| Previous | 15994 Revisions | Next |
| r1878 Sunday 9th March, 2008 at 23:29:30 UTC by Nathan Woods |
|---|
| Updated to MAME 0.123u4 core |
| [docs] | messnew.txt |
| [src/build] | png2bdc.c |
| [src/emu] | cheat.c config.c config.h cpuexec.c cpuexec.h cpuintrf.h deprecat.h devintrf.c devintrf.h drawgfx.c drawgfx.h driver.h eigccppc.h eigccx86.h emu.mak info.c inptport.c inptport.h input.c input.h mame.c mame.h mamecore.h mconfig.c mconfig.h memconv.h memory.c memory.h output.c output.h render.c render.h rendersw.c rendfont.c rendfont.h rendlay.c rendutil.c rendutil.h sound.c sound.h state.c state.h streams.c streams.h tilemap.c tilemap.h timer.c timer.h ui.c uigfx.c uimenu.c uimenu.h validity.c video.c video.h watchdog.c* watchdog.h* |
| [src/emu/cpu] | drcfe.c drcfe.h |
| [src/emu/cpu/adsp2100] | 2100ops.c adsp2100.c |
| [src/emu/cpu/alph8201] | alph8201.c |
| [src/emu/cpu/arm7] | arm7core.c arm7core.h |
| [src/emu/cpu/ccpu] | ccpu.c ccpu.h |
| [src/emu/cpu/dsp32] | dsp32.c |
| [src/emu/cpu/dsp56k] | dsp56k.c |
| [src/emu/cpu/g65816] | g65816.c g65816cm.h g65816op.h |
| [src/emu/cpu/h6280] | h6280.c |
| [src/emu/cpu/i8051] | i8051.c |
| [src/emu/cpu/i8085] | i8085.c |
| [src/emu/cpu/i86] | i86.c i86time.c |
| [src/emu/cpu/m6502] | m4510.c m6502.c m6509.c m65ce02.c ops02.h |
| [src/emu/cpu/m6800] | m6800.c |
| [src/emu/cpu/m68000] | m68kcpu.c |
| [src/emu/cpu/m6805] | m6805.c |
| [src/emu/cpu/mc68hc11] | mc68hc11.c |
| [src/emu/cpu/mips] | mdrc64.c |
| [src/emu/cpu/powerpc] | ppc.c ppc602.c ppc603.c |
| [src/emu/cpu/rsp] | rsp.c rsp.h |
| [src/emu/cpu/sh2] | sh2.c |
| [src/emu/cpu/sh4] | sh4.c |
| [src/emu/cpu/sharc] | sharcops.c |
| [src/emu/cpu/spc700] | spc700.c |
| [src/emu/cpu/tms32025] | tms32025.c |
| [src/emu/cpu/tms32031] | 32031ops.c tms32031.c |
| [src/emu/cpu/tms34010] | tms34010.c tms34010.h |
| [src/emu/cpu/tms7000] | tms7000.c |
| [src/emu/cpu/z8000] | z8000.c |
| [src/emu/cpu/z80gb] | z80gb.c z80gb.h |
| [src/emu/debug] | debugcpu.c debugcpu.h |
| [src/emu/drivers] | xtal.h |
| [src/emu/machine] | 6522via.c 6522via.h 6532riot.c 6532riot.h 6821pia.c 6821pia.h 6840ptm.c 6840ptm.h 8042kbdc.c 8237dma.c 8255ppi.c 8255ppi.h 8257dma.c laserdsc.c laserdsc.h mc146818.c msm6242.c pc16552d.c pci.c pic8259.c pit8253.c pit8253.h z80ctc.c z80ctc.h z80dma.c z80dma.h z80sio.c z80sio.h |
| [src/emu/sound] | 2151intf.c 2151intf.h 2203intf.c 2203intf.h 2413intf.c 2608intf.h 3812intf.c 3812intf.h aica.c aicalfo.c ay8910.c ay8910.h cdda.c disc_dev.c disc_flt.c disc_inp.c disc_mth.c disc_wav.c es5503.c es5503.h k053260.c k053260.h namco.c pokey.c pokey.h scsp.c sp0256.c tms5220r.c upd7759.c x1_010.c ym2151.c ym2151.h ymf271.c ymf271.h ymz280b.c ymz280b.h |
| [src/emu/video] | cdp1869.c generic.c generic.h mc6845.c mc6845.h poly.c poly.h s2636.c s2636.h tlc34076.c tms34061.c tms34061.h tms9928a.c v9938.c vector.c vooddefs.h voodoo.c voodoo.h |
| [src/lib/util] | cdrom.c chd.h png.c |
| [src/mame] | mame.mak mamedriv.c |
| [src/mame/audio] | 8080bw.c amiga.c asteroid.c atarijsa.c avalnche.c aztarac.c blockade.c bsktball.c cage.c canyon.c carnival.c cchasm.c cinemat.c circus.c crbaloon.c dcs.c dkong.c exidy.c exidy440.c firetrk.c gottlieb.c irem.c jaguar.c jedi.c leland.c llander.c m72.c mario.c mcr.c mcr.h mw8080bw.c namco54.c namcoc7x.h orbit.c phoenix.c poolshrk.c qix.c redalert.c redbaron.c rockola.c scramble.c seibu.c snes.c spiders.c starwars.c subs.c taitosnd.c toaplan2.c trackfld.c vicdual.c williams.c |
| [src/mame/drivers] | 1942.c 1943.c 1945kiii.c 20pacgal.c 2mindril.c 39in1.c 40love.c 4enraya.c 8080bw.c 88games.c acefruit.c acommand.c actfancr.c aeroboto.c aerofgt.c airbustr.c ajax.c aleck64.c alg.c aliens.c alpha68k.c ambush.c amidar.c ampoker2.c amspdwy.c angelkds.c appoooh.c aquarium.c arabian.c arcadecl.c arcadia.c argus.c arkanoid.c armedf.c ashnojoe.c asterix.c astinvad.c astrocde.c astrof.c asuka.c atarifb.c atarig1.c atarig42.c atarigt.c atarigx2.c atarisy1.c atarisy2.c atetris.c attckufo.c avalnche.c aztarac.c backfire.c badlands.c bagman.c balsente.c bankp.c baraduke.c battlane.c battlera.c battlex.c battlnts.c bbusters.c beathead.c beezer.c berzerk.c bestleag.c bfcobra.c bfm_sc2.c bigevglf.c bigfghtr.c bigstrkb.c bionicc.c bishi.c bishjan.c bking.c bladestl.c blktiger.c blmbycar.c blockade.c blockhl.c blockout.c bloodbro.c blstroid.c blueprnt.c bmcbowl.c bnstars.c bogeyman.c bombjack.c boogwing.c bottom9.c brkthru.c bsktball.c btime.c btoads.c bublbobl.c buggychl.c bwing.c cabal.c calomega.c calorie.c canyon.c capbowl.c carjmbre.c carpolo.c carrera.c cave.c cbasebal.c cbuster.c cclimber.c centiped.c chaknpop.c cham24.c champbas.c champbwl.c changela.c cheekyms.c cherrym.c cherrym2.c chinagat.c chinsan.c chqflag.c cidelsa.c cinemat.c circus.c circusc.c cischeat.c citycon.c clayshoo.c cliffhgr.c cloak.c clshroad.c cninja.c cntsteer.c coinmstr.c combatsc.c commando.c compgolf.c contra.c coolpool.c coolridr.c cop01.c cosmic.c couple.c cowrace.c cps1.c cps2.c cps3.c crbaloon.c crgolf.c crimfght.c crospang.c crshrace.c crystal.c cshooter.c csk.c cubocd32.c cultures.c cvs.c cyberbal.c cybertnk.c dacholer.c dambustr.c darius.c darkhors.c darkmist.c darkseal.c dassault.c dblewing.c dbz.c dcheese.c dcon.c ddayjlc.c ddealer.c ddenlovr.c ddragon.c ddragon3.c ddrible.c ddz.c deadang.c dec0.c dec8.c deco156.c deco32.c deco_mlc.c decocass.c deniam.c destroyr.c dgpix.c dietgo.c discoboy.c diverboy.c djboy.c djmain.c dkong.c dlair.c dmndrby.c docastle.c dogfgt.c dominob.c dooyong.c dorachan.c dotrikun.c dragrace.c dreamwld.c drgnmst.c dribling.c drmicro.c drtomy.c drw80pkr.c dunhuang.c dwarfd.c dynadice.c dynax.c dynduke.c egghunt.c enigma2.c eolith.c eolith16.c epos.c eprom.c equites.c ertictac.c esd16.c esh.c espial.c ettrivia.c exctsccr.c exedexes.c exerion.c exidy.c exidy440.c expro02.c exprraid.c exterm.c exzisus.c f-32.c f1gp.c fantland.c fastfred.c fastlane.c fcombat.c fcrash.c filetto.c finalizr.c findout.c firebeat.c firetrap.c firetrk.c fitfight.c flkatck.c flower.c flstory.c flyball.c foodf.c fortecar.c freekick.c frogger.c fromanc2.c fromance.c funkybee.c funkyjet.c funworld.c funybubl.c fuukifg2.c gaelco.c gaelco2.c gaelco3d.c gaiden.c galaga.c galaxia.c galaxian.c galivan.c galpani2.c galpani3.c galpanic.c galspnbl.c gamecstl.c gameplan.c gaplus.c gauntlet.c gberet.c gbusters.c gcpinbal.c genesis.c getrivia.c ghosteo.c gijoe.c ginganin.c gladiatr.c glass.c gng.c go2000.c goal92.c goindol.c goldstar.c gomoku.c good.c goodejan.c gotcha.c gottlieb.c gotya.c gpworld.c gradius3.c grchamp.c groundfx.c gstream.c gstriker.c gsword.c gticlub.c gtipoker.c gumbo.c gunbustr.c gundealr.c gunpey.c gunsmoke.c gyruss.c hal21.c halleys.c hanaawas.c hanaroku.c harddriv.c hcastle.c hexa.c hexion.c higemaru.c hitme.c hnayayoi.c hng64.c holeland.c homedata.c homerun.c hornet.c hotblock.c hshavoc.c hyhoo.c hyperspt.c hyprduel.c igs_180.c igs_blit.c igs_m027.c igs_m68.c ikki.c imolagp.c intrscti.c inufuku.c iqblock.c ironhors.c istellar.c itech32.c itech8.c jack.c jackal.c jackpool.c jailbrek.c jalmah.c jchan.c jcross.c jedi.c jollyjgr.c jongkyo.c jrpacman.c junofrst.c kaneko16.c kangaroo.c karnov.c kchamp.c kickgoal.c kingobox.c kingpin.c kinst.c kinstb.c klax.c kncljoe.c koikoi.c konamigq.c konamigv.c konamigx.c konamim2.c kopunch.c ksayakyu.c ksys573.c kyugo.c labyrunr.c ladybug.c ladyfrog.c laserbas.c laserbat.c lasso.c lastduel.c lastfght.c lazercmd.c legionna.c leland.c lemmings.c lethal.c lethalj.c lgp.c liberate.c liberatr.c limenko.c littlerb.c lkage.c lockon.c looping.c lordgun.c lsasquad.c ltcasino.c lucky8.c lvcards.c lwings.c m10.c m107.c m52.c m57.c m58.c m62.c m72.c m79amb.c m90.c m92.c macrossp.c macs.c madalien.c madmotor.c magic10.c magicfly.c magmax.c mainevt.c mainsnk.c mappy.c marineb.c marinedt.c mario.c markham.c marvins.c mastboy.c matmania.c maxaflex.c mayumi.c mazerbla.c mcatadv.c mcr.c mcr3.c mcr68.c meadows.c mediagx.c megadriv.c megaplay.c megasys1.c megazone.c meijinsn.c merit.c meritm.c mermaid.c metlclsh.c metro.c mexico86.c mhavoc.c micro3d.c midas.c midvunit.c midzeus.c mikie.c miniboy7.c minivadr.c mirage.c mirax.c missb2.c missile.c mitchell.c mjkjidai.c mjsister.c mjsiyoub.c mlanding.c model1.c model2.c model3.c mogura.c mole.c momoko.c moo.c mosaic.c mouser.c mpu4.c mpu4drvr.c mquake.c mrdo.c mrflea.c mrjong.c ms32.c msisaac.c mugsmash.c multigam.c munchmo.c murogem.c mustache.c mw8080bw.c mwarr.c mystston.c mystwarr.c n8080.c namcofl.c namcoic.c namcona1.c namconb1.c namcond1.c namcos1.c namcos10.c namcos11.c namcos12.c namcos2.c namcos21.c namcos22.c namcos23.c namcos86.c naomi.c naughtyb.c nbmj8688.c nbmj8891.c nbmj8991.c nbmj9195.c nemesis.c neogeo.c news.c ninjakd2.c ninjaw.c nitedrvr.c niyanpai.c nmg5.c nmk16.c nova2001.c nss.c nwk-tr.c nycaptor.c nyny.c ohmygod.c ojankohs.c olibochu.c omegrace.c oneshot.c onetwo.c opwolf.c orbit.c othldrby.c othunder.c overdriv.c pacland.c pacman.c pandoras.c panicr.c paradise.c paranoia.c parodius.c pasha2.c pass.c pastelg.c pbaction.c pcktgal.c pengo.c peplus.c pgm.c pingpong.c pipedrm.c pipeline.c pirates.c pitnrun.c pkscram.c pktgaldx.c playch10.c playmark.c plygonet.c pmpoker.c pntnpuzl.c pokechmp.c polepos.c policetr.c polyplay.c poolshrk.c pooyan.c popeye.c popper.c portrait.c powerbal.c powerins.c ppmast93.c prehisle.c progolf.c psikyo.c psikyo4.c psikyosh.c psychic5.c pturn.c puckpkmn.c punchout.c pushman.c qdrmfgp.c qix.c quantum.c quasar.c quizdna.c quizo.c quizpani.c r2dtank.c rabbit.c raiden.c raiden2.c rainbow.c rallyx.c rampart.c rastan.c rbmk.c rcasino.c rcorsair.c realbrk.c redalert.c redclash.c relief.c renegade.c retofinv.c rmhaihai.c rockola.c rockrage.c rocnrope.c rohga.c rollerg.c rollrace.c rotaryf.c route16.c royalmah.c rungun.c safarir.c sandscrp.c sangho.c sauro.c sbasketb.c sbowling.c sbugger.c scobra.c scotrsht.c scramble.c scregg.c sderby.c seattle.c segac2.c segae.c segag80r.c segag80v.c segahang.c segald.c segaorun.c segas16a.c segas16b.c segas18.c segas24.c segas32.c segaxbd.c segaybd.c seibuspi.c seicross.c sengokmj.c senjyo.c seta.c seta2.c sf.c sfkick.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 skyarmy.c skydiver.c skyfox.c skykid.c skylncr.c skyraid.c slapfght.c slapshot.c sliver.c smstrv.c snk.c snk68.c snowbros.c solomon.c sonson.c spacefb.c spaceg.c spbactn.c spcforce.c spdodgeb.c speedatk.c speedbal.c speedspn.c speglsht.c spiders.c splash.c sprcros2.c sprint2.c sprint4.c spy.c srmp2.c srmp5.c srmp6.c srumbler.c ssfindo.c sshangha.c ssingles.c sslam.c ssozumo.c sspeedr.c ssrj.c sstrangr.c ssv.c st0016.c stactics.c stadhero.c starcrus.c starfire.c starshp1.c starwars.c statriv2.c steaser.c stepstag.c stfight.c stlforce.c strnskil.c stv.c subs.c suna16.c suna8.c supbtime.c supdrapo.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 tankbust.c taotaido.c targeth.c tatsumi.c tattack.c taxidrvr.c tbowl.c tceptor.c tecmo.c tecmo16.c tecmosys.c tehkanwc.c terracre.c tetrisp2.c thayers.c thedeep.c thepit.c thief.c thoop2.c thunderj.c thunderx.c tiamc1.c tickee.c tigeroad.c timelimt.c timeplt.c tmaster.c tmnt.c tnzs.c toaplan1.c toaplan2.c toki.c topshoot.c topspeed.c toratora.c toypop.c tp84.c trackfld.c travrusa.c triplhnt.c truco.c trucocl.c trvmadns.c trvquest.c tryout.c tsamurai.c ttchamp.c tubep.c tugboat.c tumbleb.c tumblep.c tunhunt.c turbo.c turbosub.c tutankhm.c twin16.c twincobr.c twins.c uapce.c ultraman.c ultratnk.c ultrsprt.c undrfire.c unico.c upscope.c usgames.c vamphalf.c vaportra.c vastar.c vball.c vcombat.c vegaeo.c vegas.c vendetta.c vicdual.c victory.c videopin.c vigilant.c viper.c vmetal.c volfied.c vroulet.c vsnes.c vulgus.c wallc.c wardner.c warpwarp.c warriorb.c wc90.c wc90b.c wecleman.c welltris.c wgp.c wheelfir.c wilytowr.c wink.c wiping.c witch.c wiz.c wrally.c wwfsstar.c wwfwfest.c xain.c xexex.c xmen.c xorworld.c xtheball.c xxmissio.c xybots.c xyonix.c yiear.c yumefuda.c yunsun16.c yunsung8.c zac2650.c zaccaria.c zaxxon.c zerozone.c zn.c zodiack.c zr107.c |
| [src/mame/includes] | amiga.h artmagic.h atari.h btoads.h cinemat.h crbaloon.h cvs.h dc.h deco16ic.h dkong.h exidy440.h exterm.h firetrk.h grchamp.h harddriv.h jpmimpct.h kaneko16.h lethalj.h madalien.h midtunit.h midyunit.h mw8080bw.h mystston.h* namcoic.h rampart.h segas24.h snk.h stactics.h thunderj.h |
| [src/mame/machine] | ajax.c amiga.c arkanoid.c asic65.c asteroid.c atari.c atarifb.c atarigen.c atarigen.h bagman.c balsente.c beezer.c bsktball.c bublbobl.c copsnrob.c cubocd32.c daikaiju.c dc.c dec0.c decocass.c decoprot.c equites.c galaxian.c harddriv.c irobot.c kaneko16.c konamigx.c konamigx.h konppc.c konppc.h leland.c lsasquad.c mcr.c mhavoc.c midwayic.c midwunit.c midyunit.c namcoio.c namcoio.h namcos1.c namcos2.c nb1413m3.c nitedrvr.c nmk004.c nmk112.c pcshare.c playch10.c psx.c qix.c r2crypt.c scramble.c segaic16.c segaic16.h segas24.c simpsons.c slapfght.c snes.c stfight.c stvcd.c subs.c tait8741.c tait8741.h taitosj.c tatsumi.c ticket.c tnzs.c toaplan1.c vertigo.c vsnes.c williams.c |
| [src/mame/video] | 1942.c 1943.c 20pacgal.c 40love.c 8080bw.c actfancr.c aeroboto.c aerofgt.c airbustr.c alpha68k.c ambush.c amiga.c amspdwy.c angelkds.c appoooh.c aquarium.c arcadecl.c argus.c arkanoid.c armedf.c artmagic.c astrocde.c atari.c atarifb.c atarig42.c atarigt.c atarigx2.c atarimo.c atarimo.h atarirle.c atarirle.h atarisy1.c atarisy2.c avgdvg.c badlands.c bagman.c balsente.c bankp.c baraduke.c batman.c battlane.c battlera.c battlex.c bbusters.c beezer.c bigevglf.c bigstrkb.c bionicc.c bking.c blktiger.c blmbycar.c blockade.c bloodbro.c blstroid.c blueprnt.c bogeyman.c bombjack.c boogwing.c bosco.c boxer.c brkthru.c bsktball.c btime.c btoads.c buggychl.c bwing.c cabal.c calomega.c canyon.c capbowl.c carpolo.c cave.c cbasebal.c cbuster.c ccastles.c cclimber.c centiped.c chaknpop.c champbas.c changela.c cheekyms.c cinemat.c circus.c circusc.c cischeat.c citycon.c cloak.c cloud9.c clshroad.c cninja.c combatsc.c commando.c compgolf.c contra.c cop01.c cosmic.c cps1.c crbaloon.c crospang.c crshrace.c cvs.c cyberbal.c darius.c darkseal.c dassault.c dc.c dcheese.c dcon.c dday.c ddragon.c ddragon3.c ddrible.c deadang.c dec0.c dec8.c deco16ic.c deco32.c deco_mlc.c decocass.c deniam.c dietgo.c digdug.c diverboy.c djmain.c dkong.c docastle.c dogfgt.c dooyong.c drgnmst.c dynax.c dynduke.c eolith.c eprom.c equites.c esd16.c espial.c exctsccr.c exedexes.c exerion.c exidy.c exidy440.c exprraid.c exterm.c f1gp.c fantland.c fastfred.c fgoal.c firetrap.c firetrk.c fitfight.c flkatck.c flower.c flstory.c freekick.c fromance.c funkybee.c funkyjet.c funworld.c funybubl.c fuukifg2.c fuukifg3.c gaelco.c gaelco2.c gaelco3d.c gaiden.c galaga.c galaxian.c galivan.c galpani2.c galpanic.c galspnbl.c gameplan.c gaplus.c gauntlet.c gberet.c gcpinbal.c genesis.c ginganin.c gladiatr.c glass.c gng.c goal92.c goindol.c goldstar.c gomoku.c goodejan.c gotcha.c gottlieb.c gotya.c gradius3.c grchamp.c groundfx.c gstriker.c gsword.c gtia.c gticlub.c gticlub.h gunbustr.c gunsmoke.c gyruss.c harddriv.c hcastle.c higemaru.c hnayayoi.c hng64.c holeland.c homedata.c homerun.c hyhoo.c hyperspt.c hyprduel.c ikki.c inufuku.c ironhors.c itech32.c itech8.c jack.c jackal.c jaguar.c jailbrek.c jalblend.c jcross.c jedi.c jpmimpct.c kan_pand.c kan_pand.h kaneko16.c karnov.c kchamp.c kickgoal.c kingobox.c klax.c kncljoe.c konamigx.c konamiic.c konamiic.h ksayakyu.c kyugo.c ladybug.c ladyfrog.c lasso.c lastduel.c lazercmd.c legionna.c lemmings.c lethalj.c liberate.c liberatr.c lkage.c lockon.c lordgun.c lsasquad.c lwings.c m10.c m107.c m3raster.c m52.c m57.c m58.c m62.c m72.c m90.c m92.c macrossp.c madalien.c madmotor.c mainsnk.c malzak.c mappy.c mario.c markham.c marvins.c matmania.c mcatadv.c mcr.c mcr3.c mcr68.c meadows.c megasys1.c mermaid.c metlclsh.c metro.c midtunit.c midvunit.c midyunit.c midzeus.c midzeus2.c mikie.c mitchell.c mjkjidai.c mjsister.c model1.c model2.c model2rd.c model3.c momoko.c mrdo.c mrflea.c mrjong.c ms32.c msisaac.c mugsmash.c munchmo.c mustache.c mystston.c n8080.c namcofl.c namcona1.c namconb1.c namcos1.c namcos2.c namcos21.c namcos22.c namcos86.c naughtyb.c nbmj8688.c nbmj8891.c nbmj8991.c nbmj9195.c nemesis.c neogeo.c ninjakd2.c ninjaw.c nitedrvr.c niyanpai.c nmk16.c nova2001.c nycaptor.c offtwall.c ohmygod.c ojankohs.c oneshot.c orbit.c othldrby.c othunder.c pacland.c pandoras.c paradise.c pastelg.c pbaction.c pcktgal.c pgm.c phoenix.c pingpong.c pirates.c pitnrun.c pktgaldx.c playmark.c pokechmp.c polepos.c pooyan.c popeye.c popper.c portrait.c powerins.c ppu2c0x.c ppu2c0x.h prehisle.c psikyo.c psikyo4.c psikyosh.c psx.c psychic5.c punchout.c pushman.c qix.c quasar.c quizdna.c raiden.c rallyx.c rampart.c realbrk.c redclash.c relief.c renegade.c retofinv.c rockola.c rocnrope.c rohga.c route16.c rpunch.c sauro.c sbasketb.c scotrsht.c sderby.c segag80r.c segaic16.c segaic16.h segaic24.c segaic24.h segas18.c segas32.c segaybd.c seibuspi.c seicross.c sengokmj.c senjyo.c seta.c seta2.c sf.c shadfrce.c shangha3.c shangkid.c shaolins.c shootout.c shuuz.c sidearms.c sidepckt.c silkroad.c simpl156.c simpsons.c skullxbo.c skydiver.c skyfox.c skykid.c skyraid.c slapfght.c slapshot.c snes.c snk.c snk68.c solomon.c sonson.c spacefb.c spbactn.c spdodgeb.c speedbal.c speedspn.c splash.c sprcros2.c sprint2.c sprint4.c sprint8.c srmp2.c srumbler.c sshangha.c sslam.c ssozumo.c sspeedr.c ssrj.c ssv.c st0016.c stactics.c stadhero.c starcrus.c starshp1.c stfight.c stlforce.c strnskil.c stvvdp1.c stvvdp2.c subs.c suna16.c suna8.c supbtime.c superchs.c superqix.c suprloco.c suprnova.c suprslam.c system1.c system16.c tagteam.c tail2nos.c taito_b.c taito_f2.c taito_f3.c taito_h.c taito_l.c taito_z.c taitoair.c taitoic.c taitoic.h taitojc.c taitosj.c tank8.c tankbatt.c tankbust.c taotaido.c targeth.c tatsumi.c tbowl.c tceptor.c tecmo.c tecmo16.c tehkanwc.c terracre.c tetrisp2.c thedeep.c thepit.c thief.c thoop2.c thunderj.c tia.c tia.h tiamc1.c tigeroad.c timelimt.c timeplt.c tmnt.c tnzs.c toaplan1.c toaplan2.c toki.c toobin.c topspeed.c toypop.c tp84.c trackfld.c travrusa.c triplhnt.c tryout.c tsamurai.c tumbleb.c tumblep.c tunhunt.c turbo.c twin16.c twincobr.c tx1.c ultratnk.c undrfire.c unico.c usgames.c vaportra.c vastar.c vball.c vdc.c vigilant.c vindictr.c volfied.c vulgus.c warpwarp.c warriorb.c wc90.c wc90b.c wecleman.c welltris.c wgp.c wiz.c wolfpack.c wrally.c wwfsstar.c wwfwfest.c xain.c xevious.c xmen.c xorworld.c xxmissio.c xybots.c ygv608.c yiear.c yunsun16.c zac2650.c zaccaria.c zaxxon.c zodiack.c |
| [src/mess] | compcfg.c mess.mak mslegacy.c |
| [src/mess/audio] | cgenie.c dave.c intv.c mea8000.c mea8000.h pc.c |
| [src/mess/devices] | coco_fdc.c thomflop.c |
| [src/mess/drivers] | a2600.c a310.c a7800.c abc80.c abc80x.c acrnsys1.c adam.c amiga.c amstrad.c apexc.c apf.c apple1.c apple2.c aquarius.c astrocde.c at.c atari.c atarist.c avigo.c bbc.c bbcbc.c bebox.c c128.c c16.c c64.c c65.c cbmb.c cgenie.c coco.c coleco.c compis.c concept.c coupe.c crvision.c dc.c einstein.c electron.c enterp.c ex800.c exelv.c exidy.c galaxy.c gamecom.c gb.c geneve.c gmaster.c intv.c ip20.c ip22.c jupiter.c kaypro.c kc.c kim1.c lisa.c lynx.c mbee.c microtan.c mk2.c mpf1.c msx.c mtx.c n64.c nc.c nes.c osi.c p2000t.c pc.c pc8801.c pce.c pcw.c pcw16.c pdp1.c pet.c pokemini.c primo.c psx.c ql.c saturn.c sg1000.c snes.c sord.c spectrum.c ssystem3.c svi318.c svision.c ti99_2.c ti99_4p.c ti99_4x.c ti99_8.c tm990189.c tmc1800.c tmc600.c trs80.c tutor.c tx0.c vc20.c vtech2.c wswan.c x68k.c z88.c |
| [src/mess/includes] | amstr_pc.h apple2.h c128.h c16.h c64.h c65.h cbmb.h coco.h cococart.h gb.h hp48.h microtan.h pc1251.h pc1350.h pc1401.h pc1403.h pet.h svi318.h vc20tape.h |
| [src/mess/machine] | 68901mfp.c 68901mfp.h 994x_ser.c 99_dsk.c 99_hsgpl.c 99_ide.c 99_peb.c 99_peb.h 99_usbsm.c a7800.c adam.c aim65.c amigacd.c amigacrt.c amigafdc.c amigakbd.c amstr_pc.c amstrad.c apple2.c apple2gs.c apple3.c at.c atom.c bbc.c bebox.c c128.c c16.c c64.c c65.c cgenie.c coco.c coleco.c compis.c concept.c coupe.c cybiko.c dgn_beta.c europc.c gamecom.c gb.c geneve.c hp48.c i82439tx.c i8271.c ibmpc.c ins8154.c ins8154.h intv.c kaypro.c kc.c kim1.c lisa.c lviv.c lynx.c mac.c mc10.c mc6846.c mc6846.h mc6850.c mc6850.h microtan.c mpc105.c msx.c msx_slot.c mtx.c mz700.c nec765.c nes_mmc.c nes_mmc.h odyssey2.c oric.c osborne1.c pc.c pc8801.c pc_fdc.c pc_hdc.c pc_joy.c pclpt.c pet.c pmd85.c rp5c15.h sms.c spectrum.c svi318.c sym1.c thomson.c ti85.c ti99_4x.c trs80.c uart8250.c vc1541.c vc20.c vc20tape.c vectrex.c vtech2.c wd17xx.c wswan.c z80dart.c z80dart.h zx.c |
| [src/mess/video] | aim65.c amstrad.c astrocde.c cbmb.c cirrus.c coco.c gb.c kaypro.c m6847.c newport.c pc8801.c pc_aga.c pc_cga.c pc_cga.h pc_mda.c pc_t1t.c pc_vga.c pc_vga.h pc_video.c ted7360.c ted7360.h vc4000.c vectrex.c vic4567.c x68k.c |
| [src/osd] | osdcomm.h |
| [src/osd/windows] | drawd3d.c video.c |
| [src/osd/winui] | mui_audit.c |
| [src/tools] | chdman.c makemeta.c |
| r1877 | r1878 | |
|---|---|---|
| 344 | 344 | break; |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | /* print info */ | |
| 348 | // printf(" Character %X - width = %d\n", chstart, colend - colstart + 1); | |
| 349 | ||
| 350 | /* allocate a bitmap */ | |
| 351 | ch->bitmap = bitmap_alloc(colend - colstart + 1, font->height, BITMAP_FORMAT_ARGB32); | |
| 352 | if (ch->bitmap == NULL) | |
| 347 | // skip char which code is already registered | |
| 348 | if (ch->width <= 0) | |
| 353 | 349 | { |
| 354 | fprintf(stderr, "Error allocating character bitmap (%dx%d)\n", colend - colstart + 1, font->height); | |
| 355 | continue; | |
| 356 | } | |
| 350 | /* print info */ | |
| 351 | // printf(" Character %X - width = %d\n", chstart, colend - colstart + 1); | |
| 357 | 352 | |
| 358 | /* plot the character */ | |
| 359 | for (y = rowstart; y <= rowend; y++) | |
| 360 | for (x = colstart; x <= colend; x++) | |
| 361 | *BITMAP_ADDR32(ch->bitmap, y - rowstart, x - colstart) = pixel_is_set(bitmap, y, x) ? 0xffffffff : 0x00000000; | |
| 353 | /* allocate a bitmap */ | |
| 354 | ch->bitmap = bitmap_alloc(colend - colstart + 1, font->height, BITMAP_FORMAT_ARGB32); | |
| 355 | if (ch->bitmap == NULL) | |
| 356 | { | |
| 357 | fprintf(stderr, "Error allocating character bitmap (%dx%d)\n", colend - colstart + 1, font->height); | |
| 358 | continue; | |
| 359 | } | |
| 362 | 360 | |
| 363 | /* set the character parameters */ | |
| 364 | ch->width = colend - colstart + 1; | |
| 365 | ch->xoffs = 0; | |
| 366 | ch->yoffs = font->yoffs; | |
| 367 | ch->bmwidth = ch->bitmap->width; | |
| 368 | ch->bmheight = ch->bitmap->height; | |
| 361 | /* plot the character */ | |
| 362 | for (y = rowstart; y <= rowend; y++) | |
| 363 | for (x = colstart; x <= colend; x++) | |
| 364 | *BITMAP_ADDR32(ch->bitmap, y - rowstart, x - colstart) = pixel_is_set(bitmap, y, x) ? 0xffffffff : 0x00000000; | |
| 369 | 365 | |
| 366 | /* set the character parameters */ | |
| 367 | ch->width = colend - colstart + 1; | |
| 368 | ch->xoffs = 0; | |
| 369 | ch->yoffs = font->yoffs; | |
| 370 | ch->bmwidth = ch->bitmap->width; | |
| 371 | ch->bmheight = ch->bitmap->height; | |
| 372 | } | |
| 373 | ||
| 370 | 374 | /* next character */ |
| 371 | 375 | chstart++; |
| 372 | 376 | colstart = colend + 1; |
| r1877 | r1878 | |
|---|---|---|
| 22 | 22 | switch (offset & 0x61 ) |
| 23 | 23 | { |
| 24 | 24 | case 0x00: |
| 25 | coin = (input_port_3_r (offset) >> 4) & 0x7; | |
| 25 | coin = (input_port_3_r (machine, offset) >> 4) & 0x7; | |
| 26 | 26 | if (coin != 0x7) coin |= 0x8; |
| 27 | 27 | return sound_flags | coin; |
| 28 | 28 | |
| 29 | 29 | case 0x01: |
| 30 | return AY8910_read_port_0_r (offset); | |
| 30 | return AY8910_read_port_0_r (machine, offset); | |
| 31 | 31 | |
| 32 | 32 | case 0x21: |
| 33 | return AY8910_read_port_1_r (offset); | |
| 33 | return AY8910_read_port_1_r (machine, offset); | |
| 34 | 34 | |
| 35 | 35 | case 0x40: |
| 36 | return soundlatch_r (offset); | |
| 36 | return soundlatch_r (machine, offset); | |
| 37 | 37 | |
| 38 | 38 | case 0x41: |
| 39 | 39 | sound_flags &= ~0x80; |
| 40 | z80ctc_0_trg2_w (0, 0); | |
| 41 | return soundlatch2_r (offset); | |
| 40 | z80ctc_0_trg2_w (machine, 0, 0); | |
| 41 | return soundlatch2_r (machine, offset); | |
| 42 | 42 | default: |
| 43 | 43 | logerror("Read from unmapped internal IO device at 0x%x\n", offset + 0x6000); |
| 44 | 44 | return 0; |
| r1877 | r1878 | |
| 50 | 50 | switch (offset & 0x61 ) |
| 51 | 51 | { |
| 52 | 52 | case 0x00: |
| 53 | AY8910_control_port_0_w (offset, data); | |
| 53 | AY8910_control_port_0_w (machine, offset, data); | |
| 54 | 54 | break; |
| 55 | 55 | |
| 56 | 56 | case 0x01: |
| 57 | AY8910_write_port_0_w (offset, data); | |
| 57 | AY8910_write_port_0_w (machine, offset, data); | |
| 58 | 58 | break; |
| 59 | 59 | |
| 60 | 60 | case 0x20: |
| 61 | AY8910_control_port_1_w (offset, data); | |
| 61 | AY8910_control_port_1_w (machine, offset, data); | |
| 62 | 62 | break; |
| 63 | 63 | |
| 64 | 64 | case 0x21: |
| 65 | AY8910_write_port_1_w (offset, data); | |
| 65 | AY8910_write_port_1_w (machine, offset, data); | |
| 66 | 66 | break; |
| 67 | 67 | |
| 68 | 68 | case 0x40: |
| 69 | soundlatch3_w (offset, data); | |
| 69 | soundlatch3_w (machine, offset, data); | |
| 70 | 70 | break; |
| 71 | 71 | |
| 72 | 72 | case 0x41: |
| 73 | 73 | sound_flags |= 0x40; |
| 74 | soundlatch4_w (offset, data); | |
| 75 | cpunum_set_input_line(Machine, 0, 1, HOLD_LINE); | |
| 74 | soundlatch4_w (machine, offset, data); | |
| 75 | cpunum_set_input_line(machine, 0, 1, HOLD_LINE); | |
| 76 | 76 | break; |
| 77 | 77 | |
| 78 | 78 | case 0x61: |
| 79 | z80ctc_0_trg0_w (0, 0); | |
| 79 | z80ctc_0_trg0_w (machine, 0, 0); | |
| 80 | 80 | break; |
| 81 | 81 | |
| 82 | 82 | default: |
| r1877 | r1878 | |
| 94 | 94 | switch (offset & 0xf) |
| 95 | 95 | { |
| 96 | 96 | case 0: |
| 97 | soundlatch_w (offset, data); | |
| 97 | soundlatch_w (machine, offset, data); | |
| 98 | 98 | break; |
| 99 | 99 | case 1: |
| 100 | 100 | sound_flags |= 0x80; |
| 101 | soundlatch2_w (offset, data); | |
| 102 | z80ctc_0_trg2_w (0, 1); | |
| 103 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 101 | soundlatch2_w (machine, offset, data); | |
| 102 | z80ctc_0_trg2_w (machine, 0, 1); | |
| 103 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 104 | 104 | break; |
| 105 | 105 | case 2: |
| 106 | 106 | led = data; |
| r1877 | r1878 | |
| 114 | 114 | switch (offset & 0xf) |
| 115 | 115 | { |
| 116 | 116 | case 0x0: |
| 117 | return soundlatch3_r (offset) << 8; | |
| 117 | return soundlatch3_r (machine, offset) << 8; | |
| 118 | 118 | case 0x1: |
| 119 | 119 | sound_flags &= ~0x40; |
| 120 | return soundlatch4_r (offset) << 8; | |
| 120 | return soundlatch4_r (machine,offset) << 8; | |
| 121 | 121 | case 0x2: |
| 122 | return (sound_flags| (input_port_3_r (offset) & 0x07) | 0x08) << 8; | |
| 122 | return (sound_flags| (input_port_3_r (machine, offset) & 0x07) | 0x08) << 8; | |
| 123 | 123 | case 0x5: |
| 124 | return input_port_2_r (offset) << 8; | |
| 124 | return input_port_2_r (machine, offset) << 8; | |
| 125 | 125 | case 0x8: |
| 126 | return input_port_1_r (offset) << 8; | |
| 126 | return input_port_1_r (machine, offset) << 8; | |
| 127 | 127 | default: |
| 128 | 128 | return 0xff << 8; |
| 129 | 129 | } |
| r1877 | r1878 | |
| 139 | 139 | |
| 140 | 140 | static WRITE8_HANDLER( ctc_timer_1_w ) |
| 141 | 141 | { |
| 142 | ||
| 143 | 142 | if (data) /* rising edge */ |
| 144 | 143 | { |
| 145 | 144 | output[0] ^= 0x7f; |
| r1877 | r1878 | |
| 150 | 149 | |
| 151 | 150 | static WRITE8_HANDLER( ctc_timer_2_w ) |
| 152 | 151 | { |
| 153 | ||
| 154 | 152 | if (data) /* rising edge */ |
| 155 | 153 | { |
| 156 | 154 | output[1] ^= 0x7f; |
| r1877 | r1878 | |
| 171 | 169 | |
| 172 | 170 | static TIMER_CALLBACK( cchasm_sh_update ) |
| 173 | 171 | { |
| 174 | if ((input_port_3_r (0) & 0x70) != 0x70) | |
| 175 | z80ctc_0_trg0_w (0, 1); | |
| 172 | if ((input_port_3_r (machine, 0) & 0x70) != 0x70) | |
| 173 | z80ctc_0_trg0_w (machine, 0, 1); | |
| 176 | 174 | } |
| 177 | 175 | |
| 178 | 176 | SOUND_START( cchasm ) |
| r1877 | r1878 | |
|---|---|---|
| 22 | 22 | |
| 23 | 23 | WRITE8_HANDLER( qix_dac_w ) |
| 24 | 24 | { |
| 25 | discrete_sound_w(QIX_DAC_DATA, data); | |
| 25 | discrete_sound_w(machine, QIX_DAC_DATA, data); | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | WRITE8_HANDLER( qix_vol_w ) |
| 29 | 29 | { |
| 30 | discrete_sound_w(QIX_VOL_DATA, data); | |
| 30 | discrete_sound_w(machine, QIX_VOL_DATA, data); | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 |
| r1877 | r1878 | |
|---|---|---|
| 146 | 146 | |
| 147 | 147 | /* Original SPC DSP took samples 32000 times a second, which is once every |
| 148 | 148 | (1024000/32000 = 32) cycles. */ |
| 149 | #ifdef UNUSED_DEFINITION | |
| 149 | 150 | static const int TS_CYC = CPU_RATE / SAMP_FREQ; |
| 151 | #endif | |
| 150 | 152 | |
| 151 | 153 | /* Ptrs to Gaussian table */ |
| 152 | 154 | static const int *const G1 = &gauss[ 256 ]; |
| r1877 | r1878 | |
| 1226 | 1228 | case 0x2: /* Register address */ |
| 1227 | 1229 | return spc_ram[0xf2]; |
| 1228 | 1230 | case 0x3: /* Register data */ |
| 1229 | return snes_dsp_io_r( spc_ram[0xf2] ); | |
| 1231 | return snes_dsp_io_r( machine, spc_ram[0xf2] ); | |
| 1230 | 1232 | case 0x4: /* Port 0 */ |
| 1231 | 1233 | case 0x5: /* Port 1 */ |
| 1232 | 1234 | case 0x6: /* Port 2 */ |
| r1877 | r1878 | |
| 1301 | 1303 | case 0x2: /* Register address */ |
| 1302 | 1304 | break; |
| 1303 | 1305 | case 0x3: /* Register data */ |
| 1304 | snes_dsp_io_w( spc_ram[0xf2], data ); | |
| 1306 | snes_dsp_io_w( machine, spc_ram[0xf2], data ); | |
| 1305 | 1307 | break; |
| 1306 | 1308 | case 0x4: /* Port 0 */ |
| 1307 | 1309 | case 0x5: /* Port 1 */ |
| r1877 | r1878 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | #include "driver.h" |
| 146 | 146 | #include "deprecat.h" |
| 147 | #include "memconv.h" | |
| 147 | 148 | #include "includes/jaguar.h" |
| 148 | 149 | #include "cpu/jaguar/jaguar.h" |
| 149 | 150 | #include "sound/dac.h" |
| r1877 | r1878 | |
| 340 | 341 | |
| 341 | 342 | READ32_HANDLER( jaguar_jerry_regs32_r ) |
| 342 | 343 | { |
| 343 | return | |
| 344 | return | |
| 344 | 345 | } |
| 345 | 346 | |
| 346 | 347 | |
| 347 | 348 | WRITE32_HANDLER( jaguar_jerry_regs32_w ) |
| 348 | 349 | { |
| 349 | if (ACCESSING_MSW32) | |
| 350 | jaguar_jerry_regs_w(offset * 2, data >> 16, mem_mask >> 16); | |
| 351 | if (ACCESSING_LSW32) | |
| 352 | jaguar_jerry_regs_w(offset * 2 + 1, data, mem_mask); | |
| 350 | write32be_with_16be_handler(jaguar_jerry_regs_w, machine, offset, data, mem_mask); | |
| 353 | 351 | } |
| 354 | 352 | |
| 355 | 353 |
| r1877 | r1878 | |
|---|---|---|
| 179 | 179 | |
| 180 | 180 | WRITE8_HANDLER( spiders_audio_a_w ) |
| 181 | 181 | { |
| 182 | discrete_sound_w(SPIDER_WEB_SOUND_MOD_DATA, 1 + (data & 4) * 8 + (data & 2) * 4 + (data & 1) * 2); | |
| 182 | discrete_sound_w(machine, SPIDER_WEB_SOUND_MOD_DATA, 1 + (data & 4) * 8 + (data & 2) * 4 + (data & 1) * 2); | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | WRITE8_HANDLER( spiders_audio_b_w ) |
| 186 | 186 | { |
| 187 | discrete_sound_w(SPIDERS_WEB_SOUND_DATA, data); | |
| 187 | discrete_sound_w(machine, SPIDERS_WEB_SOUND_DATA, data); | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | |
| 191 | 191 | WRITE8_HANDLER( spiders_audio_ctrl_w ) |
| 192 | 192 | { |
| 193 | discrete_sound_w(SPIDERS_FIRE_EN, data & 0x10 ? 1 : 0); | |
| 194 | discrete_sound_w(SPIDERS_EXP_EN, data & 0x08 ? 1 : 0); | |
| 195 | discrete_sound_w(SPIDERS_SUPER_WEB_EXPL_EN, data & 0x04 ? 1 : 0); | |
| 196 | discrete_sound_w(SPIDERS_SUPER_WEB_EN, data & 0x02 ? 1 : 0); | |
| 197 | discrete_sound_w(SPIDERS_X_EN, data & 0x01 ? 1 : 0); | |
| 193 | discrete_sound_w(machine, SPIDERS_FIRE_EN, data & 0x10 ? 1 : 0); | |
| 194 | discrete_sound_w(machine, SPIDERS_EXP_EN, data & 0x08 ? 1 : 0); | |
| 195 | discrete_sound_w(machine, SPIDERS_SUPER_WEB_EXPL_EN, data & 0x04 ? 1 : 0); | |
| 196 | discrete_sound_w(machine, SPIDERS_SUPER_WEB_EN, data & 0x02 ? 1 : 0); | |
| 197 | discrete_sound_w(machine, SPIDERS_X_EN, data & 0x01 ? 1 : 0); | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 |
| r1877 | r1878 | |
|---|---|---|
| 387 | 387 | |
| 388 | 388 | WRITE8_HANDLER( phoenix_sound_control_a_w ) |
| 389 | 389 | { |
| 390 | discrete_sound_w(PHOENIX_EFFECT_2_DATA, data & 0x0f); | |
| 391 | discrete_sound_w(PHOENIX_EFFECT_2_FREQ, (data & 0x30) >> 4); | |
| 390 | discrete_sound_w(machine, PHOENIX_EFFECT_2_DATA, data & 0x0f); | |
| 391 | discrete_sound_w(machine, PHOENIX_EFFECT_2_FREQ, (data & 0x30) >> 4); | |
| 392 | 392 | // discrete_sound_w(PHOENIX_EFFECT_3_EN , data & 0x40); |
| 393 | 393 | // discrete_sound_w(PHOENIX_EFFECT_4_EN , data & 0x80); |
| 394 | 394 | |
| r1877 | r1878 | |
| 418 | 418 | |
| 419 | 419 | WRITE8_HANDLER( phoenix_sound_control_b_w ) |
| 420 | 420 | { |
| 421 | discrete_sound_w(PHOENIX_EFFECT_1_DATA, data & 0x0f); | |
| 422 | discrete_sound_w(PHOENIX_EFFECT_1_FILT, data & 0x20); | |
| 423 | discrete_sound_w(PHOENIX_EFFECT_1_FREQ, data & 0x10); | |
| 421 | discrete_sound_w(machine, PHOENIX_EFFECT_1_DATA, data & 0x0f); | |
| 422 | discrete_sound_w(machine, PHOENIX_EFFECT_1_FILT, data & 0x20); | |
| 423 | discrete_sound_w(machine, PHOENIX_EFFECT_1_FREQ, data & 0x10); | |
| 424 | 424 | |
| 425 | 425 | /* update the tune that the MM6221AA is playing */ |
| 426 | 426 | mm6221aa_tune_w(0, data >> 6); |
| r1877 | r1878 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | static TIMER_CALLBACK( signal_irq ) |
| 85 | 85 | { |
| 86 | amiga_custom_w(REG_INTREQ, 0x8000 | (0x80 << param), 0); | |
| 86 | amiga_custom_w(machine, REG_INTREQ, 0x8000 | (0x80 << param), 0); | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 |
| r1877 | r1878 | |
|---|---|---|
| 871 | 871 | target_pitch = 0x10000 + (target_pitch << 12); |
| 872 | 872 | |
| 873 | 873 | /* once per frame slide the pitch toward the target */ |
| 874 | if ( | |
| 874 | if (vid | |
| 875 | 875 | { |
| 876 | 876 | if (current_pitch > target_pitch) |
| 877 | 877 | current_pitch -= 300; |
| 878 | 878 | if (current_pitch < target_pitch) |
| 879 | 879 | current_pitch += 200; |
| 880 | 880 | sample_set_freq(4, current_pitch); |
| 881 | last_frame = | |
| 881 | last_frame = vid | |
| 882 | 882 | } |
| 883 | 883 | |
| 884 | 884 | /* remember the previous value */ |
| r1877 | r1878 | |
| 974 | 974 | target_volume = 0; |
| 975 | 975 | |
| 976 | 976 | /* ramp the thrust volume */ |
| 977 | if (sample_playing(2) && | |
| 977 | if (sample_playing(2) && vid | |
| 978 | 978 | { |
| 979 | 979 | if (current_volume > target_volume) |
| 980 | 980 | current_volume -= 0.078f; |
| r1877 | r1878 | |
| 984 | 984 | sample_set_volume(2, current_volume); |
| 985 | 985 | else |
| 986 | 986 | sample_stop(2); |
| 987 | last_frame = | |
| 987 | last_frame = vid | |
| 988 | 988 | } |
| 989 | 989 | |
| 990 | 990 | /* fire - falling edge */ |
| r1877 | r1878 | |
| 1251 | 1251 | target_pitch = 0x10000 + (target_pitch << 12); |
| 1252 | 1252 | |
| 1253 | 1253 | /* once per frame slide the pitch toward the target */ |
| 1254 | if ( | |
| 1254 | if (vid | |
| 1255 | 1255 | { |
| 1256 | 1256 | if (current_pitch > target_pitch) |
| 1257 | 1257 | current_pitch -= 300; |
| 1258 | 1258 | if (current_pitch < target_pitch) |
| 1259 | 1259 | current_pitch += 200; |
| 1260 | 1260 | sample_set_freq(4, current_pitch); |
| 1261 | last_frame = | |
| 1261 | last_frame = vid | |
| 1262 | 1262 | } |
| 1263 | 1263 | |
| 1264 | 1264 | /* remember the previous value */ |
| r1877 | r1878 | |
| 1363 | 1363 | target_pitch = 0x10000 + (target_pitch << 12); |
| 1364 | 1364 | |
| 1365 | 1365 | /* once per frame slide the pitch toward the target */ |
| 1366 | if ( | |
| 1366 | if (vid | |
| 1367 | 1367 | { |
| 1368 | 1368 | if (current_pitch > target_pitch) |
| 1369 | 1369 | current_pitch -= 300; |
| 1370 | 1370 | if (current_pitch < target_pitch) |
| 1371 | 1371 | current_pitch += 200; |
| 1372 | 1372 | sample_set_freq(4, current_pitch); |
| 1373 | last_frame = | |
| 1373 | last_frame = vid | |
| 1374 | 1374 | } |
| 1375 | 1375 | |
| 1376 | 1376 | /* remember the previous value */ |
| r1877 | r1878 | |
|---|---|---|
| 70 | 70 | /*78*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
| 71 | 71 | }; |
| 72 | 72 | |
| 73 | static void play_oki_sound(int game_sound, int data) | |
| 73 | static void play_oki_sound(running_machine *machine, int game_sound, int data) | |
| 74 | 74 | { |
| 75 | int status = OKIM6295_status_0_r(0); | |
| 75 | int status = OKIM6295_status_0_r(machine,0); | |
| 76 | 76 | |
| 77 | 77 | logerror("Playing sample %02x from command %02x\n",game_sound,data); |
| 78 | 78 | |
| 79 | 79 | if (game_sound != 0) |
| 80 | 80 | { |
| 81 | 81 | if ((status & 0x01) == 0) { |
| 82 | OKIM6295_data_0_w(0,(0x80 | game_sound)); | |
| 83 | OKIM6295_data_0_w(0,0x11); | |
| 82 | OKIM6295_data_0_w(machine,0,(0x80 | game_sound)); | |
| 83 | OKIM6295_data_0_w(machine,0,0x11); | |
| 84 | 84 | } |
| 85 | 85 | else if ((status & 0x02) == 0) { |
| 86 | OKIM6295_data_0_w(0,(0x80 | game_sound)); | |
| 87 | OKIM6295_data_0_w(0,0x21); | |
| 86 | OKIM6295_data_0_w(machine,0,(0x80 | game_sound)); | |
| 87 | OKIM6295_data_0_w(machine,0,0x21); | |
| 88 | 88 | } |
| 89 | 89 | else if ((status & 0x04) == 0) { |
| 90 | OKIM6295_data_0_w(0,(0x80 | game_sound)); | |
| 91 | OKIM6295_data_0_w(0,0x41); | |
| 90 | OKIM6295_data_0_w(machine,0,(0x80 | game_sound)); | |
| 91 | OKIM6295_data_0_w(machine,0,0x41); | |
| 92 | 92 | } |
| 93 | 93 | else if ((status & 0x08) == 0) { |
| 94 | OKIM6295_data_0_w(0,(0x80 | game_sound)); | |
| 95 | OKIM6295_data_0_w(0,0x81); | |
| 94 | OKIM6295_data_0_w(machine,0,(0x80 | game_sound)); | |
| 95 | OKIM6295_data_0_w(machine,0,0x81); | |
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | void dogyuun_okisnd_w(int data) | |
| 100 | void dogyuun_okisnd_w(running_machine *machine, int data) | |
| 101 | 101 | { |
| 102 | 102 | /* Need a board to determine the sound commands */ |
| 103 | 103 | // popmessage("Writing %04x to Sound CPU",data); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | void kbash_okisnd_w(int data) | |
| 106 | void kbash_okisnd_w(running_machine *machine, int data) | |
| 107 | 107 | { |
| 108 | 108 | // popmessage("Writing %04x to Sound CPU",data); |
| 109 | 109 | |
| 110 | 110 | if (data == 0) |
| 111 | 111 | { |
| 112 | OKIM6295_data_0_w(0,0x78); /* Stop playing effects */ | |
| 112 | OKIM6295_data_0_w(machine,0,0x78); /* Stop playing effects */ | |
| 113 | 113 | } |
| 114 | 114 | else if ((data > 0) && (data < 128)) |
| 115 | 115 | { |
| 116 | play_oki_sound(kbash_cmd_snd[data], data); | |
| 116 | play_oki_sound(machine, kbash_cmd_snd[data], data); | |
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | void fixeight_okisnd_w(int data) | |
| 120 | void fixeight_okisnd_w(running_machine *machine, int data) | |
| 121 | 121 | { |
| 122 | 122 | // popmessage("Writing %04x to Sound CPU",data); |
| 123 | 123 | |
| 124 | 124 | if (data == 0) |
| 125 | 125 | { |
| 126 | OKIM6295_data_0_w(0,0x78); /* Stop playing effects */ | |
| 126 | OKIM6295_data_0_w(machine,0,0x78); /* Stop playing effects */ | |
| 127 | 127 | } |
| 128 | 128 | else if ((data > 0) && (data < 128)) |
| 129 | 129 | { |
| 130 | play_oki_sound(fixeight_cmd_snd[data], data); | |
| 130 | play_oki_sound(machine, fixeight_cmd_snd[data], data); | |
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | void batsugun_okisnd_w(int data) | |
| 134 | void batsugun_okisnd_w(running_machine *machine, int data) | |
| 135 | 135 | { |
| 136 | 136 | // popmessage("Writing %04x to Sound CPU",data); |
| 137 | 137 | |
| 138 | 138 | if (data == 0) |
| 139 | 139 | { |
| 140 | OKIM6295_data_0_w(0,0x78); /* Stop playing effects */ | |
| 140 | OKIM6295_data_0_w(machine,0,0x78); /* Stop playing effects */ | |
| 141 | 141 | } |
| 142 | 142 | else if ((data > 0) && (data < 64)) |
| 143 | 143 | { |
| 144 | play_oki_sound(batsugun_cmd_snd[data], data); | |
| 144 | play_oki_sound(machine, batsugun_cmd_snd[data], data); | |
| 145 | 145 | } |
| 146 | 146 | } |
| r1877 | r1878 | |
|---|---|---|
| 82 | 82 | WRITE8_HANDLER( llander_snd_reset_w ) |
| 83 | 83 | { |
| 84 | 84 | /* Resets the LFSR that is used for the white noise generator */ |
| 85 | discrete_sound_w(LLANDER_NOISE_RESET, 0); /* Reset */ | |
| 85 | discrete_sound_w(machine, LLANDER_NOISE_RESET, 0); /* Reset */ | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | WRITE8_HANDLER( llander_sounds_w ) |
| 89 | 89 | { |
| 90 | discrete_sound_w(LLANDER_THRUST_DATA, data & 0x07); /* Thrust volume */ | |
| 91 | discrete_sound_w(LLANDER_TONE3K_EN, data & 0x10); /* Tone 3KHz enable */ | |
| 92 | discrete_sound_w(LLANDER_TONE6K_EN, data & 0x20); /* Tone 6KHz enable */ | |
| 93 | discrete_sound_w(LLANDER_EXPLOD_EN, data & 0x08); /* Explosion */ | |
| 90 | discrete_sound_w(machine, LLANDER_THRUST_DATA, data & 0x07); /* Thrust volume */ | |
| 91 | discrete_sound_w(machine, LLANDER_TONE3K_EN, data & 0x10); /* Tone 3KHz enable */ | |
| 92 | discrete_sound_w(machine, LLANDER_TONE6K_EN, data & 0x20); /* Tone 6KHz enable */ | |
| 93 | discrete_sound_w(machine, LLANDER_EXPLOD_EN, data & 0x08); /* Explosion */ | |
| 94 | 94 | } |
| 95 | 95 |
| r1877 | r1878 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | WRITE8_HANDLER( avalnche_noise_amplitude_w ) |
| 25 | 25 | { |
| 26 | discrete_sound_w(AVALNCHE_SOUNDLVL_DATA, data & 0x3f); | |
| 26 | discrete_sound_w(machine, AVALNCHE_SOUNDLVL_DATA, data & 0x3f); | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | WRITE8_HANDLER( avalnche_attract_enable_w ) |
| 31 | 31 | { |
| 32 | discrete_sound_w(AVALNCHE_ATTRACT_EN, data & 0x01); | |
| 32 | discrete_sound_w(machine, AVALNCHE_ATTRACT_EN, data & 0x01); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
| r1877 | r1878 | |
| 40 | 40 | switch (offset & 0x07) |
| 41 | 41 | { |
| 42 | 42 | case 0x00: /* AUD0 */ |
| 43 | discrete_sound_w(AVALNCHE_AUD0_EN, bit); | |
| 43 | discrete_sound_w(machine, AVALNCHE_AUD0_EN, bit); | |
| 44 | 44 | break; |
| 45 | 45 | |
| 46 | 46 | case 0x01: /* AUD1 */ |
| 47 | discrete_sound_w(AVALNCHE_AUD1_EN, bit); | |
| 47 | discrete_sound_w(machine, AVALNCHE_AUD1_EN, bit); | |
| 48 | 48 | break; |
| 49 | 49 | |
| 50 | 50 | case 0x02: /* AUD2 */ |
| 51 | 51 | default: |
| 52 | discrete_sound_w(AVALNCHE_AUD2_EN, bit); | |
| 52 | discrete_sound_w(machine, AVALNCHE_AUD2_EN, bit); | |
| 53 | 53 | break; |
| 54 | 54 | } |
| 55 | 55 | } |
| r1877 | r1878 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | WRITE8_HANDLER( canyon_motor_w ) |
| 18 | 18 | { |
| 19 | discrete_sound_w(CANYON_MOTOR1_DATA + (offset & 0x01), data & 0x0f); | |
| 19 | discrete_sound_w(machine, CANYON_MOTOR1_DATA + (offset & 0x01), data & 0x0f); | |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | WRITE8_HANDLER( canyon_explode_w ) |
| 24 | 24 | { |
| 25 | discrete_sound_w(CANYON_EXPLODE_DATA, data >> 4); | |
| 25 | discrete_sound_w(machine, CANYON_EXPLODE_DATA, data >> 4); | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | WRITE8_HANDLER( canyon_attract_w ) |
| 30 | 30 | { |
| 31 | discrete_sound_w(CANYON_ATTRACT1_EN + (offset & 0x01), offset & 0x02); | |
| 31 | discrete_sound_w(machine, CANYON_ATTRACT1_EN + (offset & 0x01), offset & 0x02); | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | WRITE8_HANDLER( canyon_whistle_w ) |
| 36 | 36 | { |
| 37 | discrete_sound_w(CANYON_WHISTLE1_EN + (offset & 0x01), offset & 0x02); | |
| 37 | discrete_sound_w(machine, CANYON_WHISTLE1_EN + (offset & 0x01), offset & 0x02); | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 |
| r1877 | r1878 | |
|---|---|---|
| 185 | 185 | switch ((data & 0x70) >> 4) |
| 186 | 186 | { |
| 187 | 187 | case 0 : /* All Off */ |
| 188 | discrete_sound_w(CIRCUS_MUSIC_BIT, 0); | |
| 188 | discrete_sound_w(machine, CIRCUS_MUSIC_BIT, 0); | |
| 189 | 189 | break; |
| 190 | 190 | |
| 191 | 191 | case 1 : /* Music */ |
| 192 | discrete_sound_w(CIRCUS_MUSIC_BIT, 1); | |
| 192 | discrete_sound_w(machine, CIRCUS_MUSIC_BIT, 1); | |
| 193 | 193 | break; |
| 194 | 194 | |
| 195 | 195 | case 2 : /* Circus = Pop; Rip Cord = Splash */ |
| r1877 | r1878 | |
| 218 | 218 | break; |
| 219 | 219 | |
| 220 | 220 | case 2: /* robotbwl */ |
| 221 | discrete_sound_w(ROBOTBWL_MUSIC_BIT, data & 0x08); /* Footsteps */ | |
| 221 | discrete_sound_w(machine, ROBOTBWL_MUSIC_BIT, data & 0x08); /* Footsteps */ | |
| 222 | 222 | |
| 223 | 223 | if (data & 0x40) /* Hit */ |
| 224 | 224 | sample_start (0, 0, 0); |
| r1877 | r1878 | |
| 243 | 243 | switch ((data & 0x70) >> 4) |
| 244 | 244 | { |
| 245 | 245 | case 0 : /* All Off */ |
| 246 | discrete_sound_w(CRASH_MUSIC_BIT, 0); | |
| 246 | discrete_sound_w(machine, CRASH_MUSIC_BIT, 0); | |
| 247 | 247 | break; |
| 248 | 248 | |
| 249 | 249 | case 1 : /* Music */ |
| 250 | discrete_sound_w(CRASH_MUSIC_BIT, 1); | |
| 250 | discrete_sound_w(machine, CRASH_MUSIC_BIT, 1); | |
| 251 | 251 | break; |
| 252 | 252 | |
| 253 | 253 | case 2 : /* Crash */ |
| r1877 | r1878 | |
| 255 | 255 | break; |
| 256 | 256 | |
| 257 | 257 | case 3 : /* Normal Video and Beep */ |
| 258 | discrete_sound_w(CRASH_BEEPER_EN, 0); | |
| 258 | discrete_sound_w(machine, CRASH_BEEPER_EN, 0); | |
| 259 | 259 | break; |
| 260 | 260 | |
| 261 | 261 | case 4 : /* Skid */ |
| 262 | 262 | break; |
| 263 | 263 | |
| 264 | 264 | case 5 : /* Invert Video and Beep */ |
| 265 | discrete_sound_w(CRASH_BEEPER_EN, 0); | |
| 265 | discrete_sound_w(machine, CRASH_BEEPER_EN, 0); | |
| 266 | 266 | break; |
| 267 | 267 | |
| 268 | 268 | case 6 : /* Hi Motor */ |
| r1877 | r1878 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | WRITE8_HANDLER( konami_SN76496_0_w ) |
| 107 | 107 | { |
| 108 | SN76496_0_w(offset, SN76496_latch); | |
| 108 | SN76496_0_w(machine, offset, SN76496_latch); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 |
| r1877 | r1878 | |
|---|---|---|
| 59 | 59 | WRITE8_HANDLER( redbaron_pokey_w ) |
| 60 | 60 | { |
| 61 | 61 | if( latch & 0x20 ) |
| 62 | pokey1_w | |
| 62 | pokey1_w | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | static void redbaron_sound_update(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int length) |
| r1877 | r1878 | |
|---|---|---|
| 208 | 208 | break; |
| 209 | 209 | |
| 210 | 210 | case 0x002: /* /RDP */ |
| 211 | result = atarigen_6502_sound_r(offset); | |
| 211 | result = atarigen_6502_sound_r(machine, offset); | |
| 212 | 212 | break; |
| 213 | 213 | |
| 214 | 214 | case 0x004: /* /RDIO */ |
| r1877 | r1878 | |
| 230 | 230 | break; |
| 231 | 231 | |
| 232 | 232 | case 0x006: /* /IRQACK */ |
| 233 | atarigen_6502_irq_ack_r(0); | |
| 233 | atarigen_6502_irq_ack_r(machine, 0); | |
| 234 | 234 | break; |
| 235 | 235 | |
| 236 | 236 | case 0x200: /* /VOICE */ |
| r1877 | r1878 | |
| 256 | 256 | break; |
| 257 | 257 | |
| 258 | 258 | case 0x006: /* /IRQACK */ |
| 259 | atarigen_6502_irq_ack_r(0); | |
| 259 | atarigen_6502_irq_ack_r(machine, 0); | |
| 260 | 260 | break; |
| 261 | 261 | |
| 262 | 262 | case 0x200: /* /VOICE */ |
| r1877 | r1878 | |
| 264 | 264 | break; |
| 265 | 265 | |
| 266 | 266 | case 0x202: /* /WRP */ |
| 267 | atarigen_6502_sound_w(offset, data); | |
| 267 | atarigen_6502_sound_w(machine, offset, data); | |
| 268 | 268 | break; |
| 269 | 269 | |
| 270 | 270 | case 0x204: /* WRIO */ |
| r1877 | r1878 | |
| 284 | 284 | int count; |
| 285 | 285 | |
| 286 | 286 | if (((data ^ last_ctl) & 0x02) && (data & 0x02)) |
| 287 | tms5220_data_w(0, speech_data); | |
| 287 | tms5220_data_w(machine, 0, speech_data); | |
| 288 | 288 | count = 5 | ((data >> 2) & 2); |
| 289 | 289 | tms5220_set_frequency(JSA_MASTER_CLOCK*2 / (16 - count)); |
| 290 | 290 | } |
| r1877 | r1878 | |
| 308 | 308 | tms5220_volume = ((data >> 6) & 3) * 100 / 3; |
| 309 | 309 | pokey_volume = ((data >> 4) & 3) * 100 / 3; |
| 310 | 310 | ym2151_volume = ((data >> 1) & 7) * 100 / 7; |
| 311 | update_all_volumes( | |
| 311 | update_all_volumes(machine); | |
| 312 | 312 | break; |
| 313 | 313 | } |
| 314 | 314 | } |
| r1877 | r1878 | |
| 329 | 329 | { |
| 330 | 330 | case 0x000: /* /RDV */ |
| 331 | 331 | if (has_oki6295) |
| 332 | result = OKIM6295_status_0_r(offset); | |
| 332 | result = OKIM6295_status_0_r(machine, offset); | |
| 333 | 333 | else |
| 334 | 334 | logerror("atarijsa: Unknown read at %04X\n", offset & 0x206); |
| 335 | 335 | break; |
| 336 | 336 | |
| 337 | 337 | case 0x002: /* /RDP */ |
| 338 | result = atarigen_6502_sound_r(offset); | |
| 338 | result = atarigen_6502_sound_r(machine, offset); | |
| 339 | 339 | break; |
| 340 | 340 | |
| 341 | 341 | case 0x004: /* /RDIO */ |
| r1877 | r1878 | |
| 356 | 356 | break; |
| 357 | 357 | |
| 358 | 358 | case 0x006: /* /IRQACK */ |
| 359 | atarigen_6502_irq_ack_r(0); | |
| 359 | atarigen_6502_irq_ack_r(machine, 0); | |
| 360 | 360 | break; |
| 361 | 361 | |
| 362 | 362 | case 0x200: /* /WRV */ |
| r1877 | r1878 | |
| 382 | 382 | break; |
| 383 | 383 | |
| 384 | 384 | case 0x006: /* /IRQACK */ |
| 385 | atarigen_6502_irq_ack_r(0); | |
| 385 | atarigen_6502_irq_ack_r(machine, 0); | |
| 386 | 386 | break; |
| 387 | 387 | |
| 388 | 388 | case 0x200: /* /WRV */ |
| 389 | 389 | if (has_oki6295) |
| 390 | OKIM6295_data_0_w(offset, data); | |
| 390 | OKIM6295_data_0_w(machine, offset, data); | |
| 391 | 391 | else |
| 392 | 392 | logerror("atarijsa: Unknown write (%02X) at %04X\n", data & 0xff, offset & 0x206); |
| 393 | 393 | break; |
| 394 | 394 | |
| 395 | 395 | case 0x202: /* /WRP */ |
| 396 | atarigen_6502_sound_w(offset, data); | |
| 396 | atarigen_6502_sound_w(machine, offset, data); | |
| 397 | 397 | break; |
| 398 | 398 | |
| 399 | 399 | case 0x204: /* /WRIO */ |
| r1877 | r1878 | |
| 429 | 429 | */ |
| 430 | 430 | ym2151_volume = ((data >> 1) & 7) * 100 / 7; |
| 431 | 431 | oki6295_volume = 50 + (data & 1) * 50; |
| 432 | update_all_volumes( | |
| 432 | update_all_volumes(machine); | |
| 433 | 433 | break; |
| 434 | 434 | } |
| 435 | 435 | } |
| r1877 | r1878 | |
| 450 | 450 | { |
| 451 | 451 | case 0x000: /* /RDV */ |
| 452 | 452 | if (has_oki6295) |
| 453 | result = OKIM6295_status_0_r(offset); | |
| 453 | result = OKIM6295_status_0_r(machine, offset); | |
| 454 | 454 | break; |
| 455 | 455 | |
| 456 | 456 | case 0x002: /* /RDP */ |
| 457 | result = atarigen_6502_sound_r(offset); | |
| 457 | result = atarigen_6502_sound_r(machine, offset); | |
| 458 | 458 | break; |
| 459 | 459 | |
| 460 | 460 | case 0x004: /* /RDIO */ |
| r1877 | r1878 | |
| 475 | 475 | break; |
| 476 | 476 | |
| 477 | 477 | case 0x006: /* /IRQACK */ |
| 478 | atarigen_6502_irq_ack_r(0); | |
| 478 | atarigen_6502_irq_ack_r(machine, 0); | |
| 479 | 479 | break; |
| 480 | 480 | |
| 481 | 481 | case 0x200: /* /WRV */ |
| r1877 | r1878 | |
| 496 | 496 | { |
| 497 | 497 | case 0x000: /* /RDV */ |
| 498 | 498 | overall_volume = data * 100 / 127; |
| 499 | update_all_volumes( | |
| 499 | update_all_volumes(machine); | |
| 500 | 500 | break; |
| 501 | 501 | |
| 502 | 502 | case 0x002: /* /RDP */ |
| r1877 | r1878 | |
| 505 | 505 | break; |
| 506 | 506 | |
| 507 | 507 | case 0x006: /* /IRQACK */ |
| 508 | atarigen_6502_irq_ack_r(0); | |
| 508 | atarigen_6502_irq_ack_r(machine, 0); | |
| 509 | 509 | break; |
| 510 | 510 | |
| 511 | 511 | case 0x200: /* /WRV */ |
| 512 | 512 | if (has_oki6295) |
| 513 | OKIM6295_data_0_w(offset, data); | |
| 513 | OKIM6295_data_0_w(machine, offset, data); | |
| 514 | 514 | break; |
| 515 | 515 | |
| 516 | 516 | case 0x202: /* /WRP */ |
| 517 | atarigen_6502_sound_w(offset, data); | |
| 517 | atarigen_6502_sound_w(machine, offset, data); | |
| 518 | 518 | break; |
| 519 | 519 | |
| 520 | 520 | case 0x204: /* /WRIO */ |
| r1877 | r1878 | |
| 561 | 561 | /* update the volumes */ |
| 562 | 562 | ym2151_volume = ((data >> 1) & 7) * 100 / 7; |
| 563 | 563 | oki6295_volume = 50 + (data & 1) * 50; |
| 564 | update_all_volumes( | |
| 564 | update_all_volumes(machine); | |
| 565 | 565 | break; |
| 566 | 566 | } |
| 567 | 567 | } |
| r1877 | r1878 | |
| 584 | 584 | if (has_oki6295) |
| 585 | 585 | { |
| 586 | 586 | if (offset & 1) |
| 587 | result = OKIM6295_status_1_r(offset); | |
| 587 | result = OKIM6295_status_1_r(machine, offset); | |
| 588 | 588 | else |
| 589 | result = OKIM6295_status_0_r(offset); | |
| 589 | result = OKIM6295_status_0_r(machine, offset); | |
| 590 | 590 | } |
| 591 | 591 | break; |
| 592 | 592 | |
| 593 | 593 | case 0x002: /* /RDP */ |
| 594 | result = atarigen_6502_sound_r(offset); | |
| 594 | result = atarigen_6502_sound_r(machine, offset); | |
| 595 | 595 | break; |
| 596 | 596 | |
| 597 | 597 | case 0x004: /* /RDIO */ |
| r1877 | r1878 | |
| 612 | 612 | break; |
| 613 | 613 | |
| 614 | 614 | case 0x006: /* /IRQACK */ |
| 615 | atarigen_6502_irq_ack_r(0); | |
| 615 | atarigen_6502_irq_ack_r(machine, 0); | |
| 616 | 616 | break; |
| 617 | 617 | |
| 618 | 618 | case 0x200: /* /WRV */ |
| r1877 | r1878 | |
| 633 | 633 | { |
| 634 | 634 | case 0x000: /* /RDV */ |
| 635 | 635 | overall_volume = data * 100 / 127; |
| 636 | update_all_volumes( | |
| 636 | update_all_volumes(machine); | |
| 637 | 637 | break; |
| 638 | 638 | |
| 639 | 639 | case 0x002: /* /RDP */ |
| r1877 | r1878 | |
| 642 | 642 | break; |
| 643 | 643 | |
| 644 | 644 | case 0x006: /* /IRQACK */ |
| 645 | atarigen_6502_irq_ack_r(0); | |
| 645 | atarigen_6502_irq_ack_r(machine, 0); | |
| 646 | 646 | break; |
| 647 | 647 | |
| 648 | 648 | case 0x200: /* /WRV */ |
| 649 | 649 | if (has_oki6295) |
| 650 | 650 | { |
| 651 | 651 | if (offset & 1) |
| 652 | OKIM6295_data_1_w(offset, data); | |
| 652 | OKIM6295_data_1_w(machine, offset, data); | |
| 653 | 653 | else |
| 654 | OKIM6295_data_0_w(offset, data); | |
| 654 | OKIM6295_data_0_w(machine, offset, data); | |
| 655 | 655 | } |
| 656 | 656 | break; |
| 657 | 657 | |
| 658 | 658 | case 0x202: /* /WRP */ |
| 659 | atarigen_6502_sound_w(offset, data); | |
| 659 | atarigen_6502_sound_w(machine, offset, data); | |
| 660 | 660 | break; |
| 661 | 661 | |
| 662 | 662 | case 0x204: /* /WRIO */ |
| r1877 | r1878 | |
| 704 | 704 | /* update the volumes */ |
| 705 | 705 | ym2151_volume = ((data >> 1) & 7) * 100 / 7; |
| 706 | 706 | oki6295_volume = 50 + (data & 1) * 50; |
| 707 | update_all_volumes( | |
| 707 | update_all_volumes(machine); | |
| 708 | 708 | break; |
| 709 | 709 | } |
| 710 | 710 | } |
| r1877 | r1878 | |
|---|---|---|
| 483 | 483 | { |
| 484 | 484 | if (LOG_COMM) |
| 485 | 485 | logerror("%06X:Data from CAGE = %04X\n", activecpu_get_pc(), data); |
| 486 | soundlatch_word_w(0, data, mem_mask); | |
| 486 | soundlatch_word_w(machine, 0, data, mem_mask); | |
| 487 | 487 | cage_to_cpu_ready = 1; |
| 488 | 488 | update_control_lines(); |
| 489 | 489 | } |
| r1877 | r1878 | |
| 503 | 503 | UINT16 main_from_cage_r(void) |
| 504 | 504 | { |
| 505 | 505 | if (LOG_COMM) |
| 506 | logerror("%06X:main read data = %04X\n", activecpu_get_pc(), soundlatch_word_r(0, 0)); | |
| 506 | logerror("%06X:main read data = %04X\n", activecpu_get_pc(), soundlatch_word_r(Machine, 0, 0)); | |
| 507 | 507 | cage_to_cpu_ready = 0; |
| 508 | 508 | update_control_lines(); |
| 509 | return soundlatch_word_r(0, 0); | |
| 509 | return soundlatch_word_r(Machine, 0, 0); | |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 |
| r1877 | r1878 | |
|---|---|---|
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | |
| 33 | void crbaloon_audio_set_music_freq(UINT8 freq) | |
| 33 | void crbaloon_audio_set_music_freq(running_machine *machine, UINT8 freq) | |
| 34 | 34 | { |
| 35 | discrete_sound_w(CRBALOON_MUSIC_DATA, freq); | |
| 35 | discrete_sound_w(machine, CRBALOON_MUSIC_DATA, freq); | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| 39 | void crbaloon_audio_set_music_enable(int enabled) | |
| 39 | void crbaloon_audio_set_music_enable(running_machine *machine, int enabled) | |
| 40 | 40 | { |
| 41 | discrete_sound_w(CRBALOON_MUSIC_EN, enabled); | |
| 41 | discrete_sound_w(machine, CRBALOON_MUSIC_EN, enabled); | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| r1877 | r1878 | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| 67 | void crbaloon_audio_set_laugh_enable(int enabled) | |
| 67 | void crbaloon_audio_set_laugh_enable(running_machine *machine, int enabled) | |
| 68 | 68 | { |
| 69 | discrete_sound_w(CRBALOON_LAUGH_EN, enabled); | |
| 69 | discrete_sound_w(machine, CRBALOON_LAUGH_EN, enabled); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 |
| r1877 | r1878 | |
|---|---|---|
| 76 | 76 | { |
| 77 | 77 | UINT8 out = (data & 0x0f); |
| 78 | 78 | if (data & 0x10) |
| 79 | discrete_sound_w(NAMCO_54XX_1_DATA, out); | |
| 79 | discrete_sound_w(machine, NAMCO_54XX_1_DATA, out); | |
| 80 | 80 | else |
| 81 | discrete_sound_w(NAMCO_54XX_0_DATA, out); | |
| 81 | discrete_sound_w(machine, NAMCO_54XX_0_DATA, out); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | static WRITE8_HANDLER( namco_54xx_R1_w ) |
| 85 | 85 | { |
| 86 | 86 | UINT8 out = (data & 0x0f); |
| 87 | 87 | |
| 88 | discrete_sound_w(NAMCO_54XX_2_DATA, out); | |
| 88 | discrete_sound_w(machine, NAMCO_54XX_2_DATA, out); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 |
| r1877 | r1878 | |
|---|---|---|
| 280 | 280 | |
| 281 | 281 | WRITE8_HANDLER( asteroid_explode_w ) |
| 282 | 282 | { |
| 283 | discrete_sound_w(ASTEROID_EXPLODE_DATA,(data&0x3c)>>2); // Volume | |
| 283 | discrete_sound_w(machine,ASTEROID_EXPLODE_DATA,(data&0x3c)>>2); // Volume | |
| 284 | 284 | /* We will modify the pitch data to send the divider value. */ |
| 285 | 285 | switch ((data&0xc0)) |
| 286 | 286 | { |
| r1877 | r1878 | |
| 297 | 297 | data = 5; |
| 298 | 298 | break; |
| 299 | 299 | } |
| 300 | discrete_sound_w(ASTEROID_EXPLODE_PITCH, data); | |
| 300 | discrete_sound_w(machine,ASTEROID_EXPLODE_PITCH, data); | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | WRITE8_HANDLER( asteroid_thump_w ) |
| 304 | 304 | { |
| 305 | discrete_sound_w(ASTEROID_THUMP_EN, data & 0x10); | |
| 306 | discrete_sound_w(ASTEROID_THUMP_DATA, data & 0x0f); | |
| 305 | discrete_sound_w(machine, ASTEROID_THUMP_EN, data & 0x10); | |
| 306 | discrete_sound_w(machine, ASTEROID_THUMP_DATA, data & 0x0f); | |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | WRITE8_HANDLER( asteroid_sounds_w ) |
| 310 | 310 | { |
| 311 | discrete_sound_w(ASTEROID_SAUCER_SND_EN + offset, data & 0x80); | |
| 311 | discrete_sound_w(machine, ASTEROID_SAUCER_SND_EN + offset, data & 0x80); | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | WRITE8_HANDLER( astdelux_sounds_w ) |
| 315 | 315 | { |
| 316 | 316 | /* Only ever activates the thrusters in Astdelux */ |
| 317 | discrete_sound_w(ASTEROID_THRUST_EN, data & 0x80); | |
| 317 | discrete_sound_w(machine, ASTEROID_THRUST_EN, data & 0x80); | |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | WRITE8_HANDLER( asteroid_noise_reset_w ) |
| 321 | 321 | { |
| 322 | discrete_sound_w(ASTEROID_NOISE_RESET, 0); | |
| 322 | discrete_sound_w(machine, ASTEROID_NOISE_RESET, 0); | |
| 323 | 323 | } |
| r1877 | r1878 | |
|---|---|---|
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | /* globals */ |
| 76 | UINT8 exidy440_sound_command; | |
| 77 | UINT8 exidy440_sound_command_ack; | |
| 76 | UINT8 *exidy440_sound_command; | |
| 77 | UINT8 exidy440_sound_command_ack; | |
| 78 | 78 | |
| 79 | 79 | /* local allocated storage */ |
| 80 | 80 | static UINT8 *sound_banks; |
| r1877 | r1878 | |
| 136 | 136 | int i, length; |
| 137 | 137 | |
| 138 | 138 | /* reset the system */ |
| 139 | exidy440_sound_command = 0; | |
| 139 | *exidy440_sound_command = 0; | |
| 140 | 140 | exidy440_sound_command_ack = 1; |
| 141 | state_save_register_global(exidy440_sound_command); | |
| 142 | 141 | state_save_register_global(exidy440_sound_command_ack); |
| 143 | 142 | |
| 144 | 143 | /* reset the 6844 */ |
| r1877 | r1878 | |
| 343 | 342 | cpunum_set_input_line(Machine, 1, 1, CLEAR_LINE); |
| 344 | 343 | exidy440_sound_command_ack = 1; |
| 345 | 344 | |
| 346 | return exidy440_sound_command; | |
| 345 | return *exidy440_sound_command; | |
| 347 | 346 | } |
| 348 | 347 | |
| 349 | 348 | |
| r1877 | r1878 | |
| 932 | 931 | |
| 933 | 932 | MDRV_CPU_ADD(M6809, EXIDY440_AUDIO_CLOCK) |
| 934 | 933 | MDRV_CPU_PROGRAM_MAP(exidy440_audio_map,0) |
| 935 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 934 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 936 | 935 | |
| 937 | 936 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 938 | 937 |
| r1877 | r1878 | |
|---|---|---|
| 63 | 63 | static UINT8 ssio_ayvolume_lookup[16]; |
| 64 | 64 | static UINT8 ssio_custom_input_mask[5]; |
| 65 | 65 | static UINT8 ssio_custom_output_mask[2]; |
| 66 | static read8_handler ssio_custom_input[5]; | |
| 67 | static write8_handler ssio_custom_output[2]; | |
| 66 | static read8_machine_func ssio_custom_input[5]; | |
| 67 | static write8_machine_func ssio_custom_output[2]; | |
| 68 | 68 | |
| 69 | 69 | /* Chip Squeak Deluxe-specific globals */ |
| 70 | 70 | static UINT8 csdeluxe_sound_cpu; |
| r1877 | r1878 | |
| 417 | 417 | UINT8 result = readinputportbytag_safe(port[offset], 0xff); |
| 418 | 418 | if (ssio_custom_input[offset]) |
| 419 | 419 | result = (result & ~ssio_custom_input_mask[offset]) | |
| 420 | ((*ssio_custom_input[offset])(offset) & ssio_custom_input_mask[offset]); | |
| 420 | ((*ssio_custom_input[offset])(machine, offset) & ssio_custom_input_mask[offset]); | |
| 421 | 421 | return result; |
| 422 | 422 | } |
| 423 | 423 | |
| r1877 | r1878 | |
| 425 | 425 | { |
| 426 | 426 | int which = offset >> 2; |
| 427 | 427 | if (which == 0) |
| 428 | mcr_control_port_w(offset, data); | |
| 428 | mcr_control_port_w(machine, offset, data); | |
| 429 | 429 | if (ssio_custom_output[which]) |
| 430 | (*ssio_custom_output[which])(offset, data & ssio_custom_output_mask[which]); | |
| 430 | (*ssio_custom_output[which])(machine, offset, data & ssio_custom_output_mask[which]); | |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | void ssio_set_custom_input(int which, int mask, read8_ | |
| 433 | void ssio_set_custom_input(int which, int mask, read8_machin | |
| 434 | 434 | { |
| 435 | 435 | ssio_custom_input[which] = handler; |
| 436 | 436 | ssio_custom_input_mask[which] = mask; |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | void ssio_set_custom_output(int which, int mask, write8_ | |
| 439 | void ssio_set_custom_output(int which, int mask, write8_machin | |
| 440 | 440 | { |
| 441 | 441 | ssio_custom_output[which/4] = handler; |
| 442 | 442 | ssio_custom_output_mask[which/4] = mask; |
| r1877 | r1878 | |
| 535 | 535 | |
| 536 | 536 | static TIMER_CALLBACK( csdeluxe_delayed_data_w ) |
| 537 | 537 | { |
| 538 | pia_0_portb_w(0, param & 0x0f); | |
| 539 | pia_0_ca1_w(0, ~param & 0x10); | |
| 538 | pia_0_portb_w(machine, 0, param & 0x0f); | |
| 539 | pia_0_ca1_w(machine, 0, ~param & 0x10); | |
| 540 | 540 | |
| 541 | 541 | /* oftentimes games will write one nibble at a time; the sync on this is very */ |
| 542 | 542 | /* important, so we boost the interleave briefly while this happens */ |
| r1877 | r1878 | |
| 550 | 550 | /* using the MOVEP instruction outputs the same value on the high and */ |
| 551 | 551 | /* low bytes. */ |
| 552 | 552 | if (ACCESSING_MSB) |
| 553 | return pia_0_alt_r(offset) << 8; | |
| 553 | return pia_0_alt_r(machine, offset) << 8; | |
| 554 | 554 | else |
| 555 | return pia_0_alt_r(offset); | |
| 555 | return pia_0_alt_r(machine, offset); | |
| 556 | 556 | } |
| 557 | 557 | |
| 558 | 558 | static WRITE16_HANDLER( csdeluxe_pia_w ) |
| 559 | 559 | { |
| 560 | 560 | if (ACCESSING_MSB) |
| 561 | pia_0_alt_w(offset, data >> 8); | |
| 561 | pia_0_alt_w(machine, offset, data >> 8); | |
| 562 | 562 | else |
| 563 | pia_0_alt_w(offset, data); | |
| 563 | pia_0_alt_w(machine, offset, data); | |
| 564 | 564 | } |
| 565 | 565 | |
| 566 | 566 | |
| r1877 | r1878 | |
| 657 | 657 | |
| 658 | 658 | static TIMER_CALLBACK( soundsgood_delayed_data_w ) |
| 659 | 659 | { |
| 660 | pia_1_portb_w(0, (param >> 1) & 0x0f); | |
| 661 | pia_1_ca1_w(0, ~param & 0x01); | |
| 660 | pia_1_portb_w(machine, 0, (param >> 1) & 0x0f); | |
| 661 | pia_1_ca1_w(machine, 0, ~param & 0x01); | |
| 662 | 662 | |
| 663 | 663 | /* oftentimes games will write one nibble at a time; the sync on this is very */ |
| 664 | 664 | /* important, so we boost the interleave briefly while this happens */ |
| r1877 | r1878 | |
| 750 | 750 | |
| 751 | 751 | static TIMER_CALLBACK( turbocs_delayed_data_w ) |
| 752 | 752 | { |
| 753 | pia_0_portb_w(0, (param >> 1) & 0x0f); | |
| 754 | pia_0_ca1_w(0, ~param & 0x01); | |
| 753 | pia_0_portb_w(machine, 0, (param >> 1) & 0x0f); | |
| 754 | pia_0_ca1_w(machine, 0, ~param & 0x01); | |
| 755 | 755 | |
| 756 | 756 | /* oftentimes games will write one nibble at a time; the sync on this is very */ |
| 757 | 757 | /* important, so we boost the interleave briefly while this happens */ |
| r1877 | r1878 | |
| 853 | 853 | /* write strobe -- pass the current command to the TMS5200 */ |
| 854 | 854 | if (((data ^ squawkntalk_tms_strobes) & 0x02) && !(data & 0x02)) |
| 855 | 855 | { |
| 856 | tms5220_data_w(offset, squawkntalk_tms_command); | |
| 856 | tms5220_data_w(machine, offset, squawkntalk_tms_command); | |
| 857 | 857 | |
| 858 | 858 | /* DoT expects the ready line to transition on a command/write here, so we oblige */ |
| 859 | pia_1_ca2_w(0, 1); | |
| 860 | pia_1_ca2_w(0, 0); | |
| 859 | pia_1_ca2_w(machine, 0, 1); | |
| 860 | pia_1_ca2_w(machine, 0, 0); | |
| 861 | 861 | } |
| 862 | 862 | |
| 863 | 863 | /* read strobe -- read the current status from the TMS5200 */ |
| 864 | 864 | else if (((data ^ squawkntalk_tms_strobes) & 0x01) && !(data & 0x01)) |
| 865 | 865 | { |
| 866 | pia_1_porta_w(0, tms5220_status_r(offset)); | |
| 866 | pia_1_porta_w(machine, 0, tms5220_status_r(machine, offset)); | |
| 867 | 867 | |
| 868 | 868 | /* DoT expects the ready line to transition on a command/write here, so we oblige */ |
| 869 | pia_1_ca2_w(0, 1); | |
| 870 | pia_1_ca2_w(0, 0); | |
| 869 | pia_1_ca2_w(machine, 0, 1); | |
| 870 | pia_1_ca2_w(machine, 0, 0); | |
| 871 | 871 | } |
| 872 | 872 | |
| 873 | 873 | /* remember the state */ |
| r1877 | r1878 | |
| 883 | 883 | |
| 884 | 884 | static TIMER_CALLBACK( squawkntalk_delayed_data_w ) |
| 885 | 885 | { |
| 886 | pia_0_porta_w(0, ~param & 0x0f); | |
| 887 | pia_0_cb1_w(0, ~param & 0x10); | |
| 886 | pia_0_porta_w(machine, 0, ~param & 0x0f); | |
| 887 | pia_0_cb1_w(machine, 0, ~param & 0x10); | |
| 888 | 888 | } |
| 889 | 889 | |
| 890 | 890 |
| r1877 | r1878 | |
|---|---|---|
| 21 | 21 | if (ACCESSING_LSB) |
| 22 | 22 | { |
| 23 | 23 | data &= 0xff; |
| 24 | soundlatch_w(offset, data); | |
| 24 | soundlatch_w(machine, offset, data); | |
| 25 | 25 | sound_status ^= 0x21; |
| 26 | 26 | if (sound_status & 0x20) |
| 27 | cpunum_set_input_line( | |
| 27 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
| r1877 | r1878 | |
| 32 | 32 | { |
| 33 | 33 | sound_status |= 0x01; |
| 34 | 34 | sound_status &= ~0x20; |
| 35 | return soundlatch_r(offset); | |
| 35 | return soundlatch_r(machine,offset); | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | READ8_HANDLER( aztarac_snd_status_r ) |
| r1877 | r1878 | |
|---|---|---|
| 266 | 266 | WRITE16_HANDLER( taitosound_port16_lsb_w ) |
| 267 | 267 | { |
| 268 | 268 | if (ACCESSING_LSB) |
| 269 | taitosound_port_w(0,data & 0xff); | |
| 269 | taitosound_port_w(machine,0,data & 0xff); | |
| 270 | 270 | } |
| 271 | 271 | WRITE16_HANDLER( taitosound_comm16_lsb_w ) |
| 272 | 272 | { |
| 273 | 273 | if (ACCESSING_LSB) |
| 274 | taitosound_comm_w(0,data & 0xff); | |
| 274 | taitosound_comm_w(machine,0,data & 0xff); | |
| 275 | 275 | } |
| 276 | 276 | READ16_HANDLER( taitosound_comm16_lsb_r ) |
| 277 | 277 | { |
| 278 | return taitosound_comm_r(0); | |
| 278 | return taitosound_comm_r(machine,0); | |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | |
| 282 | 282 | WRITE16_HANDLER( taitosound_port16_msb_w ) |
| 283 | 283 | { |
| 284 | 284 | if (ACCESSING_MSB) |
| 285 | taitosound_port_w(0,data >> 8); | |
| 285 | taitosound_port_w(machine,0,data >> 8); | |
| 286 | 286 | } |
| 287 | 287 | WRITE16_HANDLER( taitosound_comm16_msb_w ) |
| 288 | 288 | { |
| 289 | 289 | if (ACCESSING_MSB) |
| 290 | taitosound_comm_w(0,data >> 8); | |
| 290 | taitosound_comm_w(machine,0,data >> 8); | |
| 291 | 291 | } |
| 292 | 292 | READ16_HANDLER( taitosound_comm16_msb_r ) |
| 293 | 293 | { |
| 294 | return taitosound_comm_r(0) << 8; | |
| 294 | return taitosound_comm_r(machine,0) << 8; | |
| 295 | 295 | } |
| 296 | 296 |
| r1877 | r1878 | |
|---|---|---|
| 20 | 20 | READ8_HANDLER( ssio_input_port_r ); |
| 21 | 21 | WRITE8_HANDLER( ssio_output_port_w ); |
| 22 | 22 | void ssio_reset_w(int state); |
| 23 | void ssio_set_custom_input(int which, int mask, read8_handler handler); | |
| 24 | void ssio_set_custom_output(int which, int mask, write8_handler handler); | |
| 23 | void ssio_set_custom_input(int which, int mask, read8_machine_func handler); | |
| 24 | void ssio_set_custom_output(int which, int mask, write8_machine_func handler); | |
| 25 | 25 | |
| 26 | 26 | WRITE8_HANDLER( csdeluxe_data_w ); |
| 27 | 27 | READ8_HANDLER( csdeluxe_status_r ); |
| r1877 | r1878 | |
|---|---|---|
| 150 | 150 | int new_croak = data & 0x08; |
| 151 | 151 | int new_buzzz = data & 0x10; |
| 152 | 152 | |
| 153 | // discrete_sound_w(FROGS_HOP_EN, data & 0x01); | |
| 154 | // discrete_sound_w(FROGS_JUMP_EN, data & 0x02); | |
| 155 | discrete_sound_w(FROGS_TONGUE_EN, data & 0x04); | |
| 156 | // discrete_sound_w(FROGS_CAPTURE_EN, data & 0x08); | |
| 157 | // discrete_sound_w(FROGS_FLY_EN, data & 0x10); | |
| 158 | // discrete_sound_w(FROGS_SPLASH_EN, data & 0x80); | |
| 153 | // discrete_sound_w(machine, FROGS_HOP_EN, data & 0x01); | |
| 154 | // discrete_sound_w(machine, FROGS_JUMP_EN, data & 0x02); | |
| 155 | discrete_sound_w(machine, FROGS_TONGUE_EN, data & 0x04); | |
| 156 | // discrete_sound_w(machine, FROGS_CAPTURE_EN, data & 0x08); | |
| 157 | // discrete_sound_w(machine, FROGS_FLY_EN, data & 0x10); | |
| 158 | // discrete_sound_w(machine, FROGS_SPLASH_EN, data & 0x80); | |
| 159 | 159 | |
| 160 | 160 | if (data & 0x01) |
| 161 | 161 | sample_start (3, 3, 0); // Hop |
| r1877 | r1878 | |
| 447 | 447 | { |
| 448 | 448 | if (!sndti_exists(SOUND_DISCRETE, 0)) |
| 449 | 449 | return; |
| 450 | discrete_sound_w(HEADON_HISPEED_PC_EN, data & 0x01); | |
| 451 | discrete_sound_w(HEADON_SCREECH1_EN, data & 0x02); | |
| 452 | discrete_sound_w(HEADON_CRASH_EN, data & 0x04); | |
| 453 | discrete_sound_w(HEADON_HISPEED_CC_EN, data & 0x08); | |
| 454 | discrete_sound_w(HEADON_SCREECH2_EN, data & 0x10); | |
| 455 | discrete_sound_w(HEADON_BONUS_EN, data & 0x20); | |
| 456 | discrete_sound_w(HEADON_CAR_ON_EN, data & 0x40); | |
| 450 | discrete_sound_w(machine, HEADON_HISPEED_PC_EN, data & 0x01); | |
| 451 | discrete_sound_w(machine, HEADON_SCREECH1_EN, data & 0x02); | |
| 452 | discrete_sound_w(machine, HEADON_CRASH_EN, data & 0x04); | |
| 453 | discrete_sound_w(machine, HEADON_HISPEED_CC_EN, data & 0x08); | |
| 454 | discrete_sound_w(machine, HEADON_SCREECH2_EN, data & 0x10); | |
| 455 | discrete_sound_w(machine, HEADON_BONUS_EN, data & 0x20); | |
| 456 | discrete_sound_w(machine, HEADON_CAR_ON_EN, data & 0x40); | |
| 457 | 457 | |
| 458 | 458 | } |
| 459 | 459 | |
| r1877 | r1878 | |
| 461 | 461 | { |
| 462 | 462 | if (!sndti_exists(SOUND_DISCRETE, 0)) |
| 463 | 463 | return; |
| 464 | discrete_sound_w(HEADON_HISPEED_PC_EN, data & 0x10); | |
| 465 | discrete_sound_w(HEADON_SCREECH1_EN, data & 0x08); | |
| 466 | discrete_sound_w(HEADON_CRASH_EN, data & 0x80); | |
| 467 | discrete_sound_w(HEADON_HISPEED_CC_EN, data & 0x40); | |
| 468 | discrete_sound_w(HEADON_SCREECH2_EN, data & 0x04); | |
| 469 | discrete_sound_w(HEADON_BONUS_EN, data & 0x02); | |
| 470 | discrete_sound_w(HEADON_CAR_ON_EN, data & 0x20); | |
| 464 | discrete_sound_w(machine, HEADON_HISPEED_PC_EN, data & 0x10); | |
| 465 | discrete_sound_w(machine, HEADON_SCREECH1_EN, data & 0x08); | |
| 466 | discrete_sound_w(machine, HEADON_CRASH_EN, data & 0x80); | |
| 467 | discrete_sound_w(machine, HEADON_HISPEED_CC_EN, data & 0x40); | |
| 468 | discrete_sound_w(machine, HEADON_SCREECH2_EN, data & 0x04); | |
| 469 | discrete_sound_w(machine, HEADON_BONUS_EN, data & 0x02); | |
| 470 | discrete_sound_w(machine, HEADON_CAR_ON_EN, data & 0x20); | |
| 471 | 471 | |
| 472 | 472 | } |
| 473 | 473 |
| r1877 | r1878 | |
|---|---|---|
| 715 | 715 | tone_channels[2].base = 0x1000 + ((data & 0x70) << 4); |
| 716 | 716 | tone_channels[2].mask = 0xff; |
| 717 | 717 | |
| 718 | rockola_flipscreen_w(0, data); | |
| 718 | rockola_flipscreen_w(machine, 0, data); | |
| 719 | 719 | break; |
| 720 | 720 | } |
| 721 | 721 | } |
| r1877 | r1878 | |
|---|---|---|
| 38 | 38 | WRITE8_HANDLER( irem_sound_cmd_w ) |
| 39 | 39 | { |
| 40 | 40 | if ((data & 0x80) == 0) |
| 41 | soundlatch_w(0, data & 0x7f); | |
| 41 | soundlatch_w(machine, 0, data & 0x7f); | |
| 42 | 42 | else |
| 43 | cpunum_set_input_line( | |
| 43 | cpunum_set_input_line(machine, 1, 0, ASSERT_LINE); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| r1877 | r1878 | |
| 59 | 59 | |
| 60 | 60 | static WRITE8_HANDLER( m6803_port2_w ) |
| 61 | 61 | { |
| 62 | ||
| 62 | 63 | /* write latch */ |
| 63 | 64 | if ((port2 & 0x01) && !(data & 0x01)) |
| 64 | 65 | { |
| r1877 | r1878 | |
| 67 | 68 | { |
| 68 | 69 | /* PSG 0 or 1? */ |
| 69 | 70 | if (port2 & 0x08) |
| 70 | AY8910_control_port_0_w(0,port1); | |
| 71 | AY8910_control_port_0_w(machine, 0, port1); | |
| 71 | 72 | if (port2 & 0x10) |
| 72 | AY8910_control_port_1_w(0,port1); | |
| 73 | AY8910_control_port_1_w(machine, 0, port1); | |
| 73 | 74 | } |
| 74 | 75 | else |
| 75 | 76 | { |
| 76 | 77 | /* PSG 0 or 1? */ |
| 77 | 78 | if (port2 & 0x08) |
| 78 | AY8910_write_port_0_w(0,port1); | |
| 79 | AY8910_write_port_0_w(machine, 0, port1); | |
| 79 | 80 | if (port2 & 0x10) |
| 80 | AY8910_write_port_1_w(0,port1); | |
| 81 | AY8910_write_port_1_w(machine, 0, port1); | |
| 81 | 82 | } |
| 82 | 83 | } |
| 83 | 84 | port2 = data; |
| r1877 | r1878 | |
| 95 | 96 | { |
| 96 | 97 | /* PSG 0 or 1? */ |
| 97 | 98 | if (port2 & 0x08) |
| 98 | return AY8910_read_port_0_r(0); | |
| 99 | return AY8910_read_port_0_r(machine, 0); | |
| 99 | 100 | if (port2 & 0x10) |
| 100 | return AY8910_read_port_1_r(0); | |
| 101 | return AY8910_read_port_1_r(machine, 0); | |
| 101 | 102 | return 0xff; |
| 102 | 103 | } |
| 103 | 104 |
| r1877 | r1878 | |
|---|---|---|
| 12 | 12 | ***************************************************************************/ |
| 13 | 13 | WRITE8_HANDLER( bsktball_bounce_w ) |
| 14 | 14 | { |
| 15 | discrete_sound_w(BSKTBALL_CROWD_DATA, data & 0x0f); // Crowd | |
| 16 | discrete_sound_w(BSKTBALL_BOUNCE_EN, data & 0x10); // Bounce | |
| 15 | discrete_sound_w(machine, BSKTBALL_CROWD_DATA, data & 0x0f); // Crowd | |
| 16 | discrete_sound_w(machine, BSKTBALL_BOUNCE_EN, data & 0x10); // Bounce | |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | WRITE8_HANDLER( bsktball_note_w ) |
| 20 | 20 | { |
| 21 | discrete_sound_w(BSKTBALL_NOTE_DATA, data); // Note | |
| 21 | discrete_sound_w(machine, BSKTBALL_NOTE_DATA, data); // Note | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | WRITE8_HANDLER( bsktball_noise_reset_w ) |
| 25 | 25 | { |
| 26 | discrete_sound_w(BSKTBALL_NOISE_EN, offset & 0x01); | |
| 26 | discrete_sound_w(machine, BSKTBALL_NOISE_EN, offset & 0x01); | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 |
| r1877 | r1878 | |
|---|---|---|
| 1270 | 1270 | |
| 1271 | 1271 | /* handle partials */ |
| 1272 | 1272 | if (!ACCESSING_MSB) |
| 1273 | data = (i80186_internal_port_r(offset, 0) & 0xff00) | (data & 0x00ff); | |
| 1273 | data = (i80186_internal_port_r(machine, offset, 0) & 0xff00) | (data & 0x00ff); | |
| 1274 | 1274 | else if (!ACCESSING_LSB) |
| 1275 | data = (i80186_internal_port_r(offset, 0) & 0x00ff) | (data & 0xff00); | |
| 1275 | data = (i80186_internal_port_r(machine, offset, 0) & 0x00ff) | (data & 0xff00); | |
| 1276 | 1276 | |
| 1277 | 1277 | switch (offset) |
| 1278 | 1278 | { |
| r1877 | r1878 | |
| 1931 | 1931 | case 0x01: |
| 1932 | 1932 | case 0x02: |
| 1933 | 1933 | if (ACCESSING_LSB) |
| 1934 | dac_w(offset, data, 0xff00); | |
| 1934 | dac_w(machine, offset, data, 0xff00); | |
| 1935 | 1935 | return; |
| 1936 | 1936 | |
| 1937 | 1937 | case 0x03: |
| 1938 | dac_w(0, ((data << 13) & 0xe000) | ((data << 10) & 0x1c00) | ((data << 7) & 0x0300), 0x00ff); | |
| 1939 | dac_w(2, ((data << 10) & 0xe000) | ((data << 7) & 0x1c00) | ((data << 4) & 0x0300), 0x00ff); | |
| 1940 | dac_w(4, ((data << 8) & 0xc000) | ((data << 6) & 0x3000) | ((data << 4) & 0x0c00) | ((data << 2) & 0x0300), 0x00ff); | |
| 1938 | dac_w(machine, 0, ((data << 13) & 0xe000) | ((data << 10) & 0x1c00) | ((data << 7) & 0x0300), 0x00ff); | |
| 1939 | dac_w(machine, 2, ((data << 10) & 0xe000) | ((data << 7) & 0x1c00) | ((data << 4) & 0x0300), 0x00ff); | |
| 1940 | dac_w(machine, 4, ((data << 8) & 0xc000) | ((data << 6) & 0x3000) | ((data << 4) & 0x0c00) | ((data << 2) & 0x0300), 0x00ff); | |
| 1941 | 1941 | return; |
| 1942 | 1942 | } |
| 1943 | 1943 | |
| r1877 | r1878 | |
| 1972 | 1972 | return; |
| 1973 | 1973 | |
| 1974 | 1974 | case 0x21: |
| 1975 | dac_w(offset - 0x21 + 7, data, mem_mask); | |
| 1975 | dac_w(machine, offset - 0x21 + 7, data, mem_mask); | |
| 1976 | 1976 | return; |
| 1977 | 1977 | } |
| 1978 | 1978 | } |
| r1877 | r1878 | |
| 2007 | 2007 | return ((clock_active << 1) & 0x7e); |
| 2008 | 2008 | |
| 2009 | 2009 | case 1: |
| 2010 | return main_to_sound_comm_r(offset, mem_mask); | |
| 2010 | return main_to_sound_comm_r(machine, offset, mem_mask); | |
| 2011 | 2011 | |
| 2012 | 2012 | case 2: |
| 2013 | return pit8254_r(offset, mem_mask); | |
| 2013 | return pit8254_r(machine, offset, mem_mask); | |
| 2014 | 2014 | |
| 2015 | 2015 | case 3: |
| 2016 | 2016 | if (!has_ym2151) |
| 2017 | return pit8254_r(offset | 0x40, mem_mask); | |
| 2017 | return pit8254_r(machine, offset | 0x40, mem_mask); | |
| 2018 | 2018 | else |
| 2019 | return YM2151_status_port_0_lsb_r(offset, mem_mask); | |
| 2019 | return YM2151_status_port_0_lsb_r(machine, offset, mem_mask); | |
| 2020 | 2020 | |
| 2021 | 2021 | case 4: |
| 2022 | 2022 | if (is_redline) |
| 2023 | return pit8254_r(offset | 0x80, mem_mask); | |
| 2023 | return pit8254_r(machine, offset | 0x80, mem_mask); | |
| 2024 | 2024 | else |
| 2025 | 2025 | logerror("%05X:Unexpected peripheral read %d/%02X\n", activecpu_get_pc(), select, offset*2); |
| 2026 | 2026 | break; |
| r1877 | r1878 | |
| 2041 | 2041 | switch (select) |
| 2042 | 2042 | { |
| 2043 | 2043 | case 1: |
| 2044 | sound_to_main_comm_w(offset, data, mem_mask); | |
| 2044 | sound_to_main_comm_w(machine, offset, data, mem_mask); | |
| 2045 | 2045 | break; |
| 2046 | 2046 | |
| 2047 | 2047 | case 2: |
| 2048 | pit8254_w(offset, data, mem_mask); | |
| 2048 | pit8254_w(machine, offset, data, mem_mask); | |
| 2049 | 2049 | break; |
| 2050 | 2050 | |
| 2051 | 2051 | case 3: |
| 2052 | 2052 | if (!has_ym2151) |
| 2053 | pit8254_w(offset | 0x40, data, mem_mask); | |
| 2053 | pit8254_w(machine, offset | 0x40, data, mem_mask); | |
| 2054 | 2054 | else if (offset == 0) |
| 2055 | YM2151_register_port_0_lsb_w(offset, data, mem_mask); | |
| 2055 | YM2151_register_port_0_lsb_w(machine, offset, data, mem_mask); | |
| 2056 | 2056 | else if (offset == 1) |
| 2057 | YM2151_data_port_0_lsb_w(offset, data, mem_mask); | |
| 2057 | YM2151_data_port_0_lsb_w(machine, offset, data, mem_mask); | |
| 2058 | 2058 | break; |
| 2059 | 2059 | |
| 2060 | 2060 | case 4: |
| 2061 | 2061 | if (is_redline) |
| 2062 | pit8254_w(offset | 0x80, data, mem_mask); | |
| 2062 | pit8254_w(machine, offset | 0x80, data, mem_mask); | |
| 2063 | 2063 | else |
| 2064 | dac_10bit_w(offset, data, mem_mask); | |
| 2064 | dac_10bit_w(machine, offset, data, mem_mask); | |
| 2065 | 2065 | break; |
| 2066 | 2066 | |
| 2067 | 2067 | case 5: /* Ataxx/WSF/Indy Heat only */ |
| 2068 | ataxx_dac_control(offset, data, mem_mask); | |
| 2068 | ataxx_dac_control(machine, offset, data, mem_mask); | |
| 2069 | 2069 | break; |
| 2070 | 2070 | |
| 2071 | 2071 | default: |
| r1877 | r1878 | |
| 2089 | 2089 | ((data & 0x02) << 5) | |
| 2090 | 2090 | ((data & 0x04) << 3) | |
| 2091 | 2091 | ((data & 0x08) << 1); |
| 2092 | leland_80186_control_w(offset, modified); | |
| 2092 | leland_80186_control_w(machine, offset, modified); | |
| 2093 | 2093 | } |
| 2094 | 2094 | |
| 2095 | 2095 |
| r1877 | r1878 | |
|---|---|---|
| 274 | 274 | break; |
| 275 | 275 | |
| 276 | 276 | case PSG_BC_WRITE: |
| 277 | AY8910_write_port_0_w( 0, psgData ); | |
| 277 | AY8910_write_port_0_w( machine, 0, psgData ); | |
| 278 | 278 | break; |
| 279 | 279 | |
| 280 | 280 | case PSG_BC_LATCH_ADDRESS: |
| 281 | AY8910_control_port_0_w( 0, psgData ); | |
| 281 | AY8910_control_port_0_w( machine, 0, psgData ); | |
| 282 | 282 | break; |
| 283 | 283 | } |
| 284 | 284 | } |
| r1877 | r1878 | |
|---|---|---|
| 158 | 158 | |
| 159 | 159 | WRITE8_HANDLER( poolshrk_scratch_sound_w ) |
| 160 | 160 | { |
| 161 | discrete_sound_w(POOLSHRK_SCRATCH_SND, offset & 1); | |
| 161 | discrete_sound_w(machine, POOLSHRK_SCRATCH_SND, offset & 1); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | WRITE8_HANDLER( poolshrk_score_sound_w ) |
| 165 | 165 | { |
| 166 | discrete_sound_w(POOLSHRK_SCORE_EN, 1); /* this will trigger the sound code for 1 sample */ | |
| 166 | discrete_sound_w(machine, POOLSHRK_SCORE_EN, 1); /* this will trigger the sound code for 1 sample */ | |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | WRITE8_HANDLER( poolshrk_click_sound_w ) |
| 170 | 170 | { |
| 171 | discrete_sound_w(POOLSHRK_CLICK_EN, 1); /* this will trigger the sound code for 1 sample */ | |
| 171 | discrete_sound_w(machine, POOLSHRK_CLICK_EN, 1); /* this will trigger the sound code for 1 sample */ | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | WRITE8_HANDLER( poolshrk_bump_sound_w ) |
| 175 | 175 | { |
| 176 | discrete_sound_w(POOLSHRK_BUMP_EN, offset & 1); | |
| 176 | discrete_sound_w(machine, POOLSHRK_BUMP_EN, offset & 1); | |
| 177 | 177 | } |
| r1877 | r1878 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 3 | 2 | #include "cpu/i8039/i8039.h" |
| 4 | 3 | #include "cpu/m6502/m6502.h" |
| 5 | 4 | #include "sound/nes_apu.h" |
| r1877 | r1878 | |
| 36 | 35 | |
| 37 | 36 | /* Needed for dkongjr ... FIXME */ |
| 38 | 37 | //#define I8035_T_R(N) ((portT >> (N)) & 1) |
| 39 | #define I8035_T_R(N) ((soundlatch2_r(0) >> (N)) & 1) | |
| 40 | #define I8035_T_W_AL(N,D) do { state->portT = ACTIVELOW_PORT_BIT(state->portT,N,D); soundlatch2_w(0, state->portT); } while (0) | |
| 38 | #define I8035_T_R(M,N) ((soundlatch2_r(machine,0) >> (N)) & 1) | |
| 39 | #define I8035_T_W_AL(M,N,D) do { state->portT = ACTIVELOW_PORT_BIT(state->portT,N,D); soundlatch2_w(machine, 0, state->portT); } while (0) | |
| 41 | 40 | |
| 42 | #define I8035_P1_R() (soundlatch3_r(0)) | |
| 43 | #define I8035_P2_R() (soundlatch4_r(0)) | |
| 44 | #define I8035_P1_W(D) soundlatch3_w(0,D) | |
| 45 | #define I8035_P2_W(D) soundlatch4_w(0,D) | |
| 41 | #define I8035_P1_R(M) (soundlatch3_r(M,0)) | |
| 42 | #define I8035_P2_R(M) (soundlatch4_r(M,0)) | |
| 43 | #define I8035_P1_W(M,D) soundlatch3_w(M,0,D) | |
| 44 | #define I8035_P2_W(M,D) soundlatch4_w(M,0,D) | |
| 46 | 45 | |
| 47 | #define I8035_P1_W_AL(B,D) I8035_P1_W(ACTIVELOW_PORT_BIT(I8035_P1_R(),B,(D))) | |
| 48 | #define I8035_P2_W_AL(B,D) I8035_P2_W(ACTIVELOW_PORT_BIT(I8035_P2_R(),B,(D))) | |
| 46 | #define I8035_P1_W_AL(M,B,D) I8035_P1_W(M,ACTIVELOW_PORT_BIT(I8035_P1_R(M),B,(D))) | |
| 47 | #define I8035_P2_W_AL(M,B,D) I8035_P2_W(M,ACTIVELOW_PORT_BIT(I8035_P2_R(M),B,(D))) | |
| 49 | 48 | |
| 50 | 49 | |
| 51 | 50 | /**************************************************************** |
| r1877 | r1878 | |
| 331 | 330 | DISCRETE_INVERTER_OSC(NODE_51,1,0,DK_R47,DK_R48,DK_C30,0,&dkong_inverter_osc_desc_walk) |
| 332 | 331 | |
| 333 | 332 | DISCRETE_TRANSFORM3(NODE_52,1,DS_SOUND0,DK_R46,R_SERIE(DK_R44,DK_R45),"01*2+") |
| 334 | DISCRETE_MIXER4(NODE_54, 1, NODE_50, NODE_51, DK_SUP_V, 0,&dkong_rc_ | |
| 333 | DISCRETE_MIXER4(NODE_54, 1, NODE_50, NODE_51, DK_SUP_V, 0,&dkong_rc_walk_desc) | |
| 335 | 334 | |
| 336 | 335 | /* 555 Voltage controlled */ |
| 337 | 336 | DISCRETE_555_ASTABLE_CV(NODE_55, 1, RES_K(47), RES_K(27), CAP_N(33), NODE_54, &dkong_555_vco_desc) |
| r1877 | r1878 | |
| 499 | 498 | * For the walk circuit, the voltage does not matter */ |
| 500 | 499 | |
| 501 | 500 | static const discrete_555_desc radarscp_555_vco_desc = |
| 502 | {DISC_555_OUT_DC | DISC_555_OUT_ | |
| 501 | {DISC_555_OUT_DC | DISC_555_OUT_ENERGY, | |
| 503 | 502 | DK_SUP_V, |
| 504 | 503 | DK_SUP_V-0.5,DK_SUP_V*0.66,DK_SUP_V*0.33 |
| 505 | 504 | }; |
| r1877 | r1878 | |
| 589 | 588 | DISCRETE_MIXER3(NODE_42, 1, NODE_41, DK_SUP_V, 0,&radarscp_mixer_desc_0) |
| 590 | 589 | |
| 591 | 590 | /* 555 Voltage controlled */ |
| 592 | DISCRETE_555_ASTABLE_CV(NODE_43, DS_SOUND6, RES_K(47), RES_K(27), RS_C49, NODE_42, &d | |
| 591 | DISCRETE_555_ASTABLE_CV(NODE_43, DS_SOUND6, RES_K(47), RES_K(27), RS_C49, NODE_42, &radarscp_555_vco_desc) | |
| 593 | 592 | |
| 594 | 593 | DISCRETE_RCDISC_MODULATED(NODE_44,1,DS_SOUND0_INV,NODE_43,RS_R39,RS_R18,RS_R37,RS_R38,RS_C22,DK_SUP_V) |
| 595 | 594 | DISCRETE_CRFILTER(NODE_45, 1, NODE_44, RS_R15+RS_R16, RS_C33) |
| r1877 | r1878 | |
| 605 | 604 | |
| 606 | 605 | DISCRETE_MIXER3(NODE_53, 1, NODE_51, DK_SUP_V, 0,&radarscp_mixer_desc_7) |
| 607 | 606 | /* 555 Voltage controlled */ |
| 608 | DISCRETE_555_ASTABLE_CV(NODE_54, DS_SOUND7, RES_K(47), RES_K(27), RS_C48, NODE_53, &d | |
| 607 | DISCRETE_555_ASTABLE_CV(NODE_54, DS_SOUND7, RES_K(47), RES_K(27), RS_C48, NODE_53, &radarscp_555_vco_desc) | |
| 609 | 608 | |
| 610 | 609 | DISCRETE_RCINTEGRATE(NODE_55,1,NODE_52,RS_R46, RS_R46,0,RS_C45,DK_SUP_V,DISC_RC_INTEGRATE_TYPE1) |
| 611 | 610 | DISCRETE_TRANSFORM4(NODE_56, 1, NODE_55, DS_SOUND7,NODE_54,2.5, "01*23<*") |
| r1877 | r1878 | |
| 895 | 894 | state->page = 0x47; |
| 896 | 895 | state->portT = 0; |
| 897 | 896 | |
| 898 | I8035_T_W_AL(0,0); | |
| 899 | I8035_T_W_AL(1,0); | |
| 900 | I8035_P1_W(0xFF); | |
| 901 | I8035_P2_W(0xFF); | |
| 902 | soundlatch_w(0,0x0F); | |
| 897 | I8035_T_W_AL(machine,0,0); | |
| 898 | I8035_T_W_AL(machine,1,0); | |
| 899 | I8035_P1_W(machine,0xFF); | |
| 900 | I8035_P2_W(machine,0xFF); | |
| 901 | soundlatch_w(machine,0,0x0F); | |
| 903 | 902 | } |
| 904 | 903 | |
| 905 | 904 | static SOUND_RESET( dkongjr ) |
| 906 | 905 | { |
| 907 | 906 | SOUND_RESET_CALL(dkong); |
| 908 | soundlatch_w(0,0x00); | |
| 907 | soundlatch_w(machine,0,0x00); | |
| 909 | 908 | } |
| 910 | 909 | |
| 911 | 910 | /**************************************************************** |
| r1877 | r1878 | |
| 1004 | 1003 | { |
| 1005 | 1004 | logerror("PA Write %x\n", data); |
| 1006 | 1005 | |
| 1007 | tms5110_CTL_w(0, data & 0x0f); | |
| 1008 | tms5110_PDC_w(0, (data>>4) & 0x01); | |
| 1006 | tms5110_CTL_w(machine, 0, data & 0x0f); | |
| 1007 | tms5110_PDC_w(machine, 0, (data>>4) & 0x01); | |
| 1009 | 1008 | // FIXME 0x20 is CS |
| 1010 | 1009 | } |
| 1011 | 1010 | |
| r1877 | r1878 | |
| 1017 | 1016 | |
| 1018 | 1017 | static READ8_HANDLER( dkong_sh_p1_r ) |
| 1019 | 1018 | { |
| 1020 | return I8035_P1_R(); | |
| 1019 | return I8035_P1_R(machine); | |
| 1021 | 1020 | } |
| 1022 | 1021 | |
| 1023 | 1022 | static READ8_HANDLER( dkong_sh_p2_r ) |
| 1024 | 1023 | { |
| 1025 | return I8035_P2_R(); | |
| 1024 | return I8035_P2_R(machine); | |
| 1026 | 1025 | } |
| 1027 | 1026 | |
| 1028 | 1027 | static READ8_HANDLER( dkong_sh_t0_r ) |
| 1029 | 1028 | { |
| 1030 | return I8035_T_R(0); | |
| 1029 | return I8035_T_R(machine,0); | |
| 1031 | 1030 | } |
| 1032 | 1031 | |
| 1033 | 1032 | static READ8_HANDLER( dkong_sh_t1_r ) |
| 1034 | 1033 | { |
| 1035 | return I8035_T_R(1); | |
| 1034 | return I8035_T_R(machine,1); | |
| 1036 | 1035 | } |
| 1037 | 1036 | |
| 1038 | 1037 | static WRITE8_HANDLER( dkong_voice_w ) |
| r1877 | r1878 | |
| 1053 | 1052 | |
| 1054 | 1053 | static READ8_HANDLER( dkong_sh_tune_r ) |
| 1055 | 1054 | { |
| 1056 | dkong_state *state = | |
| 1055 | dkong_state *state = machine->driver_data; | |
| 1057 | 1056 | UINT8 *SND = memory_region(REGION_CPU2); |
| 1058 | 1057 | |
| 1059 | 1058 | if ( state->page & 0x40 ) |
| 1060 | 1059 | { |
| 1061 | return (soundlatch_r(0) & 0x0F) | (dkong_voice_status_r(0)<<4); | |
| 1060 | return (soundlatch_r(machine,0) & 0x0F) | (dkong_voice_status_r(machine,0)<<4); | |
| 1062 | 1061 | } |
| 1063 | 1062 | else |
| 1064 | 1063 | { |
| r1877 | r1878 | |
| 1069 | 1068 | |
| 1070 | 1069 | static READ8_HANDLER( dkongjr_sh_tune_r ) |
| 1071 | 1070 | { |
| 1072 | return soundlatch_r(0) & 0x01F; | |
| 1071 | return soundlatch_r(machine,0) & 0x01F; | |
| 1073 | 1072 | } |
| 1074 | 1073 | |
| 1075 | 1074 | static WRITE8_HANDLER( dkong_sh_p1_w ) |
| 1076 | 1075 | { |
| 1077 | discrete_sound_w(DS_DAC,data); | |
| 1076 | discrete_sound_w(machine,DS_DAC,data); | |
| 1078 | 1077 | } |
| 1079 | 1078 | |
| 1080 | 1079 | |
| r1877 | r1878 | |
| 1082 | 1081 | { |
| 1083 | 1082 | int r; |
| 1084 | 1083 | |
| 1085 | r = (I8035_P1_R() & 0x80) | (tms5110_status_r(0)<<6); | |
| 1084 | r = (I8035_P1_R(machine) & 0x80) | (tms5110_status_r(machine,0)<<6); | |
| 1086 | 1085 | return r; |
| 1087 | 1086 | } |
| 1088 | 1087 | |
| 1089 | 1088 | static WRITE8_HANDLER( dkong_sh_p2_w ) |
| 1090 | 1089 | { |
| 1091 | dkong_state *state = | |
| 1090 | dkong_state *state = machine->driver_data; | |
| 1092 | 1091 | |
| 1093 | 1092 | /* If P2.Bit7 -> is apparently an external signal decay or other output control |
| 1094 | 1093 | * If P2.Bit6 -> activates the external compressed sample ROM (not radarsc1) |
| r1877 | r1878 | |
| 1098 | 1097 | */ |
| 1099 | 1098 | |
| 1100 | 1099 | state->mcustatus = ((~data & 0x10) >> 4); |
| 1101 | radarsc1_ansn_w(0, (data & 0x20) >> 5); | |
| 1100 | radarsc1_ansn_w(machine, 0, (data & 0x20) >> 5); | |
| 1102 | 1101 | state->page = (data & 0x47); |
| 1103 | 1102 | |
| 1104 | discrete_sound_w(DS_DAC_DISCHARGE, (data & 0x80) ? 0 : 1 ); | |
| 1103 | discrete_sound_w(machine,DS_DAC_DISCHARGE, (data & 0x80) ? 0 : 1 ); | |
| 1105 | 1104 | } |
| 1106 | 1105 | |
| 1107 | 1106 | |
| r1877 | r1878 | |
| 1113 | 1112 | |
| 1114 | 1113 | WRITE8_HANDLER( dkongjr_sh_test6_w ) |
| 1115 | 1114 | { |
| 1116 | I8035_P2_W_AL(6,data & 1); | |
| 1115 | I8035_P2_W_AL(machine,6,data & 1); | |
| 1117 | 1116 | } |
| 1118 | 1117 | |
| 1119 | 1118 | |
| 1120 | 1119 | WRITE8_HANDLER( dkongjr_sh_tuneselect_w ) |
| 1121 | 1120 | { |
| 1122 | soundlatch_w(offset,data); | |
| 1121 | soundlatch_w(machine,offset,data); | |
| 1123 | 1122 | } |
| 1124 | 1123 | |
| 1125 | 1124 | READ8_HANDLER( dkong_audio_status_r ) |
| 1126 | 1125 | { |
| 1127 | dkong_state *state = | |
| 1126 | dkong_state *state = machine->driver_data; | |
| 1128 | 1127 | |
| 1129 | 1128 | return state->mcustatus; |
| 1130 | 1129 | } |
| r1877 | r1878 | |
| 1132 | 1131 | WRITE8_HANDLER( dkong_audio_irq_w ) |
| 1133 | 1132 | { |
| 1134 | 1133 | if (data) |
| 1135 | cpunum_set_input_line( | |
| 1134 | cpunum_set_input_line(machine, 1, 0, ASSERT_LINE); | |
| 1136 | 1135 | else |
| 1137 | cpunum_set_input_line( | |
| 1136 | cpunum_set_input_line(machine, 1, 0, CLEAR_LINE); | |
| 1138 | 1137 | } |
| 1139 | 1138 | |
| 1140 | 1139 | WRITE8_HANDLER( dkong_snd_disc_w ) |
| 1141 | 1140 | { |
| 1142 | dkong_state *state = | |
| 1141 | dkong_state *state = machine->driver_data; | |
| 1143 | 1142 | |
| 1144 | 1143 | switch (offset) |
| 1145 | 1144 | { |
| 1146 | 1145 | case 0: |
| 1147 | discrete_sound_w(DS_SOUND0_INP,data & 1); | |
| 1146 | discrete_sound_w(machine,DS_SOUND0_INP,data & 1); | |
| 1148 | 1147 | break; |
| 1149 | 1148 | case 1: |
| 1150 | discrete_sound_w(DS_SOUND1_INP,data & 1); | |
| 1149 | discrete_sound_w(machine,DS_SOUND1_INP,data & 1); | |
| 1151 | 1150 | break; |
| 1152 | 1151 | case 2: |
| 1153 | discrete_sound_w(DS_SOUND2_INP,data & 1); | |
| 1154 | radarscp_snd02_w(0, data & 1); | |
| 1152 | discrete_sound_w(machine,DS_SOUND2_INP,data & 1); | |
| 1153 | radarscp_snd02_w(machine, 0, data & 1); | |
| 1155 | 1154 | break; |
| 1156 | 1155 | case 3: |
| 1157 | 1156 | if (state->hardware_type == HARDWARE_TRS01) |
| 1158 | 1157 | //SOUND3 ==> PA7 |
| 1159 | I8035_P1_W_AL(7,data & 1); | |
| 1158 | I8035_P1_W_AL(machine,7,data & 1); | |
| 1160 | 1159 | else |
| 1161 | I8035_P2_W_AL(5,data & 1); | |
| 1160 | I8035_P2_W_AL(machine,5,data & 1); | |
| 1162 | 1161 | break; |
| 1163 | 1162 | case 4: |
| 1164 | I8035_T_W_AL(1, data & 1); | |
| 1163 | I8035_T_W_AL(machine, 1, data & 1); | |
| 1165 | 1164 | break; |
| 1166 | 1165 | case 5: |
| 1167 | I8035_T_W_AL(0, data & 1); | |
| 1166 | I8035_T_W_AL(machine, 0, data & 1); | |
| 1168 | 1167 | break; |
| 1169 | 1168 | case 6: |
| 1170 | discrete_sound_w(DS_SOUND6_INP,data & 1); | |
| 1169 | discrete_sound_w(machine,DS_SOUND6_INP,data & 1); | |
| 1171 | 1170 | break; |
| 1172 | 1171 | case 7: |
| 1173 | discrete_sound_w(DS_SOUND7_INP,data & 1); | |
| 1172 | discrete_sound_w(machine,DS_SOUND7_INP,data & 1); | |
| 1174 | 1173 | break; |
| 1175 | 1174 | } |
| 1176 | 1175 | return; |
| r1877 | r1878 | |
| 1178 | 1177 | |
| 1179 | 1178 | WRITE8_HANDLER( dkong_sh_tuneselect_w ) |
| 1180 | 1179 | { |
| 1181 | soundlatch_w(offset,data ^ 0x0f); | |
| 1180 | soundlatch_w(machine,offset,data ^ 0x0f); | |
| 1182 | 1181 | } |
| 1183 | 1182 | |
| 1184 | 1183 | WRITE8_HANDLER( dkongjr_snd_w1 ) |
| 1185 | 1184 | { |
| 1186 | dkong_state *state = | |
| 1185 | dkong_state *state = machine->driver_data; | |
| 1187 | 1186 | |
| 1188 | 1187 | switch (offset) |
| 1189 | 1188 | { |
| 1190 | 1189 | case 0: /* climb */ |
| 1191 | discrete_sound_w(DS_SOUND0_INP,data & 1); | |
| 1190 | discrete_sound_w(machine,DS_SOUND0_INP,data & 1); | |
| 1192 | 1191 | break; |
| 1193 | 1192 | case 1: /* jump */ |
| 1194 | discrete_sound_w(DS_SOUND1_INP,data & 1); | |
| 1193 | discrete_sound_w(machine,DS_SOUND1_INP,data & 1); | |
| 1195 | 1194 | break; |
| 1196 | 1195 | case 2: /* land */ |
| 1197 | discrete_sound_w(DS_SOUND2_INP,data & 1); | |
| 1196 | discrete_sound_w(machine,DS_SOUND2_INP,data & 1); | |
| 1198 | 1197 | break; |
| 1199 | 1198 | case 3: /* Port 3 write ==> PB 5 */ |
| 1200 | I8035_P2_W_AL(5,data & 1); | |
| 1199 | I8035_P2_W_AL(machine,5,data & 1); | |
| 1201 | 1200 | break; |
| 1202 | 1201 | case 4: /* Port 4 write */ |
| 1203 | I8035_T_W_AL(1, data & 1); | |
| 1202 | I8035_T_W_AL(machine,1, data & 1); | |
| 1204 | 1203 | break; |
| 1205 | 1204 | case 5: /* Port 5 write */ |
| 1206 | I8035_T_W_AL(0, data & 1); | |
| 1205 | I8035_T_W_AL(machine,0, data & 1); | |
| 1207 | 1206 | break; |
| 1208 | 1207 | case 6: /* Port 6 write ==> PB 4 */ |
| 1209 | I8035_P2_W_AL(4,data & 1); | |
| 1208 | I8035_P2_W_AL(machine,4,data & 1); | |
| 1210 | 1209 | break; |
| 1211 | 1210 | case 7: /* walk */ |
| 1212 | discrete_sound_w(DS_SOUND7_INP,data & 1); | |
| 1211 | discrete_sound_w(machine,DS_SOUND7_INP,data & 1); | |
| 1213 | 1212 | break; |
| 1214 | 1213 | } |
| 1215 | 1214 | } |
| r1877 | r1878 | |
| 1219 | 1218 | switch (offset) |
| 1220 | 1219 | { |
| 1221 | 1220 | case 0: /* S9 - drop */ |
| 1222 | discrete_sound_w(DS_SOUND9_INP,data & 1); | |
| 1221 | discrete_sound_w(machine,DS_SOUND9_INP,data & 1); | |
| 1223 | 1222 | break; |
| 1224 | 1223 | } |
| 1225 | 1224 | } |
| r1877 | r1878 | |
| 1358 | 1357 | |
| 1359 | 1358 | MDRV_CPU_ADD_TAG("n2a03a", N2A03,N2A03_DEFAULTCLOCK) |
| 1360 | 1359 | MDRV_CPU_PROGRAM_MAP(dkong3_sound1_map, 0) |
| 1361 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 1360 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 1362 | 1361 | |
| 1363 | 1362 | MDRV_CPU_ADD_TAG("n2a03b", N2A03,N2A03_DEFAULTCLOCK) |
| 1364 | 1363 | MDRV_CPU_PROGRAM_MAP(dkong3_sound2_map, 0) |
| 1365 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 1364 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 1366 | 1365 | |
| 1367 | 1366 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1368 | 1367 | MDRV_SOUND_ADD(NES, N2A03_DEFAULTCLOCK) |
| r1877 | r1878 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | WRITE8_HANDLER( blockade_sound_freq_w ) |
| 38 | 38 | { |
| 39 | discrete_sound_w(BLOCKADE_NOTE_DATA, data); | |
| 39 | discrete_sound_w(machine,BLOCKADE_NOTE_DATA, data); | |
| 40 | 40 | return; |
| 41 | 41 | } |
| 42 | 42 |
| r1877 | r1878 | |
|---|---|---|
| 125 | 125 | { |
| 126 | 126 | if (ACCESSING_LSB) |
| 127 | 127 | { |
| 128 | soundlatch_w(offset,data); | |
| 128 | soundlatch_w(machine,offset,data); | |
| 129 | 129 | timer_call_after_resynch(NULL, Z80_ASSERT,setvector_callback); |
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | WRITE8_HANDLER( m72_sound_command_byte_w ) |
| 134 | 134 | { |
| 135 | soundlatch_w(offset,data); | |
| 135 | soundlatch_w(machine,offset,data); | |
| 136 | 136 | timer_call_after_resynch(NULL, Z80_ASSERT,setvector_callback); |
| 137 | 137 | } |
| 138 | 138 |
| r1877 | r1878 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | WRITE8_HANDLER( firetrk_skid_reset_w ) |
| 13 | 13 | { |
| 14 | if (GAME_IS_FIRETRUCK || GAME_IS_SUPERBUG) | |
| 15 | { | |
| 16 | firetrk_skid[0] = 0; | |
| 17 | firetrk_skid[1] = 0; | |
| 18 | } | |
| 14 | firetrk_skid[0] = 0; | |
| 15 | firetrk_skid[1] = 0; | |
| 19 | 16 | |
| 20 | // also SUPERBUG_SKID_EN and MONTECAR_SKID_EN | |
| 21 | discrete_sound_w(FIRETRUCK_SKID_EN, 1); | |
| 17 | // also SUPERBUG_SKID_EN | |
| 18 | discrete_sound_w(machine, FIRETRUCK_SKID_EN, 1); | |
| 22 | 19 | } |
| 23 | 20 | |
| 24 | 21 | |
| 22 | WRITE8_HANDLER( montecar_skid_reset_w ) | |
| 23 | { | |
| 24 | discrete_sound_w(machine, MONTECAR_SKID_EN, 1); | |
| 25 | } | |
| 26 | ||
| 27 | ||
| 25 | 28 | WRITE8_HANDLER( firetrk_crash_snd_w ) |
| 26 | 29 | { |
| 27 | 30 | // also SUPERBUG_CRASH_DATA and MONTECAR_CRASH_DATA |
| 28 | discrete_sound_w(FIRETRUCK_CRASH_DATA, data >> 4); | |
| 31 | discrete_sound_w(machine, FIRETRUCK_CRASH_DATA, data >> 4); | |
| 29 | 32 | } |
| 30 | 33 | |
| 31 | 34 | |
| 32 | 35 | WRITE8_HANDLER( firetrk_skid_snd_w ) |
| 33 | 36 | { |
| 34 | 37 | // also SUPERBUG_SKID_EN and MONTECAR_SKID_EN |
| 35 | discrete_sound_w(FIRETRUCK_SKID_EN, 0); | |
| 38 | discrete_sound_w(machine, FIRETRUCK_SKID_EN, 0); | |
| 36 | 39 | } |
| 37 | 40 | |
| 38 | 41 | |
| 39 | 42 | WRITE8_HANDLER( firetrk_motor_snd_w ) |
| 40 | 43 | { |
| 41 | if (GAME_IS_FIRETRUCK || GAME_IS_MONTECARLO) | |
| 42 | { | |
| 43 | // also MONTECAR_DRONE_MOTOR_DATA | |
| 44 | discrete_sound_w(FIRETRUCK_SIREN_DATA, data >> 4); | |
| 45 | } | |
| 44 | // also MONTECAR_DRONE_MOTOR_DATA | |
| 45 | discrete_sound_w(machine, FIRETRUCK_SIREN_DATA, data >> 4); | |
| 46 | 46 | |
| 47 | // also SUPERBUG_SPEED_DATA and MONTECAR_MOTOR_DATA | |
| 48 | discrete_sound_w(FIRETRUCK_MOTOR_DATA, data & 0x0f); | |
| 47 | // also MONTECAR_MOTOR_DATA | |
| 48 | discrete_sound_w(machine, FIRETRUCK_MOTOR_DATA, data & 0x0f); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | WRITE8_HANDLER( | |
| 52 | WRITE8_HANDLER( supe | |
| 53 | 53 | { |
| 54 | discrete_sound_w( | |
| 54 | discrete_sound_w(machine, SUPE | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | |
| 58 | WRITE8_HANDLER( firetrk_ | |
| 58 | WRITE8_HANDLER( firetrk_xtndply_w ) | |
| 59 | 59 | { |
| 60 | if (GAME_IS_SUPERBUG) | |
| 61 | { | |
| 62 | discrete_sound_w(SUPERBUG_ASR_EN, 1); /* ASR */ | |
| 63 | } | |
| 60 | discrete_sound_w(machine, FIRETRUCK_XTNDPLY_EN, data); | |
| 64 | 61 | } |
| 65 | 62 | |
| 66 | 63 | |
| 67 | WRITE8_HANDLER( | |
| 64 | WRITE8_HANDLER( supe | |
| 68 | 65 | { |
| 69 | firetrk_set_flash(data & 0x80); | |
| 70 | ||
| 71 | if (GAME_IS_MONTECARLO) | |
| 72 | { | |
| 73 | discrete_sound_w(MONTECAR_BEEPER_EN, data & 0x10); /* Beep */ | |
| 74 | discrete_sound_w(MONTECAR_DRONE_LOUD_DATA, data & 0x0f); /* Drone Motor Volume */ | |
| 75 | } | |
| 66 | popmessage("ASR"); | |
| 67 | discrete_sound_w(machine, SUPERBUG_ASR_EN, 1); /* ASR */ | |
| 76 | 68 | } |
| 77 | 69 | |
| 78 | 70 |
| r1877 | r1878 | |
|---|---|---|
| 459 | 459 | |
| 460 | 460 | READ8_HANDLER( seibu_main_v30_r ) |
| 461 | 461 | { |
| 462 | return seibu_main_word_r(offset/2,0) >> (8 * (offset & 1)); | |
| 462 | return seibu_main_word_r(machine,offset/2,0) >> (8 * (offset & 1)); | |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | WRITE8_HANDLER( seibu_main_v30_w ) |
| 466 | 466 | { |
| 467 | seibu_main_word_w(offset/2,data << (8 * (offset & 1)),0xff00 >> (8 * (offset & 1))); | |
| 467 | seibu_main_word_w(machine,offset/2,data << (8 * (offset & 1)),0xff00 >> (8 * (offset & 1))); | |
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | WRITE16_HANDLER( seibu_main_mustb_w ) |
| r1877 | r1878 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | WRITE8_HANDLER( orbit_note_w ) |
| 17 | 17 | { |
| 18 | discrete_sound_w(ORBIT_NOTE_FREQ, (~data) & 0xff); | |
| 18 | discrete_sound_w(machine, ORBIT_NOTE_FREQ, (~data) & 0xff); | |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | WRITE8_HANDLER( orbit_note_amp_w ) |
| 22 | 22 | { |
| 23 | discrete_sound_w(ORBIT_ANOTE1_AMP, data & 0x0f); | |
| 24 | discrete_sound_w(ORBIT_ANOTE2_AMP, data >> 4); | |
| 23 | discrete_sound_w(machine, ORBIT_ANOTE1_AMP, data & 0x0f); | |
| 24 | discrete_sound_w(machine, ORBIT_ANOTE2_AMP, data >> 4); | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | WRITE8_HANDLER( orbit_noise_amp_w ) |
| 28 | 28 | { |
| 29 | discrete_sound_w(ORBIT_NOISE1_AMP, data & 0x0f); | |
| 30 | discrete_sound_w(ORBIT_NOISE2_AMP, data >> 4); | |
| 29 | discrete_sound_w(machine, ORBIT_NOISE1_AMP, data & 0x0f); | |
| 30 | discrete_sound_w(machine, ORBIT_NOISE2_AMP, data >> 4); | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | WRITE8_HANDLER( orbit_noise_rst_w ) |
| 34 | 34 | { |
| 35 | discrete_sound_w(ORBIT_NOISE_EN, 0); | |
| 35 | discrete_sound_w(machine, ORBIT_NOISE_EN, 0); | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 |
| r1877 | r1878 | |
|---|---|---|
| 487 | 487 | /* going high halts the CPU */ |
| 488 | 488 | if (state) |
| 489 | 489 | { |
| 490 | cvsd_bank_select_w(0, 0); | |
| 490 | cvsd_bank_select_w(Machine, 0, 0); | |
| 491 | 491 | init_audio_state(Machine); |
| 492 | 492 | cpunum_set_input_line(Machine, sound_cpunum, INPUT_LINE_RESET, ASSERT_LINE); |
| 493 | 493 | } |
| r1877 | r1878 | |
| 516 | 516 | |
| 517 | 517 | static READ8_HANDLER( narc_command_r ) |
| 518 | 518 | { |
| 519 | cpunum_set_input_line( | |
| 519 | cpunum_set_input_line(machine, sound_cpunum, M6809_IRQ_LINE, CLEAR_LINE); | |
| 520 | 520 | williams_sound_int_state = 0; |
| 521 | return soundlatch_r(0); | |
| 521 | return soundlatch_r(machine, 0); | |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | |
| 525 | 525 | static WRITE8_HANDLER( narc_command2_w ) |
| 526 | 526 | { |
| 527 | soundlatch2_w(0, data & 0xff); | |
| 528 | cpunum_set_input_line(Machine, soundalt_cpunum, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 527 | soundlatch2_w(machine, 0, data & 0xff); | |
| 528 | cpunum_set_input_line(machine, soundalt_cpunum, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | |
| 532 | 532 | static READ8_HANDLER( narc_command2_r ) |
| 533 | 533 | { |
| 534 | cpunum_set_input_line(Machine, soundalt_cpunum, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 535 | return soundlatch2_r(0); | |
| 534 | cpunum_set_input_line(machine, soundalt_cpunum, M6809_FIRQ_LINE, CLEAR_LINE); | |
| 535 | return soundlatch2_r(machine, 0); | |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | |
| r1877 | r1878 | |
| 577 | 577 | |
| 578 | 578 | void williams_narc_data_w(int data) |
| 579 | 579 | { |
| 580 | soundlatch_w(0, data & 0xff); | |
| 580 | soundlatch_w(Machine, 0, data & 0xff); | |
| 581 | 581 | cpunum_set_input_line(Machine, sound_cpunum, INPUT_LINE_NMI, (data & 0x100) ? CLEAR_LINE : ASSERT_LINE); |
| 582 | 582 | if (!(data & 0x200)) |
| 583 | 583 | { |
| r1877 | r1878 | |
| 592 | 592 | /* going high halts the CPU */ |
| 593 | 593 | if (state) |
| 594 | 594 | { |
| 595 | narc_master_bank_select_w(0, 0); | |
| 596 | narc_slave_bank_select_w(0, 0); | |
| 595 | narc_master_bank_select_w(Machine, 0, 0); | |
| 596 | narc_slave_bank_select_w(Machine, 0, 0); | |
| 597 | 597 | init_audio_state(Machine); |
| 598 | 598 | cpunum_set_input_line(Machine, sound_cpunum, INPUT_LINE_RESET, ASSERT_LINE); |
| 599 | 599 | cpunum_set_input_line(Machine, soundalt_cpunum, INPUT_LINE_RESET, ASSERT_LINE); |
| r1877 | r1878 | |
| 638 | 638 | |
| 639 | 639 | static READ8_HANDLER( adpcm_command_r ) |
| 640 | 640 | { |
| 641 | cpunum_set_input_line( | |
| 641 | cpunum_set_input_line(machine, sound_cpunum, M6809_IRQ_LINE, CLEAR_LINE); | |
| 642 | 642 | |
| 643 | 643 | /* don't clear the external IRQ state for a short while; this allows the |
| 644 | 644 | self-tests to pass */ |
| 645 | 645 | timer_set(ATTOTIME_IN_USEC(10), NULL, 0, clear_irq_state); |
| 646 | return soundlatch_r(0); | |
| 646 | return soundlatch_r(machine, 0); | |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | 649 | |
| r1877 | r1878 | |
| 661 | 661 | |
| 662 | 662 | void williams_adpcm_data_w(int data) |
| 663 | 663 | { |
| 664 | soundlatch_w(0, data & 0xff); | |
| 664 | soundlatch_w(Machine, 0, data & 0xff); | |
| 665 | 665 | if (!(data & 0x200)) |
| 666 | 666 | { |
| 667 | 667 | cpunum_set_input_line(Machine, sound_cpunum, M6809_IRQ_LINE, ASSERT_LINE); |
| r1877 | r1878 | |
| 676 | 676 | /* going high halts the CPU */ |
| 677 | 677 | if (state) |
| 678 | 678 | { |
| 679 | adpcm_bank_select_w(0, 0); | |
| 679 | adpcm_bank_select_w(Machine, 0, 0); | |
| 680 | 680 | init_audio_state(Machine); |
| 681 | 681 | cpunum_set_input_line(Machine, sound_cpunum, INPUT_LINE_RESET, ASSERT_LINE); |
| 682 | 682 | } |
| r1877 | r1878 | |
|---|---|---|
| 37 | 37 | MDRV_CPU_ADD_TAG("mcu", M37702, clock) \ |
| 38 | 38 | MDRV_CPU_PROGRAM_MAP(namcoc7x_mcu_map, 0) \ |
| 39 | 39 | MDRV_CPU_IO_MAP(namcoc7x_mcu_io, 0) \ |
| 40 | MDRV_CPU_VBLANK_INT(namcoc7x_interrupt, 2) | |
| 40 | MDRV_CPU_VBLANK_INT_HACK(namcoc7x_interrupt, 2) | |
| 41 | 41 | |
| 42 | 42 | #define NAMCO_C7X_MCU_SHARED(clock) \ |
| 43 | 43 | MDRV_CPU_ADD_TAG("mcu", M37702, clock) \ |
| 44 | 44 | MDRV_CPU_PROGRAM_MAP(namcoc7x_mcu_share_map, 0) \ |
| 45 | 45 | MDRV_CPU_IO_MAP(namcoc7x_mcu_io, 0) \ |
| 46 | MDRV_CPU_VBLANK_INT(namcoc7x_interrupt, 2) | |
| 46 | MDRV_CPU_VBLANK_INT_HACK(namcoc7x_interrupt, 2) | |
| 47 | 47 | |
| 48 | 48 | #define NAMCO_C7X_SOUND(clock) \ |
| 49 | 49 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") \ |
| r1877 | r1878 | |
|---|---|---|
| 157 | 157 | |
| 158 | 158 | WRITE8_HANDLER( hotshock_sh_irqtrigger_w ) |
| 159 | 159 | { |
| 160 | cpunum_set_input_line( | |
| 160 | cpunum_set_input_line(machine, 1, 0, ASSERT_LINE); | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | READ8_HANDLER( hotshock_soundlatch_r ) |
| 164 | 164 | { |
| 165 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 166 | return soundlatch_r(0); | |
| 165 | cpunum_set_input_line(machine, 1, 0, CLEAR_LINE); | |
| 166 | return soundlatch_r(machine,0); | |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | static void filter_w(int chip, int channel, int data) |
| r1877 | r1878 | |
| 323 | 323 | if (ctrl & 0x40) |
| 324 | 324 | speech_rom_address = 0; |
| 325 | 325 | |
| 326 | tms5110_CTL_w(0, ctrl & 0x04 ? TMS5110_CMD_SPEAK : TMS5110_CMD_RESET); | |
| 327 | tms5110_PDC_w(0, ctrl & 0x02 ? 0 : 1); | |
| 326 | tms5110_CTL_w(machine, 0, ctrl & 0x04 ? TMS5110_CMD_SPEAK : TMS5110_CMD_RESET); | |
| 327 | tms5110_PDC_w(machine, 0, ctrl & 0x02 ? 0 : 1); | |
| 328 | 328 | |
| 329 | 329 | if (!(ctrl & 0x80)) |
| 330 | 330 | timer_set(ATTOTIME_IN_HZ(AD2083_TMS5110_CLOCK / 2),NULL,1,ad2083_step); |
| r1877 | r1878 | |
|---|---|---|
| 77 | 77 | WRITE8_HANDLER( redalert_audio_command_w ) |
| 78 | 78 | { |
| 79 | 79 | /* the byte is connected to port A of the AY8910 */ |
| 80 | soundlatch_w(0, data); | |
| 80 | soundlatch_w(machine, 0, data); | |
| 81 | 81 | |
| 82 | 82 | /* D7 is also connected to the NMI input of the CPU - |
| 83 | 83 | the NMI is actually toggled by a 74121 */ |
| 84 | 84 | if ((data & 0x80) == 0x00) |
| 85 | cpunum_set_input_line( | |
| 85 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| r1877 | r1878 | |
| 97 | 97 | |
| 98 | 98 | /* BC1=1, BDIR=0 : read from PSG */ |
| 99 | 99 | case 0x01: |
| 100 | ay8910_latch_1 = AY8910_read_port_0_r(0); | |
| 100 | ay8910_latch_1 = AY8910_read_port_0_r(machine, 0); | |
| 101 | 101 | break; |
| 102 | 102 | |
| 103 | 103 | /* BC1=0, BDIR=1 : write to PSG */ |
| 104 | 104 | case 0x02: |
| 105 | AY8910_write_port_0_w(0, ay8910_latch_2); | |
| 105 | AY8910_write_port_0_w(machine, 0, ay8910_latch_2); | |
| 106 | 106 | break; |
| 107 | 107 | |
| 108 | 108 | /* BC1=1, BDIR=1 : latch address */ |
| 109 | 109 | default: |
| 110 | 110 | case 0x03: |
| 111 | AY8910_control_port_0_w(0, ay8910_latch_2); | |
| 111 | AY8910_control_port_0_w(machine, 0, ay8910_latch_2); | |
| 112 | 112 | break; |
| 113 | 113 | } |
| 114 | 114 | } |
| r1877 | r1878 | |
| 159 | 159 | |
| 160 | 160 | WRITE8_HANDLER( redalert_voice_command_w ) |
| 161 | 161 | { |
| 162 | soundlatch2_w(0, (data & 0x78) >> 3); | |
| 163 | ||
| 164 | cpunum_set_input_line(Machine, 2, I8085_RST75_LINE, (~data & 0x80) ? ASSERT_LINE : CLEAR_LINE); | |
| 162 | soundlatch2_w(machine, 0, (data & 0x78) >> 3); | |
| 163 | cpunum_set_input_line(machine, 2, I8085_RST75_LINE, (~data & 0x80) ? ASSERT_LINE : CLEAR_LINE); | |
| 165 | 164 | } |
| 166 | 165 | |
| 167 | 166 | |
| r1877 | r1878 | |
| 248 | 247 | WRITE8_HANDLER( demoneye_audio_command_w ) |
| 249 | 248 | { |
| 250 | 249 | /* the byte is connected to port A of the AY8910 */ |
| 251 | soundlatch_w(0, data); | |
| 252 | ||
| 253 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 250 | soundlatch_w(machine, 0, data); | |
| 251 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 254 | 252 | } |
| 255 | 253 | |
| 256 | 254 | |
| r1877 | r1878 | |
| 272 | 270 | { |
| 273 | 271 | case 0x00: |
| 274 | 272 | if (ay8910_latch_1 & 0x10) |
| 275 | AY8910_write_port_0_w(0, data); | |
| 273 | AY8910_write_port_0_w(machine, 0, data); | |
| 276 | 274 | |
| 277 | 275 | if (ay8910_latch_1 & 0x20) |
| 278 | AY8910_write_port_1_w(0, data); | |
| 276 | AY8910_write_port_1_w(machine, 0, data); | |
| 279 | 277 | |
| 280 | 278 | break; |
| 281 | 279 | |
| 282 | 280 | case 0x01: |
| 283 | 281 | if (ay8910_latch_1 & 0x10) |
| 284 | ay8910_latch_2 = AY8910_read_port_0_r(0); | |
| 282 | ay8910_latch_2 = AY8910_read_port_0_r(machine, 0); | |
| 285 | 283 | |
| 286 | 284 | if (ay8910_latch_1 & 0x20) |
| 287 | ay8910_latch_2 = AY8910_read_port_1_r(0); | |
| 285 | ay8910_latch_2 = AY8910_read_port_1_r(machine, 0); | |
| 288 | 286 | |
| 289 | 287 | break; |
| 290 | 288 | |
| 291 | 289 | case 0x03: |
| 292 | 290 | if (ay8910_latch_1 & 0x10) |
| 293 | AY8910_control_port_0_w(0, data); | |
| 291 | AY8910_control_port_0_w(machine, 0, data); | |
| 294 | 292 | |
| 295 | 293 | if (ay8910_latch_1 & 0x20) |
| 296 | AY8910_control_port_1_w(0, data); | |
| 294 | AY8910_control_port_1_w(machine, 0, data); | |
| 297 | 295 | |
| 298 | 296 | break; |
| 299 | 297 |
| r1877 | r1878 | |
|---|---|---|
| 97 | 97 | return 0; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | return 0; /* will never execute this */ | |
| 101 | 100 | } |
| 102 | 101 | |
| 103 | 102 | |
| r1877 | r1878 | |
| 120 | 119 | { |
| 121 | 120 | port_A = (port_A&(~port_A_ddr))|(data&port_A_ddr); |
| 122 | 121 | if ((port_A&0x01)==0) |
| 123 | tms5220_data_w(0,port_B); | |
| 122 | tms5220_data_w(machine,0,port_B); | |
| 124 | 123 | } |
| 125 | 124 | else |
| 126 | 125 | port_A = (port_A&(~port_A_ddr))|(data&port_A_ddr); |
| r1877 | r1878 | |
| 166 | 165 | return; |
| 167 | 166 | } |
| 168 | 167 | |
| 169 | return; /* will never execute this */ | |
| 170 | ||
| 171 | 168 | } |
| 172 | 169 | |
| 173 | 170 |
| r1877 | r1878 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 3 | 2 | #include "cpu/i8039/i8039.h" |
| 4 | 3 | #include "sound/dac.h" |
| 5 | 4 | #include "sound/ay8910.h" |
| r1877 | r1878 | |
| 18 | 17 | #define ACTIVELOW_PORT_BIT(P,A,D) ((P & (~(1 << A))) | ((D ^ 1) << A)) |
| 19 | 18 | #define ACTIVEHIGH_PORT_BIT(P,A,D) ((P & (~(1 << A))) | (D << A)) |
| 20 | 19 | |
| 21 | #define I8035_T_R(N) ((soundlatch2_r(0) >> (N)) & 1) | |
| 22 | #define I8035_T_W_AH(N,D) do { state->portT = ACTIVEHIGH_PORT_BIT(state->portT,N,D); soundlatch2_w(0, state->portT); } while (0) | |
| 20 | #define I8035_T_R(M,N) ((soundlatch2_r(M,0) >> (N)) & 1) | |
| 21 | #define I8035_T_W_AH(M,N,D) do { state->portT = ACTIVEHIGH_PORT_BIT(state->portT,N,D); soundlatch2_w(M, 0, state->portT); } while (0) | |
| 23 | 22 | |
| 24 | #define I8035_P1_R() (soundlatch3_r(0)) | |
| 25 | #define I8035_P2_R() (soundlatch4_r(0)) | |
| 26 | #define I8035_P1_W(D) soundlatch3_w(0,D) | |
| 27 | #define I8035_P2_W(D) soundlatch4_w(0,D) | |
| 23 | #define I8035_P1_R(M) (soundlatch3_r(M,0)) | |
| 24 | #define I8035_P2_R(M) (soundlatch4_r(M,0)) | |
| 25 | #define I8035_P1_W(M,D) soundlatch3_w(M,0,D) | |
| 26 | #define I8035_P2_W(M,D) soundlatch4_w(M,0,D) | |
| 28 | 27 | |
| 29 | #define I8035_P1_W_AH(B,D) I8035_P1_W(ACTIVEHIGH_PORT_BIT(I8035_P1_R(),B,(D))) | |
| 30 | #define I8035_P2_W_AH(B,D) I8035_P2_W(ACTIVEHIGH_PORT_BIT(I8035_P2_R(),B,(D))) | |
| 28 | #define I8035_P1_W_AH(M,B,D) I8035_P1_W(M,ACTIVEHIGH_PORT_BIT(I8035_P1_R(M),B,(D))) | |
| 29 | #define I8035_P2_W_AH(M,B,D) I8035_P2_W(M,ACTIVEHIGH_PORT_BIT(I8035_P2_R(M),B,(D))) | |
| 31 | 30 | |
| 32 | 31 | /**************************************************************** |
| 33 | 32 | * |
| r1877 | r1878 | |
| 251 | 250 | { |
| 252 | 251 | mario_state *state = machine->driver_data; |
| 253 | 252 | |
| 254 | soundlatch_clear_w(0,0); | |
| 255 | soundlatch2_clear_w(0,0); | |
| 256 | soundlatch3_clear_w(0,0); | |
| 257 | soundlatch4_clear_w(0,0); | |
| 258 | I8035_P1_W(0x00); /* Input port */ | |
| 259 | I8035_P2_W(0xff); /* Port is in high impedance state after reset */ | |
| 253 | soundlatch_clear_w(machine,0,0); | |
| 254 | soundlatch2_clear_w(machine,0,0); | |
| 255 | soundlatch3_clear_w(machine,0,0); | |
| 256 | soundlatch4_clear_w(machine,0,0); | |
| 257 | I8035_P1_W(machine,0x00); /* Input port */ | |
| 258 | I8035_P2_W(machine,0xff); /* Port is in high impedance state after reset */ | |
| 260 | 259 | |
| 261 | 260 | state->last = 0; |
| 262 | 261 | } |
| r1877 | r1878 | |
| 269 | 268 | |
| 270 | 269 | static READ8_HANDLER( mario_sh_p1_r ) |
| 271 | 270 | { |
| 272 | return I8035_P1_R(); | |
| 271 | return I8035_P1_R(machine); | |
| 273 | 272 | } |
| 274 | 273 | |
| 275 | 274 | static READ8_HANDLER( mario_sh_p2_r ) |
| 276 | 275 | { |
| 277 | return I8035_P2_R() & 0xEF; /* Bit 4 connected to GND! */ | |
| 276 | return I8035_P2_R(machine) & 0xEF; /* Bit 4 connected to GND! */ | |
| 278 | 277 | } |
| 279 | 278 | |
| 280 | 279 | static READ8_HANDLER( mario_sh_t0_r ) |
| 281 | 280 | { |
| 282 | return I8035_T_R(0); | |
| 281 | return I8035_T_R(machine,0); | |
| 283 | 282 | } |
| 284 | 283 | |
| 285 | 284 | static READ8_HANDLER( mario_sh_t1_r ) |
| 286 | 285 | { |
| 287 | return I8035_T_R(1); | |
| 286 | return I8035_T_R(machine,1); | |
| 288 | 287 | } |
| 289 | 288 | |
| 290 | 289 | static READ8_HANDLER( mario_sh_ea_r ) |
| r1877 | r1878 | |
| 292 | 291 | #if USE_8039 |
| 293 | 292 | return 1; |
| 294 | 293 | #else |
| 295 | int p2 = (I8035_P2_R() >> 5) & 1; | |
| 294 | int p2 = (I8035_P2_R(machine) >> 5) & 1; | |
| 296 | 295 | return p2 ^ 1; |
| 297 | 296 | #endif |
| 298 | 297 | } |
| r1877 | r1878 | |
| 301 | 300 | { |
| 302 | 301 | UINT8 *SND = memory_region(REGION_CPU2); |
| 303 | 302 | UINT16 mask = memory_region_length(REGION_CPU2)-1; |
| 304 | UINT8 p2 = I8035_P2_R(); | |
| 303 | UINT8 p2 = I8035_P2_R(machine); | |
| 305 | 304 | |
| 306 | 305 | if ((p2 >> 7) & 1) |
| 307 | return soundlatch_r(offset); | |
| 306 | return soundlatch_r(machine,offset); | |
| 308 | 307 | else |
| 309 | 308 | return (SND[(0x1000 + (p2 & 0x0f)*256+offset) & mask]); |
| 310 | 309 | } |
| 311 | 310 | |
| 312 | 311 | static WRITE8_HANDLER( mario_sh_sound_w ) |
| 313 | 312 | { |
| 314 | discrete_sound_w(DS_DAC,data); | |
| 313 | discrete_sound_w(machine,DS_DAC,data); | |
| 315 | 314 | } |
| 316 | 315 | |
| 317 | 316 | static WRITE8_HANDLER( mario_sh_p1_w ) |
| 318 | 317 | { |
| 319 | I8035_P1_W(data); | |
| 318 | I8035_P1_W(machine,data); | |
| 320 | 319 | } |
| 321 | 320 | |
| 322 | 321 | static WRITE8_HANDLER( mario_sh_p2_w ) |
| 323 | 322 | { |
| 324 | I8035_P2_W(data); | |
| 323 | I8035_P2_W(machine,data); | |
| 325 | 324 | } |
| 326 | 325 | |
| 327 | 326 | /**************************************************************** |
| r1877 | r1878 | |
| 332 | 331 | |
| 333 | 332 | WRITE8_HANDLER( masao_sh_irqtrigger_w ) |
| 334 | 333 | { |
| 335 | mario_state *state = | |
| 334 | mario_state *state = machine->driver_data; | |
| 336 | 335 | |
| 337 | 336 | if (state->last == 1 && data == 0) |
| 338 | 337 | { |
| 339 | 338 | /* setting bit 0 high then low triggers IRQ on the sound CPU */ |
| 340 | cpunum_set_input_line_and_vector( | |
| 339 | cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff); | |
| 341 | 340 | } |
| 342 | 341 | |
| 343 | 342 | state->last = data; |
| r1877 | r1878 | |
| 345 | 344 | |
| 346 | 345 | WRITE8_HANDLER( mario_sh_tuneselect_w ) |
| 347 | 346 | { |
| 348 | soundlatch_w(offset,data); | |
| 347 | soundlatch_w(machine,offset,data); | |
| 349 | 348 | } |
| 350 | 349 | |
| 351 | 350 | /* Mario running sample */ |
| 352 | 351 | WRITE8_HANDLER( mario_sh1_w ) |
| 353 | 352 | { |
| 354 | discrete_sound_w(DS_SOUND0_INP,data & 1); | |
| 353 | discrete_sound_w(machine,DS_SOUND0_INP,data & 1); | |
| 355 | 354 | } |
| 356 | 355 | |
| 357 | 356 | /* Luigi running sample */ |
| 358 | 357 | WRITE8_HANDLER( mario_sh2_w ) |
| 359 | 358 | { |
| 360 | discrete_sound_w(DS_SOUND1_INP,data & 1); | |
| 359 | discrete_sound_w(machine,DS_SOUND1_INP,data & 1); | |
| 361 | 360 | } |
| 362 | 361 | |
| 363 | 362 | /* Misc samples */ |
| 364 | 363 | WRITE8_HANDLER( mario_sh3_w ) |
| 365 | 364 | { |
| 366 | mario_state *state = | |
| 365 | mario_state *state = machine->driver_data; | |
| 367 | 366 | |
| 368 | 367 | switch (offset) |
| 369 | 368 | { |
| 370 | 369 | case 0: /* death */ |
| 371 | 370 | if (data) |
| 372 | cpunum_set_input_line( | |
| 371 | cpunum_set_input_line(machine, 1,0,ASSERT_LINE); | |
| 373 | 372 | else |
| 374 | cpunum_set_input_line( | |
| 373 | cpunum_set_input_line(machine, 1,0,CLEAR_LINE); | |
| 375 | 374 | break; |
| 376 | 375 | case 1: /* get coin */ |
| 377 | I8035_T_W_AH(0,data & 1); | |
| 376 | I8035_T_W_AH(machine,0,data & 1); | |
| 378 | 377 | break; |
| 379 | 378 | case 2: /* ice */ |
| 380 | I8035_T_W_AH(1,data & 1); | |
| 379 | I8035_T_W_AH(machine,1,data & 1); | |
| 381 | 380 | break; |
| 382 | 381 | case 3: /* crab */ |
| 383 | I8035_P1_W_AH(0,data & 1); | |
| 382 | I8035_P1_W_AH(machine,0,data & 1); | |
| 384 | 383 | break; |
| 385 | 384 | case 4: /* turtle */ |
| 386 | I8035_P1_W_AH(1,data & 1); | |
| 385 | I8035_P1_W_AH(machine,1,data & 1); | |
| 387 | 386 | break; |
| 388 | 387 | case 5: /* fly */ |
| 389 | I8035_P1_W_AH(2,data & 1); | |
| 388 | I8035_P1_W_AH(machine,2,data & 1); | |
| 390 | 389 | break; |
| 391 | 390 | case 6: /* coin */ |
| 392 | I8035_P1_W_AH(3,data & 1); | |
| 391 | I8035_P1_W_AH(machine,3,data & 1); | |
| 393 | 392 | break; |
| 394 | 393 | case 7: /* skid */ |
| 395 | discrete_sound_w(DS_SOUND7_INP,data & 1); | |
| 394 | discrete_sound_w(machine,DS_SOUND7_INP,data & 1); | |
| 396 | 395 | break; |
| 397 | 396 | } |
| 398 | 397 | } |
| r1877 | r1878 | |
|---|---|---|
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | soundlatch_w(offset,data); | |
| 79 | soundlatch_w(machine,offset,data); | |
| 80 | 80 | |
| 81 | 81 | switch (cpu_gettotalcpu()) |
| 82 | 82 | { |
| 83 | 83 | case 2: |
| 84 | 84 | /* Revision 1 sound board */ |
| 85 | cpunum_set_input_line( | |
| 85 | cpunum_set_input_line(machine, 1,M6502_IRQ_LINE,HOLD_LINE); | |
| 86 | 86 | break; |
| 87 | 87 | case 3: |
| 88 | 88 | case 4: |
| 89 | 89 | /* Revision 2 & 3 sound board */ |
| 90 | cpunum_set_input_line(Machine, cpu_gettotalcpu()-1,M6502_IRQ_LINE,HOLD_LINE); | |
| 91 | cpunum_set_input_line(Machine, cpu_gettotalcpu()-2,M6502_IRQ_LINE,HOLD_LINE); | |
| 90 | cpunum_set_input_line(machine, cpu_gettotalcpu()-1,M6502_IRQ_LINE,HOLD_LINE); | |
| 91 | cpunum_set_input_line(machine, cpu_gettotalcpu()-2,M6502_IRQ_LINE,HOLD_LINE); | |
| 92 | 92 | break; |
| 93 | 93 | } |
| 94 | 94 | } |
| r1877 | r1878 | |
| 175 | 175 | { |
| 176 | 176 | switch (offset) { |
| 177 | 177 | case 0: /* port A */ |
| 178 | return soundlatch_r(0) ^ 0xff; /* invert command */ | |
| 178 | return soundlatch_r(machine,0) ^ 0xff; /* invert command */ | |
| 179 | 179 | case 2: /* port B */ |
| 180 | 180 | return 0x40; /* say that PB6 is 1 (test SW1 not pressed) */ |
| 181 | 181 | case 5: /* interrupt register */ |
| r1877 | r1878 | |
| 253 | 253 | { |
| 254 | 254 | static int last; |
| 255 | 255 | |
| 256 | common_sound_control_w(offset, data); | |
| 256 | common_sound_control_w(machine, offset, data); | |
| 257 | 257 | |
| 258 | 258 | /* bit 2 goes to 8913 BDIR pin */ |
| 259 | 259 | if ((last & 0x04) == 0x04 && (data & 0x04) == 0x00) |
| r1877 | r1878 | |
| 263 | 263 | { |
| 264 | 264 | /* bit 4 goes to the 8913 BC1 pin */ |
| 265 | 265 | if (data & 0x10) |
| 266 | AY8910_control_port_0_w(0,psg_latch); | |
| 266 | AY8910_control_port_0_w(machine,0,psg_latch); | |
| 267 | 267 | else |
| 268 | AY8910_write_port_0_w(0,psg_latch); | |
| 268 | AY8910_write_port_0_w(machine,0,psg_latch); | |
| 269 | 269 | } |
| 270 | 270 | else |
| 271 | 271 | { |
| 272 | 272 | /* bit 4 goes to the 8913 BC1 pin */ |
| 273 | 273 | if (data & 0x10) |
| 274 | AY8910_control_port_1_w(0,psg_latch); | |
| 274 | AY8910_control_port_1_w(machine,0,psg_latch); | |
| 275 | 275 | else |
| 276 | AY8910_write_port_1_w(0,psg_latch); | |
| 276 | AY8910_write_port_1_w(machine,0,psg_latch); | |
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | |
| r1877 | r1878 | |
| 282 | 282 | /* bit 6 = speech chip DATA PRESENT pin; high then low to make the chip read data */ |
| 283 | 283 | if ((last & 0x40) == 0x40 && (data & 0x40) == 0x00) |
| 284 | 284 | { |
| 285 | sp0250_w(0,sp0250_latch); | |
| 285 | sp0250_w(machine,0,sp0250_latch); | |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | /* bit 7 goes to the speech chip RESET pin */ |
| r1877 | r1878 | |
|---|---|---|
| 1572 | 1572 | static READ16_HANDLER( input_latch_r ) |
| 1573 | 1573 | { |
| 1574 | 1574 | if (dcs.auto_ack) |
| 1575 | input_latch_ack_w(0,0,0); | |
| 1575 | input_latch_ack_w(machine,0,0,0); | |
| 1576 | 1576 | if (LOG_DCS_IO) |
| 1577 | 1577 | logerror("%08X:input_latch_r(%04X)\n", activecpu_get_pc(), dcs.input_data); |
| 1578 | 1578 | return dcs.input_data; |
| r1877 | r1878 | |
| 2080 | 2080 | timer_set(ATTOTIME_IN_USEC(1), NULL, param, s1_ack_callback2); |
| 2081 | 2081 | return; |
| 2082 | 2082 | } |
| 2083 | output_latch_w(0, 0x000a, 0); | |
| 2083 | output_latch_w(machine, 0, 0x000a, 0); | |
| 2084 | 2084 | } |
| 2085 | 2085 | |
| 2086 | 2086 | |
| r1877 | r1878 | |
| 2092 | 2092 | timer_set(ATTOTIME_IN_USEC(1), NULL, param, s1_ack_callback1); |
| 2093 | 2093 | return; |
| 2094 | 2094 | } |
| 2095 | output_latch_w(0, param, 0); | |
| 2095 | output_latch_w(machine, 0, param, 0); | |
| 2096 | 2096 | |
| 2097 | 2097 | /* chain to the next word we need to write back */ |
| 2098 | 2098 | timer_set(ATTOTIME_IN_USEC(1), NULL, 0, s1_ack_callback2); |
| r1877 | r1878 | |
| 2230 | 2230 | timer_set(ATTOTIME_IN_USEC(1), NULL, param, s2_ack_callback); |
| 2231 | 2231 | return; |
| 2232 | 2232 | } |
| 2233 | output_latch_w(0, param, 0); | |
| 2234 | output_control_w(0, (dcs.output_control & ~0xff00) | 0x0300, 0); | |
| 2233 | output_latch_w(machine, 0, param, 0); | |
| 2234 | output_control_w(machine, 0, (dcs.output_control & ~0xff00) | 0x0300, 0); | |
| 2235 | 2235 | } |
| 2236 | 2236 | |
| 2237 | 2237 |
| r1877 | r1878 | |
|---|---|---|
| 95 | 95 | |
| 96 | 96 | static READ8_HANDLER( audio_latch_r ) |
| 97 | 97 | { |
| 98 | jedi_state *state = | |
| 98 | jedi_state *state = machine->driver_data; | |
| 99 | 99 | |
| 100 | 100 | *state->audio_comm_stat &= ~0x80; |
| 101 | 101 | return state->audio_latch; |
| r1877 | r1878 | |
| 104 | 104 | |
| 105 | 105 | CUSTOM_INPUT( jedi_audio_comm_stat_r ) |
| 106 | 106 | { |
| 107 | jedi_state *state = Machine->driver_data; | |
| 108 | ||
| 107 | jedi_state *state = machine->driver_data; | |
| 109 | 108 | return *state->audio_comm_stat >> 6; |
| 110 | 109 | } |
| 111 | 110 | |
| r1877 | r1878 | |
| 119 | 118 | |
| 120 | 119 | READ8_HANDLER( jedi_audio_ack_latch_r ) |
| 121 | 120 | { |
| 122 | jedi_state *state = | |
| 121 | jedi_state *state = machine->driver_data; | |
| 123 | 122 | |
| 124 | 123 | *state->audio_comm_stat &= ~0x40; |
| 125 | 124 | return state->audio_ack_latch; |
| r1877 | r1878 | |
| 128 | 127 | |
| 129 | 128 | static WRITE8_HANDLER( audio_ack_latch_w ) |
| 130 | 129 | { |
| 131 | jedi_state *state = | |
| 130 | jedi_state *state = machine->driver_data; | |
| 132 | 131 | |
| 133 | 132 | state->audio_ack_latch = data; |
| 134 | 133 | *state->audio_comm_stat |= 0x40; |
| r1877 | r1878 | |
| 144 | 143 | |
| 145 | 144 | static WRITE8_HANDLER( speech_strobe_w ) |
| 146 | 145 | { |
| 147 | jedi_state *state = | |
| 146 | jedi_state *state = machine->driver_data; | |
| 148 | 147 | int new_speech_strobe_state = (~offset >> 8) & 1; |
| 149 | 148 | |
| 150 | 149 | if ((new_speech_strobe_state != state->speech_strobe_state) && new_speech_strobe_state) |
| 151 | tms5220_data_w(0, *state->speech_data); | |
| 150 | tms5220_data_w(machine, 0, *state->speech_data); | |
| 152 | 151 | state->speech_strobe_state = new_speech_strobe_state; |
| 153 | 152 | } |
| 154 | 153 |
| r1877 | r1878 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | WRITE8_HANDLER( subs_sonar1_w ) |
| 16 | 16 | { |
| 17 | discrete_sound_w(SUBS_SONAR1_EN, offset & 0x01); | |
| 17 | discrete_sound_w(machine, SUBS_SONAR1_EN, offset & 0x01); | |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | WRITE8_HANDLER( subs_sonar2_w ) |
| 21 | 21 | { |
| 22 | discrete_sound_w(SUBS_SONAR2_EN, offset & 0x01); | |
| 22 | discrete_sound_w(machine, SUBS_SONAR2_EN, offset & 0x01); | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | WRITE8_HANDLER( subs_crash_w ) |
| 26 | 26 | { |
| 27 | discrete_sound_w(SUBS_CRASH_EN, offset & 0x01); | |
| 27 | discrete_sound_w(machine, SUBS_CRASH_EN, offset & 0x01); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | WRITE8_HANDLER( subs_explode_w ) |
| 31 | 31 | { |
| 32 | discrete_sound_w(SUBS_EXPLODE_EN, offset & 0x01); | |
| 32 | discrete_sound_w(machine, SUBS_EXPLODE_EN, offset & 0x01); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | WRITE8_HANDLER( subs_noise_reset_w ) |
| 36 | 36 | { |
| 37 | 37 | /* Pulse noise reset */ |
| 38 | discrete_sound_w(SUBS_NOISE_RESET, 0); | |
| 38 | discrete_sound_w(machine, SUBS_NOISE_RESET, 0); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 |
| r1877 | r1878 | |
|---|---|---|
| 460 | 460 | { |
| 461 | 461 | if (!(data & 0x01) && (riot_portb_data & 0x01)) |
| 462 | 462 | { |
| 463 | riot_porta_data = tms5220_status_r(0); | |
| 463 | riot_porta_data = tms5220_status_r(machine, 0); | |
| 464 | 464 | logerror("(%f)%04X:TMS5220 status read = %02X\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), riot_porta_data); |
| 465 | 465 | } |
| 466 | 466 | if (!(data & 0x02) && (riot_portb_data & 0x02)) |
| 467 | 467 | { |
| 468 | 468 | logerror("(%f)%04X:TMS5220 data write = %02X\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), riot_porta_data); |
| 469 | tms5220_data_w(0, riot_porta_data); | |
| 469 | tms5220_data_w(machine, 0, riot_porta_data); | |
| 470 | 470 | } |
| 471 | 471 | } |
| 472 | 472 | riot_portb_data = (riot_portb_data & ~riot_portb_ddr) | (data & riot_portb_ddr); |
| r1877 | r1878 | |
|---|---|---|
| 160 | 160 | WRITE8_HANDLER( cosmo_sh_port_2_w ) |
| 161 | 161 | { |
| 162 | 162 | /* inverted flip screen bit */ |
| 163 | invadpt2_sh_port_2_w(offset, data ^ 0x20); | |
| 163 | invadpt2_sh_port_2_w(machine, offset, data ^ 0x20); | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | |
| r1877 | r1878 | |
| 277 | 277 | |
| 278 | 278 | WRITE8_HANDLER( indianbt_sh_port_3_w ) |
| 279 | 279 | { |
| 280 | discrete_sound_w(INDIANBT_MUSIC_DATA, data); | |
| 280 | discrete_sound_w(machine, INDIANBT_MUSIC_DATA, data); | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | |
| r1877 | r1878 | |
| 595 | 595 | |
| 596 | 596 | WRITE8_HANDLER( polaris_sh_port_1_w ) |
| 597 | 597 | { |
| 598 | discrete_sound_w(POLARIS_MUSIC_DATA, data); | |
| 598 | discrete_sound_w(machine, POLARIS_MUSIC_DATA, data); | |
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | WRITE8_HANDLER( polaris_sh_port_2_w ) |
| 602 | 602 | { |
| 603 | 603 | /* 0x01 - SX0 - Shot */ |
| 604 | discrete_sound_w(POLARIS_SX0_EN, data & 0x01); | |
| 604 | discrete_sound_w(machine, POLARIS_SX0_EN, data & 0x01); | |
| 605 | 605 | |
| 606 | 606 | /* 0x02 - SX1 - Ship Hit (Sub) */ |
| 607 | discrete_sound_w(POLARIS_SX1_EN, data & 0x02); | |
| 607 | discrete_sound_w(machine, POLARIS_SX1_EN, data & 0x02); | |
| 608 | 608 | |
| 609 | 609 | /* 0x04 - SX2 - Ship */ |
| 610 | discrete_sound_w(POLARIS_SX2_EN, data & 0x04); | |
| 610 | discrete_sound_w(machine, POLARIS_SX2_EN, data & 0x04); | |
| 611 | 611 | |
| 612 | 612 | /* 0x08 - SX3 - Explosion */ |
| 613 | discrete_sound_w(POLARIS_SX3_EN, data & 0x08); | |
| 613 | discrete_sound_w(machine, POLARIS_SX3_EN, data & 0x08); | |
| 614 | 614 | |
| 615 | 615 | /* 0x10 - SX4 */ |
| 616 | 616 | |
| 617 | 617 | /* 0x20 - SX5 - Sound Enable */ |
| 618 | discrete_sound_w(POLARIS_SX5_EN, data & 0x20); | |
| 618 | discrete_sound_w(machine, POLARIS_SX5_EN, data & 0x20); | |
| 619 | 619 | } |
| 620 | 620 | |
| 621 | 621 | WRITE8_HANDLER( polaris_sh_port_3_w ) |
| 622 | 622 | { |
| 623 | ||
| 623 | 624 | coin_lockout_global_w(data & 0x04); /* SX8 */ |
| 624 | 625 | |
| 625 | 626 | c8080bw_flip_screen_w(data & 0x20); /* SX11 */ |
| 626 | 627 | |
| 627 | 628 | /* 0x01 - SX6 - Plane Down */ |
| 628 | discrete_sound_w(POLARIS_SX6_EN, data & 0x01); | |
| 629 | discrete_sound_w(machine, POLARIS_SX6_EN, data & 0x01); | |
| 629 | 630 | |
| 630 | 631 | /* 0x02 - SX7 - Plane Up */ |
| 631 | discrete_sound_w(POLARIS_SX7_EN, data & 0x02); | |
| 632 | discrete_sound_w(machine, POLARIS_SX7_EN, data & 0x02); | |
| 632 | 633 | |
| 633 | 634 | /* 0x08 - SX9 - Hit */ |
| 634 | discrete_sound_w(POLARIS_SX9_EN, data & 0x08); | |
| 635 | discrete_sound_w(machine, POLARIS_SX9_EN, data & 0x08); | |
| 635 | 636 | |
| 636 | 637 | /* 0x10 - SX10 - Hit */ |
| 637 | discrete_sound_w(POLARIS_SX10_EN, data & 0x10); | |
| 638 | discrete_sound_w(machine, POLARIS_SX10_EN, data & 0x10); | |
| 638 | 639 | } |
| 639 | 640 | |
| 640 | 641 | |
| r1877 | r1878 | |
| 783 | 784 | bit 4 - Effect Sound C (SX4) |
| 784 | 785 | bit 5 - Explosion (SX5) */ |
| 785 | 786 | |
| 786 | discrete_sound_w(SCHASER_DOT_EN, data & 0x01); | |
| 787 | discrete_sound_w(SCHASER_DOT_SEL, data & 0x02); | |
| 787 | discrete_sound_w(machine, SCHASER_DOT_EN, data & 0x01); | |
| 788 | discrete_sound_w(machine, SCHASER_DOT_SEL, data & 0x02); | |
| 788 | 789 | |
| 789 | 790 | /* The effect is a variable rate 555 timer. A diode/resistor array is used to |
| 790 | 791 | * select the frequency. Because of the diode voltage drop, we can not use the |
| r1877 | r1878 | |
| 844 | 845 | bit 4 - Field Control B (SX10) |
| 845 | 846 | bit 5 - Flip Screen */ |
| 846 | 847 | |
| 847 | discrete_sound_w(SCHASER_MUSIC_BIT, data & 0x01); | |
| 848 | discrete_sound_w(machine, SCHASER_MUSIC_BIT, data & 0x01); | |
| 848 | 849 | |
| 849 | discrete_sound_w(SCHASER_SND_EN, data & 0x02); | |
| 850 | discrete_sound_w(machine, SCHASER_SND_EN, data & 0x02); | |
| 850 | 851 | sound_global_enable(data & 0x02); |
| 851 | 852 | |
| 852 | 853 | coin_lockout_global_w(data & 0x04); |
| r1877 | r1878 | |
| 892 | 893 | { |
| 893 | 894 | schaser_effect_555_is_low = 0; |
| 894 | 895 | timer_adjust_oneshot(schaser_effect_555_timer, attotime_never, 0); |
| 895 | schaser_sh_port_1_w(0, 0); | |
| 896 | schaser_sh_port_2_w(0, 0); | |
| 896 | schaser_sh_port_1_w(machine, 0, 0); | |
| 897 | schaser_sh_port_2_w(machine, 0, 0); | |
| 897 | 898 | schaser_effect_555_time_remain = attotime_zero; |
| 898 | 899 | |
| 899 | 900 | MACHINE_RESET_CALL(mw8080bw); |
| r1877 | r1878 | |
|---|---|---|
| 66 | 66 | |
| 67 | 67 | WRITE8_HANDLER( midway_tone_generator_lo_w ) |
| 68 | 68 | { |
| 69 | discrete_sound_w(MIDWAY_TONE_EN, (data >> 0) & 0x01); | |
| 69 | discrete_sound_w(machine, MIDWAY_TONE_EN, (data >> 0) & 0x01); | |
| 70 | 70 | |
| 71 | discrete_sound_w(MIDWAY_TONE_DATA_L, (data >> 1) & 0x1f); | |
| 71 | discrete_sound_w(machine, MIDWAY_TONE_DATA_L, (data >> 1) & 0x1f); | |
| 72 | 72 | |
| 73 | 73 | /* D6 and D7 are not connected */ |
| 74 | 74 | } |
| r1877 | r1878 | |
| 76 | 76 | |
| 77 | 77 | WRITE8_HANDLER( midway_tone_generator_hi_w ) |
| 78 | 78 | { |
| 79 | discrete_sound_w(MIDWAY_TONE_DATA_H, data & 0x3f); | |
| 79 | discrete_sound_w(machine, MIDWAY_TONE_DATA_H, data & 0x3f); | |
| 80 | 80 | |
| 81 | 81 | /* D6 and D7 are not connected */ |
| 82 | 82 | } |
| r1877 | r1878 | |
| 311 | 311 | |
| 312 | 312 | WRITE8_HANDLER( tornbase_audio_w ) |
| 313 | 313 | { |
| 314 | discrete_sound_w(TORNBASE_TONE_240_EN, (data >> 0) & 0x01); | |
| 314 | discrete_sound_w(machine, TORNBASE_TONE_240_EN, (data >> 0) & 0x01); | |
| 315 | 315 | |
| 316 | discrete_sound_w(TORNBASE_TONE_960_EN, (data >> 1) & 0x01); | |
| 316 | discrete_sound_w(machine, TORNBASE_TONE_960_EN, (data >> 1) & 0x01); | |
| 317 | 317 | |
| 318 | discrete_sound_w(TORNBASE_TONE_120_EN, (data >> 2) & 0x01); | |
| 318 | discrete_sound_w(machine, TORNBASE_TONE_120_EN, (data >> 2) & 0x01); | |
| 319 | 319 | |
| 320 | 320 | /* if (data & 0x08) enable SIREN sound */ |
| 321 | 321 | |
| r1877 | r1878 | |
| 567 | 567 | MACHINE_DRIVER_END |
| 568 | 568 | |
| 569 | 569 | |
| 570 | void maze_write_discrete(UINT8 maze_tone_timing_state) | |
| 570 | void maze_write_discrete(running_machine *machine, UINT8 maze_tone_timing_state) | |
| 571 | 571 | { |
| 572 | 572 | /* controls need to be active low */ |
| 573 | 573 | int controls = ~readinputport(0) & 0xff; |
| 574 | 574 | |
| 575 | discrete_sound_w(MAZE_TONE_TIMING, maze_tone_timing_state); | |
| 576 | discrete_sound_w(MAZE_P1_DATA, controls & 0x0f); | |
| 577 | discrete_sound_w(MAZE_P2_DATA, (controls >> 4) & 0x0f); | |
| 578 | discrete_sound_w(MAZE_JOYSTICK_IN_USE, controls != 0xff); | |
| 575 | discrete_sound_w(machine, MAZE_TONE_TIMING, maze_tone_timing_state); | |
| 576 | discrete_sound_w(machine, MAZE_P1_DATA, controls & 0x0f); | |
| 577 | discrete_sound_w(machine, MAZE_P2_DATA, (controls >> 4) & 0x0f); | |
| 578 | discrete_sound_w(machine, MAZE_JOYSTICK_IN_USE, controls != 0xff); | |
| 579 | 579 | |
| 580 | 580 | /* The coin line is connected directly to the discrete circuit. */ |
| 581 | 581 | /* We can't really do that, so updating it with the tone timing is close enough. */ |
| 582 | 582 | /* A better option might be to update it at vblank or set a timer to do it. */ |
| 583 | 583 | /* The only noticeable difference doing it here, is that the controls don't */ |
| 584 | 584 | /* imediately start making tones if pressed right after the coin is inserted. */ |
| 585 | discrete_sound_w(MAZE_COIN, (~readinputport(1) >> 3) & 0x01); | |
| 585 | discrete_sound_w(machine, MAZE_COIN, (~readinputport(1) >> 3) & 0x01); | |
| 586 | 586 | } |
| 587 | 587 | |
| 588 | 588 | |
| r1877 | r1878 | |
| 809 | 809 | |
| 810 | 810 | coin_counter_w(0, (data >> 2) & 0x01); |
| 811 | 811 | |
| 812 | discrete_sound_w(BOOTHILL_GAME_ON_EN, (data >> 3) & 0x01); | |
| 812 | discrete_sound_w(machine, BOOTHILL_GAME_ON_EN, (data >> 3) & 0x01); | |
| 813 | 813 | |
| 814 | discrete_sound_w(BOOTHILL_LEFT_SHOT_EN, (data >> 4) & 0x01); | |
| 814 | discrete_sound_w(machine, BOOTHILL_LEFT_SHOT_EN, (data >> 4) & 0x01); | |
| 815 | 815 | |
| 816 | discrete_sound_w(BOOTHILL_RIGHT_SHOT_EN, (data >> 5) & 0x01); | |
| 816 | discrete_sound_w(machine, BOOTHILL_RIGHT_SHOT_EN, (data >> 5) & 0x01); | |
| 817 | 817 | |
| 818 | discrete_sound_w(BOOTHILL_LEFT_HIT_EN, (data >> 6) & 0x01); | |
| 818 | discrete_sound_w(machine, BOOTHILL_LEFT_HIT_EN, (data >> 6) & 0x01); | |
| 819 | 819 | |
| 820 | discrete_sound_w(BOOTHILL_RIGHT_HIT_EN, (data >> 7) & 0x01); | |
| 820 | discrete_sound_w(machine, BOOTHILL_RIGHT_HIT_EN, (data >> 7) & 0x01); | |
| 821 | 821 | } |
| 822 | 822 | |
| 823 | 823 | |
| r1877 | r1878 | |
| 1041 | 1041 | |
| 1042 | 1042 | WRITE8_HANDLER( checkmat_audio_w ) |
| 1043 | 1043 | { |
| 1044 | discrete_sound_w(CHECKMAT_TONE_EN, data & 0x01); | |
| 1044 | discrete_sound_w(machine, CHECKMAT_TONE_EN, data & 0x01); | |
| 1045 | 1045 | |
| 1046 | discrete_sound_w(CHECKMAT_BOOM_EN, (data >> 1) & 0x01); | |
| 1046 | discrete_sound_w(machine, CHECKMAT_BOOM_EN, (data >> 1) & 0x01); | |
| 1047 | 1047 | |
| 1048 | 1048 | coin_counter_w(0, (data >> 2) & 0x01); |
| 1049 | 1049 | |
| 1050 | 1050 | sound_global_enable((data >> 3) & 0x01); |
| 1051 | 1051 | |
| 1052 | discrete_sound_w(CHECKMAT_TONE_DATA_45, (data >> 4) & 0x03); | |
| 1053 | discrete_sound_w(CHECKMAT_TONE_DATA_67, (data >> 6) & 0x03); | |
| 1052 | discrete_sound_w(machine, CHECKMAT_TONE_DATA_45, (data >> 4) & 0x03); | |
| 1053 | discrete_sound_w(machine, CHECKMAT_TONE_DATA_67, (data >> 6) & 0x03); | |
| 1054 | 1054 | } |
| 1055 | 1055 | |
| 1056 | 1056 | |
| r1877 | r1878 | |
| 1284 | 1284 | |
| 1285 | 1285 | coin_counter_w(0, (data >> 2) & 0x01); |
| 1286 | 1286 | |
| 1287 | discrete_sound_w(DESERTGU_GAME_ON_EN, (data >> 3) & 0x01); | |
| 1287 | discrete_sound_w(machine, DESERTGU_GAME_ON_EN, (data >> 3) & 0x01); | |
| 1288 | 1288 | |
| 1289 | discrete_sound_w(DESERTGU_RIFLE_SHOT_EN, (data >> 4) & 0x01); | |
| 1289 | discrete_sound_w(machine, DESERTGU_RIFLE_SHOT_EN, (data >> 4) & 0x01); | |
| 1290 | 1290 | |
| 1291 | discrete_sound_w(DESERTGU_BOTTLE_HIT_EN, (data >> 5) & 0x01); | |
| 1291 | discrete_sound_w(machine, DESERTGU_BOTTLE_HIT_EN, (data >> 5) & 0x01); | |
| 1292 | 1292 | |
| 1293 | discrete_sound_w(DESERTGU_ROAD_RUNNER_HIT_EN, (data >> 6) & 0x01); | |
| 1293 | discrete_sound_w(machine, DESERTGU_ROAD_RUNNER_HIT_EN, (data >> 6) & 0x01); | |
| 1294 | 1294 | |
| 1295 | discrete_sound_w(DESERTGU_CREATURE_HIT_EN, (data >> 7) & 0x01); | |
| 1295 | discrete_sound_w(machine, DESERTGU_CREATURE_HIT_EN, (data >> 7) & 0x01); | |
| 1296 | 1296 | } |
| 1297 | 1297 | |
| 1298 | 1298 | |
| 1299 | 1299 | WRITE8_HANDLER( desertgu_audio_2_w ) |
| 1300 | 1300 | { |
| 1301 | discrete_sound_w(DESERTGU_ROADRUNNER_BEEP_BEEP_EN, (data >> 0) & 0x01); | |
| 1301 | discrete_sound_w(machine, DESERTGU_ROADRUNNER_BEEP_BEEP_EN, (data >> 0) & 0x01); | |
| 1302 | 1302 | |
| 1303 | discrete_sound_w(DESERTGU_TRIGGER_CLICK_EN, (data >> 1) & 0x01); | |
| 1303 | discrete_sound_w(machine, DESERTGU_TRIGGER_CLICK_EN, (data >> 1) & 0x01); | |
| 1304 | 1304 | |
| 1305 | 1305 | output_set_value("KICKER", (data >> 2) & 0x01); |
| 1306 | 1306 | |
| r1877 | r1878 | |
| 1574 | 1574 | |
| 1575 | 1575 | WRITE8_HANDLER( dplay_audio_w ) |
| 1576 | 1576 | { |
| 1577 | discrete_sound_w(DPLAY_TONE_ON_EN, (data >> 0) & 0x01); | |
| 1577 | discrete_sound_w(machine, DPLAY_TONE_ON_EN, (data >> 0) & 0x01); | |
| 1578 | 1578 | |
| 1579 | discrete_sound_w(DPLAY_CHEER_EN, (data >> 1) & 0x01); | |
| 1579 | discrete_sound_w(machine, DPLAY_CHEER_EN, (data >> 1) & 0x01); | |
| 1580 | 1580 | |
| 1581 | discrete_sound_w(DPLAY_SIREN_EN, (data >> 2) & 0x01); | |
| 1581 | discrete_sound_w(machine, DPLAY_SIREN_EN, (data >> 2) & 0x01); | |
| 1582 | 1582 | |
| 1583 | discrete_sound_w(DPLAY_WHISTLE_EN, (data >> 3) & 0x01); | |
| 1583 | discrete_sound_w(machine, DPLAY_WHISTLE_EN, (data >> 3) & 0x01); | |
| 1584 | 1584 | |
| 1585 | discrete_sound_w(DPLAY_GAME_ON_EN, (data >> 4) & 0x01); | |
| 1585 | discrete_sound_w(machine, DPLAY_GAME_ON_EN, (data >> 4) & 0x01); | |
| 1586 | 1586 | |
| 1587 | 1587 | coin_counter_w(0, (data >> 5) & 0x01); |
| 1588 | 1588 | |
| r1877 | r1878 | |
| 2028 | 2028 | { |
| 2029 | 2029 | UINT8 rising_bits = data & ~port_2_last; |
| 2030 | 2030 | |
| 2031 | discrete_sound_w(CLOWNS_POP_BOTTOM_EN, (data >> 0) & 0x01); | |
| 2031 | discrete_sound_w(machine, CLOWNS_POP_BOTTOM_EN, (data >> 0) & 0x01); | |
| 2032 | 2032 | |
| 2033 | discrete_sound_w(CLOWNS_POP_MIDDLE_EN, (data >> 1) & 0x01); | |
| 2033 | discrete_sound_w(machine, CLOWNS_POP_MIDDLE_EN, (data >> 1) & 0x01); | |
| 2034 | 2034 | |
| 2035 | discrete_sound_w(CLOWNS_POP_TOP_EN, (data >> 2) & 0x01); | |
| 2035 | discrete_sound_w(machine, CLOWNS_POP_TOP_EN, (data >> 2) & 0x01); | |
| 2036 | 2036 | |
| 2037 | 2037 | sound_global_enable((data >> 3) & 0x01); |
| 2038 | 2038 | |
| 2039 | discrete_sound_w(CLOWNS_SPRINGBOARD_HIT_EN, (data >> 4) & 0x01); | |
| 2039 | discrete_sound_w(machine, CLOWNS_SPRINGBOARD_HIT_EN, (data >> 4) & 0x01); | |
| 2040 | 2040 | |
| 2041 | 2041 | if (rising_bits & 0x20) sample_start_n(0, 0, 0, 0); /* springboard miss */ |
| 2042 | 2042 | |
| r1877 | r1878 | |
| 2705 | 2705 | /* D1 is marked as 'OPTIONAL SWITCH VIDEO FOR COCKTAIL', |
| 2706 | 2706 | but it is never set by the software */ |
| 2707 | 2707 | |
| 2708 | discrete_sound_w(SPCENCTR_CRASH_EN, (data >> 2) & 0x01); | |
| 2708 | discrete_sound_w(machine, SPCENCTR_CRASH_EN, (data >> 2) & 0x01); | |
| 2709 | 2709 | |
| 2710 | 2710 | /* D3-D7 are not connected */ |
| 2711 | 2711 | } |
| r1877 | r1878 | |
| 2715 | 2715 | { |
| 2716 | 2716 | /* set WIND SOUND FREQ(data & 0x0f) 0, if no wind */ |
| 2717 | 2717 | |
| 2718 | discrete_sound_w(SPCENCTR_EXPLOSION_EN, (data >> 4) & 0x01); | |
| 2718 | discrete_sound_w(machine, SPCENCTR_EXPLOSION_EN, (data >> 4) & 0x01); | |
| 2719 | 2719 | |
| 2720 | discrete_sound_w(SPCENCTR_PLAYER_SHOT_EN, (data >> 5) & 0x01); | |
| 2720 | discrete_sound_w(machine, SPCENCTR_PLAYER_SHOT_EN, (data >> 5) & 0x01); | |
| 2721 | 2721 | |
| 2722 | 2722 | /* D6 and D7 are not connected */ |
| 2723 | 2723 | |
| r1877 | r1878 | |
| 2729 | 2729 | { |
| 2730 | 2730 | /* if (data & 0x01) enable SCREECH (hit the sides) sound */ |
| 2731 | 2731 | |
| 2732 | discrete_sound_w(SPCENCTR_ENEMY_SHIP_SHOT_EN, (data >> 1) & 0x01); | |
| 2732 | discrete_sound_w(machine, SPCENCTR_ENEMY_SHIP_SHOT_EN, (data >> 1) & 0x01); | |
| 2733 | 2733 | |
| 2734 | 2734 | spcenctr_set_strobe_state((data >> 2) & 0x01); |
| 2735 | 2735 | |
| 2736 | 2736 | output_set_value("LAMP", (data >> 3) & 0x01); |
| 2737 | 2737 | |
| 2738 | discrete_sound_w(SPCENCTR_BONUS_EN, (data >> 4) & 0x01); | |
| 2738 | discrete_sound_w(machine, SPCENCTR_BONUS_EN, (data >> 4) & 0x01); | |
| 2739 | 2739 | |
| 2740 | 2740 | SN76477_enable_w(0, (data >> 5) & 0x01); /* saucer sound */ |
| 2741 | 2741 | |
| r1877 | r1878 | |
| 2912 | 2912 | |
| 2913 | 2913 | sound_global_enable((data >> 2) & 0x01); |
| 2914 | 2914 | |
| 2915 | discrete_sound_w(BOWLER_FOWL_EN, (data >> 3) & 0x01); | |
| 2915 | discrete_sound_w(machine, BOWLER_FOWL_EN, (data >> 3) & 0x01); | |
| 2916 | 2916 | |
| 2917 | 2917 | /* D4 - appears to be a screen flip, but it's |
| 2918 | 2918 | shown unconnected on the schematics for both the |
| r1877 | r1878 | |
| 3642 | 3642 | { |
| 3643 | 3643 | SN76477_enable_w(0, (~data >> 0) & 0x01); /* saucer sound */ |
| 3644 | 3644 | |
| 3645 | discrete_sound_w(INVADERS_NODE(INVADERS_MISSILE_EN, 1), data & 0x02); | |
| 3646 | discrete_sound_w(INVADERS_NODE(INVADERS_EXPLOSION_EN, 1), data & 0x04); | |
| 3647 | discrete_sound_w(INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08); | |
| 3648 | discrete_sound_w(INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10); | |
| 3645 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_MISSILE_EN, 1), data & 0x02); | |
| 3646 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_EXPLOSION_EN, 1), data & 0x04); | |
| 3647 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08); | |
| 3648 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10); | |
| 3649 | 3649 | |
| 3650 | 3650 | sound_global_enable(data & 0x20); |
| 3651 | 3651 | |
| r1877 | r1878 | |
| 3655 | 3655 | |
| 3656 | 3656 | WRITE8_HANDLER( invaders_audio_2_w ) |
| 3657 | 3657 | { |
| 3658 | discrete_sound_w(INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f); | |
| 3659 | discrete_sound_w(INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10); | |
| 3658 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f); | |
| 3659 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10); | |
| 3660 | 3660 | |
| 3661 | 3661 | /* the flip screen line is only connected on the cocktail PCB */ |
| 3662 | 3662 | if (invaders_is_cabinet_cocktail()) |
| r1877 | r1878 | |
| 3792 | 3792 | |
| 3793 | 3793 | WRITE8_HANDLER( blueshrk_audio_w ) |
| 3794 | 3794 | { |
| 3795 | discrete_sound_w(BLUESHRK_GAME_ON_EN, (data >> 0) & 0x01); | |
| 3795 | discrete_sound_w(machine, BLUESHRK_GAME_ON_EN, (data >> 0) & 0x01); | |
| 3796 | 3796 | |
| 3797 | 3797 | /* discrete_sound_w(BLUESHRK_SHOT_EN, (data >> 1) & 0x01); */ |
| 3798 | 3798 | |
| 3799 | discrete_sound_w(BLUESHRK_HIT_EN, (data >> 2) & 0x01); | |
| 3799 | discrete_sound_w(machine, BLUESHRK_HIT_EN, (data >> 2) & 0x01); | |
| 3800 | 3800 | |
| 3801 | 3801 | /* discrete_sound_w(BLUESHRK_SHARK_EN, (data >> 3) & 0x01); */ |
| 3802 | 3802 | |
| r1877 | r1878 | |
| 4022 | 4022 | { |
| 4023 | 4023 | SN76477_enable_w(0, (~data >> 0) & 0x01); /* saucer sound */ |
| 4024 | 4024 | |
| 4025 | discrete_sound_w(INVADERS_NODE(INVADERS_MISSILE_EN, 1), data & 0x02); | |
| 4026 | discrete_sound_w(INVADERS_NODE(INVADERS_EXPLOSION_EN, 1), data & 0x04); | |
| 4027 | discrete_sound_w(INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08); | |
| 4028 | discrete_sound_w(INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10); | |
| 4025 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_MISSILE_EN, 1), data & 0x02); | |
| 4026 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_EXPLOSION_EN, 1), data & 0x04); | |
| 4027 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08); | |
| 4028 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10); | |
| 4029 | 4029 | |
| 4030 | 4030 | sound_global_enable(data & 0x20); |
| 4031 | 4031 | |
| r1877 | r1878 | |
| 4035 | 4035 | |
| 4036 | 4036 | WRITE8_HANDLER( invad2ct_audio_2_w ) |
| 4037 | 4037 | { |
| 4038 | discrete_sound_w(INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f); | |
| 4039 | discrete_sound_w(INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10); | |
| 4038 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f); | |
| 4039 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10); | |
| 4040 | 4040 | |
| 4041 | 4041 | /* D5-D7 are not connected */ |
| 4042 | 4042 | } |
| r1877 | r1878 | |
| 4046 | 4046 | { |
| 4047 | 4047 | SN76477_enable_w(1, (~data >> 0) & 0x01); /* saucer sound */ |
| 4048 | 4048 | |
| 4049 | discrete_sound_w(INVADERS_NODE(INVADERS_MISSILE_EN, 2), data & 0x02); | |
| 4050 | discrete_sound_w(INVADERS_NODE(INVADERS_EXPLOSION_EN, 2), data & 0x04); | |
| 4051 | discrete_sound_w(INVADERS_NODE(INVADERS_INVADER_HIT_EN, 2), data & 0x08); | |
| 4052 | discrete_sound_w(INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 2), data & 0x10); | |
| 4049 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_MISSILE_EN, 2), data & 0x02); | |
| 4050 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_EXPLOSION_EN, 2), data & 0x04); | |
| 4051 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 2), data & 0x08); | |
| 4052 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 2), data & 0x10); | |
| 4053 | 4053 | |
| 4054 | 4054 | /* D5-D7 are not connected */ |
| 4055 | 4055 | } |
| r1877 | r1878 | |
| 4057 | 4057 | |
| 4058 | 4058 | WRITE8_HANDLER( invad2ct_audio_4_w ) |
| 4059 | 4059 | { |
| 4060 | discrete_sound_w(INVADERS_NODE(INVADERS_FLEET_DATA, 2), data & 0x0f); | |
| 4061 | discrete_sound_w(INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 2), data & 0x10); | |
| 4060 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_FLEET_DATA, 2), data & 0x0f); | |
| 4061 | discrete_sound_w(machine, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 2), data & 0x10); | |
| 4062 | 4062 | |
| 4063 | 4063 | /* D5-D7 are not connected */ |
| 4064 | 4064 | } |
| r1877 | r1878 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 2 | 3 | #include "includes/amiga.h" |
| 3 | 4 | #include "cdrom.h" |
| 4 | 5 | #include "coreutil.h" |
| r1877 | r1878 | |
| 360 | 361 | #if LOG_AKIKO_CD |
| 361 | 362 | logerror( "Akiko CD IRQ\n" ); |
| 362 | 363 | #endif |
| 363 | amiga_custom_w(REG_INTREQ, 0x8000 | INTENA_PORTS, 0); | |
| 364 | amiga_custom_w(Machine, REG_INTREQ, 0x8000 | INTENA_PORTS, 0); | |
| 364 | 365 | } |
| 365 | 366 | } |
| 366 | 367 |
| r1877 | r1878 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 2 | 3 | #include "nmk004.h" |
| 3 | 4 | #include "sound/2203intf.h" |
| 4 | 5 | #include "sound/okim6295.h" |
| r1877 | r1878 | |
| 133 | 134 | |
| 134 | 135 | *****************************/ |
| 135 | 136 | |
| 136 | static void oki_play_sample(int sample_no) | |
| 137 | static void oki_play_sample(running_machine *machine, int sample_no) | |
| 137 | 138 | { |
| 138 | 139 | UINT16 table_start = (sample_no & 0x80) ? read16(SAMPLE_TABLE_1) : read16(SAMPLE_TABLE_0); |
| 139 | 140 | UINT8 byte1 = read8(table_start + 2 * (sample_no & 0x7f) + 0); |
| r1877 | r1878 | |
| 144 | 145 | { |
| 145 | 146 | // stop all channels |
| 146 | 147 | if (chip == 0) |
| 147 | OKIM6295_data_0_w(0, 0x78 ); | |
| 148 | OKIM6295_data_0_w(machine, 0, 0x78 ); | |
| 148 | 149 | else |
| 149 | OKIM6295_data_1_w(0, 0x78 ); | |
| 150 | OKIM6295_data_1_w(machine, 0, 0x78 ); | |
| 150 | 151 | } |
| 151 | 152 | else |
| 152 | 153 | { |
| r1877 | r1878 | |
| 161 | 162 | |
| 162 | 163 | // stop channel |
| 163 | 164 | if (chip == 0) |
| 164 | OKIM6295_data_0_w(0, (0x08 << ch) ); | |
| 165 | OKIM6295_data_0_w(machine, 0, (0x08 << ch) ); | |
| 165 | 166 | else |
| 166 | OKIM6295_data_1_w(0, (0x08 << ch) ); | |
| 167 | OKIM6295_data_1_w(machine, 0, (0x08 << ch) ); | |
| 167 | 168 | |
| 168 | 169 | if (sample != 0) |
| 169 | 170 | { |
| r1877 | r1878 | |
| 176 | 177 | |
| 177 | 178 | if (chip == 0) |
| 178 | 179 | { |
| 179 | OKIM6295_data_0_w(0, 0x80 | sample ); | |
| 180 | OKIM6295_data_0_w(0, (0x10 << ch) | vol ); | |
| 180 | OKIM6295_data_0_w(machine, 0, 0x80 | sample ); | |
| 181 | OKIM6295_data_0_w(machine, 0, (0x10 << ch) | vol ); | |
| 181 | 182 | } |
| 182 | 183 | else |
| 183 | 184 | { |
| 184 | OKIM6295_data_1_w(0, 0x80 | sample ); | |
| 185 | OKIM6295_data_1_w(0, (0x10 << ch) | vol ); | |
| 185 | OKIM6295_data_1_w(machine, 0, 0x80 | sample ); | |
| 186 | OKIM6295_data_1_w(machine, 0, (0x10 << ch) | vol ); | |
| 186 | 187 | } |
| 187 | 188 | } |
| 188 | 189 | } |
| 189 | 190 | } |
| 190 | 191 | |
| 191 | static void oki_update_state( | |
| 192 | static void oki_update_state(running_machine *machine) | |
| 192 | 193 | { |
| 193 | NMK004_state.oki_playing = ((OKIM6295_status_1_r(0) & 0x0f) << 4) | (OKIM6295_status_0_r(0) & 0x0f); | |
| 194 | NMK004_state.oki_playing = ((OKIM6295_status_1_r(machine, 0) & 0x0f) << 4) | (OKIM6295_status_0_r(machine, 0) & 0x0f); | |
| 194 | 195 | } |
| 195 | 196 | |
| 196 | 197 | |
| r1877 | r1878 | |
| 201 | 202 | |
| 202 | 203 | *****************************/ |
| 203 | 204 | |
| 204 | static void effects_update(int channel) | |
| 205 | static void effects_update(running_machine *machine, int channel) | |
| 205 | 206 | { |
| 206 | 207 | struct effects_control *effects = &NMK004_state.effects_control[channel]; |
| 207 | 208 | |
| r1877 | r1878 | |
| 233 | 234 | switch (token) |
| 234 | 235 | { |
| 235 | 236 | case 0xef: // play sample |
| 236 | oki_play_sample(read8(effects->current++)); | |
| 237 | oki_play_sample(machine, read8(effects->current++)); | |
| 237 | 238 | break; |
| 238 | 239 | |
| 239 | 240 | case 0xf6: // jump |
| r1877 | r1878 | |
| 308 | 309 | |
| 309 | 310 | *****************************/ |
| 310 | 311 | |
| 311 | static void fm_update(int channel) | |
| 312 | static void fm_update(running_machine *machine, int channel) | |
| 312 | 313 | { |
| 313 | 314 | struct fm_control *fm = &NMK004_state.fm_control[channel]; |
| 314 | 315 | |
| r1877 | r1878 | |
| 348 | 349 | switch (token) |
| 349 | 350 | { |
| 350 | 351 | // case 0xef: // play sample |
| 351 | // oki_play_sample(read8(fm->current++)); | |
| 352 | // oki_play_sample(machine, read8(fm->current++)); | |
| 352 | 353 | // break; |
| 353 | 354 | |
| 354 | 355 | case 0xf0: // slot (for keyon ym2203 command) |
| r1877 | r1878 | |
| 356 | 357 | fm->slot = read8(fm->current++); |
| 357 | 358 | if (channel < 3 || !(NMK004_state.fm_control[channel-3].flags & FM_FLAG_ACTIVE)) |
| 358 | 359 | { |
| 359 | YM2203_control_port_0_w(0, 0x28); // keyon/off | |
| 360 | YM2203_write_port_0_w(0, channel % 3); | |
| 360 | YM2203_control_port_0_w(machine, 0, 0x28); // keyon/off | |
| 361 | YM2203_write_port_0_w(machine, 0, channel % 3); | |
| 361 | 362 | } |
| 362 | 363 | break; |
| 363 | 364 | |
| r1877 | r1878 | |
| 585 | 586 | } |
| 586 | 587 | |
| 587 | 588 | |
| 588 | static void fm_voices_update( | |
| 589 | static void fm_voices_update(running_machine *machine) | |
| 589 | 590 | { |
| 590 | 591 | static const int ym2203_registers[0x18] = |
| 591 | 592 | { |
| r1877 | r1878 | |
| 605 | 606 | |
| 606 | 607 | for (i = 0; i < 0x18; i++) |
| 607 | 608 | { |
| 608 | YM2203_control_port_0_w(0, ym2203_registers[i] + channel); | |
| 609 | YM2203_write_port_0_w(0, fm1->voice_params[i]); | |
| 609 | YM2203_control_port_0_w(machine, 0, ym2203_registers[i] + channel); | |
| 610 | YM2203_write_port_0_w(machine, 0, fm1->voice_params[i]); | |
| 610 | 611 | } |
| 611 | 612 | } |
| 612 | 613 | |
| r1877 | r1878 | |
| 618 | 619 | { |
| 619 | 620 | for (i = 0; i < 0x18; i++) |
| 620 | 621 | { |
| 621 | YM2203_control_port_0_w(0, ym2203_registers[i] + channel); | |
| 622 | YM2203_write_port_0_w(0, fm2->voice_params[i]); | |
| 622 | YM2203_control_port_0_w(machine, 0, ym2203_registers[i] + channel); | |
| 623 | YM2203_write_port_0_w(machine, 0, fm2->voice_params[i]); | |
| 623 | 624 | } |
| 624 | 625 | } |
| 625 | 626 | } |
| r1877 | r1878 | |
| 627 | 628 | |
| 628 | 629 | if (fm1->flags & FM_FLAG_ACTIVE) |
| 629 | 630 | { |
| 630 | YM2203_control_port_0_w(0, 0xb0 + channel); // self-feedback | |
| 631 | YM2203_write_port_0_w(0, fm1->self_feedback); | |
| 631 | YM2203_control_port_0_w(machine, 0, 0xb0 + channel); // self-feedback | |
| 632 | YM2203_write_port_0_w(machine, 0, fm1->self_feedback); | |
| 632 | 633 | |
| 633 | YM2203_control_port_0_w(0, 0xa4 + channel); // F-number | |
| 634 | YM2203_write_port_0_w(0, fm1->f_number >> 8); | |
| 634 | YM2203_control_port_0_w(machine, 0, 0xa4 + channel); // F-number | |
| 635 | YM2203_write_port_0_w(machine, 0, fm1->f_number >> 8); | |
| 635 | 636 | |
| 636 | YM2203_control_port_0_w(0, 0xa0 + channel); // F-number | |
| 637 | YM2203_write_port_0_w(0, fm1->f_number & 0xff); | |
| 637 | YM2203_control_port_0_w(machine, 0, 0xa0 + channel); // F-number | |
| 638 | YM2203_write_port_0_w(machine, 0, fm1->f_number & 0xff); | |
| 638 | 639 | } |
| 639 | 640 | else |
| 640 | 641 | { |
| 641 | YM2203_control_port_0_w(0, 0xb0 + channel); // self-feedback | |
| 642 | YM2203_write_port_0_w(0, fm2->self_feedback); | |
| 642 | YM2203_control_port_0_w(machine, 0, 0xb0 + channel); // self-feedback | |
| 643 | YM2203_write_port_0_w(machine, 0, fm2->self_feedback); | |
| 643 | 644 | |
| 644 | YM2203_control_port_0_w(0, 0xa4 + channel); // F-number | |
| 645 | YM2203_write_port_0_w(0, fm2->f_number >> 8); | |
| 645 | YM2203_control_port_0_w(machine, 0, 0xa4 + channel); // F-number | |
| 646 | YM2203_write_port_0_w(machine, 0, fm2->f_number >> 8); | |
| 646 | 647 | |
| 647 | YM2203_control_port_0_w(0, 0xa0 + channel); // F-number | |
| 648 | YM2203_write_port_0_w(0, fm2->f_number & 0xff); | |
| 648 | YM2203_control_port_0_w(machine, 0, 0xa0 + channel); // F-number | |
| 649 | YM2203_write_port_0_w(machine, 0, fm2->f_number & 0xff); | |
| 649 | 650 | } |
| 650 | 651 | |
| 651 | 652 | |
| r1877 | r1878 | |
| 654 | 655 | { |
| 655 | 656 | fm1->flags &= ~FM_FLAG_MUST_SEND_KEYON; |
| 656 | 657 | |
| 657 | YM2203_control_port_0_w(0, 0x28); // keyon/off | |
| 658 | YM2203_write_port_0_w(0, fm1->slot | channel); | |
| 658 | YM2203_control_port_0_w(machine, 0, 0x28); // keyon/off | |
| 659 | YM2203_write_port_0_w(machine, 0, fm1->slot | channel); | |
| 659 | 660 | } |
| 660 | 661 | |
| 661 | 662 | if (fm2->flags & FM_FLAG_MUST_SEND_KEYON) |
| r1877 | r1878 | |
| 664 | 665 | |
| 665 | 666 | if (!(fm1->flags & FM_FLAG_ACTIVE)) |
| 666 | 667 | { |
| 667 | YM2203_control_port_0_w(0, 0x28); // keyon/off | |
| 668 | YM2203_write_port_0_w(0, fm2->slot | channel); | |
| 668 | YM2203_control_port_0_w(machine, 0, 0x28); // keyon/off | |
| 669 | YM2203_write_port_0_w(machine, 0, fm2->slot | channel); | |
| 669 | 670 | } |
| 670 | 671 | } |
| 671 | 672 | } |
| r1877 | r1878 | |
| 679 | 680 | |
| 680 | 681 | *****************************/ |
| 681 | 682 | |
| 682 | static void psg_update(int channel) | |
| 683 | static void psg_update(running_machine *machine, int channel) | |
| 683 | 684 | { |
| 684 | 685 | struct psg_control *psg = &NMK004_state.psg_control[channel]; |
| 685 | 686 | |
| r1877 | r1878 | |
| 703 | 704 | psg->flags &= ~PSG_FLAG_NOISE_NOT_ENABLED; |
| 704 | 705 | |
| 705 | 706 | // enable noise, disable tone on this channel |
| 706 | YM2203_control_port_0_w(0, 0x07); | |
| 707 | enable = YM2203_read_port_0_r(0); | |
| 707 | YM2203_control_port_0_w(machine, 0, 0x07); | |
| 708 | enable = YM2203_read_port_0_r(machine, 0); | |
| 708 | 709 | enable |= (0x01 << channel); // disable tone |
| 709 | 710 | enable &= ~(0x08 << channel); // enable noise |
| 710 | YM2203_write_port_0_w(0, enable); | |
| 711 | YM2203_write_port_0_w(machine, 0, enable); | |
| 711 | 712 | } |
| 712 | 713 | |
| 713 | 714 | |
| r1877 | r1878 | |
| 741 | 742 | psg->flags &= ~PSG_FLAG_NOISE_NOT_ENABLED; |
| 742 | 743 | |
| 743 | 744 | // enable noise, disable tone on this channel |
| 744 | YM2203_control_port_0_w(0, 0x07); | |
| 745 | enable = YM2203_read_port_0_r(0); | |
| 745 | YM2203_control_port_0_w(machine, 0, 0x07); | |
| 746 | enable = YM2203_read_port_0_r(machine, 0); | |
| 746 | 747 | enable |= (0x01 << channel); // disable tone |
| 747 | 748 | enable &= ~(0x08 << channel); // enable noise |
| 748 | YM2203_write_port_0_w(0, enable); | |
| 749 | YM2203_write_port_0_w(machine, 0, enable); | |
| 749 | 750 | break; |
| 750 | 751 | |
| 751 | 752 | case 0xf2: // set volume shape |
| r1877 | r1878 | |
| 790 | 791 | psg->volume_shape = 0; |
| 791 | 792 | |
| 792 | 793 | // mute channel |
| 793 | YM2203_control_port_0_w(0, 8 + channel); | |
| 794 | YM2203_write_port_0_w(0, 0); | |
| 794 | YM2203_control_port_0_w(machine, 0, 8 + channel); | |
| 795 | YM2203_write_port_0_w(machine, 0, 0); | |
| 795 | 796 | return; |
| 796 | 797 | } |
| 797 | 798 | } |
| r1877 | r1878 | |
| 831 | 832 | |
| 832 | 833 | period >>= octave; |
| 833 | 834 | |
| 834 | YM2203_control_port_0_w(0, 2 * channel + 1); | |
| 835 | YM2203_write_port_0_w(0, (period & 0x0f00) >> 8); | |
| 836 | YM2203_control_port_0_w(0, 2 * channel + 0); | |
| 837 | YM2203_write_port_0_w(0, (period & 0x00ff)); | |
| 835 | YM2203_control_port_0_w(machine, 0, 2 * channel + 1); | |
| 836 | YM2203_write_port_0_w(machine, 0, (period & 0x0f00) >> 8); | |
| 837 | YM2203_control_port_0_w(machine, 0, 2 * channel + 0); | |
| 838 | YM2203_write_port_0_w(machine, 0, (period & 0x00ff)); | |
| 838 | 839 | |
| 839 | 840 | psg->note_period_hi_bits = (period & 0x0f00) >> 8; |
| 840 | 841 | } |
| r1877 | r1878 | |
| 847 | 848 | psg->flags |= PSG_FLAG_NOISE_NOT_ENABLED; |
| 848 | 849 | |
| 849 | 850 | // disable noise, enable tone on this channel |
| 850 | YM2203_control_port_0_w(0, 0x07); | |
| 851 | enable = YM2203_read_port_0_r(0); | |
| 851 | YM2203_control_port_0_w(machine, 0, 0x07); | |
| 852 | enable = YM2203_read_port_0_r(machine, 0); | |
| 852 | 853 | enable &= ~(0x01 << channel); // enable tone |
| 853 | 854 | enable |= (0x08 << channel); // disable noise |
| 854 | YM2203_write_port_0_w(0, enable); | |
| 855 | YM2203_write_port_0_w(machine, 0, enable); | |
| 855 | 856 | } |
| 856 | 857 | |
| 857 | YM2203_control_port_0_w(0, 0x06); // noise period | |
| 858 | YM2203_write_port_0_w(0, psg->note); | |
| 858 | YM2203_control_port_0_w(machine, 0, 0x06); // noise period | |
| 859 | YM2203_write_port_0_w(machine, 0, psg->note); | |
| 859 | 860 | psg->note_period_hi_bits = psg->note; |
| 860 | 861 | } |
| 861 | 862 | } |
| r1877 | r1878 | |
| 880 | 881 | volume = 0; |
| 881 | 882 | |
| 882 | 883 | // set volume |
| 883 | YM2203_control_port_0_w(0, 8 + channel); | |
| 884 | YM2203_write_port_0_w(0, volume & 0x0f); | |
| 884 | YM2203_control_port_0_w(machine, 0, 8 + channel); | |
| 885 | YM2203_write_port_0_w(machine, 0, volume & 0x0f); | |
| 885 | 886 | } |
| 886 | 887 | } |
| 887 | 888 | } |
| r1877 | r1878 | |
| 894 | 895 | |
| 895 | 896 | *****************************/ |
| 896 | 897 | |
| 897 | static void get_command( | |
| 898 | static void get_command(running_machine *machine) | |
| 898 | 899 | { |
| 899 | 900 | static const UINT8 from_main[] = |
| 900 | 901 | { |
| r1877 | r1878 | |
| 931 | 932 | |
| 932 | 933 | if ((cmd_table & 0xff00) == 0) |
| 933 | 934 | { |
| 934 | oki_play_sample(cmd_table); | |
| 935 | oki_play_sample(machine, cmd_table); | |
| 935 | 936 | } |
| 936 | 937 | else |
| 937 | 938 | { |
| r1877 | r1878 | |
| 979 | 980 | |
| 980 | 981 | |
| 981 | 982 | |
| 982 | static void update_music( | |
| 983 | static void update_music(running_machine *machine) | |
| 983 | 984 | { |
| 984 | 985 | int channel; |
| 985 | 986 | |
| 986 | 987 | for (channel = 0; channel < FM_CHANNELS; channel++) |
| 987 | fm_update(channel); | |
| 988 | fm_voices_update(); | |
| 988 | fm_update(machine, channel); | |
| 989 | fm_voices_update(machine); | |
| 989 | 990 | |
| 990 | 991 | for (channel = 0; channel < PSG_CHANNELS; channel++) |
| 991 | psg_update(channel); | |
| 992 | psg_update(machine, channel); | |
| 992 | 993 | |
| 993 | 994 | for (channel = 0; channel < EFFECTS_CHANNELS; channel++) |
| 994 | effects_update(channel); | |
| 995 | effects_update(machine, channel); | |
| 995 | 996 | } |
| 996 | 997 | |
| 997 | 998 | |
| r1877 | r1878 | |
| 1002 | 1003 | |
| 1003 | 1004 | if (!irq) return; |
| 1004 | 1005 | |
| 1005 | status = YM2203_status_port_0_r(0); | |
| 1006 | status = YM2203_status_port_0_r(Machine,0); | |
| 1006 | 1007 | |
| 1007 | 1008 | if (status & 1) // timer A expired |
| 1008 | 1009 | { |
| 1009 | oki_update_state(); | |
| 1010 | get_command(); | |
| 1011 | update_music(); | |
| 1010 | oki_update_state(Machine); | |
| 1011 | get_command(Machine); | |
| 1012 | update_music(Machine); | |
| 1012 | 1013 | |
| 1013 | 1014 | // restart timer |
| 1014 | YM2203_control_port_0_w(0, 0x27); | |
| 1015 | YM2203_write_port_0_w(0, 0x15); | |
| 1015 | YM2203_control_port_0_w(Machine, 0, 0x27); | |
| 1016 | YM2203_write_port_0_w(Machine, 0, 0x15); | |
| 1016 | 1017 | } |
| 1017 | 1018 | } |
| 1018 | 1019 | |
| r1877 | r1878 | |
| 1031 | 1032 | |
| 1032 | 1033 | NMK004_state.rom = memory_region(REGION_CPU2); |
| 1033 | 1034 | |
| 1034 | YM2203_control_port_0_w(0, 0x2f); | |
| 1035 | YM2203_control_port_0_w(machine, 0, 0x2f); | |
| 1035 | 1036 | |
| 1036 | 1037 | i = 0; |
| 1037 | 1038 | while (ym2203_init[i] != 0xff) |
| 1038 | 1039 | { |
| 1039 | YM2203_control_port_0_w(0, ym2203_init[i++]); | |
| 1040 | YM2203_write_port_0_w(0, ym2203_init[i++]); | |
| 1040 | YM2203_control_port_0_w(machine, 0, ym2203_init[i++]); | |
| 1041 | YM2203_write_port_0_w(machine, 0, ym2203_init[i++]); | |
| 1041 | 1042 | } |
| 1042 | 1043 | |
| 1043 | 1044 | NMK004_state.oki_playing = 0; |
| 1044 | 1045 | |
| 1045 | oki_play_sample(0); | |
| 1046 | oki_play_sample(machine, 0); | |
| 1046 | 1047 | |
| 1047 | 1048 | NMK004_state.protection_check = 0; |
| 1048 | 1049 | } |
| r1877 | r1878 | |
|---|---|---|
| 44 | 44 | |
| 45 | 45 | /* reset the security chip */ |
| 46 | 46 | RP5H01_enable_w( 0, 0 ); |
| 47 | RP5H01_0_reset_w( 0, 0 ); | |
| 48 | RP5H01_0_reset_w( 0, 1 ); | |
| 47 | RP5H01_0_reset_w( machine, 0, 0 ); | |
| 48 | RP5H01_0_reset_w( machine, 0, 1 ); | |
| 49 | 49 | RP5H01_enable_w( 0, 1 ); |
| 50 | 50 | |
| 51 | 51 | /* reset the ppu */ |
| r1877 | r1878 | |
| 142 | 142 | /* we only support a single cart connected at slot 0 */ |
| 143 | 143 | if ( cart_sel == 0 ) |
| 144 | 144 | { |
| 145 | RP5H01_0_enable_w( 0, 0 ); | |
| 145 | RP5H01_0_enable_w( machine, 0, 0 ); | |
| 146 | 146 | data |= ( ( ~RP5H01_counter_r( 0 ) ) << 4 ) & 0x10; /* D4 */ |
| 147 | 147 | data |= ( ( RP5H01_data_r( 0 ) ) << 3 ) & 0x08; /* D3 */ |
| 148 | RP5H01_0_enable_w( 0, 1 ); | |
| 148 | RP5H01_0_enable_w( machine, 0, 1 ); | |
| 149 | 149 | } |
| 150 | 150 | return data; |
| 151 | 151 | } |
| r1877 | r1878 | |
| 155 | 155 | /* we only support a single cart connected at slot 0 */ |
| 156 | 156 | if ( cart_sel == 0 ) |
| 157 | 157 | { |
| 158 | RP5H01_0_enable_w( 0, 0 ); | |
| 159 | RP5H01_0_test_w( 0, data & 0x10 ); /* D4 */ | |
| 160 | RP5H01_0_clock_w( 0, data & 0x08 ); /* D3 */ | |
| 161 | RP5H01_0_reset_w( 0, ~data & 0x01 ); /* D0 */ | |
| 162 | RP5H01_0_enable_w( 0, 1 ); | |
| 158 | RP5H01_0_enable_w( machine, 0, 0 ); | |
| 159 | RP5H01_0_test_w( machine, 0, data & 0x10 ); /* D4 */ | |
| 160 | RP5H01_0_clock_w( machine, 0, data & 0x08 ); /* D3 */ | |
| 161 | RP5H01_0_reset_w( machine, 0, ~data & 0x01 ); /* D0 */ | |
| 162 | RP5H01_0_enable_w( machine, 0, 1 ); | |
| 163 | 163 | |
| 164 | 164 | /* this thing gets dense at some point */ |
| 165 | 165 | /* it wants to jump and execute an opcode at $ffff, wich */ |
| 166 | 166 | /* is the actual protection memory area */ |
| 167 | 167 | /* setting the whole 0x2000 region every time is a waste */ |
| 168 | 168 | /* so we just set $ffff with the current value */ |
| 169 | memory_region( REGION_CPU1 )[0xffff] = pc10_prot_r(0); | |
| 169 | memory_region( REGION_CPU1 )[0xffff] = pc10_prot_r(machine,0); | |
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 |
| r1877 | r1878 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | WRITE8_HANDLER( bublbobl_sound_command_w ) |
| 107 | 107 | { |
| 108 | soundlatch_w(offset,data); | |
| 108 | soundlatch_w(machine,offset,data); | |
| 109 | 109 | timer_call_after_resynch(NULL, data,nmi_callback); |
| 110 | 110 | } |
| 111 | 111 |
| r1877 | r1878 | |
|---|---|---|
| 271 | 271 | WRITE8_HANDLER( kingball_sound2_w ) |
| 272 | 272 | { |
| 273 | 273 | kingball_sound = (kingball_sound & ~0x02) | (data << 1); |
| 274 | soundlatch_w (0, kingball_sound | 0xf0); | |
| 274 | soundlatch_w (machine, 0, kingball_sound | 0xf0); | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
| r1877 | r1878 | |
| 313 | 313 | WRITE8_HANDLER( _4in1_bank_w ) |
| 314 | 314 | { |
| 315 | 315 | _4in1_bank = data & 0x03; |
| 316 | galaxian_gfxbank_w(0, _4in1_bank); | |
| 316 | galaxian_gfxbank_w(machine, 0, _4in1_bank); | |
| 317 | 317 | memory_set_bank(1, _4in1_bank); |
| 318 | 318 | } |
| 319 | 319 | |
| r1877 | r1878 | |
| 334 | 334 | |
| 335 | 335 | memory_set_bank(1, game); |
| 336 | 336 | |
| 337 | galaxian_gfxbank_w(0, gmgalax_selected_game); | |
| 337 | galaxian_gfxbank_w(Machine, 0, gmgalax_selected_game); | |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | READ8_HANDLER( gmgalax_input_port_0_r ) |
| r1877 | r1878 | |
| 520 | 520 | /* games are banked at 0x0000 - 0x3fff */ |
| 521 | 521 | memory_configure_bank(1, 0, 4, &RAM[0x10000], 0x4000); |
| 522 | 522 | |
| 523 | _4in1_bank_w(0, 0); /* set the initial CPU bank */ | |
| 523 | _4in1_bank_w(machine, 0, 0); /* set the initial CPU bank */ | |
| 524 | 524 | |
| 525 | 525 | state_save_register_global(_4in1_bank); |
| 526 | 526 | } |
| r1877 | r1878 | |
| 544 | 544 | |
| 545 | 545 | state_save_register_global(gmgalax_selected_game); |
| 546 | 546 | |
| 547 | gmgalax_select_game(input_port_6_r(0) & 0x01); | |
| 547 | gmgalax_select_game(input_port_6_r(machine, 0) & 0x01); | |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | INTERRUPT_GEN( gmgalax_vh_interrupt ) |
| 551 | 551 | { |
| 552 | 552 | // reset the cpu if the selected game changed |
| 553 | int new_game = input_port_6_r(0) & 0x01; | |
| 553 | int new_game = input_port_6_r(machine, 0) & 0x01; | |
| 554 | 554 | |
| 555 | 555 | if (gmgalax_selected_game != new_game) |
| 556 | 556 | { |
| 557 | 557 | gmgalax_select_game(new_game); |
| 558 | 558 | |
| 559 | 559 | /* Ghost Muncher never clears this */ |
| 560 | galaxian_stars_enable_w(0, 0); | |
| 560 | galaxian_stars_enable_w(machine, 0, 0); | |
| 561 | 561 | |
| 562 | 562 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, ASSERT_LINE); |
| 563 | 563 | } |
| r1877 | r1878 | |
|---|---|---|
| 158 | 158 | else if (!state && asic65_reset_state) |
| 159 | 159 | { |
| 160 | 160 | if (asic65_command != -1) |
| 161 | asic65_data_w(1, asic65_command, 0); | |
| 161 | asic65_data_w(Machine, 1, asic65_command, 0); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /* update the state */ |
| r1877 | r1878 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | switch (tnzs_input_select & 0x0f) |
| 80 | 80 | { |
| 81 | case 0x0a: data = input_port_4_r(0); break; | |
| 82 | case 0x0c: data = input_port_2_r(0); break; | |
| 83 | case 0x0d: data = input_port_3_r(0); break; | |
| 81 | case 0x0a: data = input_port_4_r(machine,0); break; | |
| 82 | case 0x0c: data = input_port_2_r(machine,0); break; | |
| 83 | case 0x0d: data = input_port_3_r(machine,0); break; | |
| 84 | 84 | default: data = 0xff; break; |
| 85 | 85 | } |
| 86 | 86 | |
| r1877 | r1878 | |
| 91 | 91 | |
| 92 | 92 | READ8_HANDLER( tnzs_port2_r ) |
| 93 | 93 | { |
| 94 | int data = input_port_4_r(0); | |
| 94 | int data = input_port_4_r(machine,0); | |
| 95 | 95 | |
| 96 | 96 | // logerror("I8742:%04x Read %02x from port 2\n", activecpu_get_previouspc(), data); |
| 97 | 97 | |
| r1877 | r1878 | |
| 613 | 613 | { |
| 614 | 614 | case MCU_TNZS: |
| 615 | 615 | case MCU_CHUKATAI: |
| 616 | return mcu_tnzs_r(offset); | |
| 616 | return mcu_tnzs_r(machine,offset); | |
| 617 | 617 | break; |
| 618 | 618 | case MCU_ARKANOID: |
| 619 | return mcu_arknoid2_r(offset); | |
| 619 | return mcu_arknoid2_r(machine,offset); | |
| 620 | 620 | break; |
| 621 | 621 | case MCU_EXTRMATN: |
| 622 | 622 | case MCU_DRTOPPEL: |
| 623 | 623 | case MCU_PLUMPOP: |
| 624 | return mcu_extrmatn_r(offset); | |
| 624 | return mcu_extrmatn_r(machine,offset); | |
| 625 | 625 | break; |
| 626 | 626 | default: |
| 627 | 627 | return 0xff; |
| r1877 | r1878 | |
| 635 | 635 | { |
| 636 | 636 | case MCU_TNZS: |
| 637 | 637 | case MCU_CHUKATAI: |
| 638 | mcu_tnzs_w(offset,data); | |
| 638 | mcu_tnzs_w(machine,offset,data); | |
| 639 | 639 | break; |
| 640 | 640 | case MCU_ARKANOID: |
| 641 | mcu_arknoid2_w(offset,data); | |
| 641 | mcu_arknoid2_w(machine,offset,data); | |
| 642 | 642 | break; |
| 643 | 643 | case MCU_EXTRMATN: |
| 644 | 644 | case MCU_DRTOPPEL: |
| 645 | 645 | case MCU_PLUMPOP: |
| 646 | mcu_extrmatn_w(offset,data); | |
| 646 | mcu_extrmatn_w(machine,offset,data); | |
| 647 | 647 | break; |
| 648 | 648 | default: |
| 649 | 649 | break; |
| r1877 | r1878 | |
|---|---|---|
| 129 | 129 | |
| 130 | 130 | void a600xl_mmu(UINT8 new_mmu) |
| 131 | 131 | { |
| 132 | read8_handler rbank2; | |
| 133 | write8_handler wbank2; | |
| 132 | read8_machine_func rbank2; | |
| 133 | write8_machine_func wbank2; | |
| 134 | 134 | |
| 135 | 135 | /* check if self-test ROM changed */ |
| 136 | 136 | if ( new_mmu & 0x80 ) |
| r1877 | r1878 | |
| 153 | 153 | |
| 154 | 154 | void a800xl_mmu(UINT8 new_mmu) |
| 155 | 155 | { |
| 156 | read8_handler rbank1, rbank2, rbank3, rbank4; | |
| 157 | write8_handler wbank1, wbank2, wbank3, wbank4; | |
| 156 | read8_machine_func rbank1, rbank2, rbank3, rbank4; | |
| 157 | write8_machine_func wbank1, wbank2, wbank3, wbank4; | |
| 158 | 158 | UINT8 *base1, *base2, *base3, *base4; |
| 159 | 159 | |
| 160 | 160 | /* check if memory C000-FFFF changed */ |
| r1877 | r1878 | |
| 697 | 697 | |
| 698 | 698 | static void pokey_reset(running_machine *machine) |
| 699 | 699 | { |
| 700 | pokey1_w(15,0); | |
| 700 | pokey1_w(machine,15,0); | |
| 701 | 701 | } |
| 702 | 702 | |
| 703 | 703 |
| r1877 | r1878 | |
|---|---|---|
| 463 | 463 | |
| 464 | 464 | /********************** Terminator 2 **********************/ |
| 465 | 465 | |
| 466 | static void term2_init_common(write16_ | |
| 466 | static void term2_init_common(write16_machin | |
| 467 | 467 | { |
| 468 | 468 | /* protection */ |
| 469 | 469 | static const struct protection_data term2_protection_data = |
| r1877 | r1878 | |
| 579 | 579 | break; |
| 580 | 580 | |
| 581 | 581 | case SOUND_YAWDIM: |
| 582 | soundlatch_w(0, data); | |
| 582 | soundlatch_w(machine, 0, data); | |
| 583 | 583 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); |
| 584 | 584 | break; |
| 585 | 585 | } |
| r1877 | r1878 | |
|---|---|---|
| 77 | 77 | /* Disable and clear hardware interrupt */ |
| 78 | 78 | WRITE8_HANDLER( slapfight_port_06_w ) |
| 79 | 79 | { |
| 80 | interrupt_enable_w(0,0); | |
| 80 | interrupt_enable_w(machine,0,0); | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /* Enable hardware interrupt */ |
| 84 | 84 | WRITE8_HANDLER( slapfight_port_07_w ) |
| 85 | 85 | { |
| 86 | interrupt_enable_w(0,1); | |
| 86 | interrupt_enable_w(machine,0,1); | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | WRITE8_HANDLER( slapfight_port_08_w ) |
| r1877 | r1878 | |
|---|---|---|
| 170 | 170 | |
| 171 | 171 | MACHINE_RESET( asteroid ) |
| 172 | 172 | { |
| 173 | asteroid_bank_switch_w (0,0); | |
| 174 | avgdvg_reset_w (0,0); | |
| 173 | asteroid_bank_switch_w(machine,0,0); | |
| 174 | avgdvg_reset_w(machine,0,0); | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 |
| r1877 | r1878 | |
|---|---|---|
| 92 | 92 | memory_configure_bank(2, 0, 4, memory_region(REGION_CPU1) + 0x10000, 0x2000); |
| 93 | 93 | |
| 94 | 94 | /* reset RAM/ROM banks to 0 */ |
| 95 | mhavoc_ram_banksel_w(0, 0); | |
| 96 | mhavoc_rom_banksel_w(0, 0); | |
| 95 | mhavoc_ram_banksel_w(machine, 0, 0); | |
| 96 | mhavoc_rom_banksel_w(machine, 0, 0); | |
| 97 | 97 | |
| 98 | 98 | /* reset alpha comm status */ |
| 99 | 99 | alpha_data = 0; |
| r1877 | r1878 | |
|---|---|---|
| 329 | 329 | WRITE8_HANDLER(equites_5232_w) |
| 330 | 330 | { |
| 331 | 331 | if (offset < 0x08 && data) data |= 0x80; // gets around a current 5232 emulation restriction |
| 332 | MSM5232_0_w(offset, data); | |
| 332 | MSM5232_0_w(machine, offset, data); | |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | WRITE8_HANDLER(equites_8910control_w) |
| 336 | 336 | { |
| 337 | AY8910_control_port_0_w(0, data); | |
| 337 | AY8910_control_port_0_w(machine, 0, data); | |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | WRITE8_HANDLER(equites_8910data_w) |
| 341 | 341 | { |
| 342 | AY8910_write_port_0_w(0, data); | |
| 342 | AY8910_write_port_0_w(machine, 0, data); | |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | static WRITE8_HANDLER(equites_8910porta_w) |
| r1877 | r1878 | |
|---|---|---|
| 28 | 28 | static UINT8 tape_crc16_lsb[256]; |
| 29 | 29 | static UINT8 tape_crc16_msb[256]; |
| 30 | 30 | |
| 31 | static read8_handler decocass_dongle_r; | |
| 32 | static write8_handler decocass_dongle_w; | |
| 31 | static read8_machine_func decocass_dongle_r; | |
| 32 | static write8_machine_func decocass_dongle_w; | |
| 33 | 33 | |
| 34 | 34 | static UINT8 decocass_reset; |
| 35 | 35 | static UINT8 i8041_p1; |
| r1877 | r1878 | |
| 104 | 104 | WRITE8_HANDLER( decocass_sound_command_w ) |
| 105 | 105 | { |
| 106 | 106 | LOG(2,("CPU #%d sound command -> $%02x\n", cpu_getactivecpu(), data)); |
| 107 | soundlatch_w(0,data); | |
| 107 | soundlatch_w(machine,0,data); | |
| 108 | 108 | decocass_sound_ack |= 0x80; |
| 109 | 109 | /* remove snd cpu data ack bit. i don't see it in the schems, but... */ |
| 110 | 110 | decocass_sound_ack &= ~0x40; |
| 111 | cpunum_set_input_line( | |
| 111 | cpunum_set_input_line(machine, 1, M6502_IRQ_LINE, ASSERT_LINE); | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | READ8_HANDLER( decocass_sound_data_r ) |
| 115 | 115 | { |
| 116 | UINT8 data = soundlatch2_r(0); | |
| 116 | UINT8 data = soundlatch2_r(machine, 0); | |
| 117 | 117 | LOG(2,("CPU #%d sound data <- $%02x\n", cpu_getactivecpu(), data)); |
| 118 | 118 | return data; |
| 119 | 119 | } |
| r1877 | r1878 | |
| 128 | 128 | WRITE8_HANDLER( decocass_sound_data_w ) |
| 129 | 129 | { |
| 130 | 130 | LOG(2,("CPU #%d sound data -> $%02x\n", cpu_getactivecpu(), data)); |
| 131 | soundlatch2_w(0, data); | |
| 131 | soundlatch2_w(machine, 0, data); | |
| 132 | 132 | decocass_sound_ack |= 0x40; |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | READ8_HANDLER( decocass_sound_command_r ) |
| 136 | 136 | { |
| 137 | UINT8 data = soundlatch_r(0); | |
| 137 | UINT8 data = soundlatch_r(machine, 0); | |
| 138 | 138 | LOG(4,("CPU #%d sound command <- $%02x\n", cpu_getactivecpu(), data)); |
| 139 | 139 | cpunum_set_input_line(Machine, 1, M6502_IRQ_LINE, CLEAR_LINE); |
| 140 | 140 | decocass_sound_ack &= ~0x80; |
| r1877 | r1878 | |
| 176 | 176 | |
| 177 | 177 | WRITE8_HANDLER( decocass_nmi_reset_w ) |
| 178 | 178 | { |
| 179 | cpunum_set_input_line( | |
| 179 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE ); | |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | WRITE8_HANDLER( decocass_quadrature_decoder_reset_w ) |
| 183 | 183 | { |
| 184 | 184 | /* just latch the analog controls here */ |
| 185 | decocass_quadrature_decoder[0] = input_port_3_r(0); | |
| 186 | decocass_quadrature_decoder[1] = input_port_4_r(0); | |
| 187 | decocass_quadrature_decoder[2] = input_port_5_r(0); | |
| 188 | decocass_quadrature_decoder[3] = input_port_6_r(0); | |
| 185 | decocass_quadrature_decoder[0] = input_port_3_r(machine, 0); | |
| 186 | decocass_quadrature_decoder[1] = input_port_4_r(machine, 0); | |
| 187 | decocass_quadrature_decoder[2] = input_port_5_r(machine, 0); | |
| 188 | decocass_quadrature_decoder[3] = input_port_6_r(machine, 0); | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | WRITE8_HANDLER( decocass_adc_w ) |
| r1877 | r1878 | |
| 1525 | 1525 | else |
| 1526 | 1526 | { |
| 1527 | 1527 | if (decocass_dongle_r) |
| 1528 | data = (*decocass_dongle_r)(offset); | |
| 1528 | data = (*decocass_dongle_r)(machine, offset); | |
| 1529 | 1529 | else |
| 1530 | 1530 | data = 0xff; |
| 1531 | 1531 | } |
| r1877 | r1878 | |
| 1536 | 1536 | { |
| 1537 | 1537 | if (decocass_dongle_w) |
| 1538 | 1538 | { |
| 1539 | (*decocass_dongle_w)(offset, data); | |
| 1539 | (*decocass_dongle_w)(machine, offset, data); | |
| 1540 | 1540 | return; |
| 1541 | 1541 | } |
| 1542 | 1542 | |
| r1877 | r1878 | |
| 1581 | 1581 | { |
| 1582 | 1582 | /* don't allow writes to the ROMs */ |
| 1583 | 1583 | if (!de0091_enable) |
| 1584 | decocass_charram_w(offset, data); | |
| 1584 | decocass_charram_w(machine, offset, data); | |
| 1585 | 1585 | } |
| 1586 | 1586 | |
| 1587 | 1587 | /*************************************************************************** |
| r1877 | r1878 | |
|---|---|---|
| 25 | 25 | default: |
| 26 | 26 | case 0x00: |
| 27 | 27 | current_car_image = copsnrob_carimage[0]; |
| 28 | keys = input_port_4_r(0); | |
| 28 | keys = input_port_4_r(machine,0); | |
| 29 | 29 | break; |
| 30 | 30 | case 0x04: |
| 31 | 31 | current_car_image = copsnrob_carimage[1]; |
| 32 | keys = input_port_5_r(0); | |
| 32 | keys = input_port_5_r(machine,0); | |
| 33 | 33 | break; |
| 34 | 34 | case 0x08: |
| 35 | 35 | current_car_image = copsnrob_carimage[2]; |
| 36 | keys = input_port_6_r(0); | |
| 36 | keys = input_port_6_r(machine,0); | |
| 37 | 37 | break; |
| 38 | 38 | case 0x0c: |
| 39 | 39 | current_car_image = copsnrob_carimage[3]; |
| 40 | keys = input_port_7_r(0); | |
| 40 | keys = input_port_7_r(machine,0); | |
| 41 | break; | |
| 41 | 42 | } |
| 42 | 43 | |
| 43 | 44 | if (current_car_image < 7) |
| r1877 | r1878 | |
|---|---|---|
| 560 | 560 | } |
| 561 | 561 | else |
| 562 | 562 | { |
| 563 | voodoo_0_w(offset ^ 0x80000, data, mem_mask); | |
| 563 | voodoo_0_w(machine, offset ^ 0x80000, data, mem_mask); | |
| 564 | 564 | } |
| 565 | 565 | } |
| 566 | 566 | |
| r1877 | r1878 | |
| 577 | 577 | } |
| 578 | 578 | else |
| 579 | 579 | { |
| 580 | voodoo_1_w(offset ^ 0x80000, data, mem_mask); | |
| 580 | voodoo_1_w(machine, offset ^ 0x80000, data, mem_mask); | |
| 581 | 581 | } |
| 582 | 582 | } |
| 583 | 583 | |
| r1877 | r1878 | |
| 589 | 589 | } |
| 590 | 590 | else |
| 591 | 591 | { |
| 592 | return voodoo_0_r(offset, mem_mask); | |
| 592 | return voodoo_0_r(machine, offset, mem_mask); | |
| 593 | 593 | } |
| 594 | 594 | } |
| 595 | 595 | |
| r1877 | r1878 | |
| 601 | 601 | } |
| 602 | 602 | else |
| 603 | 603 | { |
| 604 | return voodoo_1_r(offset, mem_mask); | |
| 604 | return voodoo_1_r(machine, offset, mem_mask); | |
| 605 | 605 | } |
| 606 | 606 | } |
| 607 | 607 | |
| r1877 | r1878 | |
| 618 | 618 | } |
| 619 | 619 | else |
| 620 | 620 | { |
| 621 | voodoo_0_w(offset, data, mem_mask); | |
| 621 | voodoo_0_w(machine, offset, data, mem_mask); | |
| 622 | 622 | } |
| 623 | 623 | } |
| 624 | 624 | |
| r1877 | r1878 | |
| 635 | 635 | } |
| 636 | 636 | else |
| 637 | 637 | { |
| 638 | voodoo_1_w(offset, data, mem_mask); | |
| 638 | voodoo_1_w(machine, offset, data, mem_mask); | |
| 639 | 639 | } |
| 640 | 640 | } |
| 641 | 641 | |
| r1877 | r1878 | |
| 643 | 643 | |
| 644 | 644 | #define LED_ON 0xff00ff00 |
| 645 | 645 | |
| 646 | void draw_7segment_led( | |
| 646 | void draw_7segment_led( | |
| 647 | 647 | { |
| 648 | 648 | if ((value & 0x7f) == 0x7f) |
| 649 | 649 | { |
| r1877 | r1878 | |
|---|---|---|
| 209 | 209 | /* set an initial timer to go off on scanline 0 */ |
| 210 | 210 | timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, scanline_callback); |
| 211 | 211 | |
| 212 | irobot_rom_banksel_w(0,0); | |
| 213 | irobot_out0_w(0,0); | |
| 212 | irobot_rom_banksel_w(machine,0,0); | |
| 213 | irobot_out0_w(machine,0,0); | |
| 214 | 214 | irobot_combase = comRAM[0]; |
| 215 | 215 | irobot_combase_mb = comRAM[1]; |
| 216 | 216 | irobot_outx = 0; |
| r1877 | r1878 | |
|---|---|---|
| 372 | 372 | |
| 373 | 373 | /* reset globals */ |
| 374 | 374 | leland_gfx_control = 0x00; |
| 375 | leland_sound_port_w(0, 0xff); | |
| 375 | leland_sound_port_w(machine, 0, 0xff); | |
| 376 | 376 | wcol_enable = 0; |
| 377 | 377 | |
| 378 | 378 | dangerz_x = 512; |
| r1877 | r1878 | |
| 515 | 515 | (*leland_update_master_bank)(); |
| 516 | 516 | |
| 517 | 517 | /* sound control is in the rest */ |
| 518 | leland_80186_control_w(offset, data); | |
| 518 | leland_80186_control_w(machine, offset, data); | |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | |
| r1877 | r1878 | |
| 1156 | 1156 | |
| 1157 | 1157 | case 0x02: /* /GIN2 */ |
| 1158 | 1158 | case 0x12: |
| 1159 | cpunum_set_input_line( | |
| 1159 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 1160 | 1160 | break; |
| 1161 | 1161 | |
| 1162 | 1162 | case 0x03: /* /IGID */ |
| 1163 | 1163 | case 0x13: |
| 1164 | result = AY8910_read_port_0_r(offset); | |
| 1164 | result = AY8910_read_port_0_r(machine, offset); | |
| 1165 | 1165 | break; |
| 1166 | 1166 | |
| 1167 | 1167 | case 0x10: /* /GIN0 */ |
| r1877 | r1878 | |
| 1187 | 1187 | switch (offset) |
| 1188 | 1188 | { |
| 1189 | 1189 | case 0x09: /* /MCONT */ |
| 1190 | cpunum_set_input_line( | |
| 1190 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 1191 | 1191 | wcol_enable = (data & 0x02); |
| 1192 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 1193 | cpunum_set_input_line(Machine, 1, 0, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); | |
| 1192 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 1193 | cpunum_set_input_line(machine, 1, 0, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); | |
| 1194 | 1194 | |
| 1195 | 1195 | if (LOG_EEPROM) logerror("%04X:EE write %d%d%d\n", safe_activecpu_get_pc(), |
| 1196 | 1196 | (data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1); |
| r1877 | r1878 | |
| 1200 | 1200 | break; |
| 1201 | 1201 | |
| 1202 | 1202 | case 0x0a: /* /OGIA */ |
| 1203 | AY8910_control_port_0_w(0, data); | |
| 1203 | AY8910_control_port_0_w(machine, 0, data); | |
| 1204 | 1204 | break; |
| 1205 | 1205 | |
| 1206 | 1206 | case 0x0b: /* /OGID */ |
| 1207 | AY8910_write_port_0_w(0, data); | |
| 1207 | AY8910_write_port_0_w(machine, 0, data); | |
| 1208 | 1208 | break; |
| 1209 | 1209 | |
| 1210 | 1210 | case 0x0c: /* /BKXL */ |
| 1211 | 1211 | case 0x0d: /* /BKXH */ |
| 1212 | 1212 | case 0x0e: /* /BKYL */ |
| 1213 | 1213 | case 0x0f: /* /BKYH */ |
| 1214 | leland_scroll_w(offset - 0x0c, data); | |
| 1214 | leland_scroll_w(machine, offset - 0x0c, data); | |
| 1215 | 1215 | break; |
| 1216 | 1216 | |
| 1217 | 1217 | default: |
| r1877 | r1878 | |
| 1253 | 1253 | case 0x01: /* /BKXH */ |
| 1254 | 1254 | case 0x02: /* /BKYL */ |
| 1255 | 1255 | case 0x03: /* /BKYH */ |
| 1256 | leland_scroll_w(offset, data); | |
| 1256 | leland_scroll_w(machine, offset, data); | |
| 1257 | 1257 | break; |
| 1258 | 1258 | |
| 1259 | 1259 | case 0x04: /* /MBNK */ |
| r1877 | r1878 | |
| 1265 | 1265 | break; |
| 1266 | 1266 | |
| 1267 | 1267 | case 0x05: /* /SLV0 */ |
| 1268 | cpunum_set_input_line(Machine, 1, 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 1269 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 1270 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 1268 | cpunum_set_input_line(machine, 1, 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 1269 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 1270 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 1271 | 1271 | break; |
| 1272 | 1272 | |
| 1273 | 1273 | case 0x08: /* */ |
| r1877 | r1878 | |
| 1291 | 1291 | WRITE8_HANDLER( leland_gated_paletteram_w ) |
| 1292 | 1292 | { |
| 1293 | 1293 | if (wcol_enable) |
| 1294 | paletteram_BBGGGRRR_w(offset, data); | |
| 1294 | paletteram_BBGGGRRR_w(machine, offset, data); | |
| 1295 | 1295 | } |
| 1296 | 1296 | |
| 1297 | 1297 | |
| r1877 | r1878 | |
| 1306 | 1306 | WRITE8_HANDLER( ataxx_paletteram_and_misc_w ) |
| 1307 | 1307 | { |
| 1308 | 1308 | if (wcol_enable) |
| 1309 | paletteram_xxxxRRRRGGGGBBBB_le_w(offset, data); | |
| 1309 | paletteram_xxxxRRRRGGGGBBBB_le_w(machine, offset, data); | |
| 1310 | 1310 | else if (offset == 0x7f8 || offset == 0x7f9) |
| 1311 | leland_master_video_addr_w(offset - 0x7f8, data); | |
| 1311 | leland_master_video_addr_w(machine, offset - 0x7f8, data); | |
| 1312 | 1312 | else if (offset == 0x7fc) |
| 1313 | 1313 | { |
| 1314 | 1314 | xrom1_addr = (xrom1_addr & 0xff00) | (data & 0x00ff); |
| r1877 | r1878 | |
| 1371 | 1371 | WRITE8_HANDLER( leland_sound_port_w ) |
| 1372 | 1372 | { |
| 1373 | 1373 | /* update the graphics banking */ |
| 1374 | leland_gfx_port_w(0, data); | |
| 1374 | leland_gfx_port_w(machine, 0, data); | |
| 1375 | 1375 | |
| 1376 | 1376 | /* set the new value */ |
| 1377 | 1377 | leland_gfx_control = data; |
| r1877 | r1878 | |
|---|---|---|
| 39 | 39 | WRITE32_HANDLER(nwk_voodoo_0_w); |
| 40 | 40 | WRITE32_HANDLER(nwk_voodoo_1_w); |
| 41 | 41 | |
| 42 | void draw_7segment_led( | |
| 42 | void draw_7segment_led( | |
| 43 | 43 | |
| 44 | 44 | #endif |
| r1877 | r1878 | |
|---|---|---|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | |
| 253 | #ifdef UNUSED_FUNCTON | |
| 253 | 254 | INLINE UINT8 unmake_bcd(UINT8 data) |
| 254 | 255 | { |
| 255 | 256 | return ((data & 0xf0) >> 4) * 10 + (data & 0x0f); |
| 256 | 257 | } |
| 258 | #endif | |
| 257 | 259 | |
| 258 | ||
| 259 | 260 | static TIMER_CALLBACK( reset_timer ) |
| 260 | 261 | { |
| 261 | 262 | pic.time_just_written = 0; |
| r1877 | r1878 | |
| 852 | 853 | { |
| 853 | 854 | UINT32 result = 0; |
| 854 | 855 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 855 | result |= midway_ioasic_r(offset*2, 0xffff0000) & 0xffff; | |
| 856 | result |= midway_ioasic_r(machine, offset*2, 0xffff0000) & 0xffff; | |
| 856 | 857 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 857 | result |= (midway_ioasic_r(offset*2+1, 0xffff0000) & 0xffff) << 16; | |
| 858 | result |= (midway_ioasic_r(machine, offset*2+1, 0xffff0000) & 0xffff) << 16; | |
| 858 | 859 | return result; |
| 859 | 860 | } |
| 860 | 861 | |
| r1877 | r1878 | |
| 948 | 949 | WRITE32_HANDLER( midway_ioasic_packed_w ) |
| 949 | 950 | { |
| 950 | 951 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 951 | midway_ioasic_w(offset*2, data & 0xffff, 0xffff0000); | |
| 952 | midway_ioasic_w(machine, offset*2, data & 0xffff, 0xffff0000); | |
| 952 | 953 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 953 | midway_ioasic_w(offset*2+1, data >> 16, 0xffff0000); | |
| 954 | midway_ioasic_w(machine, offset*2+1, data >> 16, 0xffff0000); | |
| 954 | 955 | } |
| 955 | 956 | |
| 956 | 957 | |
| r1877 | r1878 | |
| 1074 | 1075 | |
| 1075 | 1076 | /* offset 0 is a special case */ |
| 1076 | 1077 | if (offset == 0) |
| 1077 | result = ide_controller32_0_r(ideoffs, 0xffff0000); | |
| 1078 | result = ide_controller32_0_r(machine, ideoffs, 0xffff0000); | |
| 1078 | 1079 | |
| 1079 | 1080 | /* everything else is byte-sized */ |
| 1080 | 1081 | else |
| 1081 | result = ide_controller32_0_r(ideoffs, ~(0xff << shift)) >> shift; | |
| 1082 | result = ide_controller32_0_r(machine, ideoffs, ~(0xff << shift)) >> shift; | |
| 1082 | 1083 | return result; |
| 1083 | 1084 | } |
| 1084 | 1085 | |
| r1877 | r1878 | |
| 1091 | 1092 | |
| 1092 | 1093 | /* offset 0 is a special case */ |
| 1093 | 1094 | if (offset == 0) |
| 1094 | ide_controller32_0_w(ideoffs, data, 0xffff0000); | |
| 1095 | ide_controller32_0_w(machine, ideoffs, data, 0xffff0000); | |
| 1095 | 1096 | |
| 1096 | 1097 | /* everything else is byte-sized */ |
| 1097 | 1098 | else |
| 1098 | ide_controller32_0_w(ideoffs, data << shift, ~(0xff << shift)); | |
| 1099 | ide_controller32_0_w(machine, ideoffs, data << shift, ~(0xff << shift)); | |
| 1099 | 1100 | } |
| r1877 | r1878 | |
|---|---|---|
| 24 | 24 | range |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | static UINT8 (*system24temp_sys16_io_io_r)(int port); | |
| 28 | static void (*system24temp_sys16_io_io_w)(int port, UINT8 data); | |
| 27 | static UINT8 (*system24temp_sys16_io_io_r)(running_machine *machine, int port); | |
| 28 | static void (*system24temp_sys16_io_io_w)(running_machine *machine, int port, UINT8 data); | |
| 29 | 29 | static void (*system24temp_sys16_io_cnt_w)(UINT8 data); |
| 30 | 30 | static READ16_HANDLER ((*system24temp_sys16_io_iod_r)); |
| 31 | 31 | static WRITE16_HANDLER((*system24temp_sys16_io_iod_w)); |
| 32 | 32 | static UINT8 system24temp_sys16_io_cnt, system24temp_sys16_io_dir; |
| 33 | 33 | |
| 34 | void system24temp_sys16_io_set_callbacks(UINT8 (*io_r)(int port), | |
| 35 | void (*io_w)(int port, UINT8 data), | |
| 34 | void system24temp_sys16_io_set_callbacks(UINT8 (*io_r)(running_machine *machine, int port), | |
| 35 | void (*io_w)(running_machine *machine, int port, UINT8 data), | |
| 36 | 36 | void (*cnt_w)(UINT8 data), |
| 37 | 37 | READ16_HANDLER ((*iod_r)), |
| 38 | 38 | WRITE16_HANDLER((*iod_w))) |
| r1877 | r1878 | |
| 50 | 50 | { |
| 51 | 51 | // logerror("IO read %02x (%d:%x)\n", offset, cpu_getactivecpu(), activecpu_get_pc()); |
| 52 | 52 | if(offset < 8) |
| 53 | return system24temp_sys16_io_io_r ? system24temp_sys16_io_io_r(offset) : 0xff; | |
| 53 | return system24temp_sys16_io_io_r ? system24temp_sys16_io_io_r(machine,offset) : 0xff; | |
| 54 | 54 | else if (offset < 0x20) { |
| 55 | 55 | switch(offset) { |
| 56 | 56 | case 0x8: |
| r1877 | r1878 | |
| 70 | 70 | return 0xff; |
| 71 | 71 | } |
| 72 | 72 | } else |
| 73 | return system24temp_sys16_io_iod_r ? system24temp_sys16_io_iod_r(offset & 0x1f, mem_mask) : 0xff; | |
| 73 | return system24temp_sys16_io_iod_r ? system24temp_sys16_io_iod_r(machine, offset & 0x1f, mem_mask) : 0xff; | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | READ32_HANDLER(system24temp_sys16_io_dword_r) |
| 77 | 77 | { |
| 78 | return system24temp_sys16_io_r(2*offset, mem_mask)|(system24temp_sys16_io_r(2*offset+1, mem_mask>>16)<<16); | |
| 78 | return system24temp_sys16_io_r(machine, 2*offset, mem_mask)|(system24temp_sys16_io_r(machine,2*offset+1, mem_mask>>16)<<16); | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| r1877 | r1878 | |
| 88 | 88 | return; |
| 89 | 89 | } |
| 90 | 90 | if(system24temp_sys16_io_io_w) |
| 91 | system24temp_sys16_io_io_w(offset, data); | |
| 91 | system24temp_sys16_io_io_w(machine, offset, data); | |
| 92 | 92 | } else if (offset < 0x20) { |
| 93 | 93 | switch(offset) { |
| 94 | 94 | case 0xe: |
| r1877 | r1878 | |
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | if(offset >= 0x20 && system24temp_sys16_io_iod_w) |
| 108 | system24temp_sys16_io_iod_w(offset & 0x1f, data, mem_mask); | |
| 108 | system24temp_sys16_io_iod_w(machine, offset & 0x1f, data, mem_mask); | |
| 109 | 109 | } |
| r1877 | r1878 | |
|---|---|---|
| 146 | 146 | |
| 147 | 147 | READ16_HANDLER( tms57002_data_word_r ) |
| 148 | 148 | { |
| 149 | return(tms57002_data_r(0)); | |
| 149 | return(tms57002_data_r(machine,0)); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | READ16_HANDLER( tms57002_status_word_r ) |
| 153 | 153 | { |
| 154 | return(tms57002_status_r(0)); | |
| 154 | return(tms57002_status_r(machine,0)); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | WRITE16_HANDLER( tms57002_control_word_w ) |
| 158 | 158 | { |
| 159 | tms57002_control_w(0, data); | |
| 159 | tms57002_control_w(machine, 0, data); | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | WRITE16_HANDLER( tms57002_data_word_w ) |
| 163 | 163 | { |
| 164 | tms57002_data_w(0, data); | |
| 164 | tms57002_data_w(machine, 0, data); | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | |
| r1877 | r1878 | |
| 208 | 208 | cliprect->max_y = maxy; |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | INLINE void K053936GP_copyroz32clip( | |
| 211 | INLINE void K053936GP_copyroz32clip( | |
| 212 | 212 | const rectangle *dst_cliprect, const rectangle *src_cliprect, |
| 213 | 213 | UINT32 _startx,UINT32 _starty,int _incxx,int _incxy,int _incyx,int _incyy, |
| 214 | 214 | int tilebpp, int blend, int clip ) |
| r1877 | r1878 | |
| 359 | 359 | |
| 360 | 360 | // adpoted from generic K053936_zoom_draw() |
| 361 | 361 | static void K053936GP_zoom_draw(int chip, UINT16 *ctrl, UINT16 *linectrl, |
| 362 | | |
| 362 | | |
| 363 | 363 | int tilebpp, int blend) |
| 364 | 364 | { |
| 365 | | |
| 365 | | |
| 366 | 366 | rectangle *src_cliprect; |
| 367 | 367 | UINT16 *lineaddr; |
| 368 | 368 | |
| r1877 | r1878 | |
| 427 | 427 | } |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | void K053936GP_0_zoom_draw( | |
| 430 | void K053936GP_0_zoom_draw( | |
| 431 | 431 | tilemap *tmap, int tilebpp, int blend) |
| 432 | 432 | { |
| 433 | 433 | K053936GP_zoom_draw(0,K053936_0_ctrl,K053936_0_linectrl,bitmap,cliprect,tmap,tilebpp,blend); |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | void K053936GP_1_zoom_draw( | |
| 436 | void K053936GP_1_zoom_draw( | |
| 437 | 437 | tilemap *tmap, int tilebpp, int blend) |
| 438 | 438 | { |
| 439 | 439 | K053936GP_zoom_draw(1,K053936_1_ctrl,K053936_1_linectrl,bitmap,cliprect,tmap,tilebpp,blend); |
| r1877 | r1878 | |
| 457 | 457 | pri : 0 = topmost, 255 = backmost (pixel priority) |
| 458 | 458 | */ |
| 459 | 459 | |
| 460 | INLINE void zdrawgfxzoom32GP( | |
| 460 | INLINE void zdrawgfxzoom32GP( | |
| 461 | 461 | UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, |
| 462 | 462 | int scalex, int scaley, int alpha, int drawmode, int zcode, int pri) |
| 463 | 463 | { |
| r1877 | r1878 | |
| 1226 | 1226 | if (gx_objdma && gx_spriteram && K053247_ram) memcpy(gx_spriteram, K053247_ram, 0x1000); |
| 1227 | 1227 | } |
| 1228 | 1228 | |
| 1229 | void konamigx_mixer(running_machine *machine, | |
| 1229 | void konamigx_mixer(running_machine *machine, | |
| 1230 | 1230 | tilemap *sub1, int sub1flags, |
| 1231 | 1231 | tilemap *sub2, int sub2flags, |
| 1232 | 1232 | int mixerflags) |
| r1877 | r1878 | |
|---|---|---|
| 160 | 160 | { |
| 161 | 161 | /* Bit 0x80 is secondary CPU (HD647180) ready signal */ |
| 162 | 162 | logerror("PC:%04x Warning !!! IO reading from $14000a\n",activecpu_get_previouspc()); |
| 163 | return (0x80 | input_port_6_word_r(0,0)) & 0xff; | |
| 163 | return (0x80 | input_port_6_word_r(machine,0,0)) & 0xff; | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | READ16_HANDLER( vimana_input_port_5_word_r ) |
| 167 | 167 | { |
| 168 | 168 | int data, p; |
| 169 | 169 | |
| 170 | p = input_port_5_word_r(0,0); | |
| 170 | p = input_port_5_word_r(machine,0,0); | |
| 171 | 171 | vimana_latch ^= p; |
| 172 | 172 | data = (vimana_latch & p ); |
| 173 | 173 | |
| r1877 | r1878 | |
| 283 | 283 | { |
| 284 | 284 | if (ACCESSING_LSB) |
| 285 | 285 | { |
| 286 | toaplan1_coin_w(offset, data & 0xff); | |
| 286 | toaplan1_coin_w(machine, offset, data & 0xff); | |
| 287 | 287 | } |
| 288 | 288 | if (ACCESSING_MSB && (data&0xff00)) |
| 289 | 289 | { |
| r1877 | r1878 | |
|---|---|---|
| 258 | 258 | } |
| 259 | 259 | return n; |
| 260 | 260 | } |
| 261 | return 0; | |
| 262 | 261 | |
| 263 | 262 | case MCU_ADDRESS1: |
| 264 | 263 | { |
| r1877 | r1878 | |
| 277 | 276 | return address>>8; |
| 278 | 277 | } |
| 279 | 278 | } |
| 280 | return 0; | |
| 281 | 279 | |
| 282 | 280 | case MCU_ADDRESS2: |
| 283 | 281 | { |
| r1877 | r1878 | |
| 296 | 294 | return address>>8; |
| 297 | 295 | } |
| 298 | 296 | } |
| 299 | return 0; | |
| 300 | 297 | |
| 301 | 298 | case MCU_MESSAGE: |
| 302 | 299 | return daikaiju_buffer[1]; |
| r1877 | r1878 | |
| 342 | 339 | |
| 343 | 340 | READ8_HANDLER( daikaiju_mcu_status_r ) |
| 344 | 341 | { |
| 345 | int res = input_port_3_r(0); | |
| 342 | int res = input_port_3_r(machine,0); | |
| 346 | 343 | |
| 347 | 344 | res^=mame_rand(Machine)&3; |
| 348 | 345 | res |=((lsasquad_sound_pending & 0x02)^2)<<3; //inverted flag |
| r1877 | r1878 | |
|---|---|---|
| 21 | 21 | void K053936GP_set_offset(int chip, int xoffs, int yoffs); |
| 22 | 22 | void K053936GP_clip_enable(int chip, int status); |
| 23 | 23 | void K053936GP_set_cliprect(int chip, int minx, int maxx, int miny, int maxy); |
| 24 | void K053936GP_0_zoom_draw(mame_bitmap *bitmap, const rectangle *cliprect, tilemap *tmap, int tilebpp, int blend); | |
| 25 | void K053936GP_1_zoom_draw(mame_bitmap *bitmap, const rectangle *cliprect, tilemap *tmap, int tilebpp, int blend); | |
| 24 | void K053936GP_0_zoom_draw(bitmap_t *bitmap, const rectangle *cliprect, tilemap *tmap, int tilebpp, int blend); | |
| 25 | void K053936GP_1_zoom_draw(bitmap_t *bitmap, const rectangle *cliprect, tilemap *tmap, int tilebpp, int blend); | |
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | |
| r1877 | r1878 | |
| 83 | 83 | #define GXSUB_5BPP 0x05 // 32 colors |
| 84 | 84 | #define GXSUB_8BPP 0x08 // 256 colors |
| 85 | 85 | |
| 86 | void konamigx_mixer(running_machine *machine, | |
| 86 | void konamigx_mixer(running_machine *machine, | |
| 87 | 87 | tilemap *sub1, int sub1flags, |
| 88 | 88 | tilemap *sub2, int sub2flags, |
| 89 | 89 | int mixerflags); |
| r1877 | r1878 | |
|---|---|---|
| 457 | 457 | break; |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | return 0xffff; | |
| 461 | 460 | } |
| 462 | 461 | |
| 463 | 462 | static UINT32 cd_readLong(UINT32 addr) |
| r1877 | r1878 | |
|---|---|---|
| 66 | 66 | ***************************************************************************/ |
| 67 | 67 | READ8_HANDLER( ticket_dispenser_r ) |
| 68 | 68 | { |
| 69 | return ticket_dispenser_0_r(offset); | |
| 69 | return ticket_dispenser_0_r(machine, offset); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | READ8_HANDLER( ticket_dispenser_0_r ) |
| r1877 | r1878 | |
| 86 | 86 | ***************************************************************************/ |
| 87 | 87 | WRITE8_HANDLER( ticket_dispenser_w ) |
| 88 | 88 | { |
| 89 | ticket_dispenser_0_w(offset, data); | |
| 89 | ticket_dispenser_0_w(machine, offset, data); | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | WRITE8_HANDLER( ticket_dispenser_0_w ) |
| r1877 | r1878 | |
|---|---|---|
| 146 | 146 | struct namcoio |
| 147 | 147 | { |
| 148 | 148 | INT32 type; |
| 149 | read8_handler in[4]; | |
| 150 | write8_handler out[2]; | |
| 149 | read8_machine_func in[4]; | |
| 150 | write8_machine_func out[2]; | |
| 151 | 151 | INT32 reset; |
| 152 | 152 | INT32 lastcoins,lastbuttons; |
| 153 | 153 | INT32 credits; |
| r1877 | r1878 | |
| 165 | 165 | static READ8_HANDLER( nop_r ) { return 0x0f; } |
| 166 | 166 | static WRITE8_HANDLER( nop_w ) { } |
| 167 | 167 | |
| 168 | #define READ_PORT(n) (io[chip].in[n](0) & 0x0f) | |
| 169 | #define WRITE_PORT(n,d) io[chip].out[n](0,(d) & 0x0f) | |
| 168 | #define READ_PORT(m,n) (io[chip].in[n](m,0) & 0x0f) | |
| 169 | #define WRITE_PORT(m,n,d) io[chip].out[n](m,0,(d) & 0x0f) | |
| 170 | 170 | |
| 171 | 171 | |
| 172 | 172 | |
| r1877 | r1878 | |
| 184 | 184 | 07: nop |
| 185 | 185 | */ |
| 186 | 186 | |
| 187 | static void namcoio_51XX_write(int chip,int data) | |
| 187 | static void namcoio_51XX_write(running_machine *machine,int chip,int data) | |
| 188 | 188 | { |
| 189 | 189 | data &= 0x07; |
| 190 | 190 | |
| r1877 | r1878 | |
| 282 | 282 | { 0xf, 0xe, 0xd, 0x5, 0xc, 0x9, 0x7, 0x6, 0xb, 0x3, 0xa, 0x4, 0x1, 0x2, 0x0, 0x8 }; |
| 283 | 283 | |
| 284 | 284 | |
| 285 | static UINT8 namcoio_51XX_read(int chip) | |
| 285 | static UINT8 namcoio_51XX_read(running_machine *machine, int chip) | |
| 286 | 286 | { |
| 287 | 287 | LOG(("%04x: custom 51XX read\n",activecpu_get_pc())); |
| 288 | 288 | |
| r1877 | r1878 | |
| 291 | 291 | switch ((io[chip].in_count++) % 3) |
| 292 | 292 | { |
| 293 | 293 | default: |
| 294 | case 0: return READ_PORT(0) | (READ_PORT(1) << 4); | |
| 295 | case 1: return READ_PORT(2) | (READ_PORT(3) << 4); | |
| 294 | case 0: return READ_PORT(machine,0) | (READ_PORT(machine,1) << 4); | |
| 295 | case 1: return READ_PORT(machine,2) | (READ_PORT(machine,3) << 4); | |
| 296 | 296 | case 2: return 0; // nothing? |
| 297 | 297 | } |
| 298 | 298 | } |
| r1877 | r1878 | |
| 305 | 305 | { |
| 306 | 306 | int in,toggle; |
| 307 | 307 | |
| 308 | in = ~(READ_PORT(0) | (READ_PORT(1) << 4)); | |
| 308 | in = ~(READ_PORT(machine,0) | (READ_PORT(machine,1) << 4)); | |
| 309 | 309 | toggle = in ^ io[chip].lastcoins; |
| 310 | 310 | io[chip].lastcoins = in; |
| 311 | 311 | |
| r1877 | r1878 | |
| 313 | 313 | { |
| 314 | 314 | if (io[chip].credits >= 99) |
| 315 | 315 | { |
| 316 | WRITE_PORT(1,1); // coin lockout | |
| 316 | WRITE_PORT(machine,1,1); // coin lockout | |
| 317 | 317 | } |
| 318 | 318 | else |
| 319 | 319 | { |
| 320 | WRITE_PORT(1,0); // coin lockout | |
| 320 | WRITE_PORT(machine,1,0); // coin lockout | |
| 321 | 321 | /* check if the user inserted a coin */ |
| 322 | 322 | if (toggle & in & 0x10) |
| 323 | 323 | { |
| 324 | 324 | io[chip].coins[0]++; |
| 325 | WRITE_PORT(0,0x04); // coin counter | |
| 326 | WRITE_PORT(0,0x0c); | |
| 325 | WRITE_PORT(machine,0,0x04); // coin counter | |
| 326 | WRITE_PORT(machine,0,0x0c); | |
| 327 | 327 | if (io[chip].coins[0] >= io[chip].coins_per_cred[0]) |
| 328 | 328 | { |
| 329 | 329 | io[chip].credits += io[chip].creds_per_coin[0]; |
| r1877 | r1878 | |
| 333 | 333 | if (toggle & in & 0x20) |
| 334 | 334 | { |
| 335 | 335 | io[chip].coins[1]++; |
| 336 | WRITE_PORT(0,0x08); // coin counter | |
| 337 | WRITE_PORT(0,0x0c); | |
| 336 | WRITE_PORT(machine,0,0x08); // coin counter | |
| 337 | WRITE_PORT(machine,0,0x0c); | |
| 338 | 338 | if (io[chip].coins[1] >= io[chip].coins_per_cred[1]) |
| 339 | 339 | { |
| 340 | 340 | io[chip].credits += io[chip].creds_per_coin[1]; |
| r1877 | r1878 | |
| 351 | 351 | |
| 352 | 352 | if (io[chip].mode == 1) |
| 353 | 353 | { |
| 354 | int on = ( | |
| 354 | int on = (vid | |
| 355 | 355 | |
| 356 | 356 | if (io[chip].credits >= 2) |
| 357 | WRITE_PORT(0,0x0c | 3*on); // lamps | |
| 357 | WRITE_PORT(machine,0,0x0c | 3*on); // lamps | |
| 358 | 358 | else if (io[chip].credits >= 1) |
| 359 | WRITE_PORT(0,0x0c | 2*on); // lamps | |
| 359 | WRITE_PORT(machine,0,0x0c | 2*on); // lamps | |
| 360 | 360 | else |
| 361 | WRITE_PORT(0,0x0c); // lamps off | |
| 361 | WRITE_PORT(machine,0,0x0c); // lamps off | |
| 362 | 362 | |
| 363 | 363 | /* check for 1 player start button */ |
| 364 | 364 | if (toggle & in & 0x04) |
| r1877 | r1878 | |
| 367 | 367 | { |
| 368 | 368 | io[chip].credits--; |
| 369 | 369 | io[chip].mode = 2; |
| 370 | WRITE_PORT(0,0x0c); // lamps off | |
| 370 | WRITE_PORT(machine,0,0x0c); // lamps off | |
| 371 | 371 | } |
| 372 | 372 | } |
| 373 | 373 | /* check for 2 players start button */ |
| r1877 | r1878 | |
| 377 | 377 | { |
| 378 | 378 | io[chip].credits -= 2; |
| 379 | 379 | io[chip].mode = 2; |
| 380 | WRITE_PORT(0,0x0c); // lamps off | |
| 380 | WRITE_PORT(machine,0,0x0c); // lamps off | |
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | } |
| r1877 | r1878 | |
| 390 | 390 | |
| 391 | 391 | case 1: |
| 392 | 392 | { |
| 393 | int joy = READ_PORT(2) & 0x0f; | |
| 393 | int joy = READ_PORT(machine,2) & 0x0f; | |
| 394 | 394 | int in,toggle; |
| 395 | 395 | |
| 396 | in = ~READ_PORT(0); | |
| 396 | in = ~READ_PORT(machine,0); | |
| 397 | 397 | toggle = in ^ io[chip].lastbuttons; |
| 398 | 398 | io[chip].lastbuttons = (io[chip].lastbuttons & 2) | (in & 1); |
| 399 | 399 | |
| r1877 | r1878 | |
| 409 | 409 | |
| 410 | 410 | case 2: |
| 411 | 411 | { |
| 412 | int joy = READ_PORT(3) & 0x0f; | |
| 412 | int joy = READ_PORT(machine,3) & 0x0f; | |
| 413 | 413 | int in,toggle; |
| 414 | 414 | |
| 415 | in = ~READ_PORT(0); | |
| 415 | in = ~READ_PORT(machine,0); | |
| 416 | 416 | toggle = in ^ io[chip].lastbuttons; |
| 417 | 417 | io[chip].lastbuttons = (io[chip].lastbuttons & 1) | (in & 2); |
| 418 | 418 | |
| r1877 | r1878 | |
| 439 | 439 | #define IORAM_WRITE(offset,data) {namcoio_ram[chip * 0x10 + (offset)] = (data) & 0x0f;} |
| 440 | 440 | |
| 441 | 441 | |
| 442 | static void handle_coins(int chip,int swap) | |
| 442 | static void handle_coins(running_machine *machine,int chip,int swap) | |
| 443 | 443 | { |
| 444 | 444 | int val,toggled; |
| 445 | 445 | int credit_add = 0; |
| r1877 | r1878 | |
| 448 | 448 | |
| 449 | 449 | //popmessage("%x %x %x %x %x %x %x %x",IORAM_READ(8),IORAM_READ(9),IORAM_READ(10),IORAM_READ(11),IORAM_READ(12),IORAM_READ(13),IORAM_READ(14),IORAM_READ(15)); |
| 450 | 450 | |
| 451 | val = ~READ_PORT(0); // pins 38-41 | |
| 451 | val = ~READ_PORT(machine,0); // pins 38-41 | |
| 452 | 452 | toggled = val ^ io[chip].lastcoins; |
| 453 | 453 | io[chip].lastcoins = val; |
| 454 | 454 | |
| r1877 | r1878 | |
| 480 | 480 | credit_add = 1; |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | val = ~READ_PORT(3); // pins 30-33 | |
| 483 | val = ~READ_PORT(machine,3); // pins 30-33 | |
| 484 | 484 | toggled = val ^ io[chip].lastbuttons; |
| 485 | 485 | io[chip].lastbuttons = val; |
| 486 | 486 | |
| r1877 | r1878 | |
| 504 | 504 | IORAM_WRITE(1 ^ swap, io[chip].credits % 10); // BCD credits |
| 505 | 505 | IORAM_WRITE(2 ^ swap, credit_add); // credit increment (coin inputs) |
| 506 | 506 | IORAM_WRITE(3 ^ swap, credit_sub); // credit decrement (start buttons) |
| 507 | IORAM_WRITE(4, ~READ_PORT(1)); // pins 22-25 | |
| 507 | IORAM_WRITE(4, ~READ_PORT(machine,1)); // pins 22-25 | |
| 508 | 508 | button = ((val & 0x05) << 1) | (val & toggled & 0x05); |
| 509 | 509 | IORAM_WRITE(5, button); // pins 30 & 32 normal and impulse |
| 510 | IORAM_WRITE(6, ~READ_PORT(2)); // pins 26-29 | |
| 510 | IORAM_WRITE(6, ~READ_PORT(machine,2)); // pins 26-29 | |
| 511 | 511 | button = (val & 0x0a) | ((val & toggled & 0x0a) >> 1); |
| 512 | 512 | IORAM_WRITE(7, button); // pins 31 & 33 normal and impulse |
| 513 | 513 | } |
| 514 | 514 | |
| 515 | 515 | |
| 516 | 516 | |
| 517 | static void namco_customio_56XX_run(int chip) | |
| 517 | static void namco_customio_56XX_run(running_machine *machine, int chip) | |
| 518 | 518 | { |
| 519 | 519 | LOG(("execute 56XX %d mode %d\n",chip,IORAM_READ(8))); |
| 520 | 520 | |
| r1877 | r1878 | |
| 524 | 524 | break; |
| 525 | 525 | |
| 526 | 526 | case 1: // read switch inputs |
| 527 | IORAM_WRITE(0, ~READ_PORT(0)); // pins 38-41 | |
| 528 | IORAM_WRITE(1, ~READ_PORT(1)); // pins 22-25 | |
| 529 | IORAM_WRITE(2, ~READ_PORT(2)); // pins 26-29 | |
| 530 | IORAM_WRITE(3, ~READ_PORT(3)); // pins 30-33 | |
| 527 | IORAM_WRITE(0, ~READ_PORT(machine,0)); // pins 38-41 | |
| 528 | IORAM_WRITE(1, ~READ_PORT(machine,1)); // pins 22-25 | |
| 529 | IORAM_WRITE(2, ~READ_PORT(machine,2)); // pins 26-29 | |
| 530 | IORAM_WRITE(3, ~READ_PORT(machine,3)); // pins 30-33 | |
| 531 | 531 | |
| 532 | 532 | //popmessage("%x %x %x %x %x %x %x %x",IORAM_READ(8),IORAM_READ(9),IORAM_READ(10),IORAM_READ(11),IORAM_READ(12),IORAM_READ(13),IORAM_READ(14),IORAM_READ(15)); |
| 533 | 533 | |
| 534 | WRITE_PORT(0,IORAM_READ(9)); // output to pins 13-16 (motos, pacnpal, gaplus) | |
| 535 | WRITE_PORT(1,IORAM_READ(10)); // output to pins 17-20 (gaplus) | |
| 534 | WRITE_PORT(machine,0,IORAM_READ(9)); // output to pins 13-16 (motos, pacnpal, gaplus) | |
| 535 | WRITE_PORT(machine,1,IORAM_READ(10)); // output to pins 17-20 (gaplus) | |
| 536 | 536 | break; |
| 537 | 537 | |
| 538 | 538 | case 2: // initialize coinage settings |
| r1877 | r1878 | |
| 547 | 547 | |
| 548 | 548 | case 4: // druaga, digdug chip #1: read dip switches and inputs |
| 549 | 549 | // superpac chip #0: process coin and start inputs, read switch inputs |
| 550 | handle_coins(chip,0); | |
| 550 | handle_coins(machine,chip,0); | |
| 551 | 551 | break; |
| 552 | 552 | |
| 553 | 553 | case 7: // bootup check (liblrabl only) |
| r1877 | r1878 | |
| 575 | 575 | break; |
| 576 | 576 | |
| 577 | 577 | case 9: // read dip switches and inputs |
| 578 | WRITE_PORT(0,0); // set pin 13 = 0 | |
| 579 | IORAM_WRITE(0, ~READ_PORT(0)); // pins 38-41, pin 13 = 0 | |
| 580 | IORAM_WRITE(2, ~READ_PORT(1)); // pins 22-25, pin 13 = 0 | |
| 581 | IORAM_WRITE(4, ~READ_PORT(2)); // pins 26-29, pin 13 = 0 | |
| 582 | IORAM_WRITE(6, ~READ_PORT(3)); // pins 30-33, pin 13 = 0 | |
| 583 | WRITE_PORT(0,1); // set pin 13 = 1 | |
| 584 | IORAM_WRITE(1, ~READ_PORT(0)); // pins 38-41, pin 13 = 1 | |
| 585 | IORAM_WRITE(3, ~READ_PORT(1)); // pins 22-25, pin 13 = 1 | |
| 586 | IORAM_WRITE(5, ~READ_PORT(2)); // pins 26-29, pin 13 = 1 | |
| 587 | IORAM_WRITE(7, ~READ_PORT(3)); // pins 30-33, pin 13 = 1 | |
| 578 | WRITE_PORT(machine,0,0); // set pin 13 = 0 | |
| 579 | IORAM_WRITE(0, ~READ_PORT(machine,0)); // pins 38-41, pin 13 = 0 | |
| 580 | IORAM_WRITE(2, ~READ_PORT(machine,1)); // pins 22-25, pin 13 = 0 | |
| 581 | IORAM_WRITE(4, ~READ_PORT(machine,2)); // pins 26-29, pin 13 = 0 | |
| 582 | IORAM_WRITE(6, ~READ_PORT(machine,3)); // pins 30-33, pin 13 = 0 | |
| 583 | WRITE_PORT(machine,0,1); // set pin 13 = 1 | |
| 584 | IORAM_WRITE(1, ~READ_PORT(machine,0)); // pins 38-41, pin 13 = 1 | |
| 585 | IORAM_WRITE(3, ~READ_PORT(machine,1)); // pins 22-25, pin 13 = 1 | |
| 586 | IORAM_WRITE(5, ~READ_PORT(machine,2)); // pins 26-29, pin 13 = 1 | |
| 587 | IORAM_WRITE(7, ~READ_PORT(machine,3)); // pins 30-33, pin 13 = 1 | |
| 588 | 588 | break; |
| 589 | 589 | |
| 590 | 590 | default: |
| r1877 | r1878 | |
| 594 | 594 | |
| 595 | 595 | |
| 596 | 596 | |
| 597 | static void namco_customio_59XX_run(int chip) | |
| 597 | static void namco_customio_59XX_run(running_machine *machine, int chip) | |
| 598 | 598 | { |
| 599 | 599 | LOG(("execute 59XX %d mode %d\n",chip,IORAM_READ(8))); |
| 600 | 600 | |
| r1877 | r1878 | |
| 604 | 604 | break; |
| 605 | 605 | |
| 606 | 606 | case 3: // pacnpal chip #1: read dip switches and inputs |
| 607 | IORAM_WRITE(4, ~READ_PORT(0)); // pins 38-41, pin 13 = 0 ? | |
| 608 | IORAM_WRITE(5, ~READ_PORT(2)); // pins 26-29 ? | |
| 609 | IORAM_WRITE(6, ~READ_PORT(1)); // pins 22-25 ? | |
| 610 | IORAM_WRITE(7, ~READ_PORT(3)); // pins 30-33 | |
| 607 | IORAM_WRITE(4, ~READ_PORT(machine,0)); // pins 38-41, pin 13 = 0 ? | |
| 608 | IORAM_WRITE(5, ~READ_PORT(machine,2)); // pins 26-29 ? | |
| 609 | IORAM_WRITE(6, ~READ_PORT(machine,1)); // pins 22-25 ? | |
| 610 | IORAM_WRITE(7, ~READ_PORT(machine,3)); // pins 30-33 | |
| 611 | 611 | break; |
| 612 | 612 | |
| 613 | 613 | default: |
| r1877 | r1878 | |
| 617 | 617 | |
| 618 | 618 | |
| 619 | 619 | |
| 620 | static void namco_customio_58XX_run(int chip) | |
| 620 | static void namco_customio_58XX_run(running_machine *machine, int chip) | |
| 621 | 621 | { |
| 622 | 622 | LOG(("execute 58XX %d mode %d\n",chip,IORAM_READ(8))); |
| 623 | 623 | |
| r1877 | r1878 | |
| 627 | 627 | break; |
| 628 | 628 | |
| 629 | 629 | case 1: // read switch inputs |
| 630 | IORAM_WRITE(4, ~READ_PORT(0)); // pins 38-41 | |
| 631 | IORAM_WRITE(5, ~READ_PORT(1)); // pins 22-25 | |
| 632 | IORAM_WRITE(6, ~READ_PORT(2)); // pins 26-29 | |
| 633 | IORAM_WRITE(7, ~READ_PORT(3)); // pins 30-33 | |
| 630 | IORAM_WRITE(4, ~READ_PORT(machine,0)); // pins 38-41 | |
| 631 | IORAM_WRITE(5, ~READ_PORT(machine,1)); // pins 22-25 | |
| 632 | IORAM_WRITE(6, ~READ_PORT(machine,2)); // pins 26-29 | |
| 633 | IORAM_WRITE(7, ~READ_PORT(machine,3)); // pins 30-33 | |
| 634 | 634 | |
| 635 | 635 | //popmessage("%x %x %x %x %x %x %x %x",IORAM_READ(8),IORAM_READ(9),IORAM_READ(10),IORAM_READ(11),IORAM_READ(12),IORAM_READ(13),IORAM_READ(14),IORAM_READ(15)); |
| 636 | 636 | |
| 637 | WRITE_PORT(0,IORAM_READ(9)); // output to pins 13-16 (toypop) | |
| 638 | WRITE_PORT(1,IORAM_READ(10)); // output to pins 17-20 (toypop) | |
| 637 | WRITE_PORT(machine,0,IORAM_READ(9)); // output to pins 13-16 (toypop) | |
| 638 | WRITE_PORT(machine,1,IORAM_READ(10)); // output to pins 17-20 (toypop) | |
| 639 | 639 | break; |
| 640 | 640 | |
| 641 | 641 | case 2: // initialize coinage settings |
| r1877 | r1878 | |
| 649 | 649 | break; |
| 650 | 650 | |
| 651 | 651 | case 3: // process coin and start inputs, read switch inputs |
| 652 | handle_coins(chip,2); | |
| 652 | handle_coins(machine,chip,2); | |
| 653 | 653 | break; |
| 654 | 654 | |
| 655 | 655 | case 4: // read dip switches and inputs |
| 656 | WRITE_PORT(0,0); // set pin 13 = 0 | |
| 657 | IORAM_WRITE(0, ~READ_PORT(0)); // pins 38-41, pin 13 = 0 | |
| 658 | IORAM_WRITE(2, ~READ_PORT(1)); // pins 22-25, pin 13 = 0 | |
| 659 | IORAM_WRITE(4, ~READ_PORT(2)); // pins 26-29, pin 13 = 0 | |
| 660 | IORAM_WRITE(6, ~READ_PORT(3)); // pins 30-33, pin 13 = 0 | |
| 661 | WRITE_PORT(0,1); // set pin 13 = 1 | |
| 662 | IORAM_WRITE(1, ~READ_PORT(0)); // pins 38-41, pin 13 = 1 | |
| 663 | IORAM_WRITE(3, ~READ_PORT(1)); // pins 22-25, pin 13 = 1 | |
| 664 | IORAM_WRITE(5, ~READ_PORT(2)); // pins 26-29, pin 13 = 1 | |
| 665 | IORAM_WRITE(7, ~READ_PORT(3)); // pins 30-33, pin 13 = 1 | |
| 656 | WRITE_PORT(machine,0,0); // set pin 13 = 0 | |
| 657 | IORAM_WRITE(0, ~READ_PORT(machine,0)); // pins 38-41, pin 13 = 0 | |
| 658 | IORAM_WRITE(2, ~READ_PORT(machine,1)); // pins 22-25, pin 13 = 0 | |
| 659 | IORAM_WRITE(4, ~READ_PORT(machine,2)); // pins 26-29, pin 13 = 0 | |
| 660 | IORAM_WRITE(6, ~READ_PORT(machine,3)); // pins 30-33, pin 13 = 0 | |
| 661 | WRITE_PORT(machine,0,1); // set pin 13 = 1 | |
| 662 | IORAM_WRITE(1, ~READ_PORT(machine,0)); // pins 38-41, pin 13 = 1 | |
| 663 | IORAM_WRITE(3, ~READ_PORT(machine,1)); // pins 22-25, pin 13 = 1 | |
| 664 | IORAM_WRITE(5, ~READ_PORT(machine,2)); // pins 26-29, pin 13 = 1 | |
| 665 | IORAM_WRITE(7, ~READ_PORT(machine,3)); // pins 30-33, pin 13 = 1 | |
| 666 | 666 | break; |
| 667 | 667 | |
| 668 | 668 | case 5: // bootup check |
| r1877 | r1878 | |
| 766 | 766 | switch (io[param].type) |
| 767 | 767 | { |
| 768 | 768 | case NAMCOIO_56XX: |
| 769 | namco_customio_56XX_run(param); | |
| 769 | namco_customio_56XX_run(machine, param); | |
| 770 | 770 | break; |
| 771 | 771 | case NAMCOIO_58XX: |
| 772 | namco_customio_58XX_run(param); | |
| 772 | namco_customio_58XX_run(machine, param); | |
| 773 | 773 | break; |
| 774 | 774 | case NAMCOIO_59XX: |
| 775 | namco_customio_59XX_run(param); | |
| 775 | namco_customio_59XX_run(machine, param); | |
| 776 | 776 | break; |
| 777 | 777 | } |
| 778 | 778 | } |
| r1877 | r1878 | |
| 867 | 867 | |
| 868 | 868 | |
| 869 | 869 | |
| 870 | static UINT8 namcoio_53XX_digdug_read(int chip) | |
| 870 | static UINT8 namcoio_53XX_digdug_read(running_machine *machine, int chip) | |
| 871 | 871 | { |
| 872 | 872 | LOG(("%04x: custom 53XX read\n",activecpu_get_pc())); |
| 873 | 873 | |
| 874 | 874 | switch ((io[chip].in_count++) % 2) |
| 875 | 875 | { |
| 876 | 876 | default: |
| 877 | case 0: return READ_PORT(0) | (READ_PORT(1) << 4); | |
| 878 | case 1: return READ_PORT(2) | (READ_PORT(3) << 4); | |
| 877 | case 0: return READ_PORT(machine,0) | (READ_PORT(machine,1) << 4); | |
| 878 | case 1: return READ_PORT(machine,2) | (READ_PORT(machine,3) << 4); | |
| 879 | 879 | } |
| 880 | 880 | } |
| 881 | 881 | |
| 882 | 882 | |
| 883 | static UINT8 namcoio_53XX_polepos_read(int chip) | |
| 883 | static UINT8 namcoio_53XX_polepos_read(running_machine *machine,int chip) | |
| 884 | 884 | { |
| 885 | 885 | LOG(("%04x: custom 53XX read\n",activecpu_get_pc())); |
| 886 | 886 | |
| 887 | 887 | switch ((io[chip].in_count++) % 8) |
| 888 | 888 | { |
| 889 | case 0: return READ_PORT(0) | (READ_PORT(1) << 4); // steering | |
| 890 | case 4: return READ_PORT(2) | (READ_PORT(3) << 4); // dip switches | |
| 889 | case 0: return READ_PORT(machine,0) | (READ_PORT(machine,1) << 4); // steering | |
| 890 | case 4: return READ_PORT(machine,2) | (READ_PORT(machine,3) << 4); // dip switches | |
| 891 | 891 | default: return 0xff; // polepos2 hangs if 0 is returned |
| 892 | 892 | } |
| 893 | 893 | } |
| 894 | 894 | |
| 895 | 895 | |
| 896 | static UINT8 namco_06xx_data_read(int chipnum) | |
| 896 | static UINT8 namco_06xx_data_read(running_machine *machine, int chipnum) | |
| 897 | 897 | { |
| 898 | 898 | LOG(("forwarding read to chip %d\n",chipnum%3)); |
| 899 | 899 | |
| r1877 | r1878 | |
| 901 | 901 | { |
| 902 | 902 | case NAMCOIO_50XX: return namco_50xx_read(); |
| 903 | 903 | case NAMCOIO_50XX_2: return namco_50xx_2_read(); |
| 904 | case NAMCOIO_51XX: return namcoio_51XX_read(chipnum); | |
| 905 | case NAMCOIO_53XX_DIGDUG: return namcoio_53XX_digdug_read(chipnum); | |
| 906 | case NAMCOIO_53XX_POLEPOS: return namcoio_53XX_polepos_read(chipnum); | |
| 904 | case NAMCOIO_51XX: return namcoio_51XX_read(machine, chipnum); | |
| 905 | case NAMCOIO_53XX_DIGDUG: return namcoio_53XX_digdug_read(machine, chipnum); | |
| 906 | case NAMCOIO_53XX_POLEPOS: return namcoio_53XX_polepos_read(machine, chipnum); | |
| 907 | 907 | default: |
| 908 | 908 | logerror("%04x: custom IO type %d unsupported read\n",activecpu_get_pc(),io[chipnum].type); |
| 909 | 909 | return 0xff; |
| r1877 | r1878 | |
| 911 | 911 | } |
| 912 | 912 | |
| 913 | 913 | |
| 914 | static void namco_06xx_data_write(int chipnum,UINT8 data) | |
| 914 | static void namco_06xx_data_write(running_machine *machine,int chipnum,UINT8 data) | |
| 915 | 915 | { |
| 916 | 916 | LOG(("forwarding write to chip %d\n",chipnum%3)); |
| 917 | 917 | |
| r1877 | r1878 | |
| 919 | 919 | { |
| 920 | 920 | case NAMCOIO_50XX: namco_50xx_write(data); break; |
| 921 | 921 | case NAMCOIO_50XX_2: namco_50xx_2_write(data); break; |
| 922 | case NAMCOIO_51XX: namcoio_51XX_write(chipnum,data); break; | |
| 922 | case NAMCOIO_51XX: namcoio_51XX_write(machine,chipnum,data); break; | |
| 923 | 923 | case NAMCOIO_52XX: namcoio_52XX_write(data); break; |
| 924 | 924 | case NAMCOIO_54XX: namco_54xx_write(data); break; |
| 925 | 925 | default: |
| r1877 | r1878 | |
| 944 | 944 | } |
| 945 | 945 | |
| 946 | 946 | |
| 947 | static UINT8 namco_06xx_data_r(int chip,int offset) | |
| 947 | static UINT8 namco_06xx_data_r(running_machine *machine,int chip,int offset) | |
| 948 | 948 | { |
| 949 | 949 | LOG(("%04x: 06XX #%d read offset %d\n",activecpu_get_pc(),chip,offset)); |
| 950 | 950 | |
| r1877 | r1878 | |
| 956 | 956 | |
| 957 | 957 | switch (customio_command[chip] & 0xf) |
| 958 | 958 | { |
| 959 | case 0x1: return namco_06xx_data_read(4*chip + 0); break; | |
| 960 | case 0x2: return namco_06xx_data_read(4*chip + 1); break; | |
| 961 | case 0x4: return namco_06xx_data_read(4*chip + 2); break; | |
| 962 | case 0x8: return namco_06xx_data_read(4*chip + 3); break; | |
| 959 | case 0x1: return namco_06xx_data_read(machine, 4*chip + 0); break; | |
| 960 | case 0x2: return namco_06xx_data_read(machine, 4*chip + 1); break; | |
| 961 | case 0x4: return namco_06xx_data_read(machine, 4*chip + 2); break; | |
| 962 | case 0x8: return namco_06xx_data_read(machine, 4*chip + 3); break; | |
| 963 | 963 | default: |
| 964 | 964 | logerror("%04x: 06XX #%d read in unsupported mode %02x\n",activecpu_get_pc(),chip,customio_command[chip]); |
| 965 | 965 | return 0xff; |
| r1877 | r1878 | |
| 967 | 967 | } |
| 968 | 968 | |
| 969 | 969 | |
| 970 | static void namco_06xx_data_w(int chip,int offset,int data) | |
| 970 | static void namco_06xx_data_w(running_machine *machine,int chip,int offset,int data) | |
| 971 | 971 | { |
| 972 | 972 | LOG(("%04x: 06XX #%d write offset %d = %02x\n",activecpu_get_pc(),chip,offset,data)); |
| 973 | 973 | |
| r1877 | r1878 | |
| 979 | 979 | |
| 980 | 980 | switch (customio_command[chip] & 0xf) |
| 981 | 981 | { |
| 982 | case 0x1: namco_06xx_data_write(4*chip + 0,data); break; | |
| 983 | case 0x2: namco_06xx_data_write(4*chip + 1,data); break; | |
| 984 | case 0x4: namco_06xx_data_write(4*chip + 2,data); break; | |
| 985 | case 0x8: namco_06xx_data_write(4*chip + 3,data); break; | |
| 982 | case 0x1: namco_06xx_data_write(machine,4*chip + 0,data); break; | |
| 983 | case 0x2: namco_06xx_data_write(machine,4*chip + 1,data); break; | |
| 984 | case 0x4: namco_06xx_data_write(machine,4*chip + 2,data); break; | |
| 985 | case 0x8: namco_06xx_data_write(machine,4*chip + 3,data); break; | |
| 986 | 986 | default: |
| 987 | 987 | logerror("%04x: 06XX #%d write in unsupported mode %02x\n",activecpu_get_pc(),chip,customio_command[chip]); |
| 988 | 988 | break; |
| r1877 | r1878 | |
| 1034 | 1034 | |
| 1035 | 1035 | |
| 1036 | 1036 | |
| 1037 | READ8_HANDLER( namco_06xx_0_data_r ) { return namco_06xx_data_r(0,offset); } | |
| 1038 | READ8_HANDLER( namco_06xx_1_data_r ) { return namco_06xx_data_r(1,offset); } | |
| 1039 | WRITE8_HANDLER( namco_06xx_0_data_w ) { namco_06xx_data_w(0,offset,data); } | |
| 1040 | WRITE8_HANDLER( namco_06xx_1_data_w ) { namco_06xx_data_w(1,offset,data); } | |
| 1037 | READ8_HANDLER( namco_06xx_0_data_r ) { return namco_06xx_data_r(machine,0,offset); } | |
| 1038 | READ8_HANDLER( namco_06xx_1_data_r ) { return namco_06xx_data_r(machine,1,offset); } | |
| 1039 | WRITE8_HANDLER( namco_06xx_0_data_w ) { namco_06xx_data_w(machine,0,offset,data); } | |
| 1040 | WRITE8_HANDLER( namco_06xx_1_data_w ) { namco_06xx_data_w(machine,1,offset,data); } | |
| 1041 | 1041 | READ8_HANDLER( namco_06xx_0_ctrl_r ) { return namco_06xx_ctrl_r(0); } |
| 1042 | 1042 | READ8_HANDLER( namco_06xx_1_ctrl_r ) { return namco_06xx_ctrl_r(1); } |
| 1043 | 1043 | WRITE8_HANDLER( namco_06xx_0_ctrl_w ) { namco_06xx_ctrl_w(0,data); } |
| r1877 | r1878 | |
|---|---|---|
| 118 | 118 | MAPLE_STATUS = 0x21, |
| 119 | 119 | }; |
| 120 | 120 | |
| 121 | UINT32 sysctrl_regs[0x200/4]; | |
| 121 | UINT32 dc_sysctrl_regs[0x200/4]; | |
| 122 | UINT32 dc_coin_counts[2]; | |
| 122 | 123 | static UINT32 maple_regs[0x100/4]; |
| 123 | 124 | static UINT32 dc_rtcregister[4]; |
| 124 | 125 | static UINT32 g1bus_regs[0x100/4]; |
| 125 | 126 | extern UINT32 dma_offset; |
| 126 | 127 | static UINT8 maple0x86data1[0x80]; |
| 127 | 128 | static UINT8 maple0x86data2[0x400]; |
| 128 | static UINT32 coin_counts[8]; | |
| 129 | 129 | |
| 130 | 130 | static const UINT32 maple0x82answer[]= |
| 131 | 131 | { |
| r1877 | r1878 | |
| 163 | 163 | { |
| 164 | 164 | UINT32 ln,lx,le; |
| 165 | 165 | |
| 166 | ln=sysctrl_regs[SB_ISTNRM] & sysctrl_regs[SB_IML6NRM]; | |
| 167 | lx=sysctrl_regs[SB_ISTEXT] & sysctrl_regs[SB_IML6EXT]; | |
| 168 | le=sysctrl_regs[SB_ISTERR] & sysctrl_regs[SB_IML6ERR]; | |
| 166 | ln=dc_sysctrl_regs[SB_ISTNRM] & dc_sysctrl_regs[SB_IML6NRM]; | |
| 167 | lx=dc_sysctrl_regs[SB_ISTEXT] & dc_sysctrl_regs[SB_IML6EXT]; | |
| 168 | le=dc_sysctrl_regs[SB_ISTERR] & dc_sysctrl_regs[SB_IML6ERR]; | |
| 169 | 169 | if (ln | lx | le) |
| 170 | 170 | { |
| 171 | 171 | return 6; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | ln=sysctrl_regs[SB_ISTNRM] & sysctrl_regs[SB_IML4NRM]; | |
| 175 | lx=sysctrl_regs[SB_ISTEXT] & sysctrl_regs[SB_IML4EXT]; | |
| 176 | le=sysctrl_regs[SB_ISTERR] & sysctrl_regs[SB_IML4ERR]; | |
| 174 | ln=dc_sysctrl_regs[SB_ISTNRM] & dc_sysctrl_regs[SB_IML4NRM]; | |
| 175 | lx=dc_sysctrl_regs[SB_ISTEXT] & dc_sysctrl_regs[SB_IML4EXT]; | |
| 176 | le=dc_sysctrl_regs[SB_ISTERR] & dc_sysctrl_regs[SB_IML4ERR]; | |
| 177 | 177 | if (ln | lx | le) |
| 178 | 178 | { |
| 179 | 179 | return 4; |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | ln=sysctrl_regs[SB_ISTNRM] & sysctrl_regs[SB_IML2NRM]; | |
| 183 | lx=sysctrl_regs[SB_ISTEXT] & sysctrl_regs[SB_IML2EXT]; | |
| 184 | le=sysctrl_regs[SB_ISTERR] & sysctrl_regs[SB_IML2ERR]; | |
| 182 | ln=dc_sysctrl_regs[SB_ISTNRM] & dc_sysctrl_regs[SB_IML2NRM]; | |
| 183 | lx=dc_sysctrl_regs[SB_ISTEXT] & dc_sysctrl_regs[SB_IML2EXT]; | |
| 184 | le=dc_sysctrl_regs[SB_ISTERR] & dc_sysctrl_regs[SB_IML2ERR]; | |
| 185 | 185 | if (ln | lx | le) |
| 186 | 186 | { |
| 187 | 187 | return 2; |
| r1877 | r1878 | |
| 194 | 194 | { |
| 195 | 195 | int level; |
| 196 | 196 | |
| 197 | if (sysctrl_regs[SB_ISTERR]) | |
| 197 | if (dc_sysctrl_regs[SB_ISTERR]) | |
| 198 | 198 | { |
| 199 | sysctrl_regs[SB_ISTNRM] |= | |
| 199 | dc_sysctrl_regs[SB_ISTNRM] |= IST_ERROR | |
| 200 | 200 | } |
| 201 | 201 | else |
| 202 | 202 | { |
| 203 | sysctrl_regs[SB_ISTNRM] &= | |
| 203 | dc_sysctrl_regs[SB_ISTNRM] &= ~IST_ERROR; | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | if (sysctrl_regs[SB_ISTEXT]) | |
| 206 | if (dc_sysctrl_regs[SB_ISTEXT]) | |
| 207 | 207 | { |
| 208 | sysctrl_regs[SB_ISTNRM] |= | |
| 208 | dc_sysctrl_regs[SB_ISTNRM] |= IST_G1G2EXTSTAT; | |
| 209 | 209 | } |
| 210 | 210 | else |
| 211 | 211 | { |
| 212 | sysctrl_regs[SB_ISTNRM] &= | |
| 212 | dc_sysctrl_regs[SB_ISTNRM] &= ~IST_G1G2EXTSTAT; | |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | level=compute_interrupt_level(); |
| 216 | cpunum_set_info_int(0,CPUINFO_INT_SH4_IRLn_INPUT,15-level); | |
| 216 | cpunum_set_info_int(0, CPUINFO_INT_SH4_IRLn_INPUT, 15-level); | |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | READ64_HANDLER( dc_sysctrl_r ) |
| r1877 | r1878 | |
| 226 | 226 | #if DEBUG_SYSCTRL |
| 227 | 227 | if ((reg != 0x40) && (reg != 0x41) && (reg != 0x42) && (reg != 0x23) && (reg > 2)) // filter out IRQ status reads |
| 228 | 228 | { |
| 229 | mame_printf_verbose("SYSCTRL: [%08x] read %x @ %x (reg %x: %s), mask %llx (PC=%x)\n", 0x5f6800+reg*4, sysctrl_regs[reg], offset, reg, sysctrl_names[reg], mem_mask, activecpu_get_pc()); | |
| 229 | mame_printf_verbose("SYSCTRL: [%08x] read %x @ %x (reg %x: %s), mask %llx (PC=%x)\n", 0x5f6800+reg*4, dc_sysctrl_regs[reg], offset, reg, sysctrl_names[reg], mem_mask, activecpu_get_pc()); | |
| 230 | 230 | } |
| 231 | 231 | #endif |
| 232 | 232 | |
| 233 | return (UINT64)sysctrl_regs[reg] << shift; | |
| 233 | return (UINT64)dc_sysctrl_regs[reg] << shift; | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | WRITE64_HANDLER( dc_sysctrl_w ) |
| r1877 | r1878 | |
| 242 | 242 | |
| 243 | 243 | reg = decode_reg_64(offset, mem_mask, &shift); |
| 244 | 244 | dat = (UINT32)(data >> shift); |
| 245 | old = sysctrl_regs[reg]; | |
| 246 | sysctrl_regs[reg] = dat; // 5f6800+off*4=dat | |
| 245 | old = dc_sysctrl_regs[reg]; | |
| 246 | dc_sysctrl_regs[reg] = dat; // 5f6800+off*4=dat | |
| 247 | 247 | switch (reg) |
| 248 | 248 | { |
| 249 | 249 | case SB_C2DST: |
| 250 | ddtdata.destination=sysctrl_regs[SB_C2DSTAT]; | |
| 251 | ddtdata.length=sysctrl_regs[SB_C2DLEN]; | |
| 250 | ddtdata.destination=dc_sysctrl_regs[SB_C2DSTAT]; | |
| 251 | ddtdata.length=dc_sysctrl_regs[SB_C2DLEN]; | |
| 252 | 252 | ddtdata.size=1; |
| 253 | 253 | ddtdata.direction=0; |
| 254 | 254 | ddtdata.channel=2; |
| 255 | 255 | ddtdata.mode=25; //011001 |
| 256 | 256 | cpunum_set_info_ptr(0,CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,&ddtdata); |
| 257 | 257 | #if DEBUG_SYSCTRL |
| 258 | mame_printf_verbose("SYSCTRL: Ch2 dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, sysctrl_regs[SB_C2DSTAT],sysctrl_regs[SB_LMMODE0],sysctrl_regs[SB_LMMODE1]); | |
| 258 | mame_printf_verbose("SYSCTRL: Ch2 dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", dc_sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, dc_sysctrl_regs[SB_C2DSTAT],dc_sysctrl_regs[SB_LMMODE0],dc_sysctrl_regs[SB_LMMODE1]); | |
| 259 | 259 | #endif |
| 260 | sysctrl_regs[SB_C2DSTAT]=sysctrl_regs[SB_C2DSTAT]+ddtdata.length; | |
| 261 | sysctrl_regs[SB_C2DLEN]=0; | |
| 262 | sysctrl_regs[SB_C2DST]=0; | |
| 263 | sysctrl_regs[SB_ISTNRM] |= (1 << 19); | |
| 260 | dc_sysctrl_regs[SB_C2DSTAT]=dc_sysctrl_regs[SB_C2DSTAT]+ddtdata.length; | |
| 261 | dc_sysctrl_regs[SB_C2DLEN]=0; | |
| 262 | dc_sysctrl_regs[SB_C2DST]=0; | |
| 263 | dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_CH2; | |
| 264 | 264 | break; |
| 265 | 265 | |
| 266 | 266 | case SB_ISTNRM: |
| 267 | sysctrl_regs[SB_ISTNRM] = old & ~(dat | 0xC0000000); // bits 31,30 ro | |
| 267 | dc_sysctrl_regs[SB_ISTNRM] = old & ~(dat | 0xC0000000); // bits 31,30 ro | |
| 268 | 268 | break; |
| 269 | 269 | |
| 270 | 270 | case SB_ISTEXT: |
| 271 | sysctrl_regs[SB_ISTEXT] = old; | |
| 271 | dc_sysctrl_regs[SB_ISTEXT] = old; | |
| 272 | 272 | break; |
| 273 | 273 | |
| 274 | 274 | case SB_ISTERR: |
| 275 | sysctrl_regs[SB_ISTERR] = old & ~dat; | |
| 275 | dc_sysctrl_regs[SB_ISTERR] = old & ~dat; | |
| 276 | 276 | break; |
| 277 | 277 | } |
| 278 | 278 | update_interrupt_status(); |
| r1877 | r1878 | |
| 530 | 530 | maple0x86data2[pos+14]=readinputportbytag("IN4"); // bits 2Ppush3 2Ppush4 2Ppush5 2Ppush6 2Ppush7 2Ppush8 ... |
| 531 | 531 | // second function |
| 532 | 532 | maple0x86data2[pos+15]=1; // report |
| 533 | maple0x86data2[pos+16]=(coin_counts[0] >> 8) & 0xff; // 1CONDITION, 1SLOT COIN(bit13-8) | |
| 534 | maple0x86data2[pos+17]=coin_counts[0] & 0xff; // 1SLOT COIN(bit7-0) | |
| 535 | maple0x86data2[pos+18]=(coin_counts[1] >> 8) & 0xff; // 2CONDITION, 2SLOT COIN(bit13-8) | |
| 536 | maple0x86data2[pos+19]=coin_counts[1] & 0xff; // 2SLOT COIN(bit7-0) | |
| 533 | maple0x86data2[pos+16]=(dc_coin_counts[0] >> 8) & 0xff; // 1CONDITION, 1SLOT COIN(bit13-8) | |
| 534 | maple0x86data2[pos+17]=dc_coin_counts[0] & 0xff; // 1SLOT COIN(bit7-0) | |
| 535 | maple0x86data2[pos+18]=(dc_coin_counts[1] >> 8) & 0xff; // 2CONDITION, 2SLOT COIN(bit13-8) | |
| 536 | maple0x86data2[pos+19]=dc_coin_counts[1] & 0xff; // 2SLOT COIN(bit7-0) | |
| 537 | 537 | // third function |
| 538 | 538 | maple0x86data2[pos+20]=1; // report |
| 539 | 539 | maple0x86data2[pos+21]=0xff; // channel 1 bits 7-0 |
| r1877 | r1878 | |
| 620 | 620 | } |
| 621 | 621 | } |
| 622 | 622 | |
| 623 | ||
| 623 | INPUT_CHANGED( | |
| 624 | 624 | { |
| 625 | UINT32 | |
| 625 | UINT32 * | |
| 626 | 626 | |
| 627 | c = (newval ^ oldval) & newval; | |
| 628 | b = 1; | |
| 629 | for (a=0;a < 2;a++) | |
| 630 | { | |
| 631 | if (c & b) | |
| 632 | coin_counts[a]++; | |
| 633 | b = b << 1; | |
| 634 | } | |
| 627 | /* check for a 0 -> 1 transition */ | |
| 628 | if (!oldval && newval) | |
| 629 | *counter += 1; | |
| 635 | 630 | } |
| 636 | 631 | |
| 637 | 632 | READ64_HANDLER( dc_gdrom_r ) |
| r1877 | r1878 | |
| 717 | 712 | mame_printf_verbose("G1CTRL: transfer %x from ROM %08x to sdram %08x\n", g1bus_regs[SB_GDLEN], dma_offset, g1bus_regs[SB_GDSTAR]); |
| 718 | 713 | cpunum_set_info_ptr(0, CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA, &ddtdata); |
| 719 | 714 | g1bus_regs[SB_GDST]=0; |
| 720 | sysctrl_regs[SB_ISTNRM] |= | |
| 715 | dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_GDROM; | |
| 721 | 716 | } |
| 722 | 717 | break; |
| 723 | 718 | } |
| r1877 | r1878 | |
| 813 | 808 | |
| 814 | 809 | MACHINE_START( dc ) |
| 815 | 810 | { |
| 816 | input_port_set_changed_callback(port_tag_to_index("COINS"), 0x03, coin_slots_callback, NULL); | |
| 817 | 811 | } |
| 818 | 812 | |
| 819 | 813 | MACHINE_RESET( dc ) |
| r1877 | r1878 | |
| 823 | 817 | /* halt the ARM7 */ |
| 824 | 818 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); |
| 825 | 819 | |
| 826 | memset(sysctrl_regs, 0, sizeof(sysctrl_regs)); | |
| 820 | memset(dc_sysctrl_regs, 0, sizeof(dc_sysctrl_regs)); | |
| 827 | 821 | memset(maple_regs, 0, sizeof(maple_regs)); |
| 828 | 822 | memset(dc_rtcregister, 0, sizeof(dc_rtcregister)); |
| 829 | memset(coin_counts, 0, sizeof(coin_counts)); | |
| 823 | memset(dc_coin_counts, 0, sizeof(dc_coin_counts)); | |
| 830 | 824 | |
| 831 | sysctrl_regs[SB_SBREV] = 0x0b; | |
| 825 | dc_sysctrl_regs[SB_SBREV] = 0x0b; | |
| 832 | 826 | for (a=0;a < 0x80;a++) |
| 833 | 827 | maple0x86data1[a]=0x11+a; |
| 834 | 828 | |
| r1877 | r1878 | |
| 848 | 842 | |
| 849 | 843 | // mame_printf_verbose("AICA REG: [%08x] read %llx, mask %llx\n", 0x700000+reg*4, (UINT64)offset, mem_mask); |
| 850 | 844 | |
| 851 | return (UINT64) AICA_0_r(offset*2, 0x0000)<<shift; | |
| 845 | return (UINT64) AICA_0_r(machine, offset*2, 0x0000)<<shift; | |
| 852 | 846 | } |
| 853 | 847 | |
| 854 | 848 | WRITE64_HANDLER( dc_aica_reg_w ) |
| r1877 | r1878 | |
| 874 | 868 | } |
| 875 | 869 | } |
| 876 | 870 | |
| 877 | AICA_0_w(offset*2, dat, shift ? ((mem_mask>>32)&0xffff) : (mem_mask & 0xffff)); | |
| 871 | AICA_0_w(machine, offset*2, dat, shift ? ((mem_mask>>32)&0xffff) : (mem_mask & 0xffff)); | |
| 878 | 872 | |
| 879 | 873 | // mame_printf_verbose("AICA REG: [%08x=%x] write %llx to %x, mask %llx\n", 0x700000+reg*4, dat, data, offset, mem_mask); |
| 880 | 874 | } |
| 881 | 875 | |
| 882 | 876 | READ32_HANDLER( dc_arm_aica_r ) |
| 883 | 877 | { |
| 884 | return AICA_0_r(offset*2, 0x0000); | |
| 878 | return AICA_0_r(machine, offset*2, 0x0000); | |
| 885 | 879 | } |
| 886 | 880 | |
| 887 | 881 | WRITE32_HANDLER( dc_arm_aica_w ) |
| 888 | 882 | { |
| 889 | AICA_0_w(offset*2, data, mem_mask&0xffff); | |
| 883 | AICA_0_w(machine, offset*2, data, mem_mask&0xffff); | |
| 890 | 884 | } |
| 891 | 885 |
| r1877 | r1878 | |
|---|---|---|
| 259 | 259 | cavelon_banksw(); |
| 260 | 260 | |
| 261 | 261 | if ((offset >= 0x0100) && (offset <= 0x0103)) |
| 262 | return ppi8255_0_r(offset - 0x0100); | |
| 262 | return ppi8255_0_r(machine, offset - 0x0100); | |
| 263 | 263 | else if ((offset >= 0x0200) && (offset <= 0x0203)) |
| 264 | return ppi8255_1_r(offset - 0x0200); | |
| 264 | return ppi8255_1_r(machine, offset - 0x0200); | |
| 265 | 265 | |
| 266 | 266 | return 0xff; |
| 267 | 267 | } |
| r1877 | r1878 | |
| 271 | 271 | cavelon_banksw(); |
| 272 | 272 | |
| 273 | 273 | if ((offset >= 0x0100) && (offset <= 0x0103)) |
| 274 | ppi8255_0_w(offset - 0x0100, data); | |
| 274 | ppi8255_0_w(machine, offset - 0x0100, data); | |
| 275 | 275 | else if ((offset >= 0x0200) && (offset <= 0x0203)) |
| 276 | ppi8255_1_w(offset - 0x0200, data); | |
| 276 | ppi8255_1_w(machine, offset - 0x0200, data); | |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 |
| r1877 | r1878 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | struct namcoio_interface |
| 25 | 25 | { |
| 26 | read8_handler in[4]; /* read handlers for ports A-D */ | |
| 27 | write8_handler out[2]; /* write handlers for ports A-B */ | |
| 26 | read8_machine_func in[4]; /* read handlers for ports A-D */ | |
| 27 | write8_machine_func out[2]; /* write handlers for ports A-B */ | |
| 28 | 28 | }; |
| 29 | 29 | |
| 30 | 30 |
| r1877 | r1878 | |
|---|---|---|
| 32 | 32 | /* Bank handler definitions */ |
| 33 | 33 | typedef struct |
| 34 | 34 | { |
| 35 | read8_handler bank_handler_r; | |
| 36 | write8_handler bank_handler_w; | |
| 35 | read8_machine_func bank_handler_r; | |
| 36 | write8_machine_func bank_handler_w; | |
| 37 | 37 | int bank_offset; |
| 38 | 38 | UINT8 *bank_pointer; |
| 39 | 39 | } bankhandler; |
| r1877 | r1878 | |
| 42 | 42 | static bankhandler namcos1_bank_element[NAMCOS1_MAX_BANK]; |
| 43 | 43 | static bankhandler namcos1_active_bank[16]; |
| 44 | 44 | |
| 45 | static READ8_HANDLER( bank1_r ) { return (*namcos1_active_bank[0].bank_handler_r )(offset + namcos1_active_bank[0].bank_offset); } | |
| 46 | static READ8_HANDLER( bank2_r ) { return (*namcos1_active_bank[1].bank_handler_r )(offset + namcos1_active_bank[1].bank_offset); } | |
| 47 | static READ8_HANDLER( bank3_r ) { return (*namcos1_active_bank[2].bank_handler_r )(offset + namcos1_active_bank[2].bank_offset); } | |
| 48 | static READ8_HANDLER( bank4_r ) { return (*namcos1_active_bank[3].bank_handler_r )(offset + namcos1_active_bank[3].bank_offset); } | |
| 49 | static READ8_HANDLER( bank5_r ) { return (*namcos1_active_bank[4].bank_handler_r )(offset + namcos1_active_bank[4].bank_offset); } | |
| 50 | static READ8_HANDLER( bank6_r ) { return (*namcos1_active_bank[5].bank_handler_r )(offset + namcos1_active_bank[5].bank_offset); } | |
| 51 | static READ8_HANDLER( bank7_r ) { return (*namcos1_active_bank[6].bank_handler_r )(offset + namcos1_active_bank[6].bank_offset); } | |
| 52 | static READ8_HANDLER( bank8_r ) { return (*namcos1_active_bank[7].bank_handler_r )(offset + namcos1_active_bank[7].bank_offset); } | |
| 53 | static READ8_HANDLER( bank9_r ) { return (*namcos1_active_bank[8].bank_handler_r )(offset + namcos1_active_bank[8].bank_offset); } | |
| 54 | static READ8_HANDLER( bank10_r ) { return (*namcos1_active_bank[9].bank_handler_r )(offset + namcos1_active_bank[9].bank_offset); } | |
| 55 | static READ8_HANDLER( bank11_r ) { return (*namcos1_active_bank[10].bank_handler_r)(offset + namcos1_active_bank[10].bank_offset); } | |
| 56 | static READ8_HANDLER( bank12_r ) { return (*namcos1_active_bank[11].bank_handler_r)(offset + namcos1_active_bank[11].bank_offset); } | |
| 57 | static READ8_HANDLER( bank13_r ) { return (*namcos1_active_bank[12].bank_handler_r)(offset + namcos1_active_bank[12].bank_offset); } | |
| 58 | static READ8_HANDLER( bank14_r ) { return (*namcos1_active_bank[13].bank_handler_r)(offset + namcos1_active_bank[13].bank_offset); } | |
| 59 | static READ8_HANDLER( bank15_r ) { return (*namcos1_active_bank[14].bank_handler_r)(offset + namcos1_active_bank[14].bank_offset); } | |
| 60 | static READ8_HANDLER( bank16_r ) { return (*namcos1_active_bank[15].bank_handler_r)(offset + namcos1_active_bank[15].bank_offset); } | |
| 45 | static READ8_HANDLER( bank1_r ) { return (*namcos1_active_bank[0].bank_handler_r )(machine, offset + namcos1_active_bank[0].bank_offset); } | |
| 46 | static READ8_HANDLER( bank2_r ) { return (*namcos1_active_bank[1].bank_handler_r )(machine, offset + namcos1_active_bank[1].bank_offset); } | |
| 47 | static READ8_HANDLER( bank3_r ) { return (*namcos1_active_bank[2].bank_handler_r )(machine, offset + namcos1_active_bank[2].bank_offset); } | |
| 48 | static READ8_HANDLER( bank4_r ) { return (*namcos1_active_bank[3].bank_handler_r )(machine, offset + namcos1_active_bank[3].bank_offset); } | |
| 49 | static READ8_HANDLER( bank5_r ) { return (*namcos1_active_bank[4].bank_handler_r )(machine, offset + namcos1_active_bank[4].bank_offset); } | |
| 50 | static READ8_HANDLER( bank6_r ) { return (*namcos1_active_bank[5].bank_handler_r )(machine, offset + namcos1_active_bank[5].bank_offset); } | |
| 51 | static READ8_HANDLER( bank7_r ) { return (*namcos1_active_bank[6].bank_handler_r )(machine, offset + namcos1_active_bank[6].bank_offset); } | |
| 52 | static READ8_HANDLER( bank8_r ) { return (*namcos1_active_bank[7].bank_handler_r )(machine, offset + namcos1_active_bank[7].bank_offset); } | |
| 53 | static READ8_HANDLER( bank9_r ) { return (*namcos1_active_bank[8].bank_handler_r )(machine, offset + namcos1_active_bank[8].bank_offset); } | |
| 54 | static READ8_HANDLER( bank10_r ) { return (*namcos1_active_bank[9].bank_handler_r )(machine, offset + namcos1_active_bank[9].bank_offset); } | |
| 55 | static READ8_HANDLER( bank11_r ) { return (*namcos1_active_bank[10].bank_handler_r)(machine, offset + namcos1_active_bank[10].bank_offset); } | |
| 56 | static READ8_HANDLER( bank12_r ) { return (*namcos1_active_bank[11].bank_handler_r)(machine, offset + namcos1_active_bank[11].bank_offset); } | |
| 57 | static READ8_HANDLER( bank13_r ) { return (*namcos1_active_bank[12].bank_handler_r)(machine, offset + namcos1_active_bank[12].bank_offset); } | |
| 58 | static READ8_HANDLER( bank14_r ) { return (*namcos1_active_bank[13].bank_handler_r)(machine, offset + namcos1_active_bank[13].bank_offset); } | |
| 59 | static READ8_HANDLER( bank15_r ) { return (*namcos1_active_bank[14].bank_handler_r)(machine, offset + namcos1_active_bank[14].bank_offset); } | |
| 60 | static READ8_HANDLER( bank16_r ) { return (*namcos1_active_bank[15].bank_handler_r)(machine, offset + namcos1_active_bank[15].bank_offset); } | |
| 61 | 61 | |
| 62 | static WRITE8_HANDLER( bank1_w ) { (*namcos1_active_bank[0].bank_handler_w )(offset + namcos1_active_bank[0].bank_offset, data); } | |
| 63 | static WRITE8_HANDLER( bank2_w ) { (*namcos1_active_bank[1].bank_handler_w )(offset + namcos1_active_bank[1].bank_offset, data); } | |
| 64 | static WRITE8_HANDLER( bank3_w ) { (*namcos1_active_bank[2].bank_handler_w )(offset + namcos1_active_bank[2].bank_offset, data); } | |
| 65 | static WRITE8_HANDLER( bank4_w ) { (*namcos1_active_bank[3].bank_handler_w )(offset + namcos1_active_bank[3].bank_offset, data); } | |
| 66 | static WRITE8_HANDLER( bank5_w ) { (*namcos1_active_bank[4].bank_handler_w )(offset + namcos1_active_bank[4].bank_offset, data); } | |
| 67 | static WRITE8_HANDLER( bank6_w ) { (*namcos1_active_bank[5].bank_handler_w )(offset + namcos1_active_bank[5].bank_offset, data); } | |
| 68 | static WRITE8_HANDLER( bank7_w ) { (*namcos1_active_bank[6].bank_handler_w )(offset + namcos1_active_bank[6].bank_offset, data); } | |
| 69 | static WRITE8_HANDLER( bank8_w ) { (*namcos1_active_bank[7].bank_handler_w )(offset + namcos1_active_bank[7].bank_offset, data); } | |
| 70 | static WRITE8_HANDLER( bank9_w ) { (*namcos1_active_bank[8].bank_handler_w )(offset + namcos1_active_bank[8].bank_offset, data); } | |
| 71 | static WRITE8_HANDLER( bank10_w ) { (*namcos1_active_bank[9].bank_handler_w )(offset + namcos1_active_bank[9].bank_offset, data); } | |
| 72 | static WRITE8_HANDLER( bank11_w ) { (*namcos1_active_bank[10].bank_handler_w)(offset + namcos1_active_bank[10].bank_offset, data); } | |
| 73 | static WRITE8_HANDLER( bank12_w ) { (*namcos1_active_bank[11].bank_handler_w)(offset + namcos1_active_bank[11].bank_offset, data); } | |
| 74 | static WRITE8_HANDLER( bank13_w ) { (*namcos1_active_bank[12].bank_handler_w)(offset + namcos1_active_bank[12].bank_offset, data); } | |
| 75 | static WRITE8_HANDLER( bank14_w ) { (*namcos1_active_bank[13].bank_handler_w)(offset + namcos1_active_bank[13].bank_offset, data); } | |
| 76 | static WRITE8_HANDLER( bank15_w ) { (*namcos1_active_bank[14].bank_handler_w)(offset + namcos1_active_bank[14].bank_offset, data); } | |
| 77 | static WRITE8_HANDLER( bank16_w ) { (*namcos1_active_bank[15].bank_handler_w)(offset + namcos1_active_bank[15].bank_offset, data); } | |
| 62 | static WRITE8_HANDLER( bank1_w ) { (*namcos1_active_bank[0].bank_handler_w )(machine, offset + namcos1_active_bank[0].bank_offset, data); } | |
| 63 | static WRITE8_HANDLER( bank2_w ) { (*namcos1_active_bank[1].bank_handler_w )(machine, offset + namcos1_active_bank[1].bank_offset, data); } | |
| 64 | static WRITE8_HANDLER( bank3_w ) { (*namcos1_active_bank[2].bank_handler_w )(machine, offset + namcos1_active_bank[2].bank_offset, data); } | |
| 65 | static WRITE8_HANDLER( bank4_w ) { (*namcos1_active_bank[3].bank_handler_w )(machine, offset + namcos1_active_bank[3].bank_offset, data); } | |
| 66 | static WRITE8_HANDLER( bank5_w ) { (*namcos1_active_bank[4].bank_handler_w )(machine, offset + namcos1_active_bank[4].bank_offset, data); } | |
| 67 | static WRITE8_HANDLER( bank6_w ) { (*namcos1_active_bank[5].bank_handler_w )(machine, offset + namcos1_active_bank[5].bank_offset, data); } | |
| 68 | static WRITE8_HANDLER( bank7_w ) { (*namcos1_active_bank[6].bank_handler_w )(machine, offset + namcos1_active_bank[6].bank_offset, data); } | |
| 69 | static WRITE8_HANDLER( bank8_w ) { (*namcos1_active_bank[7].bank_handler_w )(machine, offset + namcos1_active_bank[7].bank_offset, data); } | |
| 70 | static WRITE8_HANDLER( bank9_w ) { (*namcos1_active_bank[8].bank_handler_w )(machine, offset + namcos1_active_bank[8].bank_offset, data); } | |
| 71 | static WRITE8_HANDLER( bank10_w ) { (*namcos1_active_bank[9].bank_handler_w )(machine, offset + namcos1_active_bank[9].bank_offset, data); } | |
| 72 | static WRITE8_HANDLER( bank11_w ) { (*namcos1_active_bank[10].bank_handler_w)(machine, offset + namcos1_active_bank[10].bank_offset, data); } | |
| 73 | static WRITE8_HANDLER( bank12_w ) { (*namcos1_active_bank[11].bank_handler_w)(machine, offset + namcos1_active_bank[11].bank_offset, data); } | |
| 74 | static WRITE8_HANDLER( bank13_w ) { (*namcos1_active_bank[12].bank_handler_w)(machine, offset + namcos1_active_bank[12].bank_offset, data); } | |
| 75 | static WRITE8_HANDLER( bank14_w ) { (*namcos1_active_bank[13].bank_handler_w)(machine, offset + namcos1_active_bank[13].bank_offset, data); } | |
| 76 | static WRITE8_HANDLER( bank15_w ) { (*namcos1_active_bank[14].bank_handler_w)(machine, offset + namcos1_active_bank[14].bank_offset, data); } | |
| 77 | static WRITE8_HANDLER( bank16_w ) { (*namcos1_active_bank[15].bank_handler_w)(machine, offset + namcos1_active_bank[15].bank_offset, data); } | |
| 78 | 78 | |
| 79 | static const read8_ | |
| 79 | static const read8_machin | |
| 80 | 80 | { |
| 81 | 81 | MRA8_BANK1 ,MRA8_BANK2 ,MRA8_BANK3 ,MRA8_BANK4 , |
| 82 | 82 | MRA8_BANK5 ,MRA8_BANK6 ,MRA8_BANK7 ,MRA8_BANK8 , |
| r1877 | r1878 | |
| 84 | 84 | MRA8_BANK13,MRA8_BANK14,MRA8_BANK15,MRA8_BANK16 |
| 85 | 85 | }; |
| 86 | 86 | |
| 87 | static const write8_ | |
| 87 | static const write8_machin | |
| 88 | 88 | { |
| 89 | 89 | MWA8_BANK1 ,MWA8_BANK2 ,MWA8_BANK3 ,MWA8_BANK4 , |
| 90 | 90 | MWA8_BANK5 ,MWA8_BANK6 ,MWA8_BANK7 ,MWA8_BANK8 , |
| r1877 | r1878 | |
| 92 | 92 | MWA8_BANK13,MWA8_BANK14,MWA8_BANK15,MWA8_BANK16 |
| 93 | 93 | }; |
| 94 | 94 | |
| 95 | static const read8_ | |
| 95 | static const read8_machin | |
| 96 | 96 | { |
| 97 | 97 | bank1_r, bank2_r, bank3_r, bank4_r, |
| 98 | 98 | bank5_r, bank6_r, bank7_r, bank8_r, |
| r1877 | r1878 | |
| 100 | 100 | bank13_r, bank14_r, bank15_r, bank16_r |
| 101 | 101 | }; |
| 102 | 102 | |
| 103 | static const write8_ | |
| 103 | static const write8_machin | |
| 104 | 104 | { |
| 105 | 105 | bank1_w, bank2_w, bank3_w, bank4_w, |
| 106 | 106 | bank5_w, bank6_w, bank7_w, bank8_w, |
| r1877 | r1878 | |
| 599 | 599 | if (wdog == 7 || !namcos1_reset) |
| 600 | 600 | { |
| 601 | 601 | wdog = 0; |
| 602 | watchdog_reset_w(0,0); | |
| 602 | watchdog_reset_w(machine,0,0); | |
| 603 | 603 | } |
| 604 | 604 | } |
| 605 | 605 | |
| r1877 | r1878 | |
| 612 | 612 | offset &= 0x3ff; |
| 613 | 613 | |
| 614 | 614 | /* CUS 30 */ |
| 615 | return namcos1_cus30_r(offset); | |
| 615 | return namcos1_cus30_r(machine,offset); | |
| 616 | 616 | } |
| 617 | 617 | else |
| 618 | 618 | { |
| r1877 | r1878 | |
| 630 | 630 | offset &= 0x3ff; |
| 631 | 631 | |
| 632 | 632 | /* CUS 30 */ |
| 633 | namcos1_cus30_w(offset,data); | |
| 633 | namcos1_cus30_w(machine,offset,data); | |
| 634 | 634 | } |
| 635 | 635 | else |
| 636 | 636 | { |
| r1877 | r1878 | |
| 755 | 755 | * * |
| 756 | 756 | *******************************************************************************/ |
| 757 | 757 | |
| 758 | static void namcos1_install_bank(int start,int end,read8_ | |
| 758 | static void namcos1_install_bank(int start,int end,read8_machin | |
| 759 | 759 | int offset,UINT8 *pointer) |
| 760 | 760 | { |
| 761 | 761 | int i; |
| r1877 | r1878 | |
| 772 | 772 | |
| 773 | 773 | |
| 774 | 774 | |
| 775 | static void namcos1_build_banks(read8_ | |
| 775 | static void namcos1_build_banks(read8_machin | |
| 776 | 776 | { |
| 777 | 777 | int i; |
| 778 | 778 | |
| r1877 | r1878 | |
| 944 | 944 | struct namcos1_specific |
| 945 | 945 | { |
| 946 | 946 | /* keychip */ |
| 947 | read8_handler key_r; | |
| 948 | write8_handler key_w; | |
| 947 | read8_machine_func key_r; | |
| 948 | write8_machine_func key_w; | |
| 949 | 949 | int key_id; |
| 950 | 950 | int key_reg1; |
| 951 | 951 | int key_reg2; |
| r1877 | r1878 | |
|---|---|---|
| 177 | 177 | offs_t region_size = region_size_map[chip->regs[rgn->regbase] & 3]; |
| 178 | 178 | offs_t region_base = (chip->regs[rgn->regbase + 1] << 16) & ~region_size; |
| 179 | 179 | offs_t region_start = region_base + (rgn->regoffs & region_size); |
| 180 | read16_ | |
| 180 | read16_machin | |
| 181 | 181 | int banknum = 0; |
| 182 | 182 | |
| 183 | 183 | /* skip non-ROM regions */ |
| r1877 | r1878 | |
| 343 | 343 | offs_t region_mirror = rgn->mirror & region_size; |
| 344 | 344 | offs_t region_start = region_base + (rgn->regoffs & region_size); |
| 345 | 345 | offs_t region_end = region_start + ((rgn->length - 1 < region_size) ? rgn->length - 1 : region_size); |
| 346 | write16_handler write = rgn->write; | |
| 347 | read16_handler read = rgn->read; | |
| 346 | write16_machine_func write = rgn->write; | |
| 347 | read16_machine_func read = rgn->read; | |
| 348 | 348 | int banknum = 0; |
| 349 | 349 | |
| 350 | 350 | /* check for mapping to banks */ |
| r1877 | r1878 | |
| 411 | 411 | |
| 412 | 412 | READ16_HANDLER( segaic16_memory_mapper_lsb_r ) |
| 413 | 413 | { |
| 414 | return memory_mapper_r(&memory_mapper, offset, segaic16_open_bus_r(0,0)); | |
| 414 | return memory_mapper_r(&memory_mapper, offset, segaic16_open_bus_r(machine,0,0)); | |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 |
| r1877 | r1878 | |
|---|---|---|
| 15 | 15 | offs_t length; /* length in bytes of this entry */ |
| 16 | 16 | offs_t mirror; /* maximal mirror values (will be truncated) */ |
| 17 | 17 | offs_t romoffset; /* offset within REGION_CPU0, or ~0 for independent entries */ |
| 18 | read16_handler read; /* read handler */ | |
| 19 | write16_handler write; /* write handler */ | |
| 18 | read16_machine_func read; /* read handler */ | |
| 19 | write16_machine_func write; /* write handler */ | |
| 20 | 20 | UINT16 ** base; /* pointer to memory base */ |
| 21 | 21 | const char * name; /* friendly name for debugging */ |
| 22 | 22 | }; |
| r1877 | r1878 | |
|---|---|---|
| 82 | 82 | MACHINE_RESET( stfight ) |
| 83 | 83 | { |
| 84 | 84 | // initialise rom bank |
| 85 | stfight_bank_w( 0, 0 ); | |
| 85 | stfight_bank_w( machine, 0, 0 ); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | // It's entirely possible that this bank is never switched out |
| r1877 | r1878 | |
|---|---|---|
| 56 | 56 | { |
| 57 | 57 | if (ACCESSING_LSB) |
| 58 | 58 | { |
| 59 | NMK112_okibank_w(offset, data & 0xff); | |
| 59 | NMK112_okibank_w(machine, offset, data & 0xff); | |
| 60 | 60 | } |
| 61 | 61 | } |
| r1877 | r1878 | |
|---|---|---|
| 47 | 47 | UINT8 pending4a; |
| 48 | 48 | int serial_out; |
| 49 | 49 | int coins; |
| 50 | read8_ | |
| 50 | read8_machin | |
| 51 | 51 | }I8741; |
| 52 | 52 | |
| 53 | 53 | static const struct TAITO8741interface *intf; |
| r1877 | r1878 | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /* 8741 update */ |
| 125 | static void taito8741_update(int num) | |
| 125 | static void taito8741_update(running_machine *machine, int num) | |
| 126 | 126 | { |
| 127 | 127 | I8741 *st,*sst; |
| 128 | 128 | int next = num; |
| r1877 | r1878 | |
| 177 | 177 | else |
| 178 | 178 | { /* port select */ |
| 179 | 179 | st->parallelselect = data & 0x07; |
| 180 | taito8741_hostdata_w(st,st->portHandler ? st->portHandler(st->parallelselect) : 0); | |
| 180 | taito8741_hostdata_w(st,st->portHandler ? st->portHandler(machine,st->parallelselect) : 0); | |
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | } |
| r1877 | r1878 | |
| 188 | 188 | case -1: /* no command data */ |
| 189 | 189 | break; |
| 190 | 190 | case 0x00: /* read from parallel port */ |
| 191 | taito8741_hostdata_w(st,st->portHandler ? st->portHandler(0) : 0 ); | |
| 191 | taito8741_hostdata_w(st,st->portHandler ? st->portHandler(machine,0) : 0 ); | |
| 192 | 192 | break; |
| 193 | 193 | case 0x01: /* read receive buffer 0 */ |
| 194 | 194 | case 0x02: /* read receive buffer 1 */ |
| r1877 | r1878 | |
| 201 | 201 | taito8741_hostdata_w(st,st->rxd[data-1]); |
| 202 | 202 | break; |
| 203 | 203 | case 0x08: /* latch received serial data */ |
| 204 | st->txd[0] = st->portHandler ? st->portHandler(0) : 0; | |
| 204 | st->txd[0] = st->portHandler ? st->portHandler(machine,0) : 0; | |
| 205 | 205 | if( sst ) |
| 206 | 206 | { |
| 207 | 207 | timer_call_after_resynch(NULL, num, taito8741_serial_tx); |
| r1877 | r1878 | |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | /* read status port */ |
| 275 | static int I8741_status_r(int num) | |
| 275 | static int I8741_status_r(running_machine *machine, int num) | |
| 276 | 276 | { |
| 277 | 277 | I8741 *st = &taito8741[num]; |
| 278 | taito8741_update(num); | |
| 278 | taito8741_update(machine, num); | |
| 279 | 279 | LOG(("8741-%d ST Read %02x PC=%04x\n",num,st->status,activecpu_get_pc())); |
| 280 | 280 | return st->status; |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | /* read data port */ |
| 284 | static int I8741_data_r(int num) | |
| 284 | static int I8741_data_r(running_machine *machine, int num) | |
| 285 | 285 | { |
| 286 | 286 | I8741 *st = &taito8741[num]; |
| 287 | 287 | int ret = st->toData; |
| r1877 | r1878 | |
| 289 | 289 | LOG(("8741-%d DATA Read %02x PC=%04x\n",num,ret,activecpu_get_pc())); |
| 290 | 290 | |
| 291 | 291 | /* update chip */ |
| 292 | taito8741_update(num); | |
| 292 | taito8741_update(machine, num); | |
| 293 | 293 | |
| 294 | 294 | switch( st->mode ) |
| 295 | 295 | { |
| 296 | 296 | case TAITO8741_PORT: /* parallel data */ |
| 297 | taito8741_hostdata_w(st,st->portHandler ? st->portHandler(st->parallelselect) : 0); | |
| 297 | taito8741_hostdata_w(st,st->portHandler ? st->portHandler(machine, st->parallelselect) : 0); | |
| 298 | 298 | break; |
| 299 | 299 | } |
| 300 | 300 | return ret; |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | /* Write data port */ |
| 304 | static void I8741_data_w(int num, int data) | |
| 304 | static void I8741_data_w(running_machine *machine, int num, int data) | |
| 305 | 305 | { |
| 306 | 306 | I8741 *st = &taito8741[num]; |
| 307 | 307 | LOG(("8741-%d DATA Write %02x PC=%04x\n",num,data,activecpu_get_pc())); |
| 308 | 308 | st->fromData = data; |
| 309 | 309 | st->status |= 0x02; |
| 310 | 310 | /* update chip */ |
| 311 | taito8741_update(num); | |
| 311 | taito8741_update(machine, num); | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | /* Write command port */ |
| 315 | static void I8741_command_w(int num, int data) | |
| 315 | static void I8741_command_w(running_machine *machine, int num, int data) | |
| 316 | 316 | { |
| 317 | 317 | I8741 *st = &taito8741[num]; |
| 318 | 318 | LOG(("8741-%d CMD Write %02x PC=%04x\n",num,data,activecpu_get_pc())); |
| 319 | 319 | st->fromCmd = data; |
| 320 | 320 | st->status |= 0x04; |
| 321 | 321 | /* update chip */ |
| 322 | taito8741_update(num); | |
| 322 | taito8741_update(machine,num); | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | /* Write port handler */ |
| 326 | 326 | WRITE8_HANDLER( TAITO8741_0_w ) |
| 327 | 327 | { |
| 328 | if(offset&1) I8741_command_w(0,data); | |
| 329 | else I8741_data_w(0,data); | |
| 328 | if(offset&1) I8741_command_w(machine,0,data); | |
| 329 | else I8741_data_w(machine,0,data); | |
| 330 | 330 | } |
| 331 | 331 | WRITE8_HANDLER( TAITO8741_1_w ) |
| 332 | 332 | { |
| 333 | if(offset&1) I8741_command_w(1,data); | |
| 334 | else I8741_data_w(1,data); | |
| 333 | if(offset&1) I8741_command_w(machine,1,data); | |
| 334 | else I8741_data_w(machine,1,data); | |
| 335 | 335 | } |
| 336 | 336 | WRITE8_HANDLER( TAITO8741_2_w ) |
| 337 | 337 | { |
| 338 | if(offset&1) I8741_command_w(2,data); | |
| 339 | else I8741_data_w(2,data); | |
| 338 | if(offset&1) I8741_command_w(machine,2,data); | |
| 339 | else I8741_data_w(machine,2,data); | |
| 340 | 340 | } |
| 341 | 341 | WRITE8_HANDLER( TAITO8741_3_w ) |
| 342 | 342 | { |
| 343 | if(offset&1) I8741_command_w(3,data); | |
| 344 | else I8741_data_w(3,data); | |
| 343 | if(offset&1) I8741_command_w(machine,3,data); | |
| 344 | else I8741_data_w(machine,3,data); | |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | /* Read port handler */ |
| 348 | 348 | READ8_HANDLER( TAITO8741_0_r ) |
| 349 | 349 | { |
| 350 | if(offset&1) return I8741_status_r(0); | |
| 351 | return I8741_data_r(0); | |
| 350 | if(offset&1) return I8741_status_r(machine,0); | |
| 351 | return I8741_data_r(machine,0); | |
| 352 | 352 | } |
| 353 | 353 | READ8_HANDLER( TAITO8741_1_r ) |
| 354 | 354 | { |
| 355 | if(offset&1) return I8741_status_r(1); | |
| 356 | return I8741_data_r(1); | |
| 355 | if(offset&1) return I8741_status_r(machine,1); | |
| 356 | return I8741_data_r(machine,1); | |
| 357 | 357 | } |
| 358 | 358 | READ8_HANDLER( TAITO8741_2_r ) |
| 359 | 359 | { |
| 360 | if(offset&1) return I8741_status_r(2); | |
| 361 | return I8741_data_r(2); | |
| 360 | if(offset&1) return I8741_status_r(machine,2); | |
| 361 | return I8741_data_r(machine,2); | |
| 362 | 362 | } |
| 363 | 363 | READ8_HANDLER( TAITO8741_3_r ) |
| 364 | 364 | { |
| 365 | if(offset&1) return I8741_status_r(3); | |
| 366 | return I8741_data_r(3); | |
| 365 | if(offset&1) return I8741_status_r(machine,3); | |
| 366 | return I8741_data_r(machine,3); | |
| 367 | 367 | } |
| 368 | 368 | /**************************************************************************** |
| 369 | 369 | |
| r1877 | r1878 | |
| 389 | 389 | |
| 390 | 390 | UINT8 rst; |
| 391 | 391 | |
| 392 | read8_ | |
| 392 | read8_machin | |
| 393 | 393 | }JV8741; |
| 394 | 394 | |
| 395 | 395 | static JV8741 i8741[4]; |
| r1877 | r1878 | |
| 442 | 442 | } |
| 443 | 443 | } |
| 444 | 444 | |
| 445 | static void josvolly_8741_w(int num,int offset,int data) | |
| 445 | static void josvolly_8741_w(running_machine *machine,int num,int offset,int data) | |
| 446 | 446 | { |
| 447 | 447 | JV8741 *mcu = &i8741[num]; |
| 448 | 448 | |
| r1877 | r1878 | |
| 470 | 470 | break; |
| 471 | 471 | case 2: |
| 472 | 472 | #if 1 |
| 473 | mcu->rxd = input_port_4_r(0); /* DSW2 */ | |
| 473 | mcu->rxd = input_port_4_r(machine,0); /* DSW2 */ | |
| 474 | 474 | mcu->sts |= 0x01; /* RD ready */ |
| 475 | 475 | #endif |
| 476 | 476 | break; |
| r1877 | r1878 | |
| 496 | 496 | { |
| 497 | 497 | if(josvolly_nmi_enable) |
| 498 | 498 | { |
| 499 | cpunum_set_input_line( | |
| 499 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 500 | 500 | josvolly_nmi_enable = 0; |
| 501 | 501 | } |
| 502 | 502 | } |
| r1877 | r1878 | |
| 505 | 505 | josvolly_8741_do(num); |
| 506 | 506 | } |
| 507 | 507 | |
| 508 | static INT8 josvolly_8741_r(int num,int offset) | |
| 508 | static INT8 josvolly_8741_r(running_machine *machine,int num,int offset) | |
| 509 | 509 | { |
| 510 | 510 | JV8741 *mcu = &i8741[num]; |
| 511 | 511 | int ret; |
| r1877 | r1878 | |
| 513 | 513 | if(offset==1) |
| 514 | 514 | { |
| 515 | 515 | if(mcu->rst) |
| 516 | mcu->rxd = (mcu->initReadPort)(0); /* port in */ | |
| 516 | mcu->rxd = (mcu->initReadPort)(machine,0); /* port in */ | |
| 517 | 517 | ret = mcu->sts; |
| 518 | 518 | LOG(("PC=%04X 8741[%d] SR %02X\n",activecpu_get_pc(),num,ret)); |
| 519 | 519 | } |
| r1877 | r1878 | |
| 528 | 528 | return ret; |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | WRITE8_HANDLER( josvolly_8741_0_w ){ josvolly_8741_w(0,offset,data); } | |
| 532 | READ8_HANDLER( josvolly_8741_0_r ) { return josvolly_8741_r(0,offset); } | |
| 533 | WRITE8_HANDLER( josvolly_8741_1_w ) { josvolly_8741_w(1,offset,data); } | |
| 534 | READ8_HANDLER( josvolly_8741_1_r ) { return josvolly_8741_r(1,offset); } | |
| 531 | WRITE8_HANDLER( josvolly_8741_0_w ){ josvolly_8741_w(machine,0,offset,data); } | |
| 532 | READ8_HANDLER( josvolly_8741_0_r ) { return josvolly_8741_r(machine,0,offset); } | |
| 533 | WRITE8_HANDLER( josvolly_8741_1_w ) { josvolly_8741_w(machine,1,offset,data); } | |
| 534 | READ8_HANDLER( josvolly_8741_1_r ) { return josvolly_8741_r(machine,1,offset); } |
| r1877 | r1878 | |
|---|---|---|
| 17 | 17 | int num; |
| 18 | 18 | int mode[MAX_TAITO8741]; /* program select */ |
| 19 | 19 | int serial_connect[MAX_TAITO8741]; /* serial port connection */ |
| 20 | read8_ | |
| 20 | read8_machin | |
| 21 | 21 | }; |
| 22 | 22 | |
| 23 | 23 | int TAITO8741_start(const struct TAITO8741interface *taito8741intf); |
| r1877 | r1878 | |
|---|---|---|
| 177 | 177 | grudge_steering_result = 0; |
| 178 | 178 | |
| 179 | 179 | /* reset the 6850 chips */ |
| 180 | balsente_m6850_w(0, 3); | |
| 181 | balsente_m6850_sound_w(0, 3); | |
| 180 | balsente_m6850_w(machine, 0, 3); | |
| 181 | balsente_m6850_sound_w(machine, 0, 3); | |
| 182 | 182 | |
| 183 | 183 | /* reset the noise generator */ |
| 184 | 184 | memset(noise_position, 0, sizeof(noise_position)); |
| r1877 | r1878 | |
| 1101 | 1101 | if ((chip_select & 0x3f) != 0x3f) |
| 1102 | 1102 | { |
| 1103 | 1103 | UINT8 temp = chip_select; |
| 1104 | balsente_chip_select_w(0, 0x3f); | |
| 1105 | balsente_chip_select_w(0, temp); | |
| 1104 | balsente_chip_select_w(machine, 0, 0x3f); | |
| 1105 | balsente_chip_select_w(machine, 0, temp); | |
| 1106 | 1106 | } |
| 1107 | 1107 | } |
| 1108 | 1108 |
| r1877 | r1878 | |
|---|---|---|
| 280 | 280 | /* bit 1 ( data & 2 ) enables writes to extra ram, we ignore it */ |
| 281 | 281 | |
| 282 | 282 | /* move along */ |
| 283 | vsnes_in0_w( offset, data ); | |
| 283 | vsnes_in0_w( machine, offset, data ); | |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | /* Most games switch VROM Banks in controller 0 write */ |
| r1877 | r1878 | |
| 295 | 295 | { |
| 296 | 296 | /* This PPU has registers mapped at $2000 and $2001 inverted */ |
| 297 | 297 | /* and no remapped color */ |
| 298 | ||
| 299 | 298 | if ( offset == 0 ) |
| 300 | 299 | { |
| 301 | ppu2c0x_0_w( 1, data ); | |
| 300 | ppu2c0x_0_w( machine, 1, data ); | |
| 302 | 301 | return; |
| 303 | 302 | } |
| 304 | 303 | |
| 305 | ppu2c0x_0_w( 0, data ); | |
| 304 | ppu2c0x_0_w( machine, 0, data ); | |
| 306 | 305 | } |
| 307 | 306 | |
| 308 | 307 | /**********************************************************************************/ |
| r1877 | r1878 | |
| 498 | 497 | static READ8_HANDLER( vsgshoe_security_r ) |
| 499 | 498 | { |
| 500 | 499 | /* low part must be 0x1c */ |
| 501 | return ppu2c0x_0_r( 2 ) | 0x1c; | |
| 500 | return ppu2c0x_0_r( machine, 2 ) | 0x1c; | |
| 502 | 501 | } |
| 503 | 502 | |
| 504 | 503 | static WRITE8_HANDLER( vsgshoe_gun_in0_w ) |
| r1877 | r1878 | |
| 512 | 511 | memcpy (&memory_region( REGION_CPU1 )[0x08000], &memory_region( REGION_CPU1 )[addr], 0x2000); |
| 513 | 512 | } |
| 514 | 513 | |
| 515 | gun_in0_w(offset, data); | |
| 514 | gun_in0_w(machine, offset, data); | |
| 516 | 515 | } |
| 517 | 516 | |
| 518 | 517 | DRIVER_INIT( vsgshoe ) |
| r1877 | r1878 | |
| 773 | 772 | static READ8_HANDLER( topgun_security_r ) |
| 774 | 773 | { |
| 775 | 774 | /* low part must be 0x1b */ |
| 776 | return ppu2c0x_0_r( 2 ) | 0x1b; | |
| 775 | return ppu2c0x_0_r( machine, 2 ) | 0x1b; | |
| 777 | 776 | } |
| 778 | 777 | |
| 779 | 778 | DRIVER_INIT( topgun ) |
| r1877 | r1878 | |
| 1212 | 1211 | static READ8_HANDLER( jajamaru_security_r ) |
| 1213 | 1212 | { |
| 1214 | 1213 | /* low part must be 0x40 */ |
| 1215 | return ppu2c0x_0_r( 2 ) | 0x40; | |
| 1214 | return ppu2c0x_0_r( machine, 2 ) | 0x40; | |
| 1216 | 1215 | } |
| 1217 | 1216 | |
| 1218 | 1217 | DRIVER_INIT( jajamaru ) |
| r1877 | r1878 | |
| 1239 | 1238 | static READ8_HANDLER( mightybj_security_r ) |
| 1240 | 1239 | { |
| 1241 | 1240 | /* low part must be 0x3d */ |
| 1242 | return ppu2c0x_0_r( 2 ) | 0x3d; | |
| 1241 | return ppu2c0x_0_r( machine, 2 ) | 0x3d; | |
| 1243 | 1242 | } |
| 1244 | 1243 | |
| 1245 | 1244 | DRIVER_INIT( mightybj ) |
| r1877 | r1878 | |
| 1267 | 1266 | |
| 1268 | 1267 | /* move along */ |
| 1269 | 1268 | if ( cpu_getactivecpu() == 0 ) |
| 1270 | vsnes_in0_w( offset, data ); | |
| 1269 | vsnes_in0_w( machine, offset, data ); | |
| 1271 | 1270 | else |
| 1272 | vsnes_in0_1_w( offset, data ); | |
| 1271 | vsnes_in0_1_w( machine, offset, data ); | |
| 1273 | 1272 | } |
| 1274 | 1273 | |
| 1275 | 1274 | DRIVER_INIT( vstennis ) |
| r1877 | r1878 | |
|---|---|---|
| 263 | 263 | |
| 264 | 264 | static TIMER_CALLBACK( vblank_stop ) |
| 265 | 265 | { |
| 266 | pia_3_cb1_w(0, 0); | |
| 266 | pia_3_cb1_w(machine, 0, 0); | |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | |
| 270 | 270 | INTERRUPT_GEN( qix_vblank_start ) |
| 271 | 271 | { |
| 272 | pia_3_cb1_w(0, 1); | |
| 272 | pia_3_cb1_w(machine, 0, 1); | |
| 273 | 273 | timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, vblank_stop); |
| 274 | 274 | } |
| 275 | 275 | |
| r1877 | r1878 | |
| 285 | 285 | { |
| 286 | 286 | memory_set_bank(1, (data >> 2) & 1); |
| 287 | 287 | /* not necessary, but technically correct */ |
| 288 | qix_palettebank_w(offset, data); | |
| 288 | qix_palettebank_w(machine, offset, data); | |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | |
| r1877 | r1878 | |
| 364 | 364 | |
| 365 | 365 | static TIMER_CALLBACK( deferred_pia_4_porta_w ) |
| 366 | 366 | { |
| 367 | pia_4_porta_w(0, param); | |
| 367 | pia_4_porta_w(machine, 0, param); | |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | |
| r1877 | r1878 | |
| 532 | 532 | |
| 533 | 533 | static TIMER_CALLBACK( pia_0_w_callback ) |
| 534 | 534 | { |
| 535 | pia_0_w(param >> 8, param & 0xff); | |
| 535 | pia_0_w(machine, param >> 8, param & 0xff); | |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | |
| r1877 | r1878 | |
| 575 | 575 | static WRITE8_HANDLER( slither_76489_0_w ) |
| 576 | 576 | { |
| 577 | 577 | /* write to the sound chip */ |
| 578 | SN76496_0_w(0, data); | |
| 578 | SN76496_0_w(machine, 0, data); | |
| 579 | 579 | |
| 580 | 580 | /* clock the ready line going back into CB1 */ |
| 581 | pia_1_cb1_w(0, 0); | |
| 582 | pia_1_cb1_w(0, 1); | |
| 581 | pia_1_cb1_w(machine, 0, 0); | |
| 582 | pia_1_cb1_w(machine, 0, 1); | |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | |
| 586 | 586 | static WRITE8_HANDLER( slither_76489_1_w ) |
| 587 | 587 | { |
| 588 | 588 | /* write to the sound chip */ |
| 589 | SN76496_1_w(0, data); | |
| 589 | SN76496_1_w(machine, 0, data); | |
| 590 | 590 | |
| 591 | 591 | /* clock the ready line going back into CB1 */ |
| 592 | pia_2_cb1_w(0, 0); | |
| 593 | pia_2_cb1_w(0, 1); | |
| 592 | pia_2_cb1_w(machine, 0, 0); | |
| 593 | pia_2_cb1_w(machine, 0, 1); | |
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 |
| r1877 | r1878 | |
|---|---|---|
| 276 | 276 | timer_adjust_oneshot(snes_scanline_timer, video_screen_get_time_until_pos(0, nextscan, 0), 0); |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | static void snes_init_ram( | |
| 279 | static void snes_init_ram(running_machine *machine) | |
| 280 | 280 | { |
| 281 | 281 | int i; |
| 282 | 282 | |
| r1877 | r1878 | |
| 333 | 333 | timer_adjust_oneshot(snes_hblank_timer, video_screen_get_time_until_pos(0, ((snes_ram[STAT78] & 0x10) == SNES_NTSC) ? SNES_VTOTAL_NTSC-1 : SNES_VTOTAL_PAL-1, hblank_offset), 0); |
| 334 | 334 | |
| 335 | 335 | // check if DSP1 is present (maybe not 100%?) |
| 336 | has_dsp1 = ((snes_r_bank1(0xffd6) >= 3) && (snes_r_bank1(0xffd6) <= 5)) ? 1 : 0; | |
| 336 | has_dsp1 = ((snes_r_bank1(machine,0xffd6) >= 3) && (snes_r_bank1(machine,0xffd6) <= 5)) ? 1 : 0; | |
| 337 | 337 | |
| 338 | 338 | // init frame counter so first line is 0 |
| 339 | 339 | if( ATTOSECONDS_TO_HZ(Machine->screen[0].refresh) >= 59 ) |
| r1877 | r1878 | |
| 376 | 376 | |
| 377 | 377 | MACHINE_RESET( snes ) |
| 378 | 378 | { |
| 379 | snes_init_ram(); | |
| 379 | snes_init_ram(machine); | |
| 380 | 380 | |
| 381 | 381 | /* Set STAT78 to NTSC or PAL */ |
| 382 | 382 | if( ATTOSECONDS_TO_HZ(machine->screen[0].refresh) >= 59.0f ) |
| r1877 | r1878 | |
| 449 | 449 | } |
| 450 | 450 | else if( address >= 0x2000 && address <= 0x5fff ) /* I/O */ |
| 451 | 451 | { |
| 452 | return snes_r_io( address ); | |
| 452 | return snes_r_io( machine, address ); | |
| 453 | 453 | } |
| 454 | 454 | else if( address >= 0x6000 && address <= 0x7fff ) /* Reserved */ |
| 455 | 455 | { |
| r1877 | r1878 | |
| 499 | 499 | if( address <= 0x1fff ) /* Mirror of Low RAM */ |
| 500 | 500 | return program_read_byte(0x7e0000 + address ); |
| 501 | 501 | else if( address >= 0x2000 && address <= 0x5fff ) /* I/O */ |
| 502 | return snes_r_io( address ); | |
| 502 | return snes_r_io( machine, address ); | |
| 503 | 503 | else if( address >= 0x6000 && address <= 0x7fff ) |
| 504 | 504 | { |
| 505 | 505 | if( snes_cart.mode == SNES_MODE_20 ) |
| r1877 | r1878 | |
| 600 | 600 | if( address <= 0x1fff ) /* Mirror of Low RAM */ |
| 601 | 601 | program_write_byte(0x7e0000 + address, data ); |
| 602 | 602 | else if( address >= 0x2000 && address <= 0x5fff ) /* I/O */ |
| 603 | snes_w_io( address, data ); | |
| 603 | snes_w_io( machine, address, data ); | |
| 604 | 604 | else if( address >= 0x6000 && address <= 0x7fff ) /* Reserved */ |
| 605 | 605 | if( snes_cart.mode == SNES_MODE_20 ) |
| 606 | 606 | logerror( "Attempt to write to reserved address: %X\n", offset ); |
| r1877 | r1878 | |
| 627 | 627 | if( address <= 0x1fff ) /* Mirror of Low RAM */ |
| 628 | 628 | program_write_byte(0x7e0000 + address, data ); |
| 629 | 629 | else if( address >= 0x2000 && address <= 0x5fff ) /* I/O */ |
| 630 | snes_w_io( address, data ); | |
| 630 | snes_w_io( machine, address, data ); | |
| 631 | 631 | else if( address >= 0x6000 && address <= 0x7fff ) |
| 632 | 632 | { |
| 633 | 633 | if( snes_cart.mode == SNES_MODE_20 ) /* Reserved */ |
| r1877 | r1878 | |
| 666 | 666 | if( snes_cart.mode == SNES_MODE_20 ) |
| 667 | 667 | { |
| 668 | 668 | if( offset <= 0x2fffff ) |
| 669 | snes_w_bank1( offset, data ); | |
| 669 | snes_w_bank1( machine, offset, data ); | |
| 670 | 670 | else if( offset >= 0x300000 && offset <= 0x3fffff ) |
| 671 | snes_w_bank2( offset - 0x300000, data ); | |
| 671 | snes_w_bank2( machine, offset - 0x300000, data ); | |
| 672 | 672 | } |
| 673 | 673 | else /* MODE_21 */ |
| 674 | 674 | { |
| 675 | 675 | if( offset <= 0x2fffff ) |
| 676 | snes_w_bank1( offset, data ); | |
| 676 | snes_w_bank1( machine, offset, data ); | |
| 677 | 677 | else if( offset >= 0x300000 && offset <= 0x3fffff ) |
| 678 | snes_w_bank2( offset - 0x300000, data ); | |
| 678 | snes_w_bank2( machine, offset - 0x300000, data ); | |
| 679 | 679 | else |
| 680 | 680 | logerror( "Attempt to write to ROM address: %X\n", offset ); |
| 681 | 681 | } |
| r1877 | r1878 | |
| 1577 | 1577 | } |
| 1578 | 1578 | |
| 1579 | 1579 | /* Find the amount of sram */ |
| 1580 | snes_cart.sram = snes_r_bank1(0x00ffd8); | |
| 1580 | snes_cart.sram = snes_r_bank1(machine,0x00ffd8); | |
| 1581 | 1581 | if( snes_cart.sram > 0 ) |
| 1582 | 1582 | { |
| 1583 | 1583 | snes_cart.sram = ((1 << (snes_cart.sram + 3)) / 8); |
| r1877 | r1878 | |
| 1617 | 1617 | } |
| 1618 | 1618 | |
| 1619 | 1619 | /* Find the amount of sram */ |
| 1620 | snes_cart.sram = snes_r_bank1(0x00ffd8); | |
| 1620 | snes_cart.sram = snes_r_bank1(machine,0x00ffd8); | |
| 1621 | 1621 | if( snes_cart.sram > 0 ) |
| 1622 | 1622 | { |
| 1623 | 1623 | snes_cart.sram = ((1 << (snes_cart.sram + 3)) / 8); |
| r1877 | r1878 | |
|---|---|---|
| 51 | 51 | { |
| 52 | 52 | /* set the default ROM bank (many games only have one bank and */ |
| 53 | 53 | /* never write to the bank selector register) */ |
| 54 | taitosj_bankswitch_w(0, 0); | |
| 54 | taitosj_bankswitch_w(machine, 0, 0); | |
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | zaccept = 1; |
| r1877 | r1878 | |
| 311 | 311 | |
| 312 | 312 | WRITE8_HANDLER( alpinea_bankswitch_w ) |
| 313 | 313 | { |
| 314 | taitosj_bankswitch_w(offset, data); | |
| 314 | taitosj_bankswitch_w(machine, offset, data); | |
| 315 | 315 | protection_value = data >> 2; |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | READ8_HANDLER( alpine_port_2_r ) |
| 319 | 319 | { |
| 320 | return input_port_2_r(offset) | protection_value; | |
| 320 | return input_port_2_r(machine,offset) | protection_value; | |
| 321 | 321 | } |
| r1877 | r1878 | |
|---|---|---|
| 43 | 43 | #define BLITTER_NASTY_DELAY 16 |
| 44 | 44 | |
| 45 | 45 | |
| 46 | ||
| 46 | 47 | /************************************* |
| 47 | 48 | * |
| 48 | 49 | * Type definitions |
| r1877 | r1878 | |
| 178 | 179 | static void amiga_cia_1_irq(int state); |
| 179 | 180 | static TIMER_CALLBACK( amiga_irq_proc ); |
| 180 | 181 | static TIMER_CALLBACK( amiga_blitter_proc ); |
| 182 | static TIMER_CALLBACK( scanline_callback ); | |
| 181 | 183 | |
| 184 | ||
| 185 | ||
| 182 | 186 | /************************************* |
| 183 | 187 | * |
| 184 | 188 | * Chipmem 16/32 bit access |
| r1877 | r1878 | |
| 247 | 251 | } |
| 248 | 252 | |
| 249 | 253 | |
| 254 | ||
| 250 | 255 | /************************************* |
| 251 | 256 | * |
| 252 | 257 | * Machine config/reset |
| r1877 | r1878 | |
| 315 | 320 | } |
| 316 | 321 | else |
| 317 | 322 | { |
| 318 | amiga_cia_w(0x1001/2, 1, 0); | |
| 323 | amiga_cia_w(Machine, 0x1001/2, 1, 0); | |
| 319 | 324 | } |
| 320 | 325 | |
| 321 | 326 | if (activecpu_get_pc() < 0x80000) |
| r1877 | r1878 | |
| 340 | 345 | } |
| 341 | 346 | else |
| 342 | 347 | { |
| 343 | amiga_cia_w(0x1001/2, 1, 0); | |
| 348 | amiga_cia_w(machine, 0x1001/2, 1, 0); | |
| 344 | 349 | } |
| 345 | 350 | |
| 346 | 351 | /* call the system-specific callback */ |
| 347 | 352 | if (amiga_intf->reset_callback) |
| 348 | 353 | (*amiga_intf->reset_callback)(); |
| 354 | ||
| 355 | /* start the scanline timer */ | |
| 356 | timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, scanline_callback); | |
| 349 | 357 | } |
| 350 | 358 | |
| 351 | 359 | |
| r1877 | r1878 | |
| 356 | 364 | * |
| 357 | 365 | *************************************/ |
| 358 | 366 | |
| 359 | ||
| 367 | static TIMER | |
| 360 | 368 | { |
| 361 | int scanline = | |
| 369 | int scanline = pa | |
| 362 | 370 | |
| 363 | 371 | /* on the first scanline, we do some extra bookkeeping */ |
| 364 | 372 | if (scanline == 0) |
| 365 | 373 | { |
| 366 | 374 | /* signal VBLANK IRQ */ |
| 367 | amiga_custom_w(REG_INTREQ, 0x8000 | INTENA_VERTB, 0); | |
| 375 | amiga_custom_w(machine, REG_INTREQ, 0x8000 | INTENA_VERTB, 0); | |
| 368 | 376 | |
| 369 | 377 | /* clock the first CIA TOD */ |
| 370 | 378 | cia_clock_tod(0); |
| r1877 | r1878 | |
| 377 | 385 | /* on every scanline, clock the second CIA TOD */ |
| 378 | 386 | cia_clock_tod(1); |
| 379 | 387 | |
| 380 | /* render this scanline */ | |
| 381 | amiga_render_scanline(scanline); | |
| 388 | /* render up to this scanline */ | |
| 389 | if (scanline < machine->screen[0].visarea.min_y) | |
| 390 | amiga_render_scanline(machine, NULL, scanline); | |
| 391 | else | |
| 392 | video_screen_update_partial(0, scanline); | |
| 382 | 393 | |
| 383 | 394 | /* force a sound update */ |
| 384 | 395 | amiga_audio_update(); |
| 396 | ||
| 397 | /* set timer for next line */ | |
| 398 | scanline = (scanline + 1) % machine->screen[0].height; | |
| 399 | timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, scanline_callback); | |
| 385 | 400 | } |
| 386 | 401 | |
| 387 | 402 | |
| r1877 | r1878 | |
| 432 | 447 | cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE); |
| 433 | 448 | } |
| 434 | 449 | |
| 450 | ||
| 435 | 451 | static TIMER_CALLBACK( amiga_irq_proc ) |
| 436 | 452 | { |
| 437 | 453 | update_irqs(); |
| 438 | 454 | timer_reset( amiga_irq_timer, attotime_never); |
| 439 | 455 | } |
| 440 | 456 | |
| 457 | ||
| 458 | ||
| 441 | 459 | /************************************* |
| 442 | 460 | * |
| 443 | 461 | * Standard joystick conversion |
| r1877 | r1878 | |
| 966 | 984 | CUSTOM_REG(REG_DMACON) &= ~0x4000; |
| 967 | 985 | |
| 968 | 986 | /* signal an interrupt */ |
| 969 | amiga_custom_w(REG_INTREQ, 0x8000 | INTENA_BLIT, 0); | |
| 987 | amiga_custom_w(machine, REG_INTREQ, 0x8000 | INTENA_BLIT, 0); | |
| 970 | 988 | |
| 971 | 989 | /* reset the blitter timer */ |
| 972 | 990 | timer_reset( amiga_blitter_timer, attotime_never); |
| r1877 | r1878 | |
| 1119 | 1137 | |
| 1120 | 1138 | static void amiga_cia_0_irq(int state) |
| 1121 | 1139 | { |
| 1122 | amiga_custom_w(REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_PORTS, 0); | |
| 1140 | amiga_custom_w(Machine, REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_PORTS, 0); | |
| 1123 | 1141 | } |
| 1124 | 1142 | |
| 1125 | 1143 | |
| 1126 | 1144 | static void amiga_cia_1_irq(int state) |
| 1127 | 1145 | { |
| 1128 | amiga_custom_w(REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_EXTER, 0); | |
| 1146 | amiga_custom_w(Machine, REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_EXTER, 0); | |
| 1129 | 1147 | } |
| 1130 | 1148 | |
| 1131 | 1149 | |
| r1877 | r1878 | |
| 1270 | 1288 | CUSTOM_REG(REG_SERDATR) |= 0x3000; |
| 1271 | 1289 | |
| 1272 | 1290 | /* signal an interrupt */ |
| 1273 | amiga_custom_w(REG_INTREQ, 0x8000 | INTENA_TBE, 0); | |
| 1291 | amiga_custom_w(machine, REG_INTREQ, 0x8000 | INTENA_TBE, 0); | |
| 1274 | 1292 | } |
| 1275 | 1293 | |
| 1276 | 1294 | |
| r1877 | r1878 | |
| 1506 | 1524 | } |
| 1507 | 1525 | |
| 1508 | 1526 | /* signal an interrupt */ |
| 1509 | amiga_custom_w(REG_INTREQ, 0x8000 | INTENA_RBF, 0); | |
| 1527 | amiga_custom_w(Machine, REG_INTREQ, 0x8000 | INTENA_RBF, 0); | |
| 1510 | 1528 | } |
| 1511 | 1529 | |
| 1512 | 1530 |
| r1877 | r1878 | |
|---|---|---|
| 161 | 161 | |
| 162 | 162 | static TIMER_CALLBACK( sound_command_w ) |
| 163 | 163 | { |
| 164 | exidy440_sound_command = param; | |
| 164 | *exidy440_sound_command = param; | |
| 165 | 165 | exidy440_sound_command_ack = 0; |
| 166 | 166 | cpunum_set_input_line(machine, 1, INPUT_LINE_IRQ1, ASSERT_LINE); |
| 167 | 167 |
| r1877 | r1878 | |
|---|---|---|
| 264 | 264 | |
| 265 | 265 | |
| 266 | 266 | |
| 267 | READ16_HANDLER(pc_page16le_r) { return read16le_with_read8_handler(pc_page_r, offset, mem_mask); } | |
| 268 | WRITE16_HANDLER(pc_page16le_w) { write16le_with_write8_handler(pc_page_w, offset, data, mem_mask); } | |
| 267 | READ16_HANDLER(pc_page16le_r) { return read16le_with_read8_handler(pc_page_r, machine, offset, mem_mask); } | |
| 268 | WRITE16_HANDLER(pc_page16le_w) { write16le_with_write8_handler(pc_page_w, machine, offset, data, mem_mask); } | |
| 269 | 269 | |
| 270 | 270 | |
| 271 | 271 | |
| r1877 | r1878 | |
| 319 | 319 | |
| 320 | 320 | READ32_HANDLER(at_page32_r) |
| 321 | 321 | { |
| 322 | return read32le_with_read8_handler(at_page8_r, offset, mem_mask); | |
| 322 | return read32le_with_read8_handler(at_page8_r, machine, offset, mem_mask); | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | |
| 326 | 326 | |
| 327 | 327 | WRITE32_HANDLER(at_page32_w) |
| 328 | 328 | { |
| 329 | write32le_with_write8_handler(at_page8_w, offset, data, mem_mask); | |
| 329 | write32le_with_write8_handler(at_page8_w, machine, offset, data, mem_mask); | |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 |
| r1877 | r1878 | |
|---|---|---|
| 65 | 65 | STATIC VARIABLES |
| 66 | 66 | ***************************************************************************/ |
| 67 | 67 | |
| 68 | static atarigen_int_c | |
| 68 | static atarigen_int_func | |
| 69 | 69 | static emu_timer * scanline_interrupt_timer; |
| 70 | 70 | |
| 71 | 71 | static UINT8 eeprom_unlocked; |
| r1877 | r1878 | |
| 81 | 81 | static UINT8 timed_int; |
| 82 | 82 | static UINT8 ym2151_int; |
| 83 | 83 | |
| 84 | static atarigen_scanline_c | |
| 84 | static atarigen_scanline_func | |
| 85 | 85 | static UINT32 scanlines_per_callback; |
| 86 | 86 | |
| 87 | 87 | static UINT32 actual_vc_latch0; |
| r1877 | r1878 | |
| 114 | 114 | |
| 115 | 115 | static TIMER_CALLBACK( scanline_timer_callback ); |
| 116 | 116 | |
| 117 | static void atarivc_common_w(int scrnum, offs_t offset, UINT16 newword); | |
| 117 | static void atarivc_common_w(running_machine *machine, int scrnum, offs_t offset, UINT16 newword); | |
| 118 | 118 | |
| 119 | 119 | static TIMER_CALLBACK( unhalt_cpu ); |
| 120 | 120 | |
| r1877 | r1878 | |
| 131 | 131 | the interrupt sources. |
| 132 | 132 | ---------------------------------------------------------------*/ |
| 133 | 133 | |
| 134 | void atarigen_interrupt_reset(atarigen_int_c | |
| 134 | void atarigen_interrupt_reset(atarigen_int_func | |
| 135 | 135 | { |
| 136 | 136 | int i; |
| 137 | 137 | |
| r1877 | r1878 | |
| 656 | 656 | READ16_HANDLER( atarigen_sound_r ) |
| 657 | 657 | { |
| 658 | 658 | atarigen_sound_to_cpu_ready = 0; |
| 659 | atarigen_sound_int_ack_w(0, 0, 0); | |
| 659 | atarigen_sound_int_ack_w(machine, 0, 0, 0); | |
| 660 | 660 | return atarigen_sound_to_cpu | 0xff00; |
| 661 | 661 | } |
| 662 | 662 | |
| 663 | 663 | READ16_HANDLER( atarigen_sound_upper_r ) |
| 664 | 664 | { |
| 665 | 665 | atarigen_sound_to_cpu_ready = 0; |
| 666 | atarigen_sound_int_ack_w(0, 0, 0); | |
| 666 | atarigen_sound_int_ack_w(machine, 0, 0, 0); | |
| 667 | 667 | return (atarigen_sound_to_cpu << 8) | 0x00ff; |
| 668 | 668 | } |
| 669 | 669 | |
| 670 | 670 | READ32_HANDLER( atarigen_sound_upper32_r ) |
| 671 | 671 | { |
| 672 | 672 | atarigen_sound_to_cpu_ready = 0; |
| 673 | atarigen_sound_int_ack32_w(0, 0, 0); | |
| 673 | atarigen_sound_int_ack32_w(machine, 0, 0, 0); | |
| 674 | 674 | return (atarigen_sound_to_cpu << 24) | 0x00ffffff; |
| 675 | 675 | } |
| 676 | 676 | |
| r1877 | r1878 | |
| 731 | 731 | |
| 732 | 732 | /* reset the sound write state */ |
| 733 | 733 | atarigen_sound_to_cpu_ready = 0; |
| 734 | atarigen_sound_int_ack_w(0, 0, 0); | |
| 734 | atarigen_sound_int_ack_w(machine, 0, 0, 0); | |
| 735 | 735 | |
| 736 | 736 | /* allocate a high frequency timer until a response is generated */ |
| 737 | 737 | /* the main CPU is *very* sensistive to the timing of the response */ |
| r1877 | r1878 | |
| 845 | 845 | atarigen_scanline_timer_reset: Sets up the scanline timer. |
| 846 | 846 | ---------------------------------------------------------------*/ |
| 847 | 847 | |
| 848 | void atarigen_scanline_timer_reset(int scrnum, atarigen_scanline_c | |
| 848 | void atarigen_scanline_timer_reset(int scrnum, atarigen_scanline_func | |
| 849 | 849 | { |
| 850 | 850 | /* set the scanline callback */ |
| 851 | 851 | scanline_callback = update_graphics; |
| r1877 | r1878 | |
| 899 | 899 | /* echo all the commands to the video controller */ |
| 900 | 900 | for (i = 0; i < 0x1c; i++) |
| 901 | 901 | if (atarivc_eof_data[i]) |
| 902 | atarivc_common_w(scrnum, i, atarivc_eof_data[i]); | |
| 902 | atarivc_common_w(machine, scrnum, i, atarivc_eof_data[i]); | |
| 903 | 903 | |
| 904 | 904 | /* update the scroll positions */ |
| 905 | 905 | atarimo_set_xscroll(0, atarivc_state.mo_xscroll); |
| r1877 | r1878 | |
| 969 | 969 | int newword = oldword; |
| 970 | 970 | |
| 971 | 971 | COMBINE_DATA(&newword); |
| 972 | atarivc_common_w(0, offset, newword); /* need to support scrnum */ | |
| 972 | atarivc_common_w(machine, 0, offset, newword); /* need to support scrnum */ | |
| 973 | 973 | } |
| 974 | 974 | |
| 975 | 975 | |
| r1877 | r1878 | |
| 979 | 979 | write. |
| 980 | 980 | ---------------------------------------------------------------*/ |
| 981 | 981 | |
| 982 | static void atarivc_common_w(int scrnum, offs_t offset, UINT16 newword) | |
| 982 | static void atarivc_common_w(running_machine *machine, int scrnum, offs_t offset, UINT16 newword) | |
| 983 | 983 | { |
| 984 | 984 | int oldword = atarivc_data[offset]; |
| 985 | 985 | atarivc_data[offset] = newword; |
| r1877 | r1878 | |
| 1070 | 1070 | |
| 1071 | 1071 | /* scanline IRQ ack here */ |
| 1072 | 1072 | case 0x1e: |
| 1073 | atarigen_scanline_int_ack_w(0, 0, 0); | |
| 1073 | atarigen_scanline_int_ack_w(machine, 0, 0, 0); | |
| 1074 | 1074 | break; |
| 1075 | 1075 | |
| 1076 | 1076 | /* log anything else */ |
| r1877 | r1878 | |
|---|---|---|
| 28 | 28 | TYPES & STRUCTURES |
| 29 | 29 | ***************************************************************************/ |
| 30 | 30 | |
| 31 | typedef void (*atarigen_int_c | |
| 31 | typedef void (*atarigen_int_func | |
| 32 | 32 | |
| 33 | typedef void (*atarigen_scanline_c | |
| 33 | typedef void (*atarigen_scanline_func | |
| 34 | 34 | |
| 35 | 35 | struct atarivc_state_desc |
| 36 | 36 | { |
| r1877 | r1878 | |
| 95 | 95 | INTERRUPT HANDLING |
| 96 | 96 | ---------------------------------------------------------------*/ |
| 97 | 97 | |
| 98 | void atarigen_interrupt_reset(atarigen_int_c | |
| 98 | void atarigen_interrupt_reset(atarigen_int_func | |
| 99 | 99 | void atarigen_update_interrupts(void); |
| 100 | 100 | |
| 101 | 101 | void atarigen_scanline_int_set(int scrnum, int scanline); |
| r1877 | r1878 | |
| 218 | 218 | VIDEO HELPERS |
| 219 | 219 | ---------------------------------------------------------------*/ |
| 220 | 220 | |
| 221 | void atarigen_scanline_timer_reset(int scrnum, atarigen_scanline_c | |
| 221 | void atarigen_scanline_timer_reset(int scrnum, atarigen_scanline_func | |
| 222 | 222 | int atarigen_get_hblank(running_machine *machine, int scrnum); |
| 223 | 223 | WRITE16_HANDLER( atarigen_halt_until_hblank_0_w ); |
| 224 | 224 | WRITE16_HANDLER( atarigen_666_paletteram_w ); |
| r1877 | r1878 | |
|---|---|---|
| 191 | 191 | return readinputport(offset); |
| 192 | 192 | |
| 193 | 193 | case 4: |
| 194 | return (midway_serial_pic_status_r() << 12) | midwunit_sound_state_r(0,0); | |
| 194 | return (midway_serial_pic_status_r() << 12) | midwunit_sound_state_r(machine,0,0); | |
| 195 | 195 | |
| 196 | 196 | default: |
| 197 | 197 | logerror("%08X:Unknown I/O read from %d\n", activecpu_get_pc(), offset); |
| r1877 | r1878 | |
| 281 | 281 | /* non-loopback case: bit 0 means data ready, bit 2 means ok to send */ |
| 282 | 282 | else |
| 283 | 283 | { |
| 284 | int temp = midwunit_sound_state_r(0, 0); | |
| 284 | int temp = midwunit_sound_state_r(machine, 0, 0); | |
| 285 | 285 | result |= (temp & 0x800) >> 9; |
| 286 | 286 | result |= (~temp & 0x400) >> 10; |
| 287 | 287 | timer_call_after_resynch(NULL, 0, 0); |
| r1877 | r1878 | |
| 296 | 296 | |
| 297 | 297 | /* non-loopback case: read from the DCS system */ |
| 298 | 298 | else |
| 299 | result = midwunit_sound_r(0, 0); | |
| 299 | result = midwunit_sound_r(machine, 0, 0); | |
| 300 | 300 | break; |
| 301 | 301 | |
| 302 | 302 | case 5: /* register 5 seems to be like 3, but with in/out swapped */ |
| r1877 | r1878 | |
| 308 | 308 | /* non-loopback case: bit 0 means data ready, bit 2 means ok to send */ |
| 309 | 309 | else |
| 310 | 310 | { |
| 311 | int temp = midwunit_sound_state_r(0, 0); | |
| 311 | int temp = midwunit_sound_state_r(machine, 0, 0); | |
| 312 | 312 | result |= (temp & 0x800) >> 11; |
| 313 | 313 | result |= (~temp & 0x400) >> 8; |
| 314 | 314 | timer_call_after_resynch(NULL, 0, 0); |
| r1877 | r1878 | |
| 344 | 344 | |
| 345 | 345 | /* non-loopback case: send to the DCS system */ |
| 346 | 346 | else |
| 347 | midwunit_sound_w(0, data, mem_mask); | |
| 347 | midwunit_sound_w(machine, 0, data, mem_mask); | |
| 348 | 348 | break; |
| 349 | 349 | |
| 350 | 350 | case 5: /* register 5 write seems to reset things */ |
| r1877 | r1878 | |
|---|---|---|
| 105 | 105 | mFinalLapProtCount = 0; |
| 106 | 106 | |
| 107 | 107 | /* Initialise the bank select in the sound CPU */ |
| 108 | namcos2_sound_bankselect_w(0,0); /* Page in bank 0 */ | |
| 108 | namcos2_sound_bankselect_w(machine,0,0); /* Page in bank 0 */ | |
| 109 | 109 | |
| 110 | 110 | cpunum_set_input_line(machine, CPU_SOUND, INPUT_LINE_RESET, ASSERT_LINE ); |
| 111 | 111 | |
| r1877 | r1878 | |
| 743 | 743 | switch((data>>2)&0x07) |
| 744 | 744 | { |
| 745 | 745 | case 0: |
| 746 | namcos2_mcu_analog_data=input_port_2_r(0); | |
| 746 | namcos2_mcu_analog_data=input_port_2_r(machine,0); | |
| 747 | 747 | break; |
| 748 | 748 | case 1: |
| 749 | namcos2_mcu_analog_data=input_port_3_r(0); | |
| 749 | namcos2_mcu_analog_data=input_port_3_r(machine,0); | |
| 750 | 750 | break; |
| 751 | 751 | case 2: |
| 752 | namcos2_mcu_analog_data=input_port_4_r(0); | |
| 752 | namcos2_mcu_analog_data=input_port_4_r(machine,0); | |
| 753 | 753 | break; |
| 754 | 754 | case 3: |
| 755 | namcos2_mcu_analog_data=input_port_5_r(0); | |
| 755 | namcos2_mcu_analog_data=input_port_5_r(machine,0); | |
| 756 | 756 | break; |
| 757 | 757 | case 4: |
| 758 | namcos2_mcu_analog_data=input_port_6_r(0); | |
| 758 | namcos2_mcu_analog_data=input_port_6_r(machine,0); | |
| 759 | 759 | break; |
| 760 | 760 | case 5: |
| 761 | namcos2_mcu_analog_data=input_port_7_r(0); | |
| 761 | namcos2_mcu_analog_data=input_port_7_r(machine,0); | |
| 762 | 762 | break; |
| 763 | 763 | case 6: |
| 764 | namcos2_mcu_analog_data=input_port_8_r(0); | |
| 764 | namcos2_mcu_analog_data=input_port_8_r(machine,0); | |
| 765 | 765 | break; |
| 766 | 766 | case 7: |
| 767 | namcos2_mcu_analog_data=input_port_9_r(0); | |
| 767 | namcos2_mcu_analog_data=input_port_9_r(machine,0); | |
| 768 | 768 | break; |
| 769 | 769 | } |
| 770 | 770 | #if 0 |
| r1877 | r1878 | |
| 820 | 820 | int data=0; |
| 821 | 821 | |
| 822 | 822 | /* Read/convert the bits one at a time */ |
| 823 | if(input_port_2_r(0)>threshold) data|=0x01; | |
| 824 | if(input_port_3_r(0)>threshold) data|=0x02; | |
| 825 | if(input_port_4_r(0)>threshold) data|=0x04; | |
| 826 | if(input_port_5_r(0)>threshold) data|=0x08; | |
| 827 | if(input_port_6_r(0)>threshold) data|=0x10; | |
| 828 | if(input_port_7_r(0)>threshold) data|=0x20; | |
| 829 | if(input_port_8_r(0)>threshold) data|=0x40; | |
| 830 | if(input_port_9_r(0)>threshold) data|=0x80; | |
| 823 | if(input_port_2_r(machine,0)>threshold) data|=0x01; | |
| 824 | if(input_port_3_r(machine,0)>threshold) data|=0x02; | |
| 825 | if(input_port_4_r(machine,0)>threshold) data|=0x04; | |
| 826 | if(input_port_5_r(machine,0)>threshold) data|=0x08; | |
| 827 | if(input_port_6_r(machine,0)>threshold) data|=0x10; | |
| 828 | if(input_port_7_r(machine,0)>threshold) data|=0x20; | |
| 829 | if(input_port_8_r(machine,0)>threshold) data|=0x40; | |
| 830 | if(input_port_9_r(machine,0)>threshold) data|=0x80; | |
| 831 | 831 | |
| 832 | 832 | /* Return the result */ |
| 833 | 833 | return data; |
| r1877 | r1878 | |
|---|---|---|
| 110 | 110 | WRITE16_HANDLER( deco16_104_prot_w ) /* Wizard Fire */ |
| 111 | 111 | { |
| 112 | 112 | if (offset==(0x150/2)) { |
| 113 | soundlatch_w(0,data&0xff); | |
| 114 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 113 | soundlatch_w(machine,0,data&0xff); | |
| 114 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 115 | 115 | return; |
| 116 | 116 | } |
| 117 | 117 | |
| r1877 | r1878 | |
| 228 | 228 | WRITE16_HANDLER( deco16_60_prot_w ) /* Edward Randy */ |
| 229 | 229 | { |
| 230 | 230 | if (offset==(0x64/2)) { |
| 231 | soundlatch_w(0,data&0xff); | |
| 232 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 231 | soundlatch_w(machine,0,data&0xff); | |
| 232 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | COMBINE_DATA(&deco16_prot_ram[offset]); |
| r1877 | r1878 | |
| 417 | 417 | WRITE16_HANDLER( deco16_66_prot_w ) /* Mutant Fighter */ |
| 418 | 418 | { |
| 419 | 419 | if (offset==(0x64/2)) { |
| 420 | soundlatch_w(0,data&0xff); | |
| 421 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 420 | soundlatch_w(machine,0,data&0xff); | |
| 421 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 422 | 422 | return; |
| 423 | 423 | } |
| 424 | 424 | |
| r1877 | r1878 | |
| 603 | 603 | WRITE16_HANDLER( deco16_104_cninja_prot_w ) |
| 604 | 604 | { |
| 605 | 605 | if (offset==(0xa8/2)) { |
| 606 | soundlatch_w(0,data&0xff); | |
| 607 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 606 | soundlatch_w(machine,0,data&0xff); | |
| 607 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 608 | 608 | return; |
| 609 | 609 | } |
| 610 | 610 | |
| r1877 | r1878 | |
| 665 | 665 | COMBINE_DATA(&deco16_prot_ram[offset]); |
| 666 | 666 | |
| 667 | 667 | if (offset == (0x10a >> 1)) { |
| 668 | soundlatch_w(0,data&0xff); | |
| 669 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 668 | soundlatch_w(machine,0,data&0xff); | |
| 669 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 670 | 670 | return; |
| 671 | 671 | } |
| 672 | 672 | } |
| r1877 | r1878 | |
| 778 | 778 | There doesn't appear to be any way to detect what bank is currently selected - it |
| 779 | 779 | seems game code must maintain this state (if it matters). |
| 780 | 780 | */ |
| 781 | ||
| 782 | 781 | if (decoprot_buffer_ram_selected) |
| 783 | 782 | COMBINE_DATA(&decoprot_buffer_ram[offset]); |
| 784 | 783 | else |
| 785 | 784 | COMBINE_DATA(&deco16_prot_ram[offset]); |
| 786 | 785 | |
| 787 | 786 | if (offset==(0xa8/2)) { |
| 788 | soundlatch_w(0,data&0xff); | |
| 789 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 787 | soundlatch_w(machine,0,data&0xff); | |
| 788 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 790 | 789 | return; |
| 791 | 790 | } |
| 792 | 791 | |
| r1877 | r1878 | |
| 1214 | 1213 | const int sndport=0x260; |
| 1215 | 1214 | const int xorport=0x340; |
| 1216 | 1215 | const int maskport=0x6c0; |
| 1217 | ||
| 1218 | 1216 | if (writeport==sndport) { |
| 1219 | soundlatch_w(0,data&0xff); | |
| 1220 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 1217 | soundlatch_w(machine,0,data&0xff); | |
| 1218 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 1221 | 1219 | return; |
| 1222 | 1220 | } |
| 1223 | 1221 | |
| r1877 | r1878 | |
| 1644 | 1642 | decoprot_last_write=addr; |
| 1645 | 1643 | decoprot_last_write_val=data>>16; |
| 1646 | 1644 | |
| 1647 | deco16_146_core_prot_w(addr, data>>16, mem_mask>>16); | |
| 1645 | deco16_146_core_prot_w(machine, addr, data>>16, mem_mask>>16); | |
| 1648 | 1646 | } |
| 1649 | 1647 | |
| 1650 | 1648 | READ32_HANDLER( deco16_146_fghthist_prot_r ) |
| r1877 | r1878 | |
| 1669 | 1667 | } |
| 1670 | 1668 | decoprot_last_write=-1; |
| 1671 | 1669 | |
| 1672 | val=deco16_146_core_prot_r(addr, mem_mask>>16); | |
| 1670 | val=deco16_146_core_prot_r(machine, addr, mem_mask>>16); | |
| 1673 | 1671 | |
| 1674 | 1672 | if (addr!=0x7b6 && addr!=0x1c && addr!=0x1e0 && addr!=0x1d4 |
| 1675 | 1673 | && addr!=0x2c4 && addr!=0x7a4 && addr!=0x30 // confirmed |
| r1877 | r1878 | |
| 1716 | 1714 | WRITE16_HANDLER( deco16_146_nitroball_prot_w ) |
| 1717 | 1715 | { |
| 1718 | 1716 | UINT16 addr=BITSWAP16(offset<<1, 0, 0, 0, 0, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); |
| 1719 | ||
| 1720 | deco16_146_core_prot_w(addr, data, mem_mask); | |
| 1717 | deco16_146_core_prot_w(machine, addr, data, mem_mask); | |
| 1721 | 1718 | } |
| 1722 | 1719 | |
| 1723 | 1720 | READ16_HANDLER( deco16_146_nitroball_prot_r ) |
| 1724 | 1721 | { |
| 1725 | 1722 | UINT16 addr=BITSWAP16(offset<<1, 0, 0, 0, 0, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); |
| 1726 | ||
| 1727 | return deco16_146_core_prot_r(addr, mem_mask); | |
| 1723 | return deco16_146_core_prot_r(machine, addr, mem_mask); | |
| 1728 | 1724 | } |
| 1729 | 1725 | |
| 1730 | 1726 | /**********************************************************************************/ |
| r1877 | r1878 | |
| 1733 | 1729 | { |
| 1734 | 1730 | switch (offset * 2) |
| 1735 | 1731 | { |
| 1736 | case 0x298: return input_port_0_word_r(0, 0); | |
| 1737 | case 0x342: return input_port_1_word_r(0, 0); | |
| 1738 | case 0x506: return input_port_2_word_r(0, 0); | |
| 1732 | case 0x298: return input_port_0_word_r(machine, 0, 0); | |
| 1733 | case 0x342: return input_port_1_word_r(machine, 0, 0); | |
| 1734 | case 0x506: return input_port_2_word_r(machine, 0, 0); | |
| 1739 | 1735 | } |
| 1740 | 1736 | |
| 1741 | 1737 | logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",activecpu_get_pc(),offset<<1); |
| r1877 | r1878 | |
| 1746 | 1742 | WRITE16_HANDLER( dietgo_104_prot_w ) |
| 1747 | 1743 | { |
| 1748 | 1744 | if (offset==(0x380/2)) { |
| 1749 | soundlatch_w(0,data&0xff); | |
| 1750 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 1745 | soundlatch_w(machine,0,data&0xff); | |
| 1746 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 1751 | 1747 | return; |
| 1752 | 1748 | } |
| 1753 | 1749 | logerror("Protection PC %06x: warning - write unmapped memory address %04x %04x\n",activecpu_get_pc(),offset<<1,data); |
| r1877 | r1878 | |
| 1758 | 1754 | READ16_HANDLER( deco16_104_pktgaldx_prot_r ) |
| 1759 | 1755 | { |
| 1760 | 1756 | const UINT16* prot_ram=deco16_prot_ram; |
| 1761 | ||
| 1762 | 1757 | switch (offset * 2) |
| 1763 | 1758 | { |
| 1764 | case 0x5b2: return input_port_0_word_r(0, 0); | |
| 1765 | case 0x44c: return input_port_1_word_r(0, 0); | |
| 1766 | case 0x042: return input_port_2_word_r(0, 0); | |
| 1759 | case 0x5b2: return input_port_0_word_r(machine, 0, 0); | |
| 1760 | case 0x44c: return input_port_1_word_r(machine, 0, 0); | |
| 1761 | case 0x042: return input_port_2_word_r(machine, 0, 0); | |
| 1767 | 1762 | |
| 1768 | 1763 | case 0x510: return DECO_PORT(0); |
| 1769 | 1764 | case 0x51a: return DECO_PORT(2); |
| r1877 | r1878 | |
|---|---|---|
| 62 | 62 | static UINT8 v493_irq_state; |
| 63 | 63 | static UINT8 v493_irq_vector; |
| 64 | 64 | |
| 65 | static timer_c | |
| 65 | static timer_fired_func | |
| 66 | 66 | |
| 67 | 67 | static UINT8 zwackery_sound_data; |
| 68 | 68 | |
| r1877 | r1878 | |
| 424 | 424 | { |
| 425 | 425 | /* CTC line 2 is connected to VBLANK, which is once every 1/2 frame */ |
| 426 | 426 | /* for the 30Hz interlaced display */ |
| 427 | z80ctc_0_trg2_w(0, 1); | |
| 428 | z80ctc_0_trg2_w(0, 0); | |
| 427 | z80ctc_0_trg2_w(machine, 0, 1); | |
| 428 | z80ctc_0_trg2_w(machine, 0, 0); | |
| 429 | 429 | |
| 430 | 430 | /* CTC line 3 is connected to 493, which is signalled once every */ |
| 431 | 431 | /* frame at 30Hz */ |
| 432 | 432 | if (cpu_getiloops() == 0) |
| 433 | 433 | { |
| 434 | z80ctc_0_trg3_w(0, 1); | |
| 435 | z80ctc_0_trg3_w(0, 0); | |
| 434 | z80ctc_0_trg3_w(machine, 0, 1); | |
| 435 | z80ctc_0_trg3_w(machine, 0, 0); | |
| 436 | 436 | } |
| 437 | 437 | } |
| 438 | 438 | |
| r1877 | r1878 | |
| 443 | 443 | /* frame at 30Hz */ |
| 444 | 444 | if (cpu_getiloops() == 0) |
| 445 | 445 | { |
| 446 | z80ctc_1_trg3_w(0, 1); | |
| 447 | z80ctc_1_trg3_w(0, 0); | |
| 446 | z80ctc_1_trg3_w(machine, 0, 1); | |
| 447 | z80ctc_1_trg3_w(machine, 0, 0); | |
| 448 | 448 | } |
| 449 | 449 | } |
| 450 | 450 | |
| r1877 | r1878 | |
| 585 | 585 | WRITE8_HANDLER( zwackery_pia_2_w ) |
| 586 | 586 | { |
| 587 | 587 | /* bit 7 is the watchdog */ |
| 588 | if (!(data & 0x80)) watchdog_reset_w(offset, data); | |
| 588 | if (!(data & 0x80)) watchdog_reset_w(machine, offset, data); | |
| 589 | 589 | |
| 590 | 590 | /* bits 5 and 6 control hflip/vflip */ |
| 591 | 591 | /* bits 3 and 4 control coin counters? */ |
| r1877 | r1878 | |
| 601 | 601 | |
| 602 | 602 | WRITE8_HANDLER( zwackery_ca2_w ) |
| 603 | 603 | { |
| 604 | csdeluxe_data_w(offset, (data << 4) | zwackery_sound_data); | |
| 604 | csdeluxe_data_w(machine, offset, (data << 4) | zwackery_sound_data); | |
| 605 | 605 | } |
| 606 | 606 | |
| 607 | 607 | |
| r1877 | r1878 | |
| 614 | 614 | |
| 615 | 615 | static TIMER_CALLBACK( zwackery_493_off_callback ) |
| 616 | 616 | { |
| 617 | pia_2_ca1_w(0, 0); | |
| 617 | pia_2_ca1_w(machine, 0, 0); | |
| 618 | 618 | } |
| 619 | 619 | |
| 620 | 620 | |
| 621 | 621 | static TIMER_CALLBACK( zwackery_493_callback ) |
| 622 | 622 | { |
| 623 | pia_2_ca1_w(0, 1); | |
| 623 | pia_2_ca1_w(machine, 0, 1); | |
| 624 | 624 | timer_set(video_screen_get_scan_period(0), NULL, 0, zwackery_493_off_callback); |
| 625 | 625 | } |
| 626 | 626 | |
| r1877 | r1878 | |
| 903 | 903 | WRITE16_HANDLER( mcr68_6840_upper_w ) |
| 904 | 904 | { |
| 905 | 905 | if (ACCESSING_MSB) |
| 906 | mcr68_6840_w_common(offset, (data >> 8) & 0xff); | |
| 906 | mcr68_6840_w_common(machine, offset, (data >> 8) & 0xff); | |
| 907 | 907 | } |
| 908 | 908 | |
| 909 | 909 | |
| 910 | 910 | WRITE16_HANDLER( mcr68_6840_lower_w ) |
| 911 | 911 | { |
| 912 | 912 | if (ACCESSING_LSB) |
| 913 | mcr68_6840_w_common(offset, data & 0xff); | |
| 913 | mcr68_6840_w_common(machine, offset, data & 0xff); | |
| 914 | 914 | } |
| 915 | 915 | |
| 916 | 916 | |
| 917 | 917 | READ16_HANDLER( mcr68_6840_upper_r ) |
| 918 | 918 | { |
| 919 | return (mcr68_6840_r_common(offset,0) << 8) | 0x00ff; | |
| 919 | return (mcr68_6840_r_common(machine,offset,0) << 8) | 0x00ff; | |
| 920 | 920 | } |
| 921 | 921 | |
| 922 | 922 | |
| 923 | 923 | READ16_HANDLER( mcr68_6840_lower_r ) |
| 924 | 924 | { |
| 925 | return mcr68_6840_r_common(offset,0) | 0xff00; | |
| 925 | return mcr68_6840_r_common(machine,offset,0) | 0xff00; | |
| 926 | 926 | } |
| 927 | 927 | |
| 928 | 928 | |
| r1877 | r1878 | |
| 1023 | 1023 | |
| 1024 | 1024 | WRITE8_HANDLER( mcr_ipu_watchdog_w ) |
| 1025 | 1025 | { |
| 1026 | mcr_ipu_watchdog_r(0); | |
| 1026 | mcr_ipu_watchdog_r(machine,0); | |
| 1027 | 1027 | } |
| r1877 | r1878 | |
|---|---|---|
| 350 | 350 | // self-test in Tatsumi games. Needs fixed, but hack it here for now. |
| 351 | 351 | READ8_HANDLER(tatsumi_hack_ym2151_r) |
| 352 | 352 | { |
| 353 | int r=YM2151_status_port_0_r(0); | |
| 353 | int r=YM2151_status_port_0_r(machine,0); | |
| 354 | 354 | |
| 355 | 355 | if (activecpu_get_pc()==0x2aca || activecpu_get_pc()==0x29fe |
| 356 | 356 | || activecpu_get_pc()==0xf9721 |
| r1877 | r1878 | |
| 363 | 363 | // Mame really should emulate the OKI status reads even with Mame sound off. |
| 364 | 364 | READ8_HANDLER(tatsumi_hack_oki_r) |
| 365 | 365 | { |
| 366 | int r=OKIM6295_status_0_r(0); | |
| 366 | int r=OKIM6295_status_0_r(machine,0); | |
| 367 | 367 | |
| 368 | 368 | if (activecpu_get_pc()==0x2b70 || activecpu_get_pc()==0x2bb5 |
| 369 | 369 | || activecpu_get_pc()==0x2acc |
| r1877 | r1878 | |
|---|---|---|
| 121 | 121 | |
| 122 | 122 | READ8_HANDLER( arkanoid_68705_input_0_r ) |
| 123 | 123 | { |
| 124 | int res = input_port_0_r(offset) & 0x3f; | |
| 124 | int res = input_port_0_r(machine,offset) & 0x3f; | |
| 125 | 125 | |
| 126 | 126 | /* bit 0x40 comes from the sticky bit */ |
| 127 | 127 | if (!z80write) res |= 0x40; |
| r1877 | r1878 | |
| 136 | 136 | { |
| 137 | 137 | if (arkanoid_paddle_select) |
| 138 | 138 | { |
| 139 | arkanoid_paddle_value = input_port_3_r(offset); | |
| 139 | arkanoid_paddle_value = input_port_3_r(machine,offset); | |
| 140 | 140 | } |
| 141 | 141 | else |
| 142 | 142 | { |
| 143 | arkanoid_paddle_value = input_port_2_r(offset); | |
| 143 | arkanoid_paddle_value = input_port_2_r(machine,offset); | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | return arkanoid_paddle_value; |
| r1877 | r1878 | |
|---|---|---|
| 73 | 73 | int p2_vert; |
| 74 | 74 | int temp; |
| 75 | 75 | |
| 76 | p1_horiz = input_port_0_r(offset); | |
| 77 | p1_vert = input_port_1_r(offset); | |
| 78 | p2_horiz = input_port_2_r(offset); | |
| 79 | p2_vert = input_port_3_r(offset); | |
| 76 | p1_horiz = input_port_0_r(machine, offset); | |
| 77 | p1_vert = input_port_1_r(machine, offset); | |
| 78 | p2_horiz = input_port_2_r(machine, offset); | |
| 79 | p2_vert = input_port_3_r(machine, offset); | |
| 80 | 80 | |
| 81 | 81 | /* Set direction bits */ |
| 82 | 82 | |
| r1877 | r1878 | |
| 146 | 146 | } |
| 147 | 147 | else |
| 148 | 148 | { |
| 149 | temp = input_port_4_r(offset) & 0x0F; | |
| 149 | temp = input_port_4_r(machine, offset) & 0x0F; | |
| 150 | 150 | /* Remap button 1 back to the Start button */ |
| 151 | 151 | /* NOTE: This is an ADDED feature, not a part of the original hardware! */ |
| 152 | 152 | temp = (temp) & (temp>>2); |
| r1877 | r1878 | |
|---|---|---|
| 737 | 737 | } |
| 738 | 738 | |
| 739 | 739 | /* detect changes to HEBLNK and HSBLNK and force an update before they change */ |
| 740 | if ((offset == REG_HEBLNK || offset == REG_HSBLNK) && data != tms34010_io_register_r(offset, 0)) | |
| 740 | if ((offset == REG_HEBLNK || offset == REG_HSBLNK) && data != tms34010_io_register_r(machine, offset, 0)) | |
| 741 | 741 | video_screen_update_partial(0, video_screen_get_vpos(0) - 1); |
| 742 | 742 | |
| 743 | tms34010_io_register_w(offset, data, mem_mask); | |
| 743 | tms34010_io_register_w(machine, offset, data, mem_mask); | |
| 744 | 744 | } |
| 745 | 745 | |
| 746 | 746 |
| r1877 | r1878 | |
|---|---|---|
| 36 | 36 | UINT32 *g_p_n_psxram; |
| 37 | 37 | size_t g_n_psxramsize; |
| 38 | 38 | |
| 39 | #ifdef UNUSED_FUNCTON | |
| 39 | 40 | INLINE void psxwriteword( UINT32 n_address, UINT16 n_data ) |
| 40 | 41 | { |
| 41 | 42 | *( (UINT16 *)( (UINT8 *)g_p_n_psxram + WORD_XOR_LE( n_address ) ) ) = n_data; |
| 42 | 43 | } |
| 44 | #endif | |
| 43 | 45 | |
| 44 | 46 | INLINE UINT16 psxreadword( UINT32 n_address ) |
| 45 | 47 | { |
| r1877 | r1878 | |
|---|---|---|
| 168 | 168 | { |
| 169 | 169 | switch (slyspy_state) { |
| 170 | 170 | case 0x3: |
| 171 | dec0_pf1_data_w(offset,data,mem_mask); | |
| 171 | dec0_pf1_data_w(machine,offset,data,mem_mask); | |
| 172 | 172 | return; |
| 173 | 173 | case 0x2: |
| 174 | dec0_pf2_data_w(offset,data,mem_mask); | |
| 174 | dec0_pf2_data_w(machine,offset,data,mem_mask); | |
| 175 | 175 | return; |
| 176 | 176 | case 0x0: |
| 177 | if (offset<0x8) dec0_pf2_control_0_w(offset,data,mem_mask); | |
| 178 | else if (offset<0x10) dec0_pf2_control_1_w(offset-0x8,data,mem_mask); | |
| 177 | if (offset<0x8) dec0_pf2_control_0_w(machine,offset,data,mem_mask); | |
| 178 | else if (offset<0x10) dec0_pf2_control_1_w(machine,offset-0x8,data,mem_mask); | |
| 179 | 179 | return; |
| 180 | 180 | } |
| 181 | 181 | logerror("Wrote to 240000 %02x at %04x %04x (Trap %02x)\n",offset,activecpu_get_pc(),data,slyspy_state); |
| r1877 | r1878 | |
| 185 | 185 | { |
| 186 | 186 | switch (slyspy_state) { |
| 187 | 187 | case 0x2: /* Trap A */ |
| 188 | dec0_pf1_data_w(offset,data,mem_mask); | |
| 188 | dec0_pf1_data_w(machine,offset,data,mem_mask); | |
| 189 | 189 | return; |
| 190 | 190 | case 0x0: /* Trap C */ |
| 191 | 191 | if (offset<0x40) COMBINE_DATA(&dec0_pf2_colscroll[offset]); |
| r1877 | r1878 | |
| 199 | 199 | { |
| 200 | 200 | switch (slyspy_state) { |
| 201 | 201 | case 0x0: |
| 202 | dec0_pf2_data_w(offset,data,mem_mask); | |
| 202 | dec0_pf2_data_w(machine,offset,data,mem_mask); | |
| 203 | 203 | return; |
| 204 | 204 | } |
| 205 | 205 | logerror("Wrote to 246000 %02x at %04x %04x (Trap %02x)\n",offset,activecpu_get_pc(),data,slyspy_state); |
| r1877 | r1878 | |
| 209 | 209 | { |
| 210 | 210 | switch (slyspy_state) { |
| 211 | 211 | case 0x1: |
| 212 | dec0_pf1_data_w(offset,data,mem_mask); | |
| 212 | dec0_pf1_data_w(machine,offset,data,mem_mask); | |
| 213 | 213 | return; |
| 214 | 214 | case 0x3: |
| 215 | dec0_pf2_data_w(offset,data,mem_mask); | |
| 215 | dec0_pf2_data_w(machine,offset,data,mem_mask); | |
| 216 | 216 | return; |
| 217 | 217 | case 0x0: |
| 218 | if (offset<0x8) dec0_pf1_control_0_w(offset,data,mem_mask); | |
| 219 | else if (offset<0x10) dec0_pf1_control_1_w(offset-0x8,data,mem_mask); | |
| 218 | if (offset<0x8) dec0_pf1_control_0_w(machine,offset,data,mem_mask); | |
| 219 | else if (offset<0x10) dec0_pf1_control_1_w(machine,offset-0x8,data,mem_mask); | |
| 220 | 220 | return; |
| 221 | 221 | } |
| 222 | 222 | logerror("Wrote to 248000 %02x at %04x %04x (Trap %02x)\n",offset,activecpu_get_pc(),data,slyspy_state); |
| r1877 | r1878 | |
| 226 | 226 | { |
| 227 | 227 | switch (slyspy_state) { |
| 228 | 228 | case 0x1: /* Trap 9 */ |
| 229 | dec0_pf2_data_w(offset,data,mem_mask); | |
| 229 | dec0_pf2_data_w(machine,offset,data,mem_mask); | |
| 230 | 230 | return; |
| 231 | 231 | case 0x0: /* Trap C */ |
| 232 | 232 | if (offset<0x40) COMBINE_DATA(&dec0_pf1_colscroll[offset]); |
| r1877 | r1878 | |
| 241 | 241 | switch (slyspy_state) { |
| 242 | 242 | case 0x2: |
| 243 | 243 | case 0x0: |
| 244 | dec0_pf1_data_w(offset,data,mem_mask); | |
| 244 | dec0_pf1_data_w(machine,offset,data,mem_mask); | |
| 245 | 245 | return; |
| 246 | 246 | } |
| 247 | 247 | logerror("Wrote to 24e000 %02x at %04x %04x (Trap %02x)\n",offset,activecpu_get_pc(),data,slyspy_state); |
| r1877 | r1878 | |
|---|---|---|
| 70 | 70 | switch (data & 0x03) |
| 71 | 71 | { |
| 72 | 72 | case 0: |
| 73 | pbus = input_port_0_r(0); | |
| 73 | pbus = input_port_0_r(machine,0); | |
| 74 | 74 | break; |
| 75 | 75 | case 1: |
| 76 | pbus = input_port_1_r(0) | (input_port_2_r(0) << 4); | |
| 76 | pbus = input_port_1_r(machine,0) | (input_port_2_r(machine,0) << 4); | |
| 77 | 77 | break; |
| 78 | 78 | case 2: |
| 79 | pbus = input_port_3_r(0); | |
| 79 | pbus = input_port_3_r(machine,0); | |
| 80 | 80 | break; |
| 81 | 81 | case 3: |
| 82 | 82 | pbus = 0xff; |
| r1877 | r1878 | |
|---|---|---|
| 181 | 181 | |
| 182 | 182 | READ8_HANDLER( lsasquad_mcu_status_r ) |
| 183 | 183 | { |
| 184 | int res = input_port_3_r(0); | |
| 184 | int res = input_port_3_r(machine,0); | |
| 185 | 185 | |
| 186 | 186 | /* bit 0 = when 1, mcu is ready to receive data from main cpu */ |
| 187 | 187 | /* bit 1 = when 0, mcu has sent data to the main cpu */ |
| r1877 | r1878 | |
|---|---|---|
| 51 | 51 | switch (offset) |
| 52 | 52 | { |
| 53 | 53 | case 0x00/2: // watchdog |
| 54 | return watchdog_reset_r(0); | |
| 54 | return watchdog_reset_r(machine,0); | |
| 55 | 55 | |
| 56 | 56 | case 0x02/2: // unknown (yet!), used by *MANY* games !!! |
| 57 | 57 | //popmessage("unknown collision reg"); |
| r1877 | r1878 | |
|---|---|---|
| 268 | 268 | int scanline = param; |
| 269 | 269 | |
| 270 | 270 | /* the IRQ signal comes into CB1, and is set to VA11 */ |
| 271 | pia_1_cb1_w(0, scanline & 0x20); | |
| 271 | pia_1_cb1_w(machine, 0, scanline & 0x20); | |
| 272 | 272 | |
| 273 | 273 | /* set a timer for the next update */ |
| 274 | 274 | scanline += 0x20; |
| r1877 | r1878 | |
| 280 | 280 | static TIMER_CALLBACK( williams_count240_off_callback ) |
| 281 | 281 | { |
| 282 | 282 | /* the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13 */ |
| 283 | pia_1_ca1_w(0, 0); | |
| 283 | pia_1_ca1_w(machine, 0, 0); | |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | |
| 287 | 287 | static TIMER_CALLBACK( williams_count240_callback ) |
| 288 | 288 | { |
| 289 | 289 | /* the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13 */ |
| 290 | pia_1_ca1_w(0, 1); | |
| 290 | pia_1_ca1_w(machine, 0, 1); | |
| 291 | 291 | |
| 292 | 292 | /* set a timer to turn it off once the scanline counter resets */ |
| 293 | 293 | timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, williams_count240_off_callback); |
| r1877 | r1878 | |
| 396 | 396 | int scanline = param; |
| 397 | 397 | |
| 398 | 398 | /* the IRQ signal comes into CB1, and is set to VA11 */ |
| 399 | pia_0_cb1_w(0, scanline & 0x20); | |
| 400 | pia_1_ca1_w(0, scanline & 0x20); | |
| 399 | pia_0_cb1_w(machine, 0, scanline & 0x20); | |
| 400 | pia_1_ca1_w(machine, 0, scanline & 0x20); | |
| 401 | 401 | |
| 402 | 402 | /* set a timer for the next update */ |
| 403 | 403 | scanline += 0x20; |
| r1877 | r1878 | |
| 409 | 409 | static TIMER_CALLBACK( williams2_endscreen_off_callback ) |
| 410 | 410 | { |
| 411 | 411 | /* the /ENDSCREEN signal comes into CA1 */ |
| 412 | pia_0_ca1_w(0, 1); | |
| 412 | pia_0_ca1_w(machine, 0, 1); | |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | |
| 416 | 416 | static TIMER_CALLBACK( williams2_endscreen_callback ) |
| 417 | 417 | { |
| 418 | 418 | /* the /ENDSCREEN signal comes into CA1 */ |
| 419 | pia_0_ca1_w(0, 0); | |
| 419 | pia_0_ca1_w(machine, 0, 0); | |
| 420 | 420 | |
| 421 | 421 | /* set a timer to turn it off once the scanline counter resets */ |
| 422 | 422 | timer_set(video_screen_get_time_until_pos(0, 8, 0), NULL, 0, williams2_endscreen_off_callback); |
| r1877 | r1878 | |
| 435 | 435 | |
| 436 | 436 | static void williams2_postload(void) |
| 437 | 437 | { |
| 438 | williams2_bank_select_w(0, vram_bank); | |
| 438 | williams2_bank_select_w(Machine, 0, vram_bank); | |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | |
| r1877 | r1878 | |
| 449 | 449 | memory_configure_bank(1, 1, 4, memory_region(REGION_CPU1) + 0x10000, 0x10000); |
| 450 | 450 | |
| 451 | 451 | /* make sure our banking is reset */ |
| 452 | williams2_bank_select_w(0, 0); | |
| 452 | williams2_bank_select_w(machine, 0, 0); | |
| 453 | 453 | |
| 454 | 454 | /* set a timer to go off every 16 scanlines, to toggle the VA11 line and update the screen */ |
| 455 | 455 | scanline_timer = timer_alloc(williams2_va11_callback, NULL); |
| r1877 | r1878 | |
| 526 | 526 | |
| 527 | 527 | static TIMER_CALLBACK( williams_deferred_snd_cmd_w ) |
| 528 | 528 | { |
| 529 | pia_2_portb_w(0, param); | |
| 530 | pia_2_cb1_w(0, (param == 0xff) ? 0 : 1); | |
| 529 | pia_2_portb_w(machine, 0, param); | |
| 530 | pia_2_cb1_w(machine, 0, (param == 0xff) ? 0 : 1); | |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | WRITE8_HANDLER( williams_snd_cmd_w ) |
| r1877 | r1878 | |
| 544 | 544 | |
| 545 | 545 | static TIMER_CALLBACK( williams2_deferred_snd_cmd_w ) |
| 546 | 546 | { |
| 547 | pia_2_porta_w(0, param); | |
| 547 | pia_2_porta_w(machine, 0, param); | |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | static WRITE8_HANDLER( williams2_snd_cmd_w ) |
| r1877 | r1878 | |
| 613 | 613 | READ8_HANDLER( williams_input_port_49way_0_5_r ) |
| 614 | 614 | { |
| 615 | 615 | if (port_select) |
| 616 | return williams_49way_port_0_r(0); | |
| 616 | return williams_49way_port_0_r(machine,0); | |
| 617 | 617 | else |
| 618 | 618 | return readinputport(5); |
| 619 | 619 | } |
| r1877 | r1878 | |
| 651 | 651 | { |
| 652 | 652 | /* yes, the data bits are checked for this specific value */ |
| 653 | 653 | if (data == 0x39) |
| 654 | watchdog_reset_w(0,0); | |
| 654 | watchdog_reset_w(machine,0,0); | |
| 655 | 655 | } |
| 656 | 656 | |
| 657 | 657 | |
| r1877 | r1878 | |
| 659 | 659 | { |
| 660 | 660 | /* yes, the data bits are checked for this specific value */ |
| 661 | 661 | if ((data & 0x3f) == 0x14) |
| 662 | watchdog_reset_w(0,0); | |
| 662 | watchdog_reset_w(machine,0,0); | |
| 663 | 663 | } |
| 664 | 664 | |
| 665 | 665 | |
| r1877 | r1878 | |
| 713 | 713 | |
| 714 | 714 | static void defender_postload(void) |
| 715 | 715 | { |
| 716 | defender_bank_select_w(0, vram_bank); | |
| 716 | defender_bank_select_w(Machine, 0, vram_bank); | |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | 719 | |
| r1877 | r1878 | |
| 723 | 723 | |
| 724 | 724 | /* configure the banking and make sure it is reset to 0 */ |
| 725 | 725 | memory_configure_bank(1, 0, 9, &memory_region(REGION_CPU1)[0x10000], 0x1000); |
| 726 | defender_bank_select_w(0, 0); | |
| 726 | defender_bank_select_w(machine, 0, 0); | |
| 727 | 727 | |
| 728 | 728 | state_save_register_func_postload(defender_postload); |
| 729 | 729 | } |
| r1877 | r1878 | |
| 799 | 799 | WRITE8_HANDLER( sinistar_vram_select_w ) |
| 800 | 800 | { |
| 801 | 801 | /* low two bits are standard */ |
| 802 | williams_vram_select_w(offset, data); | |
| 802 | williams_vram_select_w(machine, offset, data); | |
| 803 | 803 | |
| 804 | 804 | /* window enable from bit 2 (clips to 0x7400) */ |
| 805 | 805 | williams_blitter_window_enable = data & 0x04; |
| r1877 | r1878 | |
| 866 | 866 | static READ8_HANDLER( lottofun_input_port_0_r ) |
| 867 | 867 | { |
| 868 | 868 | /* merge in the ticket dispenser status */ |
| 869 | return input_port_0_r(offset) | ticket_dispenser_r(offset); | |
| 869 | return input_port_0_r(machine,offset) | ticket_dispenser_r(machine,offset); | |
| 870 | 870 | } |
| 871 | 871 | |
| 872 | 872 | |
| r1877 | r1878 | |
| 880 | 880 | static READ8_HANDLER( tshoot_input_port_0_3_r ) |
| 881 | 881 | { |
| 882 | 882 | /* merge in the gun inputs with the standard data */ |
| 883 | int data = williams_input_port_0_3_r(offset); | |
| 883 | int data = williams_input_port_0_3_r(machine, offset); | |
| 884 | 884 | int gun = (data & 0x3f) ^ ((data & 0x3f) >> 1); |
| 885 | 885 | return (data & 0xc0) | gun; |
| 886 | 886 | } |
| r1877 | r1878 | |
| 943 | 943 | |
| 944 | 944 | static TIMER_CALLBACK( joust2_deferred_snd_cmd_w ) |
| 945 | 945 | { |
| 946 | pia_2_porta_w(0, param & 0xff); | |
| 946 | pia_2_porta_w(machine, 0, param & 0xff); | |
| 947 | 947 | } |
| 948 | 948 | |
| 949 | 949 | |
| 950 | 950 | static WRITE8_HANDLER( joust2_pia_3_cb1_w ) |
| 951 | 951 | { |
| 952 | 952 | joust2_current_sound_data = (joust2_current_sound_data & ~0x100) | ((data << 8) & 0x100); |
| 953 | pia_3_cb1_w(offset, data); | |
| 953 | pia_3_cb1_w(machine, offset, data); | |
| 954 | 954 | } |
| 955 | 955 | |
| 956 | 956 |
| r1877 | r1878 | |
|---|---|---|
| 78 | 78 | static const UINT32 xmap_high_15[8] = { 0x1c6f2b4f, 0x9eebe281, 0x784b85d8, 0x401d6412, 0x0370ae0a, 0xa791d0b3, 0x89d290ea, 0x4666f009 }; |
| 79 | 79 | static const UINT32 xmap_high_16[8] = { 0xbe2beb93, 0xac9284fb, 0xa629fdbf, 0x82fe33dc, 0x75f1a31b, 0xee1f4f24, 0xaecc7e1e, 0xcd9b419e }; |
| 80 | 80 | |
| 81 | #ifdef UNUSED_DEFINITION | |
| 81 | 82 | static const UINT32 zmap_0[8] = { 0x08b01003, 0xed4037ec, 0x9a3a3044, 0x0daf5851, 0xa7725210, 0x0c1822ed, 0xbf726fe6, 0x6e783ea0 }; |
| 82 | 83 | static const UINT32 zmap_1[8] = { 0xc6783a02, 0x1e8239df, 0xa53d108b, 0xcc5784a1, 0x9bbb0123, 0xcc2c11dd, 0xbfb9bfda, 0x5db43f53 }; |
| 84 | #endif | |
| 83 | 85 | |
| 84 | 86 | static const UINT32 zmap_2[32] = { |
| 85 | 87 | 0x1b301017, 0x02310910, 0x04404644, 0x08042024, 0x050a3aa4, 0xb6087024, 0xa2204208, 0x1c9d9228, |
| r1877 | r1878 | |
|---|---|---|
| 339 | 339 | WRITE8_HANDLER( nb1413m3_sndrombank1_w ) |
| 340 | 340 | { |
| 341 | 341 | // if (data & 0x02) coin counter ? |
| 342 | nb1413m3_outcoin_w(0, data); // (data & 0x04) >> 2; | |
| 342 | nb1413m3_outcoin_w(machine, 0, data); // (data & 0x04) >> 2; | |
| 343 | 343 | nb1413m3_nmi_enable = ((data & 0x20) >> 5); |
| 344 | 344 | nb1413m3_sndrombank1 = (((data & 0xc0) >> 5) | ((data & 0x10) >> 4)); |
| 345 | 345 | } |
| r1877 | r1878 | |
| 381 | 381 | switch (nb1413m3_type) |
| 382 | 382 | { |
| 383 | 383 | case NB1413M3_PASTELG: |
| 384 | return ((input_port_3_r(0) & 0xfe) | (nb1413m3_busyflag & 0x01)); | |
| 384 | return ((input_port_3_r(machine,0) & 0xfe) | (nb1413m3_busyflag & 0x01)); | |
| 385 | 385 | case NB1413M3_TAIWANMB: |
| 386 | return ((input_port_3_r(0) & 0xfc) | ((nb1413m3_outcoin_flag & 0x01) << 1) | (nb1413m3_busyflag & 0x01)); | |
| 386 | return ((input_port_3_r(machine,0) & 0xfc) | ((nb1413m3_outcoin_flag & 0x01) << 1) | (nb1413m3_busyflag & 0x01)); | |
| 387 | 387 | case NB1413M3_HYHOO: |
| 388 | 388 | case NB1413M3_HYHOO2: |
| 389 | return ((input_port_2_r(0) & 0xfe) | (nb1413m3_busyflag & 0x01)); | |
| 389 | return ((input_port_2_r(machine,0) & 0xfe) | (nb1413m3_busyflag & 0x01)); | |
| 390 | 390 | default: |
| 391 | return ((input_port_2_r(0) & 0xfc) | ((nb1413m3_outcoin_flag & 0x01) << 1) | (nb1413m3_busyflag & 0x01)); | |
| 391 | return ((input_port_2_r(machine,0) & 0xfc) | ((nb1413m3_outcoin_flag & 0x01) << 1) | (nb1413m3_busyflag & 0x01)); | |
| 392 | 392 | } |
| 393 | 393 | } |
| 394 | 394 | |
| r1877 | r1878 | |
| 537 | 537 | case NB1413M3_MAIKO: |
| 538 | 538 | case NB1413M3_MMAIKO: |
| 539 | 539 | case NB1413M3_HANAOJI: |
| 540 | return ((input_port_13_r(0) & 0xfd) | ((nb1413m3_outcoin_flag & 0x01) << 1)); | |
| 540 | return ((input_port_13_r(machine,0) & 0xfd) | ((nb1413m3_outcoin_flag & 0x01) << 1)); | |
| 541 | 541 | break; |
| 542 | 542 | default: |
| 543 | 543 | return 0xff; |
| r1877 | r1878 | |
|---|---|---|
| 20 | 20 | { |
| 21 | 21 | CTRLD = data; |
| 22 | 22 | |
| 23 | discrete_sound_w(ATARIFB_WHISTLE_EN, data & 0x01); // Whistle | |
| 24 | discrete_sound_w(ATARIFB_HIT_EN, data & 0x02); // Hit | |
| 25 | discrete_sound_w(ATARIFB_ATTRACT_EN, data & 0x10); // Attract | |
| 26 | discrete_sound_w(ATARIFB_NOISE_EN, data & 0x04); // Noise Enable / Kicker | |
| 23 | discrete_sound_w(machine, ATARIFB_WHISTLE_EN, data & 0x01); // Whistle | |
| 24 | discrete_sound_w(machine, ATARIFB_HIT_EN, data & 0x02); // Hit | |
| 25 | discrete_sound_w(machine, ATARIFB_ATTRACT_EN, data & 0x10); // Attract | |
| 26 | discrete_sound_w(machine, ATARIFB_NOISE_EN, data & 0x04); // Noise Enable / Kicker | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| r1877 | r1878 | |
| 31 | 31 | { |
| 32 | 32 | CTRLD = data; |
| 33 | 33 | |
| 34 | discrete_sound_w(ATARIFB_WHISTLE_EN, data & 0x01); // Whistle | |
| 35 | discrete_sound_w(ATARIFB_HIT_EN, data & 0x02); // Hit | |
| 36 | discrete_sound_w(ATARIFB_ATTRACT_EN, data & 0x10); // Attract | |
| 37 | discrete_sound_w(ATARIFB_NOISE_EN, data & 0x04); // Noise Enable / Kicker | |
| 34 | discrete_sound_w(machine, ATARIFB_WHISTLE_EN, data & 0x01); // Whistle | |
| 35 | discrete_sound_w(machine, ATARIFB_HIT_EN, data & 0x02); // Hit | |
| 36 | discrete_sound_w(machine, ATARIFB_ATTRACT_EN, data & 0x10); // Attract | |
| 37 | discrete_sound_w(machine, ATARIFB_NOISE_EN, data & 0x04); // Noise Enable / Kicker | |
| 38 | 38 | |
| 39 | 39 | coin_counter_w (1, data & 0x80); |
| 40 | 40 | } |
| r1877 | r1878 | |
| 44 | 44 | { |
| 45 | 45 | CTRLD = data; |
| 46 | 46 | |
| 47 | discrete_sound_w(ATARIFB_WHISTLE_EN, data & 0x01); // Whistle | |
| 48 | discrete_sound_w(ATARIFB_HIT_EN, data & 0x02); // Hit | |
| 49 | discrete_sound_w(ATARIFB_ATTRACT_EN, data & 0x10); // Attract | |
| 50 | discrete_sound_w(ATARIFB_NOISE_EN, data & 0x04); // Noise Enable / Kicker | |
| 47 | discrete_sound_w(machine, ATARIFB_WHISTLE_EN, data & 0x01); // Whistle | |
| 48 | discrete_sound_w(machine, ATARIFB_HIT_EN, data & 0x02); // Hit | |
| 49 | discrete_sound_w(machine, ATARIFB_ATTRACT_EN, data & 0x10); // Attract | |
| 50 | discrete_sound_w(machine, ATARIFB_NOISE_EN, data & 0x04); // Noise Enable / Kicker | |
| 51 | 51 | |
| 52 | 52 | if (data & 0x80) |
| 53 | 53 | { |
| 54 | 54 | /* Invert video */ |
| 55 | palette_set_color(Machine,1,MAKE_RGB(0x00,0x00,0x00)); /* black */ | |
| 56 | palette_set_color(Machine,0,MAKE_RGB(0xff,0xff,0xff)); /* white */ | |
| 55 | palette_set_color(machine,1,MAKE_RGB(0x00,0x00,0x00)); /* black */ | |
| 56 | palette_set_color(machine,0,MAKE_RGB(0xff,0xff,0xff)); /* white */ | |
| 57 | 57 | } |
| 58 | 58 | else |
| 59 | 59 | { |
| 60 | 60 | /* Regular video */ |
| 61 | palette_set_color(Machine,0,MAKE_RGB(0x00,0x00,0x00)); /* black */ | |
| 62 | palette_set_color(Machine,1,MAKE_RGB(0xff,0xff,0xff)); /* white */ | |
| 61 | palette_set_color(machine,0,MAKE_RGB(0x00,0x00,0x00)); /* black */ | |
| 62 | palette_set_color(machine,1,MAKE_RGB(0xff,0xff,0xff)); /* white */ | |
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
| r1877 | r1878 | |
| 76 | 76 | /* bit 5-6 = trackball CTRL bits */ |
| 77 | 77 | /* bit 7 = Rule LED */ |
| 78 | 78 | |
| 79 | discrete_sound_w(ATARIFB_WHISTLE_EN, data & 0x01); // Whistle | |
| 80 | discrete_sound_w(ATARIFB_HIT_EN, data & 0x02); // Hit | |
| 81 | discrete_sound_w(ATARIFB_ATTRACT_EN, data & 0x10); // Attract | |
| 82 | discrete_sound_w(ATARIFB_NOISE_EN, data & 0x04); // Noise Enable / Kicker | |
| 79 | discrete_sound_w(machine, ATARIFB_WHISTLE_EN, data & 0x01); // Whistle | |
| 80 | discrete_sound_w(machine, ATARIFB_HIT_EN, data & 0x02); // Hit | |
| 81 | discrete_sound_w(machine, ATARIFB_ATTRACT_EN, data & 0x10); // Attract | |
| 82 | discrete_sound_w(machine, ATARIFB_NOISE_EN, data & 0x04); // Noise Enable / Kicker | |
| 83 | 83 | |
| 84 | 84 | // set_led_status(0,data & 0x10); // !!!!!!!!!! Is this correct???? |
| 85 | 85 | set_led_status(1,data & 0x80); |
| r1877 | r1878 | |
| 88 | 88 | |
| 89 | 89 | WRITE8_HANDLER( atarifb_out2_w ) |
| 90 | 90 | { |
| 91 | discrete_sound_w(ATARIFB_CROWD_DATA, data & 0x0f); // Crowd | |
| 91 | discrete_sound_w(machine, ATARIFB_CROWD_DATA, data & 0x0f); // Crowd | |
| 92 | 92 | |
| 93 | 93 | coin_counter_w (0, data & 0x10); |
| 94 | 94 | } |
| r1877 | r1878 | |
| 96 | 96 | |
| 97 | 97 | WRITE8_HANDLER( soccer_out2_w ) |
| 98 | 98 | { |
| 99 | discrete_sound_w(ATARIFB_CROWD_DATA, data & 0x0f); // Crowd | |
| 99 | discrete_sound_w(machine, ATARIFB_CROWD_DATA, data & 0x0f); // Crowd | |
| 100 | 100 | |
| 101 | 101 | coin_counter_w (0, data & 0x10); |
| 102 | 102 | coin_counter_w (1, data & 0x20); |
| r1877 | r1878 | |
| 152 | 152 | (sign_x_2 >> 6) | |
| 153 | 153 | (sign_y_1 >> 5) | |
| 154 | 154 | (sign_x_1 >> 4) | |
| 155 | input_port_0_r(offset); | |
| 155 | input_port_0_r(machine, offset); | |
| 156 | 156 | return val; |
| 157 | 157 | } |
| 158 | 158 | else |
| r1877 | r1878 | |
| 184 | 184 | { |
| 185 | 185 | if ((CTRLD & 0x20)==0x00) |
| 186 | 186 | { |
| 187 | return input_port_1_r(offset); | |
| 187 | return input_port_1_r(machine, offset); | |
| 188 | 188 | } |
| 189 | 189 | else |
| 190 | 190 | { |
| r1877 | r1878 | |
| 282 | 282 | { |
| 283 | 283 | if ((CTRLD & 0x40)==0x00) |
| 284 | 284 | { |
| 285 | return input_port_2_r(offset); | |
| 285 | return input_port_2_r(machine, offset); | |
| 286 | 286 | } |
| 287 | 287 | else if ((CTRLD & 0x60) == 0x60) |
| 288 | 288 | /* LD1 and LD2 both high, return Team 2 right player (player 3) */ |
| r1877 | r1878 | |
|---|---|---|
| 102 | 102 | |
| 103 | 103 | READ8_HANDLER( simpsons_sound_interrupt_r ) |
| 104 | 104 | { |
| 105 | cpunum_set_input_line_and_vector( | |
| 105 | cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0xff ); | |
| 106 | 106 | return 0x00; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | READ8_HANDLER( simpsons_sound_r ) |
| 110 | 110 | { |
| 111 | return K053260_0_r(2 + offset); | |
| 111 | return K053260_0_r(machine, 2 + offset); | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 |
| r1877 | r1878 | |
|---|---|---|
| 29 | 29 | INTERRUPT_GEN( subs_interrupt ) |
| 30 | 30 | { |
| 31 | 31 | /* only do NMI interrupt if not in TEST mode */ |
| 32 | if ((input_port_2_r(0) & 0x40)==0x40) | |
| 32 | if ((input_port_2_r(machine, 0) & 0x40)==0x40) | |
| 33 | 33 | cpunum_set_input_line(machine, 0,INPUT_LINE_NMI,PULSE_LINE); |
| 34 | 34 | } |
| 35 | 35 | |
| r1877 | r1878 | |
| 40 | 40 | If D6 is high, it moved left. If D6 is low, it moved right. |
| 41 | 41 | Be sure to keep returning a direction until steer_reset is called. |
| 42 | 42 | ***************************************************************************/ |
| 43 | static int subs_steering_1( | |
| 43 | static int subs_steering_1(running_machine *machine) | |
| 44 | 44 | { |
| 45 | 45 | static int last_val=0; |
| 46 | 46 | int this_val; |
| 47 | 47 | int delta; |
| 48 | 48 | |
| 49 | this_val=input_port_3_r(0); | |
| 49 | this_val=input_port_3_r(machine, 0); | |
| 50 | 50 | |
| 51 | 51 | delta=this_val-last_val; |
| 52 | 52 | last_val=this_val; |
| r1877 | r1878 | |
| 69 | 69 | return subs_steering_val1; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | static int subs_steering_2( | |
| 72 | static int subs_steering_2(running_machine *machine) | |
| 73 | 73 | { |
| 74 | 74 | static int last_val=0; |
| 75 | 75 | int this_val; |
| 76 | 76 | int delta; |
| 77 | 77 | |
| 78 | this_val=input_port_4_r(0); | |
| 78 | this_val=input_port_4_r(machine,0); | |
| 79 | 79 | |
| 80 | 80 | delta=this_val-last_val; |
| 81 | 81 | last_val=this_val; |
| r1877 | r1878 | |
| 112 | 112 | ***************************************************************************/ |
| 113 | 113 | READ8_HANDLER( subs_control_r ) |
| 114 | 114 | { |
| 115 | int inport = input_port_1_r(offset); | |
| 115 | int inport = input_port_1_r(machine, offset); | |
| 116 | 116 | |
| 117 | 117 | switch (offset & 0x07) |
| 118 | 118 | { |
| r1877 | r1878 | |
| 120 | 120 | case 0x01: return ((inport & 0x02) << 6); /* diag hold */ |
| 121 | 121 | case 0x02: return ((inport & 0x04) << 5); /* slam */ |
| 122 | 122 | case 0x03: return ((inport & 0x08) << 4); /* spare */ |
| 123 | case 0x04: return ((subs_steering_1() & 0x40) << 1); /* steer dir 1 */ | |
| 124 | case 0x05: return ((subs_steering_1() & 0x80) << 0); /* steer flag 1 */ | |
| 125 | case 0x06: return ((subs_steering_2() & 0x40) << 1); /* steer dir 2 */ | |
| 126 | case 0x07: return ((subs_steering_2() & 0x80) << 0); /* steer flag 2 */ | |
| 123 | case 0x04: return ((subs_steering_1(machine) & 0x40) << 1); /* steer dir 1 */ | |
| 124 | case 0x05: return ((subs_steering_1(machine) & 0x80) << 0); /* steer flag 1 */ | |
| 125 | case 0x06: return ((subs_steering_2(machine) & 0x40) << 1); /* steer dir 2 */ | |
| 126 | case 0x07: return ((subs_steering_2(machine) & 0x80) << 0); /* steer flag 2 */ | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | return 0; |
| r1877 | r1878 | |
| 134 | 134 | ***************************************************************************/ |
| 135 | 135 | READ8_HANDLER( subs_coin_r ) |
| 136 | 136 | { |
| 137 | int inport = input_port_2_r(offset); | |
| 137 | int inport = input_port_2_r(machine, offset); | |
| 138 | 138 | |
| 139 | 139 | switch (offset & 0x07) |
| 140 | 140 | { |
| r1877 | r1878 | |
| 156 | 156 | ***************************************************************************/ |
| 157 | 157 | READ8_HANDLER( subs_options_r ) |
| 158 | 158 | { |
| 159 | int opts = input_port_0_r(offset); | |
| 159 | int opts = input_port_0_r(machine, offset); | |
| 160 | 160 | |
| 161 | 161 | switch (offset & 0x03) |
| 162 | 162 | { |
| r1877 | r1878 | |
|---|---|---|
| 140 | 140 | switch ((offset & 0x01c0) >> 6){ |
| 141 | 141 | case 0x00: /* NSFIRQ + AFR */ |
| 142 | 142 | if (offset) |
| 143 | watchdog_reset_w(0, data); | |
| 143 | watchdog_reset_w(machine, 0, data); | |
| 144 | 144 | else{ |
| 145 | 145 | if (firq_enable) /* Cause interrupt on slave CPU */ |
| 146 | cpunum_set_input_line( | |
| 146 | cpunum_set_input_line(machine, 1, M6809_FIRQ_LINE, HOLD_LINE); | |
| 147 | 147 | } |
| 148 | 148 | break; |
| 149 | 149 | case 0x01: /* Cause interrupt on audio CPU */ |
| 150 | cpunum_set_input_line( | |
| 150 | cpunum_set_input_line(machine, 2, 0, HOLD_LINE); | |
| 151 | 151 | break; |
| 152 | 152 | case 0x02: /* Sound command number */ |
| 153 | soundlatch_w(offset,data); | |
| 153 | soundlatch_w(machine,offset,data); | |
| 154 | 154 | break; |
| 155 | 155 | case 0x03: /* Bankswitch + coin counters + priority*/ |
| 156 | ajax_bankswitch_w(0, data); | |
| 156 | ajax_bankswitch_w(machine, 0, data); | |
| 157 | 157 | break; |
| 158 | 158 | case 0x05: /* Lamps + Joystick vibration + Control panel quaking */ |
| 159 | ajax_lamps_w(0, data); | |
| 159 | ajax_lamps_w(machine, 0, data); | |
| 160 | 160 | break; |
| 161 | 161 | |
| 162 | 162 | default: |
| r1877 | r1878 | |
|---|---|---|
| 218 | 218 | |
| 219 | 219 | MACHINE_RESET( bagman ) |
| 220 | 220 | { |
| 221 | bagman_pal16r6_w(0,1); /*pin 2*/ | |
| 222 | bagman_pal16r6_w(1,1); /*pin 3*/ | |
| 223 | bagman_pal16r6_w(2,1); /*pin 4*/ | |
| 224 | bagman_pal16r6_w(3,1); /*pin 5*/ | |
| 225 | bagman_pal16r6_w(4,1); /*pin 6*/ | |
| 226 | bagman_pal16r6_w(5,1); /*pin 7*/ | |
| 227 | bagman_pal16r6_w(6,1); /*pin 8*/ | |
| 228 | bagman_pal16r6_w(7,1); /*pin 9*/ | |
| 221 | bagman_pal16r6_w(machine,0,1); /*pin 2*/ | |
| 222 | bagman_pal16r6_w(machine,1,1); /*pin 3*/ | |
| 223 | bagman_pal16r6_w(machine,2,1); /*pin 4*/ | |
| 224 | bagman_pal16r6_w(machine,3,1); /*pin 5*/ | |
| 225 | bagman_pal16r6_w(machine,4,1); /*pin 6*/ | |
| 226 | bagman_pal16r6_w(machine,5,1); /*pin 7*/ | |
| 227 | bagman_pal16r6_w(machine,6,1); /*pin 8*/ | |
| 228 | bagman_pal16r6_w(machine,7,1); /*pin 9*/ | |
| 229 | 229 | update_pal(); |
| 230 | 230 | } |
| 231 | 231 |
| r1877 | r1878 | |
|---|---|---|
| 212 | 212 | ***************************************************************************/ |
| 213 | 213 | WRITE8_HANDLER( nitedrvr_out0_w ) |
| 214 | 214 | { |
| 215 | discrete_sound_w(NITEDRVR_MOTOR_DATA, data & 0x0f); // Motor freq data | |
| 216 | discrete_sound_w(NITEDRVR_SKID1_EN, data & 0x10); // Skid1 enable | |
| 217 | discrete_sound_w(NITEDRVR_SKID2_EN, data & 0x20); // Skid2 enable | |
| 215 | discrete_sound_w(machine, NITEDRVR_MOTOR_DATA, data & 0x0f); // Motor freq data | |
| 216 | discrete_sound_w(machine, NITEDRVR_SKID1_EN, data & 0x10); // Skid1 enable | |
| 217 | discrete_sound_w(machine, NITEDRVR_SKID2_EN, data & 0x20); // Skid2 enable | |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | /*************************************************************************** |
| r1877 | r1878 | |
| 232 | 232 | set_led_status(0,data & 0x10); |
| 233 | 233 | |
| 234 | 234 | nitedrvr_crash_en = data & 0x01; |
| 235 | discrete_sound_w(NITEDRVR_CRASH_EN, nitedrvr_crash_en); // Crash enable | |
| 236 | discrete_sound_w(NITEDRVR_ATTRACT_EN, data & 0x02); // Attract enable (sound disable) | |
| 235 | discrete_sound_w(machine, NITEDRVR_CRASH_EN, nitedrvr_crash_en); // Crash enable | |
| 236 | discrete_sound_w(machine, NITEDRVR_ATTRACT_EN, data & 0x02); // Attract enable (sound disable) | |
| 237 | 237 | |
| 238 | 238 | if (!nitedrvr_crash_en) |
| 239 | 239 | { |
| r1877 | r1878 | |
| 241 | 241 | nitedrvr_crash_data_en = 1; |
| 242 | 242 | nitedrvr_crash_data = 0x0f; |
| 243 | 243 | /* Invert video */ |
| 244 | palette_set_color(Machine,1,MAKE_RGB(0x00,0x00,0x00)); /* BLACK */ | |
| 245 | palette_set_color(Machine,0,MAKE_RGB(0xff,0xff,0xff)); /* WHITE */ | |
| 244 | palette_set_color(machine,1,MAKE_RGB(0x00,0x00,0x00)); /* BLACK */ | |
| 245 | palette_set_color(machine,0,MAKE_RGB(0xff,0xff,0xff)); /* WHITE */ | |
| 246 | 246 | } |
| 247 | discrete_sound_w(NITEDRVR_BANG_DATA, nitedrvr_crash_data_en ? nitedrvr_crash_data : 0); // Crash Volume | |
| 247 | discrete_sound_w(machine, NITEDRVR_BANG_DATA, nitedrvr_crash_data_en ? nitedrvr_crash_data : 0); // Crash Volume | |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | |
| r1877 | r1878 | |
| 253 | 253 | if (nitedrvr_crash_en && nitedrvr_crash_data_en) |
| 254 | 254 | { |
| 255 | 255 | nitedrvr_crash_data--; |
| 256 | discrete_sound_w(NITEDRVR_BANG_DATA, nitedrvr_crash_data); // Crash Volume | |
| 256 | discrete_sound_w(machine, NITEDRVR_BANG_DATA, nitedrvr_crash_data); // Crash Volume | |
| 257 | 257 | if (!nitedrvr_crash_data) nitedrvr_crash_data_en = 0; // Done counting? |
| 258 | 258 | if (nitedrvr_crash_data & 0x01) |
| 259 | 259 | { |
| r1877 | r1878 | |
|---|---|---|
| 938 | 938 | DRIVER( dkongjrj ) /* (c) 1982 Nintendo */ |
| 939 | 939 | DRIVER( dkngjnrj ) /* (c) 1982 Nintendo */ |
| 940 | 940 | DRIVER( dkongjrb ) /* bootleg */ |
| 941 | DRIVER( dkngj | |
| 941 | DRIVER( dkongj | |
| 942 | 942 | DRIVER( dkong3 ) /* (c) 1983 Nintendo of America */ |
| 943 | 943 | DRIVER( dkong3j ) /* (c) 1983 Nintendo */ |
| 944 | 944 | DRIVER( dkong3b ) /* bootleg */ |
| r1877 | r1878 | |
|---|---|---|
| 93 | 93 | WRITE8_HANDLER( zzzap_audio_2_w ); |
| 94 | 94 | |
| 95 | 95 | MACHINE_DRIVER_EXTERN( maze_audio ); |
| 96 | void maze_write_discrete(UINT8 maze_tone_timing_state); | |
| 96 | void maze_write_discrete(running_machine *machine, UINT8 maze_tone_timing_state); | |
| 97 | 97 | |
| 98 | 98 | MACHINE_DRIVER_EXTERN( boothill_audio ); |
| 99 | 99 | WRITE8_HANDLER( boothill_audio_w ); |
| r1877 | r1878 | |
|---|---|---|
| 27 | 27 | UINT8 y_scroll_d; |
| 28 | 28 | UINT8 y_scroll_e; |
| 29 | 29 | UINT8 y_scroll_f; |
| 30 | UINT8 | |
| 30 | UINT8 fr | |
| 31 | 31 | UINT8 shot_standby; |
| 32 | 32 | UINT8 shot_arrive; |
| 33 | 33 | UINT16 beam_state; |
| r1877 | r1878 | |
| 45 | 45 | WRITE8_HANDLER( stactics_speed_latch_w ); |
| 46 | 46 | WRITE8_HANDLER( stactics_shot_trigger_w ); |
| 47 | 47 | WRITE8_HANDLER( stactics_shot_flag_clear_w ); |
| 48 | CUSTOM_INPUT( stactics_get_ | |
| 48 | CUSTOM_INPUT( stactics_get_fr | |
| 49 | 49 | CUSTOM_INPUT( stactics_get_shot_standby ); |
| 50 | 50 | CUSTOM_INPUT( stactics_get_not_shot_arrive ); |
| 51 | 51 |
| r1877 | r1878 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | WRITE16_HANDLER( lethalj_blitter_w ); |
| 14 | 14 | |
| 15 | void lethalj_scanline_update(running_machine *machine, int screen, | |
| 15 | void lethalj_scanline_update(running_machine *machine, int screen, |
| r1877 | r1878 | |
|---|---|---|
| 40 | 40 | |
| 41 | 41 | /*----------- defined in video/cvs.c -----------*/ |
| 42 | 42 | |
| 43 | extern | |
| 43 | extern | |
| 44 | 44 | extern int cvs_collision_register; |
| 45 | 45 | |
| 46 | 46 | PALETTE_INIT( cvs ); |
| r1877 | r1878 | |
|---|---|---|
| 36 | 36 | extern VIDEO_UPDATE( gwar ); |
| 37 | 37 | extern VIDEO_UPDATE( sgladiat ); |
| 38 | 38 | |
| 39 | void tnk3_draw_text( running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int bank, UINT8 *source ); | |
| 40 | void tnk3_draw_status( running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int bank, UINT8 *source ); | |
| 39 | void tnk3_draw_text( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bank, UINT8 *source ); | |
| 40 | void tnk3_draw_status( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bank, UINT8 *source ); | |
| 41 | 41 | |
| 42 | 42 | // note: compare tdfever which does blinking in software with tdfeverj which does it in hardware |
| 43 | 43 | extern int snk_blink_parity; |
| r1877 | r1878 | |
|---|---|---|
| 589 | 589 | FUNC(40); FUNC(41); FUNC(42); FUNC(43); \ |
| 590 | 590 | FUNC(44); FUNC(45); FUNC(46); FUNC(47); |
| 591 | 591 | |
| 592 | typedef void (*renderer_func | |
| 592 | typedef void (*atari_renderer_func | |
| 593 | 593 | |
| 594 | 594 | /*----------- defined in video/antic.c -----------*/ |
| 595 | 595 |
| r0 | r1878 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | Technos Mysterious Stones hardware | |
| 4 | ||
| 5 | driver by Nicola Salmoria | |
| 6 | ||
| 7 | ***************************************************************************/ | |
| 8 | ||
| 9 | ||
| 10 | #define MYSTSTON_MASTER_CLOCK (XTAL_12MHz) | |
| 11 | ||
| 12 | ||
| 13 | typedef struct _mystston_state mystston_state; | |
| 14 | struct _mystston_state | |
| 15 | { | |
| 16 | /* machine state */ | |
| 17 | UINT8 *ay8910_data; | |
| 18 | UINT8 *ay8910_select; | |
| 19 | ||
| 20 | /* video state */ | |
| 21 | tilemap *fg_tilemap; | |
| 22 | tilemap *bg_tilemap; | |
| 23 | emu_timer *interrupt_timer; | |
| 24 | UINT8 *bg_videoram; | |
| 25 | UINT8 *fg_videoram; | |
| 26 | UINT8 *spriteram; | |
| 27 | UINT8 *paletteram; | |
| 28 | UINT8 *scroll; | |
| 29 | UINT8 *video_control; | |
| 30 | }; | |
| 31 | ||
| 32 | ||
| 33 | /*----------- defined in drivers/mystston.c -----------*/ | |
| 34 | ||
| 35 | void mystston_on_scanline_interrupt(running_machine *machine); | |
| 36 | ||
| 37 | ||
| 38 | /*----------- defined in video/mystston.c -----------*/ | |
| 39 | ||
| 40 | MACHINE_DRIVER_EXTERN( mystston_video ); | |
| 41 | WRITE8_HANDLER( mystston_video_control_w ); |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | READ16_HANDLER( midyunit_dma_r ); |
| 62 | 62 | WRITE16_HANDLER( midyunit_dma_w ); |
| 63 | 63 | |
| 64 | void midyunit_scanline_update(running_machine *machine, int screen, | |
| 64 | void midyunit_scanline_update(running_machine *machine, int screen, |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | VIDEO_START( rampart ); |
| 11 | 11 | VIDEO_UPDATE( rampart ); |
| 12 | 12 | |
| 13 | void rampart_bitmap_render(running_machine *machine, | |
| 13 | void rampart_bitmap_render(running_machine *machine, | |
| 14 | 14 | |
| 15 | 15 | extern UINT16 *rampart_bitmap; |
| r1877 | r1878 | |
|---|---|---|
| 19 | 19 | READ16_HANDLER( artmagic_blitter_r ); |
| 20 | 20 | WRITE16_HANDLER( artmagic_blitter_w ); |
| 21 | 21 | |
| 22 | void artmagic_scanline(running_machine *machine, int screen, | |
| 22 | void artmagic_scanline(running_machine *machine, int screen, |
| r1877 | r1878 | |
|---|---|---|
| 29 | 29 | void deco16_set_tilemap_colour_mask(int tmap, int mask); |
| 30 | 30 | void deco16_set_tilemap_transparency_mask(int tmap, int mask); |
| 31 | 31 | |
| 32 | void deco16_tilemap_1_draw(mame_bitmap *bitmap, const rectangle *cliprect, int flags, UINT32 priority); | |
| 33 | void deco16_tilemap_2_draw(mame_bitmap *bitmap, const rectangle *cliprect, int flags, UINT32 priority); | |
| 34 | void deco16_tilemap_3_draw(mame_bitmap *bitmap, const rectangle *cliprect, int flags, UINT32 priority); | |
| 35 | void deco16_tilemap_4_draw(mame_bitmap *bitmap, const rectangle *cliprect, int flags, UINT32 priority); | |
| 32 | void deco16_tilemap_1_draw(bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); | |
| 33 | void deco16_tilemap_2_draw(bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); | |
| 34 | void deco16_tilemap_3_draw(bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); | |
| 35 | void deco16_tilemap_4_draw(bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); | |
| 36 | 36 | |
| 37 | void deco16_tilemap_34_combine_draw( | |
| 37 | void deco16_tilemap_34_combine_draw( | |
| 38 | 38 | |
| 39 | 39 | void deco16_clear_sprite_priority_bitmap(void); |
| 40 | void deco16_pdrawgfx( | |
| 40 | void deco16_pdrawgfx( | |
| 41 | 41 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 42 | 42 | const rectangle *clip,int transparency,int transparent_color,UINT32 pri_mask,UINT32 sprite_mask,UINT8 write_pri); |
| 43 | 43 | |
| r1877 | r1878 | |
| 56 | 56 | |
| 57 | 57 | READ16_HANDLER( deco16_71_r ); |
| 58 | 58 | |
| 59 | void deco16_print_debug_info( | |
| 59 | void deco16_print_debug_info( |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | extern UINT16 *exterm_slave_videoram; |
| 11 | 11 | |
| 12 | 12 | PALETTE_INIT( exterm ); |
| 13 | void exterm_scanline_update(running_machine *machine, int screen, | |
| 13 | void exterm_scanline_update(running_machine *machine, int screen, | |
| 14 | 14 | |
| 15 | 15 | void exterm_to_shiftreg_master(UINT32 address, UINT16* shiftreg); |
| 16 | 16 | void exterm_from_shiftreg_master(UINT32 address, UINT16* shiftreg); |
| r1877 | r1878 | |
|---|---|---|
| 29 | 29 | #define MONTECAR_BEEPER_EN FIRETRUCK_XTNDPLY_EN |
| 30 | 30 | #define MONTECAR_ATTRACT_INV FIRETRUCK_ATTRACT_EN |
| 31 | 31 | |
| 32 | #define GAME_IS_FIRETRUCK (firetrk_game == 1) | |
| 33 | #define GAME_IS_SUPERBUG (firetrk_game == 2) | |
| 34 | #define GAME_IS_MONTECARLO (firetrk_game == 3) | |
| 35 | 32 | |
| 36 | ||
| 37 | /*----------- defined in drivers/firetrk.c -----------*/ | |
| 38 | ||
| 39 | extern int firetrk_game; | |
| 40 | ||
| 41 | extern UINT32 firetrk_color1_mask; | |
| 42 | extern UINT32 firetrk_color2_mask; | |
| 43 | ||
| 44 | ||
| 45 | 33 | /*----------- defined in audio/firetrk.c -----------*/ |
| 46 | 34 | |
| 47 | 35 | WRITE8_HANDLER( firetrk_skid_reset_w ); |
| 36 | WRITE8_HANDLER( montecar_skid_reset_w ); | |
| 48 | 37 | WRITE8_HANDLER( firetrk_crash_snd_w ); |
| 49 | 38 | WRITE8_HANDLER( firetrk_skid_snd_w ); |
| 50 | 39 | WRITE8_HANDLER( firetrk_motor_snd_w ); |
| 40 | WRITE8_HANDLER( superbug_motor_snd_w ); | |
| 51 | 41 | WRITE8_HANDLER( firetrk_xtndply_w ); |
| 52 | WRITE8_HANDLER( firetrk_asr_w ); | |
| 53 | WRITE8_HANDLER( firetrk_out2_w ); | |
| 42 | WRITE8_HANDLER( superbug_asr_w ); | |
| 54 | 43 | |
| 55 | 44 | DISCRETE_SOUND_EXTERN( firetrk ); |
| 56 | 45 | DISCRETE_SOUND_EXTERN( superbug ); |
| r1877 | r1878 | |
| 59 | 48 | |
| 60 | 49 | /*----------- defined in video/firetrk.c -----------*/ |
| 61 | 50 | |
| 62 | extern VIDEO_UPDATE( firetrk ); | |
| 63 | extern VIDEO_START( firetrk ); | |
| 64 | extern VIDEO_EOF( firetrk ); | |
| 51 | PALETTE_INIT( firetrk ); | |
| 52 | PALETTE_INIT( montecar ); | |
| 53 | VIDEO_START( firetrk ); | |
| 54 | VIDEO_START( superbug ); | |
| 55 | VIDEO_START( montecar ); | |
| 56 | VIDEO_UPDATE( firetrk ); | |
| 57 | VIDEO_UPDATE( superbug ); | |
| 58 | VIDEO_UPDATE( montecar ); | |
| 65 | 59 | |
| 66 | extern WRITE8_HANDLER( firetrk_vert_w ); | |
| 67 | extern WRITE8_HANDLER( firetrk_horz_w ); | |
| 68 | extern WRITE8_HANDLER( firetrk_drone_hpos_w ); | |
| 69 | extern WRITE8_HANDLER( firetrk_drone_vpos_w ); | |
| 70 | extern WRITE8_HANDLER( firetrk_drone_rot_w ); | |
| 71 | extern WRITE8_HANDLER( firetrk_playfield_w ); | |
| 72 | extern WRITE8_HANDLER( firetrk_car_rot_w ); | |
| 60 | extern UINT8 *firetrk_alpha_num_ram; | |
| 61 | extern UINT8 *firetrk_playfield_ram; | |
| 62 | extern UINT8 *firetrk_scroll_x; | |
| 63 | extern UINT8 *firetrk_scroll_y; | |
| 64 | extern UINT8 *firetrk_car_rot; | |
| 65 | extern UINT8 *firetrk_drone_rot; | |
| 66 | extern UINT8 *firetrk_drone_x; | |
| 67 | extern UINT8 *firetrk_drone_y; | |
| 68 | extern UINT8 *firetrk_blink; | |
| 69 | extern UINT8 firetrk_flash; | |
| 73 | 70 | |
| 74 | extern void firetrk_set_flash(int flag); | |
| 75 | extern void firetrk_set_blink(int flag); | |
| 76 | ||
| 77 | extern UINT8* firetrk_alpha_num_ram; | |
| 78 | extern UINT8* firetrk_playfield_ram; | |
| 79 | ||
| 80 | extern int firetrk_crash[2]; | |
| 81 | extern int firetrk_skid[2]; | |
| 71 | extern UINT8 firetrk_crash[2]; | |
| 72 | extern UINT8 firetrk_skid[2]; |
| r1877 | r1878 | |
|---|---|---|
| 11 | 11 | READ16_HANDLER( system24temp_sys16_shared_ram_r ); |
| 12 | 12 | WRITE16_HANDLER( system24temp_sys16_shared_ram_w ); |
| 13 | 13 | |
| 14 | void system24temp_sys16_io_set_callbacks(UINT8 (*io_r)(int port), | |
| 15 | void (*io_w)(int port, UINT8 data), | |
| 14 | void system24temp_sys16_io_set_callbacks(UINT8 (*io_r)(running_machine *machine, int port), | |
| 15 | void (*io_w)(running_machine *machine, int port, UINT8 data), | |
| 16 | 16 | void (*cnt_w)(UINT8 data), |
| 17 | 17 | READ16_HANDLER ((*iod_r)), |
| 18 | 18 | WRITE16_HANDLER((*iod_w))); |
| r1877 | r1878 | |
|---|---|---|
| 93 | 93 | void namco_tilemap_init( |
| 94 | 94 | int gfxbank, void *pMaskROM, |
| 95 | 95 | void (*cb)( UINT16 code, int *gfx, int *mask) ); |
| 96 | void namco_tilemap_draw( | |
| 96 | void namco_tilemap_draw( | |
| 97 | 97 | void namco_tilemap_invalidate( void ); |
| 98 | 98 | WRITE16_HANDLER( namco_tilemapvideoram16_w ); |
| 99 | 99 | READ16_HANDLER( namco_tilemapvideoram16_r ); |
| r1877 | r1878 | |
| 113 | 113 | /***********************************************************************************/ |
| 114 | 114 | |
| 115 | 115 | /* Namco System II Sprite Rendering */ |
| 116 | void namcos2_draw_sprites(running_machine *machine, | |
| 116 | void namcos2_draw_sprites(running_machine *machine, | |
| 117 | 117 | |
| 118 | void namcos2_draw_sprites_metalhawk(running_machine *machine, | |
| 118 | void namcos2_draw_sprites_metalhawk(running_machine *machine, | |
| 119 | 119 | |
| 120 | 120 | /***********************************************************************************/ |
| 121 | 121 | /* C355 Motion Object Emulation */ |
| 122 | 122 | |
| 123 | 123 | /* for palXOR, supply either 0x0 (normal) or 0xf (palette mapping reversed) */ |
| 124 | 124 | void namco_obj_init( int gfxbank, int palXOR, int (*code2tile)( int code ) ); |
| 125 | void namco_obj_draw(running_machine *machine, | |
| 125 | void namco_obj_draw(running_machine *machine, | |
| 126 | 126 | |
| 127 | 127 | WRITE16_HANDLER( namco_obj16_w ); |
| 128 | 128 | READ16_HANDLER( namco_obj16_r ); |
| r1877 | r1878 | |
| 142 | 142 | /* C169 ROZ Layer Emulation */ |
| 143 | 143 | |
| 144 | 144 | void namco_roz_init( int gfxbank, int maskregion ); |
| 145 | void namco_roz_draw( | |
| 145 | void namco_roz_draw( | |
| 146 | 146 | |
| 147 | 147 | READ16_HANDLER( namco_rozcontrol16_r ); |
| 148 | 148 | WRITE16_HANDLER( namco_rozcontrol16_w ); |
| r1877 | r1878 | |
| 167 | 167 | |
| 168 | 168 | void namco_road_init(running_machine *machine, int gfxbank ); |
| 169 | 169 | void namco_road_set_transparent_color(pen_t pen); |
| 170 | void namco_road_draw(running_machine *machine, | |
| 170 | void namco_road_draw(running_machine *machine, | |
| 171 | 171 | |
| 172 | 172 | READ16_HANDLER( namco_road16_r ); |
| 173 | 173 | WRITE16_HANDLER( namco_road16_w ); |
| r1877 | r1878 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | void jpmimpct_to_shiftreg(UINT32 address, UINT16 *shiftreg); |
| 15 | 15 | void jpmimpct_from_shiftreg(UINT32 address, UINT16 *shiftreg); |
| 16 | void jpmimpct_scanline_update(running_machine *machine, int screen, | |
| 16 | void jpmimpct_scanline_update(running_machine *machine, int screen, | |
| 17 | 17 | |
| 18 | 18 | VIDEO_START( jpmimpct ); |
| r1877 | r1878 | |
|---|---|---|
| 11 | 11 | VIDEO_START( thunderj ); |
| 12 | 12 | VIDEO_UPDATE( thunderj ); |
| 13 | 13 | |
| 14 | void thunderj_mark_high_palette( | |
| 14 | void thunderj_mark_high_palette( |
| r1877 | r1878 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | int compute_interrupt_level(void); |
| 36 | 36 | void update_interrupt_status(void); |
| 37 | INPUT_CHANGED( dc_coin_slots_callback ); | |
| 37 | 38 | |
| 38 | extern UINT32 sysctrl_regs[0x200/4]; | |
| 39 | extern UINT32 dc_sysctrl_regs[0x200/4]; | |
| 40 | extern UINT32 dc_coin_counts[2]; | |
| 39 | 41 | |
| 40 | 42 | /*address*/ |
| 41 | 43 | #define SB_C2DSTAT ((0x005F6800-0x005F6800)/4) |
| r1877 | r1878 | |
| 124 | 126 | #define TA_NEXT_OPB ((0x005F8134-0x005F8000)/4) |
| 125 | 127 | #define TA_ITP_CURRENT ((0x005F8138-0x005F8000)/4) |
| 126 | 128 | |
| 129 | #define IST_EOR_VIDEO 0x00000001 | |
| 130 | #define IST_EOR_ISP 0x00000002 | |
| 131 | #define IST_EOR_TSP 0x00000004 | |
| 132 | #define IST_VBL_IN 0x00000008 | |
| 133 | #define IST_VBL_OUT 0x00000010 | |
| 134 | #define IST_HBL_IN 0x00000020 | |
| 135 | #define IST_EOXFER_YUV 0x00000040 | |
| 136 | #define IST_EOXFER_OPLST 0x00000080 | |
| 137 | #define IST_EOXFER_OPMV 0x00000100 | |
| 138 | #define IST_EOXFER_TRLST 0x00000200 | |
| 139 | #define IST_EOXFER_TRMV 0x00000400 | |
| 140 | #define IST_DMA_PVR 0x00000800 | |
| 141 | #define IST_DMA_MAPLE 0x00001000 | |
| 142 | #define IST_DMA_MAPLEVB 0x00002000 | |
| 143 | #define IST_DMA_GDROM 0x00004000 | |
| 144 | #define IST_DMA_AICA 0x00008000 | |
| 145 | #define IST_DMA_EXT1 0x00010000 | |
| 146 | #define IST_DMA_EXT2 0x00020000 | |
| 147 | #define IST_DMA_DEV 0x00040000 | |
| 148 | #define IST_DMA_CH2 0x00080000 | |
| 149 | #define IST_DMA_SORT 0x00100000 | |
| 150 | #define IST_G1G2EXTSTAT 0x40000000 | |
| 151 | #define IST_ERROR 0x80000000 | |
| 152 | ||
| 127 | 153 | #endif |
| r1877 | r1878 | |
|---|---|---|
| 60 | 60 | READ16_HANDLER( midtunit_dma_r ); |
| 61 | 61 | WRITE16_HANDLER( midtunit_dma_w ); |
| 62 | 62 | |
| 63 | void midtunit_scanline_update(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params); | |
| 64 | void midxunit_scanline_update(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params); | |
| 63 | void midtunit_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); | |
| 64 | void midxunit_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); |
| r1877 | r1878 | |
|---|---|---|
| 377 | 377 | void amiga_machine_config(const amiga_machine_interface *intf); |
| 378 | 378 | |
| 379 | 379 | MACHINE_RESET( amiga ); |
| 380 | INTERRUPT_GEN( amiga_scanline_callback ); | |
| 381 | 380 | |
| 382 | 381 | CUSTOM_INPUT( amiga_joystick_convert ); |
| 383 | 382 | |
| r1877 | r1878 | |
| 408 | 407 | |
| 409 | 408 | PALETTE_INIT( amiga ); |
| 410 | 409 | VIDEO_START( amiga ); |
| 410 | VIDEO_UPDATE( amiga ); | |
| 411 | 411 | |
| 412 | 412 | UINT32 amiga_gethvpos(void); |
| 413 | 413 | void copper_setpc(UINT32 pc); |
| 414 | 414 | void amiga_set_genlock_color(UINT16 color); |
| 415 | void amiga_render_scanline(int scanline); | |
| 415 | void amiga_render_scanline(running_machine *machine, bitmap_t *bitmap, int scanline); | |
| 416 | 416 | void amiga_sprite_dma_reset(int which); |
| 417 | 417 | void amiga_sprite_enable_comparitor(int which, int enable); |
| 418 | 418 |
| r1877 | r1878 | |
|---|---|---|
| 42 | 42 | VIDEO_START( cinemat_64level ); |
| 43 | 43 | VIDEO_START( cinemat_color ); |
| 44 | 44 | VIDEO_START( cinemat_qb3color ); |
| 45 | VIDEO_E | |
| 45 | VIDEO_UPDATE | |
| 46 | 46 | |
| 47 | 47 | VIDEO_UPDATE( spacewar ); |
| r1877 | r1878 | |
|---|---|---|
| 29 | 29 | UINT8 * rightram; |
| 30 | 30 | UINT8 * spriteram; |
| 31 | 31 | |
| 32 | | |
| 32 | | |
| 33 | 33 | tilemap * text_tilemap; |
| 34 | 34 | tilemap * left_tilemap; |
| 35 | 35 | tilemap * center_tilemap; |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | /*----------- defined in audio/crbaloon.c -----------*/ |
| 12 | 12 | |
| 13 | void crbaloon_audio_set_music_freq(UINT8 freq); | |
| 14 | void crbaloon_audio_set_music_enable(int enabled); | |
| 13 | void crbaloon_audio_set_music_freq(running_machine *machine, UINT8 freq); | |
| 14 | void crbaloon_audio_set_music_enable(running_machine *machine, int enabled); | |
| 15 | 15 | void crbaloon_audio_set_explosion_enable(int enabled); |
| 16 | 16 | void crbaloon_audio_set_breath_enable(int enabled); |
| 17 | 17 | void crbaloon_audio_set_appear_enable(int enabled); |
| 18 | void crbaloon_audio_set_laugh_enable(int enabled); | |
| 18 | void crbaloon_audio_set_laugh_enable(running_machine *machine, int enabled); | |
| 19 | 19 | |
| 20 | 20 | MACHINE_DRIVER_EXTERN( crbaloon_audio ); |
| 21 | 21 |
| r1877 | r1878 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | |
| 10 | 10 | #define EXIDY440_MASTER_CLOCK (XTAL_12_9792MHz) |
| 11 | #define EXIDY440_MAIN_CPU_CLOCK (EXIDY440_MASTER_CLOCK / 8) | |
| 12 | #define EXIDY440_PIXEL_CLOCK (EXIDY440_MASTER_CLOCK / 2) | |
| 13 | #define EXIDY440_HTOTAL (0x1a0) | |
| 14 | #define EXIDY440_HBEND (0x000) | |
| 15 | #define EXIDY440_HBSTART (0x140) | |
| 16 | #define EXIDY440_HSEND (0x178) | |
| 17 | #define EXIDY440_HSSTART (0x160) | |
| 18 | #define EXIDY440_VTOTAL (0x104) | |
| 19 | #define EXIDY440_VBEND (0x000) | |
| 20 | #define EXIDY440_VBSTART (0x0f0) | |
| 21 | #define EXIDY440_VSEND (0x0f8) | |
| 22 | #define EXIDY440_VSSTART (0x0f0) | |
| 23 | 11 | |
| 24 | /* Top Secret has a larger VBLANK area */ | |
| 25 | #define TOPSECEX_VBSTART (0x0ec) | |
| 26 | 12 | |
| 27 | ||
| 28 | 13 | /*----------- defined in drivers/exidy440.c -----------*/ |
| 29 | 14 | |
| 30 | extern UINT8 exidy440_topsecret; | |
| 31 | 15 | void exidy440_bank_select(UINT8 bank); |
| 32 | 16 | |
| 33 | 17 | |
| 34 | 18 | /*----------- defined in audio/exidy440.c -----------*/ |
| 35 | 19 | |
| 36 | extern UINT8 exidy440_sound_command; | |
| 37 | extern UINT8 exidy440_sound_command_ack; | |
| 20 | extern UINT8 *exidy440_sound_command; | |
| 21 | extern UINT8 exidy440_sound_command_ack; | |
| 38 | 22 | |
| 39 | 23 | MACHINE_DRIVER_EXTERN( exidy440_audio ); |
| 40 | 24 | |
| r1877 | r1878 | |
| 43 | 27 | |
| 44 | 28 | extern UINT8 *exidy440_imageram; |
| 45 | 29 | extern UINT8 *exidy440_scanline; |
| 46 | extern UINT8 exidy440_firq_vblank; | |
| 47 | extern UINT8 exidy440_firq_beam; | |
| 48 | extern UINT8 topsecex_yscroll; | |
| 30 | extern UINT8 exidy440_firq_vblank; | |
| 31 | extern UINT8 exidy440_firq_beam; | |
| 32 | extern UINT8 *topsecex_yscroll; | |
| 49 | 33 | |
| 50 | 34 | INTERRUPT_GEN( exidy440_vblank_interrupt ); |
| 51 | 35 | |
| 52 | VIDEO_START( exidy440 ); | |
| 53 | VIDEO_EOF( exidy440 ); | |
| 54 | VIDEO_UPDATE( exidy440 ); | |
| 55 | ||
| 56 | 36 | READ8_HANDLER( exidy440_videoram_r ); |
| 57 | 37 | WRITE8_HANDLER( exidy440_videoram_w ); |
| 58 | 38 | READ8_HANDLER( exidy440_paletteram_r ); |
| r1877 | r1878 | |
| 62 | 42 | READ8_HANDLER( exidy440_vertical_pos_r ); |
| 63 | 43 | READ8_HANDLER( exidy440_horizontal_pos_r ); |
| 64 | 44 | WRITE8_HANDLER( exidy440_interrupt_clear_w ); |
| 45 | ||
| 46 | MACHINE_DRIVER_EXTERN( exidy440_video ); | |
| 47 | MACHINE_DRIVER_EXTERN( topsecex_video ); |
| r1877 | r1878 | |
|---|---|---|
| 37 | 37 | void btoads_to_shiftreg(UINT32 address, UINT16 *shiftreg); |
| 38 | 38 | void btoads_from_shiftreg(UINT32 address, UINT16 *shiftreg); |
| 39 | 39 | |
| 40 | void btoads_scanline_update(running_machine *machine, int screen, | |
| 40 | void btoads_scanline_update(running_machine *machine, int screen, |
| r1877 | r1878 | |
|---|---|---|
| 67 | 67 | /* video state */ |
| 68 | 68 | tilemap *bg_tilemap; |
| 69 | 69 | |
| 70 | | |
| 70 | | |
| 71 | 71 | const UINT8 * color_codes; |
| 72 | 72 | emu_timer * scanline_timer; |
| 73 | 73 | INT8 vidhw; /* Selected video hardware RS Conversion / TKG04 */ |
| r1877 | r1878 | |
|---|---|---|
| 241 | 241 | READ16_HANDLER( hdgsp_paletteram_hi_r ); |
| 242 | 242 | WRITE16_HANDLER( hdgsp_paletteram_hi_w ); |
| 243 | 243 | |
| 244 | void harddriv_scanline_driver(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params); | |
| 245 | void harddriv_scanline_multisync(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params); | |
| 244 | void harddriv_scanline_driver(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); | |
| 245 | void harddriv_scanline_multisync(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); |
| r1877 | r1878 | |
|---|---|---|
| 21 | 21 | extern UINT8 *madalien_edge2_pos; |
| 22 | 22 | extern UINT8 *madalien_headlight_pos; |
| 23 | 23 | |
| 24 | WRITE8_HANDLER( madalien_mc6845_address_w ); | |
| 25 | READ8_HANDLER( madalien_mc6845_register_r ); | |
| 26 | WRITE8_HANDLER( madalien_mc6845_register_w ); | |
| 27 | ||
| 28 | 24 | MACHINE_DRIVER_EXTERN( madalien_video ); |
| r1877 | r1878 | |
|---|---|---|
| 64 | 64 | READ16_HANDLER ( kaneko16_sprites_regs_r ); |
| 65 | 65 | WRITE16_HANDLER( kaneko16_sprites_regs_w ); |
| 66 | 66 | |
| 67 | void kaneko16_draw_sprites(running_machine *machine, | |
| 67 | void kaneko16_draw_sprites(running_machine *machine, | |
| 68 | 68 | |
| 69 | 69 | /* Pixel Layer: */ |
| 70 | 70 |
| r1877 | r1878 | |
|---|---|---|
| 926 | 926 | |
| 927 | 927 | $(MAMEOBJ)/midw8080.a: \ |
| 928 | 928 | $(DRIVERS)/8080bw.o $(AUDIO)/8080bw.o $(VIDEO)/8080bw.o \ |
| 929 | $(DRIVERS)/m79amb.o | |
| 929 | $(DRIVERS)/m79amb.o | |
| 930 | 930 | $(DRIVERS)/mw8080bw.o $(MACHINE)/mw8080bw.o $(AUDIO)/mw8080bw.o $(VIDEO)/mw8080bw.o \ |
| 931 | 931 | $(DRIVERS)/rotaryf.o \ |
| 932 | 932 | $(DRIVERS)/sspeedr.o $(VIDEO)/sspeedr.o \ |
| r1877 | r1878 | |
|---|---|---|
| 106 | 106 | 3 | xx------ -------- | not used? |
| 107 | 107 | */ |
| 108 | 108 | |
| 109 | static void draw_sprites(running_machine *machine, | |
| 109 | static void draw_sprites(running_machine *machine, | |
| 110 | 110 | { |
| 111 | 111 | int i; |
| 112 | 112 | const gfx_element *gfx = machine->gfx[0]; |
| r1877 | r1878 | |
|---|---|---|
| 101 | 101 | return; |
| 102 | 102 | |
| 103 | 103 | if (offset & 0x100) |
| 104 | paletteram_xxxxBBBBGGGGRRRR_split2_w((offset & 0xff) + (palette_bank << 8),data); | |
| 104 | paletteram_xxxxBBBBGGGGRRRR_split2_w(machine, (offset & 0xff) + (palette_bank << 8),data); | |
| 105 | 105 | else |
| 106 | paletteram_xxxxBBBBGGGGRRRR_split1_w((offset & 0xff) + (palette_bank << 8),data); | |
| 106 | paletteram_xxxxBBBBGGGGRRRR_split1_w(machine, (offset & 0xff) + (palette_bank << 8),data); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | READ8_HANDLER( nycaptor_palette_r ) |
| r1877 | r1878 | |
| 145 | 145 | tilemap_set_scrolly(bg_tilemap, offset, data ); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | static void draw_sprites(running_machine *machine, | |
| 148 | static void draw_sprites(running_machine *machine, | |
| 149 | 149 | { |
| 150 | 150 | int i; |
| 151 | 151 | for (i=0;i<0x20;i++) |
| r1877 | r1878 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | WRITE8_HANDLER( pang_videoram_w ) |
| 121 | 121 | { |
| 122 | if (video_bank) mgakuen_objram_w(offset,data); | |
| 123 | else mgakuen_videoram_w(offset,data); | |
| 122 | if (video_bank) mgakuen_objram_w(machine,offset,data); | |
| 123 | else mgakuen_videoram_w(machine,offset,data); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | READ8_HANDLER( pang_videoram_r ) |
| 127 | 127 | { |
| 128 | if (video_bank) return mgakuen_objram_r(offset); | |
| 129 | else return mgakuen_videoram_r(offset); | |
| 128 | if (video_bank) return mgakuen_objram_r(machine,offset); | |
| 129 | else return mgakuen_videoram_r(machine,offset); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /*************************************************************************** |
| r1877 | r1878 | |
| 223 | 223 | |
| 224 | 224 | WRITE8_HANDLER( pang_paletteram_w ) |
| 225 | 225 | { |
| 226 | if (paletteram_bank) paletteram_xxxxRRRRGGGGBBBB_le_w(offset + 0x800,data); | |
| 227 | else paletteram_xxxxRRRRGGGGBBBB_le_w(offset,data); | |
| 226 | if (paletteram_bank) paletteram_xxxxRRRRGGGGBBBB_le_w(machine,offset + 0x800,data); | |
| 227 | else paletteram_xxxxRRRRGGGGBBBB_le_w(machine,offset,data); | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | READ8_HANDLER( pang_paletteram_r ) |
| r1877 | r1878 | |
| 235 | 235 | |
| 236 | 236 | WRITE8_HANDLER( mgakuen_paletteram_w ) |
| 237 | 237 | { |
| 238 | paletteram_xxxxRRRRGGGGBBBB_le_w(offset,data); | |
| 238 | paletteram_xxxxRRRRGGGGBBBB_le_w(machine,offset,data); | |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | READ8_HANDLER( mgakuen_paletteram_r ) |
| r1877 | r1878 | |
| 251 | 251 | |
| 252 | 252 | ***************************************************************************/ |
| 253 | 253 | |
| 254 | static void draw_sprites(running_machine *machine, | |
| 254 | static void draw_sprites(running_machine *machine, | |
| 255 | 255 | { |
| 256 | 256 | int offs,sx,sy; |
| 257 | 257 |
| r1877 | r1878 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 3 | 2 | |
| 4 | 3 | |
| 5 | UINT16 *galspnbl_bgvideoram,*galspnbl_videoram,*galspnbl_colorram; | |
| 6 | static int screenscroll; | |
| 4 | UINT16 *galspnbl_bgvideoram; | |
| 5 | UINT16 *galspnbl_videoram; | |
| 6 | UINT16 *galspnbl_colorram; | |
| 7 | UINT16 *galspnbl_scroll; | |
| 7 | 8 | |
| 8 | 9 | |
| 9 | ||
| 10 | 10 | PALETTE_INIT( galspnbl ) |
| 11 | 11 | { |
| 12 | 12 | int i; |
| r1877 | r1878 | |
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | |
| 21 | WRITE16_HANDLER( galspnbl_bgvideoram_w ) | |
| 22 | { | |
| 23 | int sx,sy; | |
| 24 | ||
| 25 | ||
| 26 | data = COMBINE_DATA(&galspnbl_bgvideoram[offset]); | |
| 27 | ||
| 28 | sx = offset % 512; | |
| 29 | sy = offset / 512; | |
| 30 | ||
| 31 | *BITMAP_ADDR16(tmpbitmap, sy, sx) = 1024 + (data >> 1); | |
| 32 | } | |
| 33 | ||
| 34 | WRITE16_HANDLER( galspnbl_scroll_w ) | |
| 35 | { | |
| 36 | if (ACCESSING_LSB) | |
| 37 | screenscroll = 4-(data & 0xff); | |
| 38 | } | |
| 39 | ||
| 40 | ||
| 41 | ||
| 42 | 21 | /* sprite format (see also Ninja Gaiden): |
| 43 | 22 | * |
| 44 | 23 | * word bit usage |
| r1877 | r1878 | |
| 55 | 34 | * 4 | xxxxxxxxxxxxxxxx | x position |
| 56 | 35 | * 5,6,7| | unused |
| 57 | 36 | */ |
| 58 | static void draw_sprites(running_machine *machine, | |
| 37 | static void draw_sprites(running_machine *machine, | |
| 59 | 38 | { |
| 60 | 39 | int offs; |
| 61 | 40 | static const UINT8 layout[8][8] = |
| r1877 | r1878 | |
| 76 | 55 | int col,row; |
| 77 | 56 | |
| 78 | 57 | attr = spriteram16[offs]; |
| 79 | if ((attr & 0x0004) && ((attr & 0x0040) == 0 || ( | |
| 58 | if ((attr & 0x0004) && ((attr & 0x0040) == 0 || (vid | |
| 80 | 59 | // && ((attr & 0x0030) >> 4) == priority) |
| 81 | 60 | && ((attr & 0x0020) >> 5) == priority) |
| 82 | 61 | { |
| r1877 | r1878 | |
| 84 | 63 | color = spriteram16[offs+2]; |
| 85 | 64 | size = 1 << (color & 0x0003); // 1,2,4,8 |
| 86 | 65 | color = (color & 0x00f0) >> 4; |
| 87 | sx = spriteram16[offs+4] + screenscroll; | |
| 66 | // sx = spriteram16[offs+4] + screenscroll; | |
| 67 | sx = spriteram16[offs+4]; | |
| 88 | 68 | sy = spriteram16[offs+3]; |
| 89 | 69 | flipx = attr & 0x0001; |
| 90 | 70 | flipy = attr & 0x0002; |
| r1877 | r1878 | |
| 108 | 88 | } |
| 109 | 89 | |
| 110 | 90 | |
| 91 | static void draw_background(bitmap_t *bitmap, const rectangle *cliprect) | |
| 92 | { | |
| 93 | offs_t offs; | |
| 94 | ||
| 95 | // int screenscroll = 4 - (galspnbl_scroll[0] & 0xff); | |
| 96 | ||
| 97 | for (offs = 0; offs < 0x20000; offs++) | |
| 98 | { | |
| 99 | int y = offs >> 9; | |
| 100 | int x = offs & 0x1ff; | |
| 101 | ||
| 102 | *BITMAP_ADDR16(bitmap, y, x) = 1024 + (galspnbl_bgvideoram[offs] >> 1); | |
| 103 | } | |
| 104 | } | |
| 105 | ||
| 106 | ||
| 111 | 107 | VIDEO_UPDATE( galspnbl ) |
| 112 | 108 | { |
| 113 | 109 | int offs; |
| 114 | 110 | |
| 111 | draw_background(bitmap, cliprect); | |
| 115 | 112 | |
| 116 | /* copy the temporary bitmap to the screen */ | |
| 117 | copyscrollbitmap(bitmap,tmpbitmap,1,&screenscroll,0,0,cliprect); | |
| 118 | ||
| 119 | 113 | draw_sprites(machine,bitmap,cliprect,0); |
| 120 | 114 | |
| 121 | 115 | for (offs = 0;offs < 0x1000/2;offs++) |
| r1877 | r1878 | |
| 135 | 129 | code, |
| 136 | 130 | color, |
| 137 | 131 | 0,0, |
| 138 | 16*sx + screenscroll,8*sy, | |
| 132 | // 16*sx + screenscroll,8*sy, | |
| 133 | 16*sx,8*sy, | |
| 139 | 134 | cliprect,TRANSPARENCY_PEN,0); |
| 140 | 135 | } |
| 141 | 136 | } |
| r1877 | r1878 | |
|---|---|---|
| 424 | 424 | |
| 425 | 425 | ***************************************************************************/ |
| 426 | 426 | |
| 427 | static void draw_sprites(running_machine *machine, | |
| 427 | static void draw_sprites(running_machine *machine, | |
| 428 | 428 | { |
| 429 | 429 | int offs,sx,sy; |
| 430 | 430 |
| r1877 | r1878 | |
|---|---|---|
| 195 | 195 | |
| 196 | 196 | ***************************************************************************/ |
| 197 | 197 | |
| 198 | static void draw_sprites(running_machine *machine, | |
| 198 | static void draw_sprites(running_machine *machine, | |
| 199 | 199 | { |
| 200 | 200 | int offs; |
| 201 | 201 | |
| r1877 | r1878 | |
| 245 | 245 | |
| 246 | 246 | VIDEO_EOF( blktiger ) |
| 247 | 247 | { |
| 248 | buffer_spriteram_w(0,0); | |
| 248 | buffer_spriteram_w(machine,0,0); | |
| 249 | 249 | } |
| r1877 | r1878 | |
|---|---|---|
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | static void draw_sprites(running_machine *machine, | |
| 135 | static void draw_sprites(running_machine *machine, | |
| 136 | 136 | { |
| 137 | 137 | int offs,fx,fy,x,y,color,sprite; |
| 138 | 138 | |
| r1877 | r1878 | |
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | static void draw_background(running_machine *machine, | |
| 172 | static void draw_background(running_machine *machine, | |
| 173 | 173 | { |
| 174 | 174 | /* The transparency / palette handling on the background layer is very strange */ |
| 175 | | |
| 175 | | |
| 176 | 176 | int scrolly, scrollx; |
| 177 | 177 | int x,y; |
| 178 | 178 | |
| r1877 | r1878 | |
| 245 | 245 | |
| 246 | 246 | VIDEO_EOF( dynduke ) |
| 247 | 247 | { |
| 248 | buffer_spriteram16_w(0,0,0); // Could be a memory location instead | |
| 248 | buffer_spriteram16_w(machine,0,0,0); // Could be a memory location instead | |
| 249 | 249 | } |
| r1877 | r1878 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | extern int mlc_raster_table[9][256]; |
| 15 | 15 | extern UINT32 mlc_clipper[32]; |
| 16 | static | |
| 16 | static | |
| 17 | 17 | static UINT32 colour_mask, *mlc_buffered_spriteram; |
| 18 | 18 | UINT32 *mlc_vram, *mlc_clip_ram; |
| 19 | 19 | |
| r1877 | r1878 | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | #ifdef UNUSED_FUNCTION |
| 38 | static void blitRaster( | |
| 38 | static void blitRaster( | |
| 39 | 39 | { |
| 40 | 40 | int x,y; |
| 41 | 41 | for (y=0; y<256; y++) //todo |
| r1877 | r1878 | |
| 63 | 63 | } |
| 64 | 64 | #endif |
| 65 | 65 | |
| 66 | static void mlc_drawgfxzoom( | |
| 66 | static void mlc_drawgfxzoom( | |
| 67 | 67 | UINT32 code1,UINT32 code2, UINT32 color,int flipx,int flipy,int sx,int sy, |
| 68 | 68 | const rectangle *clip,int transparency,int transparent_color,int use8bpp, |
| 69 | 69 | int scalex, int scaley) |
| r1877 | r1878 | |
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | static void draw_sprites(running_machine* machine, | |
| 229 | static void draw_sprites(running_machine* machine, | |
| 230 | 230 | { |
| 231 | 231 | UINT32 *index_ptr=0; |
| 232 | 232 | int offs,fx=0,fy=0,x,y,color,colorOffset,sprite,indx,h,w,bx,by,fx1,fy1; |
| r1877 | r1878 | |
| 252 | 252 | { |
| 253 | 253 | if ((mlc_spriteram[offs+0]&0x8000)==0) |
| 254 | 254 | continue; |
| 255 | if ((mlc_spriteram[offs+1]&0x2000) && ( | |
| 255 | if ((mlc_spriteram[offs+1]&0x2000) && (vid | |
| 256 | 256 | continue; |
| 257 | 257 | |
| 258 | 258 | /* |
| r1877 | r1878 | |
|---|---|---|
| 196 | 196 | } |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | static void draw_motion_object( | |
| 199 | static void draw_motion_object( | |
| 200 | 200 | { |
| 201 | 201 | /* |
| 202 | 202 | * VSTRLO 0x1202 |
| r1877 | r1878 | |
| 265 | 265 | ); |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | static void draw_box( | |
| 268 | static void draw_box( | |
| 269 | 269 | { |
| 270 | 270 | /* |
| 271 | 271 | This is unnecessarily slow, but the box priorities aren't completely understood, |
| r1877 | r1878 | |
| 318 | 318 | |
| 319 | 319 | /* "shell" graphics are 16x16 pixel tiles used for player shots and targeting cursor */ |
| 320 | 320 | static void draw_shell(running_machine *machine, |
| 321 | | |
| 321 | | |
| 322 | 322 | const rectangle *cliprect, |
| 323 | 323 | int picture_code, |
| 324 | 324 | int hposition, |
| r1877 | r1878 | |
|---|---|---|
| 183 | 183 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | static void draw_sprites(running_machine *machine, | |
| 186 | static void draw_sprites(running_machine *machine, | |
| 187 | 187 | { |
| 188 | 188 | int offs,fx,fy,x,y,color,sprite,inc; |
| 189 | 189 |
| r1877 | r1878 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "deprecat.h" | |
| 11 | 10 | |
| 12 | 11 | UINT16 *madmotor_pf1_rowscroll; |
| 13 | 12 | UINT16 *madmotor_pf1_data,*madmotor_pf2_data,*madmotor_pf3_data; |
| r1877 | r1878 | |
| 191 | 190 | |
| 192 | 191 | /******************************************************************************/ |
| 193 | 192 | |
| 194 | static void draw_sprites(running_machine *machine, | |
| 193 | static void draw_sprites(running_machine *machine, | |
| 195 | 194 | { |
| 196 | 195 | int offs; |
| 197 | 196 | |
| r1877 | r1878 | |
| 244 | 243 | for (y = 0;y < h;y++) |
| 245 | 244 | { |
| 246 | 245 | if ((color & pri_mask) == pri_val && |
| 247 | (!flash || ( | |
| 246 | (!flash || (vid | |
| 248 | 247 | drawgfx(bitmap,machine->gfx[3], |
| 249 | 248 | code - y * incy + h * x, |
| 250 | 249 | color, |
| r1877 | r1878 | |
|---|---|---|
| 188 | 188 | VIDEO_UPDATE( eprom ) |
| 189 | 189 | { |
| 190 | 190 | struct atarimo_rect_list rectlist; |
| 191 | | |
| 191 | | |
| 192 | 192 | int x, y, r; |
| 193 | 193 | |
| 194 | 194 | /* draw the playfield */ |
| r1877 | r1878 | |
| 334 | 334 | VIDEO_UPDATE( guts ) |
| 335 | 335 | { |
| 336 | 336 | struct atarimo_rect_list rectlist; |
| 337 | | |
| 337 | | |
| 338 | 338 | int x, y, r; |
| 339 | 339 | |
| 340 | 340 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 67 | 67 | switch (offset) |
| 68 | 68 | { |
| 69 | 69 | case 0: skyfox_bg_ctrl = data; break; |
| 70 | case 1: soundlatch_w(0,data); break; | |
| 70 | case 1: soundlatch_w(machine,0,data); break; | |
| 71 | 71 | case 2: break; |
| 72 | 72 | case 3: break; |
| 73 | 73 | case 4: break; |
| r1877 | r1878 | |
| 164 | 164 | |
| 165 | 165 | ***************************************************************************/ |
| 166 | 166 | |
| 167 | static void draw_sprites(running_machine *machine, | |
| 167 | static void draw_sprites(running_machine *machine, | |
| 168 | 168 | { |
| 169 | 169 | int offs; |
| 170 | 170 | |
| r1877 | r1878 | |
| 243 | 243 | |
| 244 | 244 | ***************************************************************************/ |
| 245 | 245 | |
| 246 | static void draw_background( | |
| 246 | static void draw_background( | |
| 247 | 247 | { |
| 248 | 248 | UINT8 *RAM = memory_region(REGION_GFX2); |
| 249 | 249 | int x,y,i; |
| r1877 | r1878 | |
|---|---|---|
| 118 | 118 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | static void draw_sprites(running_machine *machine, | |
| 121 | static void draw_sprites(running_machine *machine, | |
| 122 | 122 | { |
| 123 | 123 | int offs; |
| 124 | 124 |
| r1877 | r1878 | |
|---|---|---|
| 294 | 294 | |
| 295 | 295 | ***************************************************************************/ |
| 296 | 296 | |
| 297 | static void aerofgt_draw_sprites(running_machine *machine, | |
| 297 | static void aerofgt_draw_sprites(running_machine *machine, | |
| 298 | 298 | { |
| 299 | 299 | int offs; |
| 300 | 300 | |
| r1877 | r1878 | |
| 366 | 366 | } |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | static void turbofrc_draw_sprites(running_machine *machine, | |
| 369 | static void turbofrc_draw_sprites(running_machine *machine, | |
| 370 | 370 | { |
| 371 | 371 | int attr_start,base,first; |
| 372 | 372 | |
| r1877 | r1878 | |
| 441 | 441 | } |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | static void pspikesb_draw_sprites(running_machine *machine, | |
| 444 | static void pspikesb_draw_sprites(running_machine *machine, | |
| 445 | 445 | { |
| 446 | 446 | int i; |
| 447 | 447 | |
| r1877 | r1878 | |
| 476 | 476 | } |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | static void aerfboot_draw_sprites(running_machine *machine, | |
| 479 | static void aerfboot_draw_sprites(running_machine *machine, | |
| 480 | 480 | { |
| 481 | 481 | int attr_start;//,base,first; |
| 482 | 482 | |
| r1877 | r1878 | |
| 546 | 546 | } |
| 547 | 547 | } |
| 548 | 548 | |
| 549 | static void wbbc97_draw_bitmap( | |
| 549 | static void wbbc97_draw_bitmap( | |
| 550 | 550 | { |
| 551 | 551 | int x,y,count; |
| 552 | 552 | int color; |
| r1877 | r1878 | |
|---|---|---|
| 7 | 7 | #include "driver.h" |
| 8 | 8 | #include "includes/fgoal.h" |
| 9 | 9 | |
| 10 | static mame_bitmap *fgbitmap; | |
| 11 | static mame_bitmap *bgbitmap; | |
| 10 | static bitmap_t *fgbitmap; | |
| 11 | static bitmap_t *bgbitmap; | |
| 12 | 12 | |
| 13 | 13 | static UINT8 xpos; |
| 14 | 14 | static UINT8 ypos; |
| r1877 | r1878 | |
|---|---|---|
| 125 | 125 | video_start_common(machine, 0xff00); |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | static void draw_sprites(running_machine *machine, | |
| 128 | static void draw_sprites(running_machine *machine, | |
| 129 | 129 | { |
| 130 | 130 | int offs; |
| 131 | 131 |
| r1877 | r1878 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | |
| 3 | Technos Mysterious Stones hardware | |
| 4 | 4 | |
| 5 | | |
| 5 | dr | |
| 6 | 6 | |
| 7 | 7 | There are only a few differences between the video hardware of Mysterious |
| 8 | 8 | Stones and Mat Mania. The tile bank select bit is different and the sprite |
| r1877 | r1878 | |
| 13 | 13 | ***************************************************************************/ |
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | #include "video/resnet.h" | |
| 17 | #include "mystston.h" | |
| 16 | 18 | |
| 17 | 19 | |
| 18 | UINT8 *mystston_videoram2; | |
| 19 | 20 | |
| 20 | static int mystston_fgcolor, mystston_bgpage; | |
| 21 | /************************************* | |
| 22 | * | |
| 23 | * Video timing constants | |
| 24 | * | |
| 25 | *************************************/ | |
| 21 | 26 | |
| 22 | static tilemap *fg_tilemap, *bg_tilemap; | |
| 27 | #define PIXEL_CLOCK (MYSTSTON_MASTER_CLOCK / 2) | |
| 28 | #define HTOTAL (0x140) | |
| 29 | #define HBEND (0x000) | |
| 30 | #define HBSTART (0x100) | |
| 31 | #define VTOTAL (0x110) /* counts from 0x08-0xff, then from 0xe8-0xff */ | |
| 32 | #define VBEND (0x008) | |
| 33 | #define VBSTART (0x0f8) | |
| 34 | #define FIRST_INT_VPOS (0x008) | |
| 35 | #define INT_HPOS (0x100) | |
| 23 | 36 | |
| 24 | /*************************************************************************** | |
| 25 | 37 | |
| 26 | Convert the color PROMs into a more useable format. | |
| 27 | 38 | |
| 28 | Mysterious Stones has both palette RAM and a PROM. The PROM is used for | |
| 29 | text. | |
| 39 | /************************************* | |
| 40 | * | |
| 41 | * Scanline interrupt system | |
| 42 | * | |
| 43 | * There is an interrupt every 16 | |
| 44 | * scanlines, starting with 8. | |
| 45 | * | |
| 46 | *************************************/ | |
| 30 | 47 | |
| 31 | ***************************************************************************/ | |
| 32 | ||
| 33 | PALETTE_INIT( mystston ) | |
| 48 | static TIMER_CALLBACK( interrupt_callback ) | |
| 34 | 49 | { |
| 35 | int i; | |
| 50 | mystston_state *state = machine->driver_data; | |
| 51 | int scanline = param; | |
| 36 | 52 | |
| 37 | for (i = 0; i < 32; i++) | |
| 38 | { | |
| 39 | int bit0, bit1, bit2, r, g, b; | |
| 53 | mystston_on_scanline_interrupt(machine); | |
| 40 | 54 | |
| 41 | // red component | |
| 55 | scanline = scanline + 16; | |
| 56 | if (scanline >= VTOTAL) | |
| 57 | scanline = FIRST_INT_VPOS; | |
| 42 | 58 | |
| 43 | bit0 = (*color_prom >> 0) & 0x01; | |
| 44 | bit1 = (*color_prom >> 1) & 0x01; | |
| 45 | bit2 = (*color_prom >> 2) & 0x01; | |
| 59 | /* the vertical synch chain is clocked by H256 -- this is probably not important, but oh well */ | |
| 60 | timer_adjust_oneshot(state->interrupt_timer, video_screen_get_time_until_pos(0, scanline - 1, INT_HPOS), scanline); | |
| 61 | } | |
| 46 | 62 | |
| 47 | r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; | |
| 48 | 63 | |
| 49 | // green component | |
| 50 | 64 | |
| 51 | bit0 = (*color_prom >> 3) & 0x01; | |
| 52 | bit1 = (*color_prom >> 4) & 0x01; | |
| 53 | bit2 = (*color_prom >> 5) & 0x01; | |
| 65 | /************************************* | |
| 66 | * | |
| 67 | * Palette handling | |
| 68 | * | |
| 69 | *************************************/ | |
| 54 | 70 | |
| 55 | g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; | |
| 71 | static void set_palette(running_machine *machine, mystston_state *state) | |
| 72 | { | |
| 73 | int i; | |
| 74 | static const int resistances_rg[3] = { 4700, 3300, 1500 }; | |
| 75 | static const int resistances_b [2] = { 3300, 1500 }; | |
| 76 | double weights_rg[3], weights_b[2]; | |
| 56 | 77 | |
| 57 | | |
| 78 | UINT8 * | |
| 58 | 79 | |
| 59 | bit0 = 0; | |
| 60 | bit1 = (*color_prom >> 6) & 0x01; | |
| 61 | bit2 = (*color_prom >> 7) & 0x01; | |
| 80 | compute_resistor_weights(0, 255, -1.0, | |
| 81 | 3, resistances_rg, weights_rg, 0, 1000, | |
| 82 | 2, resistances_b, weights_b, 0, 1000, | |
| 83 | 0, 0, 0, 0, 0); | |
| 62 | 84 | |
| 63 | b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; | |
| 85 | for (i = 0; i < 0x40; i++) | |
| 86 | { | |
| 87 | UINT8 data; | |
| 88 | int r, g, b; | |
| 89 | int bit0, bit1, bit2; | |
| 64 | 90 | |
| 65 | palette_set_color(machine, i + 24, MAKE_RGB(r, g, b)); // first 24 colors are from RAM | |
| 91 | /* first half is dynamic, second half is from the PROM */ | |
| 92 | if (i & 0x20) | |
| 93 | data = color_prom[i & 0x1f]; | |
| 94 | else | |
| 95 | data = state->paletteram[i]; | |
| 66 | 96 | |
| 67 | color_prom++; | |
| 97 | /* red component */ | |
| 98 | bit0 = (data >> 0) & 0x01; | |
| 99 | bit1 = (data >> 1) & 0x01; | |
| 100 | bit2 = (data >> 2) & 0x01; | |
| 101 | r = combine_3_weights(weights_rg, bit0, bit1, bit2); | |
| 102 | ||
| 103 | /* green component */ | |
| 104 | bit0 = (data >> 3) & 0x01; | |
| 105 | bit1 = (data >> 4) & 0x01; | |
| 106 | bit2 = (data >> 5) & 0x01; | |
| 107 | g = combine_3_weights(weights_rg, bit0, bit1, bit2); | |
| 108 | ||
| 109 | /* blue component */ | |
| 110 | bit0 = (data >> 6) & 0x01; | |
| 111 | bit1 = (data >> 7) & 0x01; | |
| 112 | b = combine_2_weights(weights_b, bit0, bit1); | |
| 113 | ||
| 114 | palette_set_color(machine, i, MAKE_RGB(r, g, b)); | |
| 68 | 115 | } |
| 69 | 116 | } |
| 70 | 117 | |
| 71 | WRITE8_HANDLER( mystston_videoram_w ) | |
| 72 | { | |
| 73 | videoram[offset] = data; | |
| 74 | tilemap_mark_tile_dirty(fg_tilemap, offset & 0x3ff); | |
| 75 | } | |
| 76 | 118 | |
| 77 | WRITE8_HANDLER( mystston_videoram2_w ) | |
| 78 | { | |
| 79 | mystston_videoram2[offset] = data; | |
| 80 | tilemap_mark_tile_dirty(bg_tilemap, offset & 0x1ff); | |
| 81 | } | |
| 82 | 119 | |
| 83 | WRITE8_HANDLER( mystston_scroll_w ) | |
| 84 | { | |
| 85 | tilemap_set_scrolly(bg_tilemap, 0, data); | |
| 86 | } | |
| 120 | /************************************* | |
| 121 | * | |
| 122 | * Video control register | |
| 123 | * | |
| 124 | *************************************/ | |
| 87 | 125 | |
| 88 | WRITE8_HANDLER( mystston_control_w ) | |
| 126 | WRITE8_HANDLER( mystston_video_control_w ) | |
| 89 | 127 | { |
| 90 | // bits 0 and 1 are foreground text color | |
| 91 | if (mystston_fgcolor != ((data & 0x01) << 1) + ((data & 0x02) >> 1)) | |
| 92 | { | |
| 93 | mystston_fgcolor = ((data & 0x01) << 1) + ((data & 0x02) >> 1); | |
| 94 | tilemap_mark_all_tiles_dirty(fg_tilemap); | |
| 95 | } | |
| 128 | mystston_state *state = machine->driver_data; | |
| 96 | 129 | |
| 97 | // bit 2 is background page select | |
| 98 | mystston_bgpage = (data & 0x04) ? 1:0; | |
| 130 | *state->video_control = data; | |
| 99 | 131 | |
| 100 | // bits 4 and 5 are coin counters in flipped order | |
| 132 | /* D0-D1 - foreground text color */ | |
| 133 | /* D2 - background page select */ | |
| 134 | /* D3 - unused */ | |
| 135 | ||
| 136 | /* D4-D5 - coin counters in flipped order */ | |
| 101 | 137 | coin_counter_w(0, data & 0x20); |
| 102 | 138 | coin_counter_w(1, data & 0x10); |
| 103 | 139 | |
| 104 | // bit 7 is screen flip | |
| 105 | flip_screen_set((data & 0x80) ^ ((readinputport(3) & 0x20) ? 0x80:0)); | |
| 140 | /* D6 - unused */ | |
| 141 | /* D7 - screen flip */ | |
| 106 | 142 | } |
| 107 | 143 | |
| 144 | ||
| 145 | ||
| 146 | /************************************* | |
| 147 | * | |
| 148 | * Tilemap callbacks | |
| 149 | * | |
| 150 | *************************************/ | |
| 151 | ||
| 108 | 152 | static TILE_GET_INFO( get_bg_tile_info ) |
| 109 | 153 | { |
| 110 | int code = mystston_videoram2[tile_index] + ((mystston_videoram2[tile_index + 0x200] & 0x01) << 8); | |
| 154 | mystston_state *state = machine->driver_data; | |
| 155 | ||
| 156 | int page = (*state->video_control & 0x04) << 8; | |
| 157 | int code = ((state->bg_videoram[page | 0x200 | tile_index] & 0x01) << 8) | state->bg_videoram[page | tile_index]; | |
| 111 | 158 | int flags = (tile_index & 0x10) ? TILE_FLIPY : 0; |
| 112 | 159 | |
| 113 | 160 | SET_TILE_INFO(1, code, 0, flags); |
| 114 | 161 | } |
| 115 | 162 | |
| 163 | ||
| 116 | 164 | static TILE_GET_INFO( get_fg_tile_info ) |
| 117 | 165 | { |
| 118 | int code = videoram[tile_index] + ((videoram[tile_index + 0x400] & 0x07) << 8); | |
| 119 | int color = mystston_fgcolor; | |
| 166 | mystston_state *state = machine->driver_data; | |
| 120 | 167 | |
| 168 | int code = ((state->fg_videoram[0x400 | tile_index] & 0x07) << 8) | state->fg_videoram[tile_index]; | |
| 169 | int color = ((*state->video_control & 0x01) << 1) | ((*state->video_control & 0x02) >> 1); | |
| 170 | ||
| 121 | 171 | SET_TILE_INFO(0, code, color, 0); |
| 122 | 172 | } |
| 123 | 173 | |
| 124 | VIDEO_START( mystston ) | |
| 125 | { | |
| 126 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_x, | |
| 127 | 16, 16, 16, 32); | |
| 128 | 174 | |
| 129 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols_flip_x, | |
| 130 | 8, 8, 32, 32); | |
| 131 | 175 | |
| 132 | tilemap_set_transparent_pen(fg_tilemap, 0); | |
| 133 | } | |
| 176 | /************************************* | |
| 177 | * | |
| 178 | * Sprite drawing | |
| 179 | * | |
| 180 | *************************************/ | |
| 134 | 181 | |
| 135 | static void draw_sprites( | |
| 182 | static void draw_sprites(mystston | |
| 136 | 183 | { |
| 137 | 184 | int offs; |
| 138 | 185 | |
| 139 | for (offs = 0; offs < | |
| 186 | for (offs = 0; offs < 0x60 | |
| 140 | 187 | { |
| 141 | int attr = spriteram[offs]; | |
| 188 | int attr = state->spriteram[offs]; | |
| 142 | 189 | |
| 143 | 190 | if (attr & 0x01) |
| 144 | 191 | { |
| 145 | int code = | |
| 192 | int code = | |
| 146 | 193 | int color = (attr & 0x08) >> 3; |
| 147 | 194 | int flipx = attr & 0x04; |
| 148 | 195 | int flipy = attr & 0x02; |
| 149 | int sx = 240 - spriteram[offs + 3]; | |
| 150 | int sy = (240 - spriteram[offs + 2]) & 0xff; | |
| 196 | int x = 240 - state->spriteram[offs + 3]; | |
| 197 | int y = (240 - state->spriteram[offs + 2]) & 0xff; | |
| 151 | 198 | |
| 152 | if (flip | |
| 199 | if (flip | |
| 153 | 200 | { |
| 154 | sx = 240 - sx; | |
| 155 | sy = 240 - sy; | |
| 201 | x = 240 - x; | |
| 202 | y = 240 - y; | |
| 156 | 203 | flipx = !flipx; |
| 157 | 204 | flipy = !flipy; |
| 158 | 205 | } |
| 159 | 206 | |
| 160 | drawgfx(bitmap,machine->gfx[2], code, color, flipx, flipy, | |
| 161 | sx, sy, cliprect, TRANSPARENCY_PEN, 0); | |
| 207 | drawgfx(bitmap, gfx[2], code, color, flipx, flipy, x, y, cliprect, TRANSPARENCY_PEN, 0); | |
| 162 | 208 | } |
| 163 | 209 | } |
| 164 | 210 | } |
| 165 | 211 | |
| 166 | VIDEO_UPDATE( mystston ) | |
| 212 | ||
| 213 | ||
| 214 | /************************************* | |
| 215 | * | |
| 216 | * Start | |
| 217 | * | |
| 218 | *************************************/ | |
| 219 | ||
| 220 | static VIDEO_START( mystston ) | |
| 167 | 221 | { |
| 168 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 169 | draw_sprites(machine, bitmap, cliprect); | |
| 170 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); | |
| 222 | mystston_state *state = machine->driver_data; | |
| 223 | ||
| 224 | state->bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_x, 16, 16, 16, 32); | |
| 225 | ||
| 226 | state->fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols_flip_x, 8, 8, 32, 32); | |
| 227 | tilemap_set_transparent_pen(state->fg_tilemap, 0); | |
| 228 | ||
| 229 | /* create the interrupt timer */ | |
| 230 | state->interrupt_timer = timer_alloc(interrupt_callback, NULL); | |
| 231 | } | |
| 232 | ||
| 233 | ||
| 234 | ||
| 235 | /************************************* | |
| 236 | * | |
| 237 | * Reset | |
| 238 | * | |
| 239 | *************************************/ | |
| 240 | ||
| 241 | static VIDEO_RESET( mystston ) | |
| 242 | { | |
| 243 | mystston_state *state = machine->driver_data; | |
| 244 | ||
| 245 | timer_adjust_oneshot(state->interrupt_timer, video_screen_get_time_until_pos(0, FIRST_INT_VPOS - 1, INT_HPOS), FIRST_INT_VPOS); | |
| 246 | } | |
| 247 | ||
| 248 | ||
| 249 | ||
| 250 | /************************************* | |
| 251 | * | |
| 252 | * Update | |
| 253 | * | |
| 254 | *************************************/ | |
| 255 | ||
| 256 | static VIDEO_UPDATE( mystston ) | |
| 257 | { | |
| 258 | mystston_state *state = machine->driver_data; | |
| 259 | ||
| 260 | int flip = (*state->video_control & 0x80) ^ ((readinputportbytag("DSW1") & 0x20) << 2); | |
| 261 | ||
| 262 | set_palette(machine, state); | |
| 263 | ||
| 264 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); | |
| 265 | tilemap_set_scrolly(state->bg_tilemap, 0, *state->scroll); | |
| 266 | tilemap_set_flip(ALL_TILEMAPS, flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 267 | ||
| 268 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 269 | draw_sprites(state, machine->gfx, bitmap, cliprect, flip); | |
| 270 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); | |
| 271 | ||
| 171 | 272 | return 0; |
| 172 | 273 | } |
| 274 | ||
| 275 | ||
| 276 | ||
| 277 | /************************************* | |
| 278 | * | |
| 279 | * Graphics decoding | |
| 280 | * | |
| 281 | *************************************/ | |
| 282 | ||
| 283 | static const gfx_layout charlayout = | |
| 284 | { | |
| 285 | 8,8, | |
| 286 | RGN_FRAC(1,3), | |
| 287 | 3, | |
| 288 | { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, | |
| 289 | { 0, 1, 2, 3, 4, 5, 6, 7 }, | |
| 290 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, | |
| 291 | 8*8 | |
| 292 | }; | |
| 293 | ||
| 294 | ||
| 295 | static const gfx_layout spritelayout = | |
| 296 | { | |
| 297 | 16,16, | |
| 298 | RGN_FRAC(1,3), | |
| 299 | 3, | |
| 300 | { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, | |
| 301 | { 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7, | |
| 302 | 16*0+0, 16*0+1, 16*0+2, 16*0+3, 16*0+4, 16*0+5, 16*0+6, 16*0+7 }, | |
| 303 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, | |
| 304 | 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, | |
| 305 | 32*8 | |
| 306 | }; | |
| 307 | ||
| 308 | ||
| 309 | static GFXDECODE_START( mystston ) | |
| 310 | GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 4*8, 4 ) | |
| 311 | GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 2*8, 1 ) | |
| 312 | GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0*8, 2 ) | |
| 313 | GFXDECODE_END | |
| 314 | ||
| 315 | ||
| 316 | ||
| 317 | /************************************* | |
| 318 | * | |
| 319 | * Machine driver | |
| 320 | * | |
| 321 | *************************************/ | |
| 322 | ||
| 323 | MACHINE_DRIVER_START( mystston_video ) | |
| 324 | ||
| 325 | MDRV_VIDEO_START(mystston) | |
| 326 | MDRV_VIDEO_RESET(mystston) | |
| 327 | MDRV_VIDEO_UPDATE(mystston) | |
| 328 | ||
| 329 | MDRV_GFXDECODE(mystston) | |
| 330 | MDRV_PALETTE_LENGTH(0x40) | |
| 331 | ||
| 332 | MDRV_SCREEN_ADD("main", RASTER) | |
| 333 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 334 | MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) | |
| 335 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
|---|---|---|
| 112 | 112 | tilemap_set_scrollx( me_bg_tilemap, 0, -mainsnk_offset ); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | static void draw_sprites(running_machine *machine, | |
| 115 | static void draw_sprites(running_machine *machine, | |
| 116 | 116 | { |
| 117 | 117 | const gfx_element *gfx = machine->gfx[1]; |
| 118 | 118 | const UINT8 *source, *finish; |
| r1877 | r1878 | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | |
| 145 | static void draw_status(running_machine *machine, | |
| 145 | static void draw_status(running_machine *machine, | |
| 146 | 146 | { |
| 147 | 147 | const UINT8 *base = mainsnk_fgram+off; |
| 148 | 148 | const gfx_element *gfx = machine->gfx[0]; |
| r1877 | r1878 | |
|---|---|---|
| 565 | 565 | } |
| 566 | 566 | |
| 567 | 567 | |
| 568 | void midyunit_scanline_update(running_machine *machine, int screen, | |
| 568 | void midyunit_scanline_update(running_machine *machine, int screen, | |
| 569 | 569 | { |
| 570 | 570 | UINT16 *src = &local_videoram[(params->rowaddr << 9) & 0x3fe00]; |
| 571 | 571 | UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0); |
| r1877 | r1878 | |
|---|---|---|
| 49 | 49 | static tilemap *tilemap_B_cache_16[3]; |
| 50 | 50 | static tilemap *tilemap_A = NULL; |
| 51 | 51 | static tilemap *tilemap_B = NULL; |
| 52 | static | |
| 52 | static | |
| 53 | 53 | |
| 54 | 54 | static void HandleYGV608Reset( void ); |
| 55 | 55 | static void HandleRomTransfers( void ); |
| r1877 | r1878 | |
| 538 | 538 | add_exit_callback(machine, ygv608_exit); |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | static void draw_sprites(running_machine *machine, | |
| 541 | static void draw_sprites(running_machine *machine, | |
| 542 | 542 | { |
| 543 | 543 | #ifdef _ENABLE_SPRITES |
| 544 | 544 |
| r1877 | r1878 | |
|---|---|---|
| 83 | 83 | VIDEO_UPDATE( rampart ) |
| 84 | 84 | { |
| 85 | 85 | struct atarimo_rect_list rectlist; |
| 86 | | |
| 86 | | |
| 87 | 87 | int x, y, r; |
| 88 | 88 | |
| 89 | 89 | /* draw the playfield */ |
| r1877 | r1878 | |
| 117 | 117 | * |
| 118 | 118 | *************************************/ |
| 119 | 119 | |
| 120 | void rampart_bitmap_render(running_machine *machine, | |
| 120 | void rampart_bitmap_render(running_machine *machine, | |
| 121 | 121 | { |
| 122 | 122 | int x, y; |
| 123 | 123 |
| r1877 | r1878 | |
|---|---|---|
| 185 | 185 | |
| 186 | 186 | ***************************************************************************/ |
| 187 | 187 | |
| 188 | static void draw_bgbitmap(running_machine *machine, | |
| 188 | static void draw_bgbitmap(running_machine *machine, | |
| 189 | 189 | { |
| 190 | 190 | int x,y,pen,strwid,count; |
| 191 | 191 | |
| r1877 | r1878 | |
| 219 | 219 | } |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | static void draw_radar( | |
| 222 | static void draw_radar( | |
| 223 | 223 | { |
| 224 | 224 | int offs,x; |
| 225 | 225 | |
| r1877 | r1878 | |
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | static void draw_sprites(running_machine *machine, | |
| 247 | static void draw_sprites(running_machine *machine, | |
| 248 | 248 | { |
| 249 | 249 | int offs; |
| 250 | 250 |
| r1877 | r1878 | |
|---|---|---|
| 549 | 549 | if ( color > 0x1f ) color = 0x1f; |
| 550 | 550 | |
| 551 | 551 | return color; |
| 552 | } | |
| 552 | } | |
| 553 | 553 | |
| 554 | 554 | static UINT16 stv_vdp1_apply_gouraud_shading( int x, int y, UINT16 pix ) |
| 555 | 555 | { |
| r1877 | r1878 | |
| 880 | 880 | { |
| 881 | 881 | stv_framebuffer_draw_lines[y][x] = pix | sprite_colorbank; |
| 882 | 882 | } |
| 883 | } | |
| 883 | } | |
| 884 | 884 | |
| 885 | 885 | static void drawpixel_4bpp_notrans(int x, int y, int patterndata, int offsetcnt) |
| 886 | 886 | { |
| r1877 | r1878 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | /* bit 2 is IRQ enable */ |
| 85 | 85 | |
| 86 | interrupt_enable_w(0, data & 0x04); | |
| 86 | interrupt_enable_w(machine, 0, data & 0x04); | |
| 87 | 87 | |
| 88 | 88 | /* bits 3 and 4 are coin counters */ |
| 89 | 89 | |
| r1877 | r1878 | |
| 108 | 108 | 8, 8, 32, 32); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | static void draw_sprites(running_machine *machine, | |
| 111 | static void draw_sprites(running_machine *machine, | |
| 112 | 112 | { |
| 113 | 113 | int offs; |
| 114 | 114 |
| r1877 | r1878 | |
|---|---|---|
| 35 | 35 | static int nb19010_busyctr; |
| 36 | 36 | static int nb19010_busyflag; |
| 37 | 37 | |
| 38 | static | |
| 38 | static | |
| 39 | 39 | static UINT16 *nbmj9195_videoram[VRAM_MAX]; |
| 40 | 40 | static UINT16 *nbmj9195_videoworkram[VRAM_MAX]; |
| 41 | 41 | static UINT8 *nbmj9195_palette, *nbmj9195_nb22090_palette; |
| r1877 | r1878 | |
|---|---|---|
| 132 | 132 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | static void draw_sprites(running_machine *machine, | |
| 135 | static void draw_sprites(running_machine *machine, | |
| 136 | 136 | { |
| 137 | 137 | int offs; |
| 138 | 138 |
| r1877 | r1878 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | static int sprites_x_offset; |
| 11 | 11 | |
| 12 | static void draw_sprites(running_machine *machine, | |
| 12 | static void draw_sprites(running_machine *machine, | |
| 13 | 13 | { |
| 14 | 14 | const gfx_element *gfx = machine->gfx[0]; |
| 15 | 15 | UINT16 *source = sslam_spriteram; |
| r1877 | r1878 | |
|---|---|---|
| 3 | 3 | */ |
| 4 | 4 | |
| 5 | 5 | #include "driver.h" |
| 6 | #include "deprecat.h" | |
| 7 | 6 | #include "deco16ic.h" |
| 8 | 7 | |
| 9 | 8 | /* |
| r1877 | r1878 | |
| 36 | 35 | |
| 37 | 36 | /* spriteram is really 16-bit.. this can be changed to use 16-bit ram like the tilemaps |
| 38 | 37 | its the same sprite chip Data East used on many, many 16-bit era titles */ |
| 39 | static void draw_sprites(running_machine *machine, | |
| 38 | static void draw_sprites(running_machine *machine, | |
| 40 | 39 | { |
| 41 | 40 | int offs; |
| 42 | 41 | |
| r1877 | r1878 | |
| 51 | 50 | |
| 52 | 51 | y = spriteram32[offs]&0xffff; |
| 53 | 52 | flash=y&0x1000; |
| 54 | if (flash && ( | |
| 53 | if (flash && (vid | |
| 55 | 54 | |
| 56 | 55 | x = spriteram32[offs+2]&0xffff; |
| 57 | 56 | colour = (x >>9) & 0x1f; |
| r1877 | r1878 | |
|---|---|---|
| 177 | 177 | { |
| 178 | 178 | tilemap_set_flip(fg_tilemap, (data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); |
| 179 | 179 | } |
| 180 | K007121_ctrl_0_w(offset,data); | |
| 180 | K007121_ctrl_0_w(machine,offset,data); | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | WRITE8_HANDLER( hcastle_pf2_control_w ) |
| r1877 | r1878 | |
| 193 | 193 | { |
| 194 | 194 | tilemap_set_flip(bg_tilemap, (data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); |
| 195 | 195 | } |
| 196 | K007121_ctrl_1_w(offset,data); | |
| 196 | K007121_ctrl_1_w(machine,offset,data); | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | /*****************************************************************************/ |
| 200 | 200 | |
| 201 | static void draw_sprites(running_machine *machine, | |
| 201 | static void draw_sprites(running_machine *machine, | |
| 202 | 202 | { |
| 203 | 203 | int bank_base = (bank == 0) ? 0x4000 * (gfx_bank & 1) : 0; |
| 204 | 204 | K007121_sprites_draw(bank,bitmap,machine->gfx,machine->colortable,cliprect,sbank,(K007121_ctrlram[bank][6]&0x30)*2,0,bank_base,-1); |
| r1877 | r1878 | |
|---|---|---|
| 81 | 81 | tilemap_set_transparent_pen(text_layer, 15); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | static void draw_sprites(running_machine *machine, | |
| 84 | static void draw_sprites(running_machine *machine, | |
| 85 | 85 | { |
| 86 | 86 | int offs,fx,fy,x,y,color,sprite,pri; |
| 87 | 87 |
| r1877 | r1878 | |
|---|---|---|
| 346 | 346 | * |
| 347 | 347 | *************************************/ |
| 348 | 348 | |
| 349 | void artmagic_scanline(running_machine *machine, int screen, | |
| 349 | void artmagic_scanline(running_machine *machine, int screen, | |
| 350 | 350 | { |
| 351 | 351 | offs_t offset = (params->rowaddr << 12) & 0x7ff000; |
| 352 | 352 | UINT16 *vram = address_to_vram(&offset); |
| r1877 | r1878 | |
|---|---|---|
| 290 | 290 | WRITE8_HANDLER( wardner_txlayer_w ) |
| 291 | 291 | { |
| 292 | 292 | int shift = 8 * (offset & 1); |
| 293 | twincobr_txoffs_w(offset / 2, data << shift, 0xff00 >> shift); | |
| 293 | twincobr_txoffs_w(machine, offset / 2, data << shift, 0xff00 >> shift); | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | WRITE8_HANDLER( wardner_bglayer_w ) |
| 297 | 297 | { |
| 298 | 298 | int shift = 8 * (offset & 1); |
| 299 | twincobr_bgoffs_w(offset / 2, data << shift, 0xff00 >> shift); | |
| 299 | twincobr_bgoffs_w(machine, offset / 2, data << shift, 0xff00 >> shift); | |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | WRITE8_HANDLER( wardner_fglayer_w ) |
| 303 | 303 | { |
| 304 | 304 | int shift = 8 * (offset & 1); |
| 305 | twincobr_fgoffs_w(offset / 2, data << shift, 0xff00 >> shift); | |
| 305 | twincobr_fgoffs_w(machine, offset / 2, data << shift, 0xff00 >> shift); | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | WRITE8_HANDLER( wardner_txscroll_w ) |
| 309 | 309 | { |
| 310 | 310 | int shift = 8 * (offset & 1); |
| 311 | twincobr_txscroll_w(offset / 2, data << shift, 0xff00 >> shift); | |
| 311 | twincobr_txscroll_w(machine, offset / 2, data << shift, 0xff00 >> shift); | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | WRITE8_HANDLER( wardner_bgscroll_w ) |
| 315 | 315 | { |
| 316 | 316 | int shift = 8 * (offset & 1); |
| 317 | twincobr_bgscroll_w(offset / 2, data << shift, 0xff00 >> shift); | |
| 317 | twincobr_bgscroll_w(machine, offset / 2, data << shift, 0xff00 >> shift); | |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | WRITE8_HANDLER( wardner_fgscroll_w ) |
| 321 | 321 | { |
| 322 | 322 | int shift = 8 * (offset & 1); |
| 323 | twincobr_fgscroll_w(offset / 2, data << shift, 0xff00 >> shift); | |
| 323 | twincobr_fgscroll_w(machine, offset / 2, data << shift, 0xff00 >> shift); | |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | WRITE8_HANDLER( wardner_exscroll_w ) /* Extra unused video layer */ |
| r1877 | r1878 | |
| 338 | 338 | { |
| 339 | 339 | int shift = 8 * (offset & 1); |
| 340 | 340 | switch (offset/2) { |
| 341 | case 0: return twincobr_txram_r(0,0) >> shift; break; | |
| 342 | case 1: return twincobr_bgram_r(0,0) >> shift; break; | |
| 343 | case 2: return twincobr_fgram_r(0,0) >> shift; break; | |
| 341 | case 0: return twincobr_txram_r(machine,0,0) >> shift; break; | |
| 342 | case 1: return twincobr_bgram_r(machine,0,0) >> shift; break; | |
| 343 | case 2: return twincobr_fgram_r(machine,0,0) >> shift; break; | |
| 344 | 344 | } |
| 345 | 345 | return 0; |
| 346 | 346 | } |
| r1877 | r1878 | |
| 349 | 349 | { |
| 350 | 350 | int shift = 8 * (offset & 1); |
| 351 | 351 | switch (offset/2) { |
| 352 | case 0: twincobr_txram_w(0,data << shift, 0xff00 >> shift); break; | |
| 353 | case 1: twincobr_bgram_w(0,data << shift, 0xff00 >> shift); break; | |
| 354 | case 2: twincobr_fgram_w(0,data << shift, 0xff00 >> shift); break; | |
| 352 | case 0: twincobr_txram_w(machine,0,data << shift, 0xff00 >> shift); break; | |
| 353 | case 1: twincobr_bgram_w(machine,0,data << shift, 0xff00 >> shift); break; | |
| 354 | case 2: twincobr_fgram_w(machine,0,data << shift, 0xff00 >> shift); break; | |
| 355 | 355 | } |
| 356 | 356 | } |
| 357 | 357 | |
| r1877 | r1878 | |
| 417 | 417 | if ( input_code_pressed(KEYCODE_M) ) |
| 418 | 418 | { |
| 419 | 419 | offs_t tile_voffs; |
| 420 | int tcode[ | |
| 420 | int tcode[4]; | |
| 421 | 421 | while (input_code_pressed(KEYCODE_M)) ; |
| 422 | 422 | logerror("Scrolls BG-X BG-Y FG-X FG-Y TX-X TX-Y\n"); |
| 423 | 423 | logerror("------> %04x %04x %04x %04x %04x %04x\n",bgscrollx,bgscrolly,fgscrollx,fgscrolly,txscrollx,txscrolly); |
| r1877 | r1878 | |
| 454 | 454 | Sprite Handlers |
| 455 | 455 | ***************************************************************************/ |
| 456 | 456 | |
| 457 | static void draw_sprites(running_machine *machine, | |
| 457 | static void draw_sprites(running_machine *machine, | |
| 458 | 458 | { |
| 459 | 459 | int offs; |
| 460 | 460 | |
| r1877 | r1878 | |
| 489 | 489 | |
| 490 | 490 | |
| 491 | 491 | /*************************************************************************** |
| 492 | Draw the game screen in the given | |
| 492 | Draw the game screen in the given | |
| 493 | 493 | ***************************************************************************/ |
| 494 | 494 | |
| 495 | 495 | VIDEO_UPDATE( toaplan0 ) |
| r1877 | r1878 | |
| 517 | 517 | /* Spriteram is always 1 frame ahead, suggesting spriteram buffering. |
| 518 | 518 | There are no CPU output registers that control this so we |
| 519 | 519 | assume it happens automatically every frame, at the end of vblank */ |
| 520 | buffer_spriteram16_w(0,0,0); | |
| 520 | buffer_spriteram16_w(machine,0,0,0); | |
| 521 | 521 | } |
| r1877 | r1878 | |
|---|---|---|
| 31 | 31 | static int controller; |
| 32 | 32 | static int hit; |
| 33 | 33 | |
| 34 | static mame_bitmap* helper0; | |
| 35 | static mame_bitmap* helper1; | |
| 34 | static bitmap_t *helper0; | |
| 35 | static bitmap_t *helper1; | |
| 36 | 36 | |
| 37 | static tilemap | |
| 37 | static tilemap | |
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | /*************************************************************************** |
| r1877 | r1878 | |
|---|---|---|
| 30 | 30 | UINT16 *galpani2_bg8_0_scrollx, *galpani2_bg8_1_scrollx; |
| 31 | 31 | UINT16 *galpani2_bg8_0_scrolly, *galpani2_bg8_1_scrolly; |
| 32 | 32 | |
| 33 | static | |
| 33 | static | |
| 34 | 34 | |
| 35 | 35 | #define galpani2_BG8_REGS_R( _n_ ) \ |
| 36 | 36 | READ16_HANDLER( galpani2_bg8_regs_##_n_##_r ) \ |
| r1877 | r1878 | |
| 98 | 98 | |
| 99 | 99 | UINT16 *galpani2_bg15; |
| 100 | 100 | |
| 101 | static | |
| 101 | static | |
| 102 | 102 | |
| 103 | 103 | /* 8 horizontal pages of 256x256 pixels? */ |
| 104 | 104 | WRITE16_HANDLER( galpani2_bg15_w ) |
| r1877 | r1878 | |
|---|---|---|
| 196 | 196 | if( addr<0x2000*3 ) data = gfx_rom[addr]; |
| 197 | 197 | } |
| 198 | 198 | offs = (y*32+x/8+i)&0x1fff; |
| 199 | old_data = thief_videoram_r( offs ); | |
| 199 | old_data = thief_videoram_r( machine,offs ); | |
| 200 | 200 | if( xor_blit ){ |
| 201 | thief_videoram_w( offs, old_data^(data>>xoffset) ); | |
| 201 | thief_videoram_w( machine,offs, old_data^(data>>xoffset) ); | |
| 202 | 202 | } |
| 203 | 203 | else { |
| 204 | thief_videoram_w( offs, | |
| 204 | thief_videoram_w( machine,offs, | |
| 205 | 205 | (old_data&(0xff00>>xoffset)) | (data>>xoffset) |
| 206 | 206 | ); |
| 207 | 207 | } |
| 208 | 208 | offs = (offs+1)&0x1fff; |
| 209 | old_data = thief_videoram_r( offs ); | |
| 209 | old_data = thief_videoram_r( machine,offs ); | |
| 210 | 210 | if( xor_blit ){ |
| 211 | thief_videoram_w( offs, old_data^((data<<(8-xoffset))&0xff) ); | |
| 211 | thief_videoram_w( machine,offs, old_data^((data<<(8-xoffset))&0xff) ); | |
| 212 | 212 | } |
| 213 | 213 | else { |
| 214 | thief_videoram_w( offs, | |
| 214 | thief_videoram_w( machine,offs, | |
| 215 | 215 | (old_data&(0xff>>xoffset)) | ((data<<(8-xoffset))&0xff) |
| 216 | 216 | ); |
| 217 | 217 | } |
| r1877 | r1878 | |
|---|---|---|
| 18 | 18 | *************************************/ |
| 19 | 19 | |
| 20 | 20 | static double rweights[3], gweights[3], bweights[3]; |
| 21 | static | |
| 21 | static | |
| 22 | 22 | |
| 23 | 23 | static UINT8 video_control[8]; |
| 24 | 24 | static UINT8 bitmode_addr[2]; |
| r1877 | r1878 | |
|---|---|---|
| 128 | 128 | * 6,7| unused |
| 129 | 129 | */ |
| 130 | 130 | |
| 131 | static void draw_sprites(running_machine* machine, | |
| 131 | static void draw_sprites(running_machine* machine, | |
| 132 | 132 | { |
| 133 | 133 | UINT16 *source = spriteram16; |
| 134 | 134 | UINT16 *finish = source + 0x800; |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | UINT8* sprint2_video_ram; |
| 11 | 11 | |
| 12 | 12 | static tilemap* bg_tilemap; |
| 13 | static | |
| 13 | static | |
| 14 | 14 | |
| 15 | 15 | static int collision[2]; |
| 16 | 16 |
| r1877 | r1878 | |
|---|---|---|
| 67 | 67 | * |
| 68 | 68 | *************************************/ |
| 69 | 69 | |
| 70 | void exterm_scanline_update(running_machine *machine, int screen, | |
| 70 | void exterm_scanline_update(running_machine *machine, int screen, | |
| 71 | 71 | { |
| 72 | 72 | UINT16 *bgsrc = &exterm_master_videoram[(params->rowaddr << 8) & 0xff00]; |
| 73 | 73 | UINT16 *fgsrc = NULL; |
| r1877 | r1878 | |
|---|---|---|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
| 56 | static void draw_sprites(running_machine *machine, | |
| 56 | static void draw_sprites(running_machine *machine, | |
| 57 | 57 | { |
| 58 | 58 | const UINT8* p = orbit_sprite_ram; |
| 59 | 59 |
| r1877 | r1878 | |
|---|---|---|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | static void draw_chars(running_machine *machine, | |
| 52 | static void draw_chars(running_machine *machine, | |
| 53 | 53 | { |
| 54 | 54 | int offs, transparency; |
| 55 | 55 |
| r1877 | r1878 | |
|---|---|---|
| 233 | 233 | COMBINE_DATA( &video_dma_address ); |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | static void draw_blend_gfx( | |
| 236 | static void draw_blend_gfx( | |
| 237 | 237 | { |
| 238 | 238 | UINT8 *dp; |
| 239 | 239 | int i, j; |
| r1877 | r1878 | |
| 355 | 355 | { 7*16, 6*16, 5*16, 4*16, 3*16, 2*16, 1*16, 0*16 } |
| 356 | 356 | }; |
| 357 | 357 | |
| 358 | static void draw_sprites(running_machine *machine, | |
| 358 | static void draw_sprites(running_machine *machine, | |
| 359 | 359 | { |
| 360 | 360 | INT16 xpos, ypos; |
| 361 | 361 | int tile_num, color; |
| r1877 | r1878 | |
| 562 | 562 | #endif |
| 563 | 563 | |
| 564 | 564 | |
| 565 | static void combine_tilemap(running_machine *machine, | |
| 565 | static void combine_tilemap(running_machine *machine, | |
| 566 | 566 | { |
| 567 | 567 | int i,j; |
| 568 | 568 | UINT16 *s; |
| 569 | 569 | UINT16 *d; |
| 570 | 570 | UINT8 *t; |
| 571 | 571 | UINT32 xscroll_mask, yscroll_mask; |
| 572 | mame_bitmap *pen_bitmap; | |
| 573 | mame_bitmap *flags_bitmap; | |
| 572 | bitmap_t *pen_bitmap; | |
| 573 | bitmap_t *flags_bitmap; | |
| 574 | 574 | |
| 575 | 575 | pen_bitmap = tilemap_get_pixmap(tile); |
| 576 | 576 | flags_bitmap = tilemap_get_flagsmap(tile); |
| r1877 | r1878 | |
|---|---|---|
| 96 | 96 | palette_bank = 0; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | static void sauro_draw_sprites(running_machine *machine, | |
| 99 | static void sauro_draw_sprites(running_machine *machine, | |
| 100 | 100 | { |
| 101 | 101 | int offs,code,sx,sy,color,flipx; |
| 102 | 102 | |
| r1877 | r1878 | |
| 163 | 163 | 8, 8, 32, 32); |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | static void trckydoc_draw_sprites(running_machine *machine, | |
| 166 | static void trckydoc_draw_sprites(running_machine *machine, | |
| 167 | 167 | { |
| 168 | 168 | int offs,code,sy,color,flipx,sx; |
| 169 | 169 |
| r1877 | r1878 | |
|---|---|---|
| 239 | 239 | |
| 240 | 240 | ***************************************************************************/ |
| 241 | 241 | |
| 242 | static void starfield_render(running_machine *machine, | |
| 242 | static void starfield_render(running_machine *machine, | |
| 243 | 243 | { |
| 244 | 244 | int i; |
| 245 | 245 | int width, height; |
| r1877 | r1878 | |
| 266 | 266 | } |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | static void draw_sprites(running_machine *machine, | |
| 269 | static void draw_sprites(running_machine *machine, | |
| 270 | 270 | { |
| 271 | 271 | int offs; |
| 272 | 272 |
| r1877 | r1878 | |
|---|---|---|
| 306 | 306 | WRITE16_HANDLER( midxunit_paletteram_w ) |
| 307 | 307 | { |
| 308 | 308 | if (!(offset & 1)) |
| 309 | midtunit_paletteram_w(offset / 2, data, mem_mask); | |
| 309 | midtunit_paletteram_w(machine, offset / 2, data, mem_mask); | |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | |
| r1877 | r1878 | |
| 808 | 808 | * |
| 809 | 809 | *************************************/ |
| 810 | 810 | |
| 811 | void midtunit_scanline_update(running_machine *machine, int screen, | |
| 811 | void midtunit_scanline_update(running_machine *machine, int screen, | |
| 812 | 812 | { |
| 813 | 813 | UINT16 *src = &local_videoram[(params->rowaddr << 9) & 0x3fe00]; |
| 814 | 814 | UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0); |
| r1877 | r1878 | |
| 820 | 820 | dest[x] = src[coladdr++ & 0x1ff] & 0x7fff; |
| 821 | 821 | } |
| 822 | 822 | |
| 823 | void midxunit_scanline_update(running_machine *machine, int screen, | |
| 823 | void midxunit_scanline_update(running_machine *machine, int screen, | |
| 824 | 824 | { |
| 825 | 825 | UINT32 fulladdr = ((params->rowaddr << 16) | params->coladdr) >> 3; |
| 826 | 826 | UINT16 *src = &local_videoram[fulladdr & 0x3fe00]; |
| r1877 | r1878 | |
|---|---|---|
| 49 | 49 | #define RIGHT_BORDER (239) |
| 50 | 50 | |
| 51 | 51 | |
| 52 | static mame_bitmap *sprite_sprite_collision_bitmap1; | |
| 53 | static mame_bitmap *sprite_sprite_collision_bitmap2; | |
| 54 | static mame_bitmap *sprite_goal_collision_bitmap1; | |
| 55 | static mame_bitmap *sprite_goal_collision_bitmap2; | |
| 56 | static mame_bitmap *sprite_border_collision_bitmap; | |
| 52 | static bitmap_t *sprite_sprite_collision_bitmap1; | |
| 53 | static bitmap_t *sprite_sprite_collision_bitmap2; | |
| 54 | static bitmap_t *sprite_goal_collision_bitmap1; | |
| 55 | static bitmap_t *sprite_goal_collision_bitmap2; | |
| 56 | static bitmap_t *sprite_border_collision_bitmap; | |
| 57 | 57 | |
| 58 | 58 | |
| 59 | 59 | /*************************************************************************** |
| r1877 | r1878 | |
| 176 | 176 | * |
| 177 | 177 | *************************************/ |
| 178 | 178 | |
| 179 | static void draw_alpha_line(running_machine *machine, | |
| 179 | static void draw_alpha_line(running_machine *machine, | |
| 180 | 180 | int alpha_line, int video_line) |
| 181 | 181 | { |
| 182 | 182 | int x; |
| r1877 | r1878 | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | |
| 210 | static void draw_sprite(running_machine *machine, | |
| 210 | static void draw_sprite(running_machine *machine, | |
| 211 | 211 | UINT8 x, UINT8 y, int bank, int code, int col) |
| 212 | 212 | { |
| 213 | 213 | int remapped_code, flipy; |
| r1877 | r1878 | |
|---|---|---|
| 26 | 26 | static UINT8 *bg_dirtybuffer; |
| 27 | 27 | |
| 28 | 28 | static int scrollx_row[32]; |
| 29 | static | |
| 29 | static | |
| 30 | 30 | |
| 31 | 31 | //static int system1_pixel_mode = 0 |
| 32 | 32 | static UINT8 system1_background_memory,system1_video_mode=0; |
| r1877 | r1878 | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | |
| 182 | #ifdef UNUSED_FUNCTON | |
| 182 | 183 | INLINE int get_sprite_bottom_y(int spr_number) |
| 183 | 184 | { |
| 184 | 185 | return spriteram[0x10 * spr_number + SPR_Y_BOTTOM]; |
| 185 | 186 | } |
| 187 | #endif | |
| 186 | 188 | |
| 187 | INLINE void draw_pixel( | |
| 189 | INLINE void draw_pixel( | |
| 188 | 190 | int x,int y,int x_flipped,int y_flipped, |
| 189 | 191 | int spr_number,int color) |
| 190 | 192 | { |
| r1877 | r1878 | |
| 252 | 254 | system1_sprites_collisionram[offset] = 0x7e; |
| 253 | 255 | } |
| 254 | 256 | |
| 255 | static void draw_sprite( | |
| 257 | static void draw_sprite( | |
| 256 | 258 | { |
| 257 | 259 | int sy,row,height,src,bank; |
| 258 | 260 | UINT8 *sprite_base; |
| r1877 | r1878 | |
| 334 | 336 | } |
| 335 | 337 | |
| 336 | 338 | |
| 337 | static void draw_sprites( | |
| 339 | static void draw_sprites( | |
| 338 | 340 | { |
| 339 | 341 | int spr_number,sprite_bottom_y,sprite_top_y; |
| 340 | 342 | UINT8 *sprite_base; |
| r1877 | r1878 | |
| 361 | 363 | } |
| 362 | 364 | |
| 363 | 365 | |
| 364 | static int system1_draw_fg(running_machine *machine, | |
| 366 | static int system1_draw_fg(running_machine *machine, | |
| 365 | 367 | { |
| 366 | 368 | int sx,sy,offs; |
| 367 | 369 | int drawn = 0; |
| r1877 | r1878 | |
| 406 | 408 | return drawn; |
| 407 | 409 | } |
| 408 | 410 | |
| 409 | static void system1_draw_bg(running_machine *machine, | |
| 411 | static void system1_draw_bg(running_machine *machine, | |
| 410 | 412 | { |
| 411 | 413 | int sx,sy,offs; |
| 412 | 414 | int background_scrollx_flip, background_scrolly_flip; |
| r1877 | r1878 | |
| 554 | 556 | scrollx_row[offset/2] = (system1_scrollx_ram[offset & ~1] >> 1) + ((system1_scrollx_ram[offset | 1] & 1) << 7); |
| 555 | 557 | } |
| 556 | 558 | |
| 557 | static void chplft_draw_bg(running_machine *machine, | |
| 559 | static void chplft_draw_bg(running_machine *machine, | |
| 558 | 560 | { |
| 559 | 561 | int sx,sy,offs; |
| 560 | 562 | int choplifter_scroll_x_on = (system1_scrollx_ram[0] == 0xe5 && system1_scrollx_ram[1] == 0xff) ? 0 : 1; |
| r1877 | r1878 | |
| 711 | 713 | wbml_paged_videoram[0x1000*wbml_videoram_bank + offset] = data; |
| 712 | 714 | } |
| 713 | 715 | |
| 714 | static void wbml_draw_bg(running_machine *machine, | |
| 716 | static void wbml_draw_bg(running_machine *machine, | |
| 715 | 717 | { |
| 716 | 718 | int page; |
| 717 | 719 | |
| r1877 | r1878 | |
| 767 | 769 | } /* next page */ |
| 768 | 770 | } |
| 769 | 771 | |
| 770 | static void wbml_draw_fg(running_machine *machine, | |
| 772 | static void wbml_draw_fg(running_machine *machine, | |
| 771 | 773 | { |
| 772 | 774 | int offs; |
| 773 | 775 | |
| r1877 | r1878 | |
| 812 | 814 | } |
| 813 | 815 | |
| 814 | 816 | /* same as wbml but with rows scroll */ |
| 815 | static void ufosensi_draw_bg(running_machine *machine, | |
| 817 | static void ufosensi_draw_bg(running_machine *machine, | |
| 816 | 818 | { |
| 817 | 819 | int page; |
| 818 | 820 |
| r1877 | r1878 | |
|---|---|---|
| 267 | 267 | #define SIGN_EXTEND_POS(_var_) {_var_ &= 0x3ff; if (_var_ > 0x1ff) _var_ -= 0x400;} |
| 268 | 268 | |
| 269 | 269 | |
| 270 | static void draw_sprites(running_machine *machine, | |
| 270 | static void draw_sprites(running_machine *machine, | |
| 271 | 271 | { |
| 272 | 272 | UINT16 *source = spriteram16 + 0x8000/2; |
| 273 | 273 | UINT16 *finish = spriteram16 + 0x9000/2; |
| r1877 | r1878 | |
|---|---|---|
| 27 | 27 | static int nb19010_busyctr; |
| 28 | 28 | static int nb19010_busyflag; |
| 29 | 29 | |
| 30 | static | |
| 30 | static | |
| 31 | 31 | static UINT16 *niyanpai_videoram[VRAM_MAX]; |
| 32 | 32 | static UINT16 *niyanpai_videoworkram[VRAM_MAX]; |
| 33 | 33 | static UINT16 *niyanpai_palette; |
| r1877 | r1878 | |
|---|---|---|
| 103 | 103 | static int stv_vdp2_window_process(int x,int y); |
| 104 | 104 | static int stv_vdp2_apply_window_on_layer(rectangle *cliprect); |
| 105 | 105 | static void stv_vdp2_get_window0_coordinates(UINT16 *s_x, UINT16 *e_x, UINT16 *s_y, UINT16 *e_y); |
| 106 | static void stv_vdp2_check_tilemap(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 107 | static mame_bitmap *stv_vdp2_roz_bitmap[2]; | |
| 106 | static void stv_vdp2_check_tilemap(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 107 | static bitmap_t *stv_vdp2_roz_bitmap[2]; | |
| 108 | 108 | |
| 109 | 109 | enum |
| 110 | 110 | { |
| r1877 | r1878 | |
| 2357 | 2357 | |
| 2358 | 2358 | } |
| 2359 | 2359 | |
| 2360 | static void stv_vdp2_drawgfxzoom( | |
| 2360 | static void stv_vdp2_drawgfxzoom( | |
| 2361 | 2361 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 2362 | 2362 | const rectangle *clip,int transparency,int transparent_color,int scalex, int scaley, |
| 2363 | 2363 | int sprite_screen_width, int sprite_screen_height) |
| r1877 | r1878 | |
| 2690 | 2690 | *rgb = (_r << 10) | (_g << 5) | _b; |
| 2691 | 2691 | } |
| 2692 | 2692 | |
| 2693 | static void stv_vdp2_drawgfx_rgb555( | |
| 2693 | static void stv_vdp2_drawgfx_rgb555( | |
| 2694 | 2694 | int sx, int sy, const rectangle *clip, int transparency) |
| 2695 | 2695 | { |
| 2696 | 2696 | rectangle myclip; |
| r1877 | r1878 | |
| 2815 | 2815 | |
| 2816 | 2816 | } |
| 2817 | 2817 | |
| 2818 | static void stv_vdp2_draw_basic_bitmap(running_machine *machine, | |
| 2818 | static void stv_vdp2_draw_basic_bitmap(running_machine *machine, | |
| 2819 | 2819 | { |
| 2820 | 2820 | // if(LOG_VDP2) logerror ("bitmap enable %02x size %08x depth %08x\n", stv2_current_tilemap.layer_name, stv2_current_tilemap.bitmap_size, stv2_current_tilemap.colour_depth); |
| 2821 | 2821 | // popmessage ("bitmap enable %02x size %08x depth %08x number %02x", stv2_current_tilemap.layer_name, stv2_current_tilemap.bitmap_size, stv2_current_tilemap.colour_depth,stv2_current_tilemap.bitmap_palette_number); |
| r1877 | r1878 | |
| 3301 | 3301 | *_map = map; |
| 3302 | 3302 | } |
| 3303 | 3303 | |
| 3304 | static void stv_vdp2_draw_basic_tilemap(running_machine *machine, | |
| 3304 | static void stv_vdp2_draw_basic_tilemap(running_machine *machine, | |
| 3305 | 3305 | { |
| 3306 | 3306 | /* hopefully this is easier to follow than it is efficient .. */ |
| 3307 | 3307 | |
| r1877 | r1878 | |
| 3790 | 3790 | } |
| 3791 | 3791 | |
| 3792 | 3792 | |
| 3793 | static void stv_vdp2_check_tilemap_with_linescroll(running_machine *machine, | |
| 3793 | static void stv_vdp2_check_tilemap_with_linescroll(running_machine *machine, | |
| 3794 | 3794 | { |
| 3795 | 3795 | rectangle mycliprect; |
| 3796 | 3796 | int cur_line = cliprect->min_y; |
| r1877 | r1878 | |
| 3921 | 3921 | } |
| 3922 | 3922 | } |
| 3923 | 3923 | |
| 3924 | static void stv_vdp2_check_tilemap(running_machine *machine, | |
| 3924 | static void stv_vdp2_check_tilemap(running_machine *machine, | |
| 3925 | 3925 | { |
| 3926 | 3926 | /* the idea is here we check the tilemap capabilities / whats enabled and call an appropriate tilemap drawing routine, or |
| 3927 | 3927 | at the very list throw up a few errors if the tilemaps want to do something we don't support yet */ |
| r1877 | r1878 | |
| 3967 | 3967 | } |
| 3968 | 3968 | } |
| 3969 | 3969 | |
| 3970 | static void stv_vdp2_copy_roz_bitmap(mame_bitmap *bitmap, | |
| 3971 | mame_bitmap *roz_bitmap, | |
| 3970 | static void stv_vdp2_copy_roz_bitmap(bitmap_t *bitmap, | |
| 3971 | bitmap_t *roz_bitmap, | |
| 3972 | 3972 | const rectangle *cliprect, |
| 3973 | 3973 | int iRP, |
| 3974 | 3974 | int planesizex, |
| r1877 | r1878 | |
| 4334 | 4334 | } |
| 4335 | 4335 | } |
| 4336 | 4336 | |
| 4337 | static void stv_vdp2_draw_NBG0(running_machine *machine, | |
| 4337 | static void stv_vdp2_draw_NBG0(running_machine *machine, | |
| 4338 | 4338 | { |
| 4339 | 4339 | /* |
| 4340 | 4340 | Colours : 16, 256, 2048, 32768, 16770000 |
| r1877 | r1878 | |
| 4424 | 4424 | stv_vdp2_check_tilemap(machine, bitmap, cliprect); |
| 4425 | 4425 | } |
| 4426 | 4426 | |
| 4427 | static void stv_vdp2_draw_NBG1(running_machine *machine, | |
| 4427 | static void stv_vdp2_draw_NBG1(running_machine *machine, | |
| 4428 | 4428 | { |
| 4429 | 4429 | /* |
| 4430 | 4430 | Colours : 16, 256, 2048, 32768 |
| r1877 | r1878 | |
| 4514 | 4514 | stv_vdp2_check_tilemap(machine, bitmap, cliprect); |
| 4515 | 4515 | } |
| 4516 | 4516 | |
| 4517 | static void stv_vdp2_draw_NBG2(running_machine *machine, | |
| 4517 | static void stv_vdp2_draw_NBG2(running_machine *machine, | |
| 4518 | 4518 | { |
| 4519 | 4519 | /* |
| 4520 | 4520 | NBG2 is the first of the 2 more basic tilemaps, it has exactly the same capabilities as NBG3 |
| r1877 | r1878 | |
| 4614 | 4614 | stv_vdp2_check_tilemap(machine, bitmap, cliprect); |
| 4615 | 4615 | } |
| 4616 | 4616 | |
| 4617 | static void stv_vdp2_draw_NBG3(running_machine *machine, | |
| 4617 | static void stv_vdp2_draw_NBG3(running_machine *machine, | |
| 4618 | 4618 | { |
| 4619 | 4619 | /* |
| 4620 | 4620 | NBG3 is the second of the 2 more basic tilemaps, it has exactly the same capabilities as NBG2 |
| r1877 | r1878 | |
| 4715 | 4715 | } |
| 4716 | 4716 | |
| 4717 | 4717 | |
| 4718 | static void stv_vdp2_draw_rotation_screen(running_machine *machine, | |
| 4718 | static void stv_vdp2_draw_rotation_screen(running_machine *machine, | |
| 4719 | 4719 | { |
| 4720 | 4720 | rectangle roz_clip_rect, mycliprect; |
| 4721 | 4721 | int planesizex = 0, planesizey = 0, planerenderedsizex, planerenderedsizey; |
| r1877 | r1878 | |
| 4900 | 4900 | |
| 4901 | 4901 | } |
| 4902 | 4902 | |
| 4903 | static void stv_vdp2_draw_RBG0(running_machine *machine, | |
| 4903 | static void stv_vdp2_draw_RBG0(running_machine *machine, | |
| 4904 | 4904 | { |
| 4905 | 4905 | /* |
| 4906 | 4906 | Colours : 16, 256, 2048, 32768, 16770000 |
| r1877 | r1878 | |
| 5000 | 5000 | |
| 5001 | 5001 | } |
| 5002 | 5002 | |
| 5003 | static void stv_vdp2_draw_back(running_machine *machine, | |
| 5003 | static void stv_vdp2_draw_back(running_machine *machine, | |
| 5004 | 5004 | { |
| 5005 | 5005 | int xcnt,ycnt; |
| 5006 | 5006 | UINT8* gfxdata = stv_vdp2_gfx_decode; |
| r1877 | r1878 | |
| 5632 | 5632 | static UINT8 stv_sprite_priorities_in_fb_line[512][8]; |
| 5633 | 5633 | |
| 5634 | 5634 | |
| 5635 | static void draw_sprites(running_machine *machine, | |
| 5635 | static void draw_sprites(running_machine *machine, | |
| 5636 | 5636 | { |
| 5637 | 5637 | int x,y,r,g,b; |
| 5638 | 5638 | int i; |
| r1877 | r1878 | |
|---|---|---|
| 183 | 183 | colortable_configure_tilemap_groups(machine->colortable, tx_tilemap, machine->gfx[0], 0xcf); |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | static void draw_sprites(running_machine *machine, | |
| 186 | static void draw_sprites(running_machine *machine, | |
| 187 | 187 | { |
| 188 | 188 | int offs; |
| 189 | 189 | |
| r1877 | r1878 | |
| 243 | 243 | |
| 244 | 244 | VIDEO_EOF( exedexes ) |
| 245 | 245 | { |
| 246 | buffer_spriteram_w(0,0); | |
| 246 | buffer_spriteram_w(machine,0,0); | |
| 247 | 247 | } |
| r1877 | r1878 | |
|---|---|---|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | |
| 92 | static void do_pen_lookup(jedi_state *state, | |
| 92 | static void do_pen_lookup(jedi_state *state, | |
| 93 | 93 | { |
| 94 | 94 | int y, x; |
| 95 | 95 | pen_t pens[NUM_PENS]; |
| r1877 | r1878 | |
| 111 | 111 | |
| 112 | 112 | WRITE8_HANDLER( jedi_vscroll_w ) |
| 113 | 113 | { |
| 114 | jedi_state *state = | |
| 114 | jedi_state *state = machine->driver_data; | |
| 115 | 115 | |
| 116 | 116 | state->vscroll = data | (offset << 8); |
| 117 | 117 | } |
| r1877 | r1878 | |
| 119 | 119 | |
| 120 | 120 | WRITE8_HANDLER( jedi_hscroll_w ) |
| 121 | 121 | { |
| 122 | jedi_state *state = | |
| 122 | jedi_state *state = machine->driver_data; | |
| 123 | 123 | |
| 124 | 124 | state->hscroll = data | (offset << 8); |
| 125 | 125 | } |
| r1877 | r1878 | |
| 133 | 133 | * |
| 134 | 134 | *************************************/ |
| 135 | 135 | |
| 136 | static void draw_background_and_text(jedi_state *state, | |
| 136 | static void draw_background_and_text(jedi_state *state, | |
| 137 | 137 | { |
| 138 | 138 | int y; |
| 139 | 139 | int background_line_buffer[0x200]; /* RAM chip at 2A */ |
| r1877 | r1878 | |
| 233 | 233 | * |
| 234 | 234 | *************************************/ |
| 235 | 235 | |
| 236 | static void draw_sprites(jedi_state *state, | |
| 236 | static void draw_sprites(jedi_state *state, | |
| 237 | 237 | { |
| 238 | 238 | offs_t offs; |
| 239 | 239 | UINT8 *spriteram = state->spriteram; |
| r1877 | r1878 | |
|---|---|---|
| 325 | 325 | old2 += 0x40; \ |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | static void blit_nf_z( | |
| 328 | static void blit_nf_z( | |
| 329 | 329 | { |
| 330 | 330 | z_decls(sx); |
| 331 | 331 | z_clamp_x_min(); |
| r1877 | r1878 | |
| 339 | 339 | } |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | static void blit_fy_z( | |
| 342 | static void blit_fy_z( | |
| 343 | 343 | { |
| 344 | 344 | z_decls(sx); |
| 345 | 345 | z_clamp_x_min(); |
| r1877 | r1878 | |
| 353 | 353 | } |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | static void blit_fx_z( | |
| 356 | static void blit_fx_z( | |
| 357 | 357 | { |
| 358 | 358 | z_decls(sx); |
| 359 | 359 | z_clamp_x_max(); |
| r1877 | r1878 | |
| 367 | 367 | } |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | static void blit_fxy_z( | |
| 370 | static void blit_fxy_z( | |
| 371 | 371 | { |
| 372 | 372 | z_decls(sx); |
| 373 | 373 | z_clamp_x_max(); |
| r1877 | r1878 | |
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | static void (*const blit_z[4])( | |
| 384 | static void (*const blit_z[4])( | |
| 385 | 385 | blit_nf_z, |
| 386 | 386 | blit_fy_z, |
| 387 | 387 | blit_fx_z, |
| 388 | 388 | blit_fxy_z, |
| 389 | 389 | }; |
| 390 | 390 | |
| 391 | void skns_draw_sprites(running_machine *machine, | |
| 391 | void skns_draw_sprites(running_machine *machine, | |
| 392 | 392 | { |
| 393 | 393 | /*- SPR RAM Format -** |
| 394 | 394 | |
| r1877 | r1878 | |
| 766 | 766 | machine->gfx[3]->color_granularity=256; |
| 767 | 767 | } |
| 768 | 768 | |
| 769 | static void supernova_draw_a( | |
| 769 | static void supernova_draw_a( | |
| 770 | 770 | { |
| 771 | 771 | int enable_a = (skns_v3_regs[0x10/4] >> 0) & 0x0001; |
| 772 | 772 | UINT32 startx,starty; |
| r1877 | r1878 | |
| 818 | 818 | } |
| 819 | 819 | } |
| 820 | 820 | |
| 821 | static void supernova_draw_b( | |
| 821 | static void supernova_draw_b( | |
| 822 | 822 | { |
| 823 | 823 | int enable_b = (skns_v3_regs[0x34/4] >> 0) & 0x0001; |
| 824 | 824 | UINT32 startx,starty; |
| r1877 | r1878 | |
| 970 | 970 | |
| 971 | 971 | VIDEO_EOF(skns) |
| 972 | 972 | { |
| 973 | buffer_spriteram32_w(0,0,0); | |
| 973 | buffer_spriteram32_w(machine,0,0,0); | |
| 974 | 974 | } |
| r1877 | r1878 | |
|---|---|---|
| 158 | 158 | |
| 159 | 159 | ***************************************************************************/ |
| 160 | 160 | |
| 161 | static void draw_sprites(running_machine *machine, | |
| 161 | static void draw_sprites(running_machine *machine, | |
| 162 | 162 | { |
| 163 | 163 | /* Sprites list */ |
| 164 | 164 |
| r1877 | r1878 | |
|---|---|---|
| 14 | 14 | /* nth_word32 is a general-purpose utility function, which allows us to |
| 15 | 15 | * read from 32-bit aligned memory as if it were an array of 16 bit words. |
| 16 | 16 | */ |
| 17 | #ifdef UNUSED_FUNCTON | |
| 17 | 18 | INLINE UINT16 |
| 18 | 19 | nth_word32( const UINT32 *source, int which ) |
| 19 | 20 | { |
| r1877 | r1878 | |
| 28 | 29 | return (*source)>>16; |
| 29 | 30 | } |
| 30 | 31 | } |
| 32 | #endif | |
| 31 | 33 | |
| 32 | 34 | /* nth_byte32 is a general-purpose utility function, which allows us to |
| 33 | 35 | * read from 32-bit aligned memory as if it were an array of bytes. |
| 34 | 36 | */ |
| 37 | #ifdef UNUSED_FUNCTON | |
| 35 | 38 | INLINE UINT8 |
| 36 | 39 | nth_byte32( const UINT32 *pSource, int which ) |
| 37 | 40 | { |
| r1877 | r1878 | |
| 46 | 49 | default: return data&0xff; |
| 47 | 50 | } |
| 48 | 51 | } /* nth_byte32 */ |
| 52 | #endif | |
| 49 | 53 | |
| 50 | 54 | static void namcofl_install_palette(running_machine *machine) |
| 51 | 55 | { |
| r1877 | r1878 | |
|---|---|---|
| 112 | 112 | break; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | K007121_ctrl_0_w(offset,data); | |
| 115 | K007121_ctrl_0_w(machine,offset,data); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 |
| r1877 | r1878 | |
|---|---|---|
| 123 | 123 | } |
| 124 | 124 | WRITE8_HANDLER( tenkai_blit_dest_w ) |
| 125 | 125 | { |
| 126 | dynax_blit_dest_w(0, BITSWAP8(data, 7,6,5,4, 0,1,2,3)); | |
| 126 | dynax_blit_dest_w(machine, 0, BITSWAP8(data, 7,6,5,4, 0,1,2,3)); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /* Background Color */ |
| r1877 | r1878 | |
| 656 | 656 | case 3: blit_src = (blit_src & 0xffff00) | (data << 0); break; |
| 657 | 657 | case 4: blit_src = (blit_src & 0xff00ff) | (data << 8); break; |
| 658 | 658 | case 5: blit_src = (blit_src & 0x00ffff) | (data <<16); break; |
| 659 | case 6: dynax_blit_scroll_w(0,data); break; | |
| 659 | case 6: dynax_blit_scroll_w(machine,0,data); break; | |
| 660 | 660 | } |
| 661 | 661 | } |
| 662 | 662 | |
| r1877 | r1878 | |
| 671 | 671 | case 3: blit_src = (blit_src & 0xffff00) | (data << 0); break; |
| 672 | 672 | case 4: blit_src = (blit_src & 0xff00ff) | (data << 8); break; |
| 673 | 673 | case 5: blit_src = (blit_src & 0x00ffff) | (data <<16); break; |
| 674 | case 6: tenkai_blit_scroll_w(0,data); break; | |
| 674 | case 6: tenkai_blit_scroll_w(machine,0,data); break; | |
| 675 | 675 | } |
| 676 | 676 | } |
| 677 | 677 | |
| r1877 | r1878 | |
| 686 | 686 | case 3: blit_src = (blit_src & 0xffff00) | (data << 0); break; |
| 687 | 687 | case 4: blit_src = (blit_src & 0xff00ff) | (data << 8); break; |
| 688 | 688 | case 5: blit_src = (blit_src & 0x00ffff) | (data <<16); break; |
| 689 | case 6: dynax_blit_scroll_w(0,data); break; | |
| 689 | case 6: dynax_blit_scroll_w(machine,0,data); break; | |
| 690 | 690 | } |
| 691 | 691 | } |
| 692 | 692 | |
| r1877 | r1878 | |
| 700 | 700 | case 3: blit2_src = (blit2_src & 0xffff00) | (data << 0); break; |
| 701 | 701 | case 4: blit2_src = (blit2_src & 0xff00ff) | (data << 8); break; |
| 702 | 702 | case 5: blit2_src = (blit2_src & 0x00ffff) | (data <<16); break; |
| 703 | case 6: dynax_blit2_scroll_w(0,data); break; | |
| 703 | case 6: dynax_blit2_scroll_w(machine,0,data); break; | |
| 704 | 704 | } |
| 705 | 705 | } |
| 706 | 706 | |
| r1877 | r1878 | |
| 848 | 848 | |
| 849 | 849 | ***************************************************************************/ |
| 850 | 850 | |
| 851 | static void hanamai_copylayer( | |
| 851 | static void hanamai_copylayer( | |
| 852 | 852 | { |
| 853 | 853 | int color; |
| 854 | 854 | int scrollx,scrolly; |
| r1877 | r1878 | |
| 913 | 913 | } |
| 914 | 914 | |
| 915 | 915 | |
| 916 | static void jantouki_copylayer( | |
| 916 | static void jantouki_copylayer( | |
| 917 | 917 | { |
| 918 | 918 | int color,scrollx,scrolly,palettes,palbank; |
| 919 | 919 | |
| r1877 | r1878 | |
| 982 | 982 | } |
| 983 | 983 | |
| 984 | 984 | |
| 985 | static void mjdialq2_copylayer( | |
| 985 | static void mjdialq2_copylayer( | |
| 986 | 986 | { |
| 987 | 987 | int color; |
| 988 | 988 | int scrollx,scrolly; |
| r1877 | r1878 | |
| 1072 | 1072 | I,O - Change palette (-,+) |
| 1073 | 1073 | J,K & N,M - Change "tile" (-,+, slow & fast) |
| 1074 | 1074 | R - move "tile" to the next 1/8th of the gfx */ |
| 1075 | static int debug_viewer( | |
| 1075 | static int debug_viewer( | |
| 1076 | 1076 | { |
| 1077 | 1077 | #ifdef MAME_DEBUG |
| 1078 | 1078 | static int toggle; |
| r1877 | r1878 | |
| 1252 | 1252 | |
| 1253 | 1253 | // htengoku uses the mixer chip from ddenlovr |
| 1254 | 1254 | |
| 1255 | static | |
| 1255 | static | |
| 1256 | 1256 | |
| 1257 | 1257 | VIDEO_START(htengoku) |
| 1258 | 1258 | { |
| r1877 | r1878 | |
|---|---|---|
| 77 | 77 | tilemap_set_transparent_pen( foreground, 0 ); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | static void draw_sprites(running_machine *machine, | |
| 80 | static void draw_sprites(running_machine *machine, | |
| 81 | 81 | static int bFlicker; |
| 82 | 82 | const gfx_element *gfx = machine->gfx[1]; |
| 83 | 83 | const UINT8 *source = spriteram+127*4; |
| r1877 | r1878 | |
|---|---|---|
| 236 | 236 | if (offset == 7) |
| 237 | 237 | tilemap_set_flip(fg_tilemap,(data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); |
| 238 | 238 | |
| 239 | K007121_ctrl_0_w(offset,data); | |
| 239 | K007121_ctrl_0_w(machine,offset,data); | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | WRITE8_HANDLER( contra_K007121_ctrl_1_w ) |
| r1877 | r1878 | |
| 256 | 256 | if (offset == 7) |
| 257 | 257 | tilemap_set_flip(bg_tilemap,(data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); |
| 258 | 258 | |
| 259 | K007121_ctrl_1_w(offset,data); | |
| 259 | K007121_ctrl_1_w(machine,offset,data); | |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | |
| r1877 | r1878 | |
| 267 | 267 | |
| 268 | 268 | ***************************************************************************/ |
| 269 | 269 | |
| 270 | static void draw_sprites(running_machine *machine, | |
| 270 | static void draw_sprites(running_machine *machine, | |
| 271 | 271 | { |
| 272 | 272 | const UINT8 *source; |
| 273 | 273 | int base_color = (K007121_ctrlram[bank][6]&0x30)*2; |
| r1877 | r1878 | |
|---|---|---|
| 185 | 185 | paradise_priority = data; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | static void draw_sprites(running_machine *machine, | |
| 188 | static void draw_sprites(running_machine *machine, | |
| 189 | 189 | { |
| 190 | 190 | int i; |
| 191 | 191 | for (i = 0; i < spriteram_size ; i += paradise_sprite_inc) |
| r1877 | r1878 | |
|---|---|---|
| 70 | 70 | SCREEN REFRESH |
| 71 | 71 | *******************************************************/ |
| 72 | 72 | |
| 73 | static void refresh_pixel_layer(running_machine *machine, | |
| 73 | static void refresh_pixel_layer(running_machine *machine, | |
| 74 | 74 | { |
| 75 | 75 | int x, y; |
| 76 | 76 |
| r1877 | r1878 | |
|---|---|---|
| 127 | 127 | sprite_data = sprite_bank[(data & 0x80 >> 7) ^ 1]; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | shrike_shared_6809_w( 1, data ); | |
| 130 | shrike_shared_6809_w( machine, 1, data ); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
| r1877 | r1878 | |
| 138 | 138 | * |
| 139 | 139 | *************************************/ |
| 140 | 140 | |
| 141 | static void draw_one_sprite(running_machine *machine, | |
| 141 | static void draw_one_sprite(running_machine *machine, | |
| 142 | 142 | { |
| 143 | 143 | int flags = sprite[0]; |
| 144 | 144 | int image = sprite[1] | ((flags & 7) << 8); |
| r1877 | r1878 | |
|---|---|---|
| 1410 | 1410 | |
| 1411 | 1411 | WRITE16_HANDLER( bloodstm_video_w ) |
| 1412 | 1412 | { |
| 1413 | itech32_video_w(offset / 2, data, mem_mask); | |
| 1413 | itech32_video_w(machine, offset / 2, data, mem_mask); | |
| 1414 | 1414 | } |
| 1415 | 1415 | |
| 1416 | 1416 | |
| 1417 | 1417 | READ16_HANDLER( bloodstm_video_r ) |
| 1418 | 1418 | { |
| 1419 | return itech32_video_r(offset / 2,0); | |
| 1419 | return itech32_video_r(machine, offset / 2,0); | |
| 1420 | 1420 | } |
| 1421 | 1421 | |
| 1422 | 1422 | |
| 1423 | 1423 | WRITE32_HANDLER( itech020_video_w ) |
| 1424 | 1424 | { |
| 1425 | 1425 | if (ACCESSING_MSW32) |
| 1426 | itech32_video_w(offset, data >> 16, mem_mask >> 16); | |
| 1426 | itech32_video_w(machine, offset, data >> 16, mem_mask >> 16); | |
| 1427 | 1427 | else |
| 1428 | itech32_video_w(offset, data, mem_mask); | |
| 1428 | itech32_video_w(machine, offset, data, mem_mask); | |
| 1429 | 1429 | } |
| 1430 | 1430 | |
| 1431 | 1431 | |
| r1877 | r1878 | |
| 1438 | 1438 | |
| 1439 | 1439 | READ32_HANDLER( itech020_video_r ) |
| 1440 | 1440 | { |
| 1441 | int result = itech32_video_r(offset,0); | |
| 1441 | int result = itech32_video_r(machine,offset,0); | |
| 1442 | 1442 | return (result << 16) | result; |
| 1443 | 1443 | } |
| 1444 | 1444 |
| r1877 | r1878 | |
|---|---|---|
| 203 | 203 | Screen refresh |
| 204 | 204 | ***************************************************************************/ |
| 205 | 205 | |
| 206 | static void draw_sprites(running_machine *machine, | |
| 206 | static void draw_sprites(running_machine *machine, | |
| 207 | 207 | { |
| 208 | 208 | int offs; |
| 209 | 209 | |
| r1877 | r1878 | |
| 238 | 238 | } |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | static void draw_bitmap( | |
| 241 | static void draw_bitmap( | |
| 242 | 242 | { |
| 243 | 243 | int dx = flip_x ? -1 : 1; |
| 244 | 244 | int offs, i; |
| r1877 | r1878 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | extern char bbprot_kludge; |
| 18 | 18 | |
| 19 | static void draw_sprites(running_machine *machine, | |
| 19 | static void draw_sprites(running_machine *machine, | |
| 20 | 20 | { |
| 21 | 21 | const gfx_element *gfx = machine->gfx[3]; |
| 22 | 22 | UINT16 *source = fitfight_spriteram; |
| r1877 | r1878 | |
|---|---|---|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | |
| 96 | static void draw_track( | |
| 96 | static void draw_track( | |
| 97 | 97 | { |
| 98 | 98 | const UINT8* p = memory_region(REGION_GFX3); |
| 99 | 99 | |
| r1877 | r1878 | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | |
| 184 | static void draw_drones(running_machine *machine, | |
| 184 | static void draw_drones(running_machine *machine, | |
| 185 | 185 | { |
| 186 | 186 | static const UINT8 code[6] = |
| 187 | 187 | { |
| r1877 | r1878 | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | |
| 224 | static void draw_driver(running_machine *machine, | |
| 224 | static void draw_driver(running_machine *machine, | |
| 225 | 225 | { |
| 226 | 226 | int x; |
| 227 | 227 | int y; |
| r1877 | r1878 | |
|---|---|---|
| 32 | 32 | SET_TILE_INFO( 0,data&0xff,0,0 ); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | static void draw_sprites(running_machine *machine, | |
| 35 | static void draw_sprites(running_machine *machine, | |
| 36 | 36 | { |
| 37 | 37 | const UINT8 *spritepalettebank = memory_region(REGION_USER1); |
| 38 | 38 | const gfx_element *pGfx = machine->gfx[2]; |
| r1877 | r1878 | |
|---|---|---|
| 155 | 155 | |
| 156 | 156 | /* reset the genlock color */ |
| 157 | 157 | genlock_color = 0xffff; |
| 158 | ||
| 159 | VIDEO_START_CALL(generic_bitmapped); | |
| 160 | 158 | } |
| 161 | 159 | |
| 162 | 160 | |
| r1877 | r1878 | |
| 212 | 210 | } |
| 213 | 211 | |
| 214 | 212 | |
| 215 | static int copper_execute_next(int xpos) | |
| 213 | static int copper_execute_next(running_machine *machine, int xpos) | |
| 216 | 214 | { |
| 217 | 215 | int word0, word1; |
| 218 | 216 | |
| r1877 | r1878 | |
| 226 | 224 | if (LOG_COPPER) |
| 227 | 225 | logerror("%02X.%02X: Write to %s = %04x\n", last_scanline, xpos / 2, amiga_custom_names[copper_pending_offset & 0xff], copper_pending_data); |
| 228 | 226 | |
| 229 | amiga_custom_w(copper_pending_offset, copper_pending_data, 0); | |
| 227 | amiga_custom_w(machine, copper_pending_offset, copper_pending_data, 0); | |
| 230 | 228 | copper_pending_offset = 0; |
| 231 | 229 | } |
| 232 | 230 | |
| r1877 | r1878 | |
| 609 | 607 | * |
| 610 | 608 | *************************************/ |
| 611 | 609 | |
| 612 | void amiga_render_scanline(int scanline) | |
| 610 | void amiga_render_scanline(running_machine *machine, bitmap_t *bitmap, int scanline) | |
| 613 | 611 | { |
| 614 | 612 | UINT16 save_color0 = CUSTOM_REG(REG_COLOR00); |
| 615 | 613 | int ddf_start_pixel = 0, ddf_stop_pixel = 0; |
| r1877 | r1878 | |
| 620 | 618 | int planes = 0; |
| 621 | 619 | |
| 622 | 620 | int x; |
| 623 | UINT16 *dst; | |
| 621 | UINT16 *dst = NULL; | |
| 624 | 622 | int ebitoffs = 0, obitoffs = 0; |
| 625 | 623 | int ecolmask = 0, ocolmask = 0; |
| 626 | 624 | int edelay = 0, odelay = 0; |
| r1877 | r1878 | |
| 640 | 638 | update_sprite_dma(scanline); |
| 641 | 639 | |
| 642 | 640 | /* start of a new line, signal we're not done with it and fill up vars */ |
| 643 | dst = BITMAP_ADDR16(tmpbitmap, scanline, 0); | |
| 641 | if (bitmap != NULL) | |
| 642 | dst = BITMAP_ADDR16(bitmap, scanline, 0); | |
| 644 | 643 | |
| 645 | 644 | /* all sprites off at the start of the line */ |
| 646 | 645 | memset(sprite_remain, 0, sizeof(sprite_remain)); |
| r1877 | r1878 | |
| 660 | 659 | { |
| 661 | 660 | /* execute the next batch, restoring and re-saving color 0 around it */ |
| 662 | 661 | CUSTOM_REG(REG_COLOR00) = save_color0; |
| 663 | next_copper_x = copper_execute_next(x); | |
| 662 | next_copper_x = copper_execute_next(machine, x); | |
| 664 | 663 | save_color0 = CUSTOM_REG(REG_COLOR00); |
| 665 | 664 | if (genlock_color != 0xffff) |
| 666 | 665 | CUSTOM_REG(REG_COLOR00) = genlock_color; |
| r1877 | r1878 | |
| 697 | 696 | } |
| 698 | 697 | |
| 699 | 698 | /* clear the target pixels to the background color as a starting point */ |
| 700 | dst[x*2+0] = | |
| 701 | dst[x*2+1] = CUSTOM_REG(REG_COLOR00); | |
| 699 | if (dst != NULL) | |
| 700 | dst[x*2+0] = | |
| 701 | dst[x*2+1] = CUSTOM_REG(REG_COLOR00); | |
| 702 | 702 | |
| 703 | 703 | /* if we hit the first fetch pixel, reset the counters and latch the delays */ |
| 704 | 704 | if (x == ddf_start_pixel) |
| r1877 | r1878 | |
| 838 | 838 | CUSTOM_REG(REG_CLXDAT) |= 0x001; |
| 839 | 839 | |
| 840 | 840 | /* if we are within the display region, render */ |
| 841 | if (x >= hstart && x < hstop) | |
| 841 | if (dst != NULL && x >= hstart && x < hstop) | |
| 842 | 842 | { |
| 843 | 843 | /* hold-and-modify mode -- assume low-res (hi-res not supported by the hardware) */ |
| 844 | 844 | if (ham) |
| r1877 | r1878 | |
| 921 | 921 | } |
| 922 | 922 | |
| 923 | 923 | #if 0 |
| 924 | if ( | |
| 924 | if ( vid | |
| 925 | 925 | { |
| 926 | 926 | const char *m_lores = "LORES"; |
| 927 | 927 | const char *m_hires = "HIRES"; |
| r1877 | r1878 | |
| 960 | 960 | CUSTOM_REG(REG_COLOR00) = save_color0; |
| 961 | 961 | |
| 962 | 962 | #if GUESS_COPPER_OFFSET |
| 963 | if ( | |
| 963 | if (vid | |
| 964 | 964 | { |
| 965 | 965 | if (input_code_pressed(KEYCODE_Q)) |
| 966 | 966 | popmessage("%d", wait_offset -= 1); |
| r1877 | r1878 | |
| 969 | 969 | } |
| 970 | 970 | #endif |
| 971 | 971 | } |
| 972 | ||
| 973 | ||
| 974 | ||
| 975 | /************************************* | |
| 976 | * | |
| 977 | * Update | |
| 978 | * | |
| 979 | *************************************/ | |
| 980 | ||
| 981 | VIDEO_UPDATE( amiga ) | |
| 982 | { | |
| 983 | int y; | |
| 984 | ||
| 985 | /* render each scanline in the visible region */ | |
| 986 | for (y = cliprect->min_y; y <= cliprect->max_y; y++) | |
| 987 | amiga_render_scanline(machine, bitmap, y); | |
| 988 | ||
| 989 | return 0; | |
| 990 | } |
| r1877 | r1878 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | ***************************************************************/ |
| 82 | 82 | |
| 83 | static void draw_sprites(running_machine *machine, | |
| 83 | static void draw_sprites(running_machine *machine, | |
| 84 | 84 | { |
| 85 | 85 | UINT16 *spritemap = (UINT16 *)memory_region(REGION_USER1); |
| 86 | 86 | int offs, data, tilenum, color, flipx, flipy; |
| r1877 | r1878 | |
| 349 | 349 | /* See if we should draw artificial gun targets */ |
| 350 | 350 | /* (not yet implemented...) */ |
| 351 | 351 | |
| 352 | if (input_port_7_word_r(0,0) & 0x1) /* Fake DSW */ | |
| 352 | if (input_port_7_word_r(machine,0,0) & 0x1) /* Fake DSW */ | |
| 353 | 353 | { |
| 354 | 354 | popmessage("Gunsights on"); |
| 355 | 355 | } |
| r1877 | r1878 | |
|---|---|---|
| 70 | 70 | int code, colour; |
| 71 | 71 | int sx, sy; |
| 72 | 72 | int x,y; |
| 73 | mame_bitmap *s2636_0_bitmap; | |
| 74 | mame_bitmap *s2636_1_bitmap; | |
| 73 | bitmap_t *s2636_0_bitmap; | |
| 74 | bitmap_t *s2636_1_bitmap; | |
| 75 | 75 | |
| 76 | 76 | fillbitmap(bitmap,0,0); |
| 77 | 77 |
| r1877 | r1878 | |
|---|---|---|
| 16 | 16 | static int deco32_pf1_flip,deco32_pf2_flip,deco32_pf3_flip,deco32_pf4_flip; |
| 17 | 17 | static int deco32_pf2_colourbank,deco32_pf4_colourbank,deco32_pri; |
| 18 | 18 | |
| 19 | static | |
| 19 | static | |
| 20 | 20 | |
| 21 | 21 | static UINT32 dragngun_sprite_ctrl; |
| 22 | 22 | static int deco32_ace_ram_dirty, has_ace_ram; |
| r1877 | r1878 | |
| 193 | 193 | |
| 194 | 194 | /******************************************************************************/ |
| 195 | 195 | |
| 196 | static void captaven_draw_sprites(running_machine* machine, | |
| 196 | static void captaven_draw_sprites(running_machine* machine, | |
| 197 | 197 | { |
| 198 | 198 | int offs; |
| 199 | 199 | |
| r1877 | r1878 | |
| 232 | 232 | |
| 233 | 233 | sx = spritedata[offs+1]; |
| 234 | 234 | |
| 235 | if ((sy&0x2000) && ( | |
| 235 | if ((sy&0x2000) && (vid | |
| 236 | 236 | |
| 237 | 237 | colour = (spritedata[offs+2] >>0) & 0x1f; |
| 238 | 238 | |
| r1877 | r1878 | |
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | static void fghthist_draw_sprites(running_machine* machine, | |
| 281 | static void fghthist_draw_sprites(running_machine* machine, | |
| 282 | 282 | { |
| 283 | 283 | int offs; |
| 284 | 284 | |
| r1877 | r1878 | |
| 291 | 291 | |
| 292 | 292 | y = spritedata[offs]; |
| 293 | 293 | flash=y&0x1000; |
| 294 | if (flash && ( | |
| 294 | if (flash && (vid | |
| 295 | 295 | |
| 296 | 296 | trans=TRANSPARENCY_PEN; |
| 297 | 297 | x = spritedata[offs+2]; |
| r1877 | r1878 | |
| 344 | 344 | Bottom 8 bits per pixel is palettised sprite data, top 8 is |
| 345 | 345 | colour/alpha/priority. |
| 346 | 346 | */ |
| 347 | static void deco32_draw_sprite( | |
| 347 | static void deco32_draw_sprite( | |
| 348 | 348 | UINT32 code,UINT32 priority,int flipx,int flipy,int sx,int sy, |
| 349 | 349 | const rectangle *clip) |
| 350 | 350 | { |
| r1877 | r1878 | |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | // Merge with Tattass & Fghthist sprite routines later |
| 396 | static void nslasher_draw_sprites(running_machine* machine, | |
| 396 | static void nslasher_draw_sprites(running_machine* machine, | |
| 397 | 397 | { |
| 398 | 398 | int offs; |
| 399 | 399 | |
| r1877 | r1878 | |
| 407 | 407 | |
| 408 | 408 | y = spritedata[offs]; |
| 409 | 409 | flash=y&0x1000; |
| 410 | if (flash && ( | |
| 410 | if (flash && (vid | |
| 411 | 411 | |
| 412 | 412 | trans=TRANSPARENCY_PEN; |
| 413 | 413 | x = spritedata[offs+2]; |
| r1877 | r1878 | |
| 455 | 455 | } |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | INLINE void dragngun_drawgfxzoom( | |
| 458 | INLINE void dragngun_drawgfxzoom( | |
| 459 | 459 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 460 | 460 | const rectangle *clip,int transparency,int transparent_color, |
| 461 | int scalex, int scaley, | |
| 461 | int scalex, int scaley, | |
| 462 | 462 | { |
| 463 | 463 | rectangle myclip; |
| 464 | 464 | |
| r1877 | r1878 | |
| 655 | 655 | } |
| 656 | 656 | } |
| 657 | 657 | |
| 658 | static void dragngun_draw_sprites(running_machine* machine, | |
| 658 | static void dragngun_draw_sprites(running_machine* machine, | |
| 659 | 659 | { |
| 660 | 660 | const UINT32 *layout_ram; |
| 661 | 661 | const UINT32 *lookup_ram; |
| r1877 | r1878 | |
| 1073 | 1073 | } |
| 1074 | 1074 | |
| 1075 | 1075 | #if 0 |
| 1076 | static void print_debug_info( | |
| 1076 | static void print_debug_info( | |
| 1077 | 1077 | { |
| 1078 | 1078 | int j; |
| 1079 | 1079 | char buf[64*5]; |
| r1877 | r1878 | |
| 1091 | 1091 | |
| 1092 | 1092 | #endif |
| 1093 | 1093 | |
| 1094 | static void tilemap_raster_draw( | |
| 1094 | static void tilemap_raster_draw( | |
| 1095 | 1095 | { |
| 1096 | 1096 | int ptr=0,sx0,sy0,sx1,sy1,start,end=0; |
| 1097 | 1097 | rectangle clip; |
| r1877 | r1878 | |
| 1124 | 1124 | } |
| 1125 | 1125 | } |
| 1126 | 1126 | |
| 1127 | static void combined_tilemap_draw(running_machine* machine, | |
| 1127 | static void combined_tilemap_draw(running_machine* machine, | |
| 1128 | 1128 | { |
| 1129 | const mame_bitmap *bitmap0 = tilemap_get_pixmap(pf3_tilemap); | |
| 1130 | const mame_bitmap *bitmap1 = tilemap_get_pixmap(pf4_tilemap); | |
| 1129 | const bitmap_t *bitmap0 = tilemap_get_pixmap(pf3_tilemap); | |
| 1130 | const bitmap_t *bitmap1 = tilemap_get_pixmap(pf4_tilemap); | |
| 1131 | 1131 | int x,y,p; |
| 1132 | 1132 | |
| 1133 | 1133 | const UINT16 width_mask=0x3ff; |
| r1877 | r1878 | |
| 1412 | 1412 | blending support - it can't be done in-place on the final framebuffer |
| 1413 | 1413 | without a lot of support bitmaps. |
| 1414 | 1414 | */ |
| 1415 | static void mixDualAlphaSprites(running_machine* machine, | |
| 1415 | static void mixDualAlphaSprites(running_machine* machine, | |
| 1416 | 1416 | { |
| 1417 | 1417 | const pen_t *pal0 = &machine->pens[gfx0->color_base]; |
| 1418 | 1418 | const pen_t *pal1 = &machine->pens[gfx1->color_base]; |
| r1877 | r1878 | |
|---|---|---|
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | #ifdef UNUSED_FUNCTON | |
| 206 | 207 | INLINE void waveram_plot_check_depth_nowrite(int y, int x, UINT16 color, UINT16 depth) |
| 207 | 208 | { |
| 208 | 209 | if (x >= 0 && x <= zeus_cliprect.max_x && y >= 0 && y < zeus_cliprect.max_y) |
| r1877 | r1878 | |
| 212 | 213 | WAVERAM_WRITEPIX(zeus_renderbase, y, x, color); |
| 213 | 214 | } |
| 214 | 215 | } |
| 216 | #endif | |
| 215 | 217 | |
| 216 | 218 | |
| 217 | ||
| 218 | 219 | /************************************* |
| 219 | 220 | * |
| 220 | 221 | * Inlines for texel accesses |
| r1877 | r1878 | |
| 1058 | 1059 | |
| 1059 | 1060 | static void zeus_draw_quad(const UINT32 *databuffer, UINT32 texdata, int logit) |
| 1060 | 1061 | { |
| 1061 | poly_draw_scanline callback; | |
| 1062 | poly_draw_scanline_func callback; | |
| 1062 | 1063 | poly_extra_data *extra; |
| 1063 | 1064 | poly_vertex clipvert[8]; |
| 1064 | 1065 | poly_vertex vert[4]; |
| r1877 | r1878 | |
|---|---|---|
| 159 | 159 | static UINT8* bomba_otherram; |
| 160 | 160 | |
| 161 | 161 | static int valtric_mosaic=0; |
| 162 | static | |
| 162 | static | |
| 163 | 163 | |
| 164 | 164 | |
| 165 | 165 | /*************************************************************************** |
| r1877 | r1878 | |
| 1110 | 1110 | |
| 1111 | 1111 | } |
| 1112 | 1112 | |
| 1113 | static void argus_draw_sprites(running_machine *machine, | |
| 1113 | static void argus_draw_sprites(running_machine *machine, | |
| 1114 | 1114 | { |
| 1115 | 1115 | int offs; |
| 1116 | 1116 | |
| r1877 | r1878 | |
| 1166 | 1166 | } |
| 1167 | 1167 | } |
| 1168 | 1168 | |
| 1169 | static void valtric_draw_sprites(running_machine *machine, | |
| 1169 | static void valtric_draw_sprites(running_machine *machine, | |
| 1170 | 1170 | { |
| 1171 | 1171 | int offs; |
| 1172 | 1172 | |
| r1877 | r1878 | |
| 1219 | 1219 | } |
| 1220 | 1220 | } |
| 1221 | 1221 | |
| 1222 | static void butasan_draw_sprites(running_machine *machine, | |
| 1222 | static void butasan_draw_sprites(running_machine *machine, | |
| 1223 | 1223 | { |
| 1224 | 1224 | int offs; |
| 1225 | 1225 | |
| r1877 | r1878 | |
| 1464 | 1464 | } |
| 1465 | 1465 | #endif |
| 1466 | 1466 | |
| 1467 | static void bombsa_draw_sprites(running_machine *machine, | |
| 1467 | static void bombsa_draw_sprites(running_machine *machine, | |
| 1468 | 1468 | { |
| 1469 | 1469 | int offs; |
| 1470 | 1470 |
| r1877 | r1878 | |
|---|---|---|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | #if 0 |
| 121 | static int collision_check(running_machine *machine, grchamp_state *state, | |
| 121 | static int collision_check(running_machine *machine, grchamp_state *state, | |
| 122 | 122 | { |
| 123 | 123 | int bgcolor = machine->pens[0]; |
| 124 | 124 | int sprite_transp = machine->pens[0x24]; |
| r1877 | r1878 | |
| 170 | 170 | return result?(1<<which):0; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | static void draw_fog(grchamp_state *state, | |
| 173 | static void draw_fog(grchamp_state *state, | |
| 174 | 174 | { |
| 175 | 175 | int x,y,offs; |
| 176 | 176 | |
| r1877 | r1878 | |
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | static void draw_sprites(running_machine *machine, grchamp_state *state, | |
| 190 | static void draw_sprites(running_machine *machine, grchamp_state *state, | |
| 191 | 191 | { |
| 192 | 192 | const gfx_element *gfx = machine->gfx[5]; |
| 193 | 193 | int bank = (state->cpu0_out[0] & 0x20) ? 0x40 : 0x00; |
| r1877 | r1878 | |
| 373 | 373 | const UINT8 *amedata = memory_region(REGION_GFX5); |
| 374 | 374 | const UINT8 *headdata = memory_region(REGION_GFX6); |
| 375 | 375 | const UINT8 *pldata = memory_region(REGION_GFX7); |
| 376 | mame_bitmap *lpixmap = tilemap_get_pixmap(state->left_tilemap); | |
| 377 | mame_bitmap *rpixmap = tilemap_get_pixmap(state->right_tilemap); | |
| 378 | mame_bitmap *cpixmap = tilemap_get_pixmap(state->center_tilemap); | |
| 376 | bitmap_t *lpixmap = tilemap_get_pixmap(state->left_tilemap); | |
| 377 | bitmap_t *rpixmap = tilemap_get_pixmap(state->right_tilemap); | |
| 378 | bitmap_t *cpixmap = tilemap_get_pixmap(state->center_tilemap); | |
| 379 | 379 | int lrxscroll, cxscroll, lyscroll, ryscroll, cyscroll; |
| 380 | 380 | int bgcolor = state->cpu1_out[3] & 0x10; |
| 381 | 381 | int amebase = state->cpu0_out[4] >> 4; |
| r1877 | r1878 | |
| 401 | 401 | for (y = cliprect->min_y; y <= cliprect->max_y; y++) |
| 402 | 402 | { |
| 403 | 403 | /* select either left or right tilemaps based on Y */ |
| 404 | | |
| 404 | | |
| 405 | 405 | int lryscroll = (y < 128) ? lyscroll : ryscroll; |
| 406 | 406 | |
| 407 | 407 | /* get source/dest pointers */ |
| r1877 | r1878 | |
|---|---|---|
| 94 | 94 | } /* VIDEO_START( lkage ) */ |
| 95 | 95 | |
| 96 | 96 | |
| 97 | static void draw_sprites(running_machine *machine, | |
| 97 | static void draw_sprites(running_machine *machine, | |
| 98 | 98 | { |
| 99 | 99 | const UINT8 *source = spriteram; |
| 100 | 100 | const UINT8 *finish = source+0x60; |
| r1877 | r1878 | |
|---|---|---|
| 33 | 33 | SET_TILE_INFO(2, (tile & 0xfff) + 0x3000, color, 0); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | static void draw_sprites(running_machine *machine, | |
| 36 | static void draw_sprites(running_machine *machine, | |
| 37 | 37 | { |
| 38 | 38 | int offs,fx,fy,x,y,color,sprite; |
| 39 | 39 | int dx,dy,ax,ay; |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "deprecat.h" | |
| 9 | 8 | |
| 10 | 9 | UINT16 *gaiden_videoram,*gaiden_videoram2,*gaiden_videoram3; |
| 11 | 10 | int gaiden_sprite_sizey; |
| 12 | 11 | //int raiga_alpha; |
| 13 | 12 | |
| 14 | 13 | static tilemap *text_layer,*foreground,*background; |
| 15 | static | |
| 14 | static | |
| 16 | 15 | |
| 17 | 16 | /*************************************************************************** |
| 18 | 17 | |
| r1877 | r1878 | |
| 219 | 218 | changes?) it appears that the sprite drawing is no longer putting the correct raw data |
| 220 | 219 | in the bitmaps? */ |
| 221 | 220 | static void blendbitmaps(running_machine *machine, |
| 222 | | |
| 221 | | |
| 223 | 222 | int sx,int sy,const rectangle *cliprect) |
| 224 | 223 | { |
| 225 | 224 | int y,x; |
| r1877 | r1878 | |
| 276 | 275 | |
| 277 | 276 | #define NUM_SPRITES 256 |
| 278 | 277 | |
| 279 | static void gaiden_draw_sprites(running_machine *machine, | |
| 278 | static void gaiden_draw_sprites(running_machine *machine, | |
| 280 | 279 | { |
| 281 | 280 | static const UINT8 layout[8][8] = |
| 282 | 281 | { |
| r1877 | r1878 | |
| 317 | 316 | int ypos = source[3] & 0x01ff; |
| 318 | 317 | int xpos = source[4] & 0x01ff; |
| 319 | 318 | |
| 320 | if ((attributes & 0x20) && ( | |
| 319 | if ((attributes & 0x20) && (vid | |
| 321 | 320 | goto skip_sprite; |
| 322 | 321 | |
| 323 | 322 | color = (color >> 4) & 0x0f; |
| r1877 | r1878 | |
| 375 | 374 | } |
| 376 | 375 | |
| 377 | 376 | |
| 378 | static void raiga_draw_sprites(running_machine *machine, | |
| 377 | static void raiga_draw_sprites(running_machine *machine, | |
| 379 | 378 | { |
| 380 | 379 | static const UINT8 layout[8][8] = |
| 381 | 380 | { |
| r1877 | r1878 | |
| 472 | 471 | } |
| 473 | 472 | else |
| 474 | 473 | { |
| 475 | | |
| 474 | | |
| 476 | 475 | |
| 477 | 476 | for (row = 0; row < sizey; row++) |
| 478 | 477 | { |
| r1877 | r1878 | |
| 516 | 515 | * |---------x------- | x position (high bit) |
| 517 | 516 | */ |
| 518 | 517 | |
| 519 | static void drgnbowl_draw_sprites(running_machine *machine, | |
| 518 | static void drgnbowl_draw_sprites(running_machine *machine, | |
| 520 | 519 | { |
| 521 | 520 | int i, code, color, x, y, flipx, flipy, priority_mask; |
| 522 | 521 |
| r1877 | r1878 | |
|---|---|---|
| 124 | 124 | * |
| 125 | 125 | *************************************/ |
| 126 | 126 | |
| 127 | static void video_start_common(running_machine *machine, tile_get_info_c | |
| 127 | static void video_start_common(running_machine *machine, tile_get_info_func | |
| 128 | 128 | { |
| 129 | 129 | /* reset globals */ |
| 130 | 130 | bg_enable = 0; |
| r1877 | r1878 | |
| 304 | 304 | * |
| 305 | 305 | *************************************/ |
| 306 | 306 | |
| 307 | static void draw_background(running_machine *machine, | |
| 307 | static void draw_background(running_machine *machine, | |
| 308 | 308 | { |
| 309 | 309 | /* only draw if enabled */ |
| 310 | 310 | if (bg_enable) |
| 311 | 311 | { |
| 312 | | |
| 312 | | |
| 313 | 313 | int colorbase = bg_color + (congo_color_bank << 8); |
| 314 | 314 | int xmask = pixmap->width - 1; |
| 315 | 315 | int ymask = pixmap->height - 1; |
| r1877 | r1878 | |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | |
| 423 | static void draw_sprites(running_machine *machine, | |
| 423 | static void draw_sprites(running_machine *machine, | |
| 424 | 424 | { |
| 425 | 425 | int flipmask = flip_screen_get() ? 0xff : 0x00; |
| 426 | 426 | int offs; |
| r1877 | r1878 | |
|---|---|---|
| 59 | 59 | tilemap_mark_tile_dirty( background, offset&0x7ff ); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | static void draw_sprite(running_machine *machine, const UINT8 *source, | |
| 62 | static void draw_sprite(running_machine *machine, const UINT8 *source, | |
| 63 | 63 | const gfx_element *gfx; |
| 64 | 64 | int transparent_pen; |
| 65 | 65 | int bank_index; |
| r1877 | r1878 | |
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | static void shangkid_draw_sprites(running_machine *machine, | |
| 155 | static void shangkid_draw_sprites(running_machine *machine, | |
| 156 | 156 | { |
| 157 | 157 | const UINT8 *source, *finish; |
| 158 | 158 | |
| r1877 | r1878 | |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | |
| 216 | static void dynamski_draw_background(running_machine *machine, | |
| 216 | static void dynamski_draw_background(running_machine *machine, | |
| 217 | 217 | { |
| 218 | 218 | int i; |
| 219 | 219 | int sx,sy; |
| r1877 | r1878 | |
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | static void dynamski_draw_sprites(running_machine *machine, | |
| 270 | static void dynamski_draw_sprites(running_machine *machine, | |
| 271 | 271 | { |
| 272 | 272 | int i; |
| 273 | 273 | int sx,sy; |
| r1877 | r1878 | |
|---|---|---|
| 188 | 188 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | static void draw_sprites(running_machine *machine, | |
| 191 | static void draw_sprites(running_machine *machine, | |
| 192 | 192 | { |
| 193 | 193 | int offs; |
| 194 | 194 |
| r1877 | r1878 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | extern UINT8 galaxian_stars_on; |
| 15 | 15 | void galaxian_init_stars(running_machine *machine, int colors_offset); |
| 16 | void galaxian_draw_stars(running_machine *machine, | |
| 16 | void galaxian_draw_stars(running_machine *machine, | |
| 17 | 17 | |
| 18 | 18 | UINT8 *fastfred_videoram; |
| 19 | 19 | UINT8 *fastfred_spriteram; |
| r1877 | r1878 | |
| 249 | 249 | * |
| 250 | 250 | *************************************/ |
| 251 | 251 | |
| 252 | static void draw_sprites(running_machine *machine, | |
| 252 | static void draw_sprites(running_machine *machine, | |
| 253 | 253 | { |
| 254 | 254 | int offs; |
| 255 | 255 |
| r1877 | r1878 | |
|---|---|---|
| 7 | 7 | #include "driver.h" |
| 8 | 8 | |
| 9 | 9 | static UINT8 *dirty_f; |
| 10 | static | |
| 10 | static | |
| 11 | 11 | UINT16 karnov_scroll[2], *karnov_pf_data; |
| 12 | 12 | static tilemap *fix_tilemap; |
| 13 | 13 | static int flipscreen; |
| r1877 | r1878 | |
| 78 | 78 | tilemap_set_flip(ALL_TILEMAPS,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | static void draw_background(running_machine *machine, | |
| 81 | static void draw_background(running_machine *machine, | |
| 82 | 82 | { |
| 83 | 83 | int my,mx,offs,color,tile,fx,fy; |
| 84 | 84 | int scrollx=karnov_scroll[0]; |
| r1877 | r1878 | |
| 139 | 139 | copyscrollbitmap(bitmap,bitmap_f,1,&scrollx,1,&scrolly,cliprect); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | static void draw_sprites(running_machine *machine, | |
| 142 | static void draw_sprites(running_machine *machine, | |
| 143 | 143 | { |
| 144 | 144 | int offs; |
| 145 | 145 |
| r1877 | r1878 | |
|---|---|---|
| 183 | 183 | return sx || sy; |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | static void lwings_draw_sprites(running_machine *machine, | |
| 186 | static void lwings_draw_sprites(running_machine *machine, | |
| 187 | 187 | { |
| 188 | 188 | int offs; |
| 189 | 189 | |
| r1877 | r1878 | |
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | static void trojan_draw_sprites(running_machine *machine, | |
| 223 | static void trojan_draw_sprites(running_machine *machine, | |
| 224 | 224 | { |
| 225 | 225 | int offs; |
| 226 | 226 | |
| r1877 | r1878 | |
| 289 | 289 | |
| 290 | 290 | VIDEO_EOF( lwings ) |
| 291 | 291 | { |
| 292 | buffer_spriteram_w(0,0); | |
| 292 | buffer_spriteram_w(machine,0,0); | |
| 293 | 293 | } |
| r1877 | r1878 | |
|---|---|---|
| 308 | 308 | |
| 309 | 309 | |
| 310 | 310 | |
| 311 | static void draw_big_sprite( | |
| 311 | static void draw_big_sprite( | |
| 312 | 312 | { |
| 313 | 313 | int zoom; |
| 314 | 314 | |
| r1877 | r1878 | |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | |
| 352 | static void armwrest_draw_big_sprite( | |
| 352 | static void armwrest_draw_big_sprite( | |
| 353 | 353 | { |
| 354 | 354 | int zoom; |
| 355 | 355 | |
| r1877 | r1878 | |
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | static void drawbs2(running_machine *machine, | |
| 397 | static void drawbs2(running_machine *machine, | |
| 398 | 398 | { |
| 399 | 399 | int sx,sy; |
| 400 | 400 | int incxx; |
| r1877 | r1878 | |
|---|---|---|
| 162 | 162 | |
| 163 | 163 | ***************************************************************************/ |
| 164 | 164 | |
| 165 | static void draw_sprites(running_machine *machine, | |
| 165 | static void draw_sprites(running_machine *machine, | |
| 166 | 166 | { |
| 167 | 167 | int offs; |
| 168 | 168 | static const UINT8 layout[8][8] = |
| r1877 | r1878 | |
|---|---|---|
| 16 | 16 | * |
| 17 | 17 | *************************************/ |
| 18 | 18 | |
| 19 | static | |
| 19 | static | |
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | UINT16 *galpanic_bgvideoram,*galpanic_fgvideoram; |
| 6 | 6 | size_t galpanic_fgvideoram_size; |
| 7 | 7 | |
| 8 | static | |
| 8 | static | |
| 9 | 9 | |
| 10 | 10 | VIDEO_START( galpanic ) |
| 11 | 11 | { |
| r1877 | r1878 | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | static void comad_draw_sprites(running_machine *machine, | |
| 52 | static void comad_draw_sprites(running_machine *machine, | |
| 53 | 53 | { |
| 54 | 54 | int offs; |
| 55 | 55 | int sx=0, sy=0; |
| r1877 | r1878 | |
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | static void draw_fgbitmap( | |
| 89 | static void draw_fgbitmap( | |
| 90 | 90 | { |
| 91 | 91 | int offs; |
| 92 | 92 |
| r1877 | r1878 | |
|---|---|---|
| 90 | 90 | VIDEO_UPDATE( shuuz ) |
| 91 | 91 | { |
| 92 | 92 | struct atarimo_rect_list rectlist; |
| 93 | | |
| 93 | | |
| 94 | 94 | int x, y, r; |
| 95 | 95 | |
| 96 | 96 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 495 | 495 | } |
| 496 | 496 | |
| 497 | 497 | |
| 498 | static void draw_playfield( | |
| 498 | static void draw_playfield( | |
| 499 | 499 | { |
| 500 | 500 | int i; |
| 501 | 501 | |
| r1877 | r1878 | |
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 | |
| 512 | static void cclimber_draw_bigsprite( | |
| 512 | static void cclimber_draw_bigsprite( | |
| 513 | 513 | { |
| 514 | 514 | UINT8 x = cclimber_bigsprite_control[3] - 8; |
| 515 | 515 | UINT8 y = cclimber_bigsprite_control[2]; |
| r1877 | r1878 | |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | |
| 537 | static void toprollr_draw_bigsprite( | |
| 537 | static void toprollr_draw_bigsprite( | |
| 538 | 538 | { |
| 539 | 539 | UINT8 x = cclimber_bigsprite_control[3] - 8; |
| 540 | 540 | UINT8 y = cclimber_bigsprite_control[2]; |
| r1877 | r1878 | |
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | |
| 553 | static void cclimber_draw_sprites( | |
| 553 | static void cclimber_draw_sprites( | |
| 554 | 554 | { |
| 555 | 555 | int offs; |
| 556 | 556 | |
| r1877 | r1878 | |
| 587 | 587 | } |
| 588 | 588 | |
| 589 | 589 | |
| 590 | static void swimmer_draw_sprites( | |
| 590 | static void swimmer_draw_sprites( | |
| 591 | 591 | { |
| 592 | 592 | int offs; |
| 593 | 593 |
| r1877 | r1878 | |
|---|---|---|
| 91 | 91 | 1 | xxxx---- -------- | sprite color |
| 92 | 92 | */ |
| 93 | 93 | |
| 94 | static void draw_sprites(running_machine *machine, | |
| 94 | static void draw_sprites(running_machine *machine, | |
| 95 | 95 | { |
| 96 | 96 | int i; |
| 97 | 97 |
| r1877 | r1878 | |
|---|---|---|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| 61 | static void draw_sprites(running_machine *machine, | |
| 61 | static void draw_sprites(running_machine *machine, | |
| 62 | 62 | { |
| 63 | 63 | const gfx_element *gfx = machine->gfx[1]; |
| 64 | 64 | UINT8 *source = speedspn_vidram+ 0x1000; |
| r1877 | r1878 | |
|---|---|---|
| 184 | 184 | state_save_register_func_postload(set_current_bitmap_videoram_pointer); |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | static void draw_bitmap( | |
| 187 | static void draw_bitmap( | |
| 188 | 188 | { |
| 189 | 189 | int x, y; |
| 190 | 190 | |
| r1877 | r1878 | |
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | static void draw_sprites(running_machine *machine, | |
| 201 | static void draw_sprites(running_machine *machine, | |
| 202 | 202 | { |
| 203 | 203 | int offs; |
| 204 | 204 |
| r1877 | r1878 | |
|---|---|---|
| 21 | 21 | // defined in drivers/nwk-tr.c |
| 22 | 22 | int K001604_vh_start(running_machine *machine, int chip); |
| 23 | 23 | void K001604_tile_update(running_machine *machine, int chip); |
| 24 | void K001604_draw_front_layer(int chip, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 25 | void K001604_draw_back_layer(int chip, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 24 | void K001604_draw_front_layer(int chip, bitmap_t *bitmap, const rectangle *cliprect); | |
| 25 | void K001604_draw_back_layer(int chip, bitmap_t *bitmap, const rectangle *cliprect); | |
| 26 | 26 | |
| 27 | 27 | extern UINT8 gticlub_led_reg0; |
| 28 | 28 | extern UINT8 gticlub_led_reg1; |
| r1877 | r1878 | |
| 155 | 155 | static const int decode_y_zr107[16] = { 0, 8, 32, 40, 4, 12, 36, 44, 64, 72, 96, 104, 68, 76, 100, 108 }; |
| 156 | 156 | |
| 157 | 157 | static UINT32 K001005_status = 0; |
| 158 | static mame_bitmap *K001005_bitmap[2]; | |
| 159 | static mame_bitmap *K001005_zbuffer; | |
| 158 | static bitmap_t *K001005_bitmap[2]; | |
| 159 | static bitmap_t *K001005_zbuffer; | |
| 160 | 160 | static rectangle K001005_cliprect; |
| 161 | 161 | |
| 162 | 162 | static void render_polygons(void); |
| r1877 | r1878 | |
| 429 | 429 | static void draw_scanline(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid) |
| 430 | 430 | { |
| 431 | 431 | const poly_extra_data *extra = extradata; |
| 432 | | |
| 432 | | |
| 433 | 433 | float z = extent->param[0].start; |
| 434 | 434 | float dz = extent->param[0].dpdx; |
| 435 | 435 | UINT32 *fb = BITMAP_ADDR32(destmap, scanline, 0); |
| r1877 | r1878 | |
| 457 | 457 | static void draw_scanline_tex(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid) |
| 458 | 458 | { |
| 459 | 459 | const poly_extra_data *extra = extradata; |
| 460 | | |
| 460 | | |
| 461 | 461 | UINT8 *texrom = memory_region(REGION_GFX1) + (extra->texture_page * 0x40000); |
| 462 | 462 | int pal_chip = (extra->texture_palette & 0x8) ? 1 : 0; |
| 463 | 463 | int palette_index = (extra->texture_palette & 0x7) * 256; |
| r1877 | r1878 | |
| 911 | 911 | } |
| 912 | 912 | } |
| 913 | 913 | |
| 914 | void K001005_draw( | |
| 914 | void K001005_draw( | |
| 915 | 915 | { |
| 916 | 916 | int i, j; |
| 917 | 917 |
| r1877 | r1878 | |
|---|---|---|
| 220 | 220 | { |
| 221 | 221 | int i; |
| 222 | 222 | gfx_element *gfx0,*gfx1; |
| 223 | static const tile_get_info_c | |
| 223 | static const tile_get_info_func | |
| 224 | 224 | { tilemap_get_info0, tilemap_get_info1, tilemap_get_info2, tilemap_get_info3 }; |
| 225 | 225 | |
| 226 | 226 | for( i=0; i<NAMCONA1_NUM_TILEMAPS; i++ ) |
| r1877 | r1878 | |
| 249 | 249 | /*************************************************************************/ |
| 250 | 250 | |
| 251 | 251 | static void pdraw_masked_tile(running_machine *machine, |
| 252 | | |
| 252 | | |
| 253 | 253 | const rectangle *cliprect, |
| 254 | 254 | unsigned code, |
| 255 | 255 | int color, |
| r1877 | r1878 | |
| 387 | 387 | } /* pdraw_masked_tile */ |
| 388 | 388 | |
| 389 | 389 | static void pdraw_opaque_tile(running_machine *machine, |
| 390 | | |
| 390 | | |
| 391 | 391 | const rectangle *cliprect, |
| 392 | 392 | unsigned code, |
| 393 | 393 | int color, |
| r1877 | r1878 | |
| 460 | 460 | |
| 461 | 461 | static const UINT8 pri_mask[8] = { 0x00,0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f }; |
| 462 | 462 | |
| 463 | static void draw_sprites(running_machine *machine, | |
| 463 | static void draw_sprites(running_machine *machine, | |
| 464 | 464 | { |
| 465 | 465 | int which; |
| 466 | 466 | const UINT16 *source = spriteram16; |
| 467 | 467 | void (*drawtile)(running_machine *, |
| 468 | | |
| 468 | | |
| 469 | 469 | const rectangle *, |
| 470 | 470 | unsigned code, |
| 471 | 471 | int color, |
| r1877 | r1878 | |
| 557 | 557 | } /* next x */ |
| 558 | 558 | } /* draw_pixel_line */ |
| 559 | 559 | |
| 560 | static void draw_background(running_machine *machine, | |
| 560 | static void draw_background(running_machine *machine, | |
| 561 | 561 | { |
| 562 | 562 | /* scrollx lineselect |
| 563 | 563 | * tmap0 ffe000 ffe200 |
| r1877 | r1878 | |
|---|---|---|
| 33 | 33 | 8, 8, 32, 32); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | static void draw_sprites(running_machine *machine, | |
| 36 | static void draw_sprites(running_machine *machine, | |
| 37 | 37 | { |
| 38 | 38 | int motion; |
| 39 | 39 |
| r1877 | r1878 | |
|---|---|---|
| 228 | 228 | |
| 229 | 229 | ***************************************************************************/ |
| 230 | 230 | |
| 231 | static void draw_sprites(running_machine *machine, | |
| 231 | static void draw_sprites(running_machine *machine, | |
| 232 | 232 | { |
| 233 | 233 | int offs; |
| 234 | 234 | |
| r1877 | r1878 | |
| 351 | 351 | |
| 352 | 352 | VIDEO_EOF( armedf ) |
| 353 | 353 | { |
| 354 | buffer_spriteram16_w(0,0,0); | |
| 354 | buffer_spriteram16_w(machine,0,0,0); | |
| 355 | 355 | } |
| r1877 | r1878 | |
|---|---|---|
| 1 | void K001005_draw( | |
| 1 | void K001005_draw( | |
| 2 | 2 | void K001005_swap_buffers(void); |
| 3 | 3 | void K001005_init(void); |
| 4 | 4 | void K001005_preprocess_texture_data(UINT8 *rom, int length, int gticlub); |
| r1877 | r1878 | |
|---|---|---|
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "deprecat.h" | |
| 12 | 11 | #include "video/resnet.h" |
| 13 | 12 | #include "includes/dkong.h" |
| 14 | 13 | |
| r1877 | r1878 | |
| 472 | 471 | |
| 473 | 472 | WRITE8_HANDLER( dkong_videoram_w ) |
| 474 | 473 | { |
| 475 | dkong_state *state = | |
| 474 | dkong_state *state = machine->driver_data; | |
| 476 | 475 | |
| 477 | 476 | if (state->video_ram[offset] != data) |
| 478 | 477 | { |
| r1877 | r1878 | |
| 483 | 482 | |
| 484 | 483 | WRITE8_HANDLER( radarscp_snd02_w ) |
| 485 | 484 | { |
| 486 | dkong_state *state = | |
| 485 | dkong_state *state = machine->driver_data; | |
| 487 | 486 | |
| 488 | 487 | state->snd02_enable = data & 0x01; |
| 489 | 488 | } |
| 490 | 489 | |
| 491 | 490 | WRITE8_HANDLER( radarsc1_ansn_w ) |
| 492 | 491 | { |
| 493 | dkong_state *state = | |
| 492 | dkong_state *state = machine->driver_data; | |
| 494 | 493 | |
| 495 | 494 | state->sig_ansn = data & 0x01; |
| 496 | 495 | } |
| 497 | 496 | |
| 498 | 497 | WRITE8_HANDLER( dkongjr_gfxbank_w ) |
| 499 | 498 | { |
| 500 | dkong_state *state = | |
| 499 | dkong_state *state = machine->driver_data; | |
| 501 | 500 | |
| 502 | 501 | if (state->gfx_bank != (data & 0x01)) |
| 503 | 502 | { |
| r1877 | r1878 | |
| 508 | 507 | |
| 509 | 508 | WRITE8_HANDLER( dkong3_gfxbank_w ) |
| 510 | 509 | { |
| 511 | dkong_state *state = | |
| 510 | dkong_state *state = machine->driver_data; | |
| 512 | 511 | |
| 513 | 512 | if (state->gfx_bank != (~data & 0x01)) |
| 514 | 513 | { |
| r1877 | r1878 | |
| 519 | 518 | |
| 520 | 519 | WRITE8_HANDLER( dkong_palettebank_w ) |
| 521 | 520 | { |
| 522 | dkong_state *state = | |
| 521 | dkong_state *state = machine->driver_data; | |
| 523 | 522 | int newbank; |
| 524 | 523 | |
| 525 | 524 | newbank = state->palette_bank; |
| r1877 | r1878 | |
| 538 | 537 | |
| 539 | 538 | WRITE8_HANDLER( radarscp_grid_enable_w ) |
| 540 | 539 | { |
| 541 | dkong_state *state = | |
| 540 | dkong_state *state = machine->driver_data; | |
| 542 | 541 | |
| 543 | 542 | state->grid_on = data & 0x01; |
| 544 | 543 | } |
| 545 | 544 | |
| 546 | 545 | WRITE8_HANDLER( radarscp_grid_color_w ) |
| 547 | 546 | { |
| 548 | dkong_state *state = | |
| 547 | dkong_state *state = machine->driver_data; | |
| 549 | 548 | |
| 550 | 549 | state->grid_col = (data & 0x07) ^ 0x07; |
| 551 | 550 | //popmessage("Gridcol: %d", state->grid_col); |
| r1877 | r1878 | |
| 553 | 552 | |
| 554 | 553 | WRITE8_HANDLER( dkong_flipscreen_w ) |
| 555 | 554 | { |
| 556 | dkong_state *state = | |
| 555 | dkong_state *state = machine->driver_data; | |
| 557 | 556 | |
| 558 | 557 | state->flip = ~data & 0x01; |
| 559 | 558 | } |
| 560 | 559 | |
| 561 | 560 | WRITE8_HANDLER( dkong_spritebank_w ) |
| 562 | 561 | { |
| 563 | dkong_state *state = | |
| 562 | dkong_state *state = machine->driver_data; | |
| 564 | 563 | |
| 565 | 564 | state->sprite_bank = data & 0x01; |
| 566 | 565 | } |
| 567 | 566 | |
| 568 | 567 | /*************************************************************************** |
| 569 | 568 | |
| 570 | Draw the game screen in the given | |
| 569 | Draw the game screen in the given | |
| 571 | 570 | |
| 572 | 571 | ***************************************************************************/ |
| 573 | 572 | |
| 574 | static void draw_sprites(running_machine *machine, | |
| 573 | static void draw_sprites(running_machine *machine, | |
| 575 | 574 | { |
| 576 | 575 | dkong_state *state = machine->driver_data; |
| 577 | 576 | int offs; |
| r1877 | r1878 | |
| 699 | 698 | if (line_cnt>=512) |
| 700 | 699 | line_cnt=512-VTOTAL; |
| 701 | 700 | |
| 702 | if ( ( !(line_cnt & 0x40) && ((line_cnt+1) & 0x40) ) && (mame_rand( | |
| 701 | if ( ( !(line_cnt & 0x40) && ((line_cnt+1) & 0x40) ) && (mame_rand(machine) > RAND_MAX/2)) | |
| 703 | 702 | state->sig30Hz = (1-state->sig30Hz); |
| 704 | 703 | |
| 705 | 704 | state->rflip_sig = state->snd02_enable & state->sig30Hz; |
| r1877 | r1878 | |
| 762 | 761 | |
| 763 | 762 | } |
| 764 | 763 | |
| 765 | static void radarscp_draw_background(running_machine *machine, | |
| 764 | static void radarscp_draw_background(running_machine *machine, | |
| 766 | 765 | { |
| 767 | 766 | dkong_state *state = machine->driver_data; |
| 768 | 767 | const UINT8 *htable = NULL; |
| r1877 | r1878 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | static tilemap* playfield; |
| 11 | 11 | |
| 12 | static | |
| 12 | static | |
| 13 | 13 | |
| 14 | 14 | int sprint4_collision[4]; |
| 15 | 15 | |
| r1877 | r1878 | |
| 136 | 136 | |
| 137 | 137 | /* update sound status */ |
| 138 | 138 | |
| 139 | discrete_sound_w(SPRINT4_MOTOR_DATA_1, videoram[0x391] & 15); | |
| 140 | discrete_sound_w(SPRINT4_MOTOR_DATA_2, videoram[0x393] & 15); | |
| 141 | discrete_sound_w(SPRINT4_MOTOR_DATA_3, videoram[0x395] & 15); | |
| 142 | discrete_sound_w(SPRINT4_MOTOR_DATA_4, videoram[0x397] & 15); | |
| 139 | discrete_sound_w(machine, SPRINT4_MOTOR_DATA_1, videoram[0x391] & 15); | |
| 140 | discrete_sound_w(machine, SPRINT4_MOTOR_DATA_2, videoram[0x393] & 15); | |
| 141 | discrete_sound_w(machine, SPRINT4_MOTOR_DATA_3, videoram[0x395] & 15); | |
| 142 | discrete_sound_w(machine, SPRINT4_MOTOR_DATA_4, videoram[0x397] & 15); | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 |
| r1877 | r1878 | |
|---|---|---|
| 180 | 180 | WRITE8_HANDLER( appoooh_out_w ) |
| 181 | 181 | { |
| 182 | 182 | /* bit 0 controls NMI */ |
| 183 | interrupt_enable_w(0,data & 0x01); | |
| 183 | interrupt_enable_w(machine,0,data & 0x01); | |
| 184 | 184 | |
| 185 | 185 | /* bit 1 flip screen */ |
| 186 | 186 | flip_screen_set(data & 0x02); |
| r1877 | r1878 | |
| 203 | 203 | /* bit 7 unknown (used) */ |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | static void appoooh_draw_sprites( | |
| 206 | static void appoooh_draw_sprites( | |
| 207 | 207 | const rectangle *cliprect, |
| 208 | 208 | const gfx_element *gfx, |
| 209 | 209 | UINT8 *sprite) |
| r1877 | r1878 | |
| 236 | 236 | } |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | static void robowres_draw_sprites( | |
| 239 | static void robowres_draw_sprites( | |
| 240 | 240 | const rectangle *cliprect, |
| 241 | 241 | const gfx_element *gfx, |
| 242 | 242 | UINT8 *sprite) |
| r1877 | r1878 | |
|---|---|---|
| 12 | 12 | UINT8* skyraid_pos_ram; |
| 13 | 13 | UINT8* skyraid_obj_ram; |
| 14 | 14 | |
| 15 | static | |
| 15 | static | |
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | VIDEO_START( skyraid ) |
| r1877 | r1878 | |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| 24 | static void draw_text(running_machine *machine, | |
| 24 | static void draw_text(running_machine *machine, | |
| 25 | 25 | { |
| 26 | 26 | const UINT8* p = skyraid_alpha_num_ram; |
| 27 | 27 | |
| r1877 | r1878 | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
| 43 | static void draw_terrain( | |
| 43 | static void draw_terrain( | |
| 44 | 44 | { |
| 45 | 45 | const UINT8* p = memory_region(REGION_USER1); |
| 46 | 46 | |
| r1877 | r1878 | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
| 78 | static void draw_sprites(running_machine *machine, | |
| 78 | static void draw_sprites(running_machine *machine, | |
| 79 | 79 | { |
| 80 | 80 | int i; |
| 81 | 81 | |
| r1877 | r1878 | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
| 99 | static void draw_missiles(running_machine *machine, | |
| 99 | static void draw_missiles(running_machine *machine, | |
| 100 | 100 | { |
| 101 | 101 | int i; |
| 102 | 102 | |
| r1877 | r1878 | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | |
| 121 | static void draw_trapezoid( | |
| 121 | static void draw_trapezoid( | |
| 122 | 122 | { |
| 123 | 123 | const UINT8* p = memory_region(REGION_USER2); |
| 124 | 124 |
| r1877 | r1878 | |
|---|---|---|
| 290 | 290 | |
| 291 | 291 | ***************************************************************************/ |
| 292 | 292 | |
| 293 | static void draw_sprites(running_machine *machine, | |
| 293 | static void draw_sprites(running_machine *machine, | |
| 294 | 294 | { |
| 295 | 295 | int offs; |
| 296 | 296 | static const rectangle spritevisiblearea = |
| r1877 | r1878 | |
|---|---|---|
| 272 | 272 | #if defined( MAME_DEBUG ) |
| 273 | 273 | |
| 274 | 274 | #define DEBUG_COORDS ( 10 ) |
| 275 | static | |
| 275 | static | |
| 276 | 276 | static int m_b_debugclear; |
| 277 | 277 | static int m_b_debugmesh; |
| 278 | 278 | static int m_n_debugskip; |
| r1877 | r1878 | |
| 507 | 507 | #endif |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | static int DebugMeshDisplay( | |
| 510 | static int DebugMeshDisplay( | |
| 511 | 511 | { |
| 512 | 512 | if( m_b_debugmesh ) |
| 513 | 513 | { |
| r1877 | r1878 | |
| 517 | 517 | return m_b_debugmesh; |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | static int DebugTextureDisplay( | |
| 520 | static int DebugTextureDisplay( | |
| 521 | 521 | { |
| 522 | 522 | UINT32 n_y; |
| 523 | 523 | |
| r1877 | r1878 | |
| 3915 | 3915 | |
| 3916 | 3916 | void psx_gpu_reset( void ) |
| 3917 | 3917 | { |
| 3918 | psx_gpu_w( 1, 0, 0 ); | |
| 3918 | psx_gpu_w( Machine, 1, 0, 0 ); | |
| 3919 | 3919 | } |
| 3920 | 3920 | |
| 3921 | 3921 | void psx_lightgun_set( int n_x, int n_y ) |
| r1877 | r1878 | |
|---|---|---|
| 172 | 172 | |
| 173 | 173 | ***************************************************************************/ |
| 174 | 174 | |
| 175 | static void draw_sprites(running_machine *machine, | |
| 175 | static void draw_sprites(running_machine *machine, | |
| 176 | 176 | { |
| 177 | 177 | gfx_element *gfx = machine->gfx[0]; |
| 178 | 178 | int offs; |
| r1877 | r1878 | |
|---|---|---|
| 8 | 8 | INTERRUPT_GEN( beezer_interrupt ) |
| 9 | 9 | { |
| 10 | 10 | scanline = (scanline + 1) % 0x80; |
| 11 | via_0_ca2_w (0, scanline & 0x10); | |
| 11 | via_0_ca2_w (machine, 0, scanline & 0x10); | |
| 12 | 12 | if ((scanline & 0x78) == 0x78) |
| 13 | 13 | cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); |
| 14 | 14 | else |
| r1877 | r1878 | |
|---|---|---|
| 47 | 47 | pair vce_address; /* Current address in the palette */ |
| 48 | 48 | pair vce_data[512]; /* Palette data */ |
| 49 | 49 | int current_bitmap_line; /* The current line in the display we are on */ |
| 50 | | |
| 50 | | |
| 51 | 51 | }VCE; |
| 52 | 52 | |
| 53 | 53 | typedef struct { |
| r1877 | r1878 | |
| 78 | 78 | static void pce_refresh_line(int which, int line, int external_input, UINT8 *drawn, UINT16 *line_buffer); |
| 79 | 79 | static void pce_refresh_sprites(running_machine *machine, int which, int line, UINT8 *drawn, UINT16 *line_buffer); |
| 80 | 80 | static void vdc_do_dma(int which); |
| 81 | static void vpc_init( | |
| 81 | static void vpc_init( running_machine *machine ); | |
| 82 | 82 | |
| 83 | 83 | INTERRUPT_GEN( pce_interrupt ) |
| 84 | 84 | { |
| r1877 | r1878 | |
| 366 | 366 | vdc[0].inc = 1; |
| 367 | 367 | vdc[1].inc = 1; |
| 368 | 368 | |
| 369 | vpc_init(); | |
| 369 | vpc_init(machine); | |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | |
| r1877 | r1878 | |
| 1069 | 1069 | return data; |
| 1070 | 1070 | } |
| 1071 | 1071 | |
| 1072 | static void vpc_init( void ) { | |
| 1073 | vpc_w( 0, 0x11 ); | |
| 1074 | vpc_w( 1, 0x11 ); | |
| 1072 | static void vpc_init( running_machine *machine ) { | |
| 1073 | vpc_w( machine, 0, 0x11 ); | |
| 1074 | vpc_w( machine, 1, 0x11 ); | |
| 1075 | 1075 | vpc.window1.w = 0; |
| 1076 | 1076 | vpc.window2.w = 0; |
| 1077 | 1077 | vpc.vdc_select = 0; |
| r1877 | r1878 | |
| 1079 | 1079 | |
| 1080 | 1080 | WRITE8_HANDLER( sgx_vdc_w ) { |
| 1081 | 1081 | if ( vpc.vdc_select ) { |
| 1082 | vdc_1_w( offset, data ); | |
| 1082 | vdc_1_w( machine, offset, data ); | |
| 1083 | 1083 | } else { |
| 1084 | vdc_0_w( offset, data ); | |
| 1084 | vdc_0_w( machine, offset, data ); | |
| 1085 | 1085 | } |
| 1086 | 1086 | } |
| 1087 | 1087 | |
| 1088 | 1088 | READ8_HANDLER( sgx_vdc_r ) { |
| 1089 | return ( vpc.vdc_select ) ? vdc_1_r( offset ) : vdc_0_r( offset ); | |
| 1089 | return ( vpc.vdc_select ) ? vdc_1_r( machine, offset ) : vdc_0_r( machine, offset ); | |
| 1090 | 1090 | } |
| 1091 | 1091 |
| r1877 | r1878 | |
|---|---|---|
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | UINT16 *kaneko16_bg15_select, *kaneko16_bg15_reg; |
| 59 | static mame_bitmap *kaneko16_bg15_bitmap; | |
| 60 | static mame_bitmap *sprites_bitmap; /* bitmap used for to keep sprites on screen (mgcrystl 1st boss) */ | |
| 59 | static bitmap_t *kaneko16_bg15_bitmap; | |
| 60 | static bitmap_t *sprites_bitmap; /* bitmap used for to keep sprites on screen (mgcrystl 1st boss) */ | |
| 61 | 61 | |
| 62 | 62 | struct tempsprite |
| 63 | 63 | { |
| r1877 | r1878 | |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | // custom function to draw a single sprite. needed to keep correct sprites - sprites and sprites - tilemaps priorities |
| 394 | static void kaneko16_draw_sprites_custom(running_machine *machine, | |
| 394 | static void kaneko16_draw_sprites_custom(running_machine *machine, | |
| 395 | 395 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 396 | 396 | const rectangle *clip,int priority) |
| 397 | 397 | { |
| r1877 | r1878 | |
| 491 | 491 | |
| 492 | 492 | /* Build a list of sprites to display & draw them */ |
| 493 | 493 | |
| 494 | void kaneko16_draw_sprites(running_machine *machine, | |
| 494 | void kaneko16_draw_sprites(running_machine *machine, | |
| 495 | 495 | { |
| 496 | 496 | /* Sprites *must* be parsed from the first in RAM to the last, |
| 497 | 497 | because of the multisprite feature. But they *must* be drawn |
| r1877 | r1878 | |
| 802 | 802 | |
| 803 | 803 | ***************************************************************************/ |
| 804 | 804 | |
| 805 | static void kaneko16_prepare_first_tilemap_chip(running_machine *machine, | |
| 805 | static void kaneko16_prepare_first_tilemap_chip(running_machine *machine, | |
| 806 | 806 | { |
| 807 | 807 | /* Set Up FIRST Tilemap chip */ |
| 808 | 808 | int layers_flip_0; |
| r1877 | r1878 | |
| 842 | 842 | |
| 843 | 843 | } |
| 844 | 844 | |
| 845 | static void kaneko16_prepare_second_tilemap_chip(running_machine *machine, | |
| 845 | static void kaneko16_prepare_second_tilemap_chip(running_machine *machine, | |
| 846 | 846 | { |
| 847 | 847 | /* Set Up SECOND Tilemap chip */ |
| 848 | 848 | int layers_flip_1 = 0; |
| r1877 | r1878 | |
| 881 | 881 | } |
| 882 | 882 | } |
| 883 | 883 | |
| 884 | static void kaneko16_render_first_tilemap_chip(running_machine *machine, | |
| 884 | static void kaneko16_render_first_tilemap_chip(running_machine *machine, | |
| 885 | 885 | { |
| 886 | 886 | tilemap_draw_primask(bitmap,cliprect, kaneko16_tmap_0, pri, pri, 0); |
| 887 | 887 | tilemap_draw_primask(bitmap,cliprect, kaneko16_tmap_1, pri, pri, 0); |
| 888 | 888 | } |
| 889 | 889 | |
| 890 | static void kaneko16_render_second_tilemap_chip(running_machine *machine, | |
| 890 | static void kaneko16_render_second_tilemap_chip(running_machine *machine, | |
| 891 | 891 | { |
| 892 | 892 | if (kaneko16_tmap_2) |
| 893 | 893 | { |
| r1877 | r1878 | |
| 896 | 896 | } |
| 897 | 897 | } |
| 898 | 898 | |
| 899 | static void kaneko16_render_sprites(running_machine *machine, | |
| 899 | static void kaneko16_render_sprites(running_machine *machine, | |
| 900 | 900 | { |
| 901 | 901 | /* Sprites last (rendered with pdrawgfx, so they can slip |
| 902 | 902 | in between the layers) */ |
| r1877 | r1878 | |
| 914 | 914 | } |
| 915 | 915 | } |
| 916 | 916 | |
| 917 | static void kaneko16_render_15bpp_bitmap(running_machine *machine, | |
| 917 | static void kaneko16_render_15bpp_bitmap(running_machine *machine, | |
| 918 | 918 | { |
| 919 | 919 | if (kaneko16_bg15_bitmap) |
| 920 | 920 | { |
| r1877 | r1878 | |
| 934 | 934 | } |
| 935 | 935 | } |
| 936 | 936 | |
| 937 | static void kaneko16_fill_bitmap(running_machine *machine, | |
| 937 | static void kaneko16_fill_bitmap(running_machine *machine, | |
| 938 | 938 | { |
| 939 | 939 | if(kaneko16_sprite_type == 1) |
| 940 | 940 | fillbitmap(bitmap,0x7f00,cliprect); |
| r1877 | r1878 | |
|---|---|---|
| 14 | 14 | size_t goldstar_video_size; |
| 15 | 15 | UINT8 *goldstar_scroll1, *goldstar_scroll2, *goldstar_scroll3; |
| 16 | 16 | |
| 17 | static | |
| 17 | static | |
| 18 | 18 | static int bgcolor; |
| 19 | 19 | |
| 20 | 20 |
| r1877 | r1878 | |
|---|---|---|
| 172 | 172 | { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 } |
| 173 | 173 | }; |
| 174 | 174 | |
| 175 | static void draw_sprite_16x16(running_machine *machine, | |
| 175 | static void draw_sprite_16x16(running_machine *machine, | |
| 176 | 176 | int sx, int sy, int bank, int flags ) { |
| 177 | 177 | WC90_DRAW_SPRITE( code, sx, sy ); |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | static void draw_sprite_16x32(running_machine *machine, | |
| 180 | static void draw_sprite_16x32(running_machine *machine, | |
| 181 | 181 | int sx, int sy, int bank, int flags ) { |
| 182 | 182 | if ( bank & 2 ) { |
| 183 | 183 | WC90_DRAW_SPRITE( code+1, sx, sy+16 ); |
| r1877 | r1878 | |
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | static void draw_sprite_16x64(running_machine *machine, | |
| 191 | static void draw_sprite_16x64(running_machine *machine, | |
| 192 | 192 | int sx, int sy, int bank, int flags ) { |
| 193 | 193 | if ( bank & 2 ) { |
| 194 | 194 | WC90_DRAW_SPRITE( code+3, sx, sy+48 ); |
| r1877 | r1878 | |
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | static void draw_sprite_32x16(running_machine *machine, | |
| 206 | static void draw_sprite_32x16(running_machine *machine, | |
| 207 | 207 | int sx, int sy, int bank, int flags ) { |
| 208 | 208 | if ( bank & 1 ) { |
| 209 | 209 | WC90_DRAW_SPRITE( code+1, sx+16, sy ); |
| r1877 | r1878 | |
| 214 | 214 | } |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | static void draw_sprite_32x32(running_machine *machine, | |
| 217 | static void draw_sprite_32x32(running_machine *machine, | |
| 218 | 218 | int sx, int sy, int bank, int flags ) { |
| 219 | 219 | |
| 220 | 220 | const char *p = p32x32[ bank&3 ]; |
| r1877 | r1878 | |
| 225 | 225 | WC90_DRAW_SPRITE( code+p[3], sx+16, sy+16 ); |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | static void draw_sprite_32x64(running_machine *machine, | |
| 228 | static void draw_sprite_32x64(running_machine *machine, | |
| 229 | 229 | int sx, int sy, int bank, int flags ) { |
| 230 | 230 | |
| 231 | 231 | const char *p = p32x64[ bank&3 ]; |
| r1877 | r1878 | |
| 240 | 240 | WC90_DRAW_SPRITE( code+p[7], sx+16, sy+48 ); |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | static void draw_sprite_64x16(running_machine *machine, | |
| 243 | static void draw_sprite_64x16(running_machine *machine, | |
| 244 | 244 | int sx, int sy, int bank, int flags ) { |
| 245 | 245 | if ( bank & 1 ) { |
| 246 | 246 | WC90_DRAW_SPRITE( code+3, sx+48, sy ); |
| r1877 | r1878 | |
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | static void draw_sprite_64x32(running_machine *machine, | |
| 258 | static void draw_sprite_64x32(running_machine *machine, | |
| 259 | 259 | int sx, int sy, int bank, int flags ) { |
| 260 | 260 | |
| 261 | 261 | const char *p = p64x32[ bank&3 ]; |
| r1877 | r1878 | |
| 270 | 270 | WC90_DRAW_SPRITE( code+p[7], sx+48, sy+16 ); |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | static void draw_sprite_64x64(running_machine *machine, | |
| 273 | static void draw_sprite_64x64(running_machine *machine, | |
| 274 | 274 | int sx, int sy, int bank, int flags ) { |
| 275 | 275 | |
| 276 | 276 | const char *p = p64x64[ bank&3 ]; |
| r1877 | r1878 | |
| 294 | 294 | WC90_DRAW_SPRITE( code+p[15], sx+48, sy+48 ); |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | static void draw_sprite_invalid(running_machine *machine, | |
| 297 | static void draw_sprite_invalid(running_machine *machine, | |
| 298 | 298 | int sx, int sy, int bank, int flags ) { |
| 299 | 299 | logerror("8 pixel sprite size not supported\n" ); |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | typedef void (*draw_sprites_ | |
| 302 | typedef void (*draw_sprites_ | |
| 303 | 303 | |
| 304 | static const draw_sprites_ | |
| 304 | static const draw_sprites_ | |
| 305 | 305 | draw_sprite_invalid, /* 0000 = 08x08 */ |
| 306 | 306 | draw_sprite_invalid, /* 0001 = 16x08 */ |
| 307 | 307 | draw_sprite_invalid, /* 0010 = 32x08 */ |
| r1877 | r1878 | |
| 320 | 320 | draw_sprite_64x64 /* 1111 = 64x64 */ |
| 321 | 321 | }; |
| 322 | 322 | |
| 323 | static void draw_sprites(running_machine *machine, | |
| 323 | static void draw_sprites(running_machine *machine, | |
| 324 | 324 | { |
| 325 | 325 | int offs, sx,sy, flags, which; |
| 326 | 326 |
| r1877 | r1878 | |
|---|---|---|
| 190 | 190 | VIDEO_UPDATE( gauntlet ) |
| 191 | 191 | { |
| 192 | 192 | struct atarimo_rect_list rectlist; |
| 193 | | |
| 193 | | |
| 194 | 194 | int x, y, r; |
| 195 | 195 | |
| 196 | 196 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 239 | 239 | |
| 240 | 240 | /* SPRITES based on tetrisp2 for now, readd priority bits later */ |
| 241 | 241 | |
| 242 | static void draw_sprites(running_machine *machine, | |
| 242 | static void draw_sprites(running_machine *machine, | |
| 243 | 243 | { |
| 244 | 244 | /*************************************************************************** |
| 245 | 245 | |
| r1877 | r1878 | |
| 379 | 379 | |
| 380 | 380 | |
| 381 | 381 | |
| 382 | static void draw_roz( | |
| 382 | static void draw_roz( | |
| 383 | 383 | { |
| 384 | 384 | /* TODO: registers 0x40/4 / 0x44/4 and 0x50/4 / 0x54/4 are used, meaning unknown */ |
| 385 | 385 |
| r1877 | r1878 | |
|---|---|---|
| 164 | 164 | |
| 165 | 165 | /******************************************************************************/ |
| 166 | 166 | |
| 167 | static void draw_sprites(running_machine* machine, | |
| 167 | static void draw_sprites(running_machine* machine, | |
| 168 | 168 | { |
| 169 | 169 | int offs; |
| 170 | 170 | |
| r1877 | r1878 | |
| 179 | 179 | x = buffered_spriteram16[offs+2]; |
| 180 | 180 | |
| 181 | 181 | flash=y&0x1000; |
| 182 | if (flash && ( | |
| 182 | if (flash && (vid | |
| 183 | 183 | |
| 184 | 184 | colour = (x >> 9) &0x1f; |
| 185 | 185 | |
| r1877 | r1878 | |
| 251 | 251 | |
| 252 | 252 | WRITE16_HANDLER( darkseal_pf3b_data_w ) /* Mirror */ |
| 253 | 253 | { |
| 254 | darkseal_pf3_data_w(offset+0x800,data,mem_mask); | |
| 254 | darkseal_pf3_data_w(machine,offset+0x800,data,mem_mask); | |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | WRITE16_HANDLER( darkseal_control_0_w ) |
| r1877 | r1878 | |
|---|---|---|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| 59 | static void do_pen_lookup(const _20pacgal_state *state, | |
| 59 | static void do_pen_lookup(const _20pacgal_state *state, | |
| 60 | 60 | { |
| 61 | 61 | int y, x; |
| 62 | 62 | pen_t pens[NUM_PENS]; |
| r1877 | r1878 | |
| 76 | 76 | * |
| 77 | 77 | *************************************/ |
| 78 | 78 | |
| 79 | static void draw_sprite(const _20pacgal_state *state, | |
| 79 | static void draw_sprite(const _20pacgal_state *state, | |
| 80 | 80 | UINT8 code, UINT8 color, int flip_y, int flip_x) |
| 81 | 81 | { |
| 82 | 82 | int sy; |
| r1877 | r1878 | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | |
| 148 | static void draw_sprites(const _20pacgal_state *state, | |
| 148 | static void draw_sprites(const _20pacgal_state *state, | |
| 149 | 149 | { |
| 150 | 150 | int offs; |
| 151 | 151 | |
| r1877 | r1878 | |
| 197 | 197 | * |
| 198 | 198 | *************************************/ |
| 199 | 199 | |
| 200 | static void draw_chars(const _20pacgal_state *state, | |
| 200 | static void draw_chars(const _20pacgal_state *state, | |
| 201 | 201 | { |
| 202 | 202 | offs_t offs; |
| 203 | 203 |
| r1877 | r1878 | |
|---|---|---|
| 93 | 93 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | static void draw_sprites(running_machine *machine, | |
| 96 | static void draw_sprites(running_machine *machine, | |
| 97 | 97 | { |
| 98 | 98 | int offs; |
| 99 | 99 |
| r1877 | r1878 | |
|---|---|---|
| 4 | 4 | #include "driver.h" |
| 5 | 5 | |
| 6 | 6 | extern UINT16 *spbactn_bgvideoram, *spbactn_fgvideoram, *spbactn_spvideoram; |
| 7 | static | |
| 7 | static | |
| 8 | 8 | |
| 9 | 9 | /* mix & blend the paletted 16-bit tile and sprite bitmaps into an RGB 32-bit bitmap */ |
| 10 | 10 | static void blendbitmaps(running_machine *machine, |
| 11 | | |
| 11 | | |
| 12 | 12 | int sx,int sy,const rectangle *clip) |
| 13 | 13 | { |
| 14 | 14 | int ox; |
| r1877 | r1878 | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /* from gals pinball (which was in turn from ninja gaiden) */ |
| 106 | static int draw_sprites(running_machine *machine, | |
| 106 | static int draw_sprites(running_machine *machine, | |
| 107 | 107 | { |
| 108 | 108 | static const UINT8 layout[8][8] = |
| 109 | 109 | { |
| r1877 | r1878 | |
|---|---|---|
| 94 | 94 | #include "video/resnet.h" |
| 95 | 95 | |
| 96 | 96 | /* video/segac2.c */ |
| 97 | extern void update_system18_vdp( | |
| 97 | extern void update_system18_vdp( | |
| 98 | 98 | extern void start_system18_vdp(void); |
| 99 | 99 | extern READ16_HANDLER( segac2_vdp_r ); |
| 100 | 100 | extern WRITE16_HANDLER( segac2_vdp_w ); |
| r1877 | r1878 | |
| 198 | 198 | */ |
| 199 | 199 | |
| 200 | 200 | static void draw_sprite(running_machine *machine, |
| 201 | | |
| 201 | | |
| 202 | 202 | const rectangle *cliprect, |
| 203 | 203 | const UINT8 *addr, int pitch, |
| 204 | 204 | pen_t pen_base, |
| r1877 | r1878 | |
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | static void draw_sprites(running_machine *machine, | |
| 341 | static void draw_sprites(running_machine *machine, | |
| 342 | 342 | { |
| 343 | 343 | pen_t pen_base = machine->gfx[0]->color_base; |
| 344 | 344 | const UINT8 *base_gfx = memory_region(REGION_GFX2); |
| r1877 | r1878 | |
|---|---|---|
| 29 | 29 | gfx_element gfxelement[MAX_GFX_ELEMENTS]; /* local copy of graphics elements */ |
| 30 | 30 | int gfxgranularity[MAX_GFX_ELEMENTS]; |
| 31 | 31 | |
| 32 | | |
| 32 | | |
| 33 | 33 | |
| 34 | 34 | int linked; /* are the entries linked? */ |
| 35 | 35 | int split; /* are entries split or together? */ |
| r1877 | r1878 | |
| 84 | 84 | |
| 85 | 85 | struct atarimo_mask specialmask; /* mask for the special value */ |
| 86 | 86 | int specialvalue; /* resulting value to indicate "special" */ |
| 87 | atarimo_special_c | |
| 87 | atarimo_special_func | |
| 88 | 88 | int codehighshift; /* shift count for the upper code */ |
| 89 | 89 | |
| 90 | 90 | struct atarimo_entry *spriteram; /* pointer to sprite RAM */ |
| r1877 | r1878 | |
| 646 | 646 | destination bitmap. |
| 647 | 647 | ---------------------------------------------------------------*/ |
| 648 | 648 | |
| 649 | ||
| 649 | ||
| 650 | 650 | { |
| 651 | 651 | struct atarimo_data *mo = &atarimo[map]; |
| 652 | 652 | int startband, stopband, band, i; |
| r1877 | r1878 | |
| 754 | 754 | { |
| 755 | 755 | int gfxindex = mo->gfxlookup[EXTRACT_DATA(entry, mo->gfxmask)]; |
| 756 | 756 | const gfx_element *gfx = &mo->gfxelement[gfxindex]; |
| 757 | | |
| 757 | | |
| 758 | 758 | int x, y, sx, sy; |
| 759 | 759 | |
| 760 | 760 | /* extract data from the various words */ |
| r1877 | r1878 | |
|---|---|---|
| 202 | 202 | * c | ---------------- | zoomy like in System 16? |
| 203 | 203 | * e | ---------------- | |
| 204 | 204 | */ |
| 205 | static void draw_sprites( | |
| 205 | static void draw_sprites( | |
| 206 | 206 | { |
| 207 | 207 | int offs; |
| 208 | 208 |
| r1877 | r1878 | |
|---|---|---|
| 32 | 32 | ##########################################################################*/ |
| 33 | 33 | |
| 34 | 34 | /* callback for special processing */ |
| 35 | typedef int (*atarimo_special_c | |
| 35 | typedef int (*atarimo_special_func | |
| 36 | 36 | |
| 37 | 37 | /* description for a four-word mask */ |
| 38 | 38 | struct atarimo_entry |
| r1877 | r1878 | |
| 75 | 75 | |
| 76 | 76 | struct atarimo_entry specialmask; /* mask for the special value */ |
| 77 | 77 | UINT16 specialvalue; /* resulting value to indicate "special" */ |
| 78 | atarimo_special_c | |
| 78 | atarimo_special_func | |
| 79 | 79 | }; |
| 80 | 80 | |
| 81 | 81 | /* rectangle list */ |
| r1877 | r1878 | |
| 97 | 97 | UINT8 *atarimo_get_gfx_lookup(int map, int *size); |
| 98 | 98 | |
| 99 | 99 | /* core processing */ |
| 100 | ||
| 100 | ||
| 101 | 101 | |
| 102 | 102 | /* atrribute setters */ |
| 103 | 103 | void atarimo_set_bank(int map, int bank); |
| r1877 | r1878 | |
|---|---|---|
| 189 | 189 | * |
| 190 | 190 | *************************************/ |
| 191 | 191 | |
| 192 | static void mcr3_update_sprites(running_machine *machine, | |
| 192 | static void mcr3_update_sprites(running_machine *machine, | |
| 193 | 193 | { |
| 194 | 194 | int offs; |
| 195 | 195 |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "deprecat.h" | |
| 14 | 13 | |
| 15 | 14 | UINT16 *stadhero_pf1_data; |
| 16 | 15 | static UINT16 *stadhero_pf2_data; |
| r1877 | r1878 | |
| 21 | 20 | |
| 22 | 21 | /******************************************************************************/ |
| 23 | 22 | |
| 24 | static void draw_sprites(running_machine *machine, | |
| 23 | static void draw_sprites(running_machine *machine, | |
| 25 | 24 | { |
| 26 | 25 | int offs; |
| 27 | 26 | |
| r1877 | r1878 | |
| 37 | 36 | if ((colour & pri_mask) != pri_val) continue; |
| 38 | 37 | |
| 39 | 38 | flash=x&0x800; |
| 40 | if (flash && ( | |
| 39 | if (flash && (vid | |
| 41 | 40 | |
| 42 | 41 | fx = y & 0x2000; |
| 43 | 42 | fy = y & 0x4000; |
| r1877 | r1878 | |
|---|---|---|
| 110 | 110 | state_save_register_global(invert_controls); |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | static void draw_sprites(running_machine *machine, | |
| 113 | static void draw_sprites(running_machine *machine, | |
| 114 | 114 | { |
| 115 | 115 | int offs; |
| 116 | 116 |
| r1877 | r1878 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | static READ8_HANDLER( simpsons_K052109_r ) |
| 61 | 61 | { |
| 62 | return K052109_r(offset + 0x2000); | |
| 62 | return K052109_r(machine,offset + 0x2000); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | static WRITE8_HANDLER( simpsons_K052109_w ) |
| 66 | 66 | { |
| 67 | K052109_w(offset + 0x2000,data); | |
| 67 | K052109_w(machine,offset + 0x2000,data); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | static READ8_HANDLER( simpsons_K053247_r ) |
| r1877 | r1878 | |
|---|---|---|
| 230 | 230 | ** |
| 231 | 231 | ***************************************************************************/ |
| 232 | 232 | |
| 233 | static void draw_status(running_machine *machine, | |
| 233 | static void draw_status(running_machine *machine, | |
| 234 | 234 | { |
| 235 | 235 | const UINT8 *base = videoram+0x400; |
| 236 | 236 | const gfx_element *gfx = machine->gfx[0]; |
| r1877 | r1878 | |
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | static void draw_sprites(running_machine *machine, | |
| 264 | static void draw_sprites(running_machine *machine, | |
| 265 | 265 | int priority, UINT8 sprite_partition ) |
| 266 | 266 | { |
| 267 | 267 | const gfx_element *gfx = machine->gfx[3]; |
| r1877 | r1878 | |
| 406 | 406 | if( scroll_attributes & 1 ) sprite_scrollx += 256; |
| 407 | 407 | if( scroll_attributes & 2 ) fg_scrollx += 256; |
| 408 | 408 | |
| 409 | marvins_palette_bank_w(0, program_read_byte(0xc800+madcrash_vreg)); | |
| 409 | marvins_palette_bank_w(machine, 0, program_read_byte(0xc800+madcrash_vreg)); | |
| 410 | 410 | update_palette(machine, 1); |
| 411 | 411 | |
| 412 | 412 | if( flipscreen != (attributes&0x80) ) |
| r1877 | r1878 | |
|---|---|---|
| 106 | 106 | sprite colour marking could probably be improved.. |
| 107 | 107 | *******************************************************************************/ |
| 108 | 108 | |
| 109 | static void draw_sprites(running_machine *machine, | |
| 109 | static void draw_sprites(running_machine *machine, | |
| 110 | 110 | { |
| 111 | 111 | /*- SPR RAM Format -** |
| 112 | 112 |
| r1877 | r1878 | |
|---|---|---|
| 351 | 351 | |
| 352 | 352 | ***************************************************************************/ |
| 353 | 353 | |
| 354 | static void draw_road( | |
| 354 | static void draw_road( | |
| 355 | 355 | { |
| 356 | 356 | const UINT8 *road_control = memory_region(REGION_GFX5); |
| 357 | 357 | const UINT8 *road_bits1 = memory_region(REGION_GFX5) + 0x2000; |
| r1877 | r1878 | |
| 426 | 426 | } |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | static void zoom_sprite(running_machine *machine, | |
| 429 | static void zoom_sprite(running_machine *machine, | |
| 430 | 430 | UINT32 code,UINT32 color,int flipx,int sx,int sy, |
| 431 | 431 | int sizex,int sizey) |
| 432 | 432 | { |
| r1877 | r1878 | |
| 477 | 477 | } |
| 478 | 478 | } |
| 479 | 479 | |
| 480 | static void draw_sprites(running_machine *machine, | |
| 480 | static void draw_sprites(running_machine *machine, | |
| 481 | 481 | { |
| 482 | 482 | UINT16 *posmem = &polepos_sprite16_memory[0x380]; |
| 483 | 483 | UINT16 *sizmem = &polepos_sprite16_memory[0x780]; |
| r1877 | r1878 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 3 | 2 | #include "video/segaic24.h" |
| 4 | 3 | |
| 5 | 4 | #define LOG_TGP_VIDEO 0 |
| r1877 | r1878 | |
| 142 | 141 | } |
| 143 | 142 | |
| 144 | 143 | |
| 145 | static void draw_hline( | |
| 144 | static void draw_hline( | |
| 146 | 145 | { |
| 147 | 146 | UINT16 *base = BITMAP_ADDR16(bitmap, y, 0); |
| 148 | 147 | while(x1 <= x2) { |
| r1877 | r1878 | |
| 151 | 150 | } |
| 152 | 151 | } |
| 153 | 152 | |
| 154 | static void draw_hline_moired( | |
| 153 | static void draw_hline_moired( | |
| 155 | 154 | { |
| 156 | 155 | UINT16 *base = BITMAP_ADDR16(bitmap, y, 0); |
| 157 | 156 | while(x1 <= x2) { |
| r1877 | r1878 | |
| 161 | 160 | } |
| 162 | 161 | } |
| 163 | 162 | |
| 164 | static void fill_slope( | |
| 163 | static void fill_slope( | |
| 165 | 164 | { |
| 166 | 165 | if(y1 > view.y2) |
| 167 | 166 | return; |
| r1877 | r1878 | |
| 221 | 220 | *nx2 = x2; |
| 222 | 221 | } |
| 223 | 222 | |
| 224 | static void fill_line( | |
| 223 | static void fill_line( | |
| 225 | 224 | { |
| 226 | 225 | int xx1 = x1>>FRAC_SHIFT; |
| 227 | 226 | int xx2 = x2>>FRAC_SHIFT; |
| r1877 | r1878 | |
| 242 | 241 | } |
| 243 | 242 | } |
| 244 | 243 | |
| 245 | static void fill_quad( | |
| 244 | static void fill_quad( | |
| 246 | 245 | { |
| 247 | 246 | INT32 sl1, sl2, cury, limy, x1, x2; |
| 248 | 247 | int pmin, pmax, i, ps1, ps2; |
| r1877 | r1878 | |
| 343 | 342 | fill_line(bitmap, color, cury, x1, x2); |
| 344 | 343 | } |
| 345 | 344 | #if 0 |
| 346 | static void draw_line( | |
| 345 | static void draw_line( | |
| 347 | 346 | { |
| 348 | 347 | int s1x, s1y, s2x, s2y; |
| 349 | 348 | int d1, d2; |
| r1877 | r1878 | |
| 440 | 439 | } |
| 441 | 440 | |
| 442 | 441 | |
| 443 | static void draw_quads( | |
| 442 | static void draw_quads( | |
| 444 | 443 | { |
| 445 | 444 | int count = quadpt - quaddb; |
| 446 | 445 | int i; |
| r1877 | r1878 | |
| 694 | 693 | return m; |
| 695 | 694 | } |
| 696 | 695 | |
| 696 | #ifdef UNUSED_DEFINITION | |
| 697 | 697 | static const UINT8 num_of_times[]={1,1,1,1,2,2,2,3}; |
| 698 | #endif | |
| 698 | 699 | static float compute_specular(struct vector *normal, struct vector *light,float diffuse,int lmode) |
| 699 | 700 | { |
| 700 | 701 | #if 0 |
| r1877 | r1878 | |
| 1108 | 1109 | return list+2; |
| 1109 | 1110 | } |
| 1110 | 1111 | |
| 1111 | static void draw_objects( | |
| 1112 | static void draw_objects( | |
| 1112 | 1113 | { |
| 1113 | 1114 | if(quadpt != quaddb) { |
| 1114 | 1115 | LOG_TGP(("VIDEO: sort&draw\n")); |
| r1877 | r1878 | |
| 1120 | 1121 | pointpt = pointdb; |
| 1121 | 1122 | } |
| 1122 | 1123 | |
| 1123 | static UINT16 *draw_direct(UINT16 *list, | |
| 1124 | static UINT16 *draw_direct(UINT16 *list, | |
| 1124 | 1125 | { |
| 1125 | 1126 | UINT16 *res; |
| 1126 | 1127 | |
| r1877 | r1878 | |
| 1152 | 1153 | |
| 1153 | 1154 | static void end_frame(void) |
| 1154 | 1155 | { |
| 1155 | if((listctl[0] & 4) && ( | |
| 1156 | if((listctl[0] & 4) && (vid | |
| 1156 | 1157 | listctl[0] ^= 0x40; |
| 1157 | 1158 | } |
| 1158 | 1159 | |
| r1877 | r1878 | |
| 1170 | 1171 | LOG_TGP(("VIDEO: control=%08x\n", (listctl[1]<<16)|listctl[0])); |
| 1171 | 1172 | } |
| 1172 | 1173 | |
| 1173 | static void tgp_render( | |
| 1174 | static void tgp_render( | |
| 1174 | 1175 | { |
| 1175 | 1176 | render_done = 1; |
| 1176 | 1177 | if((listctl[1] & 0x1f) == 0x1f) { |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | *******************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "deprecat.h" | |
| 9 | 8 | |
| 10 | 9 | |
| 11 | 10 | static UINT8 actfancr_control_1[0x20],actfancr_control_2[0x20]; |
| r1877 | r1878 | |
| 175 | 174 | x = buffered_spriteram[offs+4]+(buffered_spriteram[offs+5]<<8); |
| 176 | 175 | colour = ((x & 0xf000) >> 12); |
| 177 | 176 | flash=x&0x800; |
| 178 | if (flash && ( | |
| 177 | if (flash && (vid | |
| 179 | 178 | |
| 180 | 179 | fx = y & 0x2000; |
| 181 | 180 | fy = y & 0x4000; |
| r1877 | r1878 | |
| 260 | 259 | x = buffered_spriteram[offs+4]+(buffered_spriteram[offs+5]<<8); |
| 261 | 260 | colour = ((x & 0xf000) >> 12); |
| 262 | 261 | flash=x&0x800; |
| 263 | if (flash && ( | |
| 262 | if (flash && (vid | |
| 264 | 263 | |
| 265 | 264 | fx = y & 0x2000; |
| 266 | 265 | fy = y & 0x4000; |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | static UINT16 bg_rambank[2],fg_rambank[2],tx_rambank; |
| 11 | 11 | |
| 12 | 12 | /* framebuffer is a raw bitmap, remapped as a last step */ |
| 13 | static | |
| 13 | static | |
| 14 | 14 | |
| 15 | 15 | static UINT16 pixel_scroll[2]; |
| 16 | 16 | |
| r1877 | r1878 | |
| 157 | 157 | COMBINE_DATA(&pixel_scroll[offset]); |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | static void hitice_clear_pixel_bitmap( | |
| 160 | static void hitice_clear_pixel_bitmap(running_machine *machine) | |
| 161 | 161 | { |
| 162 | 162 | int i; |
| 163 | 163 | |
| 164 | 164 | for (i = 0;i < 0x40000;i++) |
| 165 | hitice_pixelram_w(i,0,0); | |
| 165 | hitice_pixelram_w(machine,i,0,0); | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | static TILE_GET_INFO( get_bg_tile_info ) |
| r1877 | r1878 | |
| 285 | 285 | VIDEO_RESET( hitice ) |
| 286 | 286 | { |
| 287 | 287 | /* kludge: clear the bitmap on startup */ |
| 288 | hitice_clear_pixel_bitmap(); | |
| 288 | hitice_clear_pixel_bitmap(machine); | |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | |
| r1877 | r1878 | |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | |
| 330 | static void draw_sprites(running_machine *machine, | |
| 330 | static void draw_sprites(running_machine *machine, | |
| 331 | 331 | { |
| 332 | 332 | /* Sprite format: (16 bytes per sprite) |
| 333 | 333 | offs: bits: |
| r1877 | r1878 | |
| 450 | 450 | } |
| 451 | 451 | |
| 452 | 452 | |
| 453 | static void TC0180VCU_tilemap_draw( | |
| 453 | static void TC0180VCU_tilemap_draw( | |
| 454 | 454 | { |
| 455 | 455 | /*plane = 0 fg tilemap*/ |
| 456 | 456 | /*plane = 1 bg tilemap*/ |
| r1877 | r1878 | |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | 493 | |
| 494 | static void draw_framebuffer( | |
| 494 | static void draw_framebuffer( | |
| 495 | 495 | { |
| 496 | 496 | rectangle myclip = *cliprect; |
| 497 | 497 | int x,y; |
| r1877 | r1878 | |
|---|---|---|
| 85 | 85 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | static void draw_background( | |
| 88 | static void draw_background( | |
| 89 | 89 | { |
| 90 | 90 | UINT8 *RAM = memory_region(REGION_CPU1); |
| 91 | 91 | int i; |
| r1877 | r1878 | |
| 124 | 124 | |
| 125 | 125 | #define DRAW_SPRITE(bank, code, sx, sy) drawgfx(bitmap, machine->gfx[bank], code, color, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PEN, 0); |
| 126 | 126 | |
| 127 | static void draw_sprites_region(running_machine *machine, | |
| 127 | static void draw_sprites_region(running_machine *machine, | |
| 128 | 128 | { |
| 129 | 129 | int offs; |
| 130 | 130 | |
| r1877 | r1878 | |
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | static void draw_sprites(running_machine *machine, | |
| 209 | static void draw_sprites(running_machine *machine, | |
| 210 | 210 | { |
| 211 | 211 | UINT8 *RAM = memory_region(REGION_CPU1); |
| 212 | 212 | UINT8 *sr, *ss; |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "deprecat.h" | |
| 9 | #include "includes/tank8.h" | |
| 8 | #include "tank8.h" | |
| 10 | 9 | |
| 11 | 10 | |
| 12 | 11 | UINT8 *tank8_video_ram; |
| r1877 | r1878 | |
| 17 | 16 | |
| 18 | 17 | static tilemap *tank8_tilemap; |
| 19 | 18 | |
| 20 | static mame_bitmap *helper1; | |
| 21 | static mame_bitmap *helper2; | |
| 22 | static mame_bitmap *helper3; | |
| 19 | static bitmap_t *helper1; | |
| 20 | static bitmap_t *helper2; | |
| 21 | static bitmap_t *helper3; | |
| 23 | 22 | |
| 24 | 23 | |
| 25 | 24 | |
| r1877 | r1878 | |
| 140 | 139 | } |
| 141 | 140 | |
| 142 | 141 | |
| 143 | static void draw_sprites(running_machine *machine, | |
| 142 | static void draw_sprites(running_machine *machine, | |
| 144 | 143 | { |
| 145 | 144 | int i; |
| 146 | 145 | |
| r1877 | r1878 | |
| 163 | 162 | } |
| 164 | 163 | |
| 165 | 164 | |
| 166 | static void draw_bullets( | |
| 165 | static void draw_bullets( | |
| 167 | 166 | { |
| 168 | 167 | int i; |
| 169 | 168 | |
| r1877 | r1878 | |
| 235 | 234 | const UINT16* p2 = BITMAP_ADDR16(helper2, y, 0); |
| 236 | 235 | const UINT16* p3 = BITMAP_ADDR16(helper3, y, 0); |
| 237 | 236 | |
| 238 | if (y % 2 != | |
| 237 | if (y % 2 != vid | |
| 239 | 238 | continue; /* video display is interlaced */ |
| 240 | 239 | |
| 241 | 240 | for (x = clip->min_x; x <= clip->max_x; x++) |
| r1877 | r1878 | |
|---|---|---|
| 542 | 542 | /* These scanline drawing routines lifted from Taito F3: optimise / merge ? */ |
| 543 | 543 | |
| 544 | 544 | INLINE void taitoic_drawscanline( |
| 545 | | |
| 545 | | |
| 546 | 546 | const UINT16 *src,int transparent,UINT32 orient,int pri, const rectangle *cliprect) |
| 547 | 547 | { |
| 548 | 548 | UINT16 *dsti = BITMAP_ADDR16(bitmap, y, x); |
| r1877 | r1878 | |
| 578 | 578 | /* Note: various assumptions are made in these routines, typically that |
| 579 | 579 | only CPU#0 is of interest. If in doubt, check the routine. */ |
| 580 | 580 | |
| 581 | static int has_write_handler(int cpunum, write16_ | |
| 581 | static int has_write_handler(int cpunum, write16_machin | |
| 582 | 582 | { |
| 583 | 583 | const address_map *map; |
| 584 | 584 | for (map = memory_get_map(cpunum, ADDRESS_SPACE_PROGRAM); map && !IS_AMENTRY_END(map); map++) |
| r1877 | r1878 | |
| 755 | 755 | common_get_PC080SN_fg_tile_info(machine,tileinfo,tile_index,PC080SN_bg_ram[1][1],PC080SN_bg_gfx[1]); |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | static const tile_get_info_c | |
| 758 | static const tile_get_info_func | |
| 759 | 759 | { |
| 760 | 760 | { PC080SN_get_bg_tile_info_0, PC080SN_get_fg_tile_info_0 }, |
| 761 | 761 | { PC080SN_get_bg_tile_info_1, PC080SN_get_fg_tile_info_1 } |
| r1877 | r1878 | |
| 1069 | 1069 | } |
| 1070 | 1070 | |
| 1071 | 1071 | |
| 1072 | static void topspeed_custom_draw( | |
| 1072 | static void topspeed_custom_draw( | |
| 1073 | 1073 | UINT32 priority,UINT16 *color_ctrl_ram) |
| 1074 | 1074 | { |
| 1075 | 1075 | UINT16 *dst16,*src16; |
| 1076 | 1076 | UINT8 *tsrc; |
| 1077 | 1077 | UINT16 scanline[1024]; /* won't be called by a wide-screen game, but just in case... */ |
| 1078 | 1078 | |
| 1079 | mame_bitmap *srcbitmap = tilemap_get_pixmap(PC080SN_tilemap[chip][layer]); | |
| 1080 | mame_bitmap *flagsbitmap = tilemap_get_flagsmap(PC080SN_tilemap[chip][layer]); | |
| 1079 | bitmap_t *srcbitmap = tilemap_get_pixmap(PC080SN_tilemap[chip][layer]); | |
| 1080 | bitmap_t *flagsbitmap = tilemap_get_flagsmap(PC080SN_tilemap[chip][layer]); | |
| 1081 | 1081 | |
| 1082 | 1082 | UINT16 a,color; |
| 1083 | 1083 | int sx,x_index; |
| r1877 | r1878 | |
| 1160 | 1160 | } |
| 1161 | 1161 | |
| 1162 | 1162 | |
| 1163 | void PC080SN_tilemap_draw( | |
| 1163 | void PC080SN_tilemap_draw( | |
| 1164 | 1164 | { |
| 1165 | 1165 | tilemap_draw(bitmap,cliprect,PC080SN_tilemap[chip][layer],flags,priority); |
| 1166 | 1166 | } |
| 1167 | 1167 | |
| 1168 | void PC080SN_tilemap_draw_offset( | |
| 1168 | void PC080SN_tilemap_draw_offset( | |
| 1169 | 1169 | { |
| 1170 | 1170 | int basedx = -16 - PC080SN_xoffs; |
| 1171 | 1171 | int basedxflip = -16 + PC080SN_xoffs; |
| r1877 | r1878 | |
| 1179 | 1179 | tilemap_set_scrolldy(PC080SN_tilemap[chip][layer], basedy, basedyflip); |
| 1180 | 1180 | } |
| 1181 | 1181 | |
| 1182 | void PC080SN_tilemap_draw_special( | |
| 1182 | void PC080SN_tilemap_draw_special( | |
| 1183 | 1183 | { |
| 1184 | 1184 | topspeed_custom_draw(bitmap,cliprect,chip,layer,flags,priority,ram); |
| 1185 | 1185 | } |
| r1877 | r1878 | |
| 1276 | 1276 | } |
| 1277 | 1277 | |
| 1278 | 1278 | |
| 1279 | void PC090OJ_draw_sprites(running_machine *machine, | |
| 1279 | void PC090OJ_draw_sprites(running_machine *machine, | |
| 1280 | 1280 | { |
| 1281 | 1281 | int offs,priority=0; |
| 1282 | 1282 | int sprite_colbank = (PC090OJ_sprite_ctrl & 0xf) << 4; /* top nibble */ |
| r1877 | r1878 | |
| 1695 | 1695 | else if (offset < 0x20800/2) /* sprite ram */ |
| 1696 | 1696 | {} |
| 1697 | 1697 | else if (offset < 0x20fff/2) |
| 1698 | TC0080VCO_scrollram_w(offset-(0x20800/2),TC0080VCO_ram[offset],mem_mask); | |
| 1698 | TC0080VCO_scrollram_w(machine,offset-(0x20800/2),TC0080VCO_ram[offset],mem_mask); | |
| 1699 | 1699 | } |
| 1700 | 1700 | |
| 1701 | 1701 | |
| r1877 | r1878 | |
| 1760 | 1760 | |
| 1761 | 1761 | /* NB: orientation_flipx code in following routine has not been tested */ |
| 1762 | 1762 | |
| 1763 | static void TC0080VCO_bg0_tilemap_draw( | |
| 1763 | static void TC0080VCO_bg0_tilemap_draw( | |
| 1764 | 1764 | { |
| 1765 | 1765 | UINT16 zoom = TC0080VCO_scroll_ram[6]; |
| 1766 | 1766 | int zx, zy; |
| r1877 | r1878 | |
| 1777 | 1777 | UINT16 *dst16,*src16; |
| 1778 | 1778 | UINT8 *tsrc; |
| 1779 | 1779 | UINT16 scanline[512]; |
| 1780 | mame_bitmap *srcbitmap = tilemap_get_pixmap(TC0080VCO_tilemap[0]); | |
| 1781 | mame_bitmap *flagsbitmap = tilemap_get_flagsmap(TC0080VCO_tilemap[0]); | |
| 1780 | bitmap_t *srcbitmap = tilemap_get_pixmap(TC0080VCO_tilemap[0]); | |
| 1781 | bitmap_t *flagsbitmap = tilemap_get_flagsmap(TC0080VCO_tilemap[0]); | |
| 1782 | 1782 | |
| 1783 | 1783 | int sx,zoomx,zoomy; |
| 1784 | 1784 | int dx,ex,dy,ey; |
| r1877 | r1878 | |
| 1914 | 1914 | } |
| 1915 | 1915 | |
| 1916 | 1916 | |
| 1917 | static void TC0080VCO_bg1_tilemap_draw(running_machine *machine, | |
| 1917 | static void TC0080VCO_bg1_tilemap_draw(running_machine *machine, | |
| 1918 | 1918 | { |
| 1919 | 1919 | UINT8 layer=1; |
| 1920 | 1920 | UINT16 zoom = TC0080VCO_scroll_ram[6+layer]; |
| r1877 | r1878 | |
| 1937 | 1937 | int sx,sy; |
| 1938 | 1938 | |
| 1939 | 1939 | /* shouldn't we set no_clip before doing this (see TC0480SCP) ? */ |
| 1940 | | |
| 1940 | | |
| 1941 | 1941 | |
| 1942 | 1942 | if (zoomx < 63) |
| 1943 | 1943 | { |
| r1877 | r1878 | |
| 1990 | 1990 | } |
| 1991 | 1991 | |
| 1992 | 1992 | |
| 1993 | void TC0080VCO_tilemap_draw(running_machine *machine, | |
| 1993 | void TC0080VCO_tilemap_draw(running_machine *machine, | |
| 1994 | 1994 | { |
| 1995 | 1995 | int disable = 0x00; /* possibly layer disable bits do exist ?? */ |
| 1996 | 1996 | |
| r1877 | r1878 | |
| 2165 | 2165 | |
| 2166 | 2166 | /* This array changes with TC0100SCN_MAX_CHIPS */ |
| 2167 | 2167 | |
| 2168 | static const tile_get_info_c | |
| 2168 | static const tile_get_info_func | |
| 2169 | 2169 | { |
| 2170 | 2170 | { TC0100SCN_get_bg_tile_info_0, TC0100SCN_get_fg_tile_info_0, TC0100SCN_get_tx_tile_info_0 }, |
| 2171 | 2171 | { TC0100SCN_get_bg_tile_info_1, TC0100SCN_get_fg_tile_info_1, TC0100SCN_get_tx_tile_info_1 }, |
| r1877 | r1878 | |
| 2492 | 2492 | |
| 2493 | 2493 | WRITE16_HANDLER( TC0100SCN_dual_screen_w ) |
| 2494 | 2494 | { |
| 2495 | TC0100SCN_word_0_w(offset,data,mem_mask); | |
| 2496 | TC0100SCN_word_1_w(offset,data,mem_mask); | |
| 2495 | TC0100SCN_word_0_w(machine,offset,data,mem_mask); | |
| 2496 | TC0100SCN_word_1_w(machine,offset,data,mem_mask); | |
| 2497 | 2497 | } |
| 2498 | 2498 | |
| 2499 | 2499 | WRITE16_HANDLER( TC0100SCN_triple_screen_w ) |
| 2500 | 2500 | { |
| 2501 | TC0100SCN_word_0_w(offset,data,mem_mask); | |
| 2502 | TC0100SCN_word_1_w(offset,data,mem_mask); | |
| 2503 | TC0100SCN_word_2_w(offset,data,mem_mask); | |
| 2501 | TC0100SCN_word_0_w(machine,offset,data,mem_mask); | |
| 2502 | TC0100SCN_word_1_w(machine,offset,data,mem_mask); | |
| 2503 | TC0100SCN_word_2_w(machine,offset,data,mem_mask); | |
| 2504 | 2504 | } |
| 2505 | 2505 | |
| 2506 | 2506 | |
| r1877 | r1878 | |
| 2605 | 2605 | |
| 2606 | 2606 | READ32_HANDLER( TC0100SCN_ctrl_long_r ) |
| 2607 | 2607 | { |
| 2608 | return (TC0100SCN_ctrl_word_0_r(offset*2,0)<<16)|TC0100SCN_ctrl_word_0_r(offset*2+1,0); | |
| 2608 | return (TC0100SCN_ctrl_word_0_r(machine,offset*2,0)<<16)|TC0100SCN_ctrl_word_0_r(machine,offset*2+1,0); | |
| 2609 | 2609 | } |
| 2610 | 2610 | |
| 2611 | 2611 | WRITE32_HANDLER( TC0100SCN_ctrl_long_w ) |
| r1877 | r1878 | |
| 2616 | 2616 | |
| 2617 | 2617 | READ32_HANDLER( TC0100SCN_long_r ) |
| 2618 | 2618 | { |
| 2619 | return (TC0100SCN_word_0_r(offset*2,0)<<16)|TC0100SCN_word_0_r(offset*2+1,0); | |
| 2619 | return (TC0100SCN_word_0_r(machine,offset*2,0)<<16)|TC0100SCN_word_0_r(machine,offset*2+1,0); | |
| 2620 | 2620 | } |
| 2621 | 2621 | |
| 2622 | 2622 | WRITE32_HANDLER( TC0100SCN_long_w ) |
| 2623 | 2623 | { |
| 2624 | 2624 | if (((mem_mask & 0xff000000) == 0) || ((mem_mask & 0x00ff0000) == 0)) |
| 2625 | 2625 | { |
| 2626 | int oldword = TC0100SCN_word_0_r(offset*2,0); | |
| 2626 | int oldword = TC0100SCN_word_0_r(machine,offset*2,0); | |
| 2627 | 2627 | int newword = data>>16; |
| 2628 | 2628 | if ((mem_mask & 0x00ff0000) != 0) |
| 2629 | 2629 | newword |= (oldword &0x00ff); |
| 2630 | 2630 | if ((mem_mask & 0xff000000) != 0) |
| 2631 | 2631 | newword |= (oldword &0xff00); |
| 2632 | TC0100SCN_word_0_w(offset*2,newword,0); | |
| 2632 | TC0100SCN_word_0_w(machine,offset*2,newword,0); | |
| 2633 | 2633 | } |
| 2634 | 2634 | if (((mem_mask & 0x0000ff00) == 0) || ((mem_mask & 0x000000ff) == 0)) |
| 2635 | 2635 | { |
| 2636 | int oldword = TC0100SCN_word_0_r((offset*2)+1,0); | |
| 2636 | int oldword = TC0100SCN_word_0_r(machine,(offset*2)+1,0); | |
| 2637 | 2637 | int newword = data&0xffff; |
| 2638 | 2638 | if ((mem_mask & 0x000000ff) != 0) |
| 2639 | 2639 | newword |= (oldword &0x00ff); |
| 2640 | 2640 | if ((mem_mask & 0x0000ff00) != 0) |
| 2641 | 2641 | newword |= (oldword &0xff00); |
| 2642 | TC0100SCN_word_0_w((offset*2)+1,newword,0); | |
| 2642 | TC0100SCN_word_0_w(machine,(offset*2)+1,newword,0); | |
| 2643 | 2643 | } |
| 2644 | 2644 | } |
| 2645 | 2645 | |
| r1877 | r1878 | |
| 2687 | 2687 | } |
| 2688 | 2688 | } |
| 2689 | 2689 | |
| 2690 | static void TC0100SCN_tilemap_draw_fg( | |
| 2690 | static void TC0100SCN_tilemap_draw_fg( | |
| 2691 | 2691 | { |
| 2692 | const | |
| 2692 | const | |
| 2693 | 2693 | int width_mask, height_mask, x, y, p; |
| 2694 | 2694 | int column_offset, src_x=0, src_y=0; |
| 2695 | 2695 | int scrollx_delta = - tilemap_get_scrolldx( tmap ); |
| r1877 | r1878 | |
| 2730 | 2730 | } |
| 2731 | 2731 | } |
| 2732 | 2732 | |
| 2733 | int TC0100SCN_tilemap_draw(running_machine *machine, | |
| 2733 | int TC0100SCN_tilemap_draw(running_machine *machine, | |
| 2734 | 2734 | { |
| 2735 | 2735 | int disable = TC0100SCN_ctrl[chip][6] & 0xf7; |
| 2736 | 2736 | rectangle clip = *cliprect; |
| r1877 | r1878 | |
| 2810 | 2810 | |
| 2811 | 2811 | READ16_HANDLER( TC0430GRW_word_r ) |
| 2812 | 2812 | { |
| 2813 | return TC0280GRD_word_r(offset,mem_mask); | |
| 2813 | return TC0280GRD_word_r(machine,offset,mem_mask); | |
| 2814 | 2814 | } |
| 2815 | 2815 | |
| 2816 | 2816 | WRITE16_HANDLER( TC0280GRD_word_w ) |
| r1877 | r1878 | |
| 2821 | 2821 | |
| 2822 | 2822 | WRITE16_HANDLER( TC0430GRW_word_w ) |
| 2823 | 2823 | { |
| 2824 | TC0280GRD_word_w(offset,data,mem_mask); | |
| 2824 | TC0280GRD_word_w(machine,offset,data,mem_mask); | |
| 2825 | 2825 | } |
| 2826 | 2826 | |
| 2827 | 2827 | WRITE16_HANDLER( TC0280GRD_ctrl_word_w ) |
| r1877 | r1878 | |
| 2831 | 2831 | |
| 2832 | 2832 | WRITE16_HANDLER( TC0430GRW_ctrl_word_w ) |
| 2833 | 2833 | { |
| 2834 | TC0280GRD_ctrl_word_w(offset,data,mem_mask); | |
| 2834 | TC0280GRD_ctrl_word_w(machine,offset,data,mem_mask); | |
| 2835 | 2835 | } |
| 2836 | 2836 | |
| 2837 | 2837 | void TC0280GRD_tilemap_update(int base_color) |
| r1877 | r1878 | |
| 2848 | 2848 | TC0280GRD_tilemap_update(base_color); |
| 2849 | 2849 | } |
| 2850 | 2850 | |
| 2851 | static void zoom_draw( | |
| 2851 | static void zoom_draw( | |
| 2852 | 2852 | { |
| 2853 | 2853 | UINT32 startx,starty; |
| 2854 | 2854 | int incxx,incxy,incyx,incyy; |
| r1877 | r1878 | |
| 2875 | 2875 | 0,priority); |
| 2876 | 2876 | } |
| 2877 | 2877 | |
| 2878 | void TC0280GRD_zoom_draw( | |
| 2878 | void TC0280GRD_zoom_draw( | |
| 2879 | 2879 | { |
| 2880 | 2880 | zoom_draw(bitmap,cliprect,xoffset,yoffset,priority,2); |
| 2881 | 2881 | } |
| 2882 | 2882 | |
| 2883 | void TC0430GRW_zoom_draw( | |
| 2883 | void TC0430GRW_zoom_draw( | |
| 2884 | 2884 | { |
| 2885 | 2885 | zoom_draw(bitmap,cliprect,xoffset,yoffset,priority,1); |
| 2886 | 2886 | } |
| r1877 | r1878 | |
| 2914 | 2914 | { |
| 2915 | 2915 | if (ACCESSING_LSB) |
| 2916 | 2916 | { |
| 2917 | TC0360PRI_w(offset,data & 0xff); | |
| 2917 | TC0360PRI_w(machine,offset,data & 0xff); | |
| 2918 | 2918 | #if 0 |
| 2919 | 2919 | if (data & 0xff00) |
| 2920 | 2920 | { logerror("CPU #0 PC %06x: warning - write %02x to MSB of TC0360PRI address %02x\n",activecpu_get_pc(),data,offset); } |
| r1877 | r1878 | |
| 2928 | 2928 | { |
| 2929 | 2929 | if (ACCESSING_MSB) |
| 2930 | 2930 | { |
| 2931 | TC0360PRI_w(offset,(data >> 8) & 0xff); | |
| 2931 | TC0360PRI_w(machine,offset,(data >> 8) & 0xff); | |
| 2932 | 2932 | #if 0 |
| 2933 | 2933 | if (data & 0xff) |
| 2934 | 2934 | { logerror("CPU #0 PC %06x: warning - write %02x to LSB of TC0360PRI address %02x\n",activecpu_get_pc(),data,offset); } |
| r1877 | r1878 | |
| 3013 | 3013 | common_get_tc0480tx_tile_info(machine,tileinfo,tile_index,TC0480SCP_tx_ram,TC0480SCP_tx_gfx); |
| 3014 | 3014 | } |
| 3015 | 3015 | |
| 3016 | static const tile_get_info_c | |
| 3016 | static const tile_get_info_func | |
| 3017 | 3017 | { |
| 3018 | 3018 | TC0480SCP_get_bg0_tile_info, TC0480SCP_get_bg1_tile_info, |
| 3019 | 3019 | TC0480SCP_get_bg2_tile_info, TC0480SCP_get_bg3_tile_info, |
| r1877 | r1878 | |
| 3270 | 3270 | |
| 3271 | 3271 | READ32_HANDLER( TC0480SCP_ctrl_long_r ) |
| 3272 | 3272 | { |
| 3273 | return (TC0480SCP_ctrl_word_r(offset*2,0)<<16)|TC0480SCP_ctrl_word_r(offset*2+1,0); | |
| 3273 | return (TC0480SCP_ctrl_word_r(machine,offset*2,0)<<16)|TC0480SCP_ctrl_word_r(machine,offset*2+1,0); | |
| 3274 | 3274 | } |
| 3275 | 3275 | |
| 3276 | 3276 | /* TODO: byte access ? */ |
| 3277 | 3277 | |
| 3278 | 3278 | WRITE32_HANDLER( TC0480SCP_ctrl_long_w ) |
| 3279 | 3279 | { |
| 3280 | if (ACCESSING_MSW32) TC0480SCP_ctrl_word_w(offset*2,data>>16,mem_mask>>16); | |
| 3281 | if (ACCESSING_LSW32) TC0480SCP_ctrl_word_w((offset*2)+1,data&0xffff,mem_mask&0xffff); | |
| 3280 | if (ACCESSING_MSW32) TC0480SCP_ctrl_word_w(machine,offset*2,data>>16,mem_mask>>16); | |
| 3281 | if (ACCESSING_LSW32) TC0480SCP_ctrl_word_w(machine,(offset*2)+1,data&0xffff,mem_mask&0xffff); | |
| 3282 | 3282 | } |
| 3283 | 3283 | |
| 3284 | 3284 | READ32_HANDLER( TC0480SCP_long_r ) |
| 3285 | 3285 | { |
| 3286 | return (TC0480SCP_word_r(offset*2,0)<<16)|TC0480SCP_word_r(offset*2+1,0); | |
| 3286 | return (TC0480SCP_word_r(machine,offset*2,0)<<16)|TC0480SCP_word_r(machine,offset*2+1,0); | |
| 3287 | 3287 | } |
| 3288 | 3288 | |
| 3289 | 3289 | WRITE32_HANDLER( TC0480SCP_long_w ) |
| 3290 | 3290 | { |
| 3291 | 3291 | if (((mem_mask & 0xff000000) == 0) || ((mem_mask & 0x00ff0000) == 0)) |
| 3292 | 3292 | { |
| 3293 | int oldword = TC0480SCP_word_r(offset*2,0); | |
| 3293 | int oldword = TC0480SCP_word_r(machine,offset*2,0); | |
| 3294 | 3294 | int newword = data>>16; |
| 3295 | 3295 | if ((mem_mask & 0x00ff0000) != 0) |
| 3296 | 3296 | newword |= (oldword &0x00ff); |
| 3297 | 3297 | if ((mem_mask & 0xff000000) != 0) |
| 3298 | 3298 | newword |= (oldword &0xff00); |
| 3299 | TC0480SCP_word_w(offset*2,newword,0); | |
| 3299 | TC0480SCP_word_w(machine,offset*2,newword,0); | |
| 3300 | 3300 | } |
| 3301 | 3301 | if (((mem_mask & 0x0000ff00) == 0) || ((mem_mask & 0x000000ff) == 0)) |
| 3302 | 3302 | { |
| 3303 | int oldword = TC0480SCP_word_r((offset*2)+1,0); | |
| 3303 | int oldword = TC0480SCP_word_r(machine,(offset*2)+1,0); | |
| 3304 | 3304 | int newword = data&0xffff; |
| 3305 | 3305 | if ((mem_mask & 0x000000ff) != 0) |
| 3306 | 3306 | newword |= (oldword &0x00ff); |
| 3307 | 3307 | if ((mem_mask & 0x0000ff00) != 0) |
| 3308 | 3308 | newword |= (oldword &0xff00); |
| 3309 | TC0480SCP_word_w((offset*2)+1,newword,0); | |
| 3309 | TC0480SCP_word_w(machine,(offset*2)+1,newword,0); | |
| 3310 | 3310 | } |
| 3311 | 3311 | } |
| 3312 | 3312 | |
| r1877 | r1878 | |
| 3591 | 3591 | |
| 3592 | 3592 | **********************************************************************/ |
| 3593 | 3593 | |
| 3594 | static void TC0480SCP_bg01_draw( | |
| 3594 | static void TC0480SCP_bg01_draw( | |
| 3595 | 3595 | { |
| 3596 | 3596 | /* X-axis zoom offers expansion only: 0 = no zoom, 0xff = max |
| 3597 | 3597 | Y-axis zoom offers expansion/compression: 0x7f = no zoom, 0xff = max |
| r1877 | r1878 | |
| 3611 | 3611 | UINT8 *tsrc; |
| 3612 | 3612 | UINT16 scanline[512]; |
| 3613 | 3613 | UINT32 sx; |
| 3614 | mame_bitmap *srcbitmap = tilemap_get_pixmap(TC0480SCP_tilemap[layer][TC0480SCP_dblwidth]); | |
| 3615 | mame_bitmap *flagsbitmap = tilemap_get_flagsmap | |
| 3614 | bitmap_t *srcbitmap = tilemap_get_pixmap(TC0480SCP_tilemap[layer][TC0480SCP_dblwidth]); | |
| 3615 | bitmap_t *flagsbitmap = tilemap_get_flagsmap | |
| 3616 | 3616 | (TC0480SCP_tilemap[layer][TC0480SCP_dblwidth]); |
| 3617 | 3617 | int flip = TC0480SCP_pri_reg & 0x40; |
| 3618 | 3618 | int i,y,y_index,src_y_index,row_index; |
| r1877 | r1878 | |
| 3742 | 3742 | |
| 3743 | 3743 | ****************************************************************/ |
| 3744 | 3744 | |
| 3745 | static void TC0480SCP_bg23_draw( | |
| 3745 | static void TC0480SCP_bg23_draw( | |
| 3746 | 3746 | { |
| 3747 | mame_bitmap *srcbitmap = tilemap_get_pixmap(TC0480SCP_tilemap[layer][TC0480SCP_dblwidth]); | |
| 3748 | mame_bitmap *flagsbitmap = tilemap_get_flagsmap | |
| 3747 | bitmap_t *srcbitmap = tilemap_get_pixmap(TC0480SCP_tilemap[layer][TC0480SCP_dblwidth]); | |
| 3748 | bitmap_t *flagsbitmap = tilemap_get_flagsmap | |
| 3749 | 3749 | (TC0480SCP_tilemap[layer][TC0480SCP_dblwidth]); |
| 3750 | 3750 | |
| 3751 | 3751 | UINT16 *dst16,*src16; |
| 3752 | UINT | |
| 3752 | UINT8 | |
| 3753 | 3753 | int i,y,y_index,src_y_index,row_index,row_zoom; |
| 3754 | 3754 | int sx,x_index,x_step; |
| 3755 | 3755 | UINT32 zoomx,zoomy; |
| r1877 | r1878 | |
| 3831 | 3831 | } |
| 3832 | 3832 | |
| 3833 | 3833 | src16 = BITMAP_ADDR16(srcbitmap, src_y_index, 0); |
| 3834 | tsrc = BITMAP_ADDR | |
| 3834 | tsrc = BITMAP_ADDR8 | |
| 3835 | 3835 | dst16 = scanline; |
| 3836 | 3836 | |
| 3837 | 3837 | if (flags & TILEMAP_DRAW_OPAQUE) |
| r1877 | r1878 | |
| 3868 | 3868 | |
| 3869 | 3869 | |
| 3870 | 3870 | |
| 3871 | void TC0480SCP_tilemap_draw( | |
| 3871 | void TC0480SCP_tilemap_draw( | |
| 3872 | 3872 | { |
| 3873 | 3873 | /* no layer disable bits */ |
| 3874 | 3874 | |
| r1877 | r1878 | |
| 4100 | 4100 | |
| 4101 | 4101 | ******************************************************************************/ |
| 4102 | 4102 | |
| 4103 | void TC0150ROD_draw( | |
| 4103 | void TC0150ROD_draw( | |
| 4104 | 4104 | { |
| 4105 | 4105 | #ifdef MAME_DEBUG |
| 4106 | 4106 | static int dislayer[6]; /* Road Layer toggles to help get road correct */ |
| r1877 | r1878 | |
| 4940 | 4940 | switch (offset) |
| 4941 | 4941 | { |
| 4942 | 4942 | case 0x00: /* IN00-07 (DSA) */ |
| 4943 | return input_port_0_r(0); | |
| 4943 | return input_port_0_r(machine,0); | |
| 4944 | 4944 | |
| 4945 | 4945 | case 0x01: /* IN08-15 (DSB) */ |
| 4946 | return input_port_1_r(0); | |
| 4946 | return input_port_1_r(machine,0); | |
| 4947 | 4947 | |
| 4948 | 4948 | case 0x02: /* IN16-23 (1P) */ |
| 4949 | return input_port_2_r(0); | |
| 4949 | return input_port_2_r(machine,0); | |
| 4950 | 4950 | |
| 4951 | 4951 | case 0x03: /* IN24-31 (2P) */ |
| 4952 | return input_port_3_r(0); | |
| 4952 | return input_port_3_r(machine,0); | |
| 4953 | 4953 | |
| 4954 | 4954 | case 0x04: /* coin counters and lockout */ |
| 4955 | 4955 | return TC0220IOC_regs[4]; |
| 4956 | 4956 | |
| 4957 | 4957 | case 0x07: /* INB0-7 (coin) */ |
| 4958 | return input_port_4_r(0); | |
| 4958 | return input_port_4_r(machine,0); | |
| 4959 | 4959 | |
| 4960 | 4960 | default: |
| 4961 | 4961 | logerror("PC %06x: warning - read TC0220IOC address %02x\n",activecpu_get_pc(),offset); |
| r1877 | r1878 | |
| 4970 | 4970 | switch (offset) |
| 4971 | 4971 | { |
| 4972 | 4972 | case 0x00: |
| 4973 | watchdog_reset | |
| 4973 | watchdog_reset | |
| 4974 | 4974 | break; |
| 4975 | 4975 | |
| 4976 | 4976 | case 0x04: /* coin counters and lockout, hi nibble irrelevant */ |
| r1877 | r1878 | |
| 5002 | 5002 | |
| 5003 | 5003 | READ8_HANDLER( TC0220IOC_portreg_r ) |
| 5004 | 5004 | { |
| 5005 | return TC0220IOC_r(TC0220IOC_port); | |
| 5005 | return TC0220IOC_r(machine, TC0220IOC_port); | |
| 5006 | 5006 | } |
| 5007 | 5007 | |
| 5008 | 5008 | WRITE8_HANDLER( TC0220IOC_portreg_w ) |
| 5009 | 5009 | { |
| 5010 | TC0220IOC_w(TC0220IOC_port, data); | |
| 5010 | TC0220IOC_w(machine, TC0220IOC_port, data); | |
| 5011 | 5011 | } |
| 5012 | 5012 | |
| 5013 | 5013 | READ16_HANDLER( TC0220IOC_halfword_port_r ) |
| 5014 | 5014 | { |
| 5015 | return TC0220IOC_port_r( offset ); | |
| 5015 | return TC0220IOC_port_r( machine, offset ); | |
| 5016 | 5016 | } |
| 5017 | 5017 | |
| 5018 | 5018 | WRITE16_HANDLER( TC0220IOC_halfword_port_w ) |
| 5019 | 5019 | { |
| 5020 | 5020 | if (ACCESSING_LSB) |
| 5021 | TC0220IOC_port_w( offset, data & 0xff ); | |
| 5021 | TC0220IOC_port_w( machine, offset, data & 0xff ); | |
| 5022 | 5022 | } |
| 5023 | 5023 | |
| 5024 | 5024 | READ16_HANDLER( TC0220IOC_halfword_portreg_r ) |
| 5025 | 5025 | { |
| 5026 | return TC0220IOC_portreg_r( offset ); | |
| 5026 | return TC0220IOC_portreg_r( machine, offset ); | |
| 5027 | 5027 | } |
| 5028 | 5028 | |
| 5029 | 5029 | WRITE16_HANDLER( TC0220IOC_halfword_portreg_w ) |
| 5030 | 5030 | { |
| 5031 | 5031 | if (ACCESSING_LSB) |
| 5032 | TC0220IOC_portreg_w( offset, data & 0xff ); | |
| 5032 | TC0220IOC_portreg_w( machine, offset, data & 0xff ); | |
| 5033 | 5033 | } |
| 5034 | 5034 | |
| 5035 | 5035 | READ16_HANDLER( TC0220IOC_halfword_byteswap_port_r ) |
| 5036 | 5036 | { |
| 5037 | return TC0220IOC_port_r( offset ) << 8; | |
| 5037 | return TC0220IOC_port_r( machine, offset ) << 8; | |
| 5038 | 5038 | } |
| 5039 | 5039 | |
| 5040 | 5040 | WRITE16_HANDLER( TC0220IOC_halfword_byteswap_port_w ) |
| 5041 | 5041 | { |
| 5042 | 5042 | if (ACCESSING_MSB) |
| 5043 | TC0220IOC_port_w( offset, (data>>8) & 0xff ); | |
| 5043 | TC0220IOC_port_w( machine, offset, (data>>8) & 0xff ); | |
| 5044 | 5044 | } |
| 5045 | 5045 | |
| 5046 | 5046 | READ16_HANDLER( TC0220IOC_halfword_byteswap_portreg_r ) |
| 5047 | 5047 | { |
| 5048 | return TC0220IOC_portreg_r( offset )<<8; | |
| 5048 | return TC0220IOC_portreg_r( machine, offset )<<8; | |
| 5049 | 5049 | } |
| 5050 | 5050 | |
| 5051 | 5051 | WRITE16_HANDLER( TC0220IOC_halfword_byteswap_portreg_w ) |
| 5052 | 5052 | { |
| 5053 | 5053 | if (ACCESSING_MSB) |
| 5054 | TC0220IOC_portreg_w( offset, (data>>8) & 0xff ); | |
| 5054 | TC0220IOC_portreg_w( machine, offset, (data>>8) & 0xff ); | |
| 5055 | 5055 | } |
| 5056 | 5056 | |
| 5057 | 5057 | READ16_HANDLER( TC0220IOC_halfword_r ) |
| 5058 | 5058 | { |
| 5059 | return TC0220IOC_r(offset); | |
| 5059 | return TC0220IOC_r(machine,offset); | |
| 5060 | 5060 | } |
| 5061 | 5061 | |
| 5062 | 5062 | WRITE16_HANDLER( TC0220IOC_halfword_w ) |
| 5063 | 5063 | { |
| 5064 | 5064 | if (ACCESSING_LSB) |
| 5065 | TC0220IOC_w(offset,data & 0xff); | |
| 5065 | TC0220IOC_w(machine,offset,data & 0xff); | |
| 5066 | 5066 | else |
| 5067 | 5067 | { |
| 5068 | 5068 | /* qtorimon writes here the coin counters - bug? */ |
| 5069 | TC0220IOC_w(offset,(data >> 8) & 0xff); | |
| 5069 | TC0220IOC_w(machine,offset,(data >> 8) & 0xff); | |
| 5070 | 5070 | |
| 5071 | 5071 | if (offset) /* ainferno writes watchdog in msb */ |
| 5072 | 5072 | logerror("CPU #0 PC %06x: warning - write to MSB of TC0220IOC address %02x\n",activecpu_get_pc(),offset); |
| r1877 | r1878 | |
| 5075 | 5075 | |
| 5076 | 5076 | READ16_HANDLER( TC0220IOC_halfword_byteswap_r ) |
| 5077 | 5077 | { |
| 5078 | return TC0220IOC_halfword_r(offset,mem_mask) << 8; | |
| 5078 | return TC0220IOC_halfword_r(machine,offset,mem_mask) << 8; | |
| 5079 | 5079 | } |
| 5080 | 5080 | |
| 5081 | 5081 | WRITE16_HANDLER( TC0220IOC_halfword_byteswap_w ) |
| 5082 | 5082 | { |
| 5083 | 5083 | if (ACCESSING_MSB) |
| 5084 | TC0220IOC_w(offset,(data >> 8) & 0xff); | |
| 5084 | TC0220IOC_w(machine,offset,(data >> 8) & 0xff); | |
| 5085 | 5085 | else |
| 5086 | 5086 | { |
| 5087 | TC0220IOC_w(offset,data & 0xff); | |
| 5087 | TC0220IOC_w(machine,offset,data & 0xff); | |
| 5088 | 5088 | |
| 5089 | 5089 | logerror("CPU #0 PC %06x: warning - write to LSB of TC0220IOC address %02x\n",activecpu_get_pc(),offset); |
| 5090 | 5090 | } |
| r1877 | r1878 | |
| 5101 | 5101 | switch (offset) |
| 5102 | 5102 | { |
| 5103 | 5103 | case 0x00: /* DSA */ |
| 5104 | return input_port_0_r(0); | |
| 5104 | return input_port_0_r(machine,0); | |
| 5105 | 5105 | |
| 5106 | 5106 | case 0x01: /* DSB */ |
| 5107 | return input_port_1_r(0); | |
| 5107 | return input_port_1_r(machine,0); | |
| 5108 | 5108 | |
| 5109 | 5109 | case 0x02: /* 1P */ |
| 5110 | return input_port_2_r(0); | |
| 5110 | return input_port_2_r(machine,0); | |
| 5111 | 5111 | |
| 5112 | 5112 | case 0x03: /* 2P */ |
| 5113 | return input_port_3_r(0); | |
| 5113 | return input_port_3_r(machine,0); | |
| 5114 | 5114 | |
| 5115 | 5115 | case 0x04: /* coin counters and lockout */ |
| 5116 | 5116 | return TC0510NIO_regs[4]; |
| 5117 | 5117 | |
| 5118 | 5118 | case 0x07: /* coin */ |
| 5119 | return input_port_4_r(0); | |
| 5119 | return input_port_4_r(machine,0); | |
| 5120 | 5120 | |
| 5121 | 5121 | default: |
| 5122 | 5122 | logerror("PC %06x: warning - read TC0510NIO address %02x\n",activecpu_get_pc(),offset); |
| r1877 | r1878 | |
| 5131 | 5131 | switch (offset) |
| 5132 | 5132 | { |
| 5133 | 5133 | case 0x00: |
| 5134 | watchdog_reset | |
| 5134 | watchdog_reset | |
| 5135 | 5135 | break; |
| 5136 | 5136 | |
| 5137 | 5137 | case 0x04: /* coin counters and lockout */ |
| r1877 | r1878 | |
| 5149 | 5149 | |
| 5150 | 5150 | READ16_HANDLER( TC0510NIO_halfword_r ) |
| 5151 | 5151 | { |
| 5152 | return TC0510NIO_r(offset); | |
| 5152 | return TC0510NIO_r(machine,offset); | |
| 5153 | 5153 | } |
| 5154 | 5154 | |
| 5155 | 5155 | WRITE16_HANDLER( TC0510NIO_halfword_w ) |
| 5156 | 5156 | { |
| 5157 | 5157 | if (ACCESSING_LSB) |
| 5158 | TC0510NIO_w(offset,data & 0xff); | |
| 5158 | TC0510NIO_w(machine,offset,data & 0xff); | |
| 5159 | 5159 | else |
| 5160 | 5160 | { |
| 5161 | 5161 | /* driftout writes the coin counters here - bug? */ |
| 5162 | 5162 | logerror("CPU #0 PC %06x: warning - write to MSB of TC0510NIO address %02x\n",activecpu_get_pc(),offset); |
| 5163 | TC0510NIO_w(offset,(data >> 8) & 0xff); | |
| 5163 | TC0510NIO_w(machine,offset,(data >> 8) & 0xff); | |
| 5164 | 5164 | } |
| 5165 | 5165 | } |
| 5166 | 5166 | |
| 5167 | 5167 | READ16_HANDLER( TC0510NIO_halfword_wordswap_r ) |
| 5168 | 5168 | { |
| 5169 | return TC0510NIO_halfword_r(offset ^ 1,mem_mask); | |
| 5169 | return TC0510NIO_halfword_r(machine,offset ^ 1,mem_mask); | |
| 5170 | 5170 | } |
| 5171 | 5171 | |
| 5172 | 5172 | WRITE16_HANDLER( TC0510NIO_halfword_wordswap_w ) |
| 5173 | 5173 | { |
| 5174 | TC0510NIO_halfword_w(offset ^ 1,data,mem_mask); | |
| 5174 | TC0510NIO_halfword_w(machine,offset ^ 1,data,mem_mask); | |
| 5175 | 5175 | } |
| 5176 | 5176 | |
| 5177 | 5177 | |
| r1877 | r1878 | |
| 5184 | 5184 | switch (offset) |
| 5185 | 5185 | { |
| 5186 | 5186 | case 0x00: /* DSA */ |
| 5187 | return input_port_0_r(0); | |
| 5187 | return input_port_0_r(machine,0); | |
| 5188 | 5188 | |
| 5189 | 5189 | case 0x01: /* DSB */ |
| 5190 | return input_port_1_r(0); | |
| 5190 | return input_port_1_r(machine,0); | |
| 5191 | 5191 | |
| 5192 | 5192 | case 0x02: /* 1P */ |
| 5193 | return input_port_2_r(0); | |
| 5193 | return input_port_2_r(machine,0); | |
| 5194 | 5194 | |
| 5195 | 5195 | case 0x03: /* 2P */ |
| 5196 | return input_port_3_r(0); | |
| 5196 | return input_port_3_r(machine,0); | |
| 5197 | 5197 | |
| 5198 | 5198 | case 0x04: /* coin counters and lockout */ |
| 5199 | 5199 | return TC0640FIO_regs[4]; |
| 5200 | 5200 | |
| 5201 | 5201 | case 0x07: /* coin */ |
| 5202 | return input_port_4_r(0); | |
| 5202 | return input_port_4_r(machine,0); | |
| 5203 | 5203 | |
| 5204 | 5204 | default: |
| 5205 | 5205 | logerror("PC %06x: warning - read TC0640FIO address %02x\n",activecpu_get_pc(),offset); |
| r1877 | r1878 | |
| 5214 | 5214 | switch (offset) |
| 5215 | 5215 | { |
| 5216 | 5216 | case 0x00: |
| 5217 | watchdog_reset | |
| 5217 | watchdog_reset | |
| 5218 | 5218 | break; |
| 5219 | 5219 | |
| 5220 | 5220 | case 0x04: /* coin counters and lockout */ |
| r1877 | r1878 | |
| 5232 | 5232 | |
| 5233 | 5233 | READ16_HANDLER( TC0640FIO_halfword_r ) |
| 5234 | 5234 | { |
| 5235 | return TC0640FIO_r(offset); | |
| 5235 | return TC0640FIO_r(machine,offset); | |
| 5236 | 5236 | } |
| 5237 | 5237 | |
| 5238 | 5238 | WRITE16_HANDLER( TC0640FIO_halfword_w ) |
| 5239 | 5239 | { |
| 5240 | 5240 | if (ACCESSING_LSB) |
| 5241 | TC0640FIO_w(offset,data & 0xff); | |
| 5241 | TC0640FIO_w(machine,offset,data & 0xff); | |
| 5242 | 5242 | else |
| 5243 | 5243 | { |
| 5244 | TC0640FIO_w(offset,(data >> 8) & 0xff); | |
| 5244 | TC0640FIO_w(machine,offset,(data >> 8) & 0xff); | |
| 5245 | 5245 | logerror("CPU #0 PC %06x: warning - write to MSB of TC0640FIO address %02x\n",activecpu_get_pc(),offset); |
| 5246 | 5246 | } |
| 5247 | 5247 | } |
| 5248 | 5248 | |
| 5249 | 5249 | READ16_HANDLER( TC0640FIO_halfword_byteswap_r ) |
| 5250 | 5250 | { |
| 5251 | return TC0640FIO_halfword_r(offset,mem_mask) << 8; | |
| 5251 | return TC0640FIO_halfword_r(machine,offset,mem_mask) << 8; | |
| 5252 | 5252 | } |
| 5253 | 5253 | |
| 5254 | 5254 | WRITE16_HANDLER( TC0640FIO_halfword_byteswap_w ) |
| 5255 | 5255 | { |
| 5256 | 5256 | if (ACCESSING_MSB) |
| 5257 | TC0640FIO_w(offset,(data >> 8) & 0xff); | |
| 5257 | TC0640FIO_w(machine,offset,(data >> 8) & 0xff); | |
| 5258 | 5258 | else |
| 5259 | 5259 | { |
| 5260 | TC0640FIO_w(offset,data & 0xff); | |
| 5260 | TC0640FIO_w(machine,offset,data & 0xff); | |
| 5261 | 5261 | logerror("CPU #0 PC %06x: warning - write to LSB of TC0640FIO address %02x\n",activecpu_get_pc(),offset); |
| 5262 | 5262 | } |
| 5263 | 5263 | } |
| r1877 | r1878 | |
|---|---|---|
| 262 | 262 | 15 xxxxxxxx Y position |
| 263 | 263 | */ |
| 264 | 264 | |
| 265 | static void draw_sprites(running_machine *machine, | |
| 265 | static void draw_sprites(running_machine *machine, | |
| 266 | 266 | { |
| 267 | 267 | const UINT8 *source = &spriteram[0x0800-0x20]; /* the last is NOT a sprite */ |
| 268 | 268 | const UINT8 *finish = &spriteram[0]; |
| r1877 | r1878 | |
|---|---|---|
| 203 | 203 | |
| 204 | 204 | ***************************************************************************/ |
| 205 | 205 | |
| 206 | static void draw_normal_sprites(running_machine *machine, | |
| 206 | static void draw_normal_sprites(running_machine *machine, | |
| 207 | 207 | { |
| 208 | 208 | int i; |
| 209 | 209 | int mx = 0; // multisprite x counter |
| r1877 | r1878 | |
| 334 | 334 | } |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | static void draw_text_sprites(running_machine *machine, | |
| 337 | static void draw_text_sprites(running_machine *machine, | |
| 338 | 338 | { |
| 339 | 339 | int i; |
| 340 | 340 |
| r1877 | r1878 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | /******************************************************************************/ |
| 80 | 80 | |
| 81 | static void draw_sprites(running_machine *machine, | |
| 81 | static void draw_sprites(running_machine *machine, | |
| 82 | 82 | { |
| 83 | 83 | int offs,priority_value; |
| 84 | 84 | |
| r1877 | r1878 | |
| 98 | 98 | if (!pri && !(colour>=priority_value)) continue; |
| 99 | 99 | |
| 100 | 100 | flash=x&0x800; |
| 101 | if (flash && ( | |
| 101 | if (flash && (vid | |
| 102 | 102 | |
| 103 | 103 | fx = y & 0x2000; |
| 104 | 104 | fy = y & 0x4000; |
| r1877 | r1878 | |
|---|---|---|
| 26 | 26 | static UINT8 btime_palette = 0; |
| 27 | 27 | static UINT8 bnj_scroll1 = 0; |
| 28 | 28 | static UINT8 bnj_scroll2 = 0; |
| 29 | static | |
| 29 | static | |
| 30 | 30 | static UINT8 lnc_sound_interrupt_enabled = 0; |
| 31 | 31 | |
| 32 | 32 | /*************************************************************************** |
| r1877 | r1878 | |
| 156 | 156 | WRITE8_HANDLER( btime_paletteram_w ) |
| 157 | 157 | { |
| 158 | 158 | /* RGB output is inverted */ |
| 159 | paletteram_BBGGGRRR_w(offset,~data); | |
| 159 | paletteram_BBGGGRRR_w(machine,offset,~data); | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | WRITE8_HANDLER( lnc_videoram_w ) |
| r1877 | r1878 | |
| 210 | 210 | y = offset % 32; |
| 211 | 211 | offset = 32 * y + x; |
| 212 | 212 | |
| 213 | lnc_videoram_w(offset,data); | |
| 213 | lnc_videoram_w(machine,offset,data); | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | WRITE8_HANDLER( btime_mirrorcolorram_w ) |
| r1877 | r1878 | |
| 289 | 289 | /* For now we just check 0x40 in DSW1, and ignore the write if we */ |
| 290 | 290 | /* are in upright controls mode. */ |
| 291 | 291 | |
| 292 | if (input_port_3_r(0) & 0x40) /* cocktail mode */ | |
| 293 | btime_video_control_w(offset, data); | |
| 292 | if (input_port_3_r(machine, 0) & 0x40) /* cocktail mode */ | |
| 293 | btime_video_control_w(machine, offset, data); | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | WRITE8_HANDLER( lnc_video_control_w ) |
| r1877 | r1878 | |
| 299 | 299 | // figure out how NMI's are disabled by the sound processor |
| 300 | 300 | lnc_sound_interrupt_enabled = data & 0x08; |
| 301 | 301 | |
| 302 | bnj_video_control_w(offset, data & 0x01); | |
| 302 | bnj_video_control_w(machine, offset, data & 0x01); | |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | WRITE8_HANDLER( disco_video_control_w ) |
| 306 | 306 | { |
| 307 | 307 | btime_palette = (data >> 2) & 0x03; |
| 308 | 308 | |
| 309 | if (!(input_port_3_r(0) & 0x40)) /* cocktail mode */ | |
| 309 | if (!(input_port_3_r(machine,0) & 0x40)) /* cocktail mode */ | |
| 310 | 310 | { |
| 311 | 311 | flip_screen_set(data & 0x01); |
| 312 | 312 | } |
| r1877 | r1878 | |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | |
| 323 | static void draw_chars(running_machine *machine, | |
| 323 | static void draw_chars(running_machine *machine, | |
| 324 | 324 | { |
| 325 | 325 | offs_t offs; |
| 326 | 326 | |
| r1877 | r1878 | |
| 349 | 349 | } |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | static void draw_sprites(running_machine *machine, | |
| 352 | static void draw_sprites(running_machine *machine, | |
| 353 | 353 | UINT8 sprite_y_adjust, UINT8 sprite_y_adjust_flip_screen, |
| 354 | 354 | UINT8 *sprite_ram, offs_t interleave) |
| 355 | 355 | { |
| r1877 | r1878 | |
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | |
| 404 | static void draw_background(running_machine *machine, | |
| 404 | static void draw_background(running_machine *machine, | |
| 405 | 405 | { |
| 406 | 406 | int i; |
| 407 | 407 |
| r1877 | r1878 | |
|---|---|---|
| 31 | 31 | void PC080SN_set_scroll(int chip,int tilemap_num,int scrollx,int scrolly); |
| 32 | 32 | void PC080SN_set_trans_pen(int chip,int tilemap_num,int pen); |
| 33 | 33 | void PC080SN_tilemap_update(void); |
| 34 | void PC080SN_tilemap_draw(mame_bitmap *bitmap,const rectangle *cliprect,int chip,int layer,int flags,UINT32 priority); | |
| 35 | void PC080SN_tilemap_draw_offset(mame_bitmap *bitmap,const rectangle *cliprect,int chip,int layer,int flags,UINT32 priority,int xoffs,int yoffs); | |
| 34 | void PC080SN_tilemap_draw(bitmap_t *bitmap,const rectangle *cliprect,int chip,int layer,int flags,UINT32 priority); | |
| 35 | void PC080SN_tilemap_draw_offset(bitmap_t *bitmap,const rectangle *cliprect,int chip,int layer,int flags,UINT32 priority,int xoffs,int yoffs); | |
| 36 | 36 | |
| 37 | 37 | /* For Topspeed */ |
| 38 | void PC080SN_tilemap_draw_special( | |
| 38 | void PC080SN_tilemap_draw_special( | |
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | /***************************************************************************/ |
| r1877 | r1878 | |
| 46 | 46 | WRITE16_HANDLER( PC090OJ_word_0_w ); |
| 47 | 47 | |
| 48 | 48 | void PC090OJ_eof_callback(void); |
| 49 | void PC090OJ_draw_sprites(running_machine *machine, | |
| 49 | void PC090OJ_draw_sprites(running_machine *machine, | |
| 50 | 50 | |
| 51 | 51 | extern UINT16 PC090OJ_sprite_ctrl; |
| 52 | 52 | |
| r1877 | r1878 | |
| 59 | 59 | WRITE16_HANDLER( TC0080VCO_word_w ); |
| 60 | 60 | |
| 61 | 61 | void TC0080VCO_tilemap_update(running_machine *machine); |
| 62 | void TC0080VCO_tilemap_draw(running_machine *machine, | |
| 62 | void TC0080VCO_tilemap_draw(running_machine *machine, | |
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | /***************************************************************************/ |
| r1877 | r1878 | |
| 108 | 108 | WRITE16_HANDLER( TC0100SCN_triple_screen_w ); |
| 109 | 109 | |
| 110 | 110 | void TC0100SCN_tilemap_update(running_machine *machine); |
| 111 | int TC0100SCN_tilemap_draw(running_machine *machine, | |
| 111 | int TC0100SCN_tilemap_draw(running_machine *machine, | |
| 112 | 112 | |
| 113 | 113 | /* returns 0 or 1 depending on the lowest priority tilemap set in the internal |
| 114 | 114 | register. Use this function to draw tilemaps in the correct order. */ |
| r1877 | r1878 | |
| 122 | 122 | WRITE16_HANDLER( TC0280GRD_word_w ); |
| 123 | 123 | WRITE16_HANDLER( TC0280GRD_ctrl_word_w ); |
| 124 | 124 | void TC0280GRD_tilemap_update(int base_color); |
| 125 | void TC0280GRD_zoom_draw( | |
| 125 | void TC0280GRD_zoom_draw( | |
| 126 | 126 | |
| 127 | 127 | void TC0430GRW_vh_start(int gfxnum); |
| 128 | 128 | READ16_HANDLER ( TC0430GRW_word_r ); |
| 129 | 129 | WRITE16_HANDLER( TC0430GRW_word_w ); |
| 130 | 130 | WRITE16_HANDLER( TC0430GRW_ctrl_word_w ); |
| 131 | 131 | void TC0430GRW_tilemap_update(int base_color); |
| 132 | void TC0430GRW_zoom_draw( | |
| 132 | void TC0430GRW_zoom_draw( | |
| 133 | 133 | |
| 134 | 134 | |
| 135 | 135 | /***************************************************************************/ |
| r1877 | r1878 | |
| 151 | 151 | WRITE32_HANDLER( TC0480SCP_ctrl_long_w ); |
| 152 | 152 | |
| 153 | 153 | void TC0480SCP_tilemap_update(running_machine *machine); |
| 154 | void TC0480SCP_tilemap_draw( | |
| 154 | void TC0480SCP_tilemap_draw( | |
| 155 | 155 | |
| 156 | 156 | /* Returns the priority order of the bg tilemaps set in the internal |
| 157 | 157 | register. The order in which the four layers should be drawn is |
| r1877 | r1878 | |
| 167 | 167 | READ16_HANDLER( TC0150ROD_word_r ); |
| 168 | 168 | WRITE16_HANDLER( TC0150ROD_word_w ); |
| 169 | 169 | void TC0150ROD_vh_start(void); |
| 170 | void TC0150ROD_draw( | |
| 170 | void TC0150ROD_draw( | |
| 171 | 171 | |
| 172 | 172 | |
| 173 | 173 | /***************************************************************************/ |
| r1877 | r1878 | |
|---|---|---|
| 55 | 55 | { |
| 56 | 56 | int i; |
| 57 | 57 | |
| 58 | paletteram_BBGGRRII_w(offset,data); | |
| 58 | paletteram_BBGGRRII_w(machine,offset,data); | |
| 59 | 59 | |
| 60 | 60 | // expand the sprite palette to full length |
| 61 | 61 | if (offset < 16) |
| 62 | 62 | { |
| 63 | paletteram_BBGGRRII_w(0x200 + offset * 16 + 1, data); | |
| 63 | paletteram_BBGGRRII_w(machine, 0x200 + offset * 16 + 1, data); | |
| 64 | 64 | |
| 65 | 65 | if (offset != 1) |
| 66 | 66 | { |
| 67 | 67 | for (i = 0; i < 16; i++) |
| 68 | 68 | { |
| 69 | paletteram_BBGGRRII_w(0x200 + offset + i * 16, data); | |
| 69 | paletteram_BBGGRRII_w(machine, 0x200 + offset + i * 16, data); | |
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | } |
| r1877 | r1878 | |
| 257 | 257 | * |
| 258 | 258 | *************************************/ |
| 259 | 259 | |
| 260 | static void nova2001_draw_sprites(running_machine *machine, | |
| 260 | static void nova2001_draw_sprites(running_machine *machine, | |
| 261 | 261 | { |
| 262 | 262 | const gfx_element *gfx = machine->gfx[0]; |
| 263 | 263 | int offs; |
| r1877 | r1878 | |
| 294 | 294 | } |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | static void pkunwar_draw_sprites(running_machine *machine, | |
| 297 | static void pkunwar_draw_sprites(running_machine *machine, | |
| 298 | 298 | { |
| 299 | 299 | const gfx_element *gfx = machine->gfx[0]; |
| 300 | 300 | int offs; |
| r1877 | r1878 | |
|---|---|---|
| 177 | 177 | ***************************************************************************/ |
| 178 | 178 | |
| 179 | 179 | #include "driver.h" |
| 180 | #include "deprecat.h" | |
| 181 | 180 | #include "cps1.h" |
| 182 | 181 | |
| 183 | 182 | #define VERBOSE 0 |
| r1877 | r1878 | |
| 538 | 537 | |
| 539 | 538 | /* Pang 3 EEPROM interface */ |
| 540 | 539 | if (cps1_game_config->kludge == 5 && offset == 0x7a/2) |
| 541 | return cps1_eeprom_port_r(0,mem_mask); | |
| 540 | return cps1_eeprom_port_r(machine,0,mem_mask); | |
| 542 | 541 | |
| 543 | 542 | return cps1_output[offset]; |
| 544 | 543 | } |
| r1877 | r1878 | |
| 548 | 547 | /* Pang 3 EEPROM interface */ |
| 549 | 548 | if (cps1_game_config->kludge == 5 && offset == 0x7a/2) |
| 550 | 549 | { |
| 551 | cps1_eeprom_port_w(0,data,mem_mask); | |
| 550 | cps1_eeprom_port_w(machine,0,data,mem_mask); | |
| 552 | 551 | return; |
| 553 | 552 | } |
| 554 | 553 | |
| r1877 | r1878 | |
| 1302 | 1301 | } |
| 1303 | 1302 | |
| 1304 | 1303 | |
| 1305 | static void cps1_render_sprites(running_machine *machine, | |
| 1304 | static void cps1_render_sprites(running_machine *machine, | |
| 1306 | 1305 | { |
| 1307 | 1306 | #define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY) \ |
| 1308 | 1307 | { \ |
| 1309 | if (flip_screen_get()) | |
| 1308 | if (flip_screen_get()) | |
| 1310 | 1309 | pdrawgfx(bitmap,machine->gfx[2], \ |
| 1311 | 1310 | CODE, \ |
| 1312 | 1311 | COLOR, \ |
| r1877 | r1878 | |
| 1545 | 1544 | #undef DRAWSPRITE |
| 1546 | 1545 | } |
| 1547 | 1546 | |
| 1548 | static void cps2_render_sprites(running_machine *machine, | |
| 1547 | static void cps2_render_sprites(running_machine *machine, | |
| 1549 | 1548 | { |
| 1550 | 1549 | #define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY) \ |
| 1551 | 1550 | { \ |
| 1552 | if (flip_screen_get()) | |
| 1551 | if (flip_screen_get()) | |
| 1553 | 1552 | pdrawgfx(bitmap,machine->gfx[2], \ |
| 1554 | 1553 | CODE, \ |
| 1555 | 1554 | COLOR, \ |
| r1877 | r1878 | |
| 1692 | 1691 | |
| 1693 | 1692 | |
| 1694 | 1693 | |
| 1695 | static void cps1_render_stars( | |
| 1694 | static void cps1_render_stars( | |
| 1696 | 1695 | { |
| 1697 | 1696 | int offs; |
| 1698 | 1697 | UINT8 *stars_rom = memory_region(REGION_GFX2); |
| r1877 | r1878 | |
| 1722 | 1721 | sy = 255 - sy; |
| 1723 | 1722 | } |
| 1724 | 1723 | |
| 1725 | col = ((col & 0xe0) >> 1) + ( | |
| 1724 | col = ((col & 0xe0) >> 1) + (vid | |
| 1726 | 1725 | |
| 1727 | 1726 | if (sx >= cliprect->min_x && sx <= cliprect->max_x && |
| 1728 | 1727 | sy >= cliprect->min_y && sy <= cliprect->max_y) |
| r1877 | r1878 | |
| 1748 | 1747 | sy = 255 - sy; |
| 1749 | 1748 | } |
| 1750 | 1749 | |
| 1751 | col = ((col & 0xe0) >> 1) + ( | |
| 1750 | col = ((col & 0xe0) >> 1) + (vid | |
| 1752 | 1751 | |
| 1753 | 1752 | if (sx >= cliprect->min_x && sx <= cliprect->max_x && |
| 1754 | 1753 | sy >= cliprect->min_y && sy <= cliprect->max_y) |
| r1877 | r1878 | |
| 1759 | 1758 | } |
| 1760 | 1759 | |
| 1761 | 1760 | |
| 1762 | static void cps1_render_layer(running_machine *machine, | |
| 1761 | static void cps1_render_layer(running_machine *machine, | |
| 1763 | 1762 | { |
| 1764 | 1763 | switch (layer) |
| 1765 | 1764 | { |
| r1877 | r1878 | |
| 1774 | 1773 | } |
| 1775 | 1774 | } |
| 1776 | 1775 | |
| 1777 | static void cps1_render_high_layer( | |
| 1776 | static void cps1_render_high_layer( | |
| 1778 | 1777 | { |
| 1779 | 1778 | switch (layer) |
| 1780 | 1779 | { |
| r1877 | r1878 | |
|---|---|---|
| 4 | 4 | #include "driver.h" |
| 5 | 5 | #include "sound/samples.h" |
| 6 | 6 | |
| 7 | static mame_bitmap *ship1_vid; | |
| 8 | static mame_bitmap *ship2_vid; | |
| 9 | static mame_bitmap *proj1_vid; | |
| 10 | static mame_bitmap *proj2_vid; | |
| 7 | static bitmap_t *ship1_vid; | |
| 8 | static bitmap_t *ship2_vid; | |
| 9 | static bitmap_t *proj1_vid; | |
| 10 | static bitmap_t *proj2_vid; | |
| 11 | 11 | |
| 12 | 12 | static int s1_x = 0; |
| 13 | 13 | static int s1_y = 0; |
| r1877 | r1878 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | ***************************************************************************/ |
| 146 | 146 | |
| 147 | static void draw_sprites(running_machine *machine, | |
| 147 | static void draw_sprites(running_machine *machine, | |
| 148 | 148 | { |
| 149 | 149 | int offs; |
| 150 | 150 |
| r1877 | r1878 | |
|---|---|---|
| 116 | 116 | flipy = data; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | static void draw_background(running_machine *machine, | |
| 119 | static void draw_background(running_machine *machine, | |
| 120 | 120 | { |
| 121 | 121 | int offs; |
| 122 | 122 | |
| r1877 | r1878 | |
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | static void draw_foreground(running_machine *machine, | |
| 159 | static void draw_foreground(running_machine *machine, | |
| 160 | 160 | { |
| 161 | 161 | int offs; |
| 162 | 162 | |
| r1877 | r1878 | |
| 195 | 195 | } |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | static void draw_sprites(running_machine *machine, | |
| 198 | static void draw_sprites(running_machine *machine, | |
| 199 | 199 | const rectangle *cliprect, UINT8* sprite_ram, |
| 200 | 200 | int bank) |
| 201 | 201 | { |
| r1877 | r1878 | |
|---|---|---|
| 94 | 94 | { |
| 95 | 95 | stactics_state *state = Machine->driver_data; |
| 96 | 96 | |
| 97 | | |
| 97 | | |
| 98 | 98 | { |
| 99 | case 4: // Page D | |
| 100 | if (data & 0x01) | |
| 101 | state->y_scroll_d = offset & 0xff; | |
| 102 | break; | |
| 103 | ||
| 104 | case 5: // Page E | |
| 105 | if (data & 0x01) | |
| 106 | state->y_scroll_e = offset & 0xff; | |
| 107 | break; | |
| 108 | ||
| 109 | case 6: // Page F | |
| 110 | if (data & 0x01) | |
| 111 | state->y_scroll_f = offset & 0xff; | |
| 112 | break; | |
| 113 | } | |
| 99 | switch (offset >> 8) | |
| 100 | { | |
| 101 | case 4: state->y_scroll_d = offset & 0xff; break; | |
| 102 | case 5: state->y_scroll_e = offset & 0xff; break; | |
| 103 | case 6: state->y_scroll_f = offset & 0xff; break; | |
| 104 | } | |
| 105 | } | |
| 114 | 106 | } |
| 115 | 107 | |
| 116 | 108 | |
| 117 | 109 | |
| 118 | 110 | /************************************* |
| 119 | 111 | * |
| 120 | * | |
| 112 | * Frane | |
| 121 | 113 | * |
| 122 | 114 | *************************************/ |
| 123 | 115 | |
| 124 | CUSTOM_INPUT( stactics_get_ | |
| 116 | CUSTOM_INPUT( stactics_get_fr | |
| 125 | 117 | { |
| 126 | stactics_state *state = | |
| 118 | stactics_state *state = machine->driver_data; | |
| 127 | 119 | |
| 128 | return (state-> | |
| 120 | return (state->fr | |
| 129 | 121 | } |
| 130 | 122 | |
| 131 | 123 | |
| r1877 | r1878 | |
| 181 | 173 | |
| 182 | 174 | CUSTOM_INPUT( stactics_get_shot_standby ) |
| 183 | 175 | { |
| 184 | stactics_state *state = | |
| 176 | stactics_state *state = machine->driver_data; | |
| 185 | 177 | |
| 186 | 178 | return state->shot_standby; |
| 187 | 179 | } |
| r1877 | r1878 | |
| 189 | 181 | |
| 190 | 182 | CUSTOM_INPUT( stactics_get_not_shot_arrive ) |
| 191 | 183 | { |
| 192 | stactics_state *state = | |
| 184 | stactics_state *state = machine->driver_data; | |
| 193 | 185 | |
| 194 | 186 | return !state->shot_arrive; |
| 195 | 187 | } |
| r1877 | r1878 | |
| 245 | 237 | } |
| 246 | 238 | |
| 247 | 239 | |
| 248 | static void draw_background(stactics_state *state, | |
| 240 | static void draw_background(stactics_state *state, | |
| 249 | 241 | { |
| 250 | 242 | int y; |
| 251 | 243 | |
| r1877 | r1878 | |
| 382 | 374 | state->y_scroll_e = 0; |
| 383 | 375 | state->y_scroll_f = 0; |
| 384 | 376 | |
| 377 | state->frame_count = 0; | |
| 385 | 378 | state->shot_standby = 1; |
| 386 | 379 | state->shot_arrive = 0; |
| 387 | 380 | state->beam_state = 0; |
| 388 | 381 | state->old_beam_state = 0; |
| 389 | state->vblank_count = 0; | |
| 390 | 382 | } |
| 391 | 383 | |
| 392 | 384 | |
| r1877 | r1878 | |
| 405 | 397 | draw_background(state, bitmap, cliprect); |
| 406 | 398 | update_artwork(state); |
| 407 | 399 | |
| 408 | state-> | |
| 400 | state->fr | |
| 409 | 401 | |
| 410 | 402 | return 0; |
| 411 | 403 | } |
| r1877 | r1878 | |
|---|---|---|
| 149 | 149 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | static void draw_sprites(running_machine *machine, | |
| 152 | static void draw_sprites(running_machine *machine, | |
| 153 | 153 | { |
| 154 | 154 | int offs; |
| 155 | 155 |
| r1877 | r1878 | |
|---|---|---|
| 31 | 31 | #define IS_POLYEND(x) (((x) ^ ((x) >> 1)) & 0x4000) |
| 32 | 32 | |
| 33 | 33 | |
| 34 | static mame_bitmap *screenbits; | |
| 35 | static mame_bitmap *zbuffer; | |
| 34 | static bitmap_t *screenbits; | |
| 35 | static bitmap_t *zbuffer; | |
| 36 | 36 | static rgb_t *palette; |
| 37 | 37 | static UINT32 *polydata_buffer; |
| 38 | 38 | static UINT32 polydata_count; |
| r1877 | r1878 | |
| 219 | 219 | static void render_noz_noperspective(void *destbase, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid) |
| 220 | 220 | { |
| 221 | 221 | const poly_extra_data *extra = extradata; |
| 222 | | |
| 222 | | |
| 223 | 223 | float zbase = recip_approx(extra->ooz_base); |
| 224 | 224 | float uoz_step = extra->uoz_dx * zbase; |
| 225 | 225 | float voz_step = extra->voz_dx * zbase; |
| r1877 | r1878 | |
| 260 | 260 | static void render_normal(void *destbase, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid) |
| 261 | 261 | { |
| 262 | 262 | const poly_extra_data *extra = extradata; |
| 263 | | |
| 263 | | |
| 264 | 264 | float ooz_dx = extra->ooz_dx; |
| 265 | 265 | float uoz_dx = extra->uoz_dx; |
| 266 | 266 | float voz_dx = extra->voz_dx; |
| r1877 | r1878 | |
| 312 | 312 | static void render_alphablend(void *destbase, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid) |
| 313 | 313 | { |
| 314 | 314 | const poly_extra_data *extra = extradata; |
| 315 | | |
| 315 | | |
| 316 | 316 | float ooz_dx = extra->ooz_dx; |
| 317 | 317 | float uoz_dx = extra->uoz_dx; |
| 318 | 318 | float voz_dx = extra->voz_dx; |
| r1877 | r1878 | |
|---|---|---|
| 179 | 179 | * |
| 180 | 180 | *************************************/ |
| 181 | 181 | |
| 182 | void lethalj_scanline_update(running_machine *machine, int screen, | |
| 182 | void lethalj_scanline_update(running_machine *machine, int screen, | |
| 183 | 183 | { |
| 184 | 184 | UINT16 *src = &screenram[(vispage << 17) | ((params->rowaddr << 9) & 0x3fe00)]; |
| 185 | 185 | UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0); |
| r1877 | r1878 | |
|---|---|---|
| 143 | 143 | dcon_gfx_bank_select = 0; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | static void draw_sprites(running_machine* machine, | |
| 146 | static void draw_sprites(running_machine* machine, | |
| 147 | 147 | { |
| 148 | 148 | int offs,fx,fy,x,y,color,sprite; |
| 149 | 149 | int dx,dy,ax,ay,inc,pri_mask = 0; |
| r1877 | r1878 | |
|---|---|---|
| 84 | 84 | |
| 85 | 85 | |
| 86 | 86 | |
| 87 | static void kickgoal_draw_sprites(running_machine *machine, | |
| 87 | static void kickgoal_draw_sprites(running_machine *machine, | |
| 88 | 88 | { |
| 89 | 89 | const gfx_element *gfx = machine->gfx[1]; |
| 90 | 90 | int offs; |
| r1877 | r1878 | |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | |
| 212 | static void actionhw_draw_sprites(running_machine *machine, | |
| 212 | static void actionhw_draw_sprites(running_machine *machine, | |
| 213 | 213 | { |
| 214 | 214 | const gfx_element *gfx = machine->gfx[1]; |
| 215 | 215 | int offs; |
| r1877 | r1878 | |
|---|---|---|
| 213 | 213 | |
| 214 | 214 | WRITE8_HANDLER( itech8_palette_w ) |
| 215 | 215 | { |
| 216 | tlc34076_w(offset/2, data); | |
| 216 | tlc34076_w(machine, offset/2, data); | |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | |
| r1877 | r1878 | |
| 305 | 305 | * |
| 306 | 306 | *************************************/ |
| 307 | 307 | |
| 308 | static void perform_blit( | |
| 308 | static void perform_blit(running_machine *machine) | |
| 309 | 309 | { |
| 310 | 310 | offs_t addr = tms_state.regs[TMS34061_XYADDRESS] | ((tms_state.regs[TMS34061_XYOFFSET] & 0x300) << 8); |
| 311 | 311 | UINT8 shift = (BLITTER_FLAGS & BLITFLAG_SHIFT) ? 4 : 0; |
| r1877 | r1878 | |
| 314 | 314 | int xdir = (BLITTER_FLAGS & BLITFLAG_XFLIP) ? -1 : 1; |
| 315 | 315 | int xflip = (BLITTER_FLAGS & BLITFLAG_XFLIP); |
| 316 | 316 | int rle = (BLITTER_FLAGS & BLITFLAG_RLE); |
| 317 | int color = tms34061_latch_r(0); | |
| 317 | int color = tms34061_latch_r(machine, 0); | |
| 318 | 318 | int width = BLITTER_WIDTH; |
| 319 | 319 | int height = BLITTER_HEIGHT; |
| 320 | 320 | UINT8 transmaskhi, transmasklo; |
| r1877 | r1878 | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | /* perform the blit */ |
| 517 | perform_blit(); | |
| 517 | perform_blit(machine); | |
| 518 | 518 | blit_in_progress = 1; |
| 519 | 519 | |
| 520 | 520 | /* set a timer to go off when we're done */ |
| r1877 | r1878 | |
| 544 | 544 | col ^= 2; |
| 545 | 545 | |
| 546 | 546 | /* Row address (RA0-RA8) is not dependent on the offset */ |
| 547 | tms34061_w(col, 0xff, func, data); | |
| 547 | tms34061_w(machine, col, 0xff, func, data); | |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | |
| r1877 | r1878 | |
| 559 | 559 | col ^= 2; |
| 560 | 560 | |
| 561 | 561 | /* Row address (RA0-RA8) is not dependent on the offset */ |
| 562 | return tms34061_r(col, 0xff, func); | |
| 562 | return tms34061_r(machine, col, 0xff, func); | |
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 |
| r1877 | r1878 | |
|---|---|---|
| 106 | 106 | static emu_timer *stars_scroll_timer; |
| 107 | 107 | static UINT8 timer_adjusted; |
| 108 | 108 | void galaxian_init_stars(running_machine *machine, int colors_offset); |
| 109 | static void (*draw_stars)(running_machine *, mame_bitmap *); /* function to call to draw the star layer */ | |
| 110 | static void noop_draw_stars(running_machine *machine, mame_bitmap *bitmap); | |
| 111 | void galaxian_draw_stars(running_machine *machine, mame_bitmap *bitmap); | |
| 112 | static void scramble_draw_stars(running_machine *machine, mame_bitmap *bitmap); | |
| 113 | static void rescue_draw_stars(running_machine *machine, mame_bitmap *bitmap); | |
| 114 | static void mariner_draw_stars(running_machine *machine, mame_bitmap *bitmap); | |
| 115 | static void jumpbug_draw_stars(running_machine *machine, mame_bitmap *bitmap); | |
| 109 | static void (*draw_stars)(running_machine *, bitmap_t *); /* function to call to draw the star layer */ | |
| 110 | static void noop_draw_stars(running_machine *machine, bitmap_t *bitmap); | |
| 111 | void galaxian_draw_stars(running_machine *machine, bitmap_t *bitmap); | |
| 112 | static void scramble_draw_stars(running_machine *machine, bitmap_t *bitmap); | |
| 113 | static void rescue_draw_stars(running_machine *machine, bitmap_t *bitmap); | |
| 114 | static void mariner_draw_stars(running_machine *machine, bitmap_t *bitmap); | |
| 115 | static void jumpbug_draw_stars(running_machine *machine, bitmap_t *bitmap); | |
| 116 | 116 | static void start_stars_blink_timer(double ra, double rb, double c); |
| 117 | 117 | static void start_stars_scroll_timer(void); |
| 118 | 118 | |
| 119 | 119 | /* bullets circuit */ |
| 120 | 120 | static UINT8 darkplnt_bullet_color; |
| 121 | static void (*draw_bullets)(running_machine *, mame_bitmap *,int,int,int); /* function to call to draw a bullet */ | |
| 122 | static void galaxian_draw_bullets(running_machine *machine, mame_bitmap *bitmap, int offs, int x, int y); | |
| 123 | static void gteikob2_draw_bullets(running_machine *machine, mame_bitmap *bitmap, int offs, int x, int y); | |
| 124 | static void scramble_draw_bullets(running_machine *machine, mame_bitmap *bitmap, int offs, int x, int y); | |
| 125 | static void theend_draw_bullets(running_machine *machine, mame_bitmap *bitmap, int offs, int x, int y); | |
| 126 | static void darkplnt_draw_bullets(running_machine *machine, mame_bitmap *bitmap, int offs, int x, int y); | |
| 127 | static void dambustr_draw_bullets(running_machine *machine, mame_bitmap *bitmap, int offs, int x, int y); | |
| 121 | static void (*draw_bullets)(running_machine *, bitmap_t *,int,int,int); /* function to call to draw a bullet */ | |
| 122 | static void galaxian_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y); | |
| 123 | static void gteikob2_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y); | |
| 124 | static void scramble_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y); | |
| 125 | static void theend_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y); | |
| 126 | static void darkplnt_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y); | |
| 127 | static void dambustr_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y); | |
| 128 | 128 | |
| 129 | 129 | /* background circuit */ |
| 130 | 130 | static UINT8 background_enable; |
| 131 | 131 | static UINT8 background_red, background_green, background_blue; |
| 132 | static void (*draw_background)(running_machine *, mame_bitmap *); /* function to call to draw the background */ | |
| 133 | static void galaxian_draw_background(running_machine *machine, mame_bitmap *bitmap); | |
| 134 | static void scramble_draw_background(running_machine *machine, mame_bitmap *bitmap); | |
| 135 | static void turtles_draw_background(running_machine *machine, mame_bitmap *bitmap); | |
| 136 | static void mariner_draw_background(running_machine *machine, mame_bitmap *bitmap); | |
| 137 | static void frogger_draw_background(running_machine *machine, mame_bitmap *bitmap); | |
| 138 | static void stratgyx_draw_background(running_machine *machine, mame_bitmap *bitmap); | |
| 139 | static void minefld_draw_background(running_machine *machine, mame_bitmap *bitmap); | |
| 140 | static void rescue_draw_background(running_machine *machine, mame_bitmap *bitmap); | |
| 141 | static void dambustr_draw_background(running_machine *machine, mame_bitmap *bitmap); | |
| 132 | static void (*draw_background)(running_machine *, bitmap_t *); /* function to call to draw the background */ | |
| 133 | static void galaxian_draw_background(running_machine *machine, bitmap_t *bitmap); | |
| 134 | static void scramble_draw_background(running_machine *machine, bitmap_t *bitmap); | |
| 135 | static void turtles_draw_background(running_machine *machine, bitmap_t *bitmap); | |
| 136 | static void mariner_draw_background(running_machine *machine, bitmap_t *bitmap); | |
| 137 | static void frogger_draw_background(running_machine *machine, bitmap_t *bitmap); | |
| 138 | static void stratgyx_draw_background(running_machine *machine, bitmap_t *bitmap); | |
| 139 | static void minefld_draw_background(running_machine *machine, bitmap_t *bitmap); | |
| 140 | static void rescue_draw_background(running_machine *machine, bitmap_t *bitmap); | |
| 141 | static void dambustr_draw_background(running_machine *machine, bitmap_t *bitmap); | |
| 142 | 142 | |
| 143 | 143 | static UINT16 rockclim_v; |
| 144 | 144 | static UINT16 rockclim_h; |
| r1877 | r1878 | |
| 147 | 147 | static int dambustr_bg_color_2; |
| 148 | 148 | static int dambustr_bg_priority; |
| 149 | 149 | static int dambustr_char_bank; |
| 150 | static | |
| 150 | static | |
| 151 | 151 | |
| 152 | 152 | |
| 153 | 153 | |
| r1877 | r1878 | |
| 512 | 512 | state_save_register_global(background_blue); |
| 513 | 513 | } |
| 514 | 514 | |
| 515 | static void video_start_common(running_machine *machine, tilemap_mapper_c | |
| 515 | static void video_start_common(running_machine *machine, tilemap_mapper_func | |
| 516 | 516 | { |
| 517 | 517 | bg_tilemap = tilemap_create(get_tile_info,get_memory_offset,8,8,32,32); |
| 518 | 518 | |
| r1877 | r1878 | |
| 805 | 805 | modify_spritecode = batman2_modify_spritecode; |
| 806 | 806 | } |
| 807 | 807 | |
| 808 | static void rockclim_draw_background(running_machine *machine, | |
| 808 | static void rockclim_draw_background(running_machine *machine, | |
| 809 | 809 | { |
| 810 | 810 | tilemap_draw(bitmap,0,rockclim_tilemap, 0,0); |
| 811 | 811 | } |
| r1877 | r1878 | |
| 1091 | 1091 | |
| 1092 | 1092 | WRITE8_HANDLER( gteikob2_flip_screen_x_w ) |
| 1093 | 1093 | { |
| 1094 | galaxian_flip_screen_x_w(offset, ~data); | |
| 1094 | galaxian_flip_screen_x_w(machine, offset, ~data); | |
| 1095 | 1095 | } |
| 1096 | 1096 | |
| 1097 | 1097 | WRITE8_HANDLER( gteikob2_flip_screen_y_w ) |
| 1098 | 1098 | { |
| 1099 | galaxian_flip_screen_y_w(offset, ~data); | |
| 1099 | galaxian_flip_screen_y_w(machine, offset, ~data); | |
| 1100 | 1100 | } |
| 1101 | 1101 | |
| 1102 | 1102 | |
| 1103 | 1103 | WRITE8_HANDLER( hotshock_flip_screen_w ) |
| 1104 | 1104 | { |
| 1105 | galaxian_flip_screen_x_w(offset, data); | |
| 1106 | galaxian_flip_screen_y_w(offset, data); | |
| 1105 | galaxian_flip_screen_x_w(machine, offset, data); | |
| 1106 | galaxian_flip_screen_y_w(machine, offset, data); | |
| 1107 | 1107 | } |
| 1108 | 1108 | |
| 1109 | 1109 | |
| r1877 | r1878 | |
| 1403 | 1403 | |
| 1404 | 1404 | /* bullet drawing functions */ |
| 1405 | 1405 | |
| 1406 | static void galaxian_draw_bullets(running_machine *machine, | |
| 1406 | static void galaxian_draw_bullets(running_machine *machine, | |
| 1407 | 1407 | { |
| 1408 | 1408 | int i; |
| 1409 | 1409 | |
| r1877 | r1878 | |
| 1426 | 1426 | } |
| 1427 | 1427 | } |
| 1428 | 1428 | |
| 1429 | static void gteikob2_draw_bullets(running_machine *machine, | |
| 1429 | static void gteikob2_draw_bullets(running_machine *machine, | |
| 1430 | 1430 | { |
| 1431 | 1431 | galaxian_draw_bullets(machine, bitmap, offs, 260 - x, y); |
| 1432 | 1432 | } |
| 1433 | 1433 | |
| 1434 | static void scramble_draw_bullets(running_machine *machine, | |
| 1434 | static void scramble_draw_bullets(running_machine *machine, | |
| 1435 | 1435 | { |
| 1436 | 1436 | if (flipscreen_x) x++; |
| 1437 | 1437 | |
| r1877 | r1878 | |
| 1445 | 1445 | } |
| 1446 | 1446 | } |
| 1447 | 1447 | |
| 1448 | static void darkplnt_draw_bullets(running_machine *machine, | |
| 1448 | static void darkplnt_draw_bullets(running_machine *machine, | |
| 1449 | 1449 | { |
| 1450 | 1450 | if (flipscreen_x) x++; |
| 1451 | 1451 | |
| r1877 | r1878 | |
| 1458 | 1458 | } |
| 1459 | 1459 | } |
| 1460 | 1460 | |
| 1461 | static void theend_draw_bullets(running_machine *machine, | |
| 1461 | static void theend_draw_bullets(running_machine *machine, | |
| 1462 | 1462 | { |
| 1463 | 1463 | int i; |
| 1464 | 1464 | |
| r1877 | r1878 | |
| 1476 | 1476 | } |
| 1477 | 1477 | } |
| 1478 | 1478 | |
| 1479 | static void dambustr_draw_bullets(running_machine *machine, | |
| 1479 | static void dambustr_draw_bullets(running_machine *machine, | |
| 1480 | 1480 | { |
| 1481 | 1481 | int i, color; |
| 1482 | 1482 | |
| r1877 | r1878 | |
| 1509 | 1509 | |
| 1510 | 1510 | /* background drawing functions */ |
| 1511 | 1511 | |
| 1512 | static void galaxian_draw_background(running_machine *machine, | |
| 1512 | static void galaxian_draw_background(running_machine *machine, | |
| 1513 | 1513 | { |
| 1514 | 1514 | /* plain black background */ |
| 1515 | 1515 | fillbitmap(bitmap,0,&machine->screen[0].visarea); |
| 1516 | 1516 | } |
| 1517 | 1517 | |
| 1518 | static void scramble_draw_background(running_machine *machine, | |
| 1518 | static void scramble_draw_background(running_machine *machine, | |
| 1519 | 1519 | { |
| 1520 | 1520 | if (background_enable) |
| 1521 | 1521 | fillbitmap(bitmap,BACKGROUND_COLOR_BASE,&machine->screen[0].visarea); |
| r1877 | r1878 | |
| 1523 | 1523 | fillbitmap(bitmap,0,&machine->screen[0].visarea); |
| 1524 | 1524 | } |
| 1525 | 1525 | |
| 1526 | static void turtles_draw_background(running_machine *machine, | |
| 1526 | static void turtles_draw_background(running_machine *machine, | |
| 1527 | 1527 | { |
| 1528 | 1528 | int color = (background_blue << 2) | (background_green << 1) | background_red; |
| 1529 | 1529 | |
| 1530 | 1530 | fillbitmap(bitmap,BACKGROUND_COLOR_BASE + color,&machine->screen[0].visarea); |
| 1531 | 1531 | } |
| 1532 | 1532 | |
| 1533 | static void frogger_draw_background(running_machine *machine, | |
| 1533 | static void frogger_draw_background(running_machine *machine, | |
| 1534 | 1534 | { |
| 1535 | 1535 | /* color split point verified on real machine */ |
| 1536 | 1536 | if (flipscreen_x) |
| r1877 | r1878 | |
| 1545 | 1545 | } |
| 1546 | 1546 | } |
| 1547 | 1547 | |
| 1548 | static void stratgyx_draw_background(running_machine *machine, | |
| 1548 | static void stratgyx_draw_background(running_machine *machine, | |
| 1549 | 1549 | { |
| 1550 | 1550 | UINT8 x; |
| 1551 | 1551 | UINT8 *prom; |
| r1877 | r1878 | |
| 1580 | 1580 | } |
| 1581 | 1581 | } |
| 1582 | 1582 | |
| 1583 | static void minefld_draw_background(running_machine *machine, | |
| 1583 | static void minefld_draw_background(running_machine *machine, | |
| 1584 | 1584 | { |
| 1585 | 1585 | if (background_enable) |
| 1586 | 1586 | { |
| r1877 | r1878 | |
| 1599 | 1599 | fillbitmap(bitmap,0,&machine->screen[0].visarea); |
| 1600 | 1600 | } |
| 1601 | 1601 | |
| 1602 | static void rescue_draw_background(running_machine *machine, | |
| 1602 | static void rescue_draw_background(running_machine *machine, | |
| 1603 | 1603 | { |
| 1604 | 1604 | if (background_enable) |
| 1605 | 1605 | { |
| r1877 | r1878 | |
| 1617 | 1617 | fillbitmap(bitmap,0,&machine->screen[0].visarea); |
| 1618 | 1618 | } |
| 1619 | 1619 | |
| 1620 | static void mariner_draw_background(running_machine *machine, | |
| 1620 | static void mariner_draw_background(running_machine *machine, | |
| 1621 | 1621 | { |
| 1622 | 1622 | UINT8 x; |
| 1623 | 1623 | UINT8 *prom; |
| r1877 | r1878 | |
| 1659 | 1659 | } |
| 1660 | 1660 | } |
| 1661 | 1661 | |
| 1662 | static void dambustr_draw_background(running_machine *machine, | |
| 1662 | static void dambustr_draw_background(running_machine *machine, | |
| 1663 | 1663 | { |
| 1664 | 1664 | int col1 = BACKGROUND_COLOR_BASE + dambustr_bg_color_1; |
| 1665 | 1665 | int col2 = BACKGROUND_COLOR_BASE + dambustr_bg_color_2; |
| r1877 | r1878 | |
| 1677 | 1677 | |
| 1678 | 1678 | } |
| 1679 | 1679 | |
| 1680 | static void dambustr_draw_upper_background( | |
| 1680 | static void dambustr_draw_upper_background( | |
| 1681 | 1681 | { |
| 1682 | 1682 | static rectangle clip = { 0, 0, 0, 0 }; |
| 1683 | 1683 | |
| r1877 | r1878 | |
| 1774 | 1774 | } |
| 1775 | 1775 | } |
| 1776 | 1776 | |
| 1777 | static void plot_star(running_machine *machine, | |
| 1777 | static void plot_star(running_machine *machine, | |
| 1778 | 1778 | { |
| 1779 | 1779 | if (y < machine->screen[0].visarea.min_y || |
| 1780 | 1780 | y > machine->screen[0].visarea.max_y || |
| r1877 | r1878 | |
| 1792 | 1792 | *BITMAP_ADDR16(bitmap, y, x) = stars_colors_start + color; |
| 1793 | 1793 | } |
| 1794 | 1794 | |
| 1795 | static void noop_draw_stars(running_machine *machine, | |
| 1795 | static void noop_draw_stars(running_machine *machine, | |
| 1796 | 1796 | { |
| 1797 | 1797 | } |
| 1798 | 1798 | |
| 1799 | void galaxian_draw_stars(running_machine *machine, | |
| 1799 | void galaxian_draw_stars(running_machine *machine, | |
| 1800 | 1800 | { |
| 1801 | 1801 | int offs; |
| 1802 | 1802 | |
| r1877 | r1878 | |
| 1823 | 1823 | } |
| 1824 | 1824 | } |
| 1825 | 1825 | |
| 1826 | static void scramble_draw_stars(running_machine *machine, | |
| 1826 | static void scramble_draw_stars(running_machine *machine, | |
| 1827 | 1827 | { |
| 1828 | 1828 | int offs; |
| 1829 | 1829 | |
| r1877 | r1878 | |
| 1867 | 1867 | } |
| 1868 | 1868 | } |
| 1869 | 1869 | |
| 1870 | static void rescue_draw_stars(running_machine *machine, | |
| 1870 | static void rescue_draw_stars(running_machine *machine, | |
| 1871 | 1871 | { |
| 1872 | 1872 | int offs; |
| 1873 | 1873 | |
| r1877 | r1878 | |
| 1913 | 1913 | } |
| 1914 | 1914 | } |
| 1915 | 1915 | |
| 1916 | static void mariner_draw_stars(running_machine *machine, | |
| 1916 | static void mariner_draw_stars(running_machine *machine, | |
| 1917 | 1917 | { |
| 1918 | 1918 | int offs; |
| 1919 | 1919 | UINT8 *prom; |
| r1877 | r1878 | |
| 1948 | 1948 | } |
| 1949 | 1949 | } |
| 1950 | 1950 | |
| 1951 | static void jumpbug_draw_stars(running_machine *machine, | |
| 1951 | static void jumpbug_draw_stars(running_machine *machine, | |
| 1952 | 1952 | { |
| 1953 | 1953 | int offs; |
| 1954 | 1954 | |
| r1877 | r1878 | |
| 2056 | 2056 | SET_TILE_INFO(2, code, 0, 0); |
| 2057 | 2057 | } |
| 2058 | 2058 | |
| 2059 | static void draw_bullets_common(running_machine *machine, | |
| 2059 | static void draw_bullets_common(running_machine *machine, | |
| 2060 | 2060 | { |
| 2061 | 2061 | int offs; |
| 2062 | 2062 | |
| r1877 | r1878 | |
| 2079 | 2079 | } |
| 2080 | 2080 | |
| 2081 | 2081 | |
| 2082 | static void draw_sprites(running_machine *machine, | |
| 2082 | static void draw_sprites(running_machine *machine, | |
| 2083 | 2083 | { |
| 2084 | 2084 | int offs; |
| 2085 | 2085 |
| r1877 | r1878 | |
|---|---|---|
| 132 | 132 | |
| 133 | 133 | ***************************************************************************/ |
| 134 | 134 | |
| 135 | static void draw_sprites(running_machine *machine, | |
| 135 | static void draw_sprites(running_machine *machine, | |
| 136 | 136 | { |
| 137 | 137 | int offs; |
| 138 | 138 |
| r1877 | r1878 | |
|---|---|---|
| 146 | 146 | return gfx->gfxdata + ((source_base+(dy%16)) * gfx->line_modulo); |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | static void bbusters_draw_block(running_machine *machine, | |
| 149 | static void bbusters_draw_block(running_machine *machine, | |
| 150 | 150 | { |
| 151 | 151 | pen_t pen_base = machine->gfx[bank]->color_base + machine->gfx[bank]->color_granularity * (color % machine->gfx[bank]->total_colors); |
| 152 | 152 | UINT32 xinc=(scale_line_count * 0x10000 ) / size; |
| r1877 | r1878 | |
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | static void draw_sprites(running_machine *machine, | |
| 194 | static void draw_sprites(running_machine *machine, | |
| 195 | 195 | { |
| 196 | 196 | const UINT8 *scale_table=memory_region(REGION_USER1); |
| 197 | 197 | int offs; |
| r1877 | r1878 | |
|---|---|---|
| 88 | 88 | VS920A[numchip].gfx_region = gfx_region; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | static void VS920A_draw(int numchip, | |
| 91 | static void VS920A_draw(int numchip, | |
| 92 | 92 | { |
| 93 | 93 | VS920A_cur_chip = &VS920A[numchip]; |
| 94 | 94 | |
| r1877 | r1878 | |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | /* THIS IS STILL WRONG! */ |
| 245 | static void MB60553_draw(running_machine *machine, int numchip, | |
| 245 | static void MB60553_draw(running_machine *machine, int numchip, | |
| 246 | 246 | { |
| 247 | 247 | int line; |
| 248 | 248 | rectangle clip; |
| r1877 | r1878 | |
| 389 | 389 | tCG10103 CG10103[MAX_CG10103]; |
| 390 | 390 | static tCG10103* CG10103_cur_chip; |
| 391 | 391 | |
| 392 | static void CG10103_draw_sprite(running_machine *machine, | |
| 392 | static void CG10103_draw_sprite(running_machine *machine, | |
| 393 | 393 | { |
| 394 | 394 | int ypos = spr[0] & 0x1FF; |
| 395 | 395 | int xpos = (spr[1] & 0x1FF); |
| r1877 | r1878 | |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | |
| 468 | static void CG10103_draw(running_machine *machine, int numchip, | |
| 468 | static void CG10103_draw(running_machine *machine, int numchip, | |
| 469 | 469 | { |
| 470 | 470 | UINT16* splist; |
| 471 | 471 | int i; |
| r1877 | r1878 | |
|---|---|---|
| 72 | 72 | |
| 73 | 73 | /**************************************************************************************/ |
| 74 | 74 | |
| 75 | static void tnk3_draw_background(running_machine *machine, | |
| 75 | static void tnk3_draw_background(running_machine *machine, | |
| 76 | 76 | int x_size, int y_size, int bg_type ) |
| 77 | 77 | { |
| 78 | 78 | const gfx_element *gfx = machine->gfx[1]; |
| r1877 | r1878 | |
| 108 | 108 | copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,1,&scrolly,cliprect); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | void tnk3_draw_text(running_machine *machine, | |
| 111 | void tnk3_draw_text(running_machine *machine, | |
| 112 | 112 | { |
| 113 | 113 | const gfx_element *gfx = machine->gfx[0]; |
| 114 | 114 | |
| r1877 | r1878 | |
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | static void tnk3_draw_status_main(running_machine *machine, | |
| 137 | static void tnk3_draw_status_main(running_machine *machine, | |
| 138 | 138 | { |
| 139 | 139 | const gfx_element *gfx = machine->gfx[0]; |
| 140 | 140 | |
| r1877 | r1878 | |
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | void tnk3_draw_status(running_machine *machine, | |
| 161 | void tnk3_draw_status(running_machine *machine, | |
| 162 | 162 | { |
| 163 | 163 | tnk3_draw_status_main(machine,bitmap,cliprect,bank,source, 0); |
| 164 | 164 | tnk3_draw_status_main(machine,bitmap,cliprect,bank,source,30); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | static void tnk3_draw_sprites(running_machine *machine, | |
| 167 | static void tnk3_draw_sprites(running_machine *machine, | |
| 168 | 168 | { |
| 169 | 169 | const gfx_element *gfx = machine->gfx[2]; |
| 170 | 170 | |
| r1877 | r1878 | |
| 244 | 244 | tmpbitmap = auto_bitmap_alloc( 512, 256, machine->screen[0].format ); |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | static void sgladiat_draw_background(running_machine *machine, | |
| 247 | static void sgladiat_draw_background(running_machine *machine, | |
| 248 | 248 | { |
| 249 | 249 | const gfx_element *gfx = machine->gfx[1]; |
| 250 | 250 | |
| r1877 | r1878 | |
| 290 | 290 | |
| 291 | 291 | /**************************************************************************************/ |
| 292 | 292 | |
| 293 | static void ikari_draw_sprites(running_machine *machine, | |
| 293 | static void ikari_draw_sprites(running_machine *machine, | |
| 294 | 294 | UINT8 *source, int mode ) |
| 295 | 295 | { |
| 296 | 296 | gfx_element *gfx = machine->gfx[mode]; |
| r1877 | r1878 | |
| 360 | 360 | |
| 361 | 361 | /**************************************************************/ |
| 362 | 362 | |
| 363 | static void tdfever_draw_bg(running_machine *machine, | |
| 363 | static void tdfever_draw_bg(running_machine *machine, | |
| 364 | 364 | { |
| 365 | 365 | const UINT8 *source = snk_rambase + 0x000; |
| 366 | 366 | const gfx_element *gfx = machine->gfx[1]; |
| r1877 | r1878 | |
| 413 | 413 | -xx-x--- (bank number) |
| 414 | 414 | x------- (x offset bit8) |
| 415 | 415 | */ |
| 416 | static void tdfever_draw_sp(running_machine *machine, | |
| 416 | static void tdfever_draw_sp(running_machine *machine, | |
| 417 | 417 | { |
| 418 | 418 | const UINT8 *source = snk_rambase + ((mode==2)?0x1800:0x1000); |
| 419 | 419 | const gfx_element *gfx = machine->gfx[(mode==1)?3:2]; |
| r1877 | r1878 | |
| 467 | 467 | } |
| 468 | 468 | } |
| 469 | 469 | |
| 470 | static void tdfever_draw_tx(running_machine *machine, | |
| 470 | static void tdfever_draw_tx(running_machine *machine, | |
| 471 | 471 | { |
| 472 | 472 | const UINT8 *source = snk_rambase - 0xd000 + base; |
| 473 | 473 | const gfx_element *gfx = machine->gfx[0]; |
| r1877 | r1878 | |
|---|---|---|
| 127 | 127 | |
| 128 | 128 | |
| 129 | 129 | /* 8x8x4 tiles only */ |
| 130 | #ifdef UNUSED_FUNCTON | |
| 130 | 131 | INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int layer,UINT16 *vram) |
| 131 | 132 | { |
| 132 | 133 | UINT16 code; |
| r1877 | r1878 | |
| 159 | 160 | (((tile & 0x0ff00000) >> 20) ^ 0x0f) + 0x100, |
| 160 | 161 | TILE_FLIPXY((code & 0x6000) >> 13)); |
| 161 | 162 | } |
| 163 | #endif | |
| 162 | 164 | |
| 163 | ||
| 164 | 165 | /* 8x8x4 or 8x8x8 tiles. It's the tile's color that decides: if its low 4 |
| 165 | 166 | bits are high ($f,$1f,$2f etc) the tile is 8bpp, otherwise it's 4bpp */ |
| 166 | 167 | INLINE void get_tile_info_8bit(running_machine *machine,tile_data *tileinfo,int tile_index,int layer,UINT16 *vram) |
| r1877 | r1878 | |
| 204 | 205 | |
| 205 | 206 | /* 16x16x4 or 16x16x8 tiles. It's the tile's color that decides: if its low 4 |
| 206 | 207 | bits are high ($f,$1f,$2f etc) the tile is 8bpp, otherwise it's 4bpp */ |
| 208 | #ifdef UNUSED_FUNCTON | |
| 207 | 209 | INLINE void get_tile_info_16x16_8bit(running_machine *machine,tile_data *tileinfo,int tile_index,int layer,UINT16 *vram) |
| 208 | 210 | { |
| 209 | 211 | UINT16 code; |
| r1877 | r1878 | |
| 242 | 244 | (((tile & 0x0ff00000) >> 20) ^ 0x0f) + 0x100, |
| 243 | 245 | TILE_FLIPXY((code & 0x6000) >> 13)); |
| 244 | 246 | } |
| 247 | #endif | |
| 245 | 248 | |
| 246 | ||
| 247 | 249 | INLINE void hyprduel_vram_w(offs_t offset,UINT16 data,UINT16 mem_mask,int layer,UINT16 *vram) |
| 248 | 250 | { |
| 249 | 251 | COMBINE_DATA(&vram[offset]); |
| r1877 | r1878 | |
| 390 | 392 | |
| 391 | 393 | /* Draw sprites */ |
| 392 | 394 | |
| 393 | static void draw_sprites(running_machine *machine, | |
| 395 | static void draw_sprites(running_machine *machine, | |
| 394 | 396 | { |
| 395 | 397 | const int region = REGION_GFX1; |
| 396 | 398 | |
| r1877 | r1878 | |
| 542 | 544 | ***************************************************************************/ |
| 543 | 545 | |
| 544 | 546 | /* Draw all the layers that match the given priority */ |
| 545 | static void draw_layers( | |
| 547 | static void draw_layers( | |
| 546 | 548 | { |
| 547 | 549 | UINT16 layers_pri = hyprduel_videoregs[0x10/2]; |
| 548 | 550 | int layer; |
| r1877 | r1878 | |
|---|---|---|
| 158 | 158 | } /* handle_mcu */ |
| 159 | 159 | |
| 160 | 160 | static void |
| 161 | video_update_common(running_machine *machine, | |
| 161 | video_update_common(running_machine *machine, | |
| 162 | 162 | { |
| 163 | 163 | int pri; |
| 164 | 164 | handle_mcu(); |
| r1877 | r1878 | |
|---|---|---|
| 95 | 95 | if (has_mo) |
| 96 | 96 | { |
| 97 | 97 | struct atarimo_rect_list rectlist; |
| 98 | | |
| 98 | | |
| 99 | 99 | int x, y, r; |
| 100 | 100 | |
| 101 | 101 | mobitmap = atarimo_render(machine, 0, cliprect, &rectlist); |
| r1877 | r1878 | |
|---|---|---|
| 74 | 74 | WRITE8_HANDLER( flstory_palette_w ) |
| 75 | 75 | { |
| 76 | 76 | if (offset & 0x100) |
| 77 | paletteram_xxxxBBBBGGGGRRRR_split2_w((offset & 0xff) + (palette_bank << 8),data); | |
| 77 | paletteram_xxxxBBBBGGGGRRRR_split2_w(machine, (offset & 0xff) + (palette_bank << 8),data); | |
| 78 | 78 | else |
| 79 | paletteram_xxxxBBBBGGGGRRRR_split1_w((offset & 0xff) + (palette_bank << 8),data); | |
| 79 | paletteram_xxxxBBBBGGGGRRRR_split1_w(machine, (offset & 0xff) + (palette_bank << 8),data); | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | READ8_HANDLER( flstory_palette_r ) |
| r1877 | r1878 | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | |
| 140 | static void flstory_draw_sprites(running_machine *machine, | |
| 140 | static void flstory_draw_sprites(running_machine *machine, | |
| 141 | 141 | { |
| 142 | 142 | int i; |
| 143 | 143 | |
| r1877 | r1878 | |
| 194 | 194 | return 0; |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | static void victnine_draw_sprites(running_machine *machine, | |
| 197 | static void victnine_draw_sprites(running_machine *machine, | |
| 198 | 198 | { |
| 199 | 199 | int i; |
| 200 | 200 |
| r1877 | r1878 | |
|---|---|---|
| 9 | 9 | static tilemap *suprslam_screen_tilemap, *suprslam_bg_tilemap; |
| 10 | 10 | |
| 11 | 11 | /* todo, fix zooming correctly, its _not_ like aerofgt */ |
| 12 | static void draw_sprites(running_machine *machine, | |
| 12 | static void draw_sprites(running_machine *machine, | |
| 13 | 13 | { |
| 14 | 14 | /* SPRITE INFO |
| 15 | 15 |
| r1877 | r1878 | |
|---|---|---|
| 50 | 50 | SET_TILE_INFO(bank, code, color, 0); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | WRITE8_HANDLER( calomega_mc6845_address_w ) | |
| 54 | { | |
| 55 | mc6845_address_w(mc6845, data); | |
| 56 | } | |
| 57 | ||
| 58 | READ8_HANDLER( calomega_mc6845_register_r ) | |
| 59 | { | |
| 60 | return mc6845_register_r(mc6845); | |
| 61 | } | |
| 62 | ||
| 63 | WRITE8_HANDLER( calomega_mc6845_register_w ) | |
| 64 | { | |
| 65 | mc6845_register_w(mc6845, data); | |
| 66 | } | |
| 67 | ||
| 68 | 53 | VIDEO_START( calomega ) |
| 69 | 54 | { |
| 70 | 55 | mc6845 = devtag_get_token(machine, MC6845, "crtc"); |
| r1877 | r1878 | |
|---|---|---|
| 80 | 80 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | static void draw_sprites(running_machine *machine, | |
| 83 | static void draw_sprites(running_machine *machine, | |
| 84 | 84 | { |
| 85 | 85 | int offs; |
| 86 | 86 |
| r1877 | r1878 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "deprecat.h" | |
| 11 | 10 | |
| 12 | 11 | |
| 13 | 12 | static pen_t (*map_color)(UINT8 x, UINT8 y); |
| r1877 | r1878 | |
| 249 | 248 | } |
| 250 | 249 | |
| 251 | 250 | |
| 252 | static void draw_bitmap( | |
| 251 | static void draw_bitmap( | |
| 253 | 252 | { |
| 254 | 253 | offs_t offs; |
| 255 | 254 | |
| r1877 | r1878 | |
| 280 | 279 | } |
| 281 | 280 | |
| 282 | 281 | |
| 283 | static void draw_sprites(running_machine *machine, | |
| 282 | static void draw_sprites(running_machine *machine, | |
| 284 | 283 | { |
| 285 | 284 | int offs; |
| 286 | 285 | |
| r1877 | r1878 | |
| 315 | 314 | } |
| 316 | 315 | |
| 317 | 316 | |
| 318 | static void cosmica_draw_starfield( | |
| 317 | static void cosmica_draw_starfield( | |
| 319 | 318 | { |
| 320 | 319 | UINT8 y = 0; |
| 321 | 320 | UINT8 map = 0; |
| r1877 | r1878 | |
| 334 | 333 | int hc, hb_; |
| 335 | 334 | |
| 336 | 335 | if (flip_screen_get()) |
| 337 | x1 = x - | |
| 336 | x1 = x - vid | |
| 338 | 337 | else |
| 339 | x1 = x + | |
| 338 | x1 = x + vid | |
| 340 | 339 | |
| 341 | 340 | hc = (x1 >> 2) & 0x01; |
| 342 | 341 | hb_ = (x >> 5) & 0x01; /* not a bug, this one is the real x */ |
| r1877 | r1878 | |
| 364 | 363 | } |
| 365 | 364 | |
| 366 | 365 | |
| 367 | static void devzone_draw_grid( | |
| 366 | static void devzone_draw_grid( | |
| 368 | 367 | { |
| 369 | 368 | UINT8 y; |
| 370 | 369 | UINT8 *horz_PROM = memory_region(REGION_USER2); |
| r1877 | r1878 | |
| 422 | 421 | } |
| 423 | 422 | |
| 424 | 423 | |
| 425 | static void nomnlnd_draw_background( | |
| 424 | static void nomnlnd_draw_background( | |
| 426 | 425 | { |
| 427 | 426 | UINT8 y = 0; |
| 428 | UINT8 water = | |
| 427 | UINT8 water = vid | |
| 429 | 428 | UINT8 *PROM = memory_region(REGION_USER2); |
| 430 | 429 | |
| 431 | 430 | /* all positioning is via logic gates: |
| r1877 | r1878 | |
|---|---|---|
| 107 | 107 | static UINT8 REFLECT; /* Should playfield be reflected or not */ |
| 108 | 108 | static UINT8 NUSIZx_changed; |
| 109 | 109 | |
| 110 | static | |
| 110 | static | |
| 111 | 111 | |
| 112 | 112 | static UINT16 screen_height; |
| 113 | 113 | |
| r1877 | r1878 | |
| 123 | 123 | { 1, 4, 0 } |
| 124 | 124 | }; |
| 125 | 125 | |
| 126 | static read16_handler tia_read_input_port; | |
| 127 | static read8_handler tia_get_databus; | |
| 128 | static write16_handler tia_vsync_callback; | |
| 126 | static read16_machine_func tia_read_input_port; | |
| 127 | static read8_machine_func tia_get_databus; | |
| 128 | static write16_machine_func tia_vsync_callback; | |
| 129 | 129 | |
| 130 | 130 | static void extend_palette(running_machine *machine) { |
| 131 | 131 | int i,j; |
| r1877 | r1878 | |
| 877 | 877 | Machine->screen[0].height); |
| 878 | 878 | |
| 879 | 879 | if ( tia_vsync_callback ) { |
| 880 | tia_vsync_callback( 0, curr_y, 0xFFFF ); | |
| 880 | tia_vsync_callback( machine, 0, curr_y, 0xFFFF ); | |
| 881 | 881 | } |
| 882 | 882 | |
| 883 | 883 | prev_y = 0; |
| r1877 | r1878 | |
| 1361 | 1361 | |
| 1362 | 1362 | static WRITE8_HANDLER( HMCLR_w ) |
| 1363 | 1363 | { |
| 1364 | HMP0_w( offset, 0 ); | |
| 1365 | HMP1_w( offset, 0 ); | |
| 1366 | HMM0_w( offset, 0 ); | |
| 1367 | HMM1_w( offset, 0 ); | |
| 1368 | HMBL_w( offset, 0 ); | |
| 1364 | HMP0_w( machine, offset, 0 ); | |
| 1365 | HMP1_w( machine, offset, 0 ); | |
| 1366 | HMM0_w( machine, offset, 0 ); | |
| 1367 | HMM1_w( machine, offset, 0 ); | |
| 1368 | HMBL_w( machine, offset, 0 ); | |
| 1369 | 1369 | } |
| 1370 | 1370 | |
| 1371 | 1371 | |
| r1877 | r1878 | |
| 1650 | 1650 | { |
| 1651 | 1651 | UINT64 elapsed = activecpu_gettotalcycles() - paddle_cycles; |
| 1652 | 1652 | int input = TIA_INPUT_PORT_ALWAYS_ON; |
| 1653 | ||
| 1654 | 1653 | if ( tia_read_input_port ) |
| 1655 | 1654 | { |
| 1656 | input = tia_read_input_port(offset & 3, 0xFFFF); | |
| 1655 | input = tia_read_input_port(machine, offset & 3, 0xFFFF); | |
| 1657 | 1656 | } |
| 1658 | 1657 | |
| 1659 | 1658 | if ( input == TIA_INPUT_PORT_ALWAYS_ON ) |
| r1877 | r1878 | |
| 1676 | 1675 | |
| 1677 | 1676 | if ( tia_get_databus ) |
| 1678 | 1677 | { |
| 1679 | data = tia_get_databus(offset) & 0x3f; | |
| 1678 | data = tia_get_databus(machine, offset) & 0x3f; | |
| 1680 | 1679 | } |
| 1681 | 1680 | |
| 1682 | 1681 | if (!(offset & 0x8)) |
| r1877 | r1878 | |
| 1703 | 1702 | case 0x7: |
| 1704 | 1703 | return data | CXPPMM; |
| 1705 | 1704 | case 0x8: |
| 1706 | return data | INPT_r(0); | |
| 1705 | return data | INPT_r(machine,0); | |
| 1707 | 1706 | case 0x9: |
| 1708 | return data | INPT_r(1); | |
| 1707 | return data | INPT_r(machine,1); | |
| 1709 | 1708 | case 0xA: |
| 1710 | return data | INPT_r(2); | |
| 1709 | return data | INPT_r(machine,2); | |
| 1711 | 1710 | case 0xB: |
| 1712 | return data | INPT_r(3); | |
| 1711 | return data | INPT_r(machine,3); | |
| 1713 | 1712 | case 0xC: |
| 1714 | 1713 | { |
| 1715 | int button = tia_read_input_port ? ( tia_read_input_port(4,0xFFFF) & 0x80 ) : 0x80; | |
| 1714 | int button = tia_read_input_port ? ( tia_read_input_port(machine,4,0xFFFF) & 0x80 ) : 0x80; | |
| 1716 | 1715 | INPT4 = ( VBLANK & 0x40) ? ( INPT4 & button ) : button; |
| 1717 | 1716 | } |
| 1718 | 1717 | return data | INPT4; |
| 1719 | 1718 | case 0xD: |
| 1720 | 1719 | { |
| 1721 | int button = tia_read_input_port ? ( tia_read_input_port(5,0xFFFF) & 0x80 ) : 0x80; | |
| 1720 | int button = tia_read_input_port ? ( tia_read_input_port(machine,5,0xFFFF) & 0x80 ) : 0x80; | |
| 1722 | 1721 | INPT5 = ( VBLANK & 0x40) ? ( INPT5 & button ) : button; |
| 1723 | 1722 | } |
| 1724 | 1723 | return data | INPT5; |
| r1877 | r1878 | |
| 1778 | 1777 | 0, // HMCLR |
| 1779 | 1778 | 0, // CXCLR |
| 1780 | 1779 | }; |
| 1781 | ||
| 1782 | 1780 | int curr_x = current_x(); |
| 1783 | 1781 | int curr_y = current_y(); |
| 1784 | 1782 | |
| r1877 | r1878 | |
| 1797 | 1795 | switch (offset) |
| 1798 | 1796 | { |
| 1799 | 1797 | case 0x00: |
| 1800 | VSYNC_w(offset, data); | |
| 1798 | VSYNC_w(machine, offset, data); | |
| 1801 | 1799 | break; |
| 1802 | 1800 | case 0x01: |
| 1803 | VBLANK_w(offset, data); | |
| 1801 | VBLANK_w(machine, offset, data); | |
| 1804 | 1802 | break; |
| 1805 | 1803 | case 0x02: |
| 1806 | WSYNC_w(offset, data); | |
| 1804 | WSYNC_w(machine, offset, data); | |
| 1807 | 1805 | break; |
| 1808 | 1806 | case 0x03: |
| 1809 | RSYNC_w(offset, data); | |
| 1807 | RSYNC_w(machine, offset, data); | |
| 1810 | 1808 | break; |
| 1811 | 1809 | case 0x04: |
| 1812 | NUSIZ0_w(offset, data); | |
| 1810 | NUSIZ0_w(machine, offset, data); | |
| 1813 | 1811 | break; |
| 1814 | 1812 | case 0x05: |
| 1815 | NUSIZ1_w(offset, data); | |
| 1813 | NUSIZ1_w(machine, offset, data); | |
| 1816 | 1814 | break; |
| 1817 | 1815 | case 0x06: |
| 1818 | 1816 | COLUP0 = data; |
| r1877 | r1878 | |
| 1827 | 1825 | COLUBK = data; |
| 1828 | 1826 | break; |
| 1829 | 1827 | case 0x0A: |
| 1830 | CTRLPF_w(offset, data); | |
| 1828 | CTRLPF_w(machine, offset, data); | |
| 1831 | 1829 | break; |
| 1832 | 1830 | case 0x0B: |
| 1833 | 1831 | REFP0 = data; |
| r1877 | r1878 | |
| 1845 | 1843 | PF2 = data; |
| 1846 | 1844 | break; |
| 1847 | 1845 | case 0x10: |
| 1848 | RESP0_w(offset, data); | |
| 1846 | RESP0_w(machine, offset, data); | |
| 1849 | 1847 | break; |
| 1850 | 1848 | case 0x11: |
| 1851 | RESP1_w(offset, data); | |
| 1849 | RESP1_w(machine, offset, data); | |
| 1852 | 1850 | break; |
| 1853 | 1851 | case 0x12: |
| 1854 | RESM0_w(offset, data); | |
| 1852 | RESM0_w(machine, offset, data); | |
| 1855 | 1853 | break; |
| 1856 | 1854 | case 0x13: |
| 1857 | RESM1_w(offset, data); | |
| 1855 | RESM1_w(machine, offset, data); | |
| 1858 | 1856 | break; |
| 1859 | 1857 | case 0x14: |
| 1860 | RESBL_w(offset, data); | |
| 1858 | RESBL_w(machine, offset, data); | |
| 1861 | 1859 | break; |
| 1862 | 1860 | |
| 1863 | 1861 | case 0x15: /* AUDC0 */ |
| r1877 | r1878 | |
| 1866 | 1864 | case 0x18: /* AUDF1 */ |
| 1867 | 1865 | case 0x19: /* AUDV0 */ |
| 1868 | 1866 | case 0x1A: /* AUDV1 */ |
| 1869 | tia_sound_w(offset, data); | |
| 1867 | tia_sound_w(machine, offset, data); | |
| 1870 | 1868 | break; |
| 1871 | 1869 | |
| 1872 | 1870 | case 0x1B: |
| 1873 | GRP0_w(offset, data); | |
| 1871 | GRP0_w(machine, offset, data); | |
| 1874 | 1872 | break; |
| 1875 | 1873 | case 0x1C: |
| 1876 | GRP1_w(offset, data); | |
| 1874 | GRP1_w(machine, offset, data); | |
| 1877 | 1875 | break; |
| 1878 | 1876 | case 0x1D: |
| 1879 | 1877 | ENAM0 = data; |
| r1877 | r1878 | |
| 1885 | 1883 | ENABL = data; |
| 1886 | 1884 | break; |
| 1887 | 1885 | case 0x20: |
| 1888 | HMP0_w(offset, data); | |
| 1886 | HMP0_w(machine, offset, data); | |
| 1889 | 1887 | break; |
| 1890 | 1888 | case 0x21: |
| 1891 | HMP1_w(offset, data); | |
| 1889 | HMP1_w(machine, offset, data); | |
| 1892 | 1890 | break; |
| 1893 | 1891 | case 0x22: |
| 1894 | HMM0_w(offset, data); | |
| 1892 | HMM0_w(machine, offset, data); | |
| 1895 | 1893 | break; |
| 1896 | 1894 | case 0x23: |
| 1897 | HMM1_w(offset, data); | |
| 1895 | HMM1_w(machine, offset, data); | |
| 1898 | 1896 | break; |
| 1899 | 1897 | case 0x24: |
| 1900 | HMBL_w(offset, data); | |
| 1898 | HMBL_w(machine, offset, data); | |
| 1901 | 1899 | break; |
| 1902 | 1900 | case 0x25: |
| 1903 | 1901 | VDELP0 = data; |
| r1877 | r1878 | |
| 1909 | 1907 | VDELBL = data; |
| 1910 | 1908 | break; |
| 1911 | 1909 | case 0x28: |
| 1912 | RESMP0_w(offset, data); | |
| 1910 | RESMP0_w(machine, offset, data); | |
| 1913 | 1911 | break; |
| 1914 | 1912 | case 0x29: |
| 1915 | RESMP1_w(offset, data); | |
| 1913 | RESMP1_w(machine, offset, data); | |
| 1916 | 1914 | break; |
| 1917 | 1915 | case 0x2A: |
| 1918 | HMOVE_w(offset, data); | |
| 1916 | HMOVE_w(machine, offset, data); | |
| 1919 | 1917 | break; |
| 1920 | 1918 | case 0x2B: |
| 1921 | HMCLR_w(offset, data); | |
| 1919 | HMCLR_w(machine, offset, data); | |
| 1922 | 1920 | break; |
| 1923 | 1921 | case 0x2C: |
| 1924 | CXCLR_w(offset, 0); | |
| 1922 | CXCLR_w(machine, offset, 0); | |
| 1925 | 1923 | break; |
| 1926 | 1924 | } |
| 1927 | 1925 | } |
| r1877 | r1878 | |
|---|---|---|
| 149 | 149 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | static void draw_sprites(running_machine *machine, | |
| 152 | static void draw_sprites(running_machine *machine, | |
| 153 | 153 | { |
| 154 | 154 | int offs; |
| 155 | 155 |
| r1877 | r1878 | |
|---|---|---|
| 922 | 922 | |
| 923 | 923 | /***********************************************************************************************/ |
| 924 | 924 | |
| 925 | static const poly_draw_scanline render_funcs[8] = | |
| 925 | static const poly_draw_scanline_func render_funcs[8] = | |
| 926 | 926 | { |
| 927 | 927 | model2_3d_render_0, /* checker = 0, textured = 0, translucent = 0 */ |
| 928 | 928 | model2_3d_render_1, /* checker = 0, textured = 0, translucent = 1 */ |
| r1877 | r1878 | |
| 934 | 934 | model2_3d_render_7 /* checker = 1, textured = 1, translucent = 1 */ |
| 935 | 935 | }; |
| 936 | 936 | |
| 937 | static void model2_3d_render( | |
| 937 | static void model2_3d_render( | |
| 938 | 938 | { |
| 939 | 939 | poly_extra_data *extra = poly_get_extra_data(poly); |
| 940 | 940 | UINT8 renderer; |
| r1877 | r1878 | |
|---|---|---|
| 7 | 7 | #define TIA_MAX_SCREEN_HEIGHT 342 |
| 8 | 8 | |
| 9 | 9 | struct tia_interface { |
| 10 | read16_handler read_input_port; | |
| 11 | read8_handler databus_contents; | |
| 12 | write16_handler vsync_callback; | |
| 10 | read16_machine_func read_input_port; | |
| 11 | read8_machine_func databus_contents; | |
| 12 | write16_machine_func vsync_callback; | |
| 13 | 13 | }; |
| 14 | 14 | |
| 15 | 15 | PALETTE_INIT( tia_NTSC ); |
| r1877 | r1878 | |
|---|---|---|
| 30 | 30 | palette_set_color(Machine,offset/2,MAKE_RGB(r,g,b)); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | static void sshangha_tilemap_draw( | |
| 33 | static void sshangha_tilemap_draw( | |
| 34 | 34 | { |
| 35 | const mame_bitmap *bitmap0 = tilemap_get_pixmap(pf1_16x16_tilemap); | |
| 36 | const mame_bitmap *bitmap1 = tilemap_get_pixmap(pf2_tilemap); | |
| 35 | const bitmap_t *bitmap0 = tilemap_get_pixmap(pf1_16x16_tilemap); | |
| 36 | const bitmap_t *bitmap1 = tilemap_get_pixmap(pf2_tilemap); | |
| 37 | 37 | int x,y,p; |
| 38 | 38 | |
| 39 | 39 | for (y=0; y<240; y++) { |
| r1877 | r1878 | |
| 55 | 55 | |
| 56 | 56 | /******************************************************************************/ |
| 57 | 57 | |
| 58 | static void draw_sprites(running_machine *machine, | |
| 58 | static void draw_sprites(running_machine *machine, | |
| 59 | 59 | { |
| 60 | 60 | int offs; |
| 61 | 61 | |
| r1877 | r1878 | |
| 71 | 71 | |
| 72 | 72 | y = spritesrc[offs]; |
| 73 | 73 | flash=y&0x1000; |
| 74 | if (flash && ( | |
| 74 | if (flash && (vid | |
| 75 | 75 | |
| 76 | 76 | x = spritesrc[offs+2]; |
| 77 | 77 | colour = (x >>9) & 0x1f; |
| r1877 | r1878 | |
|---|---|---|
| 162 | 162 | * |
| 163 | 163 | *************************************/ |
| 164 | 164 | |
| 165 | static void draw_sprites(running_machine *machine, | |
| 165 | static void draw_sprites(running_machine *machine, | |
| 166 | 166 | { |
| 167 | 167 | /* sprite information is scattered through memory */ |
| 168 | 168 | /* and uses a portion of the text layer memory (outside the visible area) */ |
| r1877 | r1878 | |
|---|---|---|
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | static void sys24_tile_draw_rect(running_machine *machine, | |
| 194 | static void sys24_tile_draw_rect(running_machine *machine, | |
| 195 | 195 | UINT16 tpri, UINT8 lpri, int win, int sx, int sy, int xx1, int yy1, int xx2, int yy2) |
| 196 | 196 | { |
| 197 | 197 | int y; |
| r1877 | r1878 | |
| 325 | 325 | // about sprite priority hence the lack of support for the |
| 326 | 326 | // priority_bitmap |
| 327 | 327 | |
| 328 | static void sys24_tile_draw_rect_rgb(running_machine *machine, | |
| 328 | static void sys24_tile_draw_rect_rgb(running_machine *machine, | |
| 329 | 329 | UINT16 tpri, UINT8 lpri, int win, int sx, int sy, int xx1, int yy1, int xx2, int yy2) |
| 330 | 330 | { |
| 331 | 331 | int y; |
| r1877 | r1878 | |
| 437 | 437 | } |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | void sys24_tile_draw(running_machine *machine, | |
| 440 | void sys24_tile_draw(running_machine *machine, | |
| 441 | 441 | { |
| 442 | 442 | UINT16 hscr = sys24_tile_ram[0x5000+(layer >> 1)]; |
| 443 | 443 | UINT16 vscr = sys24_tile_ram[0x5004+(layer >> 1)]; |
| r1877 | r1878 | |
| 511 | 511 | }; |
| 512 | 512 | |
| 513 | 513 | } else { |
| 514 | mame_bitmap *bm, *tm; | |
| 515 | void (*draw)(running_machine *machine, mame_bitmap *, mame_bitmap *, mame_bitmap *, const UINT16 *, | |
| 514 | bitmap_t *bm, *tm; | |
| 515 | void (*draw)(running_machine *machine, bitmap_t *, bitmap_t *, bitmap_t *, const UINT16 *, | |
| 516 | 516 | UINT16, UINT8, int, int, int, int, int, int, int); |
| 517 | 517 | int win = layer & 1; |
| 518 | 518 | |
| r1877 | r1878 | |
| 604 | 604 | |
| 605 | 605 | READ32_HANDLER(sys24_tile32_r) |
| 606 | 606 | { |
| 607 | return sys24_tile_r(offset*2, mem_mask&0xffff) | sys24_tile_r((offset*2)+1, mem_mask>>16)<<16; | |
| 607 | return sys24_tile_r(machine, offset*2, mem_mask&0xffff) | sys24_tile_r(machine, (offset*2)+1, mem_mask>>16)<<16; | |
| 608 | 608 | } |
| 609 | 609 | |
| 610 | 610 | READ32_HANDLER(sys24_char32_r) |
| 611 | 611 | { |
| 612 | return sys24_char_r(offset*2, mem_mask&0xffff) | sys24_char_r((offset*2)+1, mem_mask>>16)<<16; | |
| 612 | return sys24_char_r(machine, offset*2, mem_mask&0xffff) | sys24_char_r(machine, (offset*2)+1, mem_mask>>16)<<16; | |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | 615 | WRITE32_HANDLER(sys24_tile32_w) |
| 616 | 616 | { |
| 617 | sys24_tile_w(offset*2, data&0xffff, mem_mask&0xffff); | |
| 618 | sys24_tile_w((offset*2)+1, data>>16, mem_mask>>16); | |
| 617 | sys24_tile_w(machine, offset*2, data&0xffff, mem_mask&0xffff); | |
| 618 | sys24_tile_w(machine, (offset*2)+1, data>>16, mem_mask>>16); | |
| 619 | 619 | } |
| 620 | 620 | |
| 621 | 621 | WRITE32_HANDLER(sys24_char32_w) |
| 622 | 622 | { |
| 623 | sys24_char_w(offset*2, data&0xffff, mem_mask&0xffff); | |
| 624 | sys24_char_w((offset*2)+1, data>>16, mem_mask>>16); | |
| 623 | sys24_char_w(machine,offset*2, data&0xffff, mem_mask&0xffff); | |
| 624 | sys24_char_w(machine,(offset*2)+1, data>>16, mem_mask>>16); | |
| 625 | 625 | } |
| 626 | 626 | |
| 627 | 627 | // - System 24 |
| r1877 | r1878 | |
| 656 | 656 | 0 11------ -------- |
| 657 | 657 | */ |
| 658 | 658 | |
| 659 | void sys24_sprite_draw( | |
| 659 | void sys24_sprite_draw( | |
| 660 | 660 | { |
| 661 | 661 | UINT16 curspr = 0; |
| 662 | 662 | int countspr = 0; |
| r1877 | r1878 | |
|---|---|---|
| 14 | 14 | static UINT8 *popeye_bitmapram; |
| 15 | 15 | static size_t popeye_bitmapram_size = 0x2000; |
| 16 | 16 | |
| 17 | static | |
| 17 | static | |
| 18 | 18 | static int invertmask; |
| 19 | 19 | static int bitmap_type; |
| 20 | 20 | enum { TYPE_SKYSKIPR, TYPE_POPEYE }; |
| r1877 | r1878 | |
| 233 | 233 | if (data & 0x80) |
| 234 | 234 | offset |= 0x40; |
| 235 | 235 | |
| 236 | popeye_bitmap_w(offset,data); | |
| 236 | popeye_bitmap_w(machine,offset,data); | |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | static TILE_GET_INFO( get_fg_tile_info ) |
| r1877 | r1878 | |
| 272 | 272 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | static void draw_background(running_machine *machine, | |
| 275 | static void draw_background(running_machine *machine, | |
| 276 | 276 | { |
| 277 | 277 | int offs; |
| 278 | 278 | static int lastflip = 0; |
| r1877 | r1878 | |
| 280 | 280 | if (lastflip != flip_screen_get()) |
| 281 | 281 | { |
| 282 | 282 | for (offs = 0;offs < popeye_bitmapram_size;offs++) |
| 283 | popeye_bitmap_w(offs,popeye_bitmapram[offs]); | |
| 283 | popeye_bitmap_w(machine,offs,popeye_bitmapram[offs]); | |
| 284 | 284 | |
| 285 | 285 | lastflip = flip_screen_get(); |
| 286 | 286 | } |
| r1877 | r1878 | |
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | static void draw_sprites(running_machine *machine, | |
| 312 | static void draw_sprites(running_machine *machine, | |
| 313 | 313 | { |
| 314 | 314 | int offs; |
| 315 | 315 |
| r1877 | r1878 | |
|---|---|---|
| 27 | 27 | /* plot a bitmap marker */ |
| 28 | 28 | /* hardware has 2 marker sizes 2x2 and 4x2 selected by jumper */ |
| 29 | 29 | /* meadows lanes normaly use 2x2 pixels and lazer command uses either */ |
| 30 | static void plot_pattern(running_machine *machine, | |
| 30 | static void plot_pattern(running_machine *machine, | |
| 31 | 31 | { |
| 32 | 32 | int xbit, ybit, size; |
| 33 | 33 | |
| 34 | 34 | size = 2; |
| 35 | if (input_port_2_r(0) & 0x40) | |
| 35 | if (input_port_2_r(machine,0) & 0x40) | |
| 36 | 36 | { |
| 37 | 37 | size = 4; |
| 38 | 38 | } |
| r1877 | r1878 | |
| 57 | 57 | { |
| 58 | 58 | int i,x,y; |
| 59 | 59 | |
| 60 | int video_inverted = input_port_2_r(0) & 0x20; | |
| 60 | int video_inverted = input_port_2_r(machine,0) & 0x20; | |
| 61 | 61 | |
| 62 | 62 | /* The first row of characters are invisible */ |
| 63 | 63 | for (i = 0; i < (VERT_RES - 1) * HORZ_RES; i++) |
| r1877 | r1878 | |
|---|---|---|
| 8 | 8 | videoram[offset] = data; |
| 9 | 9 | tilemap_mark_tile_dirty(bg_tilemap, offset); |
| 10 | 10 | |
| 11 | if (input_port_3_r(0) & 0x80) | |
| 11 | if (input_port_3_r(machine,0) & 0x80) | |
| 12 | 12 | { |
| 13 | 13 | logerror("blockade_videoram_w: scanline %d\n", video_screen_get_vpos(0)); |
| 14 | 14 | cpu_spinuntil_int(); |
| r1877 | r1878 | |
|---|---|---|
| 12 | 12 | // System24 |
| 13 | 13 | void sys24_tile_vh_start(running_machine *machine, UINT16 tile_mask); |
| 14 | 14 | void sys24_tile_update(running_machine *machine); |
| 15 | void sys24_tile_draw(running_machine *machine, | |
| 15 | void sys24_tile_draw(running_machine *machine, | |
| 16 | 16 | |
| 17 | 17 | READ16_HANDLER(sys24_tile_r); |
| 18 | 18 | READ16_HANDLER(sys24_char_r); |
| r1877 | r1878 | |
| 27 | 27 | // Sprites |
| 28 | 28 | // System24 |
| 29 | 29 | void sys24_sprite_vh_start(void); |
| 30 | void sys24_sprite_draw( | |
| 30 | void sys24_sprite_draw( | |
| 31 | 31 | |
| 32 | 32 | WRITE16_HANDLER (sys24_sprite_w); |
| 33 | 33 | READ16_HANDLER (sys24_sprite_r); |
| r1877 | r1878 | |
|---|---|---|
| 88 | 88 | -----x-- -------- -------- -------- Flip X |
| 89 | 89 | -------- -------- -------- -------- Flip Y(used?) |
| 90 | 90 | */ |
| 91 | static void draw_sprites(running_machine *machine, | |
| 91 | static void draw_sprites(running_machine *machine, | |
| 92 | 92 | { |
| 93 | 93 | int offs,fx,fy,x,y,color,sprite; |
| 94 | 94 |
| r1877 | r1878 | |
|---|---|---|
| 218 | 218 | |
| 219 | 219 | ***************************************************************************/ |
| 220 | 220 | |
| 221 | static void draw_sprites(running_machine *machine, | |
| 221 | static void draw_sprites(running_machine *machine, | |
| 222 | 222 | { |
| 223 | 223 | UINT16 *s = spriteram16; |
| 224 | 224 | UINT16 *end = spriteram16 + spriteram_size/2; |
| r1877 | r1878 | |
|---|---|---|
| 82 | 82 | |
| 83 | 83 | ***************************************************************************/ |
| 84 | 84 | |
| 85 | static void draw_sprites(running_machine *machine, | |
| 85 | static void draw_sprites(running_machine *machine, | |
| 86 | 86 | { |
| 87 | 87 | int offs,x,y,color,sprite,flipx,flipy; |
| 88 | 88 |
| r1877 | r1878 | |
|---|---|---|
| 13 | 13 | ***************************************************************************/ |
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | #include "deprecat.h" | |
| 17 | 16 | #include "lemmings.h" |
| 18 | 17 | |
| 19 | 18 | UINT16 *lemmings_pixel_0_data,*lemmings_pixel_1_data,*lemmings_vram_data,*lemmings_control_data; |
| 20 | 19 | static UINT16 *sprite_triple_buffer_0,*sprite_triple_buffer_1; |
| 21 | 20 | static UINT8 *vram_buffer, *vram_dirty; |
| 22 | static | |
| 21 | static | |
| 23 | 22 | static tilemap *vram_tilemap; |
| 24 | 23 | |
| 25 | 24 | /******************************************************************************/ |
| 26 | 25 | |
| 27 | static void draw_sprites(running_machine *machine, | |
| 26 | static void draw_sprites(running_machine *machine, | |
| 28 | 27 | { |
| 29 | 28 | int offs; |
| 30 | 29 | |
| r1877 | r1878 | |
| 39 | 38 | |
| 40 | 39 | y = spritedata[offs]; |
| 41 | 40 | flash=y&0x1000; |
| 42 | if (flash && ( | |
| 41 | if (flash && (vid | |
| 43 | 42 | |
| 44 | 43 | x = spritedata[offs+2]; |
| 45 | 44 | colour = (x >>9) & 0xf; |
| r1877 | r1878 | |
|---|---|---|
| 163 | 163 | * |
| 164 | 164 | *************************************/ |
| 165 | 165 | |
| 166 | static void draw_sprites(running_machine *machine, | |
| 166 | static void draw_sprites(running_machine *machine, | |
| 167 | 167 | { |
| 168 | 168 | int offs; |
| 169 | 169 |
| r1877 | r1878 | |
|---|---|---|
| 128 | 128 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | static void draw_sprites(running_machine *machine, | |
| 131 | static void draw_sprites(running_machine *machine, | |
| 132 | 132 | { |
| 133 | 133 | int offs; |
| 134 | 134 |
| r1877 | r1878 | |
|---|---|---|
| 154 | 154 | state_save_register_global(tiamc1_bg_hshift); |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | static void draw_sprites(running_machine *machine, | |
| 157 | static void draw_sprites(running_machine *machine, | |
| 158 | 158 | { |
| 159 | 159 | int offs; |
| 160 | 160 |
| r1877 | r1878 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | |
| 121 | 121 | #include "driver.h" |
| 122 | #include "deprecat.h" | |
| 122 | 123 | #include "toaplan1.h" |
| 123 | 124 | #include "cpu/m68000/m68000.h" |
| 124 | 125 | |
| r1877 | r1878 | |
| 318 | 319 | |
| 319 | 320 | static void rallybik_flipscreen(void) |
| 320 | 321 | { |
| 321 | rallybik_bcu_flipscreen_w(0, bcu_flipscreen, 0); | |
| 322 | rallybik_bcu_flipscreen_w(Machine, 0, bcu_flipscreen, 0); | |
| 322 | 323 | } |
| 323 | 324 | |
| 324 | 325 | static void toaplan1_flipscreen(void) |
| 325 | 326 | { |
| 326 | toaplan1_bcu_flipscreen_w(0, bcu_flipscreen, 0); | |
| 327 | toaplan1_bcu_flipscreen_w(Machine, 0, bcu_flipscreen, 0); | |
| 327 | 328 | } |
| 328 | 329 | |
| 329 | 330 | |
| r1877 | r1878 | |
| 531 | 532 | WRITE16_HANDLER( toaplan1_colorram1_w ) |
| 532 | 533 | { |
| 533 | 534 | COMBINE_DATA(&toaplan1_colorram1[offset]); |
| 534 | paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, data, mem_mask); | |
| 535 | paletteram16_xBBBBBGGGGGRRRRR_word_w(machine,offset, data, mem_mask); | |
| 535 | 536 | } |
| 536 | 537 | |
| 537 | 538 | /* sprite palette */ |
| r1877 | r1878 | |
| 543 | 544 | WRITE16_HANDLER( toaplan1_colorram2_w ) |
| 544 | 545 | { |
| 545 | 546 | COMBINE_DATA(&toaplan1_colorram2[offset]); |
| 546 | paletteram16_xBBBBBGGGGGRRRRR_word_w(offset+(toaplan1_colorram1_size/2), data, mem_mask); | |
| 547 | paletteram16_xBBBBBGGGGGRRRRR_word_w(machine,offset+(toaplan1_colorram1_size/2), data, mem_mask); | |
| 547 | 548 | } |
| 548 | 549 | |
| 549 | 550 | READ16_HANDLER( toaplan1_spriteram16_r ) |
| r1877 | r1878 | |
| 599 | 600 | if (toaplan1_unk_reset_port && toaplan1_reset) |
| 600 | 601 | { |
| 601 | 602 | toaplan1_reset = 0; |
| 602 | toaplan1_reset_sound(0,0,0); | |
| 603 | toaplan1_reset_sound(machine,0,0,0); | |
| 603 | 604 | } |
| 604 | 605 | } |
| 605 | 606 | |
| r1877 | r1878 | |
| 649 | 650 | |
| 650 | 651 | READ16_HANDLER( rallybik_tileram16_r ) |
| 651 | 652 | { |
| 652 | UINT16 data = toaplan1_tileram16_r(offset, mem_mask); | |
| 653 | UINT16 data = toaplan1_tileram16_r(machine, offset, mem_mask); | |
| 653 | 654 | |
| 654 | 655 | if (offset == 0) /* some bit lines may be stuck to others */ |
| 655 | 656 | { |
| r1877 | r1878 | |
| 941 | 942 | ***************************************************************************/ |
| 942 | 943 | |
| 943 | 944 | // custom function to draw a single sprite. needed to keep correct sprites - sprites and sprites - tilemaps priorities |
| 944 | static void toaplan1_draw_sprite_custom( | |
| 945 | static void toaplan1_draw_sprite_custom( | |
| 945 | 946 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 946 | 947 | const rectangle *clip,int priority) |
| 947 | 948 | { |
| r1877 | r1878 | |
| 1040 | 1041 | } |
| 1041 | 1042 | |
| 1042 | 1043 | |
| 1043 | static void draw_sprites(running_machine *machine, | |
| 1044 | static void draw_sprites(running_machine *machine, | |
| 1044 | 1045 | { |
| 1045 | 1046 | UINT16 *source = (UINT16 *)(buffered_spriteram16); |
| 1046 | 1047 | UINT16 *size = (UINT16 *)(toaplan1_buffered_spritesizeram16); |
| r1877 | r1878 | |
| 1106 | 1107 | } |
| 1107 | 1108 | |
| 1108 | 1109 | |
| 1109 | static void rallybik_draw_sprites(running_machine *machine, | |
| 1110 | static void rallybik_draw_sprites(running_machine *machine, | |
| 1110 | 1111 | { |
| 1111 | 1112 | int offs; |
| 1112 | 1113 | |
| r1877 | r1878 | |
| 1140 | 1141 | |
| 1141 | 1142 | |
| 1142 | 1143 | /*************************************************************************** |
| 1143 | Draw the game screen in the given | |
| 1144 | Draw the game screen in the given | |
| 1144 | 1145 | ***************************************************************************/ |
| 1145 | 1146 | |
| 1146 | 1147 | VIDEO_UPDATE( rallybik ) |
| r1877 | r1878 | |
| 1229 | 1230 | |
| 1230 | 1231 | VIDEO_EOF( rallybik ) |
| 1231 | 1232 | { |
| 1232 | buffer_spriteram16_w(0, 0, 0); | |
| 1233 | buffer_spriteram16_w(machine, 0, 0, 0); | |
| 1233 | 1234 | } |
| 1234 | 1235 | |
| 1235 | 1236 | VIDEO_EOF( toaplan1 ) |
| 1236 | 1237 | { |
| 1237 | buffer_spriteram16_w(0, 0, 0); | |
| 1238 | buffer_spriteram16_w(machine, 0, 0, 0); | |
| 1238 | 1239 | memcpy(toaplan1_buffered_spritesizeram16, toaplan1_spritesizeram16, TOAPLAN1_SPRITESIZERAM_SIZE); |
| 1239 | 1240 | } |
| 1240 | 1241 | |
| 1241 | 1242 | VIDEO_EOF( samesame ) |
| 1242 | 1243 | { |
| 1243 | buffer_spriteram16_w(0, 0, 0); | |
| 1244 | buffer_spriteram16_w(machine, 0, 0, 0); | |
| 1244 | 1245 | memcpy(toaplan1_buffered_spritesizeram16, toaplan1_spritesizeram16, TOAPLAN1_SPRITESIZERAM_SIZE); |
| 1245 | 1246 | cpunum_set_input_line(machine, 0, MC68000_IRQ_2, HOLD_LINE); /* Frame done */ |
| 1246 | 1247 | } |
| r1877 | r1878 | |
|---|---|---|
| 450 | 450 | } |
| 451 | 451 | |
| 452 | 452 | /* handle everything else */ |
| 453 | segag80r_videoram_w(offset, data); | |
| 453 | segag80r_videoram_w(machine, offset, data); | |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | |
| r1877 | r1878 | |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | /* handle everything else */ |
| 522 | segag80r_videoram_w(offset, data); | |
| 522 | segag80r_videoram_w(machine, offset, data); | |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | |
| r1877 | r1878 | |
| 602 | 602 | } |
| 603 | 603 | |
| 604 | 604 | /* handle everything else */ |
| 605 | segag80r_videoram_w(offset, data); | |
| 605 | segag80r_videoram_w(machine, offset, data); | |
| 606 | 606 | } |
| 607 | 607 | |
| 608 | 608 | |
| r1877 | r1878 | |
| 645 | 645 | * |
| 646 | 646 | *************************************/ |
| 647 | 647 | |
| 648 | static void draw_videoram(running_machine *machine, | |
| 648 | static void draw_videoram(running_machine *machine, | |
| 649 | 649 | { |
| 650 | 650 | int flipmask = video_flip ? 0x1f : 0x00; |
| 651 | 651 | int x, y; |
| r1877 | r1878 | |
| 680 | 680 | * |
| 681 | 681 | *************************************/ |
| 682 | 682 | |
| 683 | static void draw_background_spaceod( | |
| 683 | static void draw_background_spaceod( | |
| 684 | 684 | { |
| 685 | | |
| 685 | | |
| 686 | 686 | int flipmask = (spaceod_bg_control & 0x01) ? 0xff : 0x00; |
| 687 | 687 | int xoffset = (spaceod_bg_control & 0x02) ? 0x10 : 0x00; |
| 688 | 688 | int xmask = pixmap->width - 1; |
| r1877 | r1878 | |
| 737 | 737 | * |
| 738 | 738 | *************************************/ |
| 739 | 739 | |
| 740 | static void draw_background_page_scroll( | |
| 740 | static void draw_background_page_scroll( | |
| 741 | 741 | { |
| 742 | | |
| 742 | | |
| 743 | 743 | int flipmask = (video_control & 0x08) ? 0xff : 0x00; |
| 744 | 744 | int xmask = pixmap->width - 1; |
| 745 | 745 | int ymask = pixmap->height - 1; |
| r1877 | r1878 | |
| 777 | 777 | * |
| 778 | 778 | *************************************/ |
| 779 | 779 | |
| 780 | static void draw_background_full_scroll( | |
| 780 | static void draw_background_full_scroll( | |
| 781 | 781 | { |
| 782 | | |
| 782 | | |
| 783 | 783 | int flipmask = (video_control & 0x08) ? 0x3ff : 0x000; |
| 784 | 784 | int xmask = pixmap->width - 1; |
| 785 | 785 | int ymask = pixmap->height - 1; |
| r1877 | r1878 | |
|---|---|---|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | |
| 217 | static void draw_layer_interleaved( | |
| 217 | static void draw_layer_interleaved( | |
| 218 | 218 | int left_pixmap, int right_pixmap, int palbase, int transp) |
| 219 | 219 | { |
| 220 | 220 | int county,countx,pen,offs; |
| r1877 | r1878 | |
|---|---|---|
| 345 | 345 | last = data & 0x08; |
| 346 | 346 | |
| 347 | 347 | /* bit 5 = irq enable */ |
| 348 | interrupt_enable_w(0,data & 0x20); | |
| 348 | interrupt_enable_w(machine,0,data & 0x20); | |
| 349 | 349 | |
| 350 | 350 | /* bit 7 = enable char ROM reading through the video RAM */ |
| 351 | 351 | K052109_set_RMRD_line((data & 0x80) ? ASSERT_LINE : CLEAR_LINE); |
| r1877 | r1878 | |
|---|---|---|
| 116 | 116 | * |
| 117 | 117 | *************************************/ |
| 118 | 118 | |
| 119 | void jpmimpct_scanline_update(running_machine *machine, int screen, | |
| 119 | void jpmimpct_scanline_update(running_machine *machine, int screen, | |
| 120 | 120 | { |
| 121 | 121 | UINT16 *vram = &tms_vram[(params->rowaddr << 8) & 0x3ff00]; |
| 122 | 122 | UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0); |
| r1877 | r1878 | |
|---|---|---|
| 134 | 134 | flip_screen_set_no_update(0); |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | static void draw_bullets(running_machine *machine, | |
| 137 | static void draw_bullets(running_machine *machine, | |
| 138 | 138 | { |
| 139 | 139 | int offs; |
| 140 | 140 | |
| r1877 | r1878 | |
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | static void draw_sprites(running_machine *machine, | |
| 164 | static void draw_sprites(running_machine *machine, | |
| 165 | 165 | { |
| 166 | 166 | int offs; |
| 167 | 167 |
| r1877 | r1878 | |
|---|---|---|
| 26 | 26 | static int start_render_received; |
| 27 | 27 | static int alloc_ctrl_OPB_Mode, alloc_ctrl_PT_OPB, alloc_ctrl_TM_OPB, alloc_ctrl_T_OPB, alloc_ctrl_ZM_OPB, alloc_ctrl_O_OPB; |
| 28 | 28 | |
| 29 | static emu_timer *vbout_timer; | |
| 30 | ||
| 29 | 31 | static struct testsprites |
| 30 | 32 | { |
| 31 | 33 | int positionx, positiony; |
| r1877 | r1878 | |
| 301 | 303 | a = 1 << 21; |
| 302 | 304 | break; |
| 303 | 305 | } |
| 304 | sysctrl_regs[SB_ISTNRM] |= a; | |
| 306 | dc_sysctrl_regs[SB_ISTNRM] |= a; | |
| 305 | 307 | update_interrupt_status(); |
| 306 | 308 | tafifo_listtype= -1; // no list being received |
| 307 | 309 | } |
| r1877 | r1878 | |
| 607 | 609 | pvr_parameterconfig[a] = pvr_parameterconfig[a-1]; |
| 608 | 610 | } |
| 609 | 611 | |
| 612 | TIMER_CALLBACK(vbout) | |
| 613 | { | |
| 614 | dc_sysctrl_regs[SB_ISTNRM] |= IST_VBL_OUT; // V Blank-out interrupt | |
| 615 | update_interrupt_status(); | |
| 616 | ||
| 617 | timer_adjust_oneshot(vbout_timer, attotime_never, 0); | |
| 618 | } | |
| 619 | ||
| 610 | 620 | VIDEO_START(dc) |
| 611 | 621 | { |
| 612 | 622 | memset(pvrctrl_regs, 0, sizeof(pvrctrl_regs)); |
| r1877 | r1878 | |
| 627 | 637 | testsprites_size=0; |
| 628 | 638 | toerasesprites=0; |
| 629 | 639 | computedilated(); |
| 640 | ||
| 641 | vbout_timer = timer_alloc(vbout, 0); | |
| 642 | timer_adjust_oneshot(vbout_timer, attotime_never, 0); | |
| 630 | 643 | } |
| 631 | 644 | |
| 632 | 645 | VIDEO_UPDATE(dc) |
| 633 | 646 | { |
| 634 | int a; | |
| 635 | ||
| 636 | 647 | if (pvrta_regs[VO_CONTROL] & (1 << 3)) |
| 637 | 648 | { |
| 638 | 649 | fillbitmap(bitmap,pvrta_regs[VO_BORDER_COL] & 0xFFFFFF,cliprect); |
| r1877 | r1878 | |
| 644 | 655 | if (start_render_received) |
| 645 | 656 | { |
| 646 | 657 | start_render_received=0; |
| 647 | a=4; // tsp end | |
| 648 | sysctrl_regs[SB_ISTNRM] |= a; | |
| 658 | dc_sysctrl_regs[SB_ISTNRM] |= IST_EOR_TSP; // TSP end of render | |
| 649 | 659 | update_interrupt_status(); |
| 650 | 660 | } |
| 651 | 661 | return 0; |
| r1877 | r1878 | |
| 653 | 663 | |
| 654 | 664 | void dc_vblank(void) |
| 655 | 665 | { |
| 656 | sysctrl_regs[SB_ISTNRM] |= | |
| 666 | dc_sysctrl_regs[SB_ISTNRM] |= IST_VBL_IN; // V Blank-in interrupt | |
| 657 | 667 | update_interrupt_status(); |
| 668 | ||
| 669 | timer_adjust_oneshot(vbout_timer, video_screen_get_time_until_pos(0, 0, 0), 0); | |
| 658 | 670 | } |
| 659 | 671 |
| r1877 | r1878 | |
|---|---|---|
| 3 | 3 | #include "video/poly.h" |
| 4 | 4 | |
| 5 | 5 | UINT8 *taitojc_texture; |
| 6 | static mame_bitmap *framebuffer; | |
| 7 | static mame_bitmap *zbuffer; | |
| 6 | static bitmap_t *framebuffer; | |
| 7 | static bitmap_t *zbuffer; | |
| 8 | 8 | |
| 9 | 9 | extern UINT32 *taitojc_vram; |
| 10 | 10 | extern UINT32 *taitojc_objlist; |
| r1877 | r1878 | |
| 103 | 103 | // 0x01: -------- --x----- -------- -------- Priority (0 = below 3D, 1 = above 3D) |
| 104 | 104 | // 0x01: -------- -------- -xxxxxxx xxxxxxxx VRAM data address |
| 105 | 105 | |
| 106 | static void draw_object( | |
| 106 | static void draw_object( | |
| 107 | 107 | { |
| 108 | 108 | int x, y, width, height, palette; |
| 109 | 109 | int i, j; |
| r1877 | r1878 | |
| 315 | 315 | |
| 316 | 316 | static void render_solid_scan(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid) |
| 317 | 317 | { |
| 318 | | |
| 318 | | |
| 319 | 319 | float z = extent->param[0].start; |
| 320 | 320 | int color = extent->param[1].start; |
| 321 | 321 | float dz = extent->param[0].dpdx; |
| r1877 | r1878 | |
| 339 | 339 | |
| 340 | 340 | static void render_shade_scan(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid) |
| 341 | 341 | { |
| 342 | | |
| 342 | | |
| 343 | 343 | float z = extent->param[0].start; |
| 344 | 344 | float color = extent->param[1].start; |
| 345 | 345 | float dz = extent->param[0].dpdx; |
| r1877 | r1878 | |
| 367 | 367 | static void render_texture_scan(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid) |
| 368 | 368 | { |
| 369 | 369 | const poly_extra_data *extra = extradata; |
| 370 | | |
| 370 | | |
| 371 | 371 | float z = extent->param[0].start; |
| 372 | 372 | float u = extent->param[1].start; |
| 373 | 373 | float v = extent->param[2].start; |
| r1877 | r1878 | |
|---|---|---|
| 24 | 24 | static int pitnrun_scroll; |
| 25 | 25 | static int pitnrun_char_bank; |
| 26 | 26 | static int pitnrun_color_select; |
| 27 | static | |
| 27 | static | |
| 28 | 28 | static tilemap *bg, *fg; |
| 29 | 29 | UINT8* pitnrun_videoram2; |
| 30 | 30 | |
| r1877 | r1878 | |
| 187 | 187 | pitnrun_spotlights(); |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | static void draw_sprites(running_machine *machine, | |
| 190 | static void draw_sprites(running_machine *machine, | |
| 191 | 191 | { |
| 192 | 192 | int sx, sy, flipx, flipy, offs,pal; |
| 193 | 193 |
| r1877 | r1878 | |
|---|---|---|
| 408 | 408 | struct tilemap_callback_info tilemap_info[16]; /* callback info for 16 tilemap pages */ |
| 409 | 409 | struct tilemap_callback_info textmap_info; /* callback info for a single textmap page */ |
| 410 | 410 | void (*reset)(struct tilemap_info *info);/* reset callback */ |
| 411 | void (*draw_layer)(running_machine *machine, struct tilemap_info *info, | |
| 411 | void (*draw_layer)(running_machine *machine, struct tilemap_info *info, | |
| 412 | 412 | UINT16 * textram; /* pointer to textram pointer */ |
| 413 | 413 | UINT16 * tileram; /* pointer to tileram pointer */ |
| 414 | 414 | }; |
| r1877 | r1878 | |
| 424 | 424 | UINT16 colorbase; /* base color index */ |
| 425 | 425 | INT32 ramsize; /* size of sprite RAM */ |
| 426 | 426 | INT32 xoffs; /* X scroll offset */ |
| 427 | void (*draw)(struct sprite_info *info, | |
| 427 | void (*draw)(struct sprite_info *info, | |
| 428 | 428 | UINT16 * spriteram; /* pointer to spriteram pointer */ |
| 429 | 429 | UINT16 * buffer; /* buffered spriteram for those that use it */ |
| 430 | 430 | }; |
| r1877 | r1878 | |
| 439 | 439 | UINT16 colorbase2; /* color base for road background data */ |
| 440 | 440 | UINT16 colorbase3; /* color base for sky data */ |
| 441 | 441 | INT32 xoffs; /* X scroll offset */ |
| 442 | void (*draw)(struct road_info *info, | |
| 442 | void (*draw)(struct road_info *info, | |
| 443 | 443 | UINT16 * roadram; /* pointer to roadram pointer */ |
| 444 | 444 | UINT16 * buffer; /* buffered roadram pointer */ |
| 445 | 445 | UINT8 * gfx; /* expanded road graphics */ |
| r1877 | r1878 | |
| 605 | 605 | * |
| 606 | 606 | *************************************/ |
| 607 | 607 | |
| 608 | static void segaic16_draw_virtual_tilemap(running_machine *machine, struct tilemap_info *info, | |
| 608 | static void segaic16_draw_virtual_tilemap(running_machine *machine, struct tilemap_info *info, | |
| 609 | 609 | { |
| 610 | 610 | int leftmin = -1, leftmax = -1, rightmin = -1, rightmax = -1; |
| 611 | 611 | int topmin = -1, topmax = -1, bottommin = -1, bottommax = -1; |
| r1877 | r1878 | |
| 828 | 828 | } |
| 829 | 829 | |
| 830 | 830 | |
| 831 | static void segaic16_tilemap_16a_draw_layer(running_machine *machine, struct tilemap_info *info, | |
| 831 | static void segaic16_tilemap_16a_draw_layer(running_machine *machine, struct tilemap_info *info, | |
| 832 | 832 | { |
| 833 | 833 | UINT16 *textram = info->textram; |
| 834 | 834 | |
| r1877 | r1878 | |
| 1070 | 1070 | } |
| 1071 | 1071 | |
| 1072 | 1072 | |
| 1073 | static void segaic16_tilemap_16b_draw_layer(running_machine *machine, struct tilemap_info *info, | |
| 1073 | static void segaic16_tilemap_16b_draw_layer(running_machine *machine, struct tilemap_info *info, | |
| 1074 | 1074 | { |
| 1075 | 1075 | UINT16 *textram = info->textram; |
| 1076 | 1076 | UINT16 xscroll, yscroll, pages; |
| r1877 | r1878 | |
| 1200 | 1200 | void segaic16_tilemap_init(int which, int type, int colorbase, int xoffs, int numbanks) |
| 1201 | 1201 | { |
| 1202 | 1202 | struct tilemap_info *info = &bg_tilemap[which]; |
| 1203 | tile_get_info_callback get_text_info; | |
| 1204 | tile_get_info_callback get_tile_info; | |
| 1203 | tile_get_info_func get_text_info; | |
| 1204 | tile_get_info_func get_tile_info; | |
| 1205 | 1205 | int pagenum; |
| 1206 | 1206 | int i; |
| 1207 | 1207 | |
| r1877 | r1878 | |
| 1304 | 1304 | * |
| 1305 | 1305 | *************************************/ |
| 1306 | 1306 | |
| 1307 | void segaic16_tilemap_draw(running_machine *machine, int which, | |
| 1307 | void segaic16_tilemap_draw(running_machine *machine, int which, | |
| 1308 | 1308 | { |
| 1309 | 1309 | struct tilemap_info *info = &bg_tilemap[which]; |
| 1310 | 1310 | |
| r1877 | r1878 | |
| 1493 | 1493 | pri[x] = 0xff; \ |
| 1494 | 1494 | } \ |
| 1495 | 1495 | |
| 1496 | static void segaic16_sprites_hangon_draw(struct sprite_info *info, | |
| 1496 | static void segaic16_sprites_hangon_draw(struct sprite_info *info, | |
| 1497 | 1497 | { |
| 1498 | 1498 | UINT8 numbanks = memory_region_length(REGION_GFX2) / 0x10000; |
| 1499 | 1499 | const UINT16 *spritebase = (const UINT16 *)memory_region(REGION_GFX2); |
| r1877 | r1878 | |
| 1657 | 1657 | pri[x] = 0xff; \ |
| 1658 | 1658 | } \ |
| 1659 | 1659 | |
| 1660 | static void segaic16_sprites_sharrier_draw(struct sprite_info *info, | |
| 1660 | static void segaic16_sprites_sharrier_draw(struct sprite_info *info, | |
| 1661 | 1661 | { |
| 1662 | 1662 | UINT8 numbanks = memory_region_length(REGION_GFX2) / 0x20000; |
| 1663 | 1663 | const UINT32 *spritebase = (const UINT32 *)memory_region(REGION_GFX2); |
| r1877 | r1878 | |
| 1827 | 1827 | pri[x] = 0xff; \ |
| 1828 | 1828 | } \ |
| 1829 | 1829 | |
| 1830 | static void segaic16_sprites_16a_draw(struct sprite_info *info, | |
| 1830 | static void segaic16_sprites_16a_draw(struct sprite_info *info, | |
| 1831 | 1831 | { |
| 1832 | 1832 | UINT8 numbanks = memory_region_length(REGION_GFX2) / 0x10000; |
| 1833 | 1833 | const UINT16 *spritebase = (const UINT16 *)memory_region(REGION_GFX2); |
| r1877 | r1878 | |
| 1982 | 1982 | pri[x] = 0xff; \ |
| 1983 | 1983 | } \ |
| 1984 | 1984 | |
| 1985 | static void segaic16_sprites_16b_draw(struct sprite_info *info, | |
| 1985 | static void segaic16_sprites_16b_draw(struct sprite_info *info, | |
| 1986 | 1986 | { |
| 1987 | 1987 | UINT8 numbanks; |
| 1988 | 1988 | const UINT16 *spritebase; |
| r1877 | r1878 | |
| 2140 | 2140 | pri[x] = 0; \ |
| 2141 | 2141 | } \ |
| 2142 | 2142 | |
| 2143 | static void segaic16_sprites_yboard_16b_draw(struct sprite_info *info, | |
| 2143 | static void segaic16_sprites_yboard_16b_draw(struct sprite_info *info, | |
| 2144 | 2144 | { |
| 2145 | 2145 | UINT8 numbanks = memory_region_length(REGION_GFX2) / 0x20000; |
| 2146 | 2146 | const UINT16 *spritebase = (const UINT16 *)memory_region(REGION_GFX2); |
| r1877 | r1878 | |
| 2317 | 2317 | pri[x] = 0xff; \ |
| 2318 | 2318 | } \ |
| 2319 | 2319 | |
| 2320 | static void segaic16_sprites_outrun_draw(struct sprite_info *info, | |
| 2320 | static void segaic16_sprites_outrun_draw(struct sprite_info *info, | |
| 2321 | 2321 | { |
| 2322 | 2322 | UINT8 numbanks = memory_region_length(REGION_GFX2) / 0x40000; |
| 2323 | 2323 | const UINT32 *spritebase = (const UINT32 *)memory_region(REGION_GFX2); |
| r1877 | r1878 | |
| 2478 | 2478 | if (x >= minx && x <= maxx && ind < 0x1fe) \ |
| 2479 | 2479 | dest[x] = ind | colorpri; \ |
| 2480 | 2480 | |
| 2481 | static void segaic16_sprites_yboard_draw(struct sprite_info *info, | |
| 2481 | static void segaic16_sprites_yboard_draw(struct sprite_info *info, | |
| 2482 | 2482 | { |
| 2483 | 2483 | UINT8 numbanks = memory_region_length(REGION_GFX1) / 0x80000; |
| 2484 | 2484 | const UINT64 *spritebase = (const UINT64 *)memory_region(REGION_GFX1); |
| r1877 | r1878 | |
| 2741 | 2741 | * |
| 2742 | 2742 | *************************************/ |
| 2743 | 2743 | |
| 2744 | void segaic16_sprites_draw(int which, | |
| 2744 | void segaic16_sprites_draw(int which, | |
| 2745 | 2745 | { |
| 2746 | 2746 | struct sprite_info *info = &sprites[which]; |
| 2747 | 2747 | (*info->draw)(info, bitmap, cliprect); |
| r1877 | r1878 | |
| 2909 | 2909 | } |
| 2910 | 2910 | |
| 2911 | 2911 | |
| 2912 | static void segaic16_road_hangon_draw(struct road_info *info, | |
| 2912 | static void segaic16_road_hangon_draw(struct road_info *info, | |
| 2913 | 2913 | { |
| 2914 | 2914 | UINT16 *roadram = info->roadram; |
| 2915 | 2915 | int x, y; |
| r1877 | r1878 | |
| 3177 | 3177 | } |
| 3178 | 3178 | |
| 3179 | 3179 | |
| 3180 | static void segaic16_road_outrun_draw(struct road_info *info, | |
| 3180 | static void segaic16_road_outrun_draw(struct road_info *info, | |
| 3181 | 3181 | { |
| 3182 | 3182 | UINT16 *roadram = info->buffer; |
| 3183 | 3183 | int x, y; |
| r1877 | r1878 | |
| 3403 | 3403 | * |
| 3404 | 3404 | *************************************/ |
| 3405 | 3405 | |
| 3406 | void segaic16_road_draw(int which, | |
| 3406 | void segaic16_road_draw(int which, | |
| 3407 | 3407 | { |
| 3408 | 3408 | struct road_info *info = &road[which]; |
| 3409 | 3409 | (*info->draw)(info, bitmap, cliprect, priority); |
| r1877 | r1878 | |
| 3503 | 3503 | * |
| 3504 | 3504 | *************************************/ |
| 3505 | 3505 | |
| 3506 | void segaic16_rotate_draw(int which, | |
| 3506 | void segaic16_rotate_draw(int which, | |
| 3507 | 3507 | { |
| 3508 | 3508 | struct rotate_info *info = &rotate[which]; |
| 3509 | 3509 | INT32 currx = (info->buffer[0x3f0] << 16) | info->buffer[0x3f1]; |
| r1877 | r1878 | |
|---|---|---|
| 169 | 169 | return WAVERAM_BLOCK1(blocknum); |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | #ifdef UNUSED_FUNCTON | |
| 172 | 173 | INLINE void *waveram0_ptr_from_texture_addr(UINT32 addr, int width) |
| 173 | 174 | { |
| 174 | 175 | UINT32 blocknum = ((addr & ~1) * width) / 8; |
| 175 | 176 | return WAVERAM_BLOCK0(blocknum); |
| 176 | 177 | } |
| 178 | #endif | |
| 177 | 179 | |
| 178 | 180 | |
| 179 | ||
| 180 | 181 | /************************************* |
| 181 | 182 | * |
| 182 | 183 | * Inlines for rendering |
| 183 | 184 | * |
| 184 | 185 | *************************************/ |
| 185 | 186 | |
| 187 | #ifdef UNUSED_FUNCTON | |
| 186 | 188 | INLINE void waveram_plot(int y, int x, UINT32 color) |
| 187 | 189 | { |
| 188 | 190 | if (x >= 0 && x <= zeus_cliprect.max_x && y >= 0 && y < zeus_cliprect.max_y) |
| 189 | 191 | WAVERAM_WRITEPIX(zeus_renderbase, y, x, color); |
| 190 | 192 | } |
| 193 | #endif | |
| 191 | 194 | |
| 192 | 195 | INLINE void waveram_plot_depth(int y, int x, UINT32 color, UINT16 depth) |
| 193 | 196 | { |
| r1877 | r1878 | |
| 198 | 201 | } |
| 199 | 202 | } |
| 200 | 203 | |
| 204 | #ifdef UNUSED_FUNCTON | |
| 201 | 205 | INLINE void waveram_plot_check_depth(int y, int x, UINT32 color, UINT16 depth) |
| 202 | 206 | { |
| 203 | 207 | if (x >= 0 && x <= zeus_cliprect.max_x && y >= 0 && y < zeus_cliprect.max_y) |
| r1877 | r1878 | |
| 210 | 214 | } |
| 211 | 215 | } |
| 212 | 216 | } |
| 217 | #endif | |
| 213 | 218 | |
| 219 | #ifdef UNUSED_FUNCTON | |
| 214 | 220 | INLINE void waveram_plot_check_depth_nowrite(int y, int x, UINT32 color, UINT16 depth) |
| 215 | 221 | { |
| 216 | 222 | if (x >= 0 && x <= zeus_cliprect.max_x && y >= 0 && y < zeus_cliprect.max_y) |
| r1877 | r1878 | |
| 220 | 226 | WAVERAM_WRITEPIX(zeus_renderbase, y, x, color); |
| 221 | 227 | } |
| 222 | 228 | } |
| 229 | #endif | |
| 223 | 230 | |
| 224 | 231 | |
| 225 | ||
| 226 | 232 | /************************************* |
| 227 | 233 | * |
| 228 | 234 | * Inlines for texel accesses |
| r1877 | r1878 | |
| 236 | 242 | } |
| 237 | 243 | |
| 238 | 244 | |
| 245 | #ifdef UNUSED_FUNCTON | |
| 239 | 246 | INLINE UINT8 get_texel_4bit(const void *base, int y, int x, int width) |
| 240 | 247 | { |
| 241 | 248 | UINT32 byteoffs = (y / 2) * (width * 2) + ((x / 8) << 3) + ((y & 1) << 2) + ((x / 2) & 3); |
| 242 | 249 | return (WAVERAM_READ8(base, byteoffs) >> (4 * (x & 1))) & 0x0f; |
| 243 | 250 | } |
| 251 | #endif | |
| 244 | 252 | |
| 245 | 253 | |
| 246 | ||
| 247 | 254 | /************************************* |
| 248 | 255 | * |
| 249 | 256 | * Video startup |
| r1877 | r1878 | |
| 1036 | 1043 | |
| 1037 | 1044 | static void zeus_draw_quad(const UINT32 *databuffer, UINT32 texoffs, int logit) |
| 1038 | 1045 | { |
| 1039 | poly_draw_scanline callback; | |
| 1046 | poly_draw_scanline_func callback; | |
| 1040 | 1047 | poly_extra_data *extra; |
| 1041 | 1048 | poly_vertex clipvert[8]; |
| 1042 | 1049 | poly_vertex vert[4]; |
| r1877 | r1878 | |
|---|---|---|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | |
| 308 | static void liberatr_draw_planet( | |
| 308 | static void liberatr_draw_planet( | |
| 309 | 309 | { |
| 310 | 310 | UINT8 latitude; |
| 311 | 311 | |
| r1877 | r1878 | |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | |
| 348 | static void liberatr_draw_bitmap(running_machine *machine, | |
| 348 | static void liberatr_draw_bitmap(running_machine *machine, | |
| 349 | 349 | { |
| 350 | 350 | offs_t offs; |
| 351 | 351 |
| r1877 | r1878 | |
|---|---|---|
| 119 | 119 | bit 7 = enable (0 = display off) |
| 120 | 120 | */ |
| 121 | 121 | |
| 122 | static void gridiron_draw_led(running_machine *machine, | |
| 122 | static void gridiron_draw_led(running_machine *machine, | |
| 123 | 123 | { |
| 124 | 124 | int i; |
| 125 | 125 | |
| r1877 | r1878 | |
| 155 | 155 | else logerror("unknown LED %02x for player %d\n",led,player); |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | static void draw_sprites(running_machine *machine, | |
| 158 | static void draw_sprites(running_machine *machine, | |
| 159 | 159 | { |
| 160 | 160 | int offs; |
| 161 | 161 |
| r1877 | r1878 | |
|---|---|---|
| 135 | 135 | when intensity is zero the colour is not reduced to pure black, (the sky should stay |
| 136 | 136 | at dark blue rather than absolute black) */ |
| 137 | 137 | data = COMBINE_DATA(&paletteram16[offset]); |
| 138 | paletteram16_RRRRGGGGBBBBIIII_word_w(offset,(data & 0xfff0) | ((data & 0x0007) << 1) | 1, 0); | |
| 138 | paletteram16_RRRRGGGGBBBBIIII_word_w(machine,offset,(data & 0xfff0) | ((data & 0x0007) << 1) | 1, 0); | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | WRITE16_HANDLER( bionicc_scroll_w ) |
| r1877 | r1878 | |
| 183 | 183 | |
| 184 | 184 | ***************************************************************************/ |
| 185 | 185 | |
| 186 | static void draw_sprites(running_machine *machine, | |
| 186 | static void draw_sprites(running_machine *machine, | |
| 187 | 187 | { |
| 188 | 188 | int offs; |
| 189 | 189 | const gfx_element *gfx = machine->gfx[3]; |
| r1877 | r1878 | |
| 231 | 231 | |
| 232 | 232 | VIDEO_EOF( bionicc ) |
| 233 | 233 | { |
| 234 | buffer_spriteram16_w(0,0,0); | |
| 234 | buffer_spriteram16_w(machine,0,0,0); | |
| 235 | 235 | } |
| r1877 | r1878 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | void segaic16_tilemap_init(int which, int type, int colorbase, int xoffs, int numbanks); |
| 36 | 36 | void segaic16_tilemap_reset(int which); |
| 37 | void segaic16_tilemap_draw(running_machine *machine, int which, | |
| 37 | void segaic16_tilemap_draw(running_machine *machine, int which, | |
| 38 | 38 | void segaic16_tilemap_set_bank(int which, int banknum, int offset); |
| 39 | 39 | void segaic16_tilemap_set_flip(int which, int flip); |
| 40 | 40 | void segaic16_tilemap_set_rowscroll(int which, int enable); |
| r1877 | r1878 | |
| 56 | 56 | #define SEGAIC16_SPRITES_YBOARD_16B 7 |
| 57 | 57 | |
| 58 | 58 | void segaic16_sprites_init(int which, int type, int colorbase, int xoffs); |
| 59 | void segaic16_sprites_draw(int which, | |
| 59 | void segaic16_sprites_draw(int which, | |
| 60 | 60 | void segaic16_sprites_set_bank(int which, int banknum, int offset); |
| 61 | 61 | void segaic16_sprites_set_flip(int which, int flip); |
| 62 | 62 | void segaic16_sprites_set_shadow(int which, int shadow); |
| r1877 | r1878 | |
| 75 | 75 | #define SEGAIC16_ROAD_FOREGROUND 1 |
| 76 | 76 | |
| 77 | 77 | void segaic16_road_init(int which, int type, int colorbase1, int colorbase2, int colorbase3, int xoffs); |
| 78 | void segaic16_road_draw(int which, | |
| 78 | void segaic16_road_draw(int which, | |
| 79 | 79 | READ16_HANDLER( segaic16_road_control_0_r ); |
| 80 | 80 | WRITE16_HANDLER( segaic16_road_control_0_w ); |
| 81 | 81 | |
| r1877 | r1878 | |
| 85 | 85 | #define SEGAIC16_ROTATE_YBOARD 0 |
| 86 | 86 | |
| 87 | 87 | void segaic16_rotate_init(int which, int type, int colorbase); |
| 88 | void segaic16_rotate_draw(int which, | |
| 88 | void segaic16_rotate_draw(int which, | |
| 89 | 89 | READ16_HANDLER( segaic16_rotate_control_0_r ); |
| r1877 | r1878 | |
|---|---|---|
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | |
| 111 | static void draw_sprites(running_machine *machine, | |
| 111 | static void draw_sprites(running_machine *machine, | |
| 112 | 112 | { |
| 113 | 113 | int offs; |
| 114 | 114 |
| r1877 | r1878 | |
|---|---|---|
| 289 | 289 | |
| 290 | 290 | ***************************************************************************/ |
| 291 | 291 | |
| 292 | static void draw_sprites(running_machine *machine, | |
| 292 | static void draw_sprites(running_machine *machine, | |
| 293 | 293 | { |
| 294 | 294 | /* tile layers 0 & 1 have priorities 1 & 2 */ |
| 295 | 295 | static const int pri[] = { 0, 0xfc, 0xff, 0xff }; |
| r1877 | r1878 | |
|---|---|---|
| 328 | 328 | |
| 329 | 329 | ***************************************************************************/ |
| 330 | 330 | |
| 331 | static void draw_sprites(running_machine *machine, | |
| 331 | static void draw_sprites(running_machine *machine, | |
| 332 | 332 | { |
| 333 | 333 | int offs, start_offset = spriteram_size/2 - 4; |
| 334 | 334 | int height = machine->gfx[0]->height; |
| r1877 | r1878 | |
| 369 | 369 | } |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | static void draw_bitmap( | |
| 372 | static void draw_bitmap( | |
| 373 | 373 | { |
| 374 | 374 | int x,y,count; |
| 375 | 375 | int color; |
| r1877 | r1878 | |
|---|---|---|
| 179 | 179 | |
| 180 | 180 | ***************************************************************************/ |
| 181 | 181 | |
| 182 | static void esd16_draw_sprites(running_machine *machine, | |
| 182 | static void esd16_draw_sprites(running_machine *machine, | |
| 183 | 183 | { |
| 184 | 184 | int offs; |
| 185 | 185 | |
| r1877 | r1878 | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | /* note, check if i can re-merge this with the other or if its really different */ |
| 238 | static void hedpanic_draw_sprites(running_machine *machine, | |
| 238 | static void hedpanic_draw_sprites(running_machine *machine, | |
| 239 | 239 | { |
| 240 | 240 | int offs; |
| 241 | 241 |
| r1877 | r1878 | |
|---|---|---|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | /* this just loops over our decoded bitmap and puts it on the screen */ |
| 115 | static void draw_sprite_new_zoomed(int wide, int high, int xpos, int ypos, int palt, int boffset, int flip, | |
| 115 | static void draw_sprite_new_zoomed(int wide, int high, int xpos, int ypos, int palt, int boffset, int flip, | |
| 116 | 116 | { |
| 117 | 117 | int ycnt; |
| 118 | 118 | int ydrawpos; |
| r1877 | r1878 | |
| 183 | 183 | |
| 184 | 184 | static UINT16 *pgm_sprite_source; |
| 185 | 185 | |
| 186 | static void draw_sprites(int priority, | |
| 186 | static void draw_sprites(int priority, | |
| 187 | 187 | { |
| 188 | 188 | /* ZZZZ Zxxx xxxx xxxx |
| 189 | 189 | zzzz z-yy yyyy yyyy |
| r1877 | r1878 | |
|---|---|---|
| 100 | 100 | } /* namcos21_ClearPolyFrameBuffer */ |
| 101 | 101 | |
| 102 | 102 | static void |
| 103 | CopyVisiblePolyFrameBuffer( | |
| 103 | CopyVisiblePolyFrameBuffer( | |
| 104 | 104 | { /* blit the visible framebuffer */ |
| 105 | 105 | int sy; |
| 106 | 106 | for( sy=clip->min_y; sy<=clip->max_y; sy++ ) |
| r1877 | r1878 | |
|---|---|---|
| 106 | 106 | |
| 107 | 107 | static int real3d_display_list = 0; |
| 108 | 108 | |
| 109 | static mame_bitmap *bitmap3d; | |
| 110 | static mame_bitmap *zbuffer; | |
| 109 | static bitmap_t *bitmap3d; | |
| 110 | static bitmap_t *zbuffer; | |
| 111 | 111 | static rectangle clip3d; |
| 112 | 112 | static rectangle *screen_clip; |
| 113 | 113 | |
| r1877 | r1878 | |
| 178 | 178 | init_matrix_stack(); |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | static void draw_tile_4bit( | |
| 181 | static void draw_tile_4bit( | |
| 182 | 182 | { |
| 183 | 183 | int x, y; |
| 184 | 184 | UINT8 *tile_base = (UINT8*)m3_char_ram; |
| r1877 | r1878 | |
| 213 | 213 | } |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | static void draw_tile_8bit( | |
| 216 | static void draw_tile_8bit( | |
| 217 | 217 | { |
| 218 | 218 | int x, y; |
| 219 | 219 | UINT8 *tile_base = (UINT8*)m3_char_ram; |
| r1877 | r1878 | |
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | #if 0 |
| 247 | static void draw_texture_sheet( | |
| 247 | static void draw_texture_sheet( | |
| 248 | 248 | { |
| 249 | 249 | int x,y; |
| 250 | 250 | for(y = cliprect->min_y; y <= cliprect->max_y; y++) |
| r1877 | r1878 | |
| 262 | 262 | } |
| 263 | 263 | #endif |
| 264 | 264 | |
| 265 | static void draw_layer( | |
| 265 | static void draw_layer( | |
| 266 | 266 | { |
| 267 | 267 | int x, y; |
| 268 | 268 | int tile_index = 0; |
| r1877 | r1878 | |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | #ifdef UNUSED_FUNCTION |
| 340 | static void copy_screen( | |
| 340 | static void copy_screen( | |
| 341 | 341 | { |
| 342 | 342 | int x,y; |
| 343 | 343 | for(y=cliprect->min_y; y <= cliprect->max_y; y++) { |
| r1877 | r1878 | |
| 707 | 707 | } |
| 708 | 708 | } |
| 709 | 709 | |
| 710 | #ifdef UNUSED_FUNCTON | |
| 710 | 711 | INLINE void write_texture8(int xpos, int ypos, int width, int height, int page, UINT16 *data) |
| 711 | 712 | { |
| 712 | 713 | int x,y,i,j; |
| r1877 | r1878 | |
| 729 | 730 | } |
| 730 | 731 | } |
| 731 | 732 | } |
| 733 | #endif | |
| 732 | 734 | |
| 733 | 735 | static void real3d_upload_texture(UINT32 header, UINT32 *data) |
| 734 | 736 | { |
| r1877 | r1878 | |
| 882 | 884 | /*****************************************************************************/ |
| 883 | 885 | /* matrix and vector operations */ |
| 884 | 886 | |
| 887 | #ifdef UNUSED_FUNCTON | |
| 885 | 888 | INLINE float dot_product(VECTOR a, VECTOR b) |
| 886 | 889 | { |
| 887 | 890 | return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]); |
| 888 | 891 | } |
| 892 | #endif | |
| 889 | 893 | |
| 890 | 894 | INLINE float dot_product3(VECTOR3 a, VECTOR3 b) |
| 891 | 895 | { |
| r1877 | r1878 | |
| 1057 | 1061 | return clip_verts; |
| 1058 | 1062 | } |
| 1059 | 1063 | |
| 1064 | #ifdef UNUSED_DEFINITION | |
| 1060 | 1065 | static const int num_bits[16] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 }; |
| 1066 | #endif | |
| 1061 | 1067 | |
| 1062 | 1068 | static MATRIX coordinate_system; |
| 1063 | 1069 | static float viewport_focal_length = 300; |
| r1877 | r1878 | |
| 1071 | 1077 | static void render_one(TRIANGLE *tri) |
| 1072 | 1078 | { |
| 1073 | 1079 | poly_extra_data *extra = poly_get_extra_data(poly); |
| 1074 | poly_draw_scanline callback = NULL; | |
| 1080 | poly_draw_scanline_func callback = NULL; | |
| 1075 | 1081 | |
| 1076 | 1082 | tri->v[0].pz = 1.0f / tri->v[0].pz; |
| 1077 | 1083 | tri->v[1].pz = 1.0f / tri->v[1].pz; |
| r1877 | r1878 | |
| 1312 | 1318 | } |
| 1313 | 1319 | return &culling_ram[address]; |
| 1314 | 1320 | } |
| 1315 | return NULL; | |
| 1316 | 1321 | } |
| 1317 | 1322 | |
| 1318 | 1323 | static void load_matrix(int matrix_num, MATRIX *out) |
| r1877 | r1878 | |
|---|---|---|
| 144 | 144 | static TIMER_CALLBACK( clear_screen_done_callback ) |
| 145 | 145 | { |
| 146 | 146 | /* indicate that the we are done clearing the screen */ |
| 147 | via_0_ca1_w(0, 0); | |
| 147 | via_0_ca1_w(machine, 0, 0); | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | |
| 151 | 151 | static WRITE8_HANDLER( video_command_trigger_w ) |
| 152 | 152 | { |
| 153 | gameplan_state *state = | |
| 153 | gameplan_state *state = machine->driver_data; | |
| 154 | 154 | |
| 155 | 155 | if (data == 0) |
| 156 | 156 | { |
| r1877 | r1878 | |
| 193 | 193 | /* clear screen */ |
| 194 | 194 | case 3: |
| 195 | 195 | /* indicate that the we are busy */ |
| 196 | via_0_ca1_w(0, 1); | |
| 196 | via_0_ca1_w(machine, 0, 1); | |
| 197 | 197 | |
| 198 | 198 | memset(state->videoram, state->video_data & 0x0f, state->videoram_size); |
| 199 | 199 | |
| r1877 | r1878 | |
| 265 | 265 | gameplan_state *state = machine->driver_data; |
| 266 | 266 | |
| 267 | 267 | /* !VBLANK is connected to CA1 */ |
| 268 | via_0_ca1_w(0, (UINT8)param); | |
| 268 | via_0_ca1_w(machine, 0, (UINT8)param); | |
| 269 | 269 | |
| 270 | 270 | if (param) |
| 271 | 271 | timer_adjust_oneshot(state->via_0_ca1_timer, video_screen_get_time_until_pos(0, VBSTART, 0), 0); |
| r1877 | r1878 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | UINT8 *ikki_scroll; |
| 14 | 14 | |
| 15 | static | |
| 15 | static | |
| 16 | 16 | static UINT8 ikki_flipscreen; |
| 17 | 17 | static int punch_through_pen; |
| 18 | 18 | |
| r1877 | r1878 | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| 68 | static void draw_sprites(running_machine *machine, | |
| 68 | static void draw_sprites(running_machine *machine, | |
| 69 | 69 | { |
| 70 | 70 | int y; |
| 71 | 71 | offs_t offs; |
| r1877 | r1878 | |
|---|---|---|
| 67 | 67 | col ^= 2; |
| 68 | 68 | |
| 69 | 69 | /* Row address (RA0-RA8) is not dependent on the offset */ |
| 70 | tms34061_w(col, *capbowl_rowaddress, func, data); | |
| 70 | tms34061_w(machine, col, *capbowl_rowaddress, func, data); | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | |
| r1877 | r1878 | |
| 82 | 82 | col ^= 2; |
| 83 | 83 | |
| 84 | 84 | /* Row address (RA0-RA8) is not dependent on the offset */ |
| 85 | return tms34061_r(col, *capbowl_rowaddress, func); | |
| 85 | return tms34061_r(machine, col, *capbowl_rowaddress, func); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 |
| r1877 | r1878 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | /***************************************************************************/ |
| 71 | 71 | |
| 72 | static void draw_sprites(running_machine *machine, | |
| 72 | static void draw_sprites(running_machine *machine, | |
| 73 | 73 | { |
| 74 | 74 | int offs,curx,cury; |
| 75 | 75 | UINT16 code,data,sx,sy; |
| r1877 | r1878 | |
|---|---|---|
| 138 | 138 | |
| 139 | 139 | ***************************************************************************/ |
| 140 | 140 | |
| 141 | static void draw_sprites(running_machine *machine, | |
| 141 | static void draw_sprites(running_machine *machine, | |
| 142 | 142 | { |
| 143 | 143 | int offs,sx,sy; |
| 144 | 144 |
| r1877 | r1878 | |
|---|---|---|
| 20 | 20 | static int st0016_ramgfx; |
| 21 | 21 | |
| 22 | 22 | //super eagle shot |
| 23 | static | |
| 23 | static | |
| 24 | 24 | extern UINT32 *speglsht_framebuffer; |
| 25 | 25 | extern UINT32 speglsht_videoreg; |
| 26 | 26 | |
| r1877 | r1878 | |
| 196 | 196 | if( srcadr < (memory_region_length(REGION_CPU1)-0x10000) && (dstadr < ST0016_MAX_CHAR_BANK*ST0016_CHAR_BANK_SIZE)) |
| 197 | 197 | { |
| 198 | 198 | st0016_char_bank=dstadr>>5; |
| 199 | st0016_character_ram_w(dstadr&0x1f,memory_region(REGION_CPU1)[0x10000+srcadr]); | |
| 199 | st0016_character_ram_w(machine,dstadr&0x1f,memory_region(REGION_CPU1)[0x10000+srcadr]); | |
| 200 | 200 | srcadr++; |
| 201 | 201 | dstadr++; |
| 202 | 202 | length--; |
| r1877 | r1878 | |
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | static void draw_sprites(running_machine *machine, | |
| 215 | static void draw_sprites(running_machine *machine, | |
| 216 | 216 | { |
| 217 | 217 | /* |
| 218 | 218 | object ram : |
| r1877 | r1878 | |
| 421 | 421 | static void st0016_postload(void) |
| 422 | 422 | { |
| 423 | 423 | int i; |
| 424 | st0016_rom_bank_w(0,st0016_rom_bank); | |
| 424 | st0016_rom_bank_w(Machine,0,st0016_rom_bank); | |
| 425 | 425 | for(i=0;i<ST0016_MAX_CHAR_BANK;i++) |
| 426 | 426 | decodechar(Machine->gfx[st0016_ramgfx], i,(UINT8 *) st0016_charram); |
| 427 | 427 | } |
| r1877 | r1878 | |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | |
| 506 | static void draw_bgmap(running_machine *machine, | |
| 506 | static void draw_bgmap(running_machine *machine, | |
| 507 | 507 | { |
| 508 | 508 | int j; |
| 509 | 509 | //for(j=0x40-8;j>=0;j-=8) |
| r1877 | r1878 | |
|---|---|---|
| 135 | 135 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | static void draw_sprites(running_machine *machine, | |
| 138 | static void draw_sprites(running_machine *machine, | |
| 139 | 139 | { |
| 140 | 140 | int offs = (*sbasketb_spriteram_select & 0x01) * 0x100; |
| 141 | 141 | int i; |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "deprecat.h" | |
| 9 | 8 | #include "deco16ic.h" |
| 10 | 9 | |
| 11 | 10 | /******************************************************************************/ |
| r1877 | r1878 | |
| 15 | 14 | deco16_1_video_init(); |
| 16 | 15 | } |
| 17 | 16 | |
| 18 | static void draw_sprites(running_machine *machine, | |
| 17 | static void draw_sprites(running_machine *machine, | |
| 19 | 18 | { |
| 20 | 19 | int offs; |
| 21 | 20 | |
| r1877 | r1878 | |
| 27 | 26 | |
| 28 | 27 | y = spriteram16[offs]; |
| 29 | 28 | flash=y&0x1000; |
| 30 | if (flash && ( | |
| 29 | if (flash && (vid | |
| 31 | 30 | |
| 32 | 31 | x = spriteram16[offs+2]; |
| 33 | 32 | colour = (x >>9) & 0x1f; |
| r1877 | r1878 | |
|---|---|---|
| 19 | 19 | * |
| 20 | 20 | *************************************/ |
| 21 | 21 | |
| 22 | static void qix_display_enable_changed(running_machine *machine, mc6845_t *mc6845, int display_enabled); | |
| 22 | static MC6845_BEGIN_UPDATE( begin_update ); | |
| 23 | static MC6845_UPDATE_ROW( update_row ); | |
| 24 | static MC6845_ON_DE_CHANGED( display_enable_changed ); | |
| 23 | 25 | |
| 24 | static void *qix_begin_update(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 25 | 26 | |
| 26 | static void qix_update_row(running_machine *machine, | |
| 27 | mc6845_t *mc6845, | |
| 28 | mame_bitmap *bitmap, | |
| 29 | const rectangle *cliprect, | |
| 30 | UINT16 ma, | |
| 31 | UINT8 ra, | |
| 32 | UINT16 y, | |
| 33 | UINT8 x_count, | |
| 34 | INT8 cursor_x, | |
| 35 | void *param); | |
| 36 | 27 | |
| 37 | ||
| 38 | ||
| 39 | 28 | /************************************* |
| 40 | 29 | * |
| 41 | 30 | * Start |
| r1877 | r1878 | |
| 67 | 56 | * |
| 68 | 57 | *************************************/ |
| 69 | 58 | |
| 70 | static | |
| 59 | static MC6845 | |
| 71 | 60 | { |
| 72 | 61 | qix_state *state = machine->driver_data; |
| 73 | 62 | |
| r1877 | r1878 | |
| 299 | 288 | |
| 300 | 289 | /************************************* |
| 301 | 290 | * |
| 302 | * M6845 access | |
| 303 | * | |
| 304 | *************************************/ | |
| 305 | ||
| 306 | static WRITE8_HANDLER( qix_mc6845_address_w ) | |
| 307 | { | |
| 308 | qix_state *state = Machine->driver_data; | |
| 309 | ||
| 310 | mc6845_address_w(state->mc6845, data); | |
| 311 | } | |
| 312 | ||
| 313 | ||
| 314 | static READ8_HANDLER( qix_mc6845_register_r ) | |
| 315 | { | |
| 316 | qix_state *state = Machine->driver_data; | |
| 317 | ||
| 318 | return mc6845_register_r(state->mc6845); | |
| 319 | } | |
| 320 | ||
| 321 | ||
| 322 | static WRITE8_HANDLER( qix_mc6845_register_w ) | |
| 323 | { | |
| 324 | qix_state *state = Machine->driver_data; | |
| 325 | ||
| 326 | mc6845_register_w(state->mc6845, data); | |
| 327 | } | |
| 328 | ||
| 329 | ||
| 330 | ||
| 331 | /************************************* | |
| 332 | * | |
| 333 | 291 | * M6845 callbacks for updating |
| 334 | 292 | * the screen |
| 335 | 293 | * |
| 336 | 294 | *************************************/ |
| 337 | 295 | |
| 338 | static | |
| 296 | static MC6845 | |
| 339 | 297 | { |
| 340 | 298 | qix_state *state = machine->driver_data; |
| 341 | 299 | |
| r1877 | r1878 | |
| 353 | 311 | } |
| 354 | 312 | |
| 355 | 313 | |
| 356 | static void qix_update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect, | |
| 357 | UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) | |
| 314 | static MC6845_UPDATE_ROW( update_row ) | |
| 315 | ||
| 358 | 316 | { |
| 359 | 317 | qix_state *state = machine->driver_data; |
| 360 | 318 | UINT16 x; |
| r1877 | r1878 | |
| 408 | 366 | AM_RANGE(0x9400, 0x9400) AM_MIRROR(0x03fc) AM_READWRITE(qix_addresslatch_r, qix_addresslatch_w) |
| 409 | 367 | AM_RANGE(0x9402, 0x9403) AM_MIRROR(0x03fc) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(qix_state, videoram_address) |
| 410 | 368 | AM_RANGE(0x9800, 0x9800) AM_MIRROR(0x03ff) AM_READ(MRA8_RAM) AM_BASE_MEMBER(qix_state, scanline_latch) |
| 411 | AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_WRITE(qix_mc6845_address_w) | |
| 412 | AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_READWRITE(qix_mc6845_register_r, qix_mc6845_register_w) | |
| 369 | AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_DEVWRITE(MC6845, "vid-u18", mc6845_address_w) | |
| 370 | AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_DEVREADWRITE(MC6845, "vid-u18", mc6845_register_r, mc6845_register_w) | |
| 413 | 371 | AM_RANGE(0xa000, 0xffff) AM_ROM |
| 414 | 372 | ADDRESS_MAP_END |
| 415 | 373 | |
| r1877 | r1878 | |
| 426 | 384 | AM_RANGE(0x9400, 0x9400) AM_MIRROR(0x03fc) AM_READWRITE(qix_addresslatch_r, qix_addresslatch_w) |
| 427 | 385 | AM_RANGE(0x9402, 0x9403) AM_MIRROR(0x03fc) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(qix_state, videoram_address) |
| 428 | 386 | AM_RANGE(0x9800, 0x9800) AM_MIRROR(0x03ff) AM_READ(MRA8_RAM) AM_BASE_MEMBER(qix_state, scanline_latch) |
| 429 | AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_WRITE(qix_mc6845_address_w) | |
| 430 | AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_READWRITE(qix_mc6845_register_r, qix_mc6845_register_w) | |
| 387 | AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_DEVWRITE(MC6845, "vid-u18", mc6845_address_w) | |
| 388 | AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_DEVREADWRITE(MC6845, "vid-u18", mc6845_register_r, mc6845_register_w) | |
| 431 | 389 | AM_RANGE(0xa000, 0xbfff) AM_ROMBANK(1) |
| 432 | 390 | AM_RANGE(0xc000, 0xffff) AM_ROM |
| 433 | 391 | ADDRESS_MAP_END |
| r1877 | r1878 | |
| 445 | 403 | AM_RANGE(0x9401, 0x9401) AM_MIRROR(0x03fc) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(qix_state, videoram_mask) |
| 446 | 404 | AM_RANGE(0x9402, 0x9403) AM_MIRROR(0x03fc) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(qix_state, videoram_address) |
| 447 | 405 | AM_RANGE(0x9800, 0x9800) AM_MIRROR(0x03ff) AM_READ(MRA8_RAM) AM_BASE_MEMBER(qix_state, scanline_latch) |
| 448 | AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_WRITE(qix_mc6845_address_w) | |
| 449 | AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_READWRITE(qix_mc6845_register_r, qix_mc6845_register_w) | |
| 406 | AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_DEVWRITE(MC6845, "vid-u18", mc6845_address_w) | |
| 407 | AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_DEVREADWRITE(MC6845, "vid-u18", mc6845_register_r, mc6845_register_w) | |
| 450 | 408 | AM_RANGE(0xa000, 0xffff) AM_ROM |
| 451 | 409 | ADDRESS_MAP_END |
| 452 | 410 | |
| r1877 | r1878 | |
| 460 | 418 | |
| 461 | 419 | static const mc6845_interface mc6845_intf = |
| 462 | 420 | { |
| 463 | 0, /* screen we are acting on */ | |
| 464 | QIX_CHARACTER_CLOCK, /* the clock (pin 21) of the chip */ | |
| 465 | 8, /* number of pixels per video memory address */ | |
| 466 | qix_begin_update, /* before pixel update callback */ | |
| 467 | qix_update_row, /* row update callback */ | |
| 468 | 0, /* after pixel update callback */ | |
| 469 | qix_display_enable_changed /* call back for display state changes */ | |
| 421 | 0, /* screen we are acting on */ | |
| 422 | QIX_CHARACTER_CLOCK, /* the clock (pin 21) of the chip */ | |
| 423 | 8, /* number of pixels per video memory address */ | |
| 424 | begin_update, /* before pixel update callback */ | |
| 425 | update_row, /* row update callback */ | |
| 426 | NULL, /* after pixel update callback */ | |
| 427 | display_enable_changed, /* callback for display state changes */ | |
| 428 | NULL, /* HSYNC callback */ | |
| 429 | NULL /* VSYNC callback */ | |
| 470 | 430 | }; |
| 471 | 431 | |
| 472 | 432 |
| r1877 | r1878 | |
|---|---|---|
| 63 | 63 | SET_TILE_INFO(0,code,((attr>>2)&7),flags); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | static void draw_sprites(running_machine *machine, | |
| 66 | static void draw_sprites(running_machine *machine, | |
| 67 | 67 | { |
| 68 | 68 | const UINT8 *source = spriteram+spriteram_size-4; |
| 69 | 69 | const UINT8 *finish = spriteram; |
| r1877 | r1878 | |
|---|---|---|
| 152 | 152 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | static void draw_sprites(running_machine *machine, | |
| 155 | static void draw_sprites(running_machine *machine, | |
| 156 | 156 | { |
| 157 | 157 | int offs; |
| 158 | 158 | UINT8 *sr; |
| r1877 | r1878 | |
|---|---|---|
| 90 | 90 | atarirle_info * info; /* list of info records */ |
| 91 | 91 | atarirle_entry *spriteram; /* pointer to sprite RAM */ |
| 92 | 92 | |
| 93 | | |
| 93 | | |
| 94 | 94 | int partial_scanline; /* partial update scanline */ |
| 95 | 95 | |
| 96 | 96 | UINT8 control_bits; /* current control bits */ |
| r1877 | r1878 | |
| 141 | 141 | static void prescan_rle(const atarirle_data *mo, int which); |
| 142 | 142 | static void sort_and_render(atarirle_data *mo); |
| 143 | 143 | static void compute_checksum(atarirle_data *mo); |
| 144 | static void draw_rle(atarirle_data *mo, | |
| 144 | static void draw_rle(atarirle_data *mo, | |
| 145 | 145 | int x, int y, int xscale, int yscale, const rectangle *clip); |
| 146 | static void draw_rle_zoom( | |
| 146 | static void draw_rle_zoom( | |
| 147 | 147 | UINT32 palette, int sx, int sy, int scalex, int scaley, |
| 148 | 148 | const rectangle *clip); |
| 149 | static void draw_rle_zoom_hflip( | |
| 149 | static void draw_rle_zoom_hflip( | |
| 150 | 150 | UINT32 palette, int sx, int sy, int scalex, int scaley, |
| 151 | 151 | const rectangle *clip); |
| 152 | 152 | |
| r1877 | r1878 | |
| 162 | 162 | two. |
| 163 | 163 | ---------------------------------------------------------------*/ |
| 164 | 164 | |
| 165 | #ifdef UNUSED_FUNCTON | |
| 165 | 166 | INLINE int compute_log(int value) |
| 166 | 167 | { |
| 167 | 168 | int log = 0; |
| r1877 | r1878 | |
| 174 | 175 | return -1; |
| 175 | 176 | return log; |
| 176 | 177 | } |
| 178 | #endif | |
| 177 | 179 | |
| 178 | ||
| 179 | 180 | /*--------------------------------------------------------------- |
| 180 | 181 | round_to_powerof2: Rounds a number up to the nearest |
| 181 | 182 | power of 2. Even powers of 2 are rounded up to the |
| r1877 | r1878 | |
| 200 | 201 | value into the result, packing the bits along the way. |
| 201 | 202 | ---------------------------------------------------------------*/ |
| 202 | 203 | |
| 204 | #ifdef UNUSED_FUNCTON | |
| 203 | 205 | INLINE int collapse_bits(int value, int mask) |
| 204 | 206 | { |
| 205 | 207 | int testmask, ormask; |
| r1877 | r1878 | |
| 214 | 216 | } |
| 215 | 217 | return result; |
| 216 | 218 | } |
| 219 | #endif | |
| 217 | 220 | |
| 218 | ||
| 219 | 221 | /*--------------------------------------------------------------- |
| 220 | 222 | convert_mask: Converts a 4-word mask into a word index, |
| 221 | 223 | shift, and adjusted mask. Returns 0 if invalid. |
| r1877 | r1878 | |
| 523 | 525 | atarirle_get_vram: Return the VRAM bitmap. |
| 524 | 526 | ---------------------------------------------------------------*/ |
| 525 | 527 | |
| 526 | ||
| 528 | ||
| 527 | 529 | { |
| 528 | 530 | atarirle_data *mo = &atarirle[map]; |
| 529 | 531 | //logerror("atarirle_get_vram (frame %d)\n", (mo->control_bits & ATARIRLE_CONTROL_FRAME) >> 2); |
| r1877 | r1878 | |
| 731 | 733 | |
| 732 | 734 | static void sort_and_render(atarirle_data *mo) |
| 733 | 735 | { |
| 734 | mame_bitmap *bitmap1 = mo->vram[0][(~mo->control_bits & ATARIRLE_CONTROL_FRAME) >> 2]; | |
| 735 | mame_bitmap *bitmap2 = mo->vram[1][(~mo->control_bits & ATARIRLE_CONTROL_FRAME) >> 2]; | |
| 736 | bitmap_t *bitmap1 = mo->vram[0][(~mo->control_bits & ATARIRLE_CONTROL_FRAME) >> 2]; | |
| 737 | bitmap_t *bitmap2 = mo->vram[1][(~mo->control_bits & ATARIRLE_CONTROL_FRAME) >> 2]; | |
| 736 | 738 | atarirle_entry *obj = mo->spriteram; |
| 737 | 739 | mo_sort_entry sort_entry[256]; |
| 738 | 740 | mo_sort_entry *list_head[256]; |
| r1877 | r1878 | |
| 903 | 905 | object. |
| 904 | 906 | ---------------------------------------------------------------*/ |
| 905 | 907 | |
| 906 | void draw_rle(atarirle_data *mo, | |
| 908 | void draw_rle(atarirle_data *mo, | |
| 907 | 909 | int x, int y, int xscale, int yscale, const rectangle *clip) |
| 908 | 910 | { |
| 909 | 911 | UINT32 palettebase = mo->palettebase + color; |
| r1877 | r1878 | |
| 944 | 946 | bitmap. |
| 945 | 947 | ---------------------------------------------------------------*/ |
| 946 | 948 | |
| 947 | void draw_rle_zoom( | |
| 949 | void draw_rle_zoom( | |
| 948 | 950 | UINT32 palette, int sx, int sy, int scalex, int scaley, |
| 949 | 951 | const rectangle *clip) |
| 950 | 952 | { |
| r1877 | r1878 | |
| 1134 | 1136 | 16-bit bitmap with horizontal flip. |
| 1135 | 1137 | ---------------------------------------------------------------*/ |
| 1136 | 1138 | |
| 1137 | void draw_rle_zoom_hflip( | |
| 1139 | void draw_rle_zoom_hflip( | |
| 1138 | 1140 | UINT32 palette, int sx, int sy, int scalex, int scaley, |
| 1139 | 1141 | const rectangle *clip) |
| 1140 | 1142 | { |
| r1877 | r1878 | |
|---|---|---|
| 82 | 82 | 8, 8, 64, 32); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | static void draw_sprites(running_machine *machine, | |
| 85 | static void draw_sprites(running_machine *machine, | |
| 86 | 86 | { |
| 87 | 87 | const gfx_element *gfx = machine->gfx[1]; |
| 88 | 88 | UINT8 *source = spriteram; |
| r1877 | r1878 | |
|---|---|---|
| 237 | 237 | VIDEO_UPDATE( skullxbo ) |
| 238 | 238 | { |
| 239 | 239 | struct atarimo_rect_list rectlist; |
| 240 | | |
| 240 | | |
| 241 | 241 | int x, y, r; |
| 242 | 242 | |
| 243 | 243 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 34 | 34 | spriteram[offset] = data; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | static void draw_sprites(running_machine *machine, | |
| 37 | static void draw_sprites(running_machine *machine, | |
| 38 | 38 | { |
| 39 | 39 | const gfx_element *gfx = machine->gfx[0]; |
| 40 | 40 | const UINT8 *source = spriteram; |
| r1877 | r1878 | |
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | static void draw_background(running_machine *machine, | |
| 66 | static void draw_background(running_machine *machine, | |
| 67 | 67 | { |
| 68 | 68 | const UINT8 *source = videoram; |
| 69 | 69 | const gfx_element *gfx = machine->gfx[1]; |
| r1877 | r1878 | |
|---|---|---|
| 86 | 86 | WRITE32_HANDLER( atarirle_0_spriteram32_w ); |
| 87 | 87 | |
| 88 | 88 | /* render helpers */ |
| 89 | ||
| 89 | ||
| 90 | 90 | |
| 91 | 91 | |
| 92 | 92 |
| r1877 | r1878 | |
|---|---|---|
| 100 | 100 | static struct DEBUGOPTS debug_options = {5, {0,0,0,0,0,0}, 0, 0, 0}; |
| 101 | 101 | /* red green blue purple yellow cyan grey white */ |
| 102 | 102 | static const UINT16 dbg_mode_colours[8] = { 0x1f, 0x3e0, 0x7c00, 0x7c1f, 0x3ff, 0x7fe0, 0x4210, 0x7fff }; |
| 103 | static UINT8 snes_dbg_video( | |
| 103 | static UINT8 snes_dbg_video( | |
| 104 | 104 | #endif /* SNES_DBG_video */ |
| 105 | 105 | |
| 106 | 106 | /* Forward declarations */ |
| r1877 | r1878 | |
| 1783 | 1783 | * |
| 1784 | 1784 | * Redraw the current line. |
| 1785 | 1785 | *********************************************/ |
| 1786 | static void snes_refresh_scanline( | |
| 1786 | static void snes_refresh_scanline( | |
| 1787 | 1787 | { |
| 1788 | 1788 | UINT16 ii; |
| 1789 | 1789 | int x; |
| r1877 | r1878 | |
| 1889 | 1889 | |
| 1890 | 1890 | #ifdef SNES_DBG_video |
| 1891 | 1891 | |
| 1892 | static void snes_dbg_draw_maps( | |
| 1892 | static void snes_dbg_draw_maps( | |
| 1893 | 1893 | { |
| 1894 | 1894 | UINT32 tile, addr = tmap; |
| 1895 | 1895 | UINT16 ii, vflip, hflip, pal; |
| r1877 | r1878 | |
| 1930 | 1930 | //ui_draw_text( str, 0, 227 ); |
| 1931 | 1931 | } |
| 1932 | 1932 | |
| 1933 | static void snes_dbg_draw_all_tiles( | |
| 1933 | static void snes_dbg_draw_all_tiles( | |
| 1934 | 1934 | { |
| 1935 | 1935 | UINT16 ii, jj, kk; |
| 1936 | 1936 | UINT32 addr = tileaddr; |
| r1877 | r1878 | |
| 1969 | 1969 | //ui_draw_text( str, 0, 227 ); |
| 1970 | 1970 | } |
| 1971 | 1971 | |
| 1972 | static UINT8 snes_dbg_video( | |
| 1972 | static UINT8 snes_dbg_video( | |
| 1973 | 1973 | { |
| 1974 | 1974 | UINT16 ii; |
| 1975 | 1975 |
| r1877 | r1878 | |
|---|---|---|
| 13 | 13 | UINT16 *glass_videoram; |
| 14 | 14 | |
| 15 | 15 | static tilemap *pant[2]; |
| 16 | static | |
| 16 | static | |
| 17 | 17 | |
| 18 | 18 | static int glass_blitter_serial_buffer[5]; |
| 19 | 19 | static int current_command = 0; |
| r1877 | r1878 | |
| 163 | 163 | 3 | xxxxxxxx xxxxxxxx | sprite code |
| 164 | 164 | */ |
| 165 | 165 | |
| 166 | static void draw_sprites(running_machine *machine, | |
| 166 | static void draw_sprites(running_machine *machine, | |
| 167 | 167 | { |
| 168 | 168 | int i; |
| 169 | 169 | const gfx_element *gfx = machine->gfx[0]; |
| r1877 | r1878 | |
|---|---|---|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
| 63 | static void draw_sprites( | |
| 63 | static void draw_sprites( | |
| 64 | 64 | { |
| 65 | 65 | UINT16 *source = spriteram_old; |
| 66 | 66 | UINT16 *finish = source + (spriteram_size/2)/2; |
| r1877 | r1878 | |
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | static void mcatadv_draw_tilemap_part(UINT16* current_scroll, UINT16* current_videoram1, int i, tilemap* current_tilemap, | |
| 159 | static void mcatadv_draw_tilemap_part(UINT16* current_scroll, UINT16* current_videoram1, int i, tilemap* current_tilemap, | |
| 160 | 160 | { |
| 161 | 161 | int flip; |
| 162 | 162 | UINT32 drawline; |
| r1877 | r1878 | |
|---|---|---|
| 220 | 220 | * |
| 221 | 221 | *************************************/ |
| 222 | 222 | |
| 223 | VIDEO_E | |
| 223 | VIDEO_UPDATE | |
| 224 | 224 | { |
| 225 | VIDEO_UPDATE_CALL(vector); | |
| 225 | 226 | vector_clear_list(); |
| 227 | ||
| 228 | cpuintrf_push_context(0); | |
| 229 | ccpu_wdt_timer_trigger(); | |
| 230 | cpuintrf_pop_context(); | |
| 231 | ||
| 232 | return 0; | |
| 226 | 233 | } |
| 227 | 234 | |
| 228 | 235 | |
| r1877 | r1878 | |
| 237 | 244 | { |
| 238 | 245 | int sw_option = readinputportbytag("INPUTS"); |
| 239 | 246 | |
| 240 | VIDEO_UPDATE_CALL( | |
| 247 | VIDEO_UPDATE_CALL( | |
| 241 | 248 | |
| 242 | 249 | /* set the state of the artwork */ |
| 243 | 250 | output_set_value("pressed3", (~sw_option >> 0) & 1); |
| r1877 | r1878 | |
|---|---|---|
| 1256 | 1256 | Sprite Handlers |
| 1257 | 1257 | ***************************************************************************/ |
| 1258 | 1258 | |
| 1259 | static void draw_sprites( | |
| 1259 | static void draw_sprites( | |
| 1260 | 1260 | { |
| 1261 | 1261 | const gfx_element *gfx = Machine->gfx[ ((controller*2)+1) ]; |
| 1262 | 1262 | |
| r1877 | r1878 | |
| 1416 | 1416 | } |
| 1417 | 1417 | |
| 1418 | 1418 | /*************************************************************************** |
| 1419 | Draw the game screen in the given | |
| 1419 | Draw the game screen in the given | |
| 1420 | 1420 | ***************************************************************************/ |
| 1421 | 1421 | |
| 1422 | 1422 | VIDEO_UPDATE( toaplan2_0 ) |
| r1877 | r1878 | |
|---|---|---|
| 56 | 56 | // logerror("%04x: port c0 = %02x\n",activecpu_get_pc(),data); |
| 57 | 57 | |
| 58 | 58 | /* bit 0 = NMI enable */ |
| 59 | interrupt_enable_w(0,data & 1); | |
| 59 | interrupt_enable_w(machine,0,data & 1); | |
| 60 | 60 | |
| 61 | 61 | /* bit 1 = flip screen */ |
| 62 | 62 | flip_screen_set(data & 0x02); |
| r1877 | r1878 | |
| 87 | 87 | |
| 88 | 88 | ***************************************************************************/ |
| 89 | 89 | |
| 90 | static void draw_sprites(running_machine *machine, | |
| 90 | static void draw_sprites(running_machine *machine, | |
| 91 | 91 | { |
| 92 | 92 | int offs; |
| 93 | 93 |
| r1877 | r1878 | |
|---|---|---|
| 66 | 66 | tilemap_set_scrolldx(bg_tilemap, 0, 396 - 256); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | static void draw_sprites(running_machine *machine, | |
| 69 | static void draw_sprites(running_machine *machine, | |
| 70 | 70 | { |
| 71 | 71 | int i; |
| 72 | 72 |
| r1877 | r1878 | |
|---|---|---|
| 123 | 123 | 3 | xxxxxxxx xxxxxx-- | sprite code |
| 124 | 124 | */ |
| 125 | 125 | |
| 126 | static void draw_sprites(running_machine *machine, | |
| 126 | static void draw_sprites(running_machine *machine, | |
| 127 | 127 | { |
| 128 | 128 | int i, x, y, ex, ey; |
| 129 | 129 | const gfx_element *gfx = machine->gfx[0]; |
| r1877 | r1878 | |
|---|---|---|
| 124 | 124 | /* bits 2-3 unknown (2 is used) */ |
| 125 | 125 | |
| 126 | 126 | /* bit 4 controls NMI */ |
| 127 | interrupt_enable_w(0,(data & 0x10)>>4); | |
| 127 | interrupt_enable_w(machine,0,(data & 0x10)>>4); | |
| 128 | 128 | |
| 129 | 129 | /* bit 5 controls screen flip */ |
| 130 | 130 | flip_screen_set(data & 0x20); |
| r1877 | r1878 | |
|---|---|---|
| 184 | 184 | offset 3 xxxxxxxx x position (8 LSB bits) |
| 185 | 185 | */ |
| 186 | 186 | |
| 187 | static void draw_sprites(running_machine *machine, | |
| 187 | static void draw_sprites(running_machine *machine, | |
| 188 | 188 | { |
| 189 | 189 | int offs; |
| 190 | 190 |
| r1877 | r1878 | |
|---|---|---|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | // draws a 8bpp palette sprites on a 16bpp direct RGB target (sub-par implementation) |
| 201 | static void do_blit_zoom16( | |
| 201 | static void do_blit_zoom16( | |
| 202 | 202 | { |
| 203 | 203 | #define PRECISION_X 20 |
| 204 | 204 | #define PRECISION_Y 20 |
| r1877 | r1878 | |
| 332 | 332 | } |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | static void sprite_draw( | |
| 335 | static void sprite_draw( | |
| 336 | 336 | { |
| 337 | 337 | int i; |
| 338 | 338 | |
| r1877 | r1878 | |
| 535 | 535 | |
| 536 | 536 | ------------------------------------------------------------------------*/ |
| 537 | 537 | |
| 538 | static void wecleman_draw_road(running_machine *machine, | |
| 538 | static void wecleman_draw_road(running_machine *machine, | |
| 539 | 539 | { |
| 540 | 540 | // must be powers of 2 |
| 541 | 541 | #define XSIZE 512 |
| r1877 | r1878 | |
| 644 | 644 | ------------------------------------------------------------------------*/ |
| 645 | 645 | |
| 646 | 646 | // blends two 8x8x16bpp direct RGB tilemaps |
| 647 | static void draw_cloud(running_machine *machine, | |
| 647 | static void draw_cloud(running_machine *machine, | |
| 648 | 648 | gfx_element *gfx, |
| 649 | 649 | UINT16 *tm_base, |
| 650 | 650 | int x0, int y0, // target coordinate |
| r1877 | r1878 | |
| 780 | 780 | |
| 781 | 781 | ------------------------------------------------------------------------*/ |
| 782 | 782 | |
| 783 | static void hotchase_draw_road(running_machine *machine, | |
| 783 | static void hotchase_draw_road(running_machine *machine, | |
| 784 | 784 | { |
| 785 | 785 | /* Referred to what's in the ROMs */ |
| 786 | 786 | #define XSIZE 512 |
| r1877 | r1878 | |
|---|---|---|
| 100 | 100 | { |
| 101 | 101 | pastelg_gfxrom = ((data & 0xc0) >> 6); |
| 102 | 102 | pastelg_palbank = ((data & 0x10) >> 4); |
| 103 | nb1413m3_sndrombank1_w(0, data); | |
| 103 | nb1413m3_sndrombank1_w(machine, 0, data); | |
| 104 | 104 | |
| 105 | 105 | if ((pastelg_gfxrom << 16) > (memory_region_length(REGION_GFX1) - 1)) |
| 106 | 106 | { |
| r1877 | r1878 | |
|---|---|---|
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | |
| 101 | static void draw_sprite_and_check_collision(running_machine *machine, | |
| 101 | static void draw_sprite_and_check_collision(running_machine *machine, | |
| 102 | 102 | { |
| 103 | 103 | int y; |
| 104 | 104 | UINT8 code = crbaloon_spriteram[0] & 0x0f; |
| r1877 | r1878 | |
|---|---|---|
| 90 | 90 | } |
| 91 | 91 | #endif |
| 92 | 92 | |
| 93 | static void draw_sprites(running_machine *machine, | |
| 93 | static void draw_sprites(running_machine *machine, | |
| 94 | 94 | { |
| 95 | 95 | UINT8 *source = spriteram; |
| 96 | 96 | UINT8 *finish = source + 0x200; |
| r1877 | r1878 | |
|---|---|---|
| 211 | 211 | |
| 212 | 212 | ***************************************************************************/ |
| 213 | 213 | |
| 214 | static void draw_sprites(running_machine *machine, | |
| 214 | static void draw_sprites(running_machine *machine, | |
| 215 | 215 | { |
| 216 | 216 | int offs; |
| 217 | 217 | |
| r1877 | r1878 | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | |
| 238 | static void draw_bullets(running_machine *machine, | |
| 238 | static void draw_bullets(running_machine *machine, | |
| 239 | 239 | { |
| 240 | 240 | int offs; |
| 241 | 241 | |
| r1877 | r1878 | |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | |
| 260 | static void draw_stars(running_machine *machine, | |
| 260 | static void draw_stars(running_machine *machine, | |
| 261 | 261 | { |
| 262 | 262 | if (1) |
| 263 | 263 | { |
| r1877 | r1878 | |
|---|---|---|
| 62 | 62 | tmpbitmap = auto_bitmap_alloc(512,512,machine->screen[0].format); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | static void draw_status(running_machine *machine, | |
| 65 | static void draw_status(running_machine *machine, | |
| 66 | 66 | { |
| 67 | 67 | const gfx_element *gfx = machine->gfx[0]; |
| 68 | 68 | int row; |
| r1877 | r1878 | |
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | static void draw_background(running_machine *machine, | |
| 92 | static void draw_background(running_machine *machine, | |
| 93 | 93 | { |
| 94 | 94 | /* |
| 95 | 95 | ROM B1.2C contains 256 tilemaps defining 4x4 configurations of |
| r1877 | r1878 | |
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | static void draw_sprites(running_machine *machine, | |
| 131 | static void draw_sprites(running_machine *machine, | |
| 132 | 132 | { |
| 133 | 133 | int scroll = mnchmobl_vreg[6]; |
| 134 | 134 | int flags = mnchmobl_vreg[7]; /* XB?????? */ |
| r1877 | r1878 | |
|---|---|---|
| 93 | 93 | 8, 8, 32, 32); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | static void draw_sprites(running_machine *machine, | |
| 96 | static void draw_sprites(running_machine *machine, | |
| 97 | 97 | { |
| 98 | 98 | int offs; |
| 99 | 99 | |
| r1877 | r1878 | |
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | static void draw_columns(running_machine *machine, | |
| 125 | static void draw_columns(running_machine *machine, | |
| 126 | 126 | { |
| 127 | 127 | int offs; |
| 128 | 128 |
| r1877 | r1878 | |
|---|---|---|
| 149 | 149 | |
| 150 | 150 | WRITE16_HANDLER( btoads_paletteram_w ) |
| 151 | 151 | { |
| 152 | tlc34076_lsb_w(offset/2, data, mem_mask); | |
| 152 | tlc34076_lsb_w(machine, offset/2, data, mem_mask); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
| 156 | 156 | READ16_HANDLER( btoads_paletteram_r ) |
| 157 | 157 | { |
| 158 | return tlc34076_lsb_r(offset/2, mem_mask); | |
| 158 | return tlc34076_lsb_r(machine, offset/2, mem_mask); | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | |
| r1877 | r1878 | |
| 342 | 342 | * |
| 343 | 343 | *************************************/ |
| 344 | 344 | |
| 345 | void btoads_scanline_update(running_machine *machine, int screen, | |
| 345 | void btoads_scanline_update(running_machine *machine, int screen, | |
| 346 | 346 | { |
| 347 | 347 | UINT32 fulladdr = ((params->rowaddr << 16) | params->coladdr) >> 4; |
| 348 | 348 | UINT16 *bg0_base = &btoads_vram_bg0[(fulladdr + (yscroll0 << 10)) & 0x3fc00]; |
| r1877 | r1878 | |
|---|---|---|
| 379 | 379 | |
| 380 | 380 | ***************************************************************************/ |
| 381 | 381 | |
| 382 | static void draw_sprites(running_machine *machine, | |
| 382 | static void draw_sprites(running_machine *machine, | |
| 383 | 383 | { |
| 384 | 384 | int x, y, tx, ty, sx, sy, flipx, flipy; |
| 385 | 385 | int xsize, ysize, xnum, ynum; |
| r1877 | r1878 | |
|---|---|---|
| 186 | 186 | |
| 187 | 187 | ***************************************************************************/ |
| 188 | 188 | |
| 189 | static void draw_sprites(running_machine *machine, | |
| 189 | static void draw_sprites(running_machine *machine, | |
| 190 | 190 | { |
| 191 | 191 | int offs; |
| 192 | 192 | |
| r1877 | r1878 | |
| 249 | 249 | /* Spriteram is always 1 frame ahead, suggesting buffering. I can't find |
| 250 | 250 | a register to control this so I assume it happens automatically |
| 251 | 251 | every frame at the end of vblank */ |
| 252 | buffer_spriteram16_w(0,0,0); | |
| 252 | buffer_spriteram16_w(machine,0,0,0); | |
| 253 | 253 | } |
| r1877 | r1878 | |
|---|---|---|
| 76 | 76 | |
| 77 | 77 | /******************************************************************************/ |
| 78 | 78 | //AT |
| 79 | static void draw_sprites(running_machine *machine, | |
| 79 | static void draw_sprites(running_machine *machine, | |
| 80 | 80 | { |
| 81 | 81 | int offs,mx,my,color,tile,fx,fy,i; |
| 82 | 82 | |
| r1877 | r1878 | |
| 215 | 215 | } |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | static void draw_sprites_V(running_machine *machine, | |
| 218 | static void draw_sprites_V(running_machine *machine, | |
| 219 | 219 | { |
| 220 | 220 | int offs,mx,my,color,tile,fx,fy,i; |
| 221 | 221 | |
| r1877 | r1878 | |
| 322 | 322 | |
| 323 | 323 | /******************************************************************************/ |
| 324 | 324 | //AT |
| 325 | static void draw_sprites_I(running_machine *machine, | |
| 325 | static void draw_sprites_I(running_machine *machine, | |
| 326 | 326 | { |
| 327 | 327 | int data, offs, mx, my, tile, color, fy, i; |
| 328 | 328 | UINT8 *color_prom = memory_region(REGION_USER1); |
| r1877 | r1878 | |
| 428 | 428 | *bank = (data>>11 & 4) | (data>>10 & 3); |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | static void kyros_draw_sprites(running_machine *machine, | |
| 431 | static void kyros_draw_sprites(running_machine *machine, | |
| 432 | 432 | { |
| 433 | 433 | int offs,mx,my,color,tile,i,bank,fy,fx; |
| 434 | 434 | int data; |
| r1877 | r1878 | |
| 490 | 490 | |
| 491 | 491 | /******************************************************************************/ |
| 492 | 492 | |
| 493 | static void sstingry_draw_sprites(running_machine *machine, | |
| 493 | static void sstingry_draw_sprites(running_machine *machine, | |
| 494 | 494 | { |
| 495 | 495 | //AT |
| 496 | 496 | int data,offs,mx,my,color,tile,i,bank,fy,fx; |
| r1877 | r1878 | |
|---|---|---|
| 68 | 68 | tilemap_mark_tile_dirty(drgnmst_md_tilemap,offset/2); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | static void draw_sprites(running_machine *machine, | |
| 71 | static void draw_sprites(running_machine *machine, | |
| 72 | 72 | { |
| 73 | 73 | const gfx_element *gfx = machine->gfx[0]; |
| 74 | 74 | UINT16 *source = spriteram16; |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | UINT8* boxer_sprite_ram; |
| 11 | 11 | |
| 12 | 12 | |
| 13 | static void draw_boxer(running_machine *machine, | |
| 13 | static void draw_boxer(running_machine *machine, | |
| 14 | 14 | { |
| 15 | 15 | int n; |
| 16 | 16 |
| r1877 | r1878 | |
|---|---|---|
| 225 | 225 | case 0x0004/2 : return readinputport(3); // Motor Limit Switches |
| 226 | 226 | case 0x0006/2 : return readinputport(4); // DSW 1 & 2 |
| 227 | 227 | |
| 228 | case 0x0008/2 : return soundlatch2_word_r(0,0); // From sound cpu | |
| 228 | case 0x0008/2 : return soundlatch2_word_r(machine,0,0); // From sound cpu | |
| 229 | 229 | |
| 230 | 230 | case 0x0010/2 : |
| 231 | 231 | switch (cischeat_ip_select & 0x3) |
| r1877 | r1878 | |
| 274 | 274 | break; |
| 275 | 275 | |
| 276 | 276 | case 0x000a/2 : // to sound cpu |
| 277 | soundlatch_word_w(0,new_data,0); | |
| 277 | soundlatch_word_w(machine,0,new_data,0); | |
| 278 | 278 | break; |
| 279 | 279 | |
| 280 | 280 | case 0x000c/2 : break; // ?? |
| r1877 | r1878 | |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | case 0x2200/2 : return readinputport(5); // DSW 3 (4 bits) |
| 335 | case 0x2300/2 : return soundlatch2_r(0); // From sound cpu | |
| 335 | case 0x2300/2 : return soundlatch2_r(machine,0); // From sound cpu | |
| 336 | 336 | |
| 337 | 337 | default: SHOW_READ_ERROR("vreg %04X read!",offset*2); |
| 338 | 338 | return megasys1_vregs[offset]; |
| r1877 | r1878 | |
| 386 | 386 | case 0x2208/2 : break; // watchdog reset |
| 387 | 387 | |
| 388 | 388 | case 0x2300/2 : /* Sound CPU: reads latch during int 4, and stores command */ |
| 389 | soundlatch_word_w(0,new_data,0); | |
| 390 | cpunum_set_input_line(Machine, 3,4,HOLD_LINE); | |
| 389 | soundlatch_word_w(machine,0,new_data,0); | |
| 390 | cpunum_set_input_line(machine, 3,4,HOLD_LINE); | |
| 391 | 391 | break; |
| 392 | 392 | |
| 393 | 393 | /* Not sure about this one.. */ |
| 394 | case 0x2308/2 : cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 395 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 396 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE ); | |
| 394 | case 0x2308/2 : cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 395 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 396 | cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE ); | |
| 397 | 397 | break; |
| 398 | 398 | |
| 399 | 399 | default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data); |
| r1877 | r1878 | |
| 422 | 422 | (read_shift()<<5); // Buttons |
| 423 | 423 | |
| 424 | 424 | case 0x0006/2 : return readinputport(3); // ? Read at boot only |
| 425 | case 0x0008/2 : return soundlatch2_r(0); // From sound cpu | |
| 425 | case 0x0008/2 : return soundlatch2_r(machine,0); // From sound cpu | |
| 426 | 426 | |
| 427 | 427 | case 0x000c/2 : return readinputport(4); // DSW 3 |
| 428 | 428 | |
| r1877 | r1878 | |
| 445 | 445 | return (f1gpstr2_ioready[0]&1) ? 0xff : 0xf0; |
| 446 | 446 | |
| 447 | 447 | default: |
| 448 | return f1gpstar_vregs_r(offset,mem_mask); | |
| 448 | return f1gpstar_vregs_r(machine,offset,mem_mask); | |
| 449 | 449 | } |
| 450 | 450 | } |
| 451 | 451 | |
| r1877 | r1878 | |
| 464 | 464 | |
| 465 | 465 | case 0x0004/2 : return readinputport(1); // Buttons |
| 466 | 466 | |
| 467 | case 0x0008/2 : return soundlatch2_r(0); // From sound cpu | |
| 467 | case 0x0008/2 : return soundlatch2_r(machine,0); // From sound cpu | |
| 468 | 468 | |
| 469 | 469 | case 0x0010/2 : // X, Y |
| 470 | 470 | return readinputport(2) | (readinputport(3)<<8); |
| r1877 | r1878 | |
| 505 | 505 | case 0x0014/2 : break; |
| 506 | 506 | |
| 507 | 507 | /* Usually written in sequence, but not always */ |
| 508 | case 0x0008/2 : soundlatch_word_w(0,new_data,0); break; | |
| 509 | case 0x0018/2 : cpunum_set_input_line(Machine, 3,4,HOLD_LINE); break; | |
| 508 | case 0x0008/2 : soundlatch_word_w(machine,0,new_data,0); break; | |
| 509 | case 0x0018/2 : cpunum_set_input_line(machine, 3,4,HOLD_LINE); break; | |
| 510 | 510 | |
| 511 | 511 | case 0x0010/2 : break; |
| 512 | 512 | |
| r1877 | r1878 | |
| 526 | 526 | case 0x2208/2 : break; // watchdog reset |
| 527 | 527 | |
| 528 | 528 | /* Not sure about this one. Values: $10 then 0, $7 then 0 */ |
| 529 | case 0x2308/2 : cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE ); | |
| 530 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 531 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, (new_data & 4) ? ASSERT_LINE : CLEAR_LINE ); | |
| 529 | case 0x2308/2 : cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE ); | |
| 530 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 531 | cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, (new_data & 4) ? ASSERT_LINE : CLEAR_LINE ); | |
| 532 | 532 | break; |
| 533 | 533 | |
| 534 | 534 | default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data); |
| r1877 | r1878 | |
| 548 | 548 | case 0x0000/2 : |
| 549 | 549 | if (ACCESSING_LSB) |
| 550 | 550 | { |
| 551 | cpunum_set_input_line(Machine, 4,4,(new_data & 4)?ASSERT_LINE:CLEAR_LINE); | |
| 552 | cpunum_set_input_line(Machine, 4,2,(new_data & 2)?ASSERT_LINE:CLEAR_LINE); | |
| 551 | cpunum_set_input_line(machine, 4,4,(new_data & 4)?ASSERT_LINE:CLEAR_LINE); | |
| 552 | cpunum_set_input_line(machine, 4,2,(new_data & 2)?ASSERT_LINE:CLEAR_LINE); | |
| 553 | 553 | } |
| 554 | 554 | break; |
| 555 | 555 | |
| 556 | 556 | default: |
| 557 | f1gpstar_vregs_w(offset,data,mem_mask); | |
| 557 | f1gpstar_vregs_w(machine,offset,data,mem_mask); | |
| 558 | break; | |
| 558 | 559 | } |
| 559 | 560 | } |
| 560 | 561 | |
| r1877 | r1878 | |
| 583 | 584 | case 0x100/2+1 : MEGASYS1_VREG_SCROLL(2,y) break; |
| 584 | 585 | case 0x100/2+2 : megasys1_set_vreg_flag(2,new_data);break; |
| 585 | 586 | |
| 586 | case 0x208/2 : watchdog_reset_w(0,0); break; | |
| 587 | case 0x208/2 : watchdog_reset_w(machine,0,0); break; | |
| 587 | 588 | |
| 588 | 589 | default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data); |
| 589 | 590 | } |
| r1877 | r1878 | |
| 628 | 629 | /* Draw the road in the given bitmap. The priority1 and priority2 parameters |
| 629 | 630 | specify the range of lines to draw */ |
| 630 | 631 | |
| 631 | static void cischeat_draw_road(running_machine *machine, | |
| 632 | static void cischeat_draw_road(running_machine *machine, | |
| 632 | 633 | { |
| 633 | 634 | int curr_code,sx,sy; |
| 634 | 635 | int min_priority, max_priority; |
| r1877 | r1878 | |
| 718 | 719 | /* Draw the road in the given bitmap. The priority1 and priority2 parameters |
| 719 | 720 | specify the range of lines to draw */ |
| 720 | 721 | |
| 721 | static void f1gpstar_draw_road(running_machine *machine, | |
| 722 | static void f1gpstar_draw_road(running_machine *machine, | |
| 722 | 723 | { |
| 723 | 724 | int sx,sy; |
| 724 | 725 | int xstart; |
| r1877 | r1878 | |
| 834 | 835 | sprites whose priority nibble is between 0 and 15 and whose |
| 835 | 836 | colour code's high bit is set. */ |
| 836 | 837 | |
| 837 | static void cischeat_draw_sprites(running_machine *machine, | |
| 838 | static void cischeat_draw_sprites(running_machine *machine, | |
| 838 | 839 | { |
| 839 | 840 | int x, sx, flipx, xzoom, xscale, xdim, xnum, xstart, xend, xinc; |
| 840 | 841 | int y, sy, flipy, yzoom, yscale, ydim, ynum, ystart, yend, yinc; |
| r1877 | r1878 | |
| 989 | 990 | |
| 990 | 991 | ***************************************************************************/ |
| 991 | 992 | |
| 992 | static void bigrun_draw_sprites(running_machine *machine, | |
| 993 | static void bigrun_draw_sprites(running_machine *machine, | |
| 993 | 994 | { |
| 994 | 995 | int x, sx, flipx, xzoom, xscale, xdim, xnum, xstart, xend, xinc; |
| 995 | 996 | int y, sy, flipy, yzoom, yscale, ydim, ynum, ystart, yend, yinc; |
| r1877 | r1878 | |
| 1349 | 1350 | #if 1 |
| 1350 | 1351 | popmessage("Cmd: %04X Pos:%04X Lim:%04X Inp:%04X", |
| 1351 | 1352 | scudhamm_motor_command, |
| 1352 | scudhamm_motor_pos_r(0,0), | |
| 1353 | scudhamm_motor_status_r(0,0), | |
| 1354 | scudhamm_analog_r(0,0) ); | |
| 1353 | scudhamm_motor_pos_r(machine,0,0), | |
| 1354 | scudhamm_motor_status_r(machine,0,0), | |
| 1355 | scudhamm_analog_r(machine,0,0) ); | |
| 1355 | 1356 | #endif |
| 1356 | 1357 | |
| 1357 | 1358 | } |
| r1877 | r1878 | |
|---|---|---|
| 30 | 30 | tilemap_mark_tile_dirty(freek_tilemap,offset&0x3ff); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | static void gigas_draw_sprites(running_machine *machine, | |
| 33 | static void gigas_draw_sprites(running_machine *machine, | |
| 34 | 34 | { |
| 35 | 35 | int offs; |
| 36 | 36 | |
| r1877 | r1878 | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| 68 | static void pbillrd_draw_sprites(running_machine *machine, | |
| 68 | static void pbillrd_draw_sprites(running_machine *machine, | |
| 69 | 69 | { |
| 70 | 70 | int offs; |
| 71 | 71 | |
| r1877 | r1878 | |
| 101 | 101 | |
| 102 | 102 | |
| 103 | 103 | |
| 104 | static void freekick_draw_sprites(running_machine *machine, | |
| 104 | static void freekick_draw_sprites(running_machine *machine, | |
| 105 | 105 | { |
| 106 | 106 | int offs; |
| 107 | 107 |
| r1877 | r1878 | |
|---|---|---|
| 277 | 277 | float du = extent->param[1].dpdx; |
| 278 | 278 | float dv = extent->param[2].dpdx; |
| 279 | 279 | float di = extent->param[3].dpdx; |
| 280 | | |
| 280 | | |
| 281 | 281 | const poly_extra_data *extra = extradata; |
| 282 | 282 | int bn = extra->bn * 0x1000; |
| 283 | 283 | const pen_t *pens = &Machine->pens[(extra->color&0x7f)<<8]; |
| r1877 | r1878 | |
| 384 | 384 | } |
| 385 | 385 | } /* renderscanline_uvi_full */ |
| 386 | 386 | |
| 387 | static void poly3d_DrawQuad(running_machine *machine, | |
| 387 | static void poly3d_DrawQuad(running_machine *machine, | |
| 388 | 388 | { |
| 389 | 389 | poly_extra_data *extra; |
| 390 | 390 | poly_vertex v[4], clipv[5]; |
| r1877 | r1878 | |
| 489 | 489 | int y_index = extent->param[1].start * 65536.0f; |
| 490 | 490 | int dx = extent->param[0].dpdx * 65536.0f; |
| 491 | 491 | const poly_extra_data *extra = extradata; |
| 492 | | |
| 492 | | |
| 493 | 493 | const pen_t *pal = &Machine->pens[extra->color]; |
| 494 | 494 | int prioverchar = extra->prioverchar; |
| 495 | 495 | int z = extra->z; |
| r1877 | r1878 | |
| 556 | 556 | |
| 557 | 557 | static void |
| 558 | 558 | mydrawgfxzoom( |
| 559 | | |
| 559 | | |
| 560 | 560 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 561 | 561 | const rectangle *clip,int transparency,int transparent_color, |
| 562 | 562 | int scalex, int scaley, int z, int prioverchar, int alpha ) |
| r1877 | r1878 | |
| 607 | 607 | } /* mydrawgfxzoom */ |
| 608 | 608 | |
| 609 | 609 | static void |
| 610 | ApplyGamma( | |
| 610 | ApplyGamma( | |
| 611 | 611 | { |
| 612 | 612 | int x,y; |
| 613 | 613 | if( mbSuperSystem22 ) |
| r1877 | r1878 | |
| 654 | 654 | } /* ApplyGamma */ |
| 655 | 655 | |
| 656 | 656 | static void |
| 657 | poly3d_Draw3dSprite( | |
| 657 | poly3d_Draw3dSprite( | |
| 658 | 658 | { |
| 659 | 659 | int flipx = 0; |
| 660 | 660 | int flipy = 0; |
| r1877 | r1878 | |
| 900 | 900 | } /* NewSceneNode */ |
| 901 | 901 | |
| 902 | 902 | |
| 903 | static void RenderSprite(running_machine *machine, | |
| 903 | static void RenderSprite(running_machine *machine, | |
| 904 | 904 | { |
| 905 | 905 | int tile = node->data.sprite.tile; |
| 906 | 906 | int col,row; |
| r1877 | r1878 | |
| 935 | 935 | } /* next row */ |
| 936 | 936 | } /* RenderSprite */ |
| 937 | 937 | |
| 938 | static void RenderSceneHelper(running_machine *machine, | |
| 938 | static void RenderSceneHelper(running_machine *machine, | |
| 939 | 939 | { |
| 940 | 940 | if( node ) |
| 941 | 941 | { |
| r1877 | r1878 | |
| 988 | 988 | } |
| 989 | 989 | } /* RenderSceneHelper */ |
| 990 | 990 | |
| 991 | static void RenderScene(running_machine *machine, | |
| 991 | static void RenderScene(running_machine *machine, | |
| 992 | 992 | { |
| 993 | 993 | struct SceneNode *node = &mSceneRoot; |
| 994 | 994 | int i; |
| r1877 | r1878 | |
| 1248 | 1248 | |
| 1249 | 1249 | static void |
| 1250 | 1250 | DrawSpritesHelper( |
| 1251 | | |
| 1251 | | |
| 1252 | 1252 | const rectangle *cliprect, |
| 1253 | 1253 | const UINT32 *pSource, |
| 1254 | 1254 | const UINT32 *pPal, |
| r1877 | r1878 | |
| 1343 | 1343 | } /* DrawSpritesHelper */ |
| 1344 | 1344 | |
| 1345 | 1345 | static void |
| 1346 | DrawSprites( | |
| 1346 | DrawSprites( | |
| 1347 | 1347 | { |
| 1348 | 1348 | /* |
| 1349 | 1349 | // time crisis: |
| r1877 | r1878 | |
| 1536 | 1536 | } |
| 1537 | 1537 | |
| 1538 | 1538 | static void |
| 1539 | DrawTranslucentCharacters( | |
| 1539 | DrawTranslucentCharacters( | |
| 1540 | 1540 | { |
| 1541 | 1541 | alpha_set_level( 0xff-mixer.text_translucency ); /* ? */ |
| 1542 | 1542 | tilemap_draw( bitmap, cliprect, bgtilemap, TILEMAP_DRAW_ALPHA|1, 0 ); |
| 1543 | 1543 | } |
| 1544 | 1544 | |
| 1545 | static void DrawCharacterLayer(running_machine *machine, | |
| 1545 | static void DrawCharacterLayer(running_machine *machine, | |
| 1546 | 1546 | { |
| 1547 | 1547 | unsigned i; |
| 1548 | 1548 | INT32 dx = namcos22_tilemapattr[0]>>16; |
| r1877 | r1878 | |
| 1647 | 1647 | */ |
| 1648 | 1648 | static void |
| 1649 | 1649 | BlitQuadHelper( |
| 1650 | | |
| 1650 | | |
| 1651 | 1651 | unsigned color, |
| 1652 | 1652 | unsigned addr, |
| 1653 | 1653 | float m[4][4], |
| r1877 | r1878 | |
| 1813 | 1813 | } /* RegisterNormals */ |
| 1814 | 1814 | |
| 1815 | 1815 | static void |
| 1816 | BlitQuads( | |
| 1816 | BlitQuads( | |
| 1817 | 1817 | { |
| 1818 | 1818 | int numAdditionalNormals = 0; |
| 1819 | 1819 | int chunkLength = GetPolyData(addr++); |
| r1877 | r1878 | |
| 1918 | 1918 | } /* BlitQuads */ |
| 1919 | 1919 | |
| 1920 | 1920 | static void |
| 1921 | BlitPolyObject( | |
| 1921 | BlitPolyObject( | |
| 1922 | 1922 | { |
| 1923 | 1923 | unsigned addr1 = GetPolyData(code); |
| 1924 | 1924 | mLitSurfaceCount = 0; |
| r1877 | r1878 | |
| 2036 | 2036 | } /* HandleBB0003 */ |
| 2037 | 2037 | |
| 2038 | 2038 | static void |
| 2039 | Handle200002( | |
| 2039 | Handle200002( | |
| 2040 | 2040 | { |
| 2041 | 2041 | if( mPrimitiveID>=0x45 ) |
| 2042 | 2042 | { |
| r1877 | r1878 | |
| 2102 | 2102 | } /* Handle233002 */ |
| 2103 | 2103 | |
| 2104 | 2104 | static void |
| 2105 | SimulateSlaveDSP( | |
| 2105 | SimulateSlaveDSP( | |
| 2106 | 2106 | { |
| 2107 | 2107 | const INT32 *pSource = 0x300 + (INT32 *)namcos22_polygonram; |
| 2108 | 2108 | INT16 len; |
| r1877 | r1878 | |
| 2167 | 2167 | } /* SimulateSlaveDSP */ |
| 2168 | 2168 | |
| 2169 | 2169 | static void |
| 2170 | DrawPolygons( | |
| 2170 | DrawPolygons( | |
| 2171 | 2171 | { |
| 2172 | 2172 | if( mbDSPisActive ) |
| 2173 | 2173 | { |
| r1877 | r1878 | |
|---|---|---|
| 173 | 173 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | static void draw_sprites(running_machine *machine, | |
| 176 | static void draw_sprites(running_machine *machine, | |
| 177 | 177 | { |
| 178 | 178 | int i, offs; |
| 179 | 179 | |
| r1877 | r1878 | |
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | static void draw_bullets( | |
| 263 | static void draw_bullets( | |
| 264 | 264 | { |
| 265 | 265 | int offs; |
| 266 | 266 | |
| r1877 | r1878 | |
| 357 | 357 | /* Space Raider doesn't use the Va bit, and it is also set up to */ |
| 358 | 358 | /* window the stars to a certain x range */ |
| 359 | 359 | |
| 360 | void redclash_draw_stars( | |
| 360 | void redclash_draw_stars( | |
| 361 | 361 | { |
| 362 | 362 | int i; |
| 363 | 363 | UINT8 tempbit, feedback, star_color, xloc, yloc; |
| r1877 | r1878 | |
|---|---|---|
| 103 | 103 | VIDEO_UPDATE( xybots ) |
| 104 | 104 | { |
| 105 | 105 | struct atarimo_rect_list rectlist; |
| 106 | | |
| 106 | | |
| 107 | 107 | int x, y, r; |
| 108 | 108 | |
| 109 | 109 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| 118 | WRITE8_HANDLER( rockola_mc6845_address_w ) | |
| 119 | { | |
| 120 | mc6845_address_w(mc6845, data); | |
| 121 | } | |
| 122 | ||
| 123 | ||
| 124 | WRITE8_HANDLER( rockola_mc6845_register_w ) | |
| 125 | { | |
| 126 | mc6845_register_w(mc6845, data); | |
| 127 | } | |
| 128 | ||
| 129 | ||
| 130 | 118 | WRITE8_HANDLER( rockola_flipscreen_w ) |
| 131 | 119 | { |
| 132 | 120 | int bank; |
| r1877 | r1878 | |
| 275 | 263 | /* it controls only IRQs, not NMIs. Here I am affecting both, which */ |
| 276 | 264 | /* is wrong. */ |
| 277 | 265 | |
| 278 | interrupt_enable_w(0,data & 0x02); | |
| 266 | interrupt_enable_w(machine,0,data & 0x02); | |
| 279 | 267 | |
| 280 | 268 | /* other bits unused */ |
| 281 | 269 | } |
| r1877 | r1878 | |
|---|---|---|
| 443 | 443 | |
| 444 | 444 | VIDEO_UPDATE( warlords ) |
| 445 | 445 | { |
| 446 | int upright_mode = input_port_0_r(0) & 0x80; | |
| 446 | int upright_mode = input_port_0_r(machine, 0) & 0x80; | |
| 447 | 447 | int offs; |
| 448 | 448 | |
| 449 | 449 | /* if the cocktail/upright switch flipped, force refresh */ |
| r1877 | r1878 | |
|---|---|---|
| 380 | 380 | ((offset & 0xc0) == 0x40 && (newword == 0xffff || oldword == 0xffff))) |
| 381 | 381 | { |
| 382 | 382 | /* if the timer is in the active bank, update the display list */ |
| 383 | atarimo_0_spriteram_w(offset, data, 0); | |
| 383 | atarimo_0_spriteram_w(machine, offset, data, 0); | |
| 384 | 384 | update_timers(video_screen_get_vpos(0)); |
| 385 | 385 | } |
| 386 | 386 | |
| r1877 | r1878 | |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | /* let the MO handler do the basic work */ |
| 396 | atarimo_0_spriteram_w(offset, data, 0); | |
| 396 | atarimo_0_spriteram_w(machine, offset, data, 0); | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | |
| r1877 | r1878 | |
| 407 | 407 | static TIMER_CALLBACK( int3off_callback ) |
| 408 | 408 | { |
| 409 | 409 | /* clear the state */ |
| 410 | atarigen_scanline_int_ack_w(0, 0, 0); | |
| 410 | atarigen_scanline_int_ack_w(machine, 0, 0, 0); | |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | |
| r1877 | r1878 | |
| 515 | 515 | VIDEO_UPDATE( atarisy1 ) |
| 516 | 516 | { |
| 517 | 517 | struct atarimo_rect_list rectlist; |
| 518 | | |
| 518 | | |
| 519 | 519 | int x, y, r; |
| 520 | 520 | |
| 521 | 521 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 363 | 363 | 2, 2, 3, 3, |
| 364 | 364 | 2, 2, 3, 3 }; |
| 365 | 365 | |
| 366 | static void draw_sprites(running_machine *machine, | |
| 366 | static void draw_sprites(running_machine *machine, | |
| 367 | 367 | { |
| 368 | 368 | int offs,i,j,k; |
| 369 | 369 | int x,y,curx,cury; |
| r1877 | r1878 | |
| 506 | 506 | *********************************************************/ |
| 507 | 507 | |
| 508 | 508 | INLINE void bryan2_drawscanline( |
| 509 | | |
| 509 | | |
| 510 | 510 | const UINT16 *src,int transparent,UINT32 orient,int pri) |
| 511 | 511 | { |
| 512 | 512 | UINT16 *dsti = BITMAP_ADDR16(bitmap, y, x); |
| r1877 | r1878 | |
| 532 | 532 | |
| 533 | 533 | |
| 534 | 534 | |
| 535 | static void wgp_piv_layer_draw( | |
| 535 | static void wgp_piv_layer_draw( | |
| 536 | 536 | { |
| 537 | mame_bitmap *srcbitmap = tilemap_get_pixmap(wgp_piv_tilemap[layer]); | |
| 538 | mame_bitmap *flagsbitmap = tilemap_get_flagsmap(wgp_piv_tilemap[layer]); | |
| 537 | bitmap_t *srcbitmap = tilemap_get_pixmap(wgp_piv_tilemap[layer]); | |
| 538 | bitmap_t *flagsbitmap = tilemap_get_flagsmap(wgp_piv_tilemap[layer]); | |
| 539 | 539 | |
| 540 | 540 | UINT16 *dst16,*src16; |
| 541 | 541 | UINT8 *tsrc; |
| r1877 | r1878 | |
|---|---|---|
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | /* Sprite Drawing is pretty much the same as fromance.c */ |
| 43 | static void draw_sprites(running_machine *machine, | |
| 43 | static void draw_sprites(running_machine *machine, | |
| 44 | 44 | { |
| 45 | 45 | static const UINT8 zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 }; |
| 46 | 46 | int offs; |
| r1877 | r1878 | |
| 223 | 223 | tilemap_set_transparent_pen(char_tilemap, 15); |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | static void draw_background( | |
| 226 | static void draw_background( | |
| 227 | 227 | { |
| 228 | 228 | int x, y; |
| 229 | 229 | int pixdata; |
| r1877 | r1878 | |
|---|---|---|
| 16 | 16 | static tilemap* tilemap1; |
| 17 | 17 | static tilemap* tilemap2; |
| 18 | 18 | |
| 19 | static mame_bitmap* helper1; | |
| 20 | static mame_bitmap* helper2; | |
| 19 | static bitmap_t* helper1; | |
| 20 | static bitmap_t* helper2; | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | PALETTE_INIT( sprint8 ) |
| r1877 | r1878 | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
| 139 | static void draw_sprites(running_machine *machine, | |
| 139 | static void draw_sprites(running_machine *machine, | |
| 140 | 140 | { |
| 141 | 141 | int i; |
| 142 | 142 |
| r1877 | r1878 | |
|---|---|---|
| 148 | 148 | |
| 149 | 149 | /******************************************************************************/ |
| 150 | 150 | |
| 151 | static void draw_sprites(running_machine* machine, | |
| 151 | static void draw_sprites(running_machine* machine, | |
| 152 | 152 | { |
| 153 | 153 | int offs; |
| 154 | 154 | |
| r1877 | r1878 | |
| 164 | 164 | if ((colour & pri_mask) != pri_val) continue; |
| 165 | 165 | |
| 166 | 166 | flash=x&0x800; |
| 167 | if (flash && ( | |
| 167 | if (flash && (vid | |
| 168 | 168 | |
| 169 | 169 | fx = y & 0x2000; |
| 170 | 170 | fy = y & 0x4000; |
| r1877 | r1878 | |
| 216 | 216 | |
| 217 | 217 | /******************************************************************************/ |
| 218 | 218 | |
| 219 | static void custom_tilemap_draw( | |
| 219 | static void custom_tilemap_draw( | |
| 220 | 220 | const rectangle *cliprect, |
| 221 | 221 | tilemap *tilemap_ptr, |
| 222 | 222 | const UINT16 *rowscroll_ptr, |
| r1877 | r1878 | |
| 225 | 225 | const UINT16 *control1, |
| 226 | 226 | int flags) |
| 227 | 227 | { |
| 228 | const | |
| 228 | const | |
| 229 | 229 | int x, y, p; |
| 230 | 230 | int column_offset=0, src_x=0, src_y=0; |
| 231 | 231 | UINT32 scrollx=control1[0]; |
| r1877 | r1878 | |
| 295 | 295 | |
| 296 | 296 | /******************************************************************************/ |
| 297 | 297 | |
| 298 | static void dec0_pf1_draw( | |
| 298 | static void dec0_pf1_draw( | |
| 299 | 299 | { |
| 300 | 300 | switch (dec0_pf1_control_0[3]&0x3) { |
| 301 | 301 | case 0: /* 4x1 */ |
| r1877 | r1878 | |
| 311 | 311 | }; |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | static void dec0_pf2_draw( | |
| 314 | static void dec0_pf2_draw( | |
| 315 | 315 | { |
| 316 | 316 | switch (dec0_pf2_control_0[3]&0x3) { |
| 317 | 317 | case 0: /* 4x1 */ |
| r1877 | r1878 | |
| 327 | 327 | }; |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | static void dec0_pf3_draw( | |
| 330 | static void dec0_pf3_draw( | |
| 331 | 331 | { |
| 332 | 332 | switch (dec0_pf3_control_0[3]&0x3) { |
| 333 | 333 | case 0: /* 4x1 */ |
| r1877 | r1878 | |
| 611 | 611 | offset&=0xffe; |
| 612 | 612 | myword=buffer[offset] + (buffer[offset+1]<<8); |
| 613 | 613 | |
| 614 | if (offset<0x10) dec0_pf3_control_0_w(offset/2,myword,0); | |
| 615 | else dec0_pf3_control_1_w((offset-0x10)/2,myword,0); | |
| 614 | if (offset<0x10) dec0_pf3_control_0_w(machine,offset/2,myword,0); | |
| 615 | else dec0_pf3_control_1_w(machine,(offset-0x10)/2,myword,0); | |
| 616 | 616 | } |
| 617 | 617 | |
| 618 | 618 | WRITE8_HANDLER( dec0_pf3_data_8bit_w ) |
| r1877 | r1878 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | static int shadow_pen_mask, shadow_pen_shift; |
| 146 | 146 | |
| 147 | static void ssv_drawgfx( | |
| 147 | static void ssv_drawgfx( | |
| 148 | 148 | UINT32 code,UINT32 color,int flipx,int flipy,int x0,int y0, |
| 149 | 149 | const rectangle *cliprect, int shadow ) |
| 150 | 150 | { |
| r1877 | r1878 | |
| 591 | 591 | |
| 592 | 592 | /* Draw a tilemap sprite */ |
| 593 | 593 | |
| 594 | static void draw_row(running_machine *machine, | |
| 594 | static void draw_row(running_machine *machine, | |
| 595 | 595 | { |
| 596 | 596 | rectangle clip; |
| 597 | 597 | int attr, code, color, mode, size, page, shadow; |
| r1877 | r1878 | |
| 716 | 716 | |
| 717 | 717 | /* Draw the "background layer" using multiple tilemap sprites */ |
| 718 | 718 | |
| 719 | static void draw_layer(running_machine *machine, | |
| 719 | static void draw_layer(running_machine *machine, | |
| 720 | 720 | { |
| 721 | 721 | int sy; |
| 722 | 722 | for ( sy = 0; sy <= machine->screen[0].visarea.max_y; sy += 0x40 ) |
| r1877 | r1878 | |
| 725 | 725 | |
| 726 | 726 | /* Draw sprites in the sprites list */ |
| 727 | 727 | |
| 728 | static void draw_sprites(running_machine *machine, | |
| 728 | static void draw_sprites(running_machine *machine, | |
| 729 | 729 | { |
| 730 | 730 | /* Sprites list */ |
| 731 | 731 | |
| r1877 | r1878 | |
| 994 | 994 | E.h Unused |
| 995 | 995 | |
| 996 | 996 | */ |
| 997 | static void gdfs_draw_zooming_sprites(running_machine *machine, | |
| 997 | static void gdfs_draw_zooming_sprites(running_machine *machine, | |
| 998 | 998 | { |
| 999 | 999 | /* Sprites list */ |
| 1000 | 1000 |
| r1877 | r1878 | |
|---|---|---|
| 87 | 87 | Screen refresh |
| 88 | 88 | ***************************************************************************/ |
| 89 | 89 | |
| 90 | static void draw_sprites( | |
| 90 | static void draw_sprites( | |
| 91 | 91 | { |
| 92 | 92 | /* Y chain size is 16/32?/64/64? pixels. X chain size |
| 93 | 93 | is always 64 pixels. */ |
| r1877 | r1878 | |
| 217 | 217 | int col; |
| 218 | 218 | }; |
| 219 | 219 | |
| 220 | static void fill_slope( | |
| 220 | static void fill_slope( | |
| 221 | 221 | { |
| 222 | 222 | if(y1 > view.y2) |
| 223 | 223 | return; |
| r1877 | r1878 | |
| 280 | 280 | *nx2 = x2; |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | static void fill_poly( | |
| 283 | static void fill_poly( | |
| 284 | 284 | { |
| 285 | 285 | INT32 sl1, sl2, cury, limy, x1, x2; |
| 286 | 286 | int pmin, pmax, i, ps1, ps2; |
| r1877 | r1878 | |
|---|---|---|
| 236 | 236 | |
| 237 | 237 | /* copy the motion objects on top */ |
| 238 | 238 | { |
| 239 | | |
| 239 | | |
| 240 | 240 | int left = cliprect->min_x; |
| 241 | 241 | int top = cliprect->min_y; |
| 242 | 242 | int right = cliprect->max_x + 1; |
| r1877 | r1878 | |
|---|---|---|
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | #include "driver.h" |
| 7 | #include "deprecat.h" | |
| 8 | 7 | #include "namcoic.h" |
| 9 | 8 | |
| 10 | 9 | #define TX_TILE_OFFSET_CENTER (32 * 2) |
| r1877 | r1878 | |
| 32 | 31 | static INT32 bg1_scroll_x, bg1_scroll_y; |
| 33 | 32 | static INT32 bg2_scroll_x, bg2_scroll_y; |
| 34 | 33 | |
| 35 | static | |
| 34 | static | |
| 36 | 35 | |
| 37 | 36 | static UINT16 *tceptor_sprite_ram_buffered; |
| 38 | 37 | |
| r1877 | r1878 | |
| 474 | 473 | z: zoom y |
| 475 | 474 | */ |
| 476 | 475 | |
| 477 | static void draw_sprites(running_machine *machine, | |
| 476 | static void draw_sprites(running_machine *machine, | |
| 478 | 477 | { |
| 479 | 478 | UINT16 *mem1 = &tceptor_sprite_ram_buffered[0x000/2]; |
| 480 | 479 | UINT16 *mem2 = &tceptor_sprite_ram_buffered[0x100/2]; |
| r1877 | r1878 | |
| 562 | 561 | |
| 563 | 562 | if (screen) |
| 564 | 563 | { |
| 565 | int frame = | |
| 564 | int frame = vid | |
| 566 | 565 | |
| 567 | 566 | if ((frame & 1) == 1 && screen == 1) |
| 568 | 567 | return UPDATE_HAS_NOT_CHANGED; |
| r1877 | r1878 | |
|---|---|---|
| 166 | 166 | |
| 167 | 167 | ***************************************************************************/ |
| 168 | 168 | |
| 169 | static void draw_sprites(running_machine *machine, | |
| 169 | static void draw_sprites(running_machine *machine, | |
| 170 | 170 | { |
| 171 | 171 | int offs,code,attr,sx,sy,flipx,flipy,color; |
| 172 | 172 |
| r1877 | r1878 | |
|---|---|---|
| 225 | 225 | VIDEO_UPDATE( vindictr ) |
| 226 | 226 | { |
| 227 | 227 | struct atarimo_rect_list rectlist; |
| 228 | | |
| 228 | | |
| 229 | 229 | int x, y, r; |
| 230 | 230 | |
| 231 | 231 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 14 | 14 | extern UINT16 *aquarium_bak_videoram; |
| 15 | 15 | |
| 16 | 16 | /* gcpinbal.c modified */ |
| 17 | static void draw_sprites(running_machine *machine, | |
| 17 | static void draw_sprites(running_machine *machine, | |
| 18 | 18 | { |
| 19 | 19 | int offs,chain_pos; |
| 20 | 20 | int x,y,curx,cury; |
| r1877 | r1878 | |
|---|---|---|
| 554 | 554 | |
| 555 | 555 | /* Draw sprites */ |
| 556 | 556 | |
| 557 | void metro_draw_sprites(running_machine *machine, | |
| 557 | void metro_draw_sprites(running_machine *machine, | |
| 558 | 558 | { |
| 559 | 559 | const int region = REGION_GFX1; |
| 560 | 560 | |
| r1877 | r1878 | |
| 728 | 728 | |
| 729 | 729 | ***************************************************************************/ |
| 730 | 730 | |
| 731 | static void draw_tilemap(running_machine *machine, | |
| 731 | static void draw_tilemap(running_machine *machine, | |
| 732 | 732 | int sx, int sy, int wx, int wy) // scroll & window values |
| 733 | 733 | { |
| 734 | 734 | #if 1 |
| r1877 | r1878 | |
| 788 | 788 | |
| 789 | 789 | |
| 790 | 790 | /* Draw all the layers that match the given priority */ |
| 791 | static void draw_layers(running_machine *machine, | |
| 791 | static void draw_layers(running_machine *machine, | |
| 792 | 792 | { |
| 793 | 793 | UINT16 layers_pri = metro_videoregs[0x10/2]; |
| 794 | 794 | int layer; |
| r1877 | r1878 | |
|---|---|---|
| 139 | 139 | |
| 140 | 140 | */ |
| 141 | 141 | |
| 142 | static void draw_sprites(running_machine *machine, | |
| 142 | static void draw_sprites(running_machine *machine, | |
| 143 | 143 | { |
| 144 | 144 | const UINT8 *source = spriteram+0x100-4; |
| 145 | 145 | const UINT8 *finish = spriteram; |
| r1877 | r1878 | |
|---|---|---|
| 165 | 165 | |
| 166 | 166 | ***************************************************************************/ |
| 167 | 167 | |
| 168 | static void draw_sprites(running_machine *machine, | |
| 168 | static void draw_sprites(running_machine *machine, | |
| 169 | 169 | { |
| 170 | 170 | int offs; |
| 171 | 171 | UINT8 *sr; |
| r1877 | r1878 | |
|---|---|---|
| 135 | 135 | 8, 8, 32, 32); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | static void draw_sprites(running_machine *machine, | |
| 138 | static void draw_sprites(running_machine *machine, | |
| 139 | 139 | { |
| 140 | 140 | int offs; |
| 141 | 141 |
| r1877 | r1878 | |
|---|---|---|
| 306 | 306 | poly_extra_data *extra = poly_get_extra_data(poly); |
| 307 | 307 | UINT16 *dest = &midvunit_videoram[(page_control & 4) ? 0x40000 : 0x00000]; |
| 308 | 308 | int textured = ((dma_data[0] & 0x300) == 0x100); |
| 309 | poly_draw_scanline callback; | |
| 309 | poly_draw_scanline_func callback; | |
| 310 | 310 | poly_vertex vert[4]; |
| 311 | 311 | |
| 312 | 312 | /* if we're rendering to the same page we're viewing, it has changed */ |
| r1877 | r1878 | |
|---|---|---|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
| 75 | WRITE8_HANDLER( usgames_mc6845_address_w ) | |
| 76 | { | |
| 77 | mc6845_address_w(mc6845, data); | |
| 78 | } | |
| 79 | ||
| 80 | ||
| 81 | WRITE8_HANDLER( usgames_mc6845_register_w ) | |
| 82 | { | |
| 83 | mc6845_register_w(mc6845, data); | |
| 84 | } | |
| 85 | ||
| 86 | ||
| 87 | 75 | VIDEO_UPDATE(usgames) |
| 88 | 76 | { |
| 89 | 77 | tilemap_draw(bitmap,cliprect,usgames_tilemap,0,0); |
| r1877 | r1878 | |
|---|---|---|
| 117 | 117 | |
| 118 | 118 | ***************************************************************************/ |
| 119 | 119 | |
| 120 | static void draw_sprites(running_machine *machine, | |
| 120 | static void draw_sprites(running_machine *machine, | |
| 121 | 121 | { |
| 122 | 122 | int offs; |
| 123 | 123 |
| r1877 | r1878 | |
|---|---|---|
| 204 | 204 | |
| 205 | 205 | ***************************************************************************/ |
| 206 | 206 | |
| 207 | static void draw_sprites(running_machine *machine, | |
| 207 | static void draw_sprites(running_machine *machine, | |
| 208 | 208 | { |
| 209 | 209 | int offs; |
| 210 | 210 | rectangle clip = *cliprect; |
| r1877 | r1878 | |
|---|---|---|
| 100 | 100 | |
| 101 | 101 | |
| 102 | 102 | |
| 103 | static void draw_sprites(running_machine *machine, | |
| 103 | static void draw_sprites(running_machine *machine, | |
| 104 | 104 | { |
| 105 | 105 | |
| 106 | 106 | /* | ---- ---- hhhf Fe-Y | ---- ---- yyyy yyyy | ---- ---- TTTT TTTT | ---- ---- tttt tttt | |
| r1877 | r1878 | |
|---|---|---|
| 82 | 82 | * * |
| 83 | 83 | *************************************/ |
| 84 | 84 | |
| 85 | static void draw_sprites(running_machine *machine, | |
| 85 | static void draw_sprites(running_machine *machine, | |
| 86 | 86 | { |
| 87 | 87 | int x,y,code,color,offset,flipx,flipy; |
| 88 | 88 |
| r1877 | r1878 | |
|---|---|---|
| 87 | 87 | y = offset % 32; |
| 88 | 88 | offset = 32 * y + x; |
| 89 | 89 | |
| 90 | tagteam_videoram_w(offset,data); | |
| 90 | tagteam_videoram_w(machine,offset,data); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | WRITE8_HANDLER( tagteam_mirrorcolorram_w ) |
| r1877 | r1878 | |
| 99 | 99 | y = offset % 32; |
| 100 | 100 | offset = 32 * y + x; |
| 101 | 101 | |
| 102 | tagteam_colorram_w(offset,data); | |
| 102 | tagteam_colorram_w(machine,offset,data); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | WRITE8_HANDLER( tagteam_control_w ) |
| r1877 | r1878 | |
| 133 | 133 | 8, 8, 32, 32); |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | static void draw_sprites(running_machine *machine, | |
| 136 | static void draw_sprites(running_machine *machine, | |
| 137 | 137 | { |
| 138 | 138 | int offs; |
| 139 | 139 |
| r1877 | r1878 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | 2 | |
| 3 | 3 | int eolith_buffer = 0; |
| 4 | static | |
| 4 | static | |
| 5 | 5 | static UINT32 *eo_vram; |
| 6 | 6 | |
| 7 | 7 | static void plot_pixel_rgb(int x, int y, int color) |
| r1877 | r1878 | |
| 25 | 25 | switch(mem_mask) |
| 26 | 26 | { |
| 27 | 27 | case 0: |
| 28 | eolith_vram_w(offset,data,0x0000ffff); | |
| 29 | eolith_vram_w(offset,data,0xffff0000); | |
| 28 | eolith_vram_w(machine,offset,data,0x0000ffff); | |
| 29 | eolith_vram_w(machine,offset,data,0xffff0000); | |
| 30 | 30 | return; |
| 31 | 31 | |
| 32 | 32 | case 0xffff: |
| r1877 | r1878 | |
|---|---|---|
| 157 | 157 | int i; |
| 158 | 158 | /* reset the GTIA read/write/helper registers */ |
| 159 | 159 | for (i = 0; i < 32; i++) |
| 160 | atari_gtia_w(i,0); | |
| 160 | atari_gtia_w(machine,i,0); | |
| 161 | 161 | memset(>ia.r, 0, sizeof(gtia.r)); |
| 162 | 162 | if (is_ntsc()) |
| 163 | 163 | gtia.r.pal = 0xff; |
| r1877 | r1878 | |
|---|---|---|
| 19 | 19 | static UINT8 *vidram; |
| 20 | 20 | |
| 21 | 21 | |
| 22 | static | |
| 22 | static | |
| 23 | 23 | |
| 24 | 24 | WRITE8_HANDLER(bigevglf_palette_w) |
| 25 | 25 | { |
| r1877 | r1878 | |
| 69 | 69 | vidram = auto_malloc(0x100*0x100 * 4); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | static void draw_sprites(running_machine *machine, | |
| 72 | static void draw_sprites(running_machine *machine, | |
| 73 | 73 | { |
| 74 | 74 | int i,j; |
| 75 | 75 | for (i = 0xc0-4; i >= 0; i-=4) |
| r1877 | r1878 | |
|---|---|---|
| 107 | 107 | 8, 8, 32, 32); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | static void draw_sprites(running_machine *machine, | |
| 110 | static void draw_sprites(running_machine *machine, | |
| 111 | 111 | { |
| 112 | 112 | int offs; |
| 113 | 113 |
| r1877 | r1878 | |
|---|---|---|
| 68 | 68 | |
| 69 | 69 | ******************************************************************************/ |
| 70 | 70 | |
| 71 | static void draw_sprites(running_machine *machine, | |
| 71 | static void draw_sprites(running_machine *machine, | |
| 72 | 72 | { |
| 73 | 73 | int offs; |
| 74 | 74 |
| r1877 | r1878 | |
|---|---|---|
| 97 | 97 | tilemap_set_transparent_pen(fg_tilemap, 3); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | static void draw_sprites(running_machine *machine, | |
| 100 | static void draw_sprites(running_machine *machine, | |
| 101 | 101 | { |
| 102 | 102 | int offs; |
| 103 | 103 | |
| r1877 | r1878 | |
| 137 | 137 | |
| 138 | 138 | VIDEO_EOF( commando ) |
| 139 | 139 | { |
| 140 | buffer_spriteram_w(0, 0); | |
| 140 | buffer_spriteram_w(machine, 0, 0); | |
| 141 | 141 | } |
| r1877 | r1878 | |
|---|---|---|
| 302 | 302 | /* force an update if the link of object 0 is about to change */ |
| 303 | 303 | if (offs == 0x0c03) |
| 304 | 304 | video_screen_update_partial(0, video_screen_get_vpos(0)); |
| 305 | atarimo_0_spriteram_w(offs - 0x0c00, data, mem_mask); | |
| 305 | atarimo_0_spriteram_w(machine, offs - 0x0c00, data, mem_mask); | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | /* playfieldram? */ |
| r1877 | r1878 | |
| 331 | 331 | VIDEO_UPDATE( atarisy2 ) |
| 332 | 332 | { |
| 333 | 333 | struct atarimo_rect_list rectlist; |
| 334 | | |
| 334 | | |
| 335 | 335 | int x, y, r; |
| 336 | 336 | |
| 337 | 337 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | static int sprite_overdraw_enabled; |
| 8 | 8 | static int next_sprite_overdraw_enabled; |
| 9 | static | |
| 9 | static | |
| 10 | 10 | // in robokid and omegaf big sprites are laid out differently in ROM |
| 11 | 11 | static int robokid_sprites; |
| 12 | 12 | |
| r1877 | r1878 | |
| 335 | 335 | * |
| 336 | 336 | *************************************/ |
| 337 | 337 | |
| 338 | static void draw_sprites(running_machine* const machine, | |
| 338 | static void draw_sprites(running_machine* const machine, | |
| 339 | 339 | { |
| 340 | 340 | const gfx_element* const gfx = machine->gfx[1]; |
| 341 | 341 | int const big_xshift = robokid_sprites ? 1 : 0; |
| r1877 | r1878 | |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | |
| 440 | static void erase_sprites(running_machine* const machine, | |
| 440 | static void erase_sprites(running_machine* const machine, | |
| 441 | 441 | { |
| 442 | 442 | // if sprite overdraw is disabled, clear the sprite framebuffer |
| 443 | 443 | // if sprite overdraw is enabled, only clear palettes 0-B, and leave C-F on screen |
| r1877 | r1878 | |
|---|---|---|
| 16 | 16 | int mjsister_vrambank; |
| 17 | 17 | int mjsister_colorbank; |
| 18 | 18 | |
| 19 | static | |
| 19 | static | |
| 20 | 20 | static UINT8 *mjsister_videoram0, *mjsister_videoram1; |
| 21 | 21 | |
| 22 | 22 | /****************************************************************************/ |
| r1877 | r1878 | |
|---|---|---|
| 18 | 18 | MACHINE_RESET( skydiver ) |
| 19 | 19 | { |
| 20 | 20 | /* reset all latches */ |
| 21 | skydiver_start_lamp_1_w(0, 0); | |
| 22 | skydiver_start_lamp_2_w(0, 0); | |
| 23 | skydiver_lamp_s_w(0, 0); | |
| 24 | skydiver_lamp_k_w(0, 0); | |
| 25 | skydiver_lamp_y_w(0, 0); | |
| 26 | skydiver_lamp_d_w(0, 0); | |
| 21 | skydiver_start_lamp_1_w(machine, 0, 0); | |
| 22 | skydiver_start_lamp_2_w(machine, 0, 0); | |
| 23 | skydiver_lamp_s_w(machine, 0, 0); | |
| 24 | skydiver_lamp_k_w(machine, 0, 0); | |
| 25 | skydiver_lamp_y_w(machine, 0, 0); | |
| 26 | skydiver_lamp_d_w(machine, 0, 0); | |
| 27 | 27 | output_set_value("lampi", 0); |
| 28 | 28 | output_set_value("lampv", 0); |
| 29 | 29 | output_set_value("lampe", 0); |
| 30 | 30 | output_set_value("lampr", 0); |
| 31 | skydiver_width_w(0, 0); | |
| 32 | skydiver_coin_lockout_w(0, 0); | |
| 31 | skydiver_width_w(machine, 0, 0); | |
| 32 | skydiver_coin_lockout_w(machine, 0, 0); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
| r1877 | r1878 | |
| 130 | 130 | { |
| 131 | 131 | int bit = offset & 0x01; |
| 132 | 132 | |
| 133 | watchdog_reset_w(0,0); | |
| 133 | watchdog_reset_w(machine,0,0); | |
| 134 | 134 | |
| 135 | 135 | switch (offset & 0x0e) |
| 136 | 136 | { |
| r1877 | r1878 | |
| 147 | 147 | output_set_value("lampr", bit); |
| 148 | 148 | break; |
| 149 | 149 | case (0x0a): |
| 150 | discrete_sound_w(SKYDIVER_OCT1_EN, bit); | |
| 150 | discrete_sound_w(machine, SKYDIVER_OCT1_EN, bit); | |
| 151 | 151 | break; |
| 152 | 152 | case (0x0c): |
| 153 | discrete_sound_w(SKYDIVER_OCT2_EN, bit); | |
| 153 | discrete_sound_w(machine, SKYDIVER_OCT2_EN, bit); | |
| 154 | 154 | break; |
| 155 | 155 | case (0x0e): |
| 156 | discrete_sound_w(SKYDIVER_NOISE_RST, bit); | |
| 156 | discrete_sound_w(machine, SKYDIVER_NOISE_RST, bit); | |
| 157 | 157 | break; |
| 158 | 158 | } |
| 159 | 159 | } |
| r1877 | r1878 | |
| 165 | 165 | * |
| 166 | 166 | *************************************/ |
| 167 | 167 | |
| 168 | static void draw_sprites(running_machine *machine, | |
| 168 | static void draw_sprites(running_machine *machine, | |
| 169 | 169 | { |
| 170 | 170 | int pic; |
| 171 | 171 |
| r1877 | r1878 | |
|---|---|---|
| 298 | 298 | * |
| 299 | 299 | *************************************/ |
| 300 | 300 | |
| 301 | static void draw_background(running_machine *machine, | |
| 301 | static void draw_background(running_machine *machine, | |
| 302 | 302 | { |
| 303 | 303 | rectangle rect; |
| 304 | 304 |
| r1877 | r1878 | |
|---|---|---|
| 205 | 205 | |
| 206 | 206 | static void draw_starfield(running_machine *machine, |
| 207 | 207 | int scrnum, |
| 208 | | |
| 208 | | |
| 209 | 209 | const rectangle *cliprect) |
| 210 | 210 | { |
| 211 | 211 | int y; |
| r1877 | r1878 | |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | |
| 317 | static void draw_bullet(offs_t offs, pen_t pen, | |
| 317 | static void draw_bullet(offs_t offs, pen_t pen, | |
| 318 | 318 | { |
| 319 | 319 | UINT8 sy; |
| 320 | 320 | |
| r1877 | r1878 | |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | |
| 368 | static void draw_sprite(offs_t offs, pen_t *pens, | |
| 368 | static void draw_sprite(offs_t offs, pen_t *pens, | |
| 369 | 369 | { |
| 370 | 370 | UINT8 sy; |
| 371 | 371 | |
| r1877 | r1878 | |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | |
| 425 | static void draw_objects( | |
| 425 | static void draw_objects( | |
| 426 | 426 | { |
| 427 | 427 | pen_t sprite_pens[NUM_SPRITE_PENS]; |
| 428 | 428 |
| r1877 | r1878 | |
|---|---|---|
| 218 | 218 | |
| 219 | 219 | ***************************************************************************/ |
| 220 | 220 | |
| 221 | INLINE void geebee_plot( | |
| 221 | INLINE void geebee_plot( | |
| 222 | 222 | { |
| 223 | 223 | if (x >= cliprect->min_x && x <= cliprect->max_x && y >= cliprect->min_y && y <= cliprect->max_y) |
| 224 | 224 | *BITMAP_ADDR16(bitmap, y, x) = pen; |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | static void draw_ball( | |
| 227 | static void draw_ball( | |
| 228 | 228 | { |
| 229 | 229 | if (warpwarp_ball_on) |
| 230 | 230 | { |
| r1877 | r1878 | |
|---|---|---|
| 66 | 66 | |
| 67 | 67 | /******************************************************************************/ |
| 68 | 68 | |
| 69 | static void draw_sprites(running_machine *machine, | |
| 69 | static void draw_sprites(running_machine *machine, | |
| 70 | 70 | { |
| 71 | 71 | int offs; |
| 72 | 72 | |
| r1877 | r1878 | |
| 87 | 87 | if (x&0x2000) colour+=64; |
| 88 | 88 | |
| 89 | 89 | flash=y&0x1000; |
| 90 | if (flash && ( | |
| 90 | if (flash && (vid | |
| 91 | 91 | |
| 92 | 92 | fx = y & 0x2000; |
| 93 | 93 | fy = y & 0x4000; |
| r1877 | r1878 | |
|---|---|---|
| 136 | 136 | |
| 137 | 137 | #include "driver.h" |
| 138 | 138 | #include "deprecat.h" |
| 139 | #include "memconv.h" | |
| 139 | 140 | #include "profiler.h" |
| 140 | 141 | #include "machine/atarigen.h" |
| 141 | 142 | #include "cpu/mips/r3000.h" |
| r1877 | r1878 | |
| 196 | 197 | static emu_timer *object_timer; |
| 197 | 198 | static UINT8 cpu_irq_state; |
| 198 | 199 | |
| 199 | static | |
| 200 | static | |
| 200 | 201 | |
| 201 | 202 | static pen_t *pen_table; |
| 202 | 203 | |
| r1877 | r1878 | |
| 706 | 707 | |
| 707 | 708 | READ32_HANDLER( jaguar_tom_regs32_r ) |
| 708 | 709 | { |
| 709 | return | |
| 710 | return | |
| 710 | 711 | } |
| 711 | 712 | |
| 712 | 713 | |
| 713 | 714 | WRITE32_HANDLER( jaguar_tom_regs32_w ) |
| 714 | 715 | { |
| 715 | if (ACCESSING_MSW32) | |
| 716 | jaguar_tom_regs_w(offset * 2, data >> 16, mem_mask >> 16); | |
| 717 | if (ACCESSING_LSW32) | |
| 718 | jaguar_tom_regs_w(offset * 2 + 1, data, mem_mask); | |
| 716 | write32be_with_16be_handler(jaguar_tom_regs_w, machine, offset, data, mem_mask); | |
| 719 | 717 | } |
| 720 | 718 | |
| 721 | 719 |
| r1877 | r1878 | |
|---|---|---|
| 65 | 65 | return MAKE_RGB((UINT8)finalR,(UINT8)finalG,(UINT8)finalB) ; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | static void jal_blend_drawgfx( | |
| 68 | static void jal_blend_drawgfx( | |
| 69 | 69 | UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, |
| 70 | 70 | const rectangle *clip,int transparency,int transparent_color) |
| 71 | 71 | { |
| r1877 | r1878 | |
|---|---|---|
| 114 | 114 | |
| 115 | 115 | ***************************************************************************/ |
| 116 | 116 | |
| 117 | static void draw_sprites(running_machine *machine, | |
| 117 | static void draw_sprites(running_machine *machine, | |
| 118 | 118 | { |
| 119 | 119 | const gfx_element *gfx = machine->gfx[2]; |
| 120 | 120 | int offs; |
| r1877 | r1878 | |
| 156 | 156 | |
| 157 | 157 | VIDEO_EOF( gng ) |
| 158 | 158 | { |
| 159 | buffer_spriteram_w(0,0); | |
| 159 | buffer_spriteram_w(machine,0,0); | |
| 160 | 160 | } |
| r1877 | r1878 | |
|---|---|---|
| 20 | 20 | static int ojankohs_scrollx, ojankohs_scrolly; |
| 21 | 21 | static tilemap *ojankohs_tilemap; |
| 22 | 22 | static int ojankoc_screen_refresh; |
| 23 | static | |
| 23 | static | |
| 24 | 24 | |
| 25 | 25 | WRITE8_HANDLER( ojankoc_videoram_w ); |
| 26 | 26 | |
| r1877 | r1878 | |
| 209 | 209 | |
| 210 | 210 | ******************************************************************************/ |
| 211 | 211 | |
| 212 | void ojankoc_flipscreen(int data) | |
| 212 | void ojankoc_flipscreen(running_machine *machine, int data) | |
| 213 | 213 | { |
| 214 | 214 | static int ojankoc_flipscreen_old = 0; |
| 215 | 215 | int x, y; |
| r1877 | r1878 | |
| 223 | 223 | for (x = 0; x < 0x100; x++) { |
| 224 | 224 | color1 = ojankohs_videoram[0x0000 + ((y * 256) + x)]; |
| 225 | 225 | color2 = ojankohs_videoram[0x3fff - ((y * 256) + x)]; |
| 226 | ojankoc_videoram_w(0x0000 + ((y * 256) + x), color2); | |
| 227 | ojankoc_videoram_w(0x3fff - ((y * 256) + x), color1); | |
| 226 | ojankoc_videoram_w(machine, 0x0000 + ((y * 256) + x), color2); | |
| 227 | ojankoc_videoram_w(machine, 0x3fff - ((y * 256) + x), color1); | |
| 228 | 228 | |
| 229 | 229 | color1 = ojankohs_videoram[0x4000 + ((y * 256) + x)]; |
| 230 | 230 | color2 = ojankohs_videoram[0x7fff - ((y * 256) + x)]; |
| 231 | ojankoc_videoram_w(0x4000 + ((y * 256) + x), color2); | |
| 232 | ojankoc_videoram_w(0x7fff - ((y * 256) + x), color1); | |
| 231 | ojankoc_videoram_w(machine, 0x4000 + ((y * 256) + x), color2); | |
| 232 | ojankoc_videoram_w(machine, 0x7fff - ((y * 256) + x), color1); | |
| 233 | 233 | } |
| 234 | 234 | } |
| 235 | 235 | |
| r1877 | r1878 | |
| 324 | 324 | { |
| 325 | 325 | /* redraw bitmap */ |
| 326 | 326 | for (offs = 0; offs < 0x8000; offs++) { |
| 327 | ojankoc_videoram_w(offs, ojankohs_videoram[offs]); | |
| 327 | ojankoc_videoram_w(machine, offs, ojankohs_videoram[offs]); | |
| 328 | 328 | } |
| 329 | 329 | ojankoc_screen_refresh = 0; |
| 330 | 330 | } |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "deprecat.h" | |
| 9 | 8 | #include "includes/n8080.h" |
| 10 | 9 | |
| 11 | 10 | int spacefev_red_screen; |
| r1877 | r1878 | |
| 194 | 193 | 6, /* cyan */ |
| 195 | 194 | }; |
| 196 | 195 | |
| 197 | int cycle = | |
| 196 | int cycle = vid | |
| 198 | 197 | |
| 199 | 198 | color = ufo_color[cycle % 6]; |
| 200 | 199 | } |
| r1877 | r1878 | |
| 369 | 368 | |
| 370 | 369 | VIDEO_EOF( helifire ) |
| 371 | 370 | { |
| 372 | int n = ( | |
| 371 | int n = (vid | |
| 373 | 372 | |
| 374 | 373 | int i; |
| 375 | 374 | |
| r1877 | r1878 | |
| 386 | 385 | G |= B; |
| 387 | 386 | } |
| 388 | 387 | |
| 389 | if ( | |
| 388 | if (vid | |
| 390 | 389 | { |
| 391 | 390 | R |= G; |
| 392 | 391 | } |
| r1877 | r1878 | |
|---|---|---|
| 24 | 24 | static int nbmj8891_screen_refresh; |
| 25 | 25 | static int gfxdraw_mode; |
| 26 | 26 | |
| 27 | static | |
| 27 | static | |
| 28 | 28 | static UINT8 *nbmj8891_videoram0, *nbmj8891_videoram1; |
| 29 | 29 | static UINT8 *nbmj8891_palette; |
| 30 | 30 | static UINT8 *nbmj8891_clut; |
| r1877 | r1878 | |
|---|---|---|
| 104 | 104 | |
| 105 | 105 | ***************************************************************************/ |
| 106 | 106 | |
| 107 | static void draw_sprites(running_machine *machine, | |
| 107 | static void draw_sprites(running_machine *machine, | |
| 108 | 108 | int offs; |
| 109 | 109 | |
| 110 | 110 | /* draw all visible sprites of specified priority */ |
| r1877 | r1878 | |
|---|---|---|
| 193 | 193 | |
| 194 | 194 | ***************************************************************************/ |
| 195 | 195 | |
| 196 | static void draw_sprites(running_machine *machine, | |
| 196 | static void draw_sprites(running_machine *machine, | |
| 197 | 197 | { |
| 198 | 198 | rectangle clip = *cliprect; |
| 199 | 199 | const gfx_element *gfx = machine->gfx[1 + sprite_bank]; |
| r1877 | r1878 | |
|---|---|---|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
| 105 | static void holeland_draw_sprites(running_machine *machine, | |
| 105 | static void holeland_draw_sprites(running_machine *machine, | |
| 106 | 106 | { |
| 107 | 107 | int offs,code,sx,sy,color,flipx, flipy; |
| 108 | 108 | |
| r1877 | r1878 | |
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | static void crzrally_draw_sprites(running_machine *machine, | |
| 144 | static void crzrally_draw_sprites(running_machine *machine, | |
| 145 | 145 | { |
| 146 | 146 | int offs,code,sx,sy,color,flipx, flipy; |
| 147 | 147 |
| r1877 | r1878 | |
|---|---|---|
| 18 | 18 | static UINT8 deco16_io_ram[16]; |
| 19 | 19 | |
| 20 | 20 | #if 0 |
| 21 | void debug_print( | |
| 21 | void debug_print( | |
| 22 | 22 | { |
| 23 | 23 | int i,j; |
| 24 | 24 | char buf[20*16]; |
| r1877 | r1878 | |
| 100 | 100 | /* Todo */ |
| 101 | 101 | break; |
| 102 | 102 | case 8: /* Irq ack */ |
| 103 | cpunum_set_input_line( | |
| 103 | cpunum_set_input_line(machine, 0,DECO16_IRQ_LINE,CLEAR_LINE); | |
| 104 | 104 | break; |
| 105 | 105 | case 9: /* Sound */ |
| 106 | soundlatch_w(0,data); | |
| 107 | cpunum_set_input_line(Machine, 1,M6502_IRQ_LINE,HOLD_LINE); | |
| 106 | soundlatch_w(machine,0,data); | |
| 107 | cpunum_set_input_line(machine, 1,M6502_IRQ_LINE,HOLD_LINE); | |
| 108 | 108 | break; |
| 109 | 109 | } |
| 110 | 110 | } |
| r1877 | r1878 | |
| 147 | 147 | WRITE8_HANDLER( prosport_paletteram_w ) |
| 148 | 148 | { |
| 149 | 149 | /* RGB output is inverted */ |
| 150 | paletteram_BBGGGRRR_w(offset,~data); | |
| 150 | paletteram_BBGGGRRR_w(machine,offset,~data); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | PALETTE_INIT( liberate ) |
| r1877 | r1878 | |
| 182 | 182 | |
| 183 | 183 | /***************************************************************************/ |
| 184 | 184 | |
| 185 | static void liberate_draw_sprites(running_machine *machine, | |
| 185 | static void liberate_draw_sprites(running_machine *machine, | |
| 186 | 186 | { |
| 187 | 187 | int offs; |
| 188 | 188 | |
| r1877 | r1878 | |
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | static void prosport_draw_sprites(running_machine *machine, | |
| 251 | static void prosport_draw_sprites(running_machine *machine, | |
| 252 | 252 | { |
| 253 | 253 | int offs,multi,fx,fy,sx,sy,sy2,code,code2,color; |
| 254 | 254 | |
| r1877 | r1878 | |
| 303 | 303 | } |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | static void boomrang_draw_sprites(running_machine *machine, | |
| 306 | static void boomrang_draw_sprites(running_machine *machine, | |
| 307 | 307 | { |
| 308 | 308 | int offs,multi,fx,fy,sx,sy,sy2,code,code2,color; |
| 309 | 309 |
| r1877 | r1878 | |
|---|---|---|
| 155 | 155 | (which+order),color+ 8 * sprite_palbank,flipx,flipy,sx,sy, \ |
| 156 | 156 | cliprect,TRANSPARENCY_PEN,0); |
| 157 | 157 | |
| 158 | static void draw_sprites(running_machine *machine, | |
| 158 | static void draw_sprites(running_machine *machine, | |
| 159 | 159 | { |
| 160 | 160 | const gfx_element *gfx = machine->gfx[1]; |
| 161 | 161 | UINT8 *src; |
| r1877 | r1878 | |
|---|---|---|
| 149 | 149 | state_save_register_global(sprite3bank); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | static void draw_sprites(running_machine *machine, | |
| 152 | static void draw_sprites(running_machine *machine, | |
| 153 | 153 | { |
| 154 | 154 | int offs; |
| 155 | 155 |
| r1877 | r1878 | |
|---|---|---|
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | static s2636_t *s2636_0, *s2636_1, *s2636_2; |
| 23 | static mame_bitmap *background_bitmap; | |
| 24 | mame_bitmap *cvs_collision_background; | |
| 25 | static mame_bitmap *scrolled_collision_background; | |
| 23 | static bitmap_t *background_bitmap; | |
| 24 | bitmap_t *cvs_collision_background; | |
| 25 | static bitmap_t *scrolled_collision_background; | |
| 26 | 26 | |
| 27 | 27 | int cvs_collision_register; |
| 28 | 28 | |
| r1877 | r1878 | |
| 210 | 210 | offs_t offs; |
| 211 | 211 | int scroll[8]; |
| 212 | 212 | UINT8 character_banking_mode; |
| 213 | mame_bitmap *s2636_0_bitmap; | |
| 214 | mame_bitmap *s2636_1_bitmap; | |
| 215 | mame_bitmap *s2636_2_bitmap; | |
| 213 | bitmap_t *s2636_0_bitmap; | |
| 214 | bitmap_t *s2636_1_bitmap; | |
| 215 | bitmap_t *s2636_2_bitmap; | |
| 216 | 216 | |
| 217 | 217 | set_pens(machine->colortable); |
| 218 | 218 |
| r1877 | r1878 | |
|---|---|---|
| 398 | 398 | VIDEO_UPDATE( turbo ) |
| 399 | 399 | { |
| 400 | 400 | turbo_state *state = machine->driver_data; |
| 401 | | |
| 401 | | |
| 402 | 402 | const UINT8 *road_gfxdata = memory_region(REGION_GFX3); |
| 403 | 403 | const UINT8 *prom_base = memory_region(REGION_PROMS); |
| 404 | 404 | const UINT8 *pr1114 = prom_base + 0x000; |
| r1877 | r1878 | |
| 753 | 753 | VIDEO_UPDATE( subroc3d ) |
| 754 | 754 | { |
| 755 | 755 | turbo_state *state = machine->driver_data; |
| 756 | | |
| 756 | | |
| 757 | 757 | const UINT8 *prom_base = memory_region(REGION_PROMS); |
| 758 | 758 | const UINT8 *pr1419 = prom_base + 0x000; |
| 759 | 759 | const UINT8 *pr1620 = prom_base + 0x200; |
| r1877 | r1878 | |
| 972 | 972 | VIDEO_UPDATE( buckrog ) |
| 973 | 973 | { |
| 974 | 974 | turbo_state *state = machine->driver_data; |
| 975 | | |
| 975 | | |
| 976 | 976 | const UINT8 *bgcolor = memory_region(REGION_GFX3); |
| 977 | 977 | const UINT8 *prom_base = memory_region(REGION_PROMS); |
| 978 | 978 | const UINT8 *pr5194 = prom_base + 0x000; |
| r1877 | r1878 | |
|---|---|---|
| 710 | 710 | ***************************************************************************/ |
| 711 | 711 | |
| 712 | 712 | |
| 713 | static void draw_sprites_map(running_machine *machine, | |
| 713 | static void draw_sprites_map(running_machine *machine, | |
| 714 | 714 | { |
| 715 | 715 | int offs, col; |
| 716 | 716 | int xoffs, yoffs; |
| r1877 | r1878 | |
| 814 | 814 | |
| 815 | 815 | |
| 816 | 816 | |
| 817 | static void draw_sprites(running_machine *machine, | |
| 817 | static void draw_sprites(running_machine *machine, | |
| 818 | 818 | { |
| 819 | 819 | int offs; |
| 820 | 820 | int xoffs, yoffs; |
| r1877 | r1878 | |
|---|---|---|
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | |
| 48 | static void draw_background(running_machine *machine, | |
| 48 | static void draw_background(running_machine *machine, | |
| 49 | 49 | { |
| 50 | 50 | int x,y,column,tot,flag; |
| 51 | 51 | int scrollx, scrolly; |
| r1877 | r1878 | |
| 131 | 131 | |
| 132 | 132 | |
| 133 | 133 | static void draw_foreground(running_machine *machine, |
| 134 | | |
| 134 | | |
| 135 | 135 | const rectangle *cliprect, |
| 136 | 136 | UINT8 *char_pointer, |
| 137 | 137 | UINT8 *x_pointer, |
| r1877 | r1878 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | 10 | #include "video/resnet.h" |
| 11 | #include "deprecat.h" | |
| 12 | 11 | |
| 13 | UINT8 *tp84_videoram2, *tp84_colorram2; | |
| 14 | 12 | |
| 15 | static int col0; | |
| 13 | UINT8 *tp84_bg_videoram; | |
| 14 | UINT8 *tp84_bg_colorram; | |
| 15 | UINT8 *tp84_fg_videoram; | |
| 16 | UINT8 *tp84_fg_colorram; | |
| 17 | UINT8 *tp84_spriteram; | |
| 18 | UINT8 *tp84_scroll_x; | |
| 19 | UINT8 *tp84_scroll_y; | |
| 20 | UINT8 *tp84_palette_bank; | |
| 21 | UINT8 *tp84_flipscreen_x; | |
| 22 | UINT8 *tp84_flipscreen_y; | |
| 16 | 23 | |
| 17 | /* | |
| 18 | sprites are multiplexed, so we have to buffer the spriteram | |
| 19 | scanline by scanline. | |
| 20 | */ | |
| 21 | static UINT8 *sprite_mux_buffer; | |
| 22 | static int scanline; | |
| 23 | ||
| 24 | 24 | static tilemap *bg_tilemap, *fg_tilemap; |
| 25 | 25 | |
| 26 | ||
| 26 | 27 | /* |
| 27 | 28 | -The colortable is divided in 2 part: |
| 28 | 29 | -The characters colors |
| r1877 | r1878 | |
| 30 | 31 | |
| 31 | 32 | -The characters colors are indexed like this: |
| 32 | 33 | -2 bits from the characters |
| 33 | -4 bits from the attribute in colorram | |
| 34 | -2 bits from col0 (d3-d4) | |
| 35 | -3 bits from col0 (d0-d1-d2) | |
| 34 | -4 bits from the attribute in tp84_bg_colorram | |
| 35 | -2 bits from palette_bank (d3-d4) | |
| 36 | -3 bits from palette_bank (d0-d1-d2) | |
| 36 | 37 | -So, there is 2048 bytes for the characters |
| 37 | 38 | |
| 38 | 39 | -The sprites colors are indexed like this: |
| 39 | 40 | -4 bits from the sprites (16 colors) |
| 40 | 41 | -4 bits from the attribute of the sprites |
| 41 | -3 bits from | |
| 42 | -3 bits from palette_bank (d0-d1-d2) | |
| 42 | 43 | -So, there is 2048 bytes for the sprites |
| 43 | 44 | |
| 44 | 45 | */ |
| r1877 | r1878 | |
| 53 | 54 | PALETTE_INIT( tp84 ) |
| 54 | 55 | { |
| 55 | 56 | static const int resistances[4] = { 1000, 470, 220, 100 }; |
| 56 | double | |
| 57 | double | |
| 57 | 58 | int i; |
| 58 | 59 | |
| 59 | 60 | /* compute the color output resistor weights */ |
| 60 | 61 | compute_resistor_weights(0, 255, -1.0, |
| 61 | 4, resistances, rweights, 470, 0, | |
| 62 | 4, resistances, gweights, 470, 0, | |
| 63 | 4, resistances, bweights, 470, 0); | |
| 62 | 4, resistances, weights, 470, 0, | |
| 63 | 0, 0, 0, 0, 0, | |
| 64 | 0, 0, 0, 0, 0); | |
| 64 | 65 | |
| 65 | 66 | /* allocate the colortable */ |
| 66 | 67 | machine->colortable = colortable_alloc(machine, 0x100); |
| r1877 | r1878 | |
| 76 | 77 | bit1 = (color_prom[i + 0x000] >> 1) & 0x01; |
| 77 | 78 | bit2 = (color_prom[i + 0x000] >> 2) & 0x01; |
| 78 | 79 | bit3 = (color_prom[i + 0x000] >> 3) & 0x01; |
| 79 | r = combine_4_weights( | |
| 80 | r = combine_4_weights( | |
| 80 | 81 | |
| 81 | 82 | /* green component */ |
| 82 | 83 | bit0 = (color_prom[i + 0x100] >> 0) & 0x01; |
| 83 | 84 | bit1 = (color_prom[i + 0x100] >> 1) & 0x01; |
| 84 | 85 | bit2 = (color_prom[i + 0x100] >> 2) & 0x01; |
| 85 | 86 | bit3 = (color_prom[i + 0x100] >> 3) & 0x01; |
| 86 | g = combine_4_weights( | |
| 87 | g = combine_4_weights( | |
| 87 | 88 | |
| 88 | 89 | /* blue component */ |
| 89 | 90 | bit0 = (color_prom[i + 0x200] >> 0) & 0x01; |
| 90 | 91 | bit1 = (color_prom[i + 0x200] >> 1) & 0x01; |
| 91 | 92 | bit2 = (color_prom[i + 0x200] >> 2) & 0x01; |
| 92 | 93 | bit3 = (color_prom[i + 0x200] >> 3) & 0x01; |
| 93 | b = combine_4_weights( | |
| 94 | b = combine_4_weights( | |
| 94 | 95 | |
| 95 | 96 | colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b)); |
| 96 | 97 | } |
| r1877 | r1878 | |
| 112 | 113 | } |
| 113 | 114 | |
| 114 | 115 | |
| 115 | WRITE8_HANDLER( tp84_ | |
| 116 | WRITE8_HANDLER( tp84_sprite | |
| 116 | 117 | { |
| 117 | videoram[offset] = data; | |
| 118 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 118 | /* the game multiplexes the sprites, so update now */ | |
| 119 | video_screen_update_now(0); | |
| 120 | tp84_spriteram[offset] = data; | |
| 119 | 121 | } |
| 120 | 122 | |
| 121 | WRITE8_HANDLER( tp84_colorram_w ) | |
| 122 | { | |
| 123 | colorram[offset] = data; | |
| 124 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 125 | } | |
| 126 | 123 | |
| 127 | WRITE8_HANDLER( tp84_videoram2_w ) | |
| 128 | { | |
| 129 | tp84_videoram2[offset] = data; | |
| 130 | tilemap_mark_tile_dirty(fg_tilemap, offset); | |
| 131 | } | |
| 132 | ||
| 133 | WRITE8_HANDLER( tp84_colorram2_w ) | |
| 134 | { | |
| 135 | tp84_colorram2[offset] = data; | |
| 136 | tilemap_mark_tile_dirty(fg_tilemap, offset); | |
| 137 | } | |
| 138 | ||
| 139 | WRITE8_HANDLER( tp84_scroll_x_w ) | |
| 140 | { | |
| 141 | tilemap_set_scrollx(bg_tilemap, 0, data); | |
| 142 | } | |
| 143 | ||
| 144 | WRITE8_HANDLER( tp84_scroll_y_w ) | |
| 145 | { | |
| 146 | tilemap_set_scrolly(bg_tilemap, 0, data); | |
| 147 | } | |
| 148 | ||
| 149 | WRITE8_HANDLER( tp84_flipscreen_x_w ) | |
| 150 | { | |
| 151 | flip_screen_x_set(data & 0x01); | |
| 152 | } | |
| 153 | ||
| 154 | WRITE8_HANDLER( tp84_flipscreen_y_w ) | |
| 155 | { | |
| 156 | flip_screen_y_set(data & 0x01); | |
| 157 | } | |
| 158 | ||
| 159 | /***** | |
| 160 | col0 is a register to index the color Proms | |
| 161 | *****/ | |
| 162 | WRITE8_HANDLER( tp84_col0_w ) | |
| 163 | { | |
| 164 | if (col0 != data) | |
| 165 | { | |
| 166 | col0 = data; | |
| 167 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); | |
| 168 | } | |
| 169 | } | |
| 170 | ||
| 171 | /* Return the current video scan line */ | |
| 172 | 124 | READ8_HANDLER( tp84_scanline_r ) |
| 173 | 125 | { |
| 174 | return scanline; | |
| 126 | /* reads 1V - 128V */ | |
| 127 | return video_screen_get_vpos(0); | |
| 175 | 128 | } |
| 176 | 129 | |
| 130 | ||
| 177 | 131 | static TILE_GET_INFO( get_bg_tile_info ) |
| 178 | 132 | { |
| 179 | int coloffs = ((col0 & 0x18) << 1) + ((col0 & 0x07) << 6); | |
| 180 | int attr = colorram[tile_index]; | |
| 181 | int code = videoram[tile_index] + ((attr & 0x30) << 4); | |
| 182 | int color = (attr & 0x0f) + coloffs; | |
| 183 | int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0); | |
| 133 | int code = ((tp84_bg_colorram[tile_index] & 0x30) << 4) | tp84_bg_videoram[tile_index]; | |
| 134 | int color = ((*tp84_palette_bank & 0x07) << 6) | | |
| 135 | ((*tp84_palette_bank & 0x18) << 1) | | |
| 136 | (tp84_bg_colorram[tile_index] & 0x0f); | |
| 137 | int flags = TILE_FLIPYX(tp84_bg_colorram[tile_index] >> 6); | |
| 184 | 138 | |
| 185 | 139 | SET_TILE_INFO(0, code, color, flags); |
| 186 | 140 | } |
| 187 | 141 | |
| 188 | 142 | static TILE_GET_INFO( get_fg_tile_info ) |
| 189 | 143 | { |
| 190 | int coloffs = ((col0 & 0x18) << 1) + ((col0 & 0x07) << 6); | |
| 191 | int attr = tp84_colorram2[tile_index]; | |
| 192 | int code = tp84_videoram2[tile_index]+ ((attr & 0x30) << 4); | |
| 193 | int color = (attr & 0x0f) + coloffs; | |
| 194 | int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0) | TILE_FORCE_LAYER0; | |
| 144 | int code = ((tp84_fg_colorram[tile_index] & 0x30) << 4) | tp84_fg_videoram[tile_index]; | |
| 145 | int color = ((*tp84_palette_bank & 0x07) << 6) | | |
| 146 | ((*tp84_palette_bank & 0x18) << 1) | | |
| 147 | (tp84_fg_colorram[tile_index] & 0x0f); | |
| 148 | int flags = TILE_FLIPYX(tp84_fg_colorram[tile_index] >> 6); | |
| 195 | 149 | |
| 196 | 150 | SET_TILE_INFO(0, code, color, flags); |
| 197 | 151 | } |
| 198 | 152 | |
| 153 | ||
| 199 | 154 | VIDEO_START( tp84 ) |
| 200 | 155 | { |
| 201 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, | |
| 202 | 8, 8, 32, 32); | |
| 203 | ||
| 204 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, | |
| 205 | 8, 8, 32, 32); | |
| 206 | ||
| 207 | tilemap_set_transparent_pen(fg_tilemap, 0); | |
| 208 | ||
| 209 | sprite_mux_buffer = auto_malloc(256 * spriteram_size); | |
| 156 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 157 | fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 210 | 158 | } |
| 211 | 159 | |
| 212 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) | |
| 160 | ||
| 161 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) | |
| 213 | 162 | { |
| 214 | const gfx_element *gfx = machine->gfx[1]; | |
| 215 | 163 | int offs; |
| 216 | int line; | |
| 217 | int coloffset = ((col0&0x07) << 4); | |
| 164 | int palette_base = ((*tp84_palette_bank & 0x07) << 4); | |
| 218 | 165 | |
| 219 | for ( | |
| 166 | for (offs = 0x5c | |
| 220 | 167 | { |
| 221 | UINT8 *sr; | |
| 222 | rectangle clip = *cliprect; | |
| 168 | int x = tp84_spriteram[offs]; | |
| 169 | int y = 240 - tp84_spriteram[offs + 3]; | |
| 223 | 170 | |
| 224 | sr = sprite_mux_buffer + line * spriteram_size; | |
| 225 | clip.min_y = clip.max_y = line; | |
| 171 | int code = tp84_spriteram[offs + 1]; | |
| 172 | int color = palette_base | (tp84_spriteram[offs + 2] & 0x0f); | |
| 173 | int flip_x = ~tp84_spriteram[offs + 2] & 0x40; | |
| 174 | int flip_y = tp84_spriteram[offs + 2] & 0x80; | |
| 226 | 175 | |
| 227 | for (offs = spriteram_size - 4;offs >= 0;offs -= 4) | |
| 228 | { | |
| 229 | int code,color,sx,sy,flipx,flipy; | |
| 176 | drawgfx(bitmap, machine->gfx[1], code, color, flip_x, flip_y, x, y, cliprect, TRANSPARENCY_PENS, | |
| 177 | colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, palette_base)); | |
| 230 | 178 | |
| 231 | sx = sr[offs]; | |
| 232 | sy = 240 - sr[offs + 3]; | |
| 233 | ||
| 234 | if (sy > line-16 && sy <= line) | |
| 235 | { | |
| 236 | code = sr[offs + 1]; | |
| 237 | color = (sr[offs + 2] & 0x0f) + coloffset; | |
| 238 | flipx = ~sr[offs + 2] & 0x40; | |
| 239 | flipy = sr[offs + 2] & 0x80; | |
| 240 | ||
| 241 | drawgfx(bitmap,gfx, | |
| 242 | code, | |
| 243 | color, | |
| 244 | flipx,flipy, | |
| 245 | sx,sy, | |
| 246 | &clip,TRANSPARENCY_PENS, | |
| 247 | colortable_get_transpen_mask(machine->colortable, gfx, color, coloffset)); | |
| 248 | } | |
| 249 | } | |
| 250 | 179 | } |
| 251 | 180 | } |
| 252 | 181 | |
| 182 | ||
| 253 | 183 | VIDEO_UPDATE( tp84 ) |
| 254 | 184 | { |
| 255 | rectangle clip; | |
| 185 | rectangle clip = *cliprect; | |
| 256 | 186 | |
| 187 | if (cliprect->min_y == machine->screen[screen].visarea.min_y) | |
| 188 | { | |
| 189 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); | |
| 190 | ||
| 191 | tilemap_set_scrollx(bg_tilemap, 0, *tp84_scroll_x); | |
| 192 | tilemap_set_scrolly(bg_tilemap, 0, *tp84_scroll_y); | |
| 193 | ||
| 194 | tilemap_set_flip(ALL_TILEMAPS, ((*tp84_flipscreen_x & 0x01) ? TILEMAP_FLIPX : 0) | | |
| 195 | ((*tp84_flipscreen_y & 0x01) ? TILEMAP_FLIPY : 0)); | |
| 196 | } | |
| 197 | ||
| 257 | 198 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 258 | 199 | draw_sprites(machine, bitmap, cliprect); |
| 259 | 200 | |
| 260 | /* draw top | |
| 201 | /* draw top | |
| 261 | 202 | clip.min_x = machine->screen[0].visarea.min_x; |
| 262 | clip.max_x = machine->screen[0].visarea.min_x+15; | |
| 263 | clip.min_y = machine->screen[0].visarea.min_y; | |
| 264 | clip.max_y = machine->screen[0].visarea.max_y; | |
| 203 | clip.max_x = machine->screen[0].visarea.min_x + 15; | |
| 265 | 204 | tilemap_draw(bitmap, &clip, fg_tilemap, 0, 0); |
| 266 | 205 | |
| 267 | /* the middle part of fg_tilemap seems to be used as normal ram and is skipped */ | |
| 268 | ||
| 269 | /* draw bottom fg_tilemap status layer part */ | |
| 270 | clip.min_x = machine->screen[0].visarea.max_x-15; | |
| 206 | /* draw bottom status region */ | |
| 207 | clip.min_x = machine->screen[0].visarea.max_x - 15; | |
| 271 | 208 | clip.max_x = machine->screen[0].visarea.max_x; |
| 272 | clip.min_y = machine->screen[0].visarea.min_y; | |
| 273 | clip.max_y = machine->screen[0].visarea.max_y; | |
| 274 | 209 | tilemap_draw(bitmap, &clip, fg_tilemap, 0, 0); |
| 210 | ||
| 275 | 211 | return 0; |
| 276 | 212 | } |
| 277 | ||
| 278 | INTERRUPT_GEN( tp84_6809_interrupt ) | |
| 279 | { | |
| 280 | scanline = 255 - cpu_getiloops(); | |
| 281 | ||
| 282 | memcpy(sprite_mux_buffer + scanline * spriteram_size,spriteram,spriteram_size); | |
| 283 | ||
| 284 | if (scanline == 255) | |
| 285 | irq0_line_hold(machine, cpunum); | |
| 286 | } |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "deprecat.h" | |
| 9 | 8 | #include "deco16ic.h" |
| 10 | 9 | |
| 11 | 10 | static UINT16 * rohga_spriteram; |
| r1877 | r1878 | |
| 70 | 69 | |
| 71 | 70 | /******************************************************************************/ |
| 72 | 71 | |
| 73 | static void rohga_draw_sprites(running_machine *machine, | |
| 72 | static void rohga_draw_sprites(running_machine *machine, | |
| 74 | 73 | { |
| 75 | 74 | int offs; |
| 76 | 75 | |
| r1877 | r1878 | |
| 92 | 91 | |
| 93 | 92 | y = spriteptr[offs]; |
| 94 | 93 | flash=y&0x1000; |
| 95 | if (flash && ( | |
| 94 | if (flash && (vid | |
| 96 | 95 | |
| 97 | 96 | // Sprite colour is different between Rohga (6bpp) and Schmeisr (4bpp plus wire mods on pcb) |
| 98 | 97 | if (is_schmeisr) |
| r1877 | r1878 | |
| 147 | 146 | } |
| 148 | 147 | } |
| 149 | 148 | |
| 150 | static void wizdfire_draw_sprites(running_machine *machine, | |
| 149 | static void wizdfire_draw_sprites(running_machine *machine, | |
| 151 | 150 | { |
| 152 | 151 | int offs; |
| 153 | 152 | |
| r1877 | r1878 | |
| 191 | 190 | |
| 192 | 191 | y = spriteptr[offs]; |
| 193 | 192 | flash=y&0x1000; |
| 194 | if (flash && ( | |
| 193 | if (flash && (vid | |
| 195 | 194 | colour = (x >> 9) &0x1f; |
| 196 | 195 | |
| 197 | 196 | if (bank==4 && colour&0x10) { |
| r1877 | r1878 | |
| 244 | 243 | } |
| 245 | 244 | } |
| 246 | 245 | |
| 247 | static void nitrobal_draw_sprites(running_machine *machine, | |
| 246 | static void nitrobal_draw_sprites(running_machine *machine, | |
| 248 | 247 | { |
| 249 | 248 | int offs,end,inc; |
| 250 | 249 | |
| r1877 | r1878 | |
| 298 | 297 | w = (spriteptr[offs+2]&0x0f00)>> 8; |
| 299 | 298 | |
| 300 | 299 | sy = spriteptr[offs]; |
| 301 | if ((sy&0x2000) && ( | |
| 300 | if ((sy&0x2000) && (vid | |
| 302 | 301 | offs+=inc; |
| 303 | 302 | continue; |
| 304 | 303 | } |
| r1877 | r1878 | |
| 436 | 435 | |
| 437 | 436 | /******************************************************************************/ |
| 438 | 437 | |
| 439 | static void update_rohga(running_machine *machine, | |
| 438 | static void update_rohga(running_machine *machine, | |
| 440 | 439 | { |
| 441 | 440 | /* Update playfields */ |
| 442 | 441 | flip_screen_set( deco16_pf12_control[0]&0x80 ); |
| r1877 | r1878 | |
|---|---|---|
| 114 | 114 | (which+order),color,flipx,flipy,sx,sy, \ |
| 115 | 115 | cliprect,TRANSPARENCY_PEN,0); |
| 116 | 116 | |
| 117 | static void draw_sprites(running_machine *machine, | |
| 117 | static void draw_sprites(running_machine *machine, | |
| 118 | 118 | { |
| 119 | 119 | const gfx_element *gfx = machine->gfx[1]; |
| 120 | 120 | UINT8 *src = spriteram; |
| r1877 | r1878 | |
|---|---|---|
| 100 | 100 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | static void draw_sprites(running_machine *machine, | |
| 103 | static void draw_sprites(running_machine *machine, | |
| 104 | 104 | { |
| 105 | 105 | int offs; |
| 106 | 106 |
| r1877 | r1878 | |
|---|---|---|
| 196 | 196 | VIDEO_UPDATE( batman ) |
| 197 | 197 | { |
| 198 | 198 | struct atarimo_rect_list rectlist; |
| 199 | | |
| 199 | | |
| 200 | 200 | int x, y, r; |
| 201 | 201 | |
| 202 | 202 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 241 | 241 | tilemap_flip = 0; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | static void draw_sprites(running_machine *machine, | |
| 244 | static void draw_sprites(running_machine *machine, | |
| 245 | 245 | { |
| 246 | 246 | /* |
| 247 | 247 | * 16 bytes per sprite, in memory from 56000-56fff |
| r1877 | r1878 | |
|---|---|---|
| 2 | 2 | Universal Cheeky Mouse Driver |
| 3 | 3 | (c)Lee Taylor May 1998, All rights reserved. |
| 4 | 4 | |
| 5 | For use only in offical M | |
| 5 | For use only in offical MAME releases. | |
| 6 | 6 | Not to be distrabuted as part of any commerical work. |
| 7 | 7 | *************************************************************************** |
| 8 | 8 | Functions to emulate the video hardware of the machine. |
| r1877 | r1878 | |
| 12 | 12 | #include "sound/dac.h" |
| 13 | 13 | |
| 14 | 14 | |
| 15 | static int man_scroll = -1; | |
| 16 | static UINT8 sprites[0x20]; | |
| 17 | static int char_palette = 0; | |
| 15 | UINT8 *cheekyms_videoram; | |
| 16 | UINT8 *cheekyms_spriteram; | |
| 17 | UINT8 *cheekyms_port_80; | |
| 18 | 18 | |
| 19 | static tilemap *cheekyms_tilemap; | |
| 19 | 20 | |
| 21 | ||
| 22 | /* bit 3 and 7 of the char color PROMs are used for something -- not currently emulated - | |
| 23 | thus GAME_IMPERFECT_GRAPHICS */ | |
| 24 | ||
| 20 | 25 | PALETTE_INIT( cheekyms ) |
| 21 | 26 | { |
| 22 | 27 | int i,j,bit,r,g,b; |
| r1877 | r1878 | |
| 41 | 46 | } |
| 42 | 47 | |
| 43 | 48 | |
| 44 | WRITE8_HANDLER( cheekyms_ | |
| 49 | WRITE8_HANDLER( cheekyms_ | |
| 45 | 50 | { |
| 46 | sprites[offset] = data; | |
| 51 | /* the lower bits probably trigger sound samples */ | |
| 52 | ||
| 53 | DAC_data_w(0, data ? 0x80 : 0); | |
| 47 | 54 | } |
| 48 | 55 | |
| 49 | 56 | |
| 50 | WRITE8_HANDLER( cheekyms_port_ | |
| 57 | WRITE8_HANDLER( cheekyms_port_80_w ) | |
| 51 | 58 | { |
| 52 | static int last_dac = -1; | |
| 59 | /* d0-d1 - sound enables, not sure which bit is which */ | |
| 60 | /* d3-d5 - man scroll amount */ | |
| 61 | /* d6 - palette select (selects either 0 = PROM M9, 1 = PROM M8) */ | |
| 62 | /* d7 - screen flip */ | |
| 63 | *cheekyms_port_80 = data; | |
| 53 | 64 | |
| 54 | /* The lower bits probably trigger sound samples */ | |
| 65 | /* d2 - interrupt enable */ | |
| 66 | interrupt_enable_w(machine, offset, data & 0x04); | |
| 67 | } | |
| 55 | 68 | |
| 56 | if (last_dac != (data & 0x80)) | |
| 57 | { | |
| 58 | last_dac = data & 0x80; | |
| 59 | 69 | |
| 60 | DAC_data_w(0, last_dac ? 0x80 : 0); | |
| 61 | } | |
| 62 | } | |
| 63 | 70 | |
| 64 | ||
| 65 | WRITE8_HANDLER( cheekyms_port_80_w ) | |
| 71 | static TILE_GET_INFO( cheekyms_get_tile_info ) | |
| 66 | 72 | { |
| 67 | | |
| 73 | | |
| 68 | 74 | |
| 69 | /* Bit 2 is interrupt enable */ | |
| 70 | interrupt_enable_w(offset, data & 0x04); | |
| 75 | int x = tile_index & 0x1f; | |
| 76 | int y = tile_index >> 5; | |
| 77 | int code = cheekyms_videoram[tile_index]; | |
| 78 | int palette = (*cheekyms_port_80 >> 2) & 0x10; | |
| 71 | 79 | |
| 72 | /* Bit 3-5 Man scroll amount */ | |
| 73 | man_scroll = (data >> 3) & 0x07; | |
| 80 | if (x >= 0x1e) | |
| 81 | { | |
| 82 | if (y < 0x0c) | |
| 83 | color = 0x15; | |
| 84 | else if (y < 0x14) | |
| 85 | color = 0x16; | |
| 86 | else | |
| 87 | color = 0x14; | |
| 88 | } | |
| 89 | else | |
| 90 | { | |
| 91 | if ((y == 0x04) || (y == 0x1b)) | |
| 92 | color = palette | 0x0c; | |
| 93 | else | |
| 94 | color = palette | (x >> 1); | |
| 95 | } | |
| 74 | 96 | |
| 75 | /* Bit 6 is palette select (Selects either 0 = PROM M9, 1 = PROM M8) */ | |
| 76 | char_palette = (data >> 2) & 0x10; | |
| 77 | ||
| 78 | /* Bit 7 is screen flip */ | |
| 79 | flip_screen_set(data & 0x80); | |
| 97 | SET_TILE_INFO(0, code, color, 0); | |
| 80 | 98 | } |
| 81 | 99 | |
| 82 | 100 | |
| 83 | ||
| 84 | VIDEO_UPDATE( cheekyms ) | |
| 101 | VIDEO_START( cheekyms ) | |
| 85 | 102 | { |
| 86 | int offs; | |
| 103 | cheekyms_tilemap = tilemap_create(cheekyms_get_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 104 | tilemap_set_transparent_pen(cheekyms_tilemap, 0); | |
| 105 | } | |
| 87 | 106 | |
| 88 | 107 | |
| 89 | fillbitmap(bitmap,0,cliprect); | |
| 108 | static void draw_sprites(gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect, int flip) | |
| 109 | { | |
| 110 | offs_t offs; | |
| 90 | 111 | |
| 91 | /* Draw the sprites first, because they're supposed to appear below | |
| 92 | the characters */ | |
| 93 | for (offs = 0; offs < sizeof(sprites)/sizeof(sprites[0]); offs += 4) | |
| 112 | for (offs = 0; offs < 0x20; offs += 4) | |
| 94 | 113 | { |
| 95 | int | |
| 114 | int | |
| 96 | 115 | |
| 97 | v1 = sprites[offs + 0]; | |
| 98 | sy = sprites[offs + 1]; | |
| 99 | sx = 256 - sprites[offs + 2]; | |
| 100 | col = (~sprites[offs + 3] & 0x07); | |
| 116 | if ((cheekyms_spriteram[offs + 3] & 0x08) == 0x00) continue; | |
| 101 | 117 | |
| 102 | if (!(sprites[offs + 3] & 0x08)) continue; | |
| 118 | x = 256 - cheekyms_spriteram[offs + 2]; | |
| 119 | y = cheekyms_spriteram[offs + 1]; | |
| 120 | code = (~cheekyms_spriteram[offs + 0] & 0x0f) << 1; | |
| 121 | color = (~cheekyms_spriteram[offs + 3] & 0x07); | |
| 103 | 122 | |
| 104 | code = (~v1 << 1) & 0x1f; | |
| 105 | ||
| 106 | if (v1 & 0x80) | |
| 123 | if (cheekyms_spriteram[offs + 0] & 0x80) | |
| 107 | 124 | { |
| 108 | if (!flip | |
| 125 | if (!flip | |
| 109 | 126 | code++; |
| 110 | 127 | |
| 111 | drawgfx(bitmap,machine->gfx[1], | |
| 112 | code, | |
| 113 | col, | |
| 114 | 0,0, | |
| 115 | sx,sy, | |
| 116 | cliprect,TRANSPARENCY_PEN,0); | |
| 128 | drawgfx(bitmap, gfx[1], code, color, 0, 0, x, y, cliprect, TRANSPARENCY_PEN, 0); | |
| 117 | 129 | } |
| 118 | 130 | else |
| 119 | 131 | { |
| 120 | drawgfx(bitmap,machine->gfx[1], | |
| 121 | code + 0x20, | |
| 122 | col, | |
| 123 | 0,0, | |
| 124 | sx,sy, | |
| 125 | cliprect,TRANSPARENCY_PEN,0); | |
| 126 | ||
| 127 | drawgfx(bitmap,machine->gfx[1], | |
| 128 | code + 0x21, | |
| 129 | col, | |
| 130 | 0,0, | |
| 131 | sx + 8*(v1 & 2),sy + 8*(~v1 & 2), | |
| 132 | cliprect,TRANSPARENCY_PEN,0); | |
| 132 | if (cheekyms_spriteram[offs + 0] & 0x02) | |
| 133 | { | |
| 134 | drawgfx(bitmap, gfx[1], code | 0x20, color, 0, 0, x, y, cliprect, TRANSPARENCY_PEN, 0); | |
| 135 | drawgfx(bitmap, gfx[1], code | 0x21, color, 0, 0, 0x10 + x, y, cliprect, TRANSPARENCY_PEN, 0); | |
| 136 | } | |
| 137 | else | |
| 138 | { | |
| 139 | drawgfx(bitmap, gfx[1], code | 0x20, color, 0, 0, x, y, cliprect, TRANSPARENCY_PEN, 0); | |
| 140 | drawgfx(bitmap, gfx[1], code | 0x21, color, 0, 0, x, 0x10 + y, cliprect, TRANSPARENCY_PEN, 0); | |
| 141 | } | |
| 133 | 142 | } |
| 134 | 143 | } |
| 144 | } | |
| 135 | 145 | |
| 136 | 146 | |
| 137 | for (offs = videoram_size - 1;offs >= 0;offs--) | |
| 138 | { | |
| 139 | int sx,sy,man_area,color; | |
| 147 | VIDEO_UPDATE( cheekyms ) | |
| 148 | { | |
| 149 | #define SCROLL_X_MIN 8 | |
| 150 | #define SCROLL_X_MAX 12 | |
| 151 | #define SCROLL_Y_MIN 6 | |
| 152 | #define SCROLL_Y_MAX 25 | |
| 140 | 153 | |
| 141 | sx = offs % 32; | |
| 142 | sy = offs / 32; | |
| 154 | const rectangle clip_no_scroll_top = { 0*8, 32*8-1, 0*8, SCROLL_Y_MIN*8-1 }; | |
| 155 | const rectangle clip_no_scroll_bottom = { 0*8, 32*8-1, (SCROLL_Y_MAX+1)*8, 32*8-1 }; | |
| 156 | const rectangle clip_no_scroll_left_nf = { 0*8, SCROLL_X_MIN*8-1, SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 }; | |
| 157 | const rectangle clip_no_scroll_right_nf = { (SCROLL_X_MAX+1)*8, 32*8-1, SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 }; | |
| 158 | const rectangle clip_no_scroll_left_f = { (32-SCROLL_X_MIN)*8, 32*8-1, SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 }; | |
| 159 | const rectangle clip_no_scroll_right_f = { 0*8, (32-SCROLL_X_MAX-1)*8-1, SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 }; | |
| 160 | const rectangle clip_scroll_nf = { SCROLL_X_MIN*8, 13*8-1, SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 }; | |
| 161 | const rectangle clip_scroll_f = { (32-SCROLL_X_MAX-1)*8, (32-SCROLL_X_MIN)*8-1, SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 }; | |
| 143 | 162 | |
| 163 | int flip = *cheekyms_port_80 & 0x80; | |
| 144 | 164 | |
| 145 | man_area = ((sy >= 6) && (sy <= 26) && (sx >= 8) && (sx <= 12)); | |
| 165 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); | |
| 166 | tilemap_set_flip(ALL_TILEMAPS, flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); | |
| 146 | 167 | |
| 147 | if (sx >= 30) | |
| 148 | { | |
| 149 | if (sy < 12) | |
| 150 | color = 0x15; | |
| 151 | else if (sy < 20) | |
| 152 | color = 0x16; | |
| 153 | else | |
| 154 | color = 0x14; | |
| 155 | } | |
| 156 | else | |
| 157 | { | |
| 158 | color = ((sx >> 1) & 0x0f) + char_palette; | |
| 159 | if (sy == 4 || sy == 27) | |
| 160 | color = 0xc + char_palette; | |
| 161 | } | |
| 168 | fillbitmap(bitmap, 0, cliprect); | |
| 162 | 169 | |
| 163 | if (flip_screen_get()) | |
| 164 | { | |
| 165 | sx = 31 - sx; | |
| 166 | sy = 31 - sy; | |
| 167 | } | |
| 170 | /* sprites go under the playfield */ | |
| 171 | draw_sprites(machine->gfx, bitmap, cliprect, flip); | |
| 168 | 172 | |
| 169 | drawgfx(bitmap,machine->gfx[0], | |
| 170 | videoram[offs], | |
| 171 | color, | |
| 172 | flip_screen_get(),flip_screen_get(), | |
| 173 | 8*sx, 8*sy - (man_area ? man_scroll : 0), | |
| 174 | cliprect,TRANSPARENCY_PEN,0); | |
| 173 | /* draw the non-scrolling parts of the playfield first */ | |
| 174 | tilemap_set_scrolly(cheekyms_tilemap, 0, 0); | |
| 175 | tilemap_draw(bitmap, &clip_no_scroll_top, cheekyms_tilemap, 0, 0); | |
| 176 | tilemap_draw(bitmap, &clip_no_scroll_bottom, cheekyms_tilemap, 0, 0); | |
| 177 | ||
| 178 | if (flip) | |
| 179 | { | |
| 180 | tilemap_draw(bitmap, &clip_no_scroll_left_f, cheekyms_tilemap, 0, 0); | |
| 181 | tilemap_draw(bitmap, &clip_no_scroll_right_f, cheekyms_tilemap, 0, 0); | |
| 175 | 182 | } |
| 183 | else | |
| 184 | { | |
| 185 | tilemap_draw(bitmap, &clip_no_scroll_left_nf, cheekyms_tilemap, 0, 0); | |
| 186 | tilemap_draw(bitmap, &clip_no_scroll_right_nf, cheekyms_tilemap, 0, 0); | |
| 187 | } | |
| 176 | 188 | |
| 189 | /* now the scrolling part */ | |
| 190 | if (flip) | |
| 191 | { | |
| 192 | tilemap_set_scrolly(cheekyms_tilemap, 0, -((*cheekyms_port_80 >> 3) & 0x07)); | |
| 193 | tilemap_draw(bitmap, &clip_scroll_f, cheekyms_tilemap, 0, 0); | |
| 194 | } | |
| 195 | else | |
| 196 | { | |
| 197 | tilemap_set_scrolly(cheekyms_tilemap, 0, (*cheekyms_port_80 >> 3) & 0x07); | |
| 198 | tilemap_draw(bitmap, &clip_scroll_nf, cheekyms_tilemap, 0, 0); | |
| 199 | } | |
| 200 | ||
| 177 | 201 | return 0; |
| 178 | 202 | } |
| r1877 | r1878 | |
|---|---|---|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
| 116 | static void draw_sprites(running_machine *machine, | |
| 116 | static void draw_sprites(running_machine *machine, | |
| 117 | 117 | { |
| 118 | 118 | int offs; |
| 119 | 119 |
| r1877 | r1878 | |
|---|---|---|
| 40 | 40 | SPRITE DRAW ROUTINE |
| 41 | 41 | ************************************************************/ |
| 42 | 42 | |
| 43 | static void draw_sprites(running_machine *machine, | |
| 43 | static void draw_sprites(running_machine *machine, | |
| 44 | 44 | { |
| 45 | 45 | int offs, data, data2, tilenum, color, flipx, flipy; |
| 46 | 46 | int x, y, priority, pri_mask; |
| r1877 | r1878 | |
|---|---|---|
| 163 | 163 | static tilemap *pf1_tilemap_16x16,*pf2_tilemap_16x16,*pf3_tilemap_16x16,*pf4_tilemap_16x16; |
| 164 | 164 | static tilemap *pf1_tilemap_8x8,*pf2_tilemap_8x8; |
| 165 | 165 | |
| 166 | static | |
| 166 | static | |
| 167 | 167 | |
| 168 | 168 | static UINT8 *dirty_palette; |
| 169 | 169 | static int deco16_pf1_bank,deco16_pf2_bank,deco16_pf3_bank,deco16_pf4_bank; |
| r1877 | r1878 | |
| 175 | 175 | static int (*deco16_bank_callback_2)(const int bank); |
| 176 | 176 | static int (*deco16_bank_callback_3)(const int bank); |
| 177 | 177 | static int (*deco16_bank_callback_4)(const int bank); |
| 178 | static void custom_tilemap_draw( | |
| 178 | static void custom_tilemap_draw( | |
| 179 | 179 | tilemap *tilemap1_8x8,tilemap *tilemap1_16x16, const UINT16 *rowscroll_ptr,const UINT16 scrollx, |
| 180 | 180 | const UINT16 scrolly,const UINT16 control0, const UINT16 control1,int combine_mask,int combine_shift,int trans_mask,int flags,UINT32 priority); |
| 181 | 181 | |
| r1877 | r1878 | |
| 796 | 796 | |
| 797 | 797 | /*****************************************************************************************/ |
| 798 | 798 | |
| 799 | void deco16_print_debug_info( | |
| 799 | void deco16_print_debug_info( | |
| 800 | 800 | { |
| 801 | 801 | char buf[64*5]; |
| 802 | 802 | |
| r1877 | r1878 | |
| 831 | 831 | } |
| 832 | 832 | |
| 833 | 833 | /* A special pdrawgfx z-buffered sprite renderer that is needed to properly draw multiple sprite sources with alpha */ |
| 834 | void deco16_pdrawgfx( | |
| 834 | void deco16_pdrawgfx( | |
| 835 | 835 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 836 | 836 | const rectangle *clip,int transparency,int transparent_color,UINT32 pri_mask,UINT32 sprite_mask,UINT8 write_pri) |
| 837 | 837 | { |
| r1877 | r1878 | |
| 896 | 896 | |
| 897 | 897 | /*****************************************************************************************/ |
| 898 | 898 | |
| 899 | void deco16_tilemap_1_draw( | |
| 899 | void deco16_tilemap_1_draw( | |
| 900 | 900 | { |
| 901 | 901 | if (use_custom_pf1) |
| 902 | 902 | { |
| r1877 | r1878 | |
| 909 | 909 | } |
| 910 | 910 | } |
| 911 | 911 | |
| 912 | void deco16_tilemap_2_draw( | |
| 912 | void deco16_tilemap_2_draw( | |
| 913 | 913 | { |
| 914 | 914 | if (use_custom_pf2) |
| 915 | 915 | { |
| r1877 | r1878 | |
| 922 | 922 | } |
| 923 | 923 | } |
| 924 | 924 | |
| 925 | void deco16_tilemap_3_draw( | |
| 925 | void deco16_tilemap_3_draw( | |
| 926 | 926 | { |
| 927 | 927 | if (use_custom_pf3) custom_tilemap_draw(bitmap,0,pf3_tilemap_16x16,0,0,pf3_rowscroll_ptr,deco16_pf34_control[1], deco16_pf34_control[2], deco16_pf34_control[5]&0xff, deco16_pf34_control[6]&0xff, 0, 0, deco16_pf3_trans_mask, flags, priority); |
| 928 | 928 | else if (pf3_tilemap_16x16) tilemap_draw(bitmap,cliprect,pf3_tilemap_16x16,flags,priority); |
| 929 | 929 | } |
| 930 | 930 | |
| 931 | void deco16_tilemap_4_draw( | |
| 931 | void deco16_tilemap_4_draw( | |
| 932 | 932 | { |
| 933 | 933 | if (use_custom_pf4) custom_tilemap_draw(bitmap,0,pf4_tilemap_16x16,0,0,pf4_rowscroll_ptr,deco16_pf34_control[3], deco16_pf34_control[4], deco16_pf34_control[5]>>8, deco16_pf34_control[6]>>8, 0, 0, deco16_pf4_trans_mask, flags, priority); |
| 934 | 934 | else if (pf4_tilemap_16x16) tilemap_draw(bitmap,cliprect,pf4_tilemap_16x16,flags,priority); |
| r1877 | r1878 | |
| 937 | 937 | /*****************************************************************************************/ |
| 938 | 938 | |
| 939 | 939 | // Combines the output of two 4BPP tilemaps into an 8BPP tilemap |
| 940 | void deco16_tilemap_34_combine_draw( | |
| 940 | void deco16_tilemap_34_combine_draw( | |
| 941 | 941 | { |
| 942 | 942 | custom_tilemap_draw(bitmap,0,pf3_tilemap_16x16,0,pf4_tilemap_16x16,pf3_rowscroll_ptr,deco16_pf34_control[1], deco16_pf34_control[2], deco16_pf34_control[5]&0xff, deco16_pf34_control[6]&0xff, 0xf, 4, 0xff, flags, priority); |
| 943 | 943 | } |
| r1877 | r1878 | |
| 953 | 953 | */ |
| 954 | 954 | |
| 955 | 955 | static void custom_tilemap_draw( |
| 956 | | |
| 956 | | |
| 957 | 957 | tilemap *tilemap0_8x8, |
| 958 | 958 | tilemap *tilemap0_16x16, |
| 959 | 959 | tilemap *tilemap1_8x8, |
| r1877 | r1878 | |
| 971 | 971 | { |
| 972 | 972 | tilemap *tilemap0 = (control1&0x80) ? tilemap0_8x8 : tilemap0_16x16; |
| 973 | 973 | tilemap *tilemap1 = (control1&0x80) ? tilemap1_8x8 : tilemap1_16x16; |
| 974 | const mame_bitmap *src_bitmap0 = tilemap0 ? tilemap_get_pixmap(tilemap0) : NULL; | |
| 975 | const mame_bitmap *src_bitmap1 = tilemap1 ? tilemap_get_pixmap(tilemap1) : NULL; | |
| 974 | const bitmap_t *src_bitmap0 = tilemap0 ? tilemap_get_pixmap(tilemap0) : NULL; | |
| 975 | const bitmap_t *src_bitmap1 = tilemap1 ? tilemap_get_pixmap(tilemap1) : NULL; | |
| 976 | 976 | int width_mask, height_mask, x, y, p; |
| 977 | 977 | int column_offset, src_x=0, src_y=0; |
| 978 | 978 | int row_type=1 << ((control0>>3)&0xf); |
| r1877 | r1878 | |
|---|---|---|
| 89 | 89 | SET_TILE_INFO(region,tile,color,0); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | static void draw_sprites(running_machine *machine, | |
| 92 | static void draw_sprites(running_machine *machine, | |
| 93 | 93 | { |
| 94 | 94 | int offs,fx,fy,x,y,color,sprite; |
| 95 | 95 |
| r1877 | r1878 | |
|---|---|---|
| 198 | 198 | |
| 199 | 199 | ***************************************************************************/ |
| 200 | 200 | |
| 201 | static void draw_sprites(running_machine *machine, | |
| 201 | static void draw_sprites(running_machine *machine, | |
| 202 | 202 | { |
| 203 | 203 | int offs; |
| 204 | 204 |
| r1877 | r1878 | |
|---|---|---|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | static void draw_sprites(running_machine *machine, | |
| 103 | static void draw_sprites(running_machine *machine, | |
| 104 | 104 | { |
| 105 | 105 | int offs,fx,fy,x,y,color,sprite; |
| 106 | 106 |
| r1877 | r1878 | |
|---|---|---|
| 143 | 143 | -------X XXXXXXXX |
| 144 | 144 | -------- YYYYYYYY */ |
| 145 | 145 | |
| 146 | static void bloodbro_draw_sprites(running_machine *machine, | |
| 146 | static void bloodbro_draw_sprites(running_machine *machine, | |
| 147 | 147 | { |
| 148 | 148 | int offs; |
| 149 | 149 | for (offs = 0;offs < spriteram_size/2;offs += 4) |
| r1877 | r1878 | |
| 190 | 190 | -------X XXXXXXXX |
| 191 | 191 | */ |
| 192 | 192 | |
| 193 | static void weststry_draw_sprites(running_machine *machine, | |
| 193 | static void weststry_draw_sprites(running_machine *machine, | |
| 194 | 194 | { |
| 195 | 195 | int offs; |
| 196 | 196 |
| r1877 | r1878 | |
|---|---|---|
| 76 | 76 | state_save_register_global(background_image); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | static void draw_sprites(running_machine *machine, | |
| 79 | static void draw_sprites(running_machine *machine, | |
| 80 | 80 | { |
| 81 | 81 | int offs; |
| 82 | 82 |
| r1877 | r1878 | |
|---|---|---|
| 482 | 482 | |
| 483 | 483 | |
| 484 | 484 | |
| 485 | static void plot_star(running_machine *machine, | |
| 485 | static void plot_star(running_machine *machine, | |
| 486 | 486 | { |
| 487 | 487 | if (y < cliprect->min_y || |
| 488 | 488 | y > cliprect->max_y || |
| r1877 | r1878 | |
| 500 | 500 | *BITMAP_ADDR16(bitmap, y, x) = STARS_COLOR_BASE + color; |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | static void draw_stars(running_machine *machine, | |
| 503 | static void draw_stars(running_machine *machine, | |
| 504 | 504 | { |
| 505 | 505 | int offs; |
| 506 | 506 | |
| r1877 | r1878 | |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | |
| 518 | static void rallyx_draw_sprites(running_machine *machine, | |
| 518 | static void rallyx_draw_sprites(running_machine *machine, | |
| 519 | 519 | { |
| 520 | 520 | int offs; |
| 521 | 521 | |
| r1877 | r1878 | |
| 539 | 539 | } |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | static void locomotn_draw_sprites(running_machine *machine, | |
| 542 | static void locomotn_draw_sprites(running_machine *machine, | |
| 543 | 543 | { |
| 544 | 544 | int offs; |
| 545 | 545 | |
| r1877 | r1878 | |
| 564 | 564 | } |
| 565 | 565 | } |
| 566 | 566 | |
| 567 | static void rallyx_draw_bullets(running_machine *machine, | |
| 567 | static void rallyx_draw_bullets(running_machine *machine, | |
| 568 | 568 | { |
| 569 | 569 | int offs; |
| 570 | 570 | |
| r1877 | r1878 | |
| 585 | 585 | } |
| 586 | 586 | } |
| 587 | 587 | |
| 588 | static void jungler_draw_bullets(running_machine *machine, | |
| 588 | static void jungler_draw_bullets(running_machine *machine, | |
| 589 | 589 | { |
| 590 | 590 | int offs; |
| 591 | 591 | |
| r1877 | r1878 | |
| 605 | 605 | } |
| 606 | 606 | } |
| 607 | 607 | |
| 608 | static void locomotn_draw_bullets(running_machine *machine, | |
| 608 | static void locomotn_draw_bullets(running_machine *machine, | |
| 609 | 609 | { |
| 610 | 610 | int offs; |
| 611 | 611 |
| r1877 | r1878 | |
|---|---|---|
| 217 | 217 | |
| 218 | 218 | ***************************************************************************/ |
| 219 | 219 | |
| 220 | static void unico_draw_sprites(running_machine *machine, | |
| 220 | static void unico_draw_sprites(running_machine *machine, | |
| 221 | 221 | { |
| 222 | 222 | int offs; |
| 223 | 223 | |
| r1877 | r1878 | |
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | static void zeropnt2_draw_sprites(running_machine *machine, | |
| 273 | static void zeropnt2_draw_sprites(running_machine *machine, | |
| 274 | 274 | { |
| 275 | 275 | int offs; |
| 276 | 276 |
| r1877 | r1878 | |
|---|---|---|
| 193 | 193 | |
| 194 | 194 | ****************************************************************/ |
| 195 | 195 | |
| 196 | static void draw_sprites(running_machine *machine, | |
| 196 | static void draw_sprites(running_machine *machine, | |
| 197 | 197 | { |
| 198 | 198 | int offs,chain_pos; |
| 199 | 199 | int x,y,curx,cury; |
| r1877 | r1878 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | //UINT16 *realbrk_vram_0, *realbrk_vram_1, *realbrk_vram_2, *realbrk_vregs; |
| 27 | 27 | UINT16 *realbrk_vram_0, *realbrk_vram_1, *realbrk_vram_2, *realbrk_vregs, *realbrk_vram_0ras, *realbrk_vram_1ras; |
| 28 | static mame_bitmap *tmpbitmap0 = NULL; | |
| 29 | static mame_bitmap *tmpbitmap1 = NULL; | |
| 28 | static bitmap_t *tmpbitmap0 = NULL; | |
| 29 | static bitmap_t *tmpbitmap1 = NULL; | |
| 30 | 30 | |
| 31 | 31 | static int disable_video; |
| 32 | 32 | |
| r1877 | r1878 | |
| 228 | 228 | |
| 229 | 229 | ***************************************************************************/ |
| 230 | 230 | |
| 231 | static void draw_sprites(running_machine *machine, | |
| 231 | static void draw_sprites(running_machine *machine, | |
| 232 | 232 | { |
| 233 | 233 | int offs; |
| 234 | 234 | |
| r1877 | r1878 | |
| 395 | 395 | |
| 396 | 396 | /* DaiDaiKakumei */ |
| 397 | 397 | /* layer : 0== bghigh<spr 1== bglow<spr<bghigh 2==spr<bglow 3==boarder */ |
| 398 | static void dai2kaku_draw_sprites( | |
| 398 | static void dai2kaku_draw_sprites( | |
| 399 | 399 | { |
| 400 | 400 | int offs; |
| 401 | 401 |
| r1877 | r1878 | |
|---|---|---|
| 1 | 1 | /* Diver Boy - Video Hardware */ |
| 2 | 2 | |
| 3 | 3 | #include "driver.h" |
| 4 | #include "deprecat.h" | |
| 5 | 4 | |
| 6 | 5 | UINT16 *diverboy_spriteram; |
| 7 | 6 | size_t diverboy_spriteram_size; |
| r1877 | r1878 | |
| 11 | 10 | { |
| 12 | 11 | } |
| 13 | 12 | |
| 14 | static void draw_sprites(running_machine* machine, | |
| 13 | static void draw_sprites(running_machine* machine, | |
| 15 | 14 | { |
| 16 | 15 | UINT16 *source = diverboy_spriteram; |
| 17 | 16 | UINT16 *finish = source + (diverboy_spriteram_size/2); |
| r1877 | r1878 | |
| 32 | 31 | |
| 33 | 32 | bank = (source[1]&0x0002) >> 1; |
| 34 | 33 | |
| 35 | if (!flash || ( | |
| 34 | if (!flash || (vid | |
| 36 | 35 | { |
| 37 | 36 | drawgfx(bitmap,machine->gfx[bank], |
| 38 | 37 | number, |
| r1877 | r1878 | |
|---|---|---|
| 67 | 67 | |
| 68 | 68 | ********************************************************/ |
| 69 | 69 | |
| 70 | static void draw_sprites(running_machine *machine, | |
| 70 | static void draw_sprites(running_machine *machine, | |
| 71 | 71 | { |
| 72 | 72 | UINT16 *spritemap = (UINT16 *)memory_region(REGION_USER1); |
| 73 | 73 | int offs, data, tilenum, color, flipx, flipy; |
| r1877 | r1878 | |
|---|---|---|
| 14 | 14 | static int HuC6270_registers[20]; |
| 15 | 15 | static int VDC_register,vram_ptr; |
| 16 | 16 | static UINT8 *HuC6270_vram,*tile_dirty,*sprite_dirty,*vram_dirty; |
| 17 | static | |
| 17 | static | |
| 18 | 18 | |
| 19 | 19 | static int current_scanline,inc_value; |
| 20 | 20 | static int irq_enable,rcr_enable,sb_enable,bb_enable,bldwolf_vblank; |
| r1877 | r1878 | |
| 243 | 243 | |
| 244 | 244 | /******************************************************************************/ |
| 245 | 245 | |
| 246 | static void draw_sprites(running_machine *machine, | |
| 246 | static void draw_sprites(running_machine *machine, | |
| 247 | 247 | { |
| 248 | 248 | int offs,my,mx,code,code2,fx,fy,cgy=0,cgx,colour,i,yinc; |
| 249 | 249 | |
| r1877 | r1878 | |
| 307 | 307 | |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | static void screenrefresh(running_machine *machine, | |
| 310 | static void screenrefresh(running_machine *machine, | |
| 311 | 311 | { |
| 312 | 312 | int offs,code,scrollx,scrolly,mx,my; |
| 313 | 313 |
| r1877 | r1878 | |
|---|---|---|
| 27 | 27 | colortable_entry_set_value(machine->colortable, i, i); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | static void draw_sprites(running_machine *machine, | |
| 30 | static void draw_sprites(running_machine *machine, | |
| 31 | 31 | { |
| 32 | 32 | const gfx_element *gfx = machine->gfx[1]; |
| 33 | 33 | UINT8 *source = spriteram + 0x200; |
| r1877 | r1878 | |
|---|---|---|
| 168 | 168 | |
| 169 | 169 | ***************************************************************************/ |
| 170 | 170 | |
| 171 | static void draw_sprites(running_machine *machine, | |
| 171 | static void draw_sprites(running_machine *machine, | |
| 172 | 172 | { |
| 173 | 173 | int offs; |
| 174 | 174 |
| r1877 | r1878 | |
|---|---|---|
| 274 | 274 | 15 xxxxxxxx Y position |
| 275 | 275 | */ |
| 276 | 276 | |
| 277 | static void draw_sprites(running_machine *machine, | |
| 277 | static void draw_sprites(running_machine *machine, | |
| 278 | 278 | { |
| 279 | 279 | const UINT8 *source = &spriteram[0x0800-0x20]; /* the last is NOT a sprite */ |
| 280 | 280 | const UINT8 *finish = &spriteram[0]; |
| r1877 | r1878 | |
|---|---|---|
| 225 | 225 | |
| 226 | 226 | ***************************************************************************/ |
| 227 | 227 | |
| 228 | static void draw_sprites(running_machine *machine, | |
| 228 | static void draw_sprites(running_machine *machine, | |
| 229 | 229 | { |
| 230 | 230 | int offs; |
| 231 | 231 |
| r1877 | r1878 | |
|---|---|---|
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | |
| 343 | static void draw_sprites(running_machine *machine, | |
| 343 | static void draw_sprites(running_machine *machine, | |
| 344 | 344 | { |
| 345 | 345 | int offs; |
| 346 | 346 | |
| r1877 | r1878 | |
| 399 | 399 | } |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | static void m62_start( tile_get_info_c | |
| 402 | static void m62_start( tile_get_info_func | |
| 403 | 403 | { |
| 404 | 404 | m62_background = tilemap_create( tile_get_info, tilemap_scan_rows, x1, y1, x2, y2 ); |
| 405 | 405 | |
| r1877 | r1878 | |
| 418 | 418 | } |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | static void m62_textlayer( tile_get_info_c | |
| 421 | static void m62_textlayer( tile_get_info_func | |
| 422 | 422 | { |
| 423 | 423 | m62_foreground = tilemap_create( tile_get_info, tilemap_scan_rows, x1, y1, x2, y2 ); |
| 424 | 424 | |
| r1877 | r1878 | |
| 800 | 800 | |
| 801 | 801 | WRITE8_HANDLER( spelunk2_gfxport_w ) |
| 802 | 802 | { |
| 803 | m62_hscroll_high_w(0,(data&2)>>1); | |
| 804 | m62_vscroll_high_w(0,(data&1)); | |
| 803 | m62_hscroll_high_w(machine,0,(data&2)>>1); | |
| 804 | m62_vscroll_high_w(machine,0,(data&1)); | |
| 805 | 805 | if (spelunkr_palbank != ((data & 0x0c) >> 2)) |
| 806 | 806 | { |
| 807 | 807 | spelunkr_palbank = (data & 0x0c) >> 2; |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "deprecat.h" | |
| 9 | 8 | #include "cpu/z80/z80.h" |
| 10 | 9 | #include "includes/astrocde.h" |
| 11 | 10 | #include "sound/astrocde.h" |
| 12 | #include <math.h> /* for sin() and cos() */ | |
| 13 | #include "osd_cpu.h" | |
| 14 | 11 | #include "video/resnet.h" |
| 15 | 12 | |
| 16 | 13 | |
| r1877 | r1878 | |
| 312 | 309 | |
| 313 | 310 | /* compute the starting point of sparkle for the current frame */ |
| 314 | 311 | if (astrocade_video_config & AC_STARS) |
| 315 | sparklebase = ( | |
| 312 | sparklebase = (vid | |
| 316 | 313 | |
| 317 | 314 | /* iterate over scanlines */ |
| 318 | 315 | for (y = cliprect->min_y; y <= cliprect->max_y; y++) |
| r1877 | r1878 | |
| 623 | 620 | case 0x17: /* noise volume register */ |
| 624 | 621 | case 0x18: /* sound block transfer */ |
| 625 | 622 | if (astrocade_video_config & AC_SOUND_PRESENT) |
| 626 | astrocade_sound1_w(offset, data); | |
| 623 | astrocade_sound1_w(machine, offset, data); | |
| 627 | 624 | break; |
| 628 | 625 | |
| 629 | 626 | case 0x19: /* expand register */ |
| r1877 | r1878 | |
|---|---|---|
| 39 | 39 | |
| 40 | 40 | VIDEO_EOF( toki ) |
| 41 | 41 | { |
| 42 | buffer_spriteram16_w(0,0,0); | |
| 42 | buffer_spriteram16_w(machine,0,0,0); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | VIDEO_EOF( tokib ) |
| 46 | 46 | { |
| 47 | buffer_spriteram16_w(0,0,0); | |
| 47 | buffer_spriteram16_w(machine,0,0,0); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | static TILE_GET_INFO( get_text_tile_info ) |
| r1877 | r1878 | |
| 176 | 176 | ***************************************************************************/ |
| 177 | 177 | |
| 178 | 178 | |
| 179 | static void toki_draw_sprites(running_machine *machine, | |
| 179 | static void toki_draw_sprites(running_machine *machine, | |
| 180 | 180 | { |
| 181 | 181 | int x,y,xoffs,yoffs,tile,flipx,flipy,color,offs; |
| 182 | 182 | UINT16 *sprite_word; |
| r1877 | r1878 | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | |
| 223 | static void tokib_draw_sprites(running_machine *machine, | |
| 223 | static void tokib_draw_sprites(running_machine *machine, | |
| 224 | 224 | { |
| 225 | 225 | int x,y,tile,flipx,color,offs; |
| 226 | 226 | UINT16 *sprite_word; |
| r1877 | r1878 | |
|---|---|---|
| 16 | 16 | static UINT8 *fortyl_pixram1; |
| 17 | 17 | static UINT8 *fortyl_pixram2; |
| 18 | 18 | |
| 19 | static mame_bitmap *pixel_bitmap1; | |
| 20 | static mame_bitmap *pixel_bitmap2; | |
| 19 | static bitmap_t *pixel_bitmap1; | |
| 20 | static bitmap_t *pixel_bitmap2; | |
| 21 | 21 | |
| 22 | 22 | static tilemap *background; |
| 23 | 23 | |
| r1877 | r1878 | |
| 256 | 256 | offset 3 xxxxxxxx x position |
| 257 | 257 | */ |
| 258 | 258 | |
| 259 | static void draw_sprites(running_machine *machine, | |
| 259 | static void draw_sprites(running_machine *machine, | |
| 260 | 260 | { |
| 261 | 261 | int offs; |
| 262 | 262 | |
| r1877 | r1878 | |
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | static void draw_pixram( | |
| 322 | static void draw_pixram( | |
| 323 | 323 | { |
| 324 | 324 | int offs; |
| 325 | 325 | int f = fortyl_flipscreen ^ 1; |
| r1877 | r1878 | |
|---|---|---|
| 80 | 80 | state_save_register_func_postload(all_tiles_dirty); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | static void draw_sprites(running_machine *machine, | |
| 83 | static void draw_sprites(running_machine *machine, | |
| 84 | 84 | { |
| 85 | 85 | UINT8 *source = spriteram; |
| 86 | 86 | UINT8 *finish = source + 96 * 4; |
| r1877 | r1878 | |
|---|---|---|
| 494 | 494 | |
| 495 | 495 | ***************************************************************************/ |
| 496 | 496 | |
| 497 | static void draw_sprites(running_machine *machine, | |
| 497 | static void draw_sprites(running_machine *machine, | |
| 498 | 498 | { |
| 499 | 499 | int offs; |
| 500 | 500 | |
| r1877 | r1878 | |
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | |
| 545 | static void draw_stars(running_machine *machine, | |
| 545 | static void draw_stars(running_machine *machine, | |
| 546 | 546 | { |
| 547 | 547 | /* draw the stars */ |
| 548 | 548 |
| r1877 | r1878 | |
|---|---|---|
| 249 | 249 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | lasso_flip_screen_w(offset, data); | |
| 252 | lasso_flip_screen_w(machine, offset, data); | |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | WRITE8_HANDLER( wwjgtin_video_control_w ) |
| r1877 | r1878 | |
| 263 | 263 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | lasso_flip_screen_w(offset, data); | |
| 266 | lasso_flip_screen_w(machine, offset, data); | |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | WRITE8_HANDLER( pinbo_video_control_w ) |
| r1877 | r1878 | |
| 271 | 271 | /* no need to dirty the tilemap -- only the sprites use the global bank */ |
| 272 | 272 | gfxbank = (data & 0x0c) >> 2; |
| 273 | 273 | |
| 274 | lasso_flip_screen_w(offset, data); | |
| 274 | lasso_flip_screen_w(machine, offset, data); | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
| r1877 | r1878 | |
| 281 | 281 | * |
| 282 | 282 | *************************************/ |
| 283 | 283 | |
| 284 | static void draw_sprites(running_machine *machine, | |
| 284 | static void draw_sprites(running_machine *machine, | |
| 285 | 285 | { |
| 286 | 286 | const UINT8 *finish, *source; |
| 287 | 287 | int inc; |
| r1877 | r1878 | |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | |
| 343 | static void draw_lasso( | |
| 343 | static void draw_lasso( | |
| 344 | 344 | { |
| 345 | 345 | offs_t offs; |
| 346 | 346 | pen_t pen = 0x3f; |
| r1877 | r1878 | |
|---|---|---|
| 23 | 23 | static int mjsikaku_screen_refresh; |
| 24 | 24 | static int mjsikaku_gfxmode; |
| 25 | 25 | |
| 26 | static | |
| 26 | static | |
| 27 | 27 | static UINT16 *mjsikaku_videoram; |
| 28 | 28 | static UINT8 *nbmj8688_clut; |
| 29 | 29 | |
| r1877 | r1878 | |
| 198 | 198 | WRITE8_HANDLER( secolove_romsel_w ) |
| 199 | 199 | { |
| 200 | 200 | mjsikaku_gfxrom = ((data & 0xc0) >> 4) + (data & 0x03); |
| 201 | mjsikaku_gfxflag2_w(0, data); | |
| 201 | mjsikaku_gfxflag2_w(machine, 0, data); | |
| 202 | 202 | |
| 203 | 203 | if ((mjsikaku_gfxrom << 17) > (memory_region_length(REGION_GFX1) - 1)) |
| 204 | 204 | { |
| r1877 | r1878 | |
| 212 | 212 | WRITE8_HANDLER( crystalg_romsel_w ) |
| 213 | 213 | { |
| 214 | 214 | mjsikaku_gfxrom = (data & 0x03); |
| 215 | mjsikaku_gfxflag2_w(0, data); | |
| 215 | mjsikaku_gfxflag2_w(machine, 0, data); | |
| 216 | 216 | |
| 217 | 217 | if ((mjsikaku_gfxrom << 17) > (memory_region_length(REGION_GFX1) - 1)) |
| 218 | 218 | { |
| r1877 | r1878 | |
| 226 | 226 | WRITE8_HANDLER( seiha_romsel_w ) |
| 227 | 227 | { |
| 228 | 228 | mjsikaku_gfxrom = (data & 0x1f); |
| 229 | mjsikaku_gfxflag3_w(0, data); | |
| 229 | mjsikaku_gfxflag3_w(machine, 0, data); | |
| 230 | 230 | |
| 231 | 231 | if ((mjsikaku_gfxrom << 17) > (memory_region_length(REGION_GFX1) - 1)) |
| 232 | 232 | { |
| r1877 | r1878 | |
|---|---|---|
| 171 | 171 | switch(offset) |
| 172 | 172 | { |
| 173 | 173 | case 0x00: |
| 174 | val = input_port_0_r(0); | |
| 174 | val = input_port_0_r(machine,0); | |
| 175 | 175 | break; |
| 176 | 176 | case 0x01: |
| 177 | val = input_port_1_r(0); | |
| 177 | val = input_port_1_r(machine,0); | |
| 178 | 178 | break; |
| 179 | 179 | case 0x02: |
| 180 | val = input_port_2_r(0); | |
| 180 | val = input_port_2_r(machine,0); | |
| 181 | 181 | break; |
| 182 | 182 | case 0x03: |
| 183 | val = input_port_3_r(0); | |
| 183 | val = input_port_3_r(machine,0); | |
| 184 | 184 | break; |
| 185 | 185 | case 0x04: |
| 186 | val = input_port_4_r(0); | |
| 186 | val = input_port_4_r(machine,0); | |
| 187 | 187 | break; |
| 188 | 188 | default: |
| 189 | 189 | val = ps5_io_ram[offset]; |
| r1877 | r1878 | |
| 199 | 199 | return psychic5_fg_videoram[offset & 0xfff]; |
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | return 0; | |
| 203 | 202 | } |
| 204 | 203 | |
| 205 | 204 | WRITE8_HANDLER( psychic5_paged_ram_w ) |
| r1877 | r1878 | |
| 207 | 206 | if (!ps5_vram_page) |
| 208 | 207 | { |
| 209 | 208 | if (offset < 0x1000) |
| 210 | psychic5_bg_videoram_w(offset,data); | |
| 209 | psychic5_bg_videoram_w(machine,offset,data); | |
| 211 | 210 | else |
| 212 | 211 | ps5_dummy_bg_ram[offset & 0xfff] = data; |
| 213 | 212 | } |
| r1877 | r1878 | |
| 239 | 238 | } |
| 240 | 239 | else |
| 241 | 240 | { |
| 242 | psychic5_fg_videoram_w(offset & 0xfff, data); | |
| 241 | psychic5_fg_videoram_w(machine, offset & 0xfff, data); | |
| 243 | 242 | } |
| 244 | 243 | } |
| 245 | 244 | } |
| r1877 | r1878 | |
| 294 | 293 | #define DRAW_SPRITE(code, sx, sy) jal_blend_drawgfx(bitmap, machine->gfx[0], code, color, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PEN, 15); |
| 295 | 294 | /* #define DRAW_SPRITE(code, sx, sy) drawgfx(bitmap, machine->gfx[0], code, color, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PEN, 15); */ |
| 296 | 295 | |
| 297 | static void draw_sprites(running_machine *machine, | |
| 296 | static void draw_sprites(running_machine *machine, | |
| 298 | 297 | { |
| 299 | 298 | int offs; |
| 300 | 299 | |
| r1877 | r1878 | |
| 362 | 361 | } |
| 363 | 362 | } |
| 364 | 363 | |
| 365 | static void draw_background(running_machine *machine, | |
| 364 | static void draw_background(running_machine *machine, | |
| 366 | 365 | { |
| 367 | 366 | int bg_scrollx = (ps5_io_ram[BG_SCROLLX_LSB] + ((ps5_io_ram[BG_SCROLLX_MSB] & 0x03) << 8)) & 0x3ff; |
| 368 | 367 | int bg_scrolly = (ps5_io_ram[BG_SCROLLY_LSB] + ((ps5_io_ram[BG_SCROLLY_MSB] & 0x01) << 8)) & 0x1ff; |
| r1877 | r1878 | |
|---|---|---|
| 97 | 97 | Screen refresh |
| 98 | 98 | ***************************************************************************/ |
| 99 | 99 | |
| 100 | static void syvalion_draw_sprites( | |
| 100 | static void syvalion_draw_sprites( | |
| 101 | 101 | { |
| 102 | 102 | /* Y chain size is 16/32?/64/64? pixels. X chain size |
| 103 | 103 | is always 64 pixels. */ |
| r1877 | r1878 | |
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | static void recordbr_draw_sprites( | |
| 193 | static void recordbr_draw_sprites( | |
| 194 | 194 | { |
| 195 | 195 | /* Y chain size is 16/32?/64/64? pixels. X chain size |
| 196 | 196 | is always 64 pixels. */ |
| r1877 | r1878 | |
| 302 | 302 | } |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | static void dleague_draw_sprites( | |
| 305 | static void dleague_draw_sprites( | |
| 306 | 306 | { |
| 307 | 307 | /* Y chain size is 16/32?/64/64? pixels. X chain size |
| 308 | 308 | is always 64 pixels. */ |
| r1877 | r1878 | |
|---|---|---|
| 83 | 83 | ********************************************************/ |
| 84 | 84 | |
| 85 | 85 | |
| 86 | static void draw_sprites(running_machine *machine, | |
| 86 | static void draw_sprites(running_machine *machine, | |
| 87 | 87 | { |
| 88 | 88 | UINT16 *spritemap = (UINT16 *)memory_region(REGION_USER1); |
| 89 | 89 | UINT16 tile_mask = (machine->gfx[0]->total_elements) - 1; |
| r1877 | r1878 | |
|---|---|---|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| 82 | INLINE void set_pixel( | |
| 82 | INLINE void set_pixel( | |
| 83 | 83 | { |
| 84 | 84 | if (y >= MW8080BW_VCOUNTER_START_NO_VBLANK) |
| 85 | 85 | { |
| r1877 | r1878 | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
| 94 | INLINE void set_8_pixels( | |
| 94 | INLINE void set_8_pixels( | |
| 95 | 95 | pen_t *pens, UINT8 fore_color, UINT8 back_color) |
| 96 | 96 | { |
| 97 | 97 | int i; |
| r1877 | r1878 | |
| 107 | 107 | |
| 108 | 108 | |
| 109 | 109 | /* this is needed as this driver doesn't emulate the shift register like mw8080bw does */ |
| 110 | static void clear_extra_columns( | |
| 110 | static void clear_extra_columns( | |
| 111 | 111 | { |
| 112 | 112 | UINT8 x; |
| 113 | 113 |
| r1877 | r1878 | |
|---|---|---|
| 181 | 181 | tilemap_set_flip(ALL_TILEMAPS,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); |
| 182 | 182 | break; |
| 183 | 183 | case 7: |
| 184 | soundlatch_w(0,data); | |
| 184 | soundlatch_w(machine,0,data); | |
| 185 | 185 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); |
| 186 | 186 | break; |
| 187 | 187 | default: |
| r1877 | r1878 | |
| 211 | 211 | |
| 212 | 212 | ------------------------------------------------------------------------ */ |
| 213 | 213 | |
| 214 | static void draw_sprites(running_machine *machine, | |
| 214 | static void draw_sprites(running_machine *machine, | |
| 215 | 215 | { |
| 216 | 216 | int offs; |
| 217 | 217 |
| r1877 | r1878 | |
|---|---|---|
| 135 | 135 | |
| 136 | 136 | ***************************************************************************/ |
| 137 | 137 | |
| 138 | static void draw_sprites(running_machine *machine, | |
| 138 | static void draw_sprites(running_machine *machine, | |
| 139 | 139 | { |
| 140 | 140 | int offs; |
| 141 | 141 |
| r1877 | r1878 | |
|---|---|---|
| 112 | 112 | VIDEO_UPDATE( quasar ) |
| 113 | 113 | { |
| 114 | 114 | int offs; |
| 115 | mame_bitmap *s2636_0_bitmap; | |
| 116 | mame_bitmap *s2636_1_bitmap; | |
| 117 | mame_bitmap *s2636_2_bitmap; | |
| 115 | bitmap_t *s2636_0_bitmap; | |
| 116 | bitmap_t *s2636_1_bitmap; | |
| 117 | bitmap_t *s2636_2_bitmap; | |
| 118 | 118 | |
| 119 | 119 | /* for every character in the video RAM */ |
| 120 | 120 | for (offs = 0; offs < 0x0400; offs++) |
| r1877 | r1878 | |
|---|---|---|
| 101 | 101 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_flip_xy, 8, 8, 32, 32); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | static void draw_sprites(running_machine *machine, | |
| 104 | static void draw_sprites(running_machine *machine, | |
| 105 | 105 | { |
| 106 | 106 | int offs; |
| 107 | 107 |
| r1877 | r1878 | |
|---|---|---|
| 74 | 74 | SPRITE DRAW ROUTINES |
| 75 | 75 | ************************************************************/ |
| 76 | 76 | |
| 77 | static void draw_sprites(running_machine *machine, | |
| 77 | static void draw_sprites(running_machine *machine, | |
| 78 | 78 | { |
| 79 | 79 | /* |
| 80 | 80 | Sprite format: |
| r1877 | r1878 | |
|---|---|---|
| 193 | 193 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | static void draw_sprites(running_machine *machine, | |
| 196 | static void draw_sprites(running_machine *machine, | |
| 197 | 197 | { |
| 198 | 198 | int offs; |
| 199 | 199 |
| r1877 | r1878 | |
|---|---|---|
| 32 | 32 | extern UINT32 *psikyo4_vidregs; |
| 33 | 33 | |
| 34 | 34 | /* --- SPRITES --- */ |
| 35 | static void draw_sprites(running_machine *machine, | |
| 35 | static void draw_sprites(running_machine *machine, | |
| 36 | 36 | { |
| 37 | 37 | /*- Sprite Format 0x0000 - 0x2bff -** |
| 38 | 38 |
| r1877 | r1878 | |
|---|---|---|
| 34 | 34 | static const UINT8 *pacland_color_prom; |
| 35 | 35 | |
| 36 | 36 | static tilemap *bg_tilemap, *fg_tilemap; |
| 37 | static | |
| 37 | static | |
| 38 | 38 | |
| 39 | 39 | static UINT32 *transmask[3]; |
| 40 | 40 | |
| r1877 | r1878 | |
| 286 | 286 | ***************************************************************************/ |
| 287 | 287 | |
| 288 | 288 | /* the sprite generator IC is the same as Mappy */ |
| 289 | static void draw_sprites(running_machine *machine, | |
| 289 | static void draw_sprites(running_machine *machine, | |
| 290 | 290 | { |
| 291 | 291 | int offs; |
| 292 | 292 | |
| r1877 | r1878 | |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | |
| 346 | static void draw_fg( | |
| 346 | static void draw_fg( | |
| 347 | 347 | { |
| 348 | 348 | int y, x; |
| 349 | 349 |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | ****************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "deprecat.h" | |
| 9 | 8 | #include "deco16ic.h" |
| 10 | 9 | #include "cninja.h" |
| 11 | 10 | |
| r1877 | r1878 | |
| 105 | 104 | deco16_raster_display_position=0; |
| 106 | 105 | } |
| 107 | 106 | |
| 108 | static void raster_pf3_draw( | |
| 107 | static void raster_pf3_draw( | |
| 109 | 108 | { |
| 110 | 109 | tilemap *tmap=deco16_get_tilemap(2,0); |
| 111 | 110 | int ptr=0,start,end=0; |
| r1877 | r1878 | |
| 151 | 150 | |
| 152 | 151 | /******************************************************************************/ |
| 153 | 152 | |
| 154 | static void cninja_draw_sprites(running_machine *machine, | |
| 153 | static void cninja_draw_sprites(running_machine *machine, | |
| 155 | 154 | { |
| 156 | 155 | int offs; |
| 157 | 156 | |
| r1877 | r1878 | |
| 174 | 173 | |
| 175 | 174 | y = buffered_spriteram16[offs]; |
| 176 | 175 | flash=y&0x1000; |
| 177 | if (flash && ( | |
| 176 | if (flash && (vid | |
| 178 | 177 | colour = (x >> 9) &0x1f; |
| 179 | 178 | |
| 180 | 179 | fx = y & 0x2000; |
| r1877 | r1878 | |
| 220 | 219 | } |
| 221 | 220 | } |
| 222 | 221 | |
| 223 | static void robocop2_draw_sprites(running_machine *machine, | |
| 222 | static void robocop2_draw_sprites(running_machine *machine, | |
| 224 | 223 | { |
| 225 | 224 | int offs; |
| 226 | 225 | |
| r1877 | r1878 | |
| 242 | 241 | |
| 243 | 242 | y = buffered_spriteram16[offs]; |
| 244 | 243 | flash=y&0x1000; |
| 245 | if (flash && ( | |
| 244 | if (flash && (vid | |
| 246 | 245 | colour = (x >> 9) &0x1f; |
| 247 | 246 | |
| 248 | 247 | fx = y & 0x2000; |
| r1877 | r1878 | |
| 288 | 287 | } |
| 289 | 288 | } |
| 290 | 289 | |
| 291 | static void mutantf_draw_sprites(running_machine *machine, | |
| 290 | static void mutantf_draw_sprites(running_machine *machine, | |
| 292 | 291 | { |
| 293 | 292 | int offs,end,inc; |
| 294 | 293 | |
| r1877 | r1878 | |
| 340 | 339 | w = (spriteptr[offs+2]&0x0f00)>> 8; |
| 341 | 340 | |
| 342 | 341 | sy = spriteptr[offs]; |
| 343 | if ((sy&0x2000) && ( | |
| 342 | if ((sy&0x2000) && (vid | |
| 344 | 343 | offs+=inc; |
| 345 | 344 | continue; |
| 346 | 345 | } |
| r1877 | r1878 | |
|---|---|---|
| 109 | 109 | ** |
| 110 | 110 | ***************************************************************************/ |
| 111 | 111 | |
| 112 | static void draw_status(running_machine *machine, | |
| 112 | static void draw_status(running_machine *machine, | |
| 113 | 113 | { |
| 114 | 114 | const UINT8 *base = jcr_textram + 0x400; |
| 115 | 115 | const gfx_element *gfx = machine->gfx[0]; |
| r1877 | r1878 | |
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | static void draw_sprites(running_machine *machine, | |
| 139 | static void draw_sprites(running_machine *machine, | |
| 140 | 140 | { |
| 141 | 141 | const gfx_element *gfx = machine->gfx[3]; |
| 142 | 142 | const UINT8 *source, *finish; |
| r1877 | r1878 | |
|---|---|---|
| 177 | 177 | state_save_register_global(popper_gfx_bank); |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | static void draw_sprites(running_machine *machine, | |
| 180 | static void draw_sprites(running_machine *machine, | |
| 181 | 181 | { |
| 182 | 182 | int offs,sx,sy,flipx,flipy; |
| 183 | 183 |
| r1877 | r1878 | |
|---|---|---|
| 180 | 180 | |
| 181 | 181 | ***************************************************************************/ |
| 182 | 182 | |
| 183 | static void draw_sprites(running_machine* machine, | |
| 183 | static void draw_sprites(running_machine* machine, | |
| 184 | 184 | { |
| 185 | 185 | gfx_element *gfx = machine->gfx[gfxset]; |
| 186 | 186 | const UINT8 *finish = source + lenght; |
| r1877 | r1878 | |
|---|---|---|
| 53 | 53 | WRITE8_HANDLER( ladyfrog_palette_w ) |
| 54 | 54 | { |
| 55 | 55 | if (offset & 0x100) |
| 56 | paletteram_xxxxBBBBGGGGRRRR_split2_w((offset & 0xff) + (palette_bank << 8),data); | |
| 56 | paletteram_xxxxBBBBGGGGRRRR_split2_w(machine, (offset & 0xff) + (palette_bank << 8),data); | |
| 57 | 57 | else |
| 58 | paletteram_xxxxBBBBGGGGRRRR_split1_w((offset & 0xff) + (palette_bank << 8),data); | |
| 58 | paletteram_xxxxBBBBGGGGRRRR_split1_w(machine, (offset & 0xff) + (palette_bank << 8),data); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | READ8_HANDLER( ladyfrog_palette_r ) |
| r1877 | r1878 | |
| 97 | 97 | tilemap_set_scrolly(bg_tilemap, offset, data ); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | static void draw_sprites(running_machine *machine, | |
| 100 | static void draw_sprites(running_machine *machine, | |
| 101 | 101 | { |
| 102 | 102 | int i; |
| 103 | 103 | for (i=0;i<0x20;i++) |
| r1877 | r1878 | |
|---|---|---|
| 172 | 172 | flipon = charon = staron = objon = bgon = 0; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | static void draw_sprites_region(running_machine *machine, | |
| 175 | static void draw_sprites_region(running_machine *machine, | |
| 176 | 176 | { |
| 177 | 177 | const gfx_element *gfx = machine->gfx[2]; |
| 178 | 178 | int offs, attr, color, code, x, y, flipx, flipy; |
| r1877 | r1878 | |
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | static void sidearms_draw_starfield( | |
| 207 | static void sidearms_draw_starfield( | |
| 208 | 208 | { |
| 209 | 209 | int x, y, i; |
| 210 | 210 | UINT32 hadd_283, vadd_283, _hflop_74a_n, _hcount_191, _vcount_191; |
| r1877 | r1878 | |
| 327 | 327 | #endif |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | static void draw_sprites(running_machine *machine, | |
| 330 | static void draw_sprites(running_machine *machine, | |
| 331 | 331 | { |
| 332 | 332 | if (sidearms_gameid == 2 || sidearms_gameid == 3) // Dyger and Whizz have simple front-to-back sprite priority |
| 333 | 333 | draw_sprites_region(machine, bitmap, cliprect, 0x0000, 0x1000); |
| r1877 | r1878 | |
| 360 | 360 | |
| 361 | 361 | VIDEO_EOF( sidearms ) |
| 362 | 362 | { |
| 363 | buffer_spriteram_w(0, 0); | |
| 363 | buffer_spriteram_w(machine, 0, 0); | |
| 364 | 364 | } |
| r1877 | r1878 | |
|---|---|---|
| 56 | 56 | /* non-textured render path */ |
| 57 | 57 | static void MODEL2_FUNC_NAME(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid) |
| 58 | 58 | { |
| 59 | #if !defined( MODEL2_TRANSLUCENT) | |
| 59 | 60 | const poly_extra_data *extra = extradata; |
| 60 | | |
| 61 | | |
| 61 | 62 | UINT32 *p = BITMAP_ADDR32(destmap, scanline, 0); |
| 62 | 63 | |
| 63 | 64 | /* extract color information */ |
| r1877 | r1878 | |
| 71 | 72 | UINT8 luma; |
| 72 | 73 | UINT32 tr, tg, tb; |
| 73 | 74 | int x; |
| 74 | ||
| 75 | #endif | |
| 75 | 76 | /* if it's translucent, there's nothing to render */ |
| 76 | 77 | #if defined( MODEL2_TRANSLUCENT) |
| 77 | 78 | return; |
| 78 | #e | |
| 79 | #else | |
| 79 | 80 | |
| 80 | 81 | luma = lumaram[BYTE_XOR_LE(lumabase + (0xf << 3))] & 0x3F; |
| 81 | 82 | |
| r1877 | r1878 | |
| 101 | 102 | #else |
| 102 | 103 | p[x] = color; |
| 103 | 104 | #endif |
| 105 | #endif | |
| 104 | 106 | } |
| 105 | 107 | |
| 106 | 108 | #else |
| r1877 | r1878 | |
| 108 | 110 | static void MODEL2_FUNC_NAME(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid) |
| 109 | 111 | { |
| 110 | 112 | const poly_extra_data *extra = extradata; |
| 111 | | |
| 113 | | |
| 112 | 114 | UINT32 *p = BITMAP_ADDR32(destmap, scanline, 0); |
| 113 | 115 | |
| 114 | 116 | UINT32 tex_width = extra->texwidth; |
| r1877 | r1878 | |
|---|---|---|
| 25 | 25 | WRITE8_HANDLER( jack_paletteram_w ) |
| 26 | 26 | { |
| 27 | 27 | /* RGB output is inverted */ |
| 28 | paletteram_BBGGGRRR_w(offset,~data); | |
| 28 | paletteram_BBGGGRRR_w(machine,offset,~data); | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | READ8_HANDLER( jack_flipscreen_r ) |
| r1877 | r1878 | |
| 58 | 58 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flipy, 8, 8, 32, 32); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | static void jack_draw_sprites(running_machine *machine, | |
| 61 | static void jack_draw_sprites(running_machine *machine, | |
| 62 | 62 | { |
| 63 | 63 | int offs; |
| 64 | 64 | |
| r1877 | r1878 | |
| 139 | 139 | bg_tilemap = tilemap_create(joinem_get_bg_tile_info, tilemap_scan_cols_flipy, 8, 8, 32, 32); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | static void joinem_draw_sprites(running_machine *machine, | |
| 142 | static void joinem_draw_sprites(running_machine *machine, | |
| 143 | 143 | { |
| 144 | 144 | int offs; |
| 145 | 145 |
| r1877 | r1878 | |
|---|---|---|
| 14 | 14 | ***************************************************************************/ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | #include "deprecat.h" | |
| 18 | 17 | #include "deco16ic.h" |
| 19 | 18 | |
| 20 | static void draw_sprites(running_machine *machine, | |
| 19 | static void draw_sprites(running_machine *machine, | |
| 21 | 20 | { |
| 22 | 21 | int offs; |
| 23 | 22 | |
| r1877 | r1878 | |
| 30 | 29 | |
| 31 | 30 | y = spriteram16[offs]; |
| 32 | 31 | flash=y&0x1000; |
| 33 | if (flash && ( | |
| 32 | if (flash && (vid | |
| 34 | 33 | |
| 35 | 34 | x = spriteram16[offs+2]; |
| 36 | 35 | colour = (x >>9) & 0x1f; |
| r1877 | r1878 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | static UINT8 *bitmapram; |
| 8 | 8 | static int bm_plane; |
| 9 | static | |
| 9 | static | |
| 10 | 10 | static int pixcolor; |
| 11 | 11 | static tilemap *bg_tilemap; |
| 12 | 12 | |
| r1877 | r1878 | |
| 143 | 143 | return; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | internal_bitmapram_w(offset + BITMAPRAM_SIZE/3 * bm_plane,data); | |
| 146 | internal_bitmapram_w(machine,offset + BITMAPRAM_SIZE/3 * bm_plane,data); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | WRITE8_HANDLER( dogfgt_bgvideoram_w ) |
| r1877 | r1878 | |
| 185 | 185 | |
| 186 | 186 | ***************************************************************************/ |
| 187 | 187 | |
| 188 | static void draw_sprites(running_machine *machine, | |
| 188 | static void draw_sprites(running_machine *machine, | |
| 189 | 189 | { |
| 190 | 190 | int offs; |
| 191 | 191 | |
| r1877 | r1878 | |
| 230 | 230 | lastpixcolor = pixcolor; |
| 231 | 231 | |
| 232 | 232 | for (offs = 0;offs < BITMAPRAM_SIZE;offs++) |
| 233 | internal_bitmapram_w(offs,bitmapram[offs]); | |
| 233 | internal_bitmapram_w(machine,offs,bitmapram[offs]); | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 |
| r1877 | r1878 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 3 | 2 | #include "deco16ic.h" |
| 4 | 3 | |
| 5 | static void draw_sprites(running_machine* machine, | |
| 4 | static void draw_sprites(running_machine* machine, | |
| 6 | 5 | { |
| 7 | 6 | int offs; |
| 8 | 7 | |
| r1877 | r1878 | |
| 15 | 14 | |
| 16 | 15 | y = spriteram16[offs]; |
| 17 | 16 | flash=y&0x1000; |
| 18 | if (flash && ( | |
| 17 | if (flash && (vid | |
| 19 | 18 | |
| 20 | 19 | x = spriteram16[offs+2]; |
| 21 | 20 | colour = (x >>9) & 0x1f; |
| r1877 | r1878 | |
|---|---|---|
| 31 | 31 | UINT8 *taitosj_video_priority; |
| 32 | 32 | UINT8 *taitosj_collision_reg; |
| 33 | 33 | UINT8 *kikstart_scrollram; |
| 34 | static mame_bitmap *taitosj_layer_bitmap[3]; | |
| 35 | static mame_bitmap *sprite_sprite_collbitmap1,*sprite_sprite_collbitmap2; | |
| 36 | static mame_bitmap *sprite_layer_collbitmap1; | |
| 37 | static mame_bitmap *sprite_layer_collbitmap2[3]; | |
| 34 | static bitmap_t *taitosj_layer_bitmap[3]; | |
| 35 | static bitmap_t *sprite_sprite_collbitmap1,*sprite_sprite_collbitmap2; | |
| 36 | static bitmap_t *sprite_layer_collbitmap1; | |
| 37 | static bitmap_t *sprite_layer_collbitmap2[3]; | |
| 38 | 38 | static UINT8 dirtycharacter1[256],dirtycharacter2[256]; |
| 39 | 39 | static UINT8 dirtysprite1[64],dirtysprite2[64]; |
| 40 | 40 | |
| 41 | 41 | static const int layer_enable_mask[3] = { 0x10, 0x20, 0x40 }; |
| 42 | 42 | |
| 43 | typedef void (*copy_layer_func_t)(running_machine *, | |
| 43 | typedef void (*copy_layer_func_t)(running_machine *, | |
| 44 | 44 | const rectangle *, int, int *, rectangle *); |
| 45 | 45 | |
| 46 | 46 | |
| r1877 | r1878 | |
| 268 | 268 | |
| 269 | 269 | WRITE8_HANDLER( junglhbr_characterram_w ) |
| 270 | 270 | { |
| 271 | taitosj_characterram_w(offset, data ^ 0xfc); | |
| 271 | taitosj_characterram_w(machine, offset, data ^ 0xfc); | |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | |
| r1877 | r1878 | |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | 615 | |
| 616 | static void draw_sprites(running_machine *machine, | |
| 616 | static void draw_sprites(running_machine *machine, | |
| 617 | 617 | { |
| 618 | 618 | /* |
| 619 | 619 | sprite visibility area is missing 4 pixels from the sides, surely to reduce |
| r1877 | r1878 | |
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | |
| 682 | static void taitosj_copy_layer(running_machine *machine, | |
| 682 | static void taitosj_copy_layer(running_machine *machine, | |
| 683 | 683 | int which, int *sprites_on, rectangle *sprite_areas) |
| 684 | 684 | { |
| 685 | 685 | static const int fudge1[3] = { 3, 1, -1 }; |
| r1877 | r1878 | |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | 719 | |
| 720 | static void kikstart_copy_layer(running_machine *machine, | |
| 720 | static void kikstart_copy_layer(running_machine *machine, | |
| 721 | 721 | int which, int *sprites_on, rectangle *sprite_areas) |
| 722 | 722 | { |
| 723 | 723 | if (*taitosj_video_mode & layer_enable_mask[which]) |
| r1877 | r1878 | |
| 755 | 755 | } |
| 756 | 756 | |
| 757 | 757 | |
| 758 | static void copy_layer(running_machine *machine, | |
| 758 | static void copy_layer(running_machine *machine, | |
| 759 | 759 | copy_layer_func_t copy_layer_func, int which, int *sprites_on, rectangle *sprite_areas) |
| 760 | 760 | { |
| 761 | 761 | if (which == 0) |
| r1877 | r1878 | |
| 765 | 765 | } |
| 766 | 766 | |
| 767 | 767 | |
| 768 | static void copy_layers(running_machine *machine, | |
| 768 | static void copy_layers(running_machine *machine, | |
| 769 | 769 | copy_layer_func_t copy_layer_func, int *sprites_on, rectangle *sprite_areas) |
| 770 | 770 | { |
| 771 | 771 | int i = 0; |
| r1877 | r1878 | |
| 792 | 792 | } |
| 793 | 793 | |
| 794 | 794 | |
| 795 | static int video_update_common(running_machine *machine, | |
| 795 | static int video_update_common(running_machine *machine, | |
| 796 | 796 | const rectangle *cliprect, copy_layer_func_t copy_layer_func) |
| 797 | 797 | { |
| 798 | 798 | int sprites_on[0x20]; /* 1 if sprite is active */ |
| r1877 | r1878 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | static int rear_refresh=1; |
| 38 | 38 | |
| 39 | static | |
| 39 | static | |
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | VIDEO_START( vigilant ) |
| r1877 | r1878 | |
| 170 | 170 | ??? |
| 171 | 171 | **************************************************************************/ |
| 172 | 172 | |
| 173 | static void draw_foreground(running_machine *machine, | |
| 173 | static void draw_foreground(running_machine *machine, | |
| 174 | 174 | { |
| 175 | 175 | int offs; |
| 176 | 176 | int scroll = -(horiz_scroll_low + horiz_scroll_high); |
| r1877 | r1878 | |
| 218 | 218 | |
| 219 | 219 | |
| 220 | 220 | |
| 221 | static void draw_background(running_machine *machine, | |
| 221 | static void draw_background(running_machine *machine, | |
| 222 | 222 | { |
| 223 | 223 | int scrollx = 0x17a + 16*8 - (rear_horiz_scroll_low + rear_horiz_scroll_high); |
| 224 | 224 | |
| r1877 | r1878 | |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | |
| 236 | static void draw_sprites(running_machine *machine, | |
| 236 | static void draw_sprites(running_machine *machine, | |
| 237 | 237 | { |
| 238 | 238 | int offs; |
| 239 | 239 |
| r1877 | r1878 | |
|---|---|---|
| 1242 | 1242 | |
| 1243 | 1243 | WRITE16_HANDLER( avgdvg_go_word_w ) |
| 1244 | 1244 | { |
| 1245 | avgdvg_go_w(offset, data); | |
| 1245 | avgdvg_go_w(machine, offset, data); | |
| 1246 | 1246 | } |
| 1247 | 1247 | |
| 1248 | 1248 | |
| r1877 | r1878 | |
| 1260 | 1260 | |
| 1261 | 1261 | WRITE16_HANDLER( avgdvg_reset_word_w ) |
| 1262 | 1262 | { |
| 1263 | avgdvg_reset_w (0,0); | |
| 1263 | avgdvg_reset_w (machine,0,0); | |
| 1264 | 1264 | } |
| 1265 | 1265 | |
| 1266 | 1266 | MACHINE_RESET( avgdvg ) |
| 1267 | 1267 | { |
| 1268 | avgdvg_reset_w (0,0); | |
| 1268 | avgdvg_reset_w (machine,0,0); | |
| 1269 | 1269 | } |
| 1270 | 1270 | |
| 1271 | 1271 |
| r1877 | r1878 | |
|---|---|---|
| 209 | 209 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | static void kingofb_draw_sprites(running_machine *machine, | |
| 212 | static void kingofb_draw_sprites(running_machine *machine, | |
| 213 | 213 | { |
| 214 | 214 | int offs; |
| 215 | 215 | |
| r1877 | r1878 | |
| 275 | 275 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | static void ringking_draw_sprites(running_machine *machine, | |
| 278 | static void ringking_draw_sprites(running_machine *machine, | |
| 279 | 279 | { |
| 280 | 280 | int offs; |
| 281 | 281 |
| r1877 | r1878 | |
|---|---|---|
| 22 | 22 | static int nbmj8991_clutsel; |
| 23 | 23 | static int nbmj8991_screen_refresh; |
| 24 | 24 | |
| 25 | static | |
| 25 | static | |
| 26 | 26 | static UINT8 *nbmj8991_videoram; |
| 27 | 27 | static UINT8 *nbmj8991_clut; |
| 28 | 28 |
| r1877 | r1878 | |
|---|---|---|
| 277 | 277 | |
| 278 | 278 | for (offs = 0; offs < videoram_size; offs++) |
| 279 | 279 | { |
| 280 | galivan_videoram_w(offs, 0x20); | |
| 280 | galivan_videoram_w(machine, offs, 0x20); | |
| 281 | 281 | } |
| 282 | 282 | for (offs = 0; offs < videoram_size; offs++) |
| 283 | 283 | { |
| 284 | galivan_colorram_w(offs, 0x03); | |
| 284 | galivan_colorram_w(machine, offs, 0x03); | |
| 285 | 285 | } |
| 286 | 286 | } |
| 287 | 287 | |
| r1877 | r1878 | |
| 348 | 348 | |
| 349 | 349 | ***************************************************************************/ |
| 350 | 350 | |
| 351 | static void draw_sprites(running_machine *machine, | |
| 351 | static void draw_sprites(running_machine *machine, | |
| 352 | 352 | { |
| 353 | 353 | const UINT8 *spritepalettebank = memory_region(REGION_USER1); |
| 354 | 354 | int offs; |
| r1877 | r1878 | |
|---|---|---|
| 135 | 135 | |
| 136 | 136 | ***************************************************************************/ |
| 137 | 137 | |
| 138 | static void draw_sprites(running_machine *machine, | |
| 138 | static void draw_sprites(running_machine *machine, | |
| 139 | 139 | { |
| 140 | 140 | gfx_element *gfx = machine->gfx[2]; |
| 141 | 141 | const UINT8 *source = spriteram+32*4-4; |
| r1877 | r1878 | |
|---|---|---|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |
| 37 | static void draw_sprites(running_machine *machine, | |
| 37 | static void draw_sprites(running_machine *machine, | |
| 38 | 38 | { |
| 39 | 39 | int i; |
| 40 | 40 | |
| r1877 | r1878 | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| 59 | static void draw_bombs( | |
| 59 | static void draw_bombs( | |
| 60 | 60 | { |
| 61 | 61 | int i; |
| 62 | 62 |
| r1877 | r1878 | |
|---|---|---|
| 89 | 89 | tilemap_mark_tile_dirty(bg_tilemap[offset >> 11],((offset << 1) & 0x0fff) >> 1); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | static void draw_bitmap( | |
| 92 | static void draw_bitmap( | |
| 93 | 93 | { |
| 94 | 94 | int sx,sy,color,count,colxor,bitswap; |
| 95 | 95 | colxor = 0; /* splash and some bitmap modes in roldfrog */ |
| r1877 | r1878 | |
| 216 | 216 | 400| xxxxxxxx -------- | unused |
| 217 | 217 | */ |
| 218 | 218 | |
| 219 | static void splash_draw_sprites(running_machine *machine, | |
| 219 | static void splash_draw_sprites(running_machine *machine, | |
| 220 | 220 | { |
| 221 | 221 | int i; |
| 222 | 222 | const gfx_element *gfx = machine->gfx[1]; |
| r1877 | r1878 | |
| 237 | 237 | } |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | static void funystrp_draw_sprites(running_machine *machine, | |
| 240 | static void funystrp_draw_sprites(running_machine *machine, | |
| 241 | 241 | { |
| 242 | 242 | int i; |
| 243 | 243 | const gfx_element *gfx = machine->gfx[1]; |
| r1877 | r1878 | |
|---|---|---|
| 191 | 191 | |
| 192 | 192 | ***************************************************************************/ |
| 193 | 193 | |
| 194 | static void f1gp_draw_sprites(running_machine *machine, | |
| 194 | static void f1gp_draw_sprites(running_machine *machine, | |
| 195 | 195 | { |
| 196 | 196 | int attr_start,first; |
| 197 | 197 | UINT16 *spram = chip ? f1gp_spr2vram : f1gp_spr1vram; |
| r1877 | r1878 | |
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | static void f1gpb_draw_sprites(running_machine *machine, | |
| 265 | static void f1gpb_draw_sprites(running_machine *machine, | |
| 266 | 266 | { |
| 267 | 267 | int attr_start, start_offset = spriteram_size/2 - 4; |
| 268 | 268 | |
| r1877 | r1878 | |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | |
| 420 | static void f1gp2_draw_sprites(running_machine *machine, | |
| 420 | static void f1gp2_draw_sprites(running_machine *machine, | |
| 421 | 421 | { |
| 422 | 422 | int offs; |
| 423 | 423 |
| r1877 | r1878 | |
|---|---|---|
| 73 | 73 | |
| 74 | 74 | static void |
| 75 | 75 | DrawRozHelper( |
| 76 | | |
| 76 | | |
| 77 | 77 | tilemap *tmap, |
| 78 | 78 | const rectangle *clip, |
| 79 | 79 | const struct RozParam *rozInfo ) |
| r1877 | r1878 | |
| 83 | 83 | if( bitmap->bpp == 16 ) |
| 84 | 84 | { |
| 85 | 85 | UINT32 size_mask = rozInfo->size-1; |
| 86 | mame_bitmap *srcbitmap = tilemap_get_pixmap( tmap ); | |
| 87 | mame_bitmap *flagsbitmap = tilemap_get_flagsmap( tmap ); | |
| 86 | bitmap_t *srcbitmap = tilemap_get_pixmap( tmap ); | |
| 87 | bitmap_t *flagsbitmap = tilemap_get_flagsmap( tmap ); | |
| 88 | 88 | UINT32 startx = rozInfo->startx + clip->min_x * rozInfo->incxx + clip->min_y * rozInfo->incyx; |
| 89 | 89 | UINT32 starty = rozInfo->starty + clip->min_x * rozInfo->incxy + clip->min_y * rozInfo->incyy; |
| 90 | 90 | int sx = clip->min_x; |
| r1877 | r1878 | |
| 138 | 138 | } /* DrawRozHelper */ |
| 139 | 139 | |
| 140 | 140 | static void |
| 141 | DrawROZ( | |
| 141 | DrawROZ( | |
| 142 | 142 | { |
| 143 | 143 | const int xoffset = 38,yoffset = 0; |
| 144 | 144 | struct RozParam rozParam; |
| r1877 | r1878 | |
|---|---|---|
| 132 | 132 | * The Stratovox video connections have been verified from the schematics |
| 133 | 133 | */ |
| 134 | 134 | |
| 135 | static int video_update_stratvox_ttmahjng( | |
| 135 | static int video_update_stratvox_ttmahjng( | |
| 136 | 136 | const rectangle *cliprect, |
| 137 | 137 | pen_t (*make_pen)(UINT8)) |
| 138 | 138 | { |
| r1877 | r1878 | |
|---|---|---|
| 8 | 8 | #include "deprecat.h" |
| 9 | 9 | #include "exidy440.h" |
| 10 | 10 | |
| 11 | #define SPRITE_COUNT 40 | |
| 12 | 11 | |
| 12 | #define PIXEL_CLOCK (EXIDY440_MASTER_CLOCK / 2) | |
| 13 | #define HTOTAL (0x1a0) | |
| 14 | #define HBEND (0x000) | |
| 15 | #define HBSTART (0x140) | |
| 16 | #define HSEND (0x178) | |
| 17 | #define HSSTART (0x160) | |
| 18 | #define VTOTAL (0x104) | |
| 19 | #define VBEND (0x000) | |
| 20 | #define VBSTART (0x0f0) | |
| 21 | #define VSEND (0x0f8) | |
| 22 | #define VSSTART (0x0f0) | |
| 13 | 23 | |
| 24 | /* Top Secret has a larger VBLANK area */ | |
| 25 | #define TOPSECEX_VBSTART (0x0ec) | |
| 26 | ||
| 27 | #define SPRITE_COUNT (0x28) | |
| 28 | ||
| 29 | ||
| 14 | 30 | /* globals */ |
| 15 | 31 | UINT8 *exidy440_scanline; |
| 16 | 32 | UINT8 *exidy440_imageram; |
| 17 | UINT8 exidy440_firq_vblank; | |
| 18 | UINT8 exidy440_firq_beam; | |
| 19 | UINT8 topsecex_yscroll; | |
| 33 | UINT8 exidy440_firq_vblank; | |
| 34 | UINT8 exidy440_firq_beam; | |
| 35 | UINT8 *topsecex_yscroll; | |
| 20 | 36 | |
| 21 | 37 | /* local allocated storage */ |
| 22 | 38 | static UINT8 exidy440_latched_x; |
| r1877 | r1878 | |
| 30 | 46 | static UINT8 palettebank_vis; |
| 31 | 47 | |
| 32 | 48 | /* function prototypes */ |
| 33 | static void exidy440_update_firq( | |
| 49 | static void exidy440_update_firq(running_machine *machine); | |
| 34 | 50 | |
| 35 | 51 | |
| 36 | 52 | |
| r1877 | r1878 | |
| 40 | 56 | * |
| 41 | 57 | *************************************/ |
| 42 | 58 | |
| 43 | VIDEO_START( exidy440 ) | |
| 59 | static VIDEO_START( exidy440 ) | |
| 44 | 60 | { |
| 45 | 61 | /* reset the system */ |
| 46 | 62 | firq_enable = 0; |
| r1877 | r1878 | |
| 50 | 66 | exidy440_firq_vblank = 0; |
| 51 | 67 | exidy440_firq_beam = 0; |
| 52 | 68 | |
| 53 | /* reset Top Secret scroll position */ | |
| 54 | topsecex_yscroll = 0; | |
| 55 | ||
| 56 | 69 | /* allocate a buffer for VRAM */ |
| 57 | 70 | local_videoram = auto_malloc(256 * 256 * 2); |
| 58 | 71 | memset(local_videoram, 0, 256 * 256 * 2); |
| r1877 | r1878 | |
| 63 | 76 | } |
| 64 | 77 | |
| 65 | 78 | |
| 79 | static VIDEO_START( topsecex ) | |
| 80 | { | |
| 81 | VIDEO_START_CALL(exidy440); | |
| 66 | 82 | |
| 83 | *topsecex_yscroll = 0; | |
| 84 | } | |
| 85 | ||
| 86 | ||
| 87 | ||
| 67 | 88 | /************************************* |
| 68 | 89 | * |
| 69 | 90 | * Video RAM read/write |
| r1877 | r1878 | |
| 133 | 154 | { |
| 134 | 155 | /* clear the FIRQ on a read here */ |
| 135 | 156 | exidy440_firq_beam = 0; |
| 136 | exidy440_update_firq(); | |
| 157 | exidy440_update_firq(Machine); | |
| 137 | 158 | |
| 138 | 159 | /* according to the schems, this value is only latched on an FIRQ |
| 139 | 160 | * caused by collision or beam */ |
| r1877 | r1878 | |
| 187 | 208 | palettebank_vis = data & 1; |
| 188 | 209 | |
| 189 | 210 | /* update the FIRQ in case we enabled something */ |
| 190 | exidy440_update_firq(); | |
| 211 | exidy440_update_firq(Machine); | |
| 191 | 212 | |
| 192 | 213 | /* if we're swapping palettes, change all the colors */ |
| 193 | 214 | if (oldvis != palettebank_vis) |
| r1877 | r1878 | |
| 210 | 231 | { |
| 211 | 232 | /* clear the VBLANK FIRQ on a write here */ |
| 212 | 233 | exidy440_firq_vblank = 0; |
| 213 | exidy440_update_firq(); | |
| 234 | exidy440_update_firq(Machine); | |
| 214 | 235 | } |
| 215 | 236 | |
| 216 | 237 | |
| r1877 | r1878 | |
| 221 | 242 | * |
| 222 | 243 | *************************************/ |
| 223 | 244 | |
| 224 | static void exidy440_update_firq( | |
| 245 | static void exidy440_update_firq(running_machine *machine) | |
| 225 | 246 | { |
| 226 | 247 | if (exidy440_firq_vblank || (firq_enable && exidy440_firq_beam)) |
| 227 | cpunum_set_input_line( | |
| 248 | cpunum_set_input_line(machine, 0, 1, ASSERT_LINE); | |
| 228 | 249 | else |
| 229 | cpunum_set_input_line( | |
| 250 | cpunum_set_input_line(machine, 0, 1, CLEAR_LINE); | |
| 230 | 251 | } |
| 231 | 252 | |
| 232 | 253 | |
| r1877 | r1878 | |
| 234 | 255 | { |
| 235 | 256 | /* set the FIRQ line on a VBLANK */ |
| 236 | 257 | exidy440_firq_vblank = 1; |
| 237 | exidy440_update_firq(); | |
| 258 | exidy440_update_firq(machine); | |
| 238 | 259 | } |
| 239 | 260 | |
| 240 | 261 | |
| r1877 | r1878 | |
| 251 | 272 | if (firq_select && firq_enable) |
| 252 | 273 | { |
| 253 | 274 | exidy440_firq_beam = 1; |
| 254 | exidy440_update_firq(); | |
| 275 | exidy440_update_firq(machine); | |
| 255 | 276 | } |
| 256 | 277 | |
| 257 | 278 | /* round the x value to the nearest byte */ |
| r1877 | r1878 | |
| 268 | 289 | if (!firq_select && firq_enable) |
| 269 | 290 | { |
| 270 | 291 | exidy440_firq_beam = 1; |
| 271 | exidy440_update_firq(); | |
| 292 | exidy440_update_firq(machine); | |
| 272 | 293 | } |
| 273 | 294 | |
| 274 | 295 | /* round the x value to the nearest byte */ |
| r1877 | r1878 | |
| 286 | 307 | * |
| 287 | 308 | *************************************/ |
| 288 | 309 | |
| 289 | static void draw_sprites( | |
| 310 | static void draw_sprites( | |
| 290 | 311 | { |
| 291 | 312 | int i; |
| 292 | 313 | |
| 293 | 314 | /* get a pointer to the palette to look for collision flags */ |
| 294 | 315 | UINT8 *palette = &local_paletteram[palettebank_vis * 512]; |
| 316 | int count = 0; | |
| 295 | 317 | |
| 296 | /* start the count high for topsecret, which doesn't use collision flags */ | |
| 297 | int count = exidy440_topsecret ? 128 : 0; | |
| 298 | ||
| 299 | 318 | /* draw the sprite images, checking for collisions along the way */ |
| 300 | 319 | UINT8 *sprite = spriteram + (SPRITE_COUNT - 1) * 4; |
| 301 | 320 | |
| r1877 | r1878 | |
| 323 | 342 | for (y = 0; y < 16; y++, yoffs--, sy--) |
| 324 | 343 | { |
| 325 | 344 | /* wrap at the top and bottom of the screen */ |
| 326 | if (sy >= EXIDY440_VBSTART) | |
| 327 | sy -= (EXIDY440_VBSTART - EXIDY440_VBEND); | |
| 328 | else if (sy < EXIDY440_VBEND) | |
| 329 | sy += (EXIDY440_VBSTART - EXIDY440_VBEND); | |
| 345 | if (sy >= VBSTART) | |
| 346 | sy -= (VBSTART - VBEND); | |
| 347 | else if (sy < VBEND) | |
| 348 | sy += (VBSTART - VBEND); | |
| 330 | 349 | |
| 331 | 350 | /* stop if we get before the current scanline */ |
| 332 | 351 | if (yoffs < cliprect->min_y) |
| r1877 | r1878 | |
| 347 | 366 | int pen; |
| 348 | 367 | |
| 349 | 368 | /* left pixel */ |
| 350 | if (left && | |
| 369 | if (left && | |
| 351 | 370 | { |
| 352 | 371 | /* combine with the background */ |
| 353 | 372 | pen = left | old[0]; |
| 354 | 373 | *BITMAP_ADDR16(bitmap, yoffs, currx) = pen; |
| 355 | 374 | |
| 356 | 375 | /* check the collisions bit */ |
| 357 | if ((palette[2 * pen] & 0x80) && count++ < 128) | |
| 376 | if (check_collision && (palette[2 * pen] & 0x80) && (count++ < 128)) | |
| 358 | 377 | timer_set(video_screen_get_time_until_pos(0, yoffs, currx), NULL, currx, collide_firq_callback); |
| 359 | 378 | } |
| 360 | 379 | currx++; |
| 361 | 380 | |
| 362 | 381 | /* right pixel */ |
| 363 | if (right && | |
| 382 | if (right && | |
| 364 | 383 | { |
| 365 | 384 | /* combine with the background */ |
| 366 | 385 | pen = right | old[1]; |
| 367 | 386 | *BITMAP_ADDR16(bitmap, yoffs, currx) = pen; |
| 368 | 387 | |
| 369 | 388 | /* check the collisions bit */ |
| 370 | if ((palette[2 * pen] & 0x80) && count++ < 128) | |
| 389 | if (check_collision && (palette[2 * pen] & 0x80) && (count++ < 128)) | |
| 371 | 390 | timer_set(video_screen_get_time_until_pos(0, yoffs, currx), NULL, currx, collide_firq_callback); |
| 372 | 391 | } |
| 373 | 392 | currx++; |
| r1877 | r1878 | |
| 387 | 406 | * |
| 388 | 407 | *************************************/ |
| 389 | 408 | |
| 390 | static void update_screen( | |
| 409 | static void update_screen( | |
| 391 | 410 | { |
| 392 | 411 | int y, sy; |
| 393 | 412 | |
| r1877 | r1878 | |
| 396 | 415 | for (y = cliprect->min_y; y <= cliprect->max_y; y++, sy++) |
| 397 | 416 | { |
| 398 | 417 | /* wrap at the bottom of the screen */ |
| 399 | if (sy >= EXIDY440_VBSTART) | |
| 400 | sy -= (EXIDY440_VBSTART - EXIDY440_VBEND); | |
| 418 | if (sy >= VBSTART) | |
| 419 | sy -= (VBSTART - VBEND); | |
| 401 | 420 | |
| 402 | 421 | /* draw line */ |
| 403 | draw_scanline8(bitmap, 0, y, ( | |
| 422 | draw_scanline8(bitmap, 0, y, ( | |
| 404 | 423 | } |
| 405 | 424 | |
| 406 | 425 | /* draw the sprites */ |
| 407 | draw_sprites(bitmap, cliprect, scroll_offset); | |
| 426 | draw_sprites(bitmap, cliprect, scroll_offset, check_collision); | |
| 408 | 427 | } |
| 409 | 428 | |
| 410 | 429 | |
| r1877 | r1878 | |
| 415 | 434 | * |
| 416 | 435 | *************************************/ |
| 417 | 436 | |
| 418 | VIDEO_UPDATE( exidy440 ) | |
| 437 | static VIDEO_UPDATE( exidy440 ) | |
| 419 | 438 | { |
| 420 | 439 | /* redraw the screen */ |
| 421 | if (exidy440_topsecret) | |
| 422 | update_screen(machine, bitmap, cliprect, topsecex_yscroll); | |
| 423 | else | |
| 424 | update_screen(machine, bitmap, cliprect, 0); | |
| 440 | update_screen(bitmap, cliprect, 0, TRUE); | |
| 425 | 441 | |
| 426 | return 0; | |
| 427 | } | |
| 428 | ||
| 429 | ||
| 430 | ||
| 431 | /************************************* | |
| 432 | * | |
| 433 | * Standard screen refresh callback | |
| 434 | * | |
| 435 | *************************************/ | |
| 436 | ||
| 437 | VIDEO_EOF( exidy440 ) | |
| 438 | { | |
| 439 | 442 | /* generate an interrupt once/frame for the beam */ |
| 440 | if ( | |
| 443 | if (cliprect->max | |
| 441 | 444 | { |
| 442 | attotime time; | |
| 443 | attoseconds_t increment; | |
| 444 | int beamx, beamy; | |
| 445 | 445 | int i; |
| 446 | 446 | |
| 447 | beamx = ((input_port_4_r(0) & 0xff) * (EXIDY440_HBSTART - EXIDY440_HBEND)) >> 8; | |
| 448 | beamy = ((input_port_5_r(0) & 0xff) * (EXIDY440_VBSTART - EXIDY440_VBEND)) >> 8; | |
| 447 | int beamx = ((input_port_4_r(machine, 0) & 0xff) * (HBSTART - HBEND)) >> 8; | |
| 448 | int beamy = ((input_port_5_r(machine, 0) & 0xff) * (VBSTART - VBEND)) >> 8; | |
| 449 | 449 | |
| 450 | 450 | /* The timing of this FIRQ is very important. The games look for an FIRQ |
| 451 | 451 | and then wait about 650 cycles, clear the old FIRQ, and wait a |
| r1877 | r1878 | |
| 453 | 453 | From this, it appears that they are expecting to get beams over |
| 454 | 454 | a 12 scanline period, and trying to pick roughly the middle one. |
| 455 | 455 | This is how it is implemented. */ |
| 456 | increment = attotime_to_attoseconds(video_screen_get_scan_period(0)); | |
| 457 | time = attotime_sub(video_screen_get_time_until_pos(0, beamy, beamx), attotime_make(0, increment * 6)); | |
| 456 | attoseconds_t increment = attotime_to_attoseconds(video_screen_get_scan_period(0)); | |
| 457 | attotime time = attotime_sub(video_screen_get_time_until_pos(0, beamy, beamx), attotime_make(0, increment * 6)); | |
| 458 | 458 | for (i = 0; i <= 12; i++) |
| 459 | 459 | { |
| 460 | 460 | timer_set(time, NULL, beamx, beam_firq_callback); |
| 461 | 461 | time = attotime_add(time, attotime_make(0, increment)); |
| 462 | 462 | } |
| 463 | 463 | } |
| 464 | ||
| 465 | return 0; | |
| 464 | 466 | } |
| 467 | ||
| 468 | ||
| 469 | static VIDEO_UPDATE( topsecex ) | |
| 470 | { | |
| 471 | /* redraw the screen */ | |
| 472 | update_screen(bitmap, cliprect, *topsecex_yscroll, FALSE); | |
| 473 | ||
| 474 | return 0; | |
| 475 | } | |
| 476 | ||
| 477 | ||
| 478 | ||
| 479 | /************************************* | |
| 480 | * | |
| 481 | * Machine drivers | |
| 482 | * | |
| 483 | *************************************/ | |
| 484 | ||
| 485 | MACHINE_DRIVER_START( exidy440_video ) | |
| 486 | MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) | |
| 487 | MDRV_VIDEO_START(exidy440) | |
| 488 | MDRV_VIDEO_UPDATE(exidy440) | |
| 489 | MDRV_PALETTE_LENGTH(256) | |
| 490 | ||
| 491 | MDRV_SCREEN_ADD("main", RASTER) | |
| 492 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 493 | MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) | |
| 494 | MACHINE_DRIVER_END | |
| 495 | ||
| 496 | ||
| 497 | MACHINE_DRIVER_START( topsecex_video ) | |
| 498 | MDRV_VIDEO_ATTRIBUTES(0) | |
| 499 | MDRV_VIDEO_START(topsecex) | |
| 500 | MDRV_VIDEO_UPDATE(topsecex) | |
| 501 | ||
| 502 | MDRV_SCREEN_MODIFY("main") | |
| 503 | MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, TOPSECEX_VBSTART) | |
| 504 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
|---|---|---|
| 88 | 88 | size_t tx1_objram_size; |
| 89 | 89 | |
| 90 | 90 | static tilemap *tx1_tilemap; |
| 91 | static | |
| 91 | static | |
| 92 | 92 | static render_texture *tx1_texture; |
| 93 | 93 | |
| 94 | 94 | WRITE16_HANDLER( tx1_vram_w ) |
| r1877 | r1878 | |
| 222 | 222 | |
| 223 | 223 | |
| 224 | 224 | /* Preliminary */ |
| 225 | static void tx1_draw_objects( | |
| 225 | static void tx1_draw_objects( | |
| 226 | 226 | { |
| 227 | 227 | #define FRAC 16 |
| 228 | 228 |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | ****************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "deprecat.h" | |
| 9 | 8 | #include "deco16ic.h" |
| 10 | 9 | |
| 11 | 10 | /******************************************************************************/ |
| 12 | 11 | |
| 13 | static void draw_sprites(running_machine* machine, | |
| 12 | static void draw_sprites(running_machine* machine, | |
| 14 | 13 | { |
| 15 | 14 | int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; |
| 16 | 15 | int offs, bank, gfxbank; |
| r1877 | r1878 | |
| 46 | 45 | |
| 47 | 46 | y = spritebase[offs]; |
| 48 | 47 | flash=y&0x1000; |
| 49 | if (flash && ( | |
| 48 | if (flash && (vid | |
| 50 | 49 | colour = (x >> 9) &0x1f; |
| 51 | 50 | if (y&0x8000) colour+=32; |
| 52 | 51 |
| r1877 | r1878 | |
|---|---|---|
| 120 | 120 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | static void draw_sprites(running_machine *machine, | |
| 123 | static void draw_sprites(running_machine *machine, | |
| 124 | 124 | { |
| 125 | 125 | int offs; |
| 126 | 126 |
| r1877 | r1878 | |
|---|---|---|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | |
| 243 | static void draw_objects(running_machine *machine, | |
| 243 | static void draw_objects(running_machine *machine, | |
| 244 | 244 | { |
| 245 | 245 | int i,j,k,x,y; |
| 246 | 246 |
| r1877 | r1878 | |
|---|---|---|
| 99 | 99 | static TIMER_CALLBACK( irq_off ) |
| 100 | 100 | { |
| 101 | 101 | /* clear the interrupt */ |
| 102 | atarigen_scanline_int_ack_w(0, 0, 0); | |
| 102 | atarigen_scanline_int_ack_w(machine, 0, 0, 0); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | |
| r1877 | r1878 | |
| 122 | 122 | attotime period_on; |
| 123 | 123 | attotime period_off; |
| 124 | 124 | |
| 125 | /* | |
| 125 | /* FIXME: - the only thing this IRQ does it tweak the starting MO link */ | |
| 126 | 126 | /* unfortunately, it does it too early for the given MOs! */ |
| 127 | 127 | /* perhaps it is not actually hooked up on the real PCB... */ |
| 128 | 128 | return; |
| r1877 | r1878 | |
| 148 | 148 | VIDEO_UPDATE( blstroid ) |
| 149 | 149 | { |
| 150 | 150 | struct atarimo_rect_list rectlist; |
| 151 | | |
| 151 | | |
| 152 | 152 | int x, y, r; |
| 153 | 153 | |
| 154 | 154 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 114 | 114 | 8, 8, 64, 32); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | static void draw_status_row(running_machine *machine, | |
| 117 | static void draw_status_row(running_machine *machine, | |
| 118 | 118 | { |
| 119 | 119 | int row; |
| 120 | 120 | |
| r1877 | r1878 | |
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | static void draw_sprites(running_machine *machine, | |
| 149 | static void draw_sprites(running_machine *machine, | |
| 150 | 150 | { |
| 151 | 151 | int offs; |
| 152 | 152 | |
| r1877 | r1878 | |
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | static void draw_status(running_machine *machine, | |
| 174 | static void draw_status(running_machine *machine, | |
| 175 | 175 | { |
| 176 | 176 | draw_status_row(machine, bitmap, cliprect, 0, 1); |
| 177 | 177 | draw_status_row(machine, bitmap, cliprect, 1, 0); |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | static tilemap *tx_layer; |
| 6 | 6 | static tilemap *layer0, *layer1, *layer2, *layer3; |
| 7 | 7 | |
| 8 | static | |
| 8 | static | |
| 9 | 9 | |
| 10 | 10 | UINT16 *roundup_r_ram, *roundup_p_ram, *roundup_l_ram; |
| 11 | 11 | UINT16 *cyclwarr_videoram0, *cyclwarr_videoram1; |
| r1877 | r1878 | |
| 237 | 237 | |
| 238 | 238 | /********************************************************************/ |
| 239 | 239 | |
| 240 | INLINE void roundupt_drawgfxzoomrotate( | |
| 240 | INLINE void roundupt_drawgfxzoomrotate( | |
| 241 | 241 | UINT32 code,UINT32 color,int flipx,int flipy,UINT32 ssx,UINT32 ssy, |
| 242 | 242 | const rectangle *clip, int scalex, int scaley, int rotate, int write_priority_only ) |
| 243 | 243 | { |
| r1877 | r1878 | |
| 453 | 453 | } |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | static void mycopyrozbitmap_core( | |
| 456 | static void mycopyrozbitmap_core( | |
| 457 | 457 | int dstx,int dsty, int srcwidth, int srcheight,int incxx,int incxy,int incyx,int incyy, |
| 458 | 458 | const rectangle *clip,int transparency,int transparent_color) |
| 459 | 459 | { |
| r1877 | r1878 | |
| 515 | 515 | } |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | static void draw_sprites(running_machine *machine, | |
| 518 | static void draw_sprites(running_machine *machine, | |
| 519 | 519 | { |
| 520 | 520 | int offs,fx,x,y,color; |
| 521 | 521 | int w,h,index,lines,scale,rotate; |
| r1877 | r1878 | |
| 686 | 686 | } |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | static void draw_sky(running_machine *machine, | |
| 689 | static void draw_sky(running_machine *machine, | |
| 690 | 690 | { |
| 691 | 691 | // all todo |
| 692 | 692 | int x,y; |
| r1877 | r1878 | |
| 708 | 708 | } |
| 709 | 709 | } |
| 710 | 710 | |
| 711 | static void draw_road(running_machine *machine, | |
| 711 | static void draw_road(running_machine *machine, | |
| 712 | 712 | { |
| 713 | 713 | /* |
| 714 | 714 | 0xf980 0x0008 0x8c80 0x4a00 - road right to below, width unknown (32 pixels guess) |
| r1877 | r1878 | |
| 960 | 960 | |
| 961 | 961 | /**********************************************************************/ |
| 962 | 962 | |
| 963 | static void draw_bg(running_machine *machine, | |
| 963 | static void draw_bg(running_machine *machine, | |
| 964 | 964 | { |
| 965 | 965 | /* |
| 966 | 966 | Each tile (0x4000 of them) has a lookup table in ROM to build an individual 3-bit palette |
| 967 | 967 | from sets of 8 bit palettes! |
| 968 | 968 | */ |
| 969 | 969 | const UINT8* tile_cluts = memory_region(REGION_GFX4); |
| 970 | const | |
| 970 | const | |
| 971 | 971 | int src_y_mask=ysize-1; |
| 972 | 972 | int src_x_mask=xsize-1; |
| 973 | 973 | int tile_y_mask=(ysize/8)-1; |
| r1877 | r1878 | |
|---|---|---|
| 13 | 13 | ***************************************************************************/ |
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | #include "deprecat.h" | |
| 17 | 16 | #include "deco16ic.h" |
| 18 | 17 | |
| 19 | 18 | /******************************************************************************/ |
| 20 | 19 | |
| 21 | static void draw_sprites(running_machine *machine, | |
| 20 | static void draw_sprites(running_machine *machine, | |
| 22 | 21 | { |
| 23 | 22 | int offs; |
| 24 | 23 | |
| r1877 | r1878 | |
| 31 | 30 | |
| 32 | 31 | y = spriteram16[offs]; |
| 33 | 32 | flash=y&0x1000; |
| 34 | if (flash && ( | |
| 33 | if (flash && (vid | |
| 35 | 34 | |
| 36 | 35 | x = spriteram16[offs+2]; |
| 37 | 36 | colour = (x >>9) & 0x1f; |
| r1877 | r1878 | |
|---|---|---|
| 1149 | 1149 | ***************************************************************************/ |
| 1150 | 1150 | |
| 1151 | 1151 | #include "driver.h" |
| 1152 | #include "deprecat.h" | |
| 1153 | 1152 | #include "video/konamiic.h" |
| 1154 | 1153 | |
| 1155 | 1154 | #define VERBOSE 0 |
| r1877 | r1878 | |
| 1296 | 1295 | * |
| 1297 | 1296 | */ |
| 1298 | 1297 | |
| 1299 | void K007121_sprites_draw(int chip, | |
| 1298 | void K007121_sprites_draw(int chip, | |
| 1300 | 1299 | const rectangle *cliprect, const UINT8 *source,int base_color, |
| 1301 | 1300 | int global_x_offset,int bank_base, UINT32 pri_mask) |
| 1302 | 1301 | { |
| r1877 | r1878 | |
| 1674 | 1673 | tilemap_set_enable(K007342_tilemap[tmap], enable); |
| 1675 | 1674 | } |
| 1676 | 1675 | |
| 1677 | void K007342_tilemap_draw( | |
| 1676 | void K007342_tilemap_draw( | |
| 1678 | 1677 | { |
| 1679 | 1678 | tilemap_draw(bitmap,cliprect,K007342_tilemap[num],flags,priority); |
| 1680 | 1679 | } |
| r1877 | r1878 | |
| 1741 | 1740 | * 7 | xxxxxxxx | unused |
| 1742 | 1741 | */ |
| 1743 | 1742 | |
| 1744 | void K007420_sprites_draw( | |
| 1743 | void K007420_sprites_draw( | |
| 1745 | 1744 | { |
| 1746 | 1745 | #define K007420_SPRITERAM_SIZE 0x200 |
| 1747 | 1746 | int offs; |
| r1877 | r1878 | |
| 2247 | 2246 | |
| 2248 | 2247 | READ16_HANDLER( K052109_word_r ) |
| 2249 | 2248 | { |
| 2250 | return K052109_r(offset + 0x2000) | (K052109_r(offset) << 8); | |
| 2249 | return K052109_r(machine,offset + 0x2000) | (K052109_r(machine,offset) << 8); | |
| 2251 | 2250 | } |
| 2252 | 2251 | |
| 2253 | 2252 | WRITE16_HANDLER( K052109_word_w ) |
| 2254 | 2253 | { |
| 2255 | 2254 | if (ACCESSING_MSB) |
| 2256 | K052109_w(offset,(data >> 8) & 0xff); | |
| 2255 | K052109_w(machine,offset,(data >> 8) & 0xff); | |
| 2257 | 2256 | if (ACCESSING_LSB) |
| 2258 | K052109_w(offset + 0x2000,data & 0xff); | |
| 2257 | K052109_w(machine,offset + 0x2000,data & 0xff); | |
| 2259 | 2258 | } |
| 2260 | 2259 | |
| 2261 | 2260 | READ16_HANDLER(K052109_lsb_r) |
| 2262 | 2261 | { |
| 2263 | return K052109_r(offset); | |
| 2262 | return K052109_r(machine,offset); | |
| 2264 | 2263 | } |
| 2265 | 2264 | |
| 2266 | 2265 | WRITE16_HANDLER(K052109_lsb_w) |
| 2267 | 2266 | { |
| 2268 | 2267 | if(ACCESSING_LSB) |
| 2269 | K052109_w(offset, data & 0xff); | |
| 2268 | K052109_w(machine, offset, data & 0xff); | |
| 2270 | 2269 | } |
| 2271 | 2270 | |
| 2272 | 2271 | void K052109_set_RMRD_line(int state) |
| r1877 | r1878 | |
| 2613 | 2612 | |
| 2614 | 2613 | READ16_HANDLER( K051960_word_r ) |
| 2615 | 2614 | { |
| 2616 | return K051960_r(offset*2 + 1) | (K051960_r(offset*2) << 8); | |
| 2615 | return K051960_r(machine,offset*2 + 1) | (K051960_r(machine,offset*2) << 8); | |
| 2617 | 2616 | } |
| 2618 | 2617 | |
| 2619 | 2618 | WRITE16_HANDLER( K051960_word_w ) |
| 2620 | 2619 | { |
| 2621 | 2620 | if (ACCESSING_MSB) |
| 2622 | K051960_w(offset*2,(data >> 8) & 0xff); | |
| 2621 | K051960_w(machine,offset*2,(data >> 8) & 0xff); | |
| 2623 | 2622 | if (ACCESSING_LSB) |
| 2624 | K051960_w(offset*2 + 1,data & 0xff); | |
| 2623 | K051960_w(machine,offset*2 + 1,data & 0xff); | |
| 2625 | 2624 | } |
| 2626 | 2625 | |
| 2627 | 2626 | READ8_HANDLER( K051937_r ) |
| r1877 | r1878 | |
| 2686 | 2685 | |
| 2687 | 2686 | READ16_HANDLER( K051937_word_r ) |
| 2688 | 2687 | { |
| 2689 | return K051937_r(offset*2 + 1) | (K051937_r(offset*2) << 8); | |
| 2688 | return K051937_r(machine,offset*2 + 1) | (K051937_r(machine,offset*2) << 8); | |
| 2690 | 2689 | } |
| 2691 | 2690 | |
| 2692 | 2691 | WRITE16_HANDLER( K051937_word_w ) |
| 2693 | 2692 | { |
| 2694 | 2693 | if (ACCESSING_MSB) |
| 2695 | K051937_w(offset*2,(data >> 8) & 0xff); | |
| 2694 | K051937_w(machine,offset*2,(data >> 8) & 0xff); | |
| 2696 | 2695 | if (ACCESSING_LSB) |
| 2697 | K051937_w(offset*2 + 1,data & 0xff); | |
| 2696 | K051937_w(machine,offset*2 + 1,data & 0xff); | |
| 2698 | 2697 | } |
| 2699 | 2698 | |
| 2700 | 2699 | |
| r1877 | r1878 | |
| 2730 | 2729 | * Note that Aliens also uses the shadow bit to select the second sprite bank. |
| 2731 | 2730 | */ |
| 2732 | 2731 | |
| 2733 | void K051960_sprites_draw( | |
| 2732 | void K051960_sprites_draw( | |
| 2734 | 2733 | { |
| 2735 | 2734 | #define NUM_SPRITES 128 |
| 2736 | 2735 | int offs,pri_code; |
| r1877 | r1878 | |
| 2927 | 2926 | if (K052109_RMRD_line == CLEAR_LINE) |
| 2928 | 2927 | { |
| 2929 | 2928 | if (offset >= 0x3800 && offset < 0x3808) |
| 2930 | return K051937_r(offset - 0x3800); | |
| 2929 | return K051937_r(machine,offset - 0x3800); | |
| 2931 | 2930 | else if (offset < 0x3c00) |
| 2932 | return K052109_r(offset); | |
| 2931 | return K052109_r(machine,offset); | |
| 2933 | 2932 | else |
| 2934 | return K051960_r(offset - 0x3c00); | |
| 2933 | return K051960_r(machine,offset - 0x3c00); | |
| 2935 | 2934 | } |
| 2936 | else return K052109_r(offset); | |
| 2935 | else return K052109_r(machine,offset); | |
| 2937 | 2936 | } |
| 2938 | 2937 | |
| 2939 | 2938 | WRITE8_HANDLER( K052109_051960_w ) |
| 2940 | 2939 | { |
| 2941 | 2940 | if (offset >= 0x3800 && offset < 0x3808) |
| 2942 | K051937_w(offset - 0x3800,data); | |
| 2941 | K051937_w(machine,offset - 0x3800,data); | |
| 2943 | 2942 | else if (offset < 0x3c00) |
| 2944 | K052109_w(offset,data); | |
| 2943 | K052109_w(machine,offset,data); | |
| 2945 | 2944 | else |
| 2946 | K051960_w(offset - 0x3c00,data); | |
| 2945 | K051960_w(machine,offset - 0x3c00,data); | |
| 2947 | 2946 | } |
| 2948 | 2947 | |
| 2949 | 2948 | |
| r1877 | r1878 | |
| 3189 | 3188 | |
| 3190 | 3189 | READ16_HANDLER( K053244_lsb_r ) |
| 3191 | 3190 | { |
| 3192 | return K053244_r(offset); | |
| 3191 | return K053244_r(machine, offset); | |
| 3193 | 3192 | } |
| 3194 | 3193 | |
| 3195 | 3194 | WRITE16_HANDLER( K053244_lsb_w ) |
| 3196 | 3195 | { |
| 3197 | 3196 | if (ACCESSING_LSB) |
| 3198 | K053244_w(offset, data & 0xff); | |
| 3197 | K053244_w(machine, offset, data & 0xff); | |
| 3199 | 3198 | } |
| 3200 | 3199 | |
| 3201 | 3200 | READ16_HANDLER( K053244_word_r ) |
| 3202 | 3201 | { |
| 3203 | return (K053244_r(offset*2)<<8)|K053244_r(offset*2+1); | |
| 3202 | return (K053244_r(machine, offset*2)<<8)|K053244_r(machine, offset*2+1); | |
| 3204 | 3203 | } |
| 3205 | 3204 | |
| 3206 | 3205 | WRITE16_HANDLER( K053244_word_w ) |
| 3207 | 3206 | { |
| 3208 | 3207 | if (ACCESSING_MSB) |
| 3209 | K053244_w(offset*2, (data >> 8) & 0xff); | |
| 3208 | K053244_w(machine, offset*2, (data >> 8) & 0xff); | |
| 3210 | 3209 | if (ACCESSING_LSB) |
| 3211 | K053244_w(offset*2+1, data & 0xff); | |
| 3210 | K053244_w(machine, offset*2+1, data & 0xff); | |
| 3212 | 3211 | } |
| 3213 | 3212 | |
| 3214 | 3213 | void K053244_bankselect(int chip, int bank) |
| r1877 | r1878 | |
| 3244 | 3243 | * The rest of the sprite remains normal. |
| 3245 | 3244 | */ |
| 3246 | 3245 | |
| 3247 | void K053245_sprites_draw(int chip, | |
| 3246 | void K053245_sprites_draw(int chip, | |
| 3248 | 3247 | { |
| 3249 | 3248 | #define NUM_SPRITES 128 |
| 3250 | 3249 | int offs,pri_code,i; |
| r1877 | r1878 | |
| 3473 | 3472 | |
| 3474 | 3473 | /* Lethal Enforcers has 2 of these chips hooked up in parallel to give 6bpp gfx.. lets cheat a |
| 3475 | 3474 | bit and make emulating it a little less messy by using a custom function instead */ |
| 3476 | void K053245_sprites_draw_lethal(running_machine *machine,int chip, | |
| 3475 | void K053245_sprites_draw_lethal(running_machine *machine,int chip, | |
| 3477 | 3476 | { |
| 3478 | 3477 | #define NUM_SPRITES 128 |
| 3479 | 3478 | int offs,pri_code,i; |
| r1877 | r1878 | |
| 4129 | 4128 | READ16_HANDLER( K053246_word_r ) |
| 4130 | 4129 | { |
| 4131 | 4130 | offset <<= 1; |
| 4132 | return K053246_r(offset + 1) | (K053246_r(offset) << 8); | |
| 4131 | return K053246_r(machine, offset + 1) | (K053246_r(machine, offset) << 8); | |
| 4133 | 4132 | } |
| 4134 | 4133 | |
| 4135 | 4134 | WRITE16_HANDLER( K053246_word_w ) |
| 4136 | 4135 | { |
| 4137 | 4136 | if (ACCESSING_MSB) |
| 4138 | K053246_w(offset<<1,(data >> 8) & 0xff); | |
| 4137 | K053246_w(machine, offset<<1,(data >> 8) & 0xff); | |
| 4139 | 4138 | if (ACCESSING_LSB) |
| 4140 | K053246_w((offset<<1) + 1,data & 0xff); | |
| 4139 | K053246_w(machine, (offset<<1) + 1,data & 0xff); | |
| 4141 | 4140 | } |
| 4142 | 4141 | |
| 4143 | 4142 | READ32_HANDLER( K053246_long_r ) |
| 4144 | 4143 | { |
| 4145 | 4144 | offset <<= 1; |
| 4146 | return (K053246_word_r(offset+1, 0xffff) | K053246_word_r(offset, 0xffff)<<16); | |
| 4145 | return (K053246_word_r(machine, offset+1, 0xffff) | K053246_word_r(machine, offset, 0xffff)<<16); | |
| 4147 | 4146 | } |
| 4148 | 4147 | |
| 4149 | 4148 | WRITE32_HANDLER( K053246_long_w ) |
| 4150 | 4149 | { |
| 4151 | 4150 | offset <<= 1; |
| 4152 | K053246_word_w(offset, data>>16, mem_mask >> 16); | |
| 4153 | K053246_word_w(offset+1, data, mem_mask); | |
| 4151 | K053246_word_w(machine, offset, data>>16, mem_mask >> 16); | |
| 4152 | K053246_word_w(machine, offset+1, data, mem_mask); | |
| 4154 | 4153 | } |
| 4155 | 4154 | |
| 4156 | 4155 | void K053246_set_OBJCHA_line(int state) |
| r1877 | r1878 | |
| 4193 | 4192 | * The rest of the sprite remains normal. |
| 4194 | 4193 | */ |
| 4195 | 4194 | |
| 4196 | void K053247_sprites_draw(running_machine *machine, | |
| 4195 | void K053247_sprites_draw(running_machine *machine, | |
| 4197 | 4196 | { |
| 4198 | 4197 | #define NUM_SPRITES 256 |
| 4199 | 4198 | |
| r1877 | r1878 | |
| 4659 | 4658 | 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, |
| 4660 | 4659 | 128*8 |
| 4661 | 4660 | }; |
| 4662 | static const tile_get_info_c | |
| 4661 | static const tile_get_info_func | |
| 4663 | 4662 | |
| 4664 | 4663 | /* find first empty slot to decode gfx */ |
| 4665 | 4664 | for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++) |
| r1877 | r1878 | |
| 4858 | 4857 | } |
| 4859 | 4858 | |
| 4860 | 4859 | |
| 4861 | static void K051316_zoom_draw(int chip, | |
| 4860 | static void K051316_zoom_draw(int chip, | |
| 4862 | 4861 | { |
| 4863 | 4862 | UINT32 startx,starty; |
| 4864 | 4863 | int incxx,incxy,incyx,incyy; |
| r1877 | r1878 | |
| 4902 | 4901 | #endif |
| 4903 | 4902 | } |
| 4904 | 4903 | |
| 4905 | void K051316_zoom_draw_0( | |
| 4904 | void K051316_zoom_draw_0( | |
| 4906 | 4905 | { |
| 4907 | 4906 | K051316_zoom_draw(0,bitmap,cliprect,flags,priority); |
| 4908 | 4907 | } |
| 4909 | 4908 | |
| 4910 | void K051316_zoom_draw_1( | |
| 4909 | void K051316_zoom_draw_1( | |
| 4911 | 4910 | { |
| 4912 | 4911 | K051316_zoom_draw(1,bitmap,cliprect,flags,priority); |
| 4913 | 4912 | } |
| 4914 | 4913 | |
| 4915 | void K051316_zoom_draw_2( | |
| 4914 | void K051316_zoom_draw_2( | |
| 4916 | 4915 | { |
| 4917 | 4916 | K051316_zoom_draw(2,bitmap,cliprect,flags,priority); |
| 4918 | 4917 | } |
| r1877 | r1878 | |
| 4933 | 4932 | static int K053936_wraparound[K053936_MAX_CHIPS]; |
| 4934 | 4933 | |
| 4935 | 4934 | |
| 4936 | static void K053936_zoom_draw(int chip,UINT16 *ctrl,UINT16 *linectrl, | |
| 4935 | static void K053936_zoom_draw(int chip,UINT16 *ctrl,UINT16 *linectrl, | |
| 4937 | 4936 | { |
| 4938 | 4937 | if (ctrl[0x07] & 0x0040) /* "super" mode */ |
| 4939 | 4938 | { |
| r1877 | r1878 | |
| 5041 | 5040 | } |
| 5042 | 5041 | |
| 5043 | 5042 | |
| 5044 | void K053936_0_zoom_draw( | |
| 5043 | void K053936_0_zoom_draw( | |
| 5045 | 5044 | { |
| 5046 | 5045 | K053936_zoom_draw(0,K053936_0_ctrl,K053936_0_linectrl,bitmap,cliprect,tmap,flags,priority); |
| 5047 | 5046 | } |
| 5048 | 5047 | |
| 5049 | void K053936_1_zoom_draw( | |
| 5048 | void K053936_1_zoom_draw( | |
| 5050 | 5049 | { |
| 5051 | 5050 | K053936_zoom_draw(1,K053936_1_ctrl,K053936_1_linectrl,bitmap,cliprect,tmap,flags,priority); |
| 5052 | 5051 | } |
| r1877 | r1878 | |
| 5156 | 5155 | WRITE16_HANDLER( K053251_lsb_w ) |
| 5157 | 5156 | { |
| 5158 | 5157 | if (ACCESSING_LSB) |
| 5159 | K053251_w(offset, data & 0xff); | |
| 5158 | K053251_w(machine, offset, data & 0xff); | |
| 5160 | 5159 | } |
| 5161 | 5160 | |
| 5162 | 5161 | WRITE16_HANDLER( K053251_msb_w ) |
| 5163 | 5162 | { |
| 5164 | 5163 | if (ACCESSING_MSB) |
| 5165 | K053251_w(offset, (data >> 8) & 0xff); | |
| 5164 | K053251_w(machine, offset, (data >> 8) & 0xff); | |
| 5166 | 5165 | } |
| 5167 | 5166 | |
| 5168 | 5167 | int K053251_get_priority(int ci) |
| r1877 | r1878 | |
| 5231 | 5230 | |
| 5232 | 5231 | READ16_HANDLER( K054000_lsb_r ) |
| 5233 | 5232 | { |
| 5234 | return K054000_r(offset); | |
| 5233 | return K054000_r(machine, offset); | |
| 5235 | 5234 | } |
| 5236 | 5235 | |
| 5237 | 5236 | WRITE16_HANDLER( K054000_lsb_w ) |
| 5238 | 5237 | { |
| 5239 | 5238 | if (ACCESSING_LSB) |
| 5240 | K054000_w(offset, data & 0xff); | |
| 5239 | K054000_w(machine, offset, data & 0xff); | |
| 5241 | 5240 | } |
| 5242 | 5241 | |
| 5243 | 5242 | |
| r1877 | r1878 | |
| 5347 | 5346 | #define K056832_PAGE_COUNT 16 |
| 5348 | 5347 | |
| 5349 | 5348 | static tilemap *K056832_tilemap[K056832_PAGE_COUNT]; |
| 5350 | static | |
| 5349 | static | |
| 5351 | 5350 | |
| 5352 | 5351 | static UINT16 K056832_regs[0x20]; // 157/832 regs group 1 |
| 5353 | 5352 | static UINT16 K056832_regsb[4]; // 157/832 regs group 2, board dependent |
| r1877 | r1878 | |
| 6034 | 6033 | return K056832_rombase[addr+1] | (K056832_rombase[addr] << 8); |
| 6035 | 6034 | } |
| 6036 | 6035 | |
| 6037 | return 0; | |
| 6038 | 6036 | } |
| 6039 | 6037 | |
| 6040 | 6038 | READ16_HANDLER( K056832_bishi_rom_word_r ) |
| r1877 | r1878 | |
| 6076 | 6074 | READ32_HANDLER( K056832_rom_long_r ) |
| 6077 | 6075 | { |
| 6078 | 6076 | offset <<= 1; |
| 6079 | return (K056832_rom_word_r(offset+1, 0xffff) | (K056832_rom_word_r(offset, 0xffff)<<16)); | |
| 6077 | return (K056832_rom_word_r(machine, offset+1, 0xffff) | (K056832_rom_word_r(machine, offset, 0xffff)<<16)); | |
| 6080 | 6078 | } |
| 6081 | 6079 | |
| 6082 | 6080 | /* only one page is mapped to videoram at a time through a window */ |
| r1877 | r1878 | |
| 6385 | 6383 | // if (ACCESSING_xxx) trick. in particular, 8-bit writes |
| 6386 | 6384 | // are used to the tilemap bank register. |
| 6387 | 6385 | offset <<= 1; |
| 6388 | K056832_word_w(offset, data>>16, mem_mask >> 16); | |
| 6389 | K056832_word_w(offset+1, data, mem_mask); | |
| 6386 | K056832_word_w(machine, offset, data>>16, mem_mask >> 16); | |
| 6387 | K056832_word_w(machine, offset+1, data, mem_mask); | |
| 6390 | 6388 | } |
| 6391 | 6389 | |
| 6392 | 6390 | WRITE16_HANDLER( K056832_b_word_w ) |
| r1877 | r1878 | |
| 6398 | 6396 | { |
| 6399 | 6397 | if (offset & 1) |
| 6400 | 6398 | { |
| 6401 | K056832_word_w((offset>>1), data, 0xff00); | |
| 6399 | K056832_word_w(machine, (offset>>1), data, 0xff00); | |
| 6402 | 6400 | } |
| 6403 | 6401 | else |
| 6404 | 6402 | { |
| 6405 | K056832_word_w((offset>>1), data<<8, 0x00ff); | |
| 6403 | K056832_word_w(machine, (offset>>1), data<<8, 0x00ff); | |
| 6406 | 6404 | } |
| 6407 | 6405 | } |
| 6408 | 6406 | |
| r1877 | r1878 | |
| 6410 | 6408 | { |
| 6411 | 6409 | if (offset & 1) |
| 6412 | 6410 | { |
| 6413 | K056832_b_word_w((offset>>1), data, 0xff00); | |
| 6411 | K056832_b_word_w(machine, (offset>>1), data, 0xff00); | |
| 6414 | 6412 | } |
| 6415 | 6413 | else |
| 6416 | 6414 | { |
| 6417 | K056832_b_word_w((offset>>1), data<<8, 0x00ff); | |
| 6415 | K056832_b_word_w(machine, (offset>>1), data<<8, 0x00ff); | |
| 6418 | 6416 | } |
| 6419 | 6417 | } |
| 6420 | 6418 | |
| r1877 | r1878 | |
| 6422 | 6420 | { |
| 6423 | 6421 | if (ACCESSING_MSW32) |
| 6424 | 6422 | { |
| 6425 | K056832_b_word_w(offset<<1, data>>16, mem_mask >> 16); | |
| 6423 | K056832_b_word_w(machine, offset<<1, data>>16, mem_mask >> 16); | |
| 6426 | 6424 | } |
| 6427 | 6425 | if (ACCESSING_LSW32) |
| 6428 | 6426 | { |
| 6429 | K056832_b_word_w((offset<<1)+1, data, mem_mask); | |
| 6427 | K056832_b_word_w(machine, (offset<<1)+1, data, mem_mask); | |
| 6430 | 6428 | } |
| 6431 | 6429 | } |
| 6432 | 6430 | |
| 6433 | static int K056832_update_linemap(running_machine *machine, | |
| 6431 | static int K056832_update_linemap(running_machine *machine, | |
| 6434 | 6432 | { |
| 6435 | 6433 | #define LINE_WIDTH 512 |
| 6436 | 6434 | |
| r1877 | r1878 | |
| 6441 | 6439 | |
| 6442 | 6440 | rectangle zerorect; |
| 6443 | 6441 | tilemap *tmap; |
| 6444 | | |
| 6442 | | |
| 6445 | 6443 | UINT8 *xprdata; |
| 6446 | 6444 | const gfx_element *src_gfx; |
| 6447 | 6445 | |
| r1877 | r1878 | |
| 6536 | 6534 | #undef DRAW_PIX |
| 6537 | 6535 | } |
| 6538 | 6536 | |
| 6539 | void K056832_tilemap_draw(running_machine *machine, | |
| 6537 | void K056832_tilemap_draw(running_machine *machine, | |
| 6540 | 6538 | { |
| 6541 | 6539 | static int last_colorbase[K056832_PAGE_COUNT]; |
| 6542 | 6540 | |
| r1877 | r1878 | |
| 6817 | 6815 | |
| 6818 | 6816 | } // end of function |
| 6819 | 6817 | |
| 6820 | void K056832_tilemap_draw_dj(running_machine *machine, | |
| 6818 | void K056832_tilemap_draw_dj(running_machine *machine, | |
| 6821 | 6819 | { |
| 6822 | 6820 | static int last_colorbase[K056832_PAGE_COUNT]; |
| 6823 | 6821 | |
| r1877 | r1878 | |
| 7243 | 7241 | WRITE32_HANDLER( K054338_long_w ) |
| 7244 | 7242 | { |
| 7245 | 7243 | offset <<= 1; |
| 7246 | K054338_word_w(offset, data>>16, mem_mask>>16); | |
| 7247 | K054338_word_w(offset+1, data, mem_mask); | |
| 7244 | K054338_word_w(machine, offset, data>>16, mem_mask>>16); | |
| 7245 | K054338_word_w(machine, offset+1, data, mem_mask); | |
| 7248 | 7246 | } |
| 7249 | 7247 | |
| 7250 | 7248 | // returns a 16-bit '338 register |
| r1877 | r1878 | |
| 7271 | 7269 | } |
| 7272 | 7270 | |
| 7273 | 7271 | // K054338 BG color fill |
| 7274 | void K054338_fill_solid_bg( | |
| 7272 | void K054338_fill_solid_bg( | |
| 7275 | 7273 | { |
| 7276 | 7274 | UINT32 bgcolor; |
| 7277 | 7275 | UINT32 *pLine; |
| r1877 | r1878 | |
| 7291 | 7289 | } |
| 7292 | 7290 | |
| 7293 | 7291 | // Unified K054338/K055555 BG color fill |
| 7294 | void K054338_fill_backcolor(running_machine *machine, | |
| 7292 | void K054338_fill_backcolor(running_machine *machine, | |
| 7295 | 7293 | { |
| 7296 | 7294 | int clipx, clipy, clipw, cliph, i, dst_pitch; |
| 7297 | 7295 | int BGC_CBLK, BGC_SET; |
| r1877 | r1878 | |
| 7467 | 7465 | |
| 7468 | 7466 | chip_ptr = &K053250_info.chip[chip]; |
| 7469 | 7467 | |
| 7470 | current_frame = | |
| 7468 | current_frame = vid | |
| 7471 | 7469 | last_frame = chip_ptr->frame; |
| 7472 | 7470 | |
| 7473 | 7471 | if (limiter && current_frame == last_frame) return; // make sure we only do DMA transfer once per frame |
| r1877 | r1878 | |
| 7592 | 7590 | #if 0 |
| 7593 | 7591 | |
| 7594 | 7592 | static void K053250_pdraw_scanline8( |
| 7595 | | |
| 7593 | | |
| 7596 | 7594 | const UINT8 *src,pen_t *pens,int transparent_pen,UINT32 orient,int pri) |
| 7597 | 7595 | { |
| 7598 | 7596 | /* 8bpp destination */ |
| r1877 | r1878 | |
| 7765 | 7763 | } |
| 7766 | 7764 | } |
| 7767 | 7765 | |
| 7768 | void K053250_draw(running_machine *machine, | |
| 7766 | void K053250_draw(running_machine *machine, | |
| 7769 | 7767 | { |
| 7770 | 7768 | static int pmode[2] = {-1,-1}; |
| 7771 | 7769 | static int kc=-1, kk=0, kxx=-105, kyy=0; |
| r1877 | r1878 | |
| 7967 | 7965 | #else |
| 7968 | 7966 | |
| 7969 | 7967 | // utility function to render a clipped scanline vertically or horizontally |
| 7970 | INLINE void K053250_pdraw_scanline32( | |
| 7968 | INLINE void K053250_pdraw_scanline32( | |
| 7971 | 7969 | const rectangle *cliprect, int linepos, int scroll, int zoom, |
| 7972 | 7970 | UINT32 clipmask, UINT32 wrapmask, UINT32 orientation, int priority) |
| 7973 | 7971 | { |
| r1877 | r1878 | |
| 8134 | 8132 | #undef FIXPOINT_PRECISION_HALF |
| 8135 | 8133 | } |
| 8136 | 8134 | |
| 8137 | void K053250_draw(running_machine *machine, | |
| 8135 | void K053250_draw(running_machine *machine, | |
| 8138 | 8136 | { |
| 8139 | 8137 | struct K053250_CHIPTAG *chip_ptr; |
| 8140 | 8138 | UINT16 *line_ram; |
| r1877 | r1878 | |
| 8375 | 8373 | WRITE32_HANDLER( K053252_long_w ) |
| 8376 | 8374 | { |
| 8377 | 8375 | offset <<= 1; |
| 8378 | K053252_word_w(offset, data>>16, mem_mask>>16); | |
| 8379 | K053252_word_w(offset+1, data, mem_mask); | |
| 8376 | K053252_word_w(machine, offset, data>>16, mem_mask>>16); | |
| 8377 | K053252_word_w(machine, offset+1, data, mem_mask); | |
| 8380 | 8378 | } |
| 8381 | 8379 | |
| 8382 | 8380 | |
| r1877 | r1878 | |
| 8394 | 8392 | READ32_HANDLER( K056832_long_r ) |
| 8395 | 8393 | { |
| 8396 | 8394 | offset <<= 1; |
| 8397 | return (K056832_word_r(offset+1, 0xffff) | K056832_word_r(offset, 0xffff)<<16); | |
| 8395 | return (K056832_word_r(machine, offset+1, 0xffff) | K056832_word_r(machine, offset, 0xffff)<<16); | |
| 8398 | 8396 | } |
| 8399 | 8397 | |
| 8400 | 8398 | READ32_HANDLER( K053247_reg_long_r ) |
| 8401 | 8399 | { |
| 8402 | 8400 | offset <<= 1; |
| 8403 | return (K053247_reg_word_r(offset+1, 0xffff) | K053247_reg_word_r(offset, 0xffff)<<16); | |
| 8401 | return (K053247_reg_word_r(machine, offset+1, 0xffff) | K053247_reg_word_r(machine, offset, 0xffff)<<16); | |
| 8404 | 8402 | } |
| 8405 | 8403 | |
| 8406 | 8404 | READ32_HANDLER( K055555_long_r ) |
| 8407 | 8405 | { |
| 8408 | 8406 | offset <<= 1; |
| 8409 | return (K055555_word_r(offset+1, 0xffff) | K055555_word_r(offset, 0xffff)<<16); | |
| 8407 | return (K055555_word_r(machine, offset+1, 0xffff) | K055555_word_r(machine, offset, 0xffff)<<16); | |
| 8410 | 8408 | } |
| 8411 | 8409 | |
| 8412 | 8410 | READ16_HANDLER( K053244_reg_word_r ) { return(K053244_regs[0][offset*2]<<8|K053244_regs[0][offset*2+1]); } |
| r1877 | r1878 | |
|---|---|---|
| 167 | 167 | |
| 168 | 168 | ***************************************************************************/ |
| 169 | 169 | |
| 170 | static void draw_sprites(running_machine *machine, | |
| 170 | static void draw_sprites(running_machine *machine, | |
| 171 | 171 | { |
| 172 | 172 | UINT16 *source, *finish; |
| 173 | 173 |
| r1877 | r1878 | |
|---|---|---|
| 175 | 175 | |
| 176 | 176 | ***************************************************************************/ |
| 177 | 177 | |
| 178 | static void draw_sprites(running_machine *machine, | |
| 178 | static void draw_sprites(running_machine *machine, | |
| 179 | 179 | { |
| 180 | 180 | int offs; |
| 181 | 181 | static const rectangle spritevisiblearea = |
| r1877 | r1878 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | WRITE8_HANDLER( meadows_spriteram_w ) |
| 65 | 65 | { |
| 66 | if (spriteram[offset] != data) | |
| 67 | video_screen_update_partial(0, video_screen_get_vpos(0)); | |
| 66 | video_screen_update_now(0); | |
| 68 | 67 | spriteram[offset] = data; |
| 69 | 68 | } |
| 70 | 69 | |
| r1877 | r1878 | |
| 76 | 75 | * |
| 77 | 76 | *************************************/ |
| 78 | 77 | |
| 79 | static void draw_sprites(running_machine *machine, | |
| 78 | static void draw_sprites(running_machine *machine, | |
| 80 | 79 | { |
| 81 | 80 | int i; |
| 82 | 81 |
| r1877 | r1878 | |
|---|---|---|
| 11 | 11 | void K007121_ctrl_w(int chip,int offset,int data); |
| 12 | 12 | WRITE8_HANDLER( K007121_ctrl_0_w ); |
| 13 | 13 | WRITE8_HANDLER( K007121_ctrl_1_w ); |
| 14 | void K007121_sprites_draw(int chip, | |
| 14 | void K007121_sprites_draw(int chip, | |
| 15 | 15 | const rectangle *cliprect, const UINT8 *source,int base_color, |
| 16 | 16 | int global_x_offset,int bank_base, UINT32 pri_mask); |
| 17 | 17 | |
| r1877 | r1878 | |
| 24 | 24 | void K007342_tilemap_update(void); |
| 25 | 25 | WRITE8_HANDLER( K007342_vreg_w ); |
| 26 | 26 | void K007342_tilemap_set_enable(int layer, int enable); |
| 27 | void K007342_tilemap_draw( | |
| 27 | void K007342_tilemap_draw( | |
| 28 | 28 | int K007342_is_INT_enabled(void); |
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | void K007420_vh_start(running_machine *machine, int gfxnum, void (*callback)(int *code,int *color)); |
| 32 | 32 | READ8_HANDLER( K007420_r ); |
| 33 | 33 | WRITE8_HANDLER( K007420_w ); |
| 34 | void K007420_sprites_draw( | |
| 34 | void K007420_sprites_draw( | |
| 35 | 35 | void K007420_set_banklimit(int limit); |
| 36 | 36 | |
| 37 | 37 | |
| r1877 | r1878 | |
| 104 | 104 | WRITE8_HANDLER( K051937_w ); |
| 105 | 105 | READ16_HANDLER( K051937_word_r ); |
| 106 | 106 | WRITE16_HANDLER( K051937_word_w ); |
| 107 | void K051960_sprites_draw( | |
| 107 | void K051960_sprites_draw( | |
| 108 | 108 | int K051960_is_IRQ_enabled(void); |
| 109 | 109 | int K051960_is_NMI_enabled(void); |
| 110 | 110 | void K051960_set_sprite_offsets(int dx, int dy); |
| r1877 | r1878 | |
| 129 | 129 | READ16_HANDLER( K053244_word_r ); |
| 130 | 130 | WRITE16_HANDLER( K053244_word_w ); |
| 131 | 131 | void K053244_bankselect(int chip, int bank); /* used by TMNT2, Asterix and Premier Soccer for ROM testing */ |
| 132 | void K053245_sprites_draw(int chip, mame_bitmap *bitmap,const rectangle *cliprect); | |
| 133 | void K053245_sprites_draw_lethal(running_machine *machine, int chip, mame_bitmap *bitmap,const rectangle *cliprect); /* for lethal enforcers */ | |
| 132 | void K053245_sprites_draw(int chip, bitmap_t *bitmap,const rectangle *cliprect); | |
| 133 | void K053245_sprites_draw_lethal(running_machine *machine, int chip, bitmap_t *bitmap,const rectangle *cliprect); /* for lethal enforcers */ | |
| 134 | 134 | void K053245_clear_buffer(int chip); |
| 135 | 135 | void K053245_set_SpriteOffset(int chip,int offsx, int offsy); |
| 136 | 136 | |
| r1877 | r1878 | |
| 164 | 164 | WRITE32_HANDLER( K053247_long_w ); |
| 165 | 165 | WRITE16_HANDLER( K053247_reg_word_w ); // "OBJSET2" registers |
| 166 | 166 | WRITE32_HANDLER( K053247_reg_long_w ); |
| 167 | void K053247_sprites_draw(running_machine *machine, | |
| 167 | void K053247_sprites_draw(running_machine *machine, | |
| 168 | 168 | int K053247_read_register(int regnum); |
| 169 | 169 | void K053247_set_SpriteOffset(int offsx, int offsy); |
| 170 | 170 | void K053247_wraparound_enable(int status); |
| r1877 | r1878 | |
| 214 | 214 | WRITE8_HANDLER( K051316_ctrl_0_w ); |
| 215 | 215 | WRITE8_HANDLER( K051316_ctrl_1_w ); |
| 216 | 216 | WRITE8_HANDLER( K051316_ctrl_2_w ); |
| 217 | void K051316_zoom_draw_0(mame_bitmap *bitmap,const rectangle *cliprect,int flags,UINT32 priority); | |
| 218 | void K051316_zoom_draw_1(mame_bitmap *bitmap,const rectangle *cliprect,int flags,UINT32 priority); | |
| 219 | void K051316_zoom_draw_2(mame_bitmap *bitmap,const rectangle *cliprect,int flags,UINT32 priority); | |
| 217 | void K051316_zoom_draw_0(bitmap_t *bitmap,const rectangle *cliprect,int flags,UINT32 priority); | |
| 218 | void K051316_zoom_draw_1(bitmap_t *bitmap,const rectangle *cliprect,int flags,UINT32 priority); | |
| 219 | void K051316_zoom_draw_2(bitmap_t *bitmap,const rectangle *cliprect,int flags,UINT32 priority); | |
| 220 | 220 | void K051316_wraparound_enable(int chip, int status); |
| 221 | 221 | void K051316_set_offset(int chip, int xoffs, int yoffs); |
| 222 | 222 | |
| 223 | 223 | |
| 224 | 224 | extern UINT16 *K053936_0_ctrl,*K053936_0_linectrl; |
| 225 | 225 | extern UINT16 *K053936_1_ctrl,*K053936_1_linectrl; |
| 226 | void K053936_0_zoom_draw(mame_bitmap *bitmap,const rectangle *cliprect,tilemap *tmap,int flags,UINT32 priority); | |
| 227 | void K053936_1_zoom_draw(mame_bitmap *bitmap,const rectangle *cliprect,tilemap *tmap,int flags,UINT32 priority); | |
| 226 | void K053936_0_zoom_draw(bitmap_t *bitmap,const rectangle *cliprect,tilemap *tmap,int flags,UINT32 priority); | |
| 227 | void K053936_1_zoom_draw(bitmap_t *bitmap,const rectangle *cliprect,tilemap *tmap,int flags,UINT32 priority); | |
| 228 | 228 | void K053936_wraparound_enable(int chip, int status); |
| 229 | 229 | void K053936_set_offset(int chip, int xoffs, int yoffs); |
| 230 | 230 | |
| r1877 | r1878 | |
| 284 | 284 | WRITE8_HANDLER( K056832_b_w ); |
| 285 | 285 | void K056832_mark_plane_dirty(int num); |
| 286 | 286 | void K056832_MarkAllTilemapsDirty(void); |
| 287 | void K056832_tilemap_draw(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int num, int flags, UINT32 priority); | |
| 288 | void K056832_tilemap_draw_dj(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority); | |
| 287 | void K056832_tilemap_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int num, int flags, UINT32 priority); | |
| 288 | void K056832_tilemap_draw_dj(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority); | |
| 289 | 289 | void K056832_set_LayerAssociation(int status); |
| 290 | 290 | int K056832_get_LayerAssociation(void); |
| 291 | 291 | void K056832_set_LayerOffset(int layer, int offsx, int offsy); |
| r1877 | r1878 | |
| 391 | 391 | WRITE32_HANDLER( K054338_long_w ); |
| 392 | 392 | int K054338_read_register(int reg); |
| 393 | 393 | void K054338_update_all_shadows(running_machine *machine); // called at the beginning of VIDEO_UPDATE() |
| 394 | void K054338_fill_solid_bg(mame_bitmap *bitmap); // solid backcolor fill | |
| 395 | void K054338_fill_backcolor(running_machine *machine, mame_bitmap *bitmap, int mode); // unified fill, 0=solid, 1=gradient | |
| 394 | void K054338_fill_solid_bg(bitmap_t *bitmap); // solid backcolor fill | |
| 395 | void K054338_fill_backcolor(running_machine *machine, bitmap_t *bitmap, int mode); // unified fill, 0=solid, 1=gradient | |
| 396 | 396 | int K054338_set_alpha_level(int pblend); // blend style 0-2 |
| 397 | 397 | void K054338_invert_alpha(int invert); // 0=0x00(invis)-0x1f(solid), 1=0x1f(invis)-0x00(solod) |
| 398 | 398 | void K054338_export_config(int **shdRGB); |
| r1877 | r1878 | |
| 427 | 427 | #define K053250_WRAP500 0x01 |
| 428 | 428 | #define K053250_OVERDRIVE 0x02 |
| 429 | 429 | |
| 430 | void K053250_draw(running_machine *machine, | |
| 430 | void K053250_draw(running_machine *machine, | |
| 431 | 431 | void K053250_set_LayerOffset(int chip, int offsx, int offsy); |
| 432 | 432 | void K053250_unpack_pixels(int region); |
| 433 | 433 | void K053250_dma(int chip, int limiter); |
| r1877 | r1878 | |
|---|---|---|
| 64 | 64 | WRITE8_HANDLER( bogeyman_paletteram_w ) |
| 65 | 65 | { |
| 66 | 66 | /* RGB output is inverted */ |
| 67 | paletteram_BBGGGRRR_w(offset, ~data); | |
| 67 | paletteram_BBGGGRRR_w(machine, offset, ~data); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | static TILE_GET_INFO( get_bg_tile_info ) |
| r1877 | r1878 | |
| 98 | 98 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | static void draw_sprites(running_machine *machine, | |
| 101 | static void draw_sprites(running_machine *machine, | |
| 102 | 102 | { |
| 103 | 103 | int offs; |
| 104 | 104 |
| r1877 | r1878 | |
|---|---|---|
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | |
| 463 | void harddriv_scanline_driver(running_machine *machine, int screen, | |
| 463 | void harddriv_scanline_driver(running_machine *machine, int screen, | |
| 464 | 464 | { |
| 465 | 465 | UINT8 *vram_base = &hdgsp_vram[(params->rowaddr << 12) & vram_mask]; |
| 466 | 466 | UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0); |
| r1877 | r1878 | |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | |
| 478 | void harddriv_scanline_multisync(running_machine *machine, int screen, | |
| 478 | void harddriv_scanline_multisync(running_machine *machine, int screen, | |
| 479 | 479 | { |
| 480 | 480 | UINT8 *vram_base = &hdgsp_vram[(params->rowaddr << 11) & vram_mask]; |
| 481 | 481 | UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0); |
| r1877 | r1878 | |
|---|---|---|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
| 48 | static void srmp2_draw_sprites(running_machine *machine, | |
| 48 | static void srmp2_draw_sprites(running_machine *machine, | |
| 49 | 49 | { |
| 50 | 50 | /* |
| 51 | 51 | Sprite RAM A: spriteram16_2 |
| r1877 | r1878 | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | |
| 121 | static void srmp3_draw_sprites_map(running_machine *machine, | |
| 121 | static void srmp3_draw_sprites_map(running_machine *machine, | |
| 122 | 122 | { |
| 123 | 123 | int offs, col; |
| 124 | 124 | int xoffs, yoffs; |
| r1877 | r1878 | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | |
| 194 | static void srmp3_draw_sprites(running_machine *machine, | |
| 194 | static void srmp3_draw_sprites(running_machine *machine, | |
| 195 | 195 | { |
| 196 | 196 | /* |
| 197 | 197 | Sprite RAM A: spriteram_2 |
| r1877 | r1878 | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
| 278 | static void mjyuugi_draw_sprites_map(running_machine *machine, | |
| 278 | static void mjyuugi_draw_sprites_map(running_machine *machine, | |
| 279 | 279 | { |
| 280 | 280 | int offs, col; |
| 281 | 281 | int xoffs, yoffs; |
| r1877 | r1878 | |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | |
| 358 | static void mjyuugi_draw_sprites(running_machine *machine, | |
| 358 | static void mjyuugi_draw_sprites(running_machine *machine, | |
| 359 | 359 | { |
| 360 | 360 | /* |
| 361 | 361 | Sprite RAM A: spriteram16_2 |
| r1877 | r1878 | |
|---|---|---|
| 401 | 401 | |
| 402 | 402 | ***************************************************************************/ |
| 403 | 403 | |
| 404 | static void m72_draw_sprites(running_machine *machine, | |
| 404 | static void m72_draw_sprites(running_machine *machine, | |
| 405 | 405 | { |
| 406 | 406 | int offs; |
| 407 | 407 | |
| r1877 | r1878 | |
| 454 | 454 | } |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | static void majtitle_draw_sprites(running_machine *machine, | |
| 457 | static void majtitle_draw_sprites(running_machine *machine, | |
| 458 | 458 | { |
| 459 | 459 | int offs; |
| 460 | 460 |
| r1877 | r1878 | |
|---|---|---|
| 33 | 33 | 8, 8, 32, 32); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | static void draw_sprites(running_machine *machine, | |
| 36 | static void draw_sprites(running_machine *machine, | |
| 37 | 37 | { |
| 38 | 38 | int offs; |
| 39 | 39 |
| r1877 | r1878 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | ***************************************************************************/ |
| 81 | 81 | |
| 82 | static void draw_sprites(running_machine *machine, | |
| 82 | static void draw_sprites(running_machine *machine, | |
| 83 | 83 | { |
| 84 | 84 | int offs; |
| 85 | 85 |
| r1877 | r1878 | |
|---|---|---|
| 143 | 143 | |
| 144 | 144 | ***************************************************************************/ |
| 145 | 145 | |
| 146 | static void draw_sprites(running_machine *machine, | |
| 146 | static void draw_sprites(running_machine *machine, | |
| 147 | 147 | { |
| 148 | 148 | int offs,mx,my,color,tile,fx,fy,i; |
| 149 | 149 | |
| r1877 | r1878 | |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | |
| 220 | static void draw_sprites2(running_machine *machine, | |
| 220 | static void draw_sprites2(running_machine *machine, | |
| 221 | 221 | { |
| 222 | 222 | int offs,mx,my,color,tile,fx,fy,i; |
| 223 | 223 |
| r1877 | r1878 | |
|---|---|---|
| 31 | 31 | static tilemap *tilemap_edge1[4]; |
| 32 | 32 | static tilemap *tilemap_edge2[4]; |
| 33 | 33 | |
| 34 | static | |
| 34 | static | |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | static PALETTE_INIT( madalien ) |
| r1877 | r1878 | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | |
| 87 | WRITE8_HANDLER( madalien_mc6845_address_w ) | |
| 88 | { | |
| 89 | mc6845_address_w(mc6845, data); | |
| 90 | } | |
| 91 | ||
| 92 | READ8_HANDLER( madalien_mc6845_register_r ) | |
| 93 | { | |
| 94 | return mc6845_register_r(mc6845); | |
| 95 | } | |
| 96 | ||
| 97 | WRITE8_HANDLER( madalien_mc6845_register_w ) | |
| 98 | { | |
| 99 | mc6845_register_w(mc6845, data); | |
| 100 | } | |
| 101 | ||
| 102 | ||
| 103 | 87 | INLINE int scan_helper(int col, int row, int section) |
| 104 | 88 | { |
| 105 | 89 | return (section << 8) | ((~col & 0x0f) << 3) | row; |
| r1877 | r1878 | |
| 150 | 134 | { |
| 151 | 135 | int i; |
| 152 | 136 | |
| 153 | static const tilemap_mapper_c | |
| 137 | static const tilemap_mapper_func | |
| 154 | 138 | { |
| 155 | 139 | scan_mode0, scan_mode1, scan_mode2, scan_mode3 |
| 156 | 140 | }; |
| r1877 | r1878 | |
| 185 | 169 | } |
| 186 | 170 | |
| 187 | 171 | |
| 188 | static void draw_edges( | |
| 172 | static void draw_edges( | |
| 189 | 173 | { |
| 190 | 174 | rectangle clip_edge1; |
| 191 | 175 | rectangle clip_edge2; |
| r1877 | r1878 | |
| 223 | 207 | } |
| 224 | 208 | |
| 225 | 209 | |
| 226 | static void draw_headlight( | |
| 210 | static void draw_headlight( | |
| 227 | 211 | { |
| 228 | 212 | if (BIT(*madalien_video_flags, 0)) |
| 229 | 213 | { |
| r1877 | r1878 | |
| 258 | 242 | } |
| 259 | 243 | |
| 260 | 244 | |
| 261 | static void draw_foreground(running_machine *machine, | |
| 245 | static void draw_foreground(running_machine *machine, | |
| 262 | 246 | { |
| 263 | 247 | int i; |
| 264 | 248 | |
| r1877 | r1878 | |
| 404 | 388 | NULL, /* before pixel update callback */ |
| 405 | 389 | NULL, /* row update callback */ |
| 406 | 390 | NULL, /* after pixel update callback */ |
| 407 | NULL /* call back for display state changes */ | |
| 391 | NULL, /* callback for display state changes */ | |
| 392 | NULL, /* HSYNC callback */ | |
| 393 | NULL /* VSYNC callback */ | |
| 408 | 394 | }; |
| 409 | 395 | |
| 410 | 396 |
| r1877 | r1878 | |
|---|---|---|
| 117 | 117 | |
| 118 | 118 | ***************************************************************************/ |
| 119 | 119 | |
| 120 | static void draw_sprites(running_machine *machine, | |
| 120 | static void draw_sprites(running_machine *machine, | |
| 121 | 121 | { |
| 122 | 122 | int offs; |
| 123 | 123 |
| r1877 | r1878 | |
|---|---|---|
| 209 | 209 | |
| 210 | 210 | ***************************************************************************/ |
| 211 | 211 | |
| 212 | static void draw_sprites(running_machine *machine, | |
| 212 | static void draw_sprites(running_machine *machine, | |
| 213 | 213 | { |
| 214 | 214 | int offs; |
| 215 | 215 |
| r1877 | r1878 | |
|---|---|---|
| 151 | 151 | |
| 152 | 152 | ***************************************************************************/ |
| 153 | 153 | |
| 154 | static void draw_sprites(running_machine *machine, | |
| 154 | static void draw_sprites(running_machine *machine, | |
| 155 | 155 | { |
| 156 | 156 | UINT8 *s = spriteram, *end = s + spriteram_size; |
| 157 | 157 |
| r1877 | r1878 | |
|---|---|---|
| 76 | 76 | tilemap_set_transparent_pen(oneshot_fg_tilemap,0); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | static void draw_crosshairs( | |
| 79 | static void draw_crosshairs( | |
| 80 | 80 | { |
| 81 | 81 | int xpos,ypos; |
| 82 | 82 | /* get gun raw coordonates (player 1) */ |
| r1877 | r1878 | |
| 106 | 106 | gun_x_p2=0; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | static void draw_sprites(running_machine *machine, | |
| 109 | static void draw_sprites(running_machine *machine, | |
| 110 | 110 | { |
| 111 | 111 | const UINT16 *source = oneshot_sprites; |
| 112 | 112 | const UINT16 *finish = source+(0x1000/2); |
| r1877 | r1878 | |
|---|---|---|
| 95 | 95 | |
| 96 | 96 | /* sprites - quite a bit still needs doing .. */ |
| 97 | 97 | |
| 98 | static void draw_sprites(running_machine *machine, | |
| 98 | static void draw_sprites(running_machine *machine, | |
| 99 | 99 | { |
| 100 | 100 | |
| 101 | 101 | const UINT16 *source = stlforce_spriteram+0x0; |
| r1877 | r1878 | |
|---|---|---|
| 35 | 35 | |
| 36 | 36 | ********************************************************************************/ |
| 37 | 37 | |
| 38 | static void draw_sprites(running_machine *machine, | |
| 38 | static void draw_sprites(running_machine *machine, | |
| 39 | 39 | { |
| 40 | 40 | int offs,map_offset,x,y,curx,cury,sprite_chunk; |
| 41 | 41 | UINT16 *spritemap = topspeed_spritemap; |
| r1877 | r1878 | |
|---|---|---|
| 21 | 21 | WRITE8_HANDLER( amspdwy_paletteram_w ) |
| 22 | 22 | { |
| 23 | 23 | data ^= 0xff; |
| 24 | paletteram_BBGGGRRR_w(offset,data); | |
| 24 | paletteram_BBGGGRRR_w(machine,offset,data); | |
| 25 | 25 | // paletteram_RRRGGGBB_w(offset,data); |
| 26 | 26 | } |
| 27 | 27 | |
| r1877 | r1878 | |
| 102 | 102 | |
| 103 | 103 | ***************************************************************************/ |
| 104 | 104 | |
| 105 | static void draw_sprites(running_machine *machine, | |
| 105 | static void draw_sprites(running_machine *machine, | |
| 106 | 106 | { |
| 107 | 107 | int i; |
| 108 | 108 | int max_x = machine->screen[0].width - 1; |
| r1877 | r1878 | |
|---|---|---|
| 60 | 60 | |
| 61 | 61 | #include "driver.h" |
| 62 | 62 | |
| 63 | static void draw_sprites(running_machine *machine, | |
| 63 | static void draw_sprites(running_machine *machine, | |
| 64 | 64 | { |
| 65 | 65 | UINT8 *indx_ram = spriteram + 0x2000, // this ram contains indexes into offs_ram |
| 66 | 66 | *offs_ram = spriteram + 0x2400, // this ram contains x,y offsets or indexes into spriteram_2 |
| r1877 | r1878 | |
|---|---|---|
| 215 | 215 | video_screen_update_partial(0, video_screen_get_vpos(0)); |
| 216 | 216 | |
| 217 | 217 | /* update the data */ |
| 218 | atarimo_0_slipram_w(offset, data, mem_mask); | |
| 218 | atarimo_0_slipram_w(machine, offset, data, mem_mask); | |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | |
| r1877 | r1878 | |
| 229 | 229 | VIDEO_UPDATE( toobin ) |
| 230 | 230 | { |
| 231 | 231 | struct atarimo_rect_list rectlist; |
| 232 | | |
| 232 | | |
| 233 | 233 | int x, y, r; |
| 234 | 234 | |
| 235 | 235 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 112 | 112 | |
| 113 | 113 | ***************************************************************************/ |
| 114 | 114 | |
| 115 | static void draw_sprites(running_machine *machine, | |
| 115 | static void draw_sprites(running_machine *machine, | |
| 116 | 116 | { |
| 117 | 117 | int offs; |
| 118 | 118 | |
| r1877 | r1878 | |
| 170 | 170 | |
| 171 | 171 | VIDEO_EOF( srumbler ) |
| 172 | 172 | { |
| 173 | buffer_spriteram_w(0,0); | |
| 173 | buffer_spriteram_w(machine,0,0); | |
| 174 | 174 | } |
| r1877 | r1878 | |
|---|---|---|
| 222 | 222 | |
| 223 | 223 | *************************************************************************/ |
| 224 | 224 | |
| 225 | static void draw_sprites(running_machine *machine, | |
| 225 | static void draw_sprites(running_machine *machine, | |
| 226 | 226 | { |
| 227 | 227 | int offs,fx,fy,x,y,color,sprite,cur_pri; |
| 228 | 228 | int dx,dy,ax,ay; |
| r1877 | r1878 | |
|---|---|---|
| 82 | 82 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | static void draw_sprites(running_machine *machine, | |
| 85 | static void draw_sprites(running_machine *machine, | |
| 86 | 86 | { |
| 87 | 87 | int offs; |
| 88 | 88 |
| r1877 | r1878 | |
|---|---|---|
| 186 | 186 | * |
| 187 | 187 | *************************************/ |
| 188 | 188 | |
| 189 | static void mcr68_update_sprites(running_machine *machine, | |
| 189 | static void mcr68_update_sprites(running_machine *machine, | |
| 190 | 190 | { |
| 191 | 191 | rectangle sprite_clip = machine->screen[0].visarea; |
| 192 | 192 | int offs; |
| r1877 | r1878 | |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | |
| 241 | static void zwackery_update_sprites(running_machine *machine, | |
| 241 | static void zwackery_update_sprites(running_machine *machine, | |
| 242 | 242 | { |
| 243 | 243 | int offs; |
| 244 | 244 |
| r1877 | r1878 | |
|---|---|---|
| 125 | 125 | tilemap_mark_tile_dirty(bg_tilemap, offset); |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | WRITE8_HANDLER( funworld_mc6845_address_w ) | |
| 129 | { | |
| 130 | mc6845_address_w(mc6845, data); | |
| 131 | } | |
| 132 | ||
| 133 | READ8_HANDLER( funworld_mc6845_register_r ) | |
| 134 | { | |
| 135 | return mc6845_register_r(mc6845); | |
| 136 | } | |
| 137 | ||
| 138 | WRITE8_HANDLER( funworld_mc6845_register_w ) | |
| 139 | { | |
| 140 | mc6845_register_w(mc6845, data); | |
| 141 | } | |
| 142 | ||
| 143 | 128 | /**** normal hardware limit **** |
| 144 | 129 | - bits - |
| 145 | 130 | 7654 3210 |
| r1877 | r1878 | |
|---|---|---|
| 163 | 163 | 8, 8, 32, 64); |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | static void draw_sprites(running_machine *machine, | |
| 166 | static void draw_sprites(running_machine *machine, | |
| 167 | 167 | { |
| 168 | 168 | int offs; |
| 169 | 169 |
| r1877 | r1878 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "deprecat.h" | |
| 11 | 10 | #include "video/resnet.h" |
| 12 | 11 | |
| 13 | 12 | #include "includes/mario.h" |
| r1877 | r1878 | |
| 80 | 79 | |
| 81 | 80 | WRITE8_HANDLER( mario_videoram_w ) |
| 82 | 81 | { |
| 83 | mario_state *state = | |
| 82 | mario_state *state = machine->driver_data; | |
| 84 | 83 | |
| 85 | 84 | state->videoram[offset] = data; |
| 86 | 85 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); |
| r1877 | r1878 | |
| 88 | 87 | |
| 89 | 88 | WRITE8_HANDLER( mario_gfxbank_w ) |
| 90 | 89 | { |
| 91 | mario_state *state = | |
| 90 | mario_state *state = machine->driver_data; | |
| 92 | 91 | |
| 93 | 92 | if (state->gfx_bank != (data & 0x01)) |
| 94 | 93 | { |
| r1877 | r1878 | |
| 99 | 98 | |
| 100 | 99 | WRITE8_HANDLER( mario_palettebank_w ) |
| 101 | 100 | { |
| 102 | mario_state *state = | |
| 101 | mario_state *state = machine->driver_data; | |
| 103 | 102 | |
| 104 | 103 | if (state->palette_bank != (data & 0x01)) |
| 105 | 104 | { |
| r1877 | r1878 | |
| 110 | 109 | |
| 111 | 110 | WRITE8_HANDLER( mario_scroll_w ) |
| 112 | 111 | { |
| 113 | mario_state *state = | |
| 112 | mario_state *state = machine->driver_data; | |
| 114 | 113 | |
| 115 | 114 | state->gfx_scroll = data + 17; |
| 116 | 115 | } |
| 117 | 116 | |
| 118 | 117 | WRITE8_HANDLER( mario_flip_w ) |
| 119 | 118 | { |
| 120 | mario_state *state = | |
| 119 | mario_state *state = machine->driver_data; | |
| 121 | 120 | |
| 122 | 121 | if (state->flip != (data & 0x01)) |
| 123 | 122 | { |
| r1877 | r1878 | |
| 132 | 131 | |
| 133 | 132 | static TILE_GET_INFO( get_bg_tile_info ) |
| 134 | 133 | { |
| 135 | mario_state *state = | |
| 134 | mario_state *state = machine->driver_data; | |
| 136 | 135 | int code = state->videoram[tile_index] + 256 * state->gfx_bank; |
| 137 | 136 | int color; |
| 138 | 137 | |
| r1877 | r1878 | |
| 162 | 161 | * confirmed on mametests.org as being present on real PCB as well. |
| 163 | 162 | */ |
| 164 | 163 | |
| 165 | static void draw_sprites(running_machine *machine, | |
| 164 | static void draw_sprites(running_machine *machine, | |
| 166 | 165 | { |
| 167 | mario_state *state = | |
| 166 | mario_state *state = machine->driver_data; | |
| 168 | 167 | int offs; |
| 169 | 168 | |
| 170 | 169 | for (offs = 0;offs < state->spriteram_size;offs += 4) |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | K053247_vh_start(machine,REGION_GFX2,53,-2,NORMAL_PLANE_ORDER,xmen_sprite_callback); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | static mame_bitmap * screen_right; | |
| 58 | static mame_bitmap * screen_left; | |
| 57 | static bitmap_t * screen_right; | |
| 58 | static bitmap_t * screen_left; | |
| 59 | 59 | static UINT16 *K053247_ram; |
| 60 | 60 | |
| 61 | 61 | VIDEO_START( xmen6p ) |
| r1877 | r1878 | |
| 166 | 166 | VIDEO_EOF( xmen6p ) |
| 167 | 167 | { |
| 168 | 168 | int layer[3]; |
| 169 | | |
| 169 | | |
| 170 | 170 | rectangle cliprect; |
| 171 | 171 | int offset; |
| 172 | 172 | |
| r1877 | r1878 | |
| 198 | 198 | for (offset=0;offset<(0xc000/2);offset++) |
| 199 | 199 | { |
| 200 | 200 | // K052109_lsb_w |
| 201 | K052109_w(offset,xmen6p_tilemapright[offset]&0x00ff); | |
| 201 | K052109_w(machine,offset,xmen6p_tilemapright[offset]&0x00ff); | |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | |
| r1877 | r1878 | |
| 217 | 217 | for (offset=0;offset<(0xc000/2);offset++) |
| 218 | 218 | { |
| 219 | 219 | // K052109_lsb_w |
| 220 | K052109_w(offset,xmen6p_tilemapleft[offset]&0x00ff); | |
| 220 | K052109_w(machine,offset,xmen6p_tilemapleft[offset]&0x00ff); | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 |
| r1877 | r1878 | |
|---|---|---|
| 106 | 106 | |
| 107 | 107 | |
| 108 | 108 | |
| 109 | static void draw_playfield_and_alpha(running_machine *machine, | |
| 109 | static void draw_playfield_and_alpha(running_machine *machine, | |
| 110 | 110 | int playfield_x_offset, int playfield_y_offset) |
| 111 | 111 | { |
| 112 | 112 | static const rectangle bigfield_area = { 4*8, 34*8-1, 0*8, 32*8-1 }; |
| r1877 | r1878 | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | |
| 126 | static void draw_sprites(running_machine *machine, | |
| 126 | static void draw_sprites(running_machine *machine, | |
| 127 | 127 | int gfx, int is_soccer) |
| 128 | 128 | { |
| 129 | 129 | static const rectangle bigfield_area = { 4*8, 34*8-1, 0*8, 32*8-1 }; |
| r1877 | r1878 | |
|---|---|---|
| 9 | 9 | static tilemap *fg_tilemap,*fg2_tilemap,*fg3_tilemap; |
| 10 | 10 | extern UINT32 *silkroad_vidram,*silkroad_vidram2,*silkroad_vidram3, *silkroad_sprram, *silkroad_regs; |
| 11 | 11 | |
| 12 | static void draw_sprites(running_machine *machine, | |
| 12 | static void draw_sprites(running_machine *machine, | |
| 13 | 13 | { |
| 14 | 14 | const gfx_element *gfx = machine->gfx[0]; |
| 15 | 15 | UINT32 *source = silkroad_sprram; |
| r1877 | r1878 | |
|---|---|---|
| 92 | 92 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | static void draw_sprites(running_machine *machine, | |
| 95 | static void draw_sprites(running_machine *machine, | |
| 96 | 96 | { |
| 97 | 97 | int offs; |
| 98 | 98 |
| r1877 | r1878 | |
|---|---|---|
| 17 | 17 | UINT16 *tecmo16_charram; |
| 18 | 18 | |
| 19 | 19 | static tilemap *fg_tilemap,*bg_tilemap,*tx_tilemap; |
| 20 | static | |
| 20 | static | |
| 21 | 21 | |
| 22 | 22 | static int flipscreen, game_is_riot; |
| 23 | 23 | |
| r1877 | r1878 | |
| 212 | 212 | |
| 213 | 213 | /* mix & blend the paletted 16-bit tile and sprite bitmaps into an RGB 32-bit bitmap */ |
| 214 | 214 | static void blendbitmaps(running_machine *machine, |
| 215 | | |
| 215 | | |
| 216 | 216 | int sx,int sy,const rectangle *clip) |
| 217 | 217 | { |
| 218 | 218 | int ox; |
| r1877 | r1878 | |
| 320 | 320 | } |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | static void draw_sprites(running_machine *machine, | |
| 323 | static void draw_sprites(running_machine *machine, | |
| 324 | 324 | { |
| 325 | 325 | int offs; |
| 326 | 326 | static const UINT8 layout[8][8] = |
| r1877 | r1878 | |
| 335 | 335 | {42,43,46,47,58,59,62,63} |
| 336 | 336 | }; |
| 337 | 337 | |
| 338 | | |
| 338 | | |
| 339 | 339 | |
| 340 | 340 | for (offs = spriteram_size/2 - 8;offs >= 0;offs -= 8) |
| 341 | 341 | { |
| r1877 | r1878 | |
|---|---|---|
| 125 | 125 | WRITE8_HANDLER( naughtyb_videoreg_w ) |
| 126 | 126 | { |
| 127 | 127 | // bits 4+5 control the sound circuit |
| 128 | pleiads_sound_control_c_w(machine,offset,data); | |
| 128 | 129 | |
| 129 | pleiads_sound_control_c_w(offset,data); | |
| 130 | ||
| 131 | 130 | naughtyb_cocktail = |
| 132 | ( ( input_port_2_r(0) & 0x80 ) && // cabinet == cocktail | |
| 131 | ( ( input_port_2_r(machine,0) & 0x80 ) && // cabinet == cocktail | |
| 133 | 132 | ( data & 0x01 ) ); // handling player 2 |
| 134 | 133 | palreg = (data >> 1) & 0x03; // pallette sel is bit 1 & 2 |
| 135 | 134 | bankreg = (data >> 2) & 0x01; // banksel is just bit 2 |
| r1877 | r1878 | |
| 138 | 137 | WRITE8_HANDLER( popflame_videoreg_w ) |
| 139 | 138 | { |
| 140 | 139 | // bits 4+5 control the sound circuit |
| 140 | pleiads_sound_control_c_w(machine,offset,data); | |
| 141 | 141 | |
| 142 | pleiads_sound_control_c_w(offset,data); | |
| 143 | ||
| 144 | 142 | naughtyb_cocktail = |
| 145 | ( ( input_port_2_r(0) & 0x80 ) && // cabinet == cocktail | |
| 143 | ( ( input_port_2_r(machine,0) & 0x80 ) && // cabinet == cocktail | |
| 146 | 144 | ( data & 0x01 ) ); // handling player 2 |
| 147 | 145 | palreg = (data >> 1) & 0x03; // pallette sel is bit 1 & 2 |
| 148 | 146 | bankreg = (data >> 3) & 0x01; // banksel is just bit 3 |
| r1877 | r1878 | |
|---|---|---|
| 174 | 174 | toypop_bg_image[2*offset+1] = (data & 0xf) | ((data & 0xf0) << 4); |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | static void draw_background( | |
| 177 | static void draw_background( | |
| 178 | 178 | { |
| 179 | 179 | int offs, x, y; |
| 180 | 180 | UINT16 scanline[288]; |
| r1877 | r1878 | |
| 222 | 222 | ***************************************************************************/ |
| 223 | 223 | |
| 224 | 224 | /* from mappy.c */ |
| 225 | void mappy_draw_sprites(running_machine *machine, | |
| 225 | void mappy_draw_sprites(running_machine *machine, | |
| 226 | 226 | |
| 227 | 227 | |
| 228 | 228 | VIDEO_UPDATE( toypop ) |
| r1877 | r1878 | |
|---|---|---|
| 15 | 15 | ***************************************************************************/ |
| 16 | 16 | |
| 17 | 17 | #include "driver.h" |
| 18 | #include "deprecat.h" | |
| 19 | 18 | |
| 20 | 19 | static UINT16 tumblepb_control_0[8]; |
| 21 | 20 | UINT16 *tumblepb_pf1_data,*tumblepb_pf2_data; |
| r1877 | r1878 | |
| 30 | 29 | |
| 31 | 30 | /******************************************************************************/ |
| 32 | 31 | |
| 33 | static void tumblepb_draw_sprites(running_machine *machine, | |
| 32 | static void tumblepb_draw_sprites(running_machine *machine, | |
| 34 | 33 | { |
| 35 | 34 | int offs; |
| 36 | 35 | |
| r1877 | r1878 | |
| 43 | 42 | |
| 44 | 43 | y = spriteram16[offs]; |
| 45 | 44 | flash=y&0x1000; |
| 46 | if (flash && ( | |
| 45 | if (flash && (vid | |
| 47 | 46 | |
| 48 | 47 | x = spriteram16[offs+2]; |
| 49 | 48 | colour = (x >>9) & 0xf; |
| r1877 | r1878 | |
| 92 | 91 | } |
| 93 | 92 | } |
| 94 | 93 | |
| 95 | static void jumpkids_draw_sprites(running_machine *machine, | |
| 94 | static void jumpkids_draw_sprites(running_machine *machine, | |
| 96 | 95 | { |
| 97 | 96 | int offs; |
| 98 | 97 | |
| r1877 | r1878 | |
| 105 | 104 | |
| 106 | 105 | y = spriteram16[offs]; |
| 107 | 106 | flash=y&0x1000; |
| 108 | if (flash && ( | |
| 107 | if (flash && (vid | |
| 109 | 108 | |
| 110 | 109 | x = spriteram16[offs+2]; |
| 111 | 110 | colour = (x >>9) & 0xf; |
| r1877 | r1878 | |
| 154 | 153 | } |
| 155 | 154 | } |
| 156 | 155 | |
| 157 | static void fncywld_draw_sprites(running_machine *machine, | |
| 156 | static void fncywld_draw_sprites(running_machine *machine, | |
| 158 | 157 | { |
| 159 | 158 | int offs; |
| 160 | 159 | |
| r1877 | r1878 | |
| 167 | 166 | |
| 168 | 167 | y = spriteram16[offs]; |
| 169 | 168 | flash=y&0x1000; |
| 170 | if (flash && ( | |
| 169 | if (flash && (vid | |
| 171 | 170 | |
| 172 | 171 | x = spriteram16[offs+2]; |
| 173 | 172 | colour = (x >>9) & 0x3f; |
| r1877 | r1878 | |
|---|---|---|
| 69 | 69 | } |
| 70 | 70 | /****************************************************************************/ |
| 71 | 71 | |
| 72 | static void momoko_draw_bg_pri( | |
| 72 | static void momoko_draw_bg_pri( | |
| 73 | 73 | { |
| 74 | 74 | int xx,sx,sy,px,py,dot; |
| 75 | 75 | UINT32 gfxadr; |
| r1877 | r1878 | |
|---|---|---|
| 65 | 65 | 3 XXXXXXXX |
| 66 | 66 | */ |
| 67 | 67 | |
| 68 | static void kchamp_draw_sprites(running_machine *machine, | |
| 68 | static void kchamp_draw_sprites(running_machine *machine, | |
| 69 | 69 | { |
| 70 | 70 | int offs; |
| 71 | 71 | |
| r1877 | r1878 | |
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | static void kchampvs_draw_sprites(running_machine *machine, | |
| 96 | static void kchampvs_draw_sprites(running_machine *machine, | |
| 97 | 97 | { |
| 98 | 98 | int offs; |
| 99 | 99 |
| r1877 | r1878 | |
|---|---|---|
| 254 | 254 | 0*8, 28*8-1 |
| 255 | 255 | }; |
| 256 | 256 | |
| 257 | static void draw_sprites(running_machine* machine, | |
| 257 | static void draw_sprites(running_machine* machine, | |
| 258 | 258 | { |
| 259 | 259 | int offs; |
| 260 | 260 |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | static tilemap* playfield; |
| 12 | 12 | |
| 13 | static | |
| 13 | static | |
| 14 | 14 | |
| 15 | 15 | int ultratnk_collision[4]; |
| 16 | 16 | |
| r1877 | r1878 | |
| 140 | 140 | |
| 141 | 141 | /* update sound status */ |
| 142 | 142 | |
| 143 | discrete_sound_w(ULTRATNK_MOTOR_DATA_1, videoram[0x391] & 15); | |
| 144 | discrete_sound_w(ULTRATNK_MOTOR_DATA_2, videoram[0x393] & 15); | |
| 143 | discrete_sound_w(machine, ULTRATNK_MOTOR_DATA_1, videoram[0x391] & 15); | |
| 144 | discrete_sound_w(machine, ULTRATNK_MOTOR_DATA_2, videoram[0x393] & 15); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 |
| r1877 | r1878 | |
|---|---|---|
| 66 | 66 | state_save_register_global_array(m90_video_control_data); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | static void draw_sprites(running_machine *machine, | |
| 69 | static void draw_sprites(running_machine *machine, | |
| 70 | 70 | { |
| 71 | 71 | int offs; |
| 72 | 72 | |
| r1877 | r1878 | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | #if 0 |
| 104 | static void bootleg_draw_sprites(running_machine *machine, | |
| 104 | static void bootleg_draw_sprites(running_machine *machine, | |
| 105 | 105 | { |
| 106 | 106 | int offs; |
| 107 | 107 |
| r1877 | r1878 | |
|---|---|---|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /* Same as Jailbreak + palette bank */ |
| 97 | static void draw_sprites(running_machine *machine, | |
| 97 | static void draw_sprites(running_machine *machine, | |
| 98 | 98 | { |
| 99 | 99 | int i; |
| 100 | 100 |
| r1877 | r1878 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | ********************************************************/ |
| 71 | 71 | |
| 72 | static void draw_sprites(running_machine *machine, | |
| 72 | static void draw_sprites(running_machine *machine, | |
| 73 | 73 | { |
| 74 | 74 | UINT16 *spritemap = (UINT16 *)memory_region(REGION_USER1); |
| 75 | 75 | int offs, data, tilenum, color, flipx, flipy; |
| r1877 | r1878 | |
|---|---|---|
| 167 | 167 | ********************************************************/ |
| 168 | 168 | |
| 169 | 169 | |
| 170 | static void contcirc_draw_sprites_16x8(running_machine *machine, | |
| 170 | static void contcirc_draw_sprites_16x8(running_machine *machine, | |
| 171 | 171 | { |
| 172 | 172 | UINT16 *spritemap = (UINT16 *)memory_region(REGION_USER1); |
| 173 | 173 | int offs, data, tilenum, color, flipx, flipy; |
| r1877 | r1878 | |
| 259 | 259 | |
| 260 | 260 | |
| 261 | 261 | |
| 262 | static void chasehq_draw_sprites_16x16(running_machine *machine, | |
| 262 | static void chasehq_draw_sprites_16x16(running_machine *machine, | |
| 263 | 263 | { |
| 264 | 264 | UINT16 *spritemap = (UINT16 *)memory_region(REGION_USER1); |
| 265 | 265 | int offs, data, tilenum, color, flipx, flipy; |
| r1877 | r1878 | |
| 444 | 444 | |
| 445 | 445 | |
| 446 | 446 | |
| 447 | static void bshark_draw_sprites_16x8(running_machine *machine, | |
| 447 | static void bshark_draw_sprites_16x8(running_machine *machine, | |
| 448 | 448 | { |
| 449 | 449 | UINT16 *spritemap = (UINT16 *)memory_region(REGION_USER1); |
| 450 | 450 | int offs, data, tilenum, color, flipx, flipy; |
| r1877 | r1878 | |
| 537 | 537 | |
| 538 | 538 | |
| 539 | 539 | |
| 540 | static void sci_draw_sprites_16x8(running_machine *machine, | |
| 540 | static void sci_draw_sprites_16x8(running_machine *machine, | |
| 541 | 541 | { |
| 542 | 542 | UINT16 *spritemap = (UINT16 *)memory_region(REGION_USER1); |
| 543 | 543 | int offs, start_offs, data, tilenum, color, flipx, flipy; |
| r1877 | r1878 | |
| 639 | 639 | |
| 640 | 640 | |
| 641 | 641 | |
| 642 | static void aquajack_draw_sprites_16x8(running_machine *machine, | |
| 642 | static void aquajack_draw_sprites_16x8(running_machine *machine, | |
| 643 | 643 | { |
| 644 | 644 | UINT16 *spritemap = (UINT16 *)memory_region(REGION_USER1); |
| 645 | 645 | int offs, data, tilenum, color, flipx, flipy; |
| r1877 | r1878 | |
| 731 | 731 | |
| 732 | 732 | |
| 733 | 733 | |
| 734 | static void spacegun_draw_sprites_16x8(running_machine *machine, | |
| 734 | static void spacegun_draw_sprites_16x8(running_machine *machine, | |
| 735 | 735 | { |
| 736 | 736 | UINT16 *spritemap = (UINT16 *)memory_region(REGION_USER1); |
| 737 | 737 | int offs, data, tilenum, color, flipx, flipy; |
| r1877 | r1878 | |
|---|---|---|
| 234 | 234 | videoram_pg_index = data & 1; |
| 235 | 235 | memory_set_bank(1, videoram_pg_index); |
| 236 | 236 | |
| 237 | cocktail_mode = videoram_pg_index && (input_port_3_r(0) & 0x01); | |
| 237 | cocktail_mode = videoram_pg_index && (input_port_3_r(machine,0) & 0x01); | |
| 238 | 238 | |
| 239 | 239 | tilemap_set_flip(ALL_TILEMAPS, cocktail_mode ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); |
| 240 | 240 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| r1877 | r1878 | |
| 257 | 257 | videoram_pg_index = data & 1; |
| 258 | 258 | memory_set_bank(1, videoram_pg_index); |
| 259 | 259 | |
| 260 | cocktail_mode = videoram_pg_index && (input_port_3_r(0) & 0x01); | |
| 260 | cocktail_mode = videoram_pg_index && (input_port_3_r(machine,0) & 0x01); | |
| 261 | 261 | |
| 262 | 262 | tilemap_set_flip(ALL_TILEMAPS, cocktail_mode ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); |
| 263 | 263 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); |
| r1877 | r1878 | |
| 280 | 280 | pleiads_protection_question = data & 0xfc; |
| 281 | 281 | |
| 282 | 282 | /* send two bits to sound control C (not sure if they are there) */ |
| 283 | pleiads_sound_control_c_w(offset, data); | |
| 283 | pleiads_sound_control_c_w(machine, offset, data); | |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 |
| r1877 | r1878 | |
|---|---|---|
| 157 | 157 | Display refresh |
| 158 | 158 | |
| 159 | 159 | ***************************************************************************/ |
| 160 | static void draw_sprites(running_machine *machine, | |
| 160 | static void draw_sprites(running_machine *machine, | |
| 161 | 161 | { |
| 162 | 162 | const UINT8 *source = spriteram+32*4-4; |
| 163 | 163 | const UINT8 *finish = spriteram; /* ? */ |
| r1877 | r1878 | |
|---|---|---|
| 75 | 75 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | static void draw_sprites(running_machine *machine, | |
| 78 | static void draw_sprites(running_machine *machine, | |
| 79 | 79 | { |
| 80 | 80 | int offs; |
| 81 | 81 |
| r1877 | r1878 | |
|---|---|---|
| 13 | 13 | int pbillian_show_power; |
| 14 | 14 | |
| 15 | 15 | static int gfxbank; |
| 16 | static | |
| 16 | static | |
| 17 | 17 | static int show_bitmap; |
| 18 | 18 | static tilemap *bg_tilemap; |
| 19 | 19 | |
| r1877 | r1878 | |
| 130 | 130 | bankaddress = 0x10000 + ((data & 0x08) >> 3) * 0x4000; |
| 131 | 131 | memory_set_bankptr(1,&rom[bankaddress]); |
| 132 | 132 | |
| 133 | interrupt_enable_w(0,data & 0x10); | |
| 133 | interrupt_enable_w(machine,0,data & 0x10); | |
| 134 | 134 | flip_screen_set(data & 0x20); |
| 135 | 135 | } |
| 136 | 136 | |
| r1877 | r1878 | |
| 150 | 150 | show_bitmap = (data & 0x04) >> 2; |
| 151 | 151 | |
| 152 | 152 | /* bit 3 enables NMI */ |
| 153 | interrupt_enable_w(offset,data & 0x08); | |
| 153 | interrupt_enable_w(machine,offset,data & 0x08); | |
| 154 | 154 | |
| 155 | 155 | /* bits 4-5 control ROM bank */ |
| 156 | 156 | bankaddress = 0x10000 + ((data & 0x30) >> 4) * 0x4000; |
| r1877 | r1878 | |
| 165 | 165 | |
| 166 | 166 | ***************************************************************************/ |
| 167 | 167 | |
| 168 | static void pbillian_draw_sprites(running_machine *machine, | |
| 168 | static void pbillian_draw_sprites(running_machine *machine, | |
| 169 | 169 | { |
| 170 | 170 | int offs; |
| 171 | 171 | |
| r1877 | r1878 | |
| 192 | 192 | } |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | static void superqix_draw_sprites(running_machine *machine, | |
| 195 | static void superqix_draw_sprites(running_machine *machine, | |
| 196 | 196 | { |
| 197 | 197 | int offs; |
| 198 | 198 |
| r1877 | r1878 | |
|---|---|---|
| 17 | 17 | UINT8 *dday_colorram; |
| 18 | 18 | |
| 19 | 19 | static tilemap *fg_tilemap, *bg_tilemap, *text_tilemap, *sl_tilemap; |
| 20 | static | |
| 20 | static | |
| 21 | 21 | static int control; |
| 22 | 22 | static int sl_image; |
| 23 | 23 | static int sl_enable; |
| r1877 | r1878 | |
| 324 | 324 | /* apply shadow */ |
| 325 | 325 | int x, y; |
| 326 | 326 | |
| 327 | | |
| 327 | | |
| 328 | 328 | |
| 329 | 329 | for (x = cliprect->min_x; x <= cliprect->max_x; x++) |
| 330 | 330 | for (y = cliprect->min_y; y <= cliprect->max_y; y++) |
| r1877 | r1878 | |
|---|---|---|
| 360 | 360 | * |
| 361 | 361 | *************************************/ |
| 362 | 362 | |
| 363 | static void update_one_screen(running_machine* machine, int screen, | |
| 363 | static void update_one_screen(running_machine* machine, int screen, | |
| 364 | 364 | { |
| 365 | 365 | struct atarimo_rect_list rectlist; |
| 366 | 366 | rectangle tempclip = *cliprect; |
| 367 | | |
| 367 | | |
| 368 | 368 | int x, y, r, mooffset, temp; |
| 369 | 369 | |
| 370 | 370 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 44 | 44 | static UINT16 scroll_h; |
| 45 | 45 | static UINT16 scroll_v; |
| 46 | 46 | |
| 47 | static mame_bitmap *front_buffer; | |
| 48 | static mame_bitmap *back_buffer; | |
| 47 | static bitmap_t *front_buffer; | |
| 48 | static bitmap_t *back_buffer; | |
| 49 | 49 | static emu_timer *bufend_timer; |
| 50 | 50 | static emu_timer *cursor_timer; |
| 51 | 51 | |
| r1877 | r1878 | |
| 730 | 730 | if (carry) --CNT; \ |
| 731 | 731 | } while(0) |
| 732 | 732 | |
| 733 | static void rotate_draw( | |
| 733 | static void rotate_draw( | |
| 734 | 734 | { |
| 735 | 735 | UINT32 y; |
| 736 | 736 | |
| r1877 | r1878 | |
| 834 | 834 | |
| 835 | 835 | *******************************************************************************************/ |
| 836 | 836 | |
| 837 | static void hud_draw( | |
| 837 | static void hud_draw( | |
| 838 | 838 | { |
| 839 | 839 | UINT8 *tile_rom = memory_region(REGION_GFX3); |
| 840 | 840 | UINT32 offs; |
| r1877 | r1878 | |
| 977 | 977 | VIDEO_EOF( lockon ) |
| 978 | 978 | { |
| 979 | 979 | /* Swap the frame buffers */ |
| 980 | | |
| 980 | | |
| 981 | 981 | front_buffer = back_buffer; |
| 982 | 982 | back_buffer = tmp; |
| 983 | 983 |
| r1877 | r1878 | |
|---|---|---|
| 8 | 8 | static UINT8 mappy_scroll; |
| 9 | 9 | static tilemap *bg_tilemap; |
| 10 | 10 | |
| 11 | static | |
| 11 | static | |
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | /*************************************************************************** |
| r1877 | r1878 | |
| 400 | 400 | ***************************************************************************/ |
| 401 | 401 | |
| 402 | 402 | /* also used by toypop.c */ |
| 403 | void mappy_draw_sprites(running_machine *machine, | |
| 403 | void mappy_draw_sprites(running_machine *machine, | |
| 404 | 404 | { |
| 405 | 405 | int offs; |
| 406 | 406 | |
| r1877 | r1878 | |
| 475 | 475 | 1 -------x X position MSB |
| 476 | 476 | */ |
| 477 | 477 | |
| 478 | static void phozon_draw_sprites(running_machine *machine, | |
| 478 | static void phozon_draw_sprites(running_machine *machine, | |
| 479 | 479 | { |
| 480 | 480 | int offs; |
| 481 | 481 |
| r1877 | r1878 | |
|---|---|---|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | static void draw_sprites(running_machine *machine, | |
| 67 | static void draw_sprites(running_machine *machine, | |
| 68 | 68 | { |
| 69 | 69 | UINT16 *source = &buffered_spriteram16[spriteram_size/2] - 4; |
| 70 | 70 | UINT16 *finish = buffered_spriteram16; |
| r1877 | r1878 | |
| 166 | 166 | |
| 167 | 167 | VIDEO_EOF( tigeroad ) |
| 168 | 168 | { |
| 169 | buffer_spriteram16_w(0,0,0); | |
| 169 | buffer_spriteram16_w(machine,0,0,0); | |
| 170 | 170 | } |
| r1877 | r1878 | |
|---|---|---|
| 796 | 796 | return 0; |
| 797 | 797 | } |
| 798 | 798 | |
| 799 | static renderer_func | |
| 799 | static atari_renderer_func | |
| 800 | 800 | |
| 801 | 801 | static void artifacts_gfx(UINT8 *src, UINT8 *dst, int width) |
| 802 | 802 | { |
| r1877 | r1878 | |
| 1060 | 1060 | return video_screen_get_hpos(0) * CYCLES_PER_LINE / Machine->screen[0].width; |
| 1061 | 1061 | } |
| 1062 | 1062 | |
| 1063 | static void after(int cycles, timer_c | |
| 1063 | static void after(int cycles, timer_fired_func | |
| 1064 | 1064 | { |
| 1065 | 1065 | attotime duration = attotime_make(0, attotime_to_attoseconds(video_screen_get_scan_period(0)) * cycles / CYCLES_PER_LINE); |
| 1066 | 1066 | (void)funcname; |
| r1877 | r1878 | |
| 1083 | 1083 | } |
| 1084 | 1084 | |
| 1085 | 1085 | |
| 1086 | static const renderer_func | |
| 1086 | static const atari_renderer_func | |
| 1087 | 1087 | /* no playfield narrow normal wide */ |
| 1088 | 1088 | { |
| 1089 | 1089 | {antic_mode_0_xx,antic_mode_0_xx,antic_mode_0_xx,antic_mode_0_xx}, |
| r1877 | r1878 | |
| 1198 | 1198 | if( antic.w.dmactl & DMA_MISSILE ) |
| 1199 | 1199 | { |
| 1200 | 1200 | antic.steal_cycles += 1; |
| 1201 | atari_gtia_w(0x11, RDPMGFXD(3*256)); | |
| 1201 | atari_gtia_w(machine, 0x11, RDPMGFXD(3*256)); | |
| 1202 | 1202 | } |
| 1203 | 1203 | /* transport player data to GTIA ? */ |
| 1204 | 1204 | if( antic.w.dmactl & DMA_PLAYER ) |
| 1205 | 1205 | { |
| 1206 | 1206 | antic.steal_cycles += 4; |
| 1207 | atari_gtia_w(0x0d, RDPMGFXD(4*256)); | |
| 1208 | atari_gtia_w(0x0e, RDPMGFXD(5*256)); | |
| 1209 | atari_gtia_w(0x0f, RDPMGFXD(6*256)); | |
| 1210 | atari_gtia_w(0x10, RDPMGFXD(7*256)); | |
| 1207 | atari_gtia_w(machine, 0x0d, RDPMGFXD(4*256)); | |
| 1208 | atari_gtia_w(machine, 0x0e, RDPMGFXD(5*256)); | |
| 1209 | atari_gtia_w(machine, 0x0f, RDPMGFXD(6*256)); | |
| 1210 | atari_gtia_w(machine, 0x10, RDPMGFXD(7*256)); | |
| 1211 | 1211 | } |
| 1212 | 1212 | } |
| 1213 | 1213 | else |
| r1877 | r1878 | |
| 1217 | 1217 | { |
| 1218 | 1218 | if( (antic.scanline & 1) == 0 ) /* even line ? */ |
| 1219 | 1219 | antic.steal_cycles += 1; |
| 1220 | atari_gtia_w(0x11, RDPMGFXS(3*128)); | |
| 1220 | atari_gtia_w(machine, 0x11, RDPMGFXS(3*128)); | |
| 1221 | 1221 | } |
| 1222 | 1222 | /* transport player data to GTIA ? */ |
| 1223 | 1223 | if( antic.w.dmactl & DMA_PLAYER ) |
| 1224 | 1224 | { |
| 1225 | 1225 | if( (antic.scanline & 1) == 0 ) /* even line ? */ |
| 1226 | 1226 | antic.steal_cycles += 4; |
| 1227 | atari_gtia_w(0x0d, RDPMGFXS(4*128)); | |
| 1228 | atari_gtia_w(0x0e, RDPMGFXS(5*128)); | |
| 1229 | atari_gtia_w(0x0f, RDPMGFXS(6*128)); | |
| 1230 | atari_gtia_w(0x10, RDPMGFXS(7*128)); | |
| 1227 | atari_gtia_w(machine, 0x0d, RDPMGFXS(4*128)); | |
| 1228 | atari_gtia_w(machine, 0x0e, RDPMGFXS(5*128)); | |
| 1229 | atari_gtia_w(machine, 0x0f, RDPMGFXS(6*128)); | |
| 1230 | atari_gtia_w(machine, 0x10, RDPMGFXS(7*128)); | |
| 1231 | 1231 | } |
| 1232 | 1232 | } |
| 1233 | 1233 | } |
| r1877 | r1878 | |
|---|---|---|
| 206 | 206 | |
| 207 | 207 | struct layer_info |
| 208 | 208 | { |
| 209 | | |
| 209 | | |
| 210 | 210 | UINT8 * transparent; |
| 211 | 211 | }; |
| 212 | 212 | |
| r1877 | r1878 | |
| 568 | 568 | WRITE32_HANDLER( multi32_videoram_w ) |
| 569 | 569 | { |
| 570 | 570 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 571 | system32_videoram_w(offset*2+0, data, mem_mask); | |
| 571 | system32_videoram_w(machine, offset*2+0, data, mem_mask); | |
| 572 | 572 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 573 | system32_videoram_w(offset*2+1, data >> 16, mem_mask >> 16); | |
| 573 | system32_videoram_w(machine, offset*2+1, data >> 16, mem_mask >> 16); | |
| 574 | 574 | } |
| 575 | 575 | |
| 576 | 576 | |
| r1877 | r1878 | |
| 648 | 648 | |
| 649 | 649 | READ32_HANDLER( multi32_sprite_control_r ) |
| 650 | 650 | { |
| 651 | return system32_sprite_control_r(offset*2+0, mem_mask) | | |
| 652 | (system32_sprite_control_r(offset*2+1, mem_mask >> 16) << 16); | |
| 651 | return system32_sprite_control_r(machine, offset*2+0, mem_mask) | | |
| 652 | (system32_sprite_control_r(machine, offset*2+1, mem_mask >> 16) << 16); | |
| 653 | 653 | } |
| 654 | 654 | |
| 655 | 655 | |
| 656 | 656 | WRITE32_HANDLER( multi32_sprite_control_w ) |
| 657 | 657 | { |
| 658 | 658 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 659 | system32_sprite_control_w(offset*2+0, data, mem_mask); | |
| 659 | system32_sprite_control_w(machine, offset*2+0, data, mem_mask); | |
| 660 | 660 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 661 | system32_sprite_control_w(offset*2+1, data >> 16, mem_mask >> 16); | |
| 661 | system32_sprite_control_w(machine, offset*2+1, data >> 16, mem_mask >> 16); | |
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | |
| r1877 | r1878 | |
| 943 | 943 | static void update_tilemap_zoom(running_machine *machine, int scrnum, struct layer_info *layer, const rectangle *cliprect, int bgnum) |
| 944 | 944 | { |
| 945 | 945 | int clipenable, clipout, clips, clipdraw_start; |
| 946 | | |
| 946 | | |
| 947 | 947 | struct extents_list clip_extents; |
| 948 | 948 | tilemap *tilemaps[4]; |
| 949 | 949 | UINT32 srcx, srcx_start, srcy; |
| r1877 | r1878 | |
| 1020 | 1020 | /* optimize for the case where we are clipped out */ |
| 1021 | 1021 | if (clipdraw || extents[1] <= cliprect->max_x) |
| 1022 | 1022 | { |
| 1023 | | |
| 1023 | | |
| 1024 | 1024 | int transparent = 0; |
| 1025 | 1025 | UINT16 *src[2]; |
| 1026 | 1026 | |
| r1877 | r1878 | |
| 1094 | 1094 | static void update_tilemap_rowscroll(running_machine *machine, int scrnum, struct layer_info *layer, const rectangle *cliprect, int bgnum) |
| 1095 | 1095 | { |
| 1096 | 1096 | int clipenable, clipout, clips, clipdraw_start; |
| 1097 | | |
| 1097 | | |
| 1098 | 1098 | struct extents_list clip_extents; |
| 1099 | 1099 | tilemap *tilemaps[4]; |
| 1100 | 1100 | int rowscroll, rowselect; |
| r1877 | r1878 | |
| 1145 | 1145 | /* optimize for the case where we are clipped out */ |
| 1146 | 1146 | if (clipdraw || extents[1] <= cliprect->max_x) |
| 1147 | 1147 | { |
| 1148 | | |
| 1148 | | |
| 1149 | 1149 | int transparent = 0; |
| 1150 | 1150 | UINT16 *src[2]; |
| 1151 | 1151 | int srcxstep; |
| r1877 | r1878 | |
| 1243 | 1243 | |
| 1244 | 1244 | static void update_tilemap_text(running_machine *machine, int scrnum, struct layer_info *layer, const rectangle *cliprect) |
| 1245 | 1245 | { |
| 1246 | | |
| 1246 | | |
| 1247 | 1247 | UINT16 *tilebase; |
| 1248 | 1248 | UINT16 *gfxbase; |
| 1249 | 1249 | int startx, starty; |
| r1877 | r1878 | |
| 1401 | 1401 | static void update_bitmap(running_machine *machine, int scrnum, struct layer_info *layer, const rectangle *cliprect) |
| 1402 | 1402 | { |
| 1403 | 1403 | int clipenable, clipout, clips, clipdraw_start; |
| 1404 | | |
| 1404 | | |
| 1405 | 1405 | struct extents_list clip_extents; |
| 1406 | 1406 | int xscroll, yscroll; |
| 1407 | 1407 | int color; |
| r1877 | r1878 | |
| 1503 | 1503 | |
| 1504 | 1504 | static void update_background(struct layer_info *layer, const rectangle *cliprect) |
| 1505 | 1505 | { |
| 1506 | | |
| 1506 | | |
| 1507 | 1507 | int x, y; |
| 1508 | 1508 | |
| 1509 | 1509 | for (y = cliprect->min_y; y <= cliprect->max_y; y++) |
| r1877 | r1878 | |
| 1699 | 1699 | { 0x1fff, 0x0fff, 0x07ff, 0x03ff } |
| 1700 | 1700 | }; |
| 1701 | 1701 | |
| 1702 | | |
| 1702 | | |
| 1703 | 1703 | UINT8 numbanks = memory_region_length(REGION_GFX2) / 0x400000; |
| 1704 | 1704 | const UINT32 *spritebase = (const UINT32 *)memory_region(REGION_GFX2); |
| 1705 | 1705 | |
| r1877 | r1878 | |
| 2028 | 2028 | return BITMAP_ADDR16(layer_data[layer].bitmap, scanline, 0); |
| 2029 | 2029 | } |
| 2030 | 2030 | |
| 2031 | static void mix_all_layers(int which, int xoffs, | |
| 2031 | static void mix_all_layers(int which, int xoffs, | |
| 2032 | 2032 | { |
| 2033 | 2033 | int blendenable = mixer_control[which][0x4e/2] & 0x0800; |
| 2034 | 2034 | int blendfactor = (mixer_control[which][0x4e/2] >> 8) & 7; |
| r1877 | r1878 | |
|---|---|---|
| 118 | 118 | VIDEO_UPDATE( badlands ) |
| 119 | 119 | { |
| 120 | 120 | struct atarimo_rect_list rectlist; |
| 121 | | |
| 121 | | |
| 122 | 122 | int x, y, r; |
| 123 | 123 | |
| 124 | 124 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 150 | 150 | Render the Sprites |
| 151 | 151 | |
| 152 | 152 | ***************************************************************************/ |
| 153 | static void draw_sprites(running_machine *machine, | |
| 153 | static void draw_sprites(running_machine *machine, | |
| 154 | 154 | { |
| 155 | 155 | int offs; |
| 156 | 156 |
| r1877 | r1878 | |
|---|---|---|
| 95 | 95 | #include "psikyosh.h" |
| 96 | 96 | |
| 97 | 97 | /* Needed for psikyosh_drawgfxzoom */ |
| 98 | static | |
| 98 | static | |
| 99 | 99 | |
| 100 | 100 | /* Psikyo PS6406B */ |
| 101 | 101 | /* --- BACKGROUNDS --- */ |
| 102 | 102 | |
| 103 | 103 | /* 'Normal' layers, no line/columnscroll. No per-line effects */ |
| 104 | static void draw_bglayer(running_machine *machine, int layer, | |
| 104 | static void draw_bglayer(running_machine *machine, int layer, | |
| 105 | 105 | { |
| 106 | 106 | gfx_element *gfx; |
| 107 | 107 | int offs=0, sx, sy; |
| r1877 | r1878 | |
| 167 | 167 | |
| 168 | 168 | /* This is a complete bodge for the daraku text layers. There is not enough info to be sure how it is supposed to work */ |
| 169 | 169 | /* It appears that there are row/column scroll values for 2 seperate layers, just drawing it twice using one of each of the sets of values for now */ |
| 170 | static void draw_bglayertext(running_machine *machine, int layer, | |
| 170 | static void draw_bglayertext(running_machine *machine, int layer, | |
| 171 | 171 | { |
| 172 | 172 | gfx_element *gfx; |
| 173 | 173 | int offs, sx, sy; |
| r1877 | r1878 | |
| 257 | 257 | |
| 258 | 258 | /* Row Scroll and/or Column Scroll/Zoom, has per-column Alpha/Bank/Priority. This isn't correct, just testing */ |
| 259 | 259 | /* For now I'm just using the first alpha/bank/priority values and sodding the rest of it */ |
| 260 | static void draw_bglayerscroll(running_machine *machine, int layer, | |
| 260 | static void draw_bglayerscroll(running_machine *machine, int layer, | |
| 261 | 261 | { |
| 262 | 262 | gfx_element *gfx; |
| 263 | 263 | int offs, sx, sy; |
| r1877 | r1878 | |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | /* 3 BG layers, with priority */ |
| 338 | static void draw_background(running_machine *machine, | |
| 338 | static void draw_background(running_machine *machine, | |
| 339 | 339 | { |
| 340 | 340 | int i; |
| 341 | 341 | |
| r1877 | r1878 | |
| 393 | 393 | /* sx and sy is top-left of entire sprite regardless of flip */ |
| 394 | 394 | /* Note that Level 5-4 of sbomberb boss is perfect! (Alpha blended zoomed) as well as S1945II logo */ |
| 395 | 395 | /* pixel is only plotted if z is >= priority_buffer[y][x] */ |
| 396 | static void psikyosh_drawgfxzoom( | |
| 396 | static void psikyosh_drawgfxzoom( | |
| 397 | 397 | UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, |
| 398 | 398 | const rectangle *clip,int transparency,int transparent_color, |
| 399 | 399 | int zoomx, int zoomy, int wide, int high, UINT32 z) |
| r1877 | r1878 | |
| 930 | 930 | |
| 931 | 931 | #define SPRITE_PRI(n) (((psikyosh_vidregs[2] << (4*n)) & 0xf0000000 ) >> 28) |
| 932 | 932 | |
| 933 | static void draw_sprites(running_machine *machine, | |
| 933 | static void draw_sprites(running_machine *machine, | |
| 934 | 934 | { |
| 935 | 935 | /*- Sprite Format 0x0000 - 0x37ff -** |
| 936 | 936 | |
| r1877 | r1878 | |
| 1073 | 1073 | |
| 1074 | 1074 | } |
| 1075 | 1075 | |
| 1076 | static void psikyosh_prelineblend( | |
| 1076 | static void psikyosh_prelineblend( | |
| 1077 | 1077 | { |
| 1078 | 1078 | /* There are 224 values for pre-lineblending. Using one for every row currently */ |
| 1079 | 1079 | /* I suspect that it should be blended against black by the amount specified as |
| r1877 | r1878 | |
| 1097 | 1097 | profiler_mark(PROFILER_END); |
| 1098 | 1098 | } |
| 1099 | 1099 | |
| 1100 | static void psikyosh_postlineblend( | |
| 1100 | static void psikyosh_postlineblend( | |
| 1101 | 1101 | { |
| 1102 | 1102 | /* There are 224 values for post-lineblending. Using one for every row currently */ |
| 1103 | 1103 | UINT32 *dstline; |
| r1877 | r1878 | |
| 1143 | 1143 | |
| 1144 | 1144 | VIDEO_EOF( psikyosh ) |
| 1145 | 1145 | { |
| 1146 | buffer_spriteram32_w(0,0,0); | |
| 1146 | buffer_spriteram32_w(machine,0,0,0); | |
| 1147 | 1147 | } |
| 1148 | 1148 | |
| 1149 | 1149 | /*popmessage ("Regs %08x %08x %08x\n %08x %08x %08x", |
| r1877 | r1878 | |
|---|---|---|
| 136 | 136 | palette_set_color_rgb(Machine,offs/2,pal5bit(r),pal5bit(g),pal5bit(b)); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | static void draw_sprites(running_machine *machine, | |
| 139 | static void draw_sprites(running_machine *machine, | |
| 140 | 140 | { |
| 141 | 141 | int offs; |
| 142 | 142 |
| r1877 | r1878 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | static UINT8* pandora_spriteram; |
| 52 | 52 | static UINT8 pandora_region; |
| 53 | static | |
| 53 | static | |
| 54 | 54 | static int pandora_clear_bitmap; |
| 55 | 55 | static int pandora_xoffset, pandora_yoffset; |
| 56 | 56 | |
| r1877 | r1878 | |
| 59 | 59 | pandora_clear_bitmap = clear; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | void pandora_update(running_machine *machine, | |
| 62 | void pandora_update(running_machine *machine, | |
| 63 | 63 | { |
| 64 | 64 | if (!pandora_sprites_bitmap) |
| 65 | 65 | { |
| r1877 | r1878 | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | |
| 74 | static void pandora_draw(running_machine *machine, | |
| 74 | static void pandora_draw(running_machine *machine, | |
| 75 | 75 | { |
| 76 | 76 | |
| 77 | 77 | int sx=0, sy=0, x=0, y=0, offs; |
| r1877 | r1878 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 3 | 2 | #include "deco16ic.h" |
| 4 | 3 | |
| 5 | static void draw_sprites(running_machine *machine, | |
| 4 | static void draw_sprites(running_machine *machine, | |
| 6 | 5 | { |
| 7 | 6 | int offs; |
| 8 | 7 | int flipscreen=!flip_screen_get(); |
| r1877 | r1878 | |
| 17 | 16 | |
| 18 | 17 | y = spriteram_base[offs]; |
| 19 | 18 | flash=y&0x1000; |
| 20 | if (flash && ( | |
| 19 | if (flash && (vid | |
| 21 | 20 | |
| 22 | 21 | x = spriteram_base[offs+2]; |
| 23 | 22 | colour = (x >>9) & 0x1f; |
| r1877 | r1878 | |
|---|---|---|
| 90 | 90 | VIDEO_UPDATE( offtwall ) |
| 91 | 91 | { |
| 92 | 92 | struct atarimo_rect_list rectlist; |
| 93 | | |
| 93 | | |
| 94 | 94 | int x, y, r; |
| 95 | 95 | |
| 96 | 96 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 278 | 278 | colortable_entry_set_value(machine->colortable, i, c); |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | static void equites_draw_scroll(running_machine *machine, | |
| 281 | static void equites_draw_scroll(running_machine *machine, | |
| 282 | 282 | { |
| 283 | 283 | #define TILE_BANKBASE 1 |
| 284 | 284 | |
| r1877 | r1878 | |
| 326 | 326 | #undef TILE_BANKBASE |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | static void equites_draw_sprites(running_machine *machine, | |
| 329 | static void equites_draw_sprites(running_machine *machine, | |
| 330 | 330 | { |
| 331 | 331 | #define SPRITE_BANKBASE 3 |
| 332 | 332 | #define SHIFTX -4 |
| r1877 | r1878 | |
| 402 | 402 | } |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | static void splndrbt_draw_scroll(running_machine *machine, | |
| 405 | static void splndrbt_draw_scroll(running_machine *machine, | |
| 406 | 406 | { |
| 407 | 407 | #define TILE_BANKBASE 1 |
| 408 | 408 | |
| r1877 | r1878 | |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | static void splndrbt_slantcopy( |
| 439 | mame_bitmap *src_bitmap, | |
| 440 | mame_bitmap *dst_bitmap, | |
| 439 | bitmap_t *src_bitmap, | |
| 440 | bitmap_t *dst_bitmap, | |
| 441 | 441 | const rectangle *dst_clip, |
| 442 | 442 | int src_x, int src_y, |
| 443 | 443 | unsigned src_w, unsigned src_h, |
| r1877 | r1878 | |
| 479 | 479 | #undef WRAP |
| 480 | 480 | } |
| 481 | 481 | |
| 482 | static void splndrbt_draw_sprites(running_machine *machine, | |
| 482 | static void splndrbt_draw_sprites(running_machine *machine, | |
| 483 | 483 | { |
| 484 | 484 | #define SPRITE_BANKBASE 3 |
| 485 | 485 | #define FP_ONE 0x10000 |
| r1877 | r1878 | |
|---|---|---|
| 1 | 1 | /* kan_pand.h */ |
| 2 | 2 | |
| 3 | 3 | void pandora_start(UINT8 region, int x, int y); |
| 4 | void pandora_update(running_machine *machine, | |
| 4 | void pandora_update(running_machine *machine, | |
| 5 | 5 | void pandora_eof(running_machine *machine); |
| 6 | 6 | void pandora_set_clear_bitmap(int clear); |
| 7 | 7 |
| r1877 | r1878 | |
|---|---|---|
| 120 | 120 | VIDEO_UPDATE( gradius3 ) |
| 121 | 121 | { |
| 122 | 122 | /* TODO: this kludge enforces the char banks. For some reason, they don't work otherwise. */ |
| 123 | K052109_w(0x1d80,0x10); | |
| 124 | K052109_w(0x1f00,0x32); | |
| 123 | K052109_w(machine,0x1d80,0x10); | |
| 124 | K052109_w(machine,0x1f00,0x32); | |
| 125 | 125 | |
| 126 | 126 | if (dirtygfx) |
| 127 | 127 | { |
| r1877 | r1878 | |
|---|---|---|
| 149 | 149 | big object |
| 150 | 150 | ********************************************/ |
| 151 | 151 | |
| 152 | static void draw_object(running_machine* machine, | |
| 152 | static void draw_object(running_machine* machine, | |
| 153 | 153 | { |
| 154 | 154 | int sx, sy, color; |
| 155 | 155 | |
| r1877 | r1878 | |
| 171 | 171 | drawgfx(bitmap, machine->gfx[3], 1, color, 0, 1, sx, sy - 64, cliprect, TRANSPARENCY_PEN, 0); |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | static void draw_center( | |
| 174 | static void draw_center( | |
| 175 | 175 | { |
| 176 | 176 | int sx, sy, x, y, color; |
| 177 | 177 | |
| r1877 | r1878 | |
| 408 | 408 | memory handlers |
| 409 | 409 | ********************************************/ |
| 410 | 410 | |
| 411 | static void draw_sprites(running_machine* machine, | |
| 411 | static void draw_sprites(running_machine* machine, | |
| 412 | 412 | int sprite_y_adjust, int sprite_y_adjust_flip_screen, |
| 413 | 413 | UINT8 *sprite_ram, int interleave) |
| 414 | 414 | { |
| r1877 | r1878 | |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | |
| 462 | static void draw_missiles( | |
| 462 | static void draw_missiles( | |
| 463 | 463 | int missile_y_adjust, int missile_y_adjust_flip_screen, |
| 464 | 464 | UINT8 *missile_ram, int interleave) |
| 465 | 465 | { |
| r1877 | r1878 | |
| 608 | 608 | int scrollx, scrolly_l, scrolly_r; |
| 609 | 609 | rectangle clip; |
| 610 | 610 | |
| 611 | if (0xc0 != (input_port_2_r(0) & 0xc0)) /* coin slots assert an NMI */ | |
| 611 | if (0xc0 != (input_port_2_r(machine, 0) & 0xc0)) /* coin slots assert an NMI */ | |
| 612 | 612 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); |
| 613 | 613 | |
| 614 | 614 | if (0 == (watchdog_flip & 0x04)) |
| 615 | watchdog_reset_w (0,0); | |
| 615 | watchdog_reset_w (machine,0,0); | |
| 616 | 616 | else if (watchdog_count-- > 0) |
| 617 | watchdog_reset_w (0,0); | |
| 617 | watchdog_reset_w (machine,0,0); | |
| 618 | 618 | |
| 619 | 619 | #if TAPE_UI_DISPLAY |
| 620 | 620 | if (tape_timer) |
| r1877 | r1878 | |
|---|---|---|
| 330 | 330 | * |
| 331 | 331 | *************************************/ |
| 332 | 332 | |
| 333 | static void draw_sprites(running_machine *machine, | |
| 333 | static void draw_sprites(running_machine *machine, | |
| 334 | 334 | { |
| 335 | 335 | static const UINT8 zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 }; |
| 336 | 336 | int offs; |
| r1877 | r1878 | |
|---|---|---|
| 182 | 182 | ***************************************************************************/ |
| 183 | 183 | |
| 184 | 184 | /* the sprite generator IC is the same as Mappy */ |
| 185 | static void draw_sprites(running_machine *machine, | |
| 185 | static void draw_sprites(running_machine *machine, | |
| 186 | 186 | { |
| 187 | 187 | int offs; |
| 188 | 188 |
| r1877 | r1878 | |
|---|---|---|
| 102 | 102 | VIDEO_UPDATE( klax ) |
| 103 | 103 | { |
| 104 | 104 | struct atarimo_rect_list rectlist; |
| 105 | | |
| 105 | | |
| 106 | 106 | int x, y, r; |
| 107 | 107 | |
| 108 | 108 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 14 | 14 | static int gomoku_flipscreen; |
| 15 | 15 | static int gomoku_bg_dispsw; |
| 16 | 16 | static tilemap *fg_tilemap; |
| 17 | static | |
| 17 | static | |
| 18 | 18 | |
| 19 | 19 | UINT8 *gomoku_videoram; |
| 20 | 20 | UINT8 *gomoku_colorram; |
| r1877 | r1878 | |
|---|---|---|
| 12 | 12 | UINT32 *djmain_obj_ram; |
| 13 | 13 | |
| 14 | 14 | |
| 15 | static void draw_sprites(running_machine* machine, | |
| 15 | static void draw_sprites(running_machine* machine, | |
| 16 | 16 | { |
| 17 | 17 | int offs, pri_code; |
| 18 | 18 | int sortedlist[NUM_SPRITES]; |
| r1877 | r1878 | |
|---|---|---|
| 7 | 7 | #include "driver.h" |
| 8 | 8 | #include "firetrk.h" |
| 9 | 9 | |
| 10 | UINT8* firetrk_alpha_num_ram; | |
| 11 | UINT8* firetrk_playfield_ram; | |
| 12 | 10 | |
| 13 | int firetrk_skid[2]; | |
| 14 | int firetrk_crash[2]; | |
| 11 | UINT8 *firetrk_alpha_num_ram; | |
| 12 | UINT8 *firetrk_playfield_ram; | |
| 13 | UINT8 *firetrk_scroll_x; | |
| 14 | UINT8 *firetrk_scroll_y; | |
| 15 | UINT8 *firetrk_car_rot; | |
| 16 | UINT8 *firetrk_drone_rot; | |
| 17 | UINT8 *firetrk_drone_x; | |
| 18 | UINT8 *firetrk_drone_y; | |
| 19 | UINT8 *firetrk_blink; | |
| 20 | UINT8 firetrk_flash; | |
| 15 | 21 | |
| 16 | static mame_bitmap *helper1; | |
| 17 | static mame_bitmap *helper2; | |
| 22 | UINT8 firetrk_skid[2]; | |
| 23 | UINT8 firetrk_crash[2]; | |
| 18 | 24 | |
| 19 | static int blink; | |
| 20 | static int flash; | |
| 21 | static int drone_hpos; | |
| 22 | static int drone_vpos; | |
| 25 | static bitmap_t *helper1; | |
| 26 | static bitmap_t *helper2; | |
| 23 | 27 | |
| 24 | static const rectangle playfield_window = { 0x02A, 0x115, 0x000, 0x0FF }; | |
| 28 | static UINT32 color1_mask; | |
| 29 | static UINT32 color2_mask; | |
| 25 | 30 | |
| 26 | struct sprite_data | |
| 27 | { | |
| 28 | int layout; | |
| 29 | int number; | |
| 30 | int x; | |
| 31 | int y; | |
| 32 | int flipx; | |
| 33 | int flipy; | |
| 34 | int color; | |
| 35 | }; | |
| 36 | 31 | |
| 37 | static str | |
| 32 | static const rectangle | |
| 38 | 33 | |
| 39 | static tilemap* tilemap1; /* for screen display */ | |
| 40 | static tilemap* tilemap2; /* for collision detection */ | |
| 34 | static tilemap *tilemap1; /* for screen display */ | |
| 35 | static tilemap *tilemap2; /* for collision detection */ | |
| 41 | 36 | |
| 42 | 37 | |
| 43 | 38 | |
| 44 | ||
| 39 | PALETTE_INIT( fi | |
| 45 | 40 | { |
| 46 | if (GAME_IS_FIRETRUCK) | |
| 41 | int i; | |
| 42 | ||
| 43 | static const UINT8 colortable_source[] = | |
| 47 | 44 | { |
| 48 | return (c & 0x3F) >= 0x4 && (c & 0x3F) <= 0xB; | |
| 49 | } | |
| 50 | if (GAME_IS_SUPERBUG) | |
| 45 | 0, 0, 1, 0, | |
| 46 | 2, 0, 3, 0, | |
| 47 | 3, 3, 2, 3, | |
| 48 | 1, 3, 0, 3, | |
| 49 | 0, 0, 1, 0, | |
| 50 | 2, 0, 0, 3, | |
| 51 | 3, 0, 0, 3 | |
| 52 | }; | |
| 53 | static const rgb_t palette_source[] = | |
| 51 | 54 | { |
| 52 | return (c & 0x3F) >= 0x8 && (c & 0x3F) <= 0xF; | |
| 53 | } | |
| 55 | RGB_BLACK, | |
| 56 | MAKE_RGB(0x5b, 0x5b, 0x5b), | |
| 57 | MAKE_RGB(0xa4, 0xa4, 0xa4), | |
| 58 | RGB_WHITE | |
| 59 | }; | |
| 54 | 60 | |
| 55 | return 0; | |
| 56 | } | |
| 61 | color1_mask = color2_mask = 0; | |
| 57 | 62 | |
| 63 | for (i = 0; i < ARRAY_LENGTH(colortable_source); i++) | |
| 64 | { | |
| 65 | UINT8 color = colortable_source[i]; | |
| 58 | 66 | |
| 59 | void firetrk_set_flash(int flag) | |
| 60 | { | |
| 61 | tilemap_mark_all_tiles_dirty(tilemap1); | |
| 67 | if (color == 1) | |
| 68 | color1_mask |= 1 << i; | |
| 69 | else if (color == 2) | |
| 70 | color2_mask |= 1 << i; | |
| 62 | 71 | |
| 63 | if (GAME_IS_FIRETRUCK || GAME_IS_SUPERBUG) | |
| 64 | { | |
| 65 | if (flag) | |
| 66 | { | |
| 67 | car[0].color = 1; | |
| 68 | car[1].color = 1; | |
| 69 | } | |
| 70 | else | |
| 71 | { | |
| 72 | car[0].color = 0; | |
| 73 | car[1].color = 0; | |
| 74 | } | |
| 72 | palette_set_color(machine, i, palette_source[color]); | |
| 75 | 73 | } |
| 74 | } | |
| 76 | 75 | |
| 77 | flash = flag; | |
| 76 | ||
| 77 | static void prom_to_palette(running_machine *machine, int number, UINT8 val) | |
| 78 | { | |
| 79 | palette_set_color(machine, number, MAKE_RGB(pal1bit(val >> 2), pal1bit(val >> 1), pal1bit(val >> 0))); | |
| 78 | 80 | } |
| 79 | 81 | |
| 80 | 82 | |
| 81 | ||
| 83 | PALETTE | |
| 82 | 84 | { |
| 83 | int | |
| 85 | int i | |
| 84 | 86 | |
| 85 | | |
| 87 | | |
| 86 | 88 | { |
| 87 | if (arrow_code(firetrk_playfield_ram[offset])) | |
| 88 | { | |
| 89 | tilemap_mark_tile_dirty(tilemap1, offset); | |
| 90 | } | |
| 91 | } | |
| 89 | 0x00, 0x00, 0x00, 0x01, | |
| 90 | 0x00, 0x02, 0x00, 0x03, | |
| 91 | 0x03, 0x03, 0x03, 0x02, | |
| 92 | 0x03, 0x01, 0x03, 0x00, | |
| 93 | 0x00, 0x00, 0x02, 0x00, | |
| 94 | 0x02, 0x01, 0x02, 0x02, | |
| 95 | 0x00, 0x10, 0x20, 0x30, | |
| 96 | 0x00, 0x04, 0x08, 0x0c, | |
| 97 | 0x00, 0x44, 0x48, 0x4c, | |
| 98 | 0x00, 0x84, 0x88, 0x8c, | |
| 99 | 0x00, 0xc4, 0xc8, 0xcc | |
| 100 | }; | |
| 92 | 101 | |
| 93 | blink = flag; | |
| 94 | } | |
| 102 | /* | |
| 103 | * The color PROM is addressed as follows: | |
| 104 | * | |
| 105 | * A0 => PLAYFIELD 1 | |
| 106 | * A1 => PLAYFIELD 2 | |
| 107 | * A2 => DRONE 1 | |
| 108 | * A3 => DRONE 2 | |
| 109 | * A4 => CAR 1 | |
| 110 | * A5 => CAR 2 | |
| 111 | * A6 => DRONE COLOR 1 | |
| 112 | * A7 => DRONE COLOR 2 | |
| 113 | * A8 => PLAYFIELD WINDOW | |
| 114 | * | |
| 115 | * This driver hard-codes some behavior which actually depends | |
| 116 | * on the PROM, like priorities, clipping and transparency. | |
| 117 | * | |
| 118 | */ | |
| 95 | 119 | |
| 120 | color1_mask = color2_mask = 0; | |
| 96 | 121 | |
| 97 | static TILE_GET_INFO( get_tile_info1 ) | |
| 98 | { | |
| 99 | UINT8 code = firetrk_playfield_ram[tile_index]; | |
| 122 | for (i = 0; i < ARRAY_LENGTH(colortable_source); i++) | |
| 123 | { | |
| 124 | UINT8 color = colortable_source[i]; | |
| 100 | 125 | |
| 101 | int color = code >> 6; | |
| 126 | if (color == 1) | |
| 127 | color1_mask |= 1 << i; | |
| 128 | else if (color == 2) | |
| 129 | color2_mask |= 1 << i; | |
| 102 | 130 | |
| 103 | if (blink && arrow_code(code)) | |
| 104 | { | |
| 105 | color = 0; | |
| 131 | prom_to_palette(machine, i, color_prom[0x100 + colortable_source[i]]); | |
| 106 | 132 | } |
| 107 | if (flash) | |
| 108 | { | |
| 109 | color |= 4; | |
| 110 | } | |
| 111 | 133 | |
| 112 | SET_TILE_INFO(1, code & 0x3f, color, 0); | |
| 134 | palette_set_color(machine, ARRAY_LENGTH(colortable_source) + 0, RGB_BLACK); | |
| 135 | palette_set_color(machine, ARRAY_LENGTH(colortable_source) + 1, RGB_WHITE); | |
| 113 | 136 | } |
| 114 | 137 | |
| 115 | 138 | |
| 116 | static TILE_GET_INFO( get_tile_info | |
| 139 | static TILE_GET_INFO( firetrk_get_tile_info1 ) | |
| 117 | 140 | { |
| 118 | UINT8 code = firetrk_playfield_ram[tile_index]; | |
| 141 | int code = firetrk_playfield_ram[tile_index] & 0x3f; | |
| 142 | int color = (firetrk_playfield_ram[tile_index] >> 6) & 0x03; | |
| 119 | 143 | |
| 120 | int color = 0; | |
| 144 | if (*firetrk_blink && (code >= 0x04) && (code <= 0x0b)) | |
| 145 | color = 0; | |
| 121 | 146 | |
| 122 | /* palette 1 for crash and palette 2 for skid */ | |
| 147 | if (firetrk_flash) | |
| 148 | color = color | 0x04; | |
| 123 | 149 | |
| 124 | if (GAME_IS_FIRETRUCK) | |
| 125 | { | |
| 126 | if ((code & 0x30) != 0x00 || (code & 0x0c) == 0x00) | |
| 127 | { | |
| 128 | color = 1; /* palette 0, 1 */ | |
| 129 | } | |
| 130 | if ((code & 0x3c) == 0x0c) | |
| 131 | { | |
| 132 | color = 2; /* palette 0, 2 */ | |
| 133 | } | |
| 134 | } | |
| 150 | SET_TILE_INFO(1, code, color, 0); | |
| 151 | } | |
| 135 | 152 | |
| 136 | if (GAME_IS_SUPERBUG) | |
| 137 | { | |
| 138 | if ((code & 0x30) != 0x00) | |
| 139 | { | |
| 140 | color = 1; /* palette 0, 1 */ | |
| 141 | } | |
| 142 | if ((code & 0x38) == 0x00) | |
| 143 | { | |
| 144 | color = 2; /* palette 0, 2 */ | |
| 145 | } | |
| 146 | } | |
| 147 | 153 | |
| 148 | if (GAME_IS_MONTECARLO) | |
| 149 | { | |
| 150 | if ((code & 0xc0) == 0x40 || (code & 0xc0) == 0x80) | |
| 151 | { | |
| 152 | color = 2; /* palette 2, 1 */ | |
| 153 | } | |
| 154 | if ((code & 0xc0) == 0xc0) | |
| 155 | { | |
| 156 | color = 1; /* palette 2, 0 */ | |
| 157 | } | |
| 158 | if ((code & 0xc0) == 0x00) | |
| 159 | { | |
| 160 | color = 3; /* palette 2, 2 */ | |
| 161 | } | |
| 162 | if ((code & 0x30) == 0x30) | |
| 163 | { | |
| 164 | color = 0; /* palette 0, 0 */ | |
| 165 | } | |
| 166 | } | |
| 154 | static TILE_GET_INFO( superbug_get_tile_info1 ) | |
| 155 | { | |
| 156 | int code = firetrk_playfield_ram[tile_index] & 0x3f; | |
| 157 | int color = (firetrk_playfield_ram[tile_index] >> 6) & 0x03; | |
| 167 | 158 | |
| 168 | SET_TILE_INFO(2, code & 0x3f, color, 0); | |
| 169 | } | |
| 159 | if (*firetrk_blink && (code >= 0x08) && (code <= 0x0f)) | |
| 160 | color = 0; | |
| 170 | 161 | |
| 162 | if (firetrk_flash) | |
| 163 | color = color | 0x04; | |
| 171 | 164 | |
| 172 | WRITE8_HANDLER( firetrk_vert_w ) | |
| 173 | { | |
| 174 | tilemap_set_scrolly(tilemap1, 0, data); | |
| 175 | tilemap_set_scrolly(tilemap2, 0, data); | |
| 165 | SET_TILE_INFO(1, code, color, 0); | |
| 176 | 166 | } |
| 177 | 167 | |
| 178 | 168 | |
| 179 | ||
| 169 | static TILE | |
| 180 | 170 | { |
| 181 | tilemap_set_scrollx(tilemap1, 0, data - 37); | |
| 182 | tilemap_set_scrollx(tilemap2, 0, data - 37); | |
| 183 | } | |
| 171 | int code = firetrk_playfield_ram[tile_index] & 0x3f; | |
| 172 | int color = (firetrk_playfield_ram[tile_index] >> 6) & 0x03; | |
| 184 | 173 | |
| 174 | if (firetrk_flash) | |
| 175 | color = color | 0x04; | |
| 185 | 176 | |
| 186 | WRITE8_HANDLER( firetrk_drone_hpos_w ) | |
| 187 | { | |
| 188 | drone_hpos = data; | |
| 177 | SET_TILE_INFO(1, code, color, 0); | |
| 189 | 178 | } |
| 190 | 179 | |
| 191 | 180 | |
| 192 | ||
| 181 | static TILE | |
| 193 | 182 | { |
| 194 | drone_vpos = data; | |
| 183 | UINT8 code = firetrk_playfield_ram[tile_index] & 0x3f; | |
| 184 | int color = 0; | |
| 185 | ||
| 186 | /* palette 1 for crash and palette 2 for skid */ | |
| 187 | if (((code & 0x30) != 0x00) || ((code & 0x0c) == 0x00)) | |
| 188 | color = 1; /* palette 0, 1 */ | |
| 189 | ||
| 190 | if ((code & 0x3c) == 0x0c) | |
| 191 | color = 2; /* palette 0, 2 */ | |
| 192 | ||
| 193 | SET_TILE_INFO(2, code, color, 0); | |
| 195 | 194 | } |
| 196 | 195 | |
| 197 | 196 | |
| 198 | ||
| 197 | static TILE | |
| 199 | 198 | { |
| 200 | if (GAME_IS_FIRETRUCK) | |
| 201 | { | |
| 202 | car[0].number = data & 0x03; | |
| 199 | UINT8 code = firetrk_playfield_ram[tile_index] & 0x3f; | |
| 200 | int color = 0; | |
| 203 | 201 | |
| 204 | if (data & 0x10) /* swap xy */ | |
| 205 | { | |
| 206 | car[0].layout = 4; | |
| 207 | } | |
| 208 | else | |
| 209 | { | |
| 210 | car[0].layout = 3; | |
| 211 | } | |
| 202 | /* palette 1 for crash and palette 2 for skid */ | |
| 203 | if ((code & 0x30) != 0x00) | |
| 204 | color = 1; /* palette 0, 1 */ | |
| 212 | 205 | |
| 213 | car[0].flipx = data & 0x04; | |
| 214 | car[0].flipy = data & 0x08; | |
| 215 | } | |
| 206 | if ((code & 0x38) == 0x00) | |
| 207 | color = 2; /* palette 0, 2 */ | |
| 216 | 208 | |
| 217 | if (GAME_IS_SUPERBUG) | |
| 218 | { | |
| 219 | car[0].number = (data & 0x03) ^ 3; | |
| 209 | SET_TILE_INFO(2, code, color, 0); | |
| 210 | } | |
| 220 | 211 | |
| 221 | if (data & 0x10) /* swap xy */ | |
| 222 | { | |
| 223 | car[0].layout = 4; | |
| 224 | } | |
| 225 | else | |
| 226 | { | |
| 227 | car[0].layout = 3; | |
| 228 | } | |
| 229 | 212 | |
| 230 | car[0].flipx = data & 0x04; | |
| 231 | car[0].flipy = data & 0x08; | |
| 232 | } | |
| 213 | static TILE_GET_INFO( montecar_get_tile_info2 ) | |
| 214 | { | |
| 215 | UINT8 code = firetrk_playfield_ram[tile_index]; | |
| 216 | int color = 0; | |
| 233 | 217 | |
| 234 | if (GAME_IS_MONTECARLO) | |
| 235 | { | |
| 236 | car[0].number = data & 0x07; | |
| 218 | /* palette 1 for crash and palette 2 for skid */ | |
| 219 | if (((code & 0xc0) == 0x40) || ((code & 0xc0) == 0x80)) | |
| 220 | color = 2; /* palette 2, 1 */ | |
| 237 | 221 | |
| 238 | if (data & 0x80) | |
| 239 | { | |
| 240 | car[1].color |= 2; | |
| 241 | } | |
| 242 | else | |
| 243 | { | |
| 244 | car[1].color &= ~2; | |
| 245 | } | |
| 222 | if ((code & 0xc0) == 0xc0) | |
| 223 | color = 1; /* palette 2, 0 */ | |
| 246 | 224 | |
| 247 | car[0].flipx = data & 0x10; | |
| 248 | car[0].flipy = data & 0x08; | |
| 249 | } | |
| 225 | if ((code & 0xc0) == 0x00) | |
| 226 | color = 3; /* palette 2, 2 */ | |
| 227 | ||
| 228 | if ((code & 0x30) == 0x30) | |
| 229 | color = 0; /* palette 0, 0 */ | |
| 230 | ||
| 231 | SET_TILE_INFO(2, code & 0x3f, color, 0); | |
| 250 | 232 | } |
| 251 | 233 | |
| 252 | 234 | |
| 253 | ||
| 235 | V | |
| 254 | 236 | { |
| 255 | car[1].number = data & 0x07; | |
| 237 | helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); | |
| 238 | helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); | |
| 256 | 239 | |
| 257 | if (GAME_IS_FIRETRUCK) | |
| 258 | { | |
| 259 | car[1].flipx = data & 0x08; | |
| 260 | car[1].flipy = data & 0x10; | |
| 261 | } | |
| 262 | ||
| 263 | if (GAME_IS_MONTECARLO) | |
| 264 | { | |
| 265 | car[1].flipx = data & 0x10; | |
| 266 | car[1].flipy = data & 0x08; | |
| 267 | ||
| 268 | if (data & 0x80) | |
| 269 | { | |
| 270 | car[1].color |= 1; | |
| 271 | } | |
| 272 | else | |
| 273 | { | |
| 274 | car[1].color &= ~1; | |
| 275 | } | |
| 276 | } | |
| 240 | tilemap1 = tilemap_create(firetrk_get_tile_info1, tilemap_scan_rows, 16, 16, 16, 16); | |
| 241 | tilemap2 = tilemap_create(firetrk_get_tile_info2, tilemap_scan_rows, 16, 16, 16, 16); | |
| 277 | 242 | } |
| 278 | 243 | |
| 279 | 244 | |
| 280 | ||
| 245 | V | |
| 281 | 246 | { |
| 282 | firetrk_playfield_ram[offset] = data; | |
| 283 | tilemap_mark_tile_dirty(tilemap1, offset); | |
| 284 | tilemap_mark_tile_dirty(tilemap2, offset); | |
| 247 | helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); | |
| 248 | helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); | |
| 249 | ||
| 250 | tilemap1 = tilemap_create(superbug_get_tile_info1, tilemap_scan_rows, 16, 16, 16, 16); | |
| 251 | tilemap2 = tilemap_create(superbug_get_tile_info2, tilemap_scan_rows, 16, 16, 16, 16); | |
| 285 | 252 | } |
| 286 | 253 | |
| 287 | 254 | |
| 288 | VIDEO_START( | |
| 255 | VIDEO_START( mon | |
| 289 | 256 | { |
| 290 | 257 | helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 291 | 258 | helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 292 | 259 | |
| 293 | tilemap1 = tilemap_create(get_tile_info1, tilemap_scan_rows, 16, 16, 16, 16); | |
| 294 | tilemap2 = tilemap_create(get_tile_info2, tilemap_scan_rows, 16, 16, 16, 16); | |
| 260 | tilemap1 = tilemap_create(montecar_get_tile_info1, tilemap_scan_rows, 16, 16, 16, 16); | |
| 261 | tilemap2 = tilemap_create(montecar_get_tile_info2, tilemap_scan_rows, 16, 16, 16, 16); | |
| 262 | } | |
| 295 | 263 | |
| 296 | memset(&car[0], 0, sizeof (struct sprite_data)); | |
| 297 | memset(&car[1], 0, sizeof (struct sprite_data)); | |
| 298 | 264 | |
| 299 | if (GAME_IS_FIRETRUCK) | |
| 265 | static void firetrk_draw_car(gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect, int which, int flash) | |
| 266 | { | |
| 267 | int gfx_bank, code, color, flip_x, flip_y, x, y; | |
| 268 | ||
| 269 | if (which) | |
| 300 | 270 | { |
| 301 | car[0].layout = 3; | |
| 302 | car[1].layout = 5; | |
| 271 | gfx_bank = 5; | |
| 272 | code = *firetrk_drone_rot & 0x07; | |
| 273 | color = flash ? 1 : 0; | |
| 274 | flip_x = *firetrk_drone_rot & 0x08; | |
| 275 | flip_y = *firetrk_drone_rot & 0x10; | |
| 276 | x = (flip_x ? *firetrk_drone_x - 63 : 192 - *firetrk_drone_x) + 36; | |
| 277 | y = flip_y ? *firetrk_drone_y - 63 : 192 - *firetrk_drone_y; | |
| 303 | 278 | } |
| 304 | | |
| 279 | else | |
| 305 | 280 | { |
| 306 | car[0].layout = 3; | |
| 307 | car[1].layout = 0; | |
| 281 | gfx_bank = (*firetrk_car_rot & 0x10) ? 4 : 3; | |
| 282 | code = *firetrk_car_rot & 0x03; | |
| 283 | color = flash ? 1 : 0; | |
| 284 | flip_x = *firetrk_car_rot & 0x04; | |
| 285 | flip_y = *firetrk_car_rot & 0x08; | |
| 286 | x = 144; | |
| 287 | y = 104; | |
| 308 | 288 | } |
| 309 | if (GAME_IS_MONTECARLO) | |
| 310 | { | |
| 311 | car[0].layout = 3; | |
| 312 | car[1].layout = 4; | |
| 313 | } | |
| 289 | ||
| 290 | drawgfx(bitmap, gfx[gfx_bank], code, color, flip_x, flip_y, x, y, cliprect, TRANSPARENCY_PEN, 0); | |
| 314 | 291 | } |
| 315 | 292 | |
| 316 | 293 | |
| 317 | static void | |
| 294 | static void superbug_draw | |
| 318 | 295 | { |
| 319 | car[0].x = 144; | |
| 320 | car[0].y = 104; | |
| 296 | int gfx_bank = (*firetrk_car_rot & 0x10) ? 4 : 3; | |
| 297 | int code = ~*firetrk_car_rot & 0x03; | |
| 298 | int color = flash ? 1 : 0; | |
| 299 | int flip_x = *firetrk_car_rot & 0x04; | |
| 300 | int flip_y = *firetrk_car_rot & 0x08; | |
| 321 | 301 | |
| 322 | if (GAME_IS_FIRETRUCK) | |
| 323 | { | |
| 324 | car[1].x = car[1].flipx ? drone_hpos - 63 : 192 - drone_hpos; | |
| 325 | car[1].y = car[1].flipy ? drone_vpos - 63 : 192 - drone_vpos; | |
| 302 | drawgfx(bitmap, gfx[gfx_bank], code, color, flip_x, flip_y, 144, 104, cliprect, TRANSPARENCY_PEN, 0); | |
| 303 | } | |
| 326 | 304 | |
| 327 | car[1].x += 36; | |
| 328 | } | |
| 329 | 305 | |
| 330 | if (GAME_IS_MONTECARLO) | |
| 331 | { | |
| 332 | car[1].x = car[1].flipx ? drone_hpos - 31 : 224 - drone_hpos; | |
| 333 | car[1].y = car[1].flipy ? drone_vpos - 31 : 224 - drone_vpos; | |
| 306 | static void montecar_draw_car(gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect, int which, int is_collision_detection) | |
| 307 | { | |
| 308 | int gfx_bank, code, color, flip_x, flip_y, x, y; | |
| 334 | 309 | |
| 335 | car[1].x += 34; | |
| 310 | if (which) | |
| 311 | { | |
| 312 | gfx_bank = 4; | |
| 313 | code = *firetrk_drone_rot & 0x07; | |
| 314 | color = is_collision_detection ? 0 : (((*firetrk_car_rot & 0x80) >> 6) | ((*firetrk_drone_rot & 0x80) >> 7)); | |
| 315 | flip_x = *firetrk_drone_rot & 0x10; | |
| 316 | flip_y = *firetrk_drone_rot & 0x08; | |
| 317 | x = (flip_x ? *firetrk_drone_x - 31 : 224 - *firetrk_drone_x) + 34; | |
| 318 | y = flip_y ? *firetrk_drone_y - 31 : 224 - *firetrk_drone_y; | |
| 336 | 319 | } |
| 320 | else | |
| 321 | { | |
| 322 | gfx_bank = 3; | |
| 323 | code = *firetrk_car_rot & 0x07; | |
| 324 | color = 0; | |
| 325 | flip_x = *firetrk_car_rot & 0x10; | |
| 326 | flip_y = *firetrk_car_rot & 0x08; | |
| 327 | x = 144; | |
| 328 | y = 104; | |
| 329 | } | |
| 330 | ||
| 331 | drawgfx(bitmap, gfx[gfx_bank], code, color, flip_x, flip_y, x, y, cliprect, TRANSPARENCY_PEN, 0); | |
| 337 | 332 | } |
| 338 | 333 | |
| 339 | 334 | |
| 340 | static void draw_text(running_machine *machine, mame_bitmap* bitmap, const rectangle* cliprect) | |
| 335 | static void draw_text(gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *alpha_ram, | |
| 336 | int x, int count, int height) | |
| 341 | 337 | { |
| 342 | const UINT8* p = firetrk_alpha_num_ram; | |
| 343 | ||
| 344 | 338 | int i; |
| 345 | 339 | |
| 346 | for (i = 0; i < 2; i++) | |
| 347 | { | |
| 348 | int x = 0; | |
| 349 | int y = 0; | |
| 340 | for (i = 0; i < count; i++) | |
| 341 | drawgfx(bitmap, gfx[0], alpha_ram[i], 0, 0, 0, x, i * height, cliprect, TRANSPARENCY_NONE, 0); | |
| 342 | } | |
| 350 | 343 | |
| 351 | if (GAME_IS_SUPERBUG || GAME_IS_FIRETRUCK) | |
| 352 | { | |
| 353 | x = (i == 0) ? 296 : 8; | |
| 354 | } | |
| 355 | if (GAME_IS_MONTECARLO) | |
| 356 | { | |
| 357 | x = (i == 0) ? 24 : 16; | |
| 358 | } | |
| 359 | 344 | |
| 360 | for (y = 0; y < 256; y += machine->gfx[0]->width) | |
| 345 | static void check_collision(int which) | |
| 346 | { | |
| 347 | int y, x; | |
| 348 | ||
| 349 | for (y = playfield_window.min_y; y <= playfield_window.max_y; y++) | |
| 350 | for (x = playfield_window.min_x; x <= playfield_window.max_x; x++) | |
| 361 | 351 | { |
| 362 | drawgfx(bitmap, machine->gfx[0], *p++, 0, 0, 0, | |
| 363 | x, y, cliprect, TRANSPARENCY_NONE, 0); | |
| 352 | pen_t a = *BITMAP_ADDR16(helper1, y, x); | |
| 353 | pen_t b = *BITMAP_ADDR16(helper2, y, x); | |
| 354 | ||
| 355 | if (b != 0xff && (color1_mask >> a) & 1) | |
| 356 | firetrk_crash[which] = 1; | |
| 357 | ||
| 358 | if (b != 0xff && (color2_mask >> a) & 1) | |
| 359 | firetrk_skid[which] = 1; | |
| 364 | 360 | } |
| 365 | } | |
| 366 | 361 | } |
| 367 | 362 | |
| 368 | 363 | |
| 369 | 364 | VIDEO_UPDATE( firetrk ) |
| 370 | 365 | { |
| 371 | int i; | |
| 366 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); | |
| 367 | tilemap_set_scrollx(tilemap1, 0, *firetrk_scroll_x - 37); | |
| 368 | tilemap_set_scrollx(tilemap2, 0, *firetrk_scroll_x - 37); | |
| 369 | tilemap_set_scrolly(tilemap1, 0, *firetrk_scroll_y); | |
| 370 | tilemap_set_scrolly(tilemap2, 0, *firetrk_scroll_y); | |
| 372 | 371 | |
| 372 | fillbitmap(bitmap, 0, cliprect); | |
| 373 | 373 | tilemap_draw(bitmap, &playfield_window, tilemap1, 0, 0); |
| 374 | firetrk_draw_car(machine->gfx, bitmap, &playfield_window, 0, firetrk_flash); | |
| 375 | firetrk_draw_car(machine->gfx, bitmap, &playfield_window, 1, firetrk_flash); | |
| 376 | draw_text(machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x00, 296, 0x10, 0x10); | |
| 377 | draw_text(machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x10, 8, 0x10, 0x10); | |
| 374 | 378 | |
| 375 | calc_car_positions(); | |
| 376 | ||
| 377 | for (i = 1; i >= 0; i--) | |
| 379 | if (cliprect->max_y == machine->screen[screen].visarea.max_y) | |
| 378 | 380 | { |
| 379 | if (GAME_IS_SUPERBUG && i == 1) | |
| 380 | { | |
| 381 | continue; | |
| 382 | } | |
| 381 | tilemap_draw(helper1, &playfield_window, tilemap2, 0, 0); | |
| 383 | 382 | |
| 384 | drawgfx(bitmap, | |
| 385 | machine->gfx[car[i].layout], | |
| 386 | car[i].number, | |
| 387 | car[i].color, | |
| 388 | car[i].flipx, | |
| 389 | car[i].flipy, | |
| 390 | car[i].x, | |
| 391 | car[i].y, | |
| 392 | &playfield_window, | |
| 393 | TRANSPARENCY_PEN, 0); | |
| 383 | fillbitmap(helper2, 0xff, &playfield_window); | |
| 384 | firetrk_draw_car(machine->gfx, helper2, &playfield_window, 0, FALSE); | |
| 385 | check_collision(0); | |
| 386 | ||
| 387 | fillbitmap(helper2, 0xff, &playfield_window); | |
| 388 | firetrk_draw_car(machine->gfx, helper2, &playfield_window, 1, FALSE); | |
| 389 | check_collision(1); | |
| 390 | ||
| 391 | *firetrk_blink = FALSE; | |
| 394 | 392 | } |
| 395 | 393 | |
| 396 | draw_text(machine, bitmap, cliprect); | |
| 397 | 394 | return 0; |
| 398 | 395 | } |
| 399 | 396 | |
| 400 | 397 | |
| 401 | VIDEO_E | |
| 398 | VIDEO_UPDATE | |
| 402 | 399 | { |
| 403 | int i; | |
| 400 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); | |
| 401 | tilemap_set_scrollx(tilemap1, 0, *firetrk_scroll_x - 37); | |
| 402 | tilemap_set_scrollx(tilemap2, 0, *firetrk_scroll_x - 37); | |
| 403 | tilemap_set_scrolly(tilemap1, 0, *firetrk_scroll_y); | |
| 404 | tilemap_set_scrolly(tilemap2, 0, *firetrk_scroll_y); | |
| 404 | 405 | |
| 405 | tilemap_draw(helper1, &playfield_window, tilemap2, 0, 0); | |
| 406 | fillbitmap(bitmap, 0, cliprect); | |
| 407 | tilemap_draw(bitmap, &playfield_window, tilemap1, 0, 0); | |
| 408 | superbug_draw_car(machine->gfx, bitmap, &playfield_window, firetrk_flash); | |
| 409 | draw_text(machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x00, 296, 0x10, 0x10); | |
| 410 | draw_text(machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x10, 8, 0x10, 0x10); | |
| 406 | 411 | |
| 407 | calc_car_positions(); | |
| 408 | ||
| 409 | for (i = 1; i >= 0; i--) | |
| 412 | if (cliprect->max_y == machine->screen[screen].visarea.max_y) | |
| 410 | 413 | { |
| 411 | int width = machine->gfx[car[i].layout]->width; | |
| 412 | int height = machine->gfx[car[i].layout]->height; | |
| 414 | tilemap_draw(helper1, &playfield_window, tilemap2, 0, 0); | |
| 413 | 415 | |
| 414 | int x; | |
| 415 | int y; | |
| 416 | fillbitmap(helper2, 0xff, &playfield_window); | |
| 417 | superbug_draw_car(machine->gfx, helper2, &playfield_window, FALSE); | |
| 418 | check_collision(0); | |
| 416 | 419 | |
| 417 | if (GAME_IS_SUPERBUG && i == 1) | |
| 418 | { | |
| 419 | continue; | |
| 420 | } | |
| 420 | *firetrk_blink = FALSE; | |
| 421 | } | |
| 421 | 422 | |
| 422 | fillbitmap(helper2, 0xff, NULL); | |
| 423 | drawgfx(helper2, | |
| 424 | machine->gfx[car[i].layout], | |
| 425 | car[i].number, | |
| 426 | 0, | |
| 427 | car[i].flipx, | |
| 428 | car[i].flipy, | |
| 429 | car[i].x, | |
| 430 | car[i].y, | |
| 431 | &playfield_window, | |
| 432 | TRANSPARENCY_PEN, 0); | |
| 423 | return 0; | |
| 424 | } | |
| 433 | 425 | |
| 434 | for (y = car[i].y; y < car[i].y + height; y++) | |
| 435 | { | |
| 436 | for (x = car[i].x; x < car[i].x + width; x++) | |
| 437 | { | |
| 438 | pen_t a; | |
| 439 | pen_t b; | |
| 440 | 426 | |
| 441 | if (x < playfield_window.min_x) | |
| 442 | continue; | |
| 443 | if (x > playfield_window.max_x) | |
| 444 | continue; | |
| 445 | if (y < playfield_window.min_y) | |
| 446 | continue; | |
| 447 | if (y > playfield_window.max_y) | |
| 448 | continue; | |
| 427 | VIDEO_UPDATE( montecar ) | |
| 428 | { | |
| 429 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); | |
| 430 | tilemap_set_scrollx(tilemap1, 0, *firetrk_scroll_x - 37); | |
| 431 | tilemap_set_scrollx(tilemap2, 0, *firetrk_scroll_x - 37); | |
| 432 | tilemap_set_scrolly(tilemap1, 0, *firetrk_scroll_y); | |
| 433 | tilemap_set_scrolly(tilemap2, 0, *firetrk_scroll_y); | |
| 449 | 434 | |
| 450 | a = *BITMAP_ADDR16(helper1, y, x); | |
| 451 | b = *BITMAP_ADDR16(helper2, y, x); | |
| 435 | fillbitmap(bitmap, 0x2c, cliprect); | |
| 436 | tilemap_draw(bitmap, &playfield_window, tilemap1, 0, 0); | |
| 437 | montecar_draw_car(machine->gfx, bitmap, &playfield_window, 0, FALSE); | |
| 438 | montecar_draw_car(machine->gfx, bitmap, &playfield_window, 1, FALSE); | |
| 439 | draw_text(machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x00, 24, 0x20, 0x08); | |
| 440 | draw_text(machine->gfx, bitmap, cliprect, firetrk_alpha_num_ram + 0x20, 16, 0x20, 0x08); | |
| 452 | 441 | |
| 453 | if (b != 0xff && (firetrk_color1_mask >> a) & 1) | |
| 454 | { | |
| 455 | firetrk_crash[i] = 1; | |
| 456 | } | |
| 457 | if (b != 0xff && (firetrk_color2_mask >> a) & 1) | |
| 458 | { | |
| 459 | firetrk_skid[i] = 1; | |
| 460 | } | |
| 461 | } | |
| 462 | } | |
| 463 | } | |
| 464 | ||
| 465 | if (blink) | |
| 442 | if (cliprect->max_y == machine->screen[screen].visarea.max_y) | |
| 466 | 443 | { |
| 467 | firetrk_set_blink(0); | |
| 444 | tilemap_draw(helper1, &playfield_window, tilemap2, 0, 0); | |
| 445 | ||
| 446 | fillbitmap(helper2, 0xff, &playfield_window); | |
| 447 | montecar_draw_car(machine->gfx, helper2, &playfield_window, 0, TRUE); | |
| 448 | check_collision(0); | |
| 449 | ||
| 450 | fillbitmap(helper2, 0xff, &playfield_window); | |
| 451 | montecar_draw_car(machine->gfx, helper2, &playfield_window, 1, TRUE); | |
| 452 | check_collision(1); | |
| 468 | 453 | } |
| 454 | ||
| 455 | return 0; | |
| 469 | 456 | } |
| r1877 | r1878 | |
|---|---|---|
| 172 | 172 | * |
| 173 | 173 | *************************************/ |
| 174 | 174 | |
| 175 | static void draw_background(running_machine *machine, | |
| 175 | static void draw_background(running_machine *machine, | |
| 176 | 176 | { |
| 177 | 177 | int y; |
| 178 | 178 | |
| r1877 | r1878 | |
| 187 | 187 | * |
| 188 | 188 | *************************************/ |
| 189 | 189 | |
| 190 | static void draw_sprites(running_machine *machine, | |
| 190 | static void draw_sprites(running_machine *machine, | |
| 191 | 191 | { |
| 192 | 192 | int offs; |
| 193 | 193 |
| r1877 | r1878 | |
|---|---|---|
| 94 | 94 | tilemap_set_scroll_rows(bg_tilemap, 4); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | static void draw_sprites(running_machine *machine, | |
| 97 | static void draw_sprites(running_machine *machine, | |
| 98 | 98 | { |
| 99 | 99 | rectangle clip = *cliprect; |
| 100 | 100 | const gfx_element *gfx = machine->gfx[1]; |
| r1877 | r1878 | |
|---|---|---|
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | |
| 283 | static void draw_fixed_layer( | |
| 283 | static void draw_fixed_layer( | |
| 284 | 284 | { |
| 285 | 285 | int x; |
| 286 | 286 | |
| r1877 | r1878 | |
| 809 | 809 | |
| 810 | 810 | /* accessing the LSB only is not mapped */ |
| 811 | 811 | if (mem_mask == 0xff00) |
| 812 | ret = neogeo_unmapped_r(0, 0) & 0x00ff; | |
| 812 | ret = neogeo_unmapped_r(machine, 0, 0) & 0x00ff; | |
| 813 | 813 | else |
| 814 | 814 | { |
| 815 | 815 | switch (offset) |
| r1877 | r1878 | |
|---|---|---|
| 420 | 420 | g = (paletteram32[offset] >> 8) & 0xff; |
| 421 | 421 | b = (paletteram32[offset] >> 0) & 0xff; |
| 422 | 422 | |
| 423 | palette_set_color( | |
| 423 | palette_set_color(machine,offset,MAKE_RGB(r,g,b)); | |
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | WRITE32_HANDLER( konamigx_palette2_w ) |
| r1877 | r1878 | |
| 437 | 437 | g = (paletteram32[offset] >> 8) & 0xff; |
| 438 | 438 | b = (paletteram32[offset] >> 0) & 0xff; |
| 439 | 439 | |
| 440 | palette_set_color( | |
| 440 | palette_set_color(machine,offset,MAKE_RGB(r,g,b)); | |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | // main monitor for type 3 |
| r1877 | r1878 | |
| 447 | 447 | |
| 448 | 448 | paletteram16 = (UINT16 *)paletteram32; |
| 449 | 449 | if (ACCESSING_MSW32) |
| 450 | paletteram16_xRRRRRGGGGGBBBBB_word_w(offset*2, data >> 16, mem_mask >> 16); | |
| 450 | paletteram16_xRRRRRGGGGGBBBBB_word_w(machine, offset*2, data >> 16, mem_mask >> 16); | |
| 451 | 451 | if (ACCESSING_LSW32) |
| 452 | paletteram16_xRRRRRGGGGGBBBBB_word_w(offset*2+1, data, mem_mask); | |
| 452 | paletteram16_xRRRRRGGGGGBBBBB_word_w(machine, offset*2+1, data, mem_mask); | |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | // sub monitor for type 3 |
| r1877 | r1878 | |
| 463 | 463 | |
| 464 | 464 | paletteram16 = (UINT16 *)paletteram32; |
| 465 | 465 | if (ACCESSING_MSW32) |
| 466 | paletteram16_xRRRRRGGGGGBBBBB_word_w(offset*2, data >> 16, mem_mask >> 16); | |
| 466 | paletteram16_xRRRRRGGGGGBBBBB_word_w(machine, offset*2, data >> 16, mem_mask >> 16); | |
| 467 | 467 | if (ACCESSING_LSW32) |
| 468 | paletteram16_xRRRRRGGGGGBBBBB_word_w(offset*2+1, data, mem_mask); | |
| 468 | paletteram16_xRRRRRGGGGGBBBBB_word_w(machine, offset*2+1, data, mem_mask); | |
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | WRITE32_HANDLER( konamigx_tilebank_w ) |
| r1877 | r1878 | |
|---|---|---|
| 137 | 137 | colortable_configure_tilemap_groups(machine->colortable, sprcros2_fgtilemap, machine->gfx[2], 0); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | static void draw_sprites(running_machine *machine, | |
| 140 | static void draw_sprites(running_machine *machine, | |
| 141 | 141 | { |
| 142 | 142 | int offs,sx,sy,color,flipx,flipy; |
| 143 | 143 |
| r1877 | r1878 | |
|---|---|---|
| 129 | 129 | * |
| 130 | 130 | *************************************/ |
| 131 | 131 | |
| 132 | void thunderj_mark_high_palette( | |
| 132 | void thunderj_mark_high_palette( | |
| 133 | 133 | { |
| 134 | 134 | #define START_MARKER ((4 << ATARIMO_PRIORITY_SHIFT) | 2) |
| 135 | 135 | #define END_MARKER ((4 << ATARIMO_PRIORITY_SHIFT) | 4) |
| r1877 | r1878 | |
| 155 | 155 | VIDEO_UPDATE( thunderj ) |
| 156 | 156 | { |
| 157 | 157 | struct atarimo_rect_list rectlist; |
| 158 | | |
| 158 | | |
| 159 | 159 | int x, y, r; |
| 160 | 160 | |
| 161 | 161 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 17 | 17 | void redclash_set_stars_enable( UINT8 on ); |
| 18 | 18 | void redclash_update_stars_state(void); |
| 19 | 19 | void redclash_set_stars_speed( UINT8 speed ); |
| 20 | void redclash_draw_stars( | |
| 20 | void redclash_draw_stars( | |
| 21 | 21 | |
| 22 | 22 | static tilemap *bg_tilemap; |
| 23 | 23 | static tilemap *grid_tilemap; |
| r1877 | r1878 | |
| 307 | 307 | tilemap_set_transparent_pen(bg_tilemap, 0); |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | static void draw_sprites(running_machine *machine, | |
| 310 | static void draw_sprites(running_machine *machine, | |
| 311 | 311 | { |
| 312 | 312 | int offs; |
| 313 | 313 |
| r1877 | r1878 | |
|---|---|---|
| 340 | 340 | |
| 341 | 341 | static WRITE8_HANDLER( combascb_sh_irqtrigger_w ) |
| 342 | 342 | { |
| 343 | soundlatch_w(offset,data); | |
| 344 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 343 | soundlatch_w(machine,offset,data); | |
| 344 | cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff); | |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | static READ8_HANDLER( combascb_io_r ) |
| r1877 | r1878 | |
| 440 | 440 | memset( combasc_page[1], 0x00, 0x2000 ); |
| 441 | 441 | |
| 442 | 442 | combasc_bank_select = -1; |
| 443 | combasc_bankselect_w( 0,0 ); | |
| 443 | combasc_bankselect_w( machine,0,0 ); | |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | WRITE8_HANDLER( combasc_pf_control_w ) |
| r1877 | r1878 | |
| 477 | 477 | |
| 478 | 478 | ***************************************************************************/ |
| 479 | 479 | |
| 480 | static void draw_sprites(running_machine *machine, | |
| 480 | static void draw_sprites(running_machine *machine, | |
| 481 | 481 | { |
| 482 | 482 | int base_color = (circuit*4)*16+(K007121_ctrlram[circuit][6]&0x10)*2; |
| 483 | 483 | |
| r1877 | r1878 | |
| 600 | 600 | |
| 601 | 601 | ***************************************************************************/ |
| 602 | 602 | |
| 603 | static void bootleg_draw_sprites(running_machine *machine, | |
| 603 | static void bootleg_draw_sprites(running_machine *machine, | |
| 604 | 604 | { |
| 605 | 605 | const gfx_element *gfx = machine->gfx[circuit+2]; |
| 606 | 606 |
| r1877 | r1878 | |
|---|---|---|
| 85 | 85 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | static void draw_sprites(running_machine *machine, | |
| 88 | static void draw_sprites(running_machine *machine, | |
| 89 | 89 | { |
| 90 | 90 | int offs; |
| 91 | 91 |
| r1877 | r1878 | |
|---|---|---|
| 65 | 65 | /* our chip state */ |
| 66 | 66 | typedef struct { |
| 67 | 67 | running_machine *machine; /* execution context */ |
| 68 | | |
| 68 | | |
| 69 | 69 | UINT8 *videoram; /* video ram */ |
| 70 | 70 | UINT8 *spriteram; /* sprite ram */ |
| 71 | 71 | pen_t *colortable; /* color table modified at run time */ |
| r1877 | r1878 | |
| 385 | 385 | static void draw_background(const int num, UINT8 *line_priority ) |
| 386 | 386 | { |
| 387 | 387 | /* cache some values locally */ |
| 388 | | |
| 388 | | |
| 389 | 389 | const int *ppu_regs = &chips[num].regs[0]; |
| 390 | 390 | const int scanline = chips[num].scanline; |
| 391 | 391 | const int refresh_data = chips[num].refresh_data; |
| r1877 | r1878 | |
| 524 | 524 | static void draw_sprites(const int num, UINT8 *line_priority ) |
| 525 | 525 | { |
| 526 | 526 | /* cache some values locally */ |
| 527 | | |
| 527 | | |
| 528 | 528 | const int scanline = chips[num].scanline; |
| 529 | 529 | const int gfx_bank = intf->gfx_layout_number[num]; |
| 530 | 530 | const int total_elements = chips[num].machine->gfx[gfx_bank]->total_elements; |
| r1877 | r1878 | |
| 726 | 726 | draw_background(num, line_priority ); |
| 727 | 727 | else |
| 728 | 728 | { |
| 729 | | |
| 729 | | |
| 730 | 730 | const int scanline = chips[num].scanline; |
| 731 | 731 | UINT8 color_mask; |
| 732 | 732 | UINT16 back_pen; |
| r1877 | r1878 | |
| 777 | 777 | } |
| 778 | 778 | else |
| 779 | 779 | { |
| 780 | | |
| 780 | | |
| 781 | 781 | const int scanline = this_ppu->scanline; |
| 782 | 782 | UINT8 color_mask; |
| 783 | 783 | UINT16 back_pen; |
| r1877 | r1878 | |
| 1335 | 1335 | * PPU Rendering |
| 1336 | 1336 | * |
| 1337 | 1337 | *************************************/ |
| 1338 | void ppu2c0x_render( int num, | |
| 1338 | void ppu2c0x_render( int num, | |
| 1339 | 1339 | { |
| 1340 | 1340 | /* check bounds */ |
| 1341 | 1341 | if ( num >= intf->num ) |
| r1877 | r1878 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | static int *dirtychar; |
| 11 | 11 | |
| 12 | static | |
| 12 | static | |
| 13 | 13 | static int sl_bank,bg_on,sky_on,sprite_color_base,bg_scrollx; |
| 14 | 14 | |
| 15 | 15 | |
| r1877 | r1878 | |
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | |
| 92 | static void draw_sky( | |
| 92 | static void draw_sky( | |
| 93 | 93 | { |
| 94 | 94 | int x,y; |
| 95 | 95 | |
| r1877 | r1878 | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
| 102 | static void draw_bg(running_machine *machine, | |
| 102 | static void draw_bg(running_machine *machine, | |
| 103 | 103 | { |
| 104 | 104 | int offs; |
| 105 | 105 | int scroll[256]; |
| r1877 | r1878 | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
| 139 | static void draw_fg(running_machine *machine, | |
| 139 | static void draw_fg(running_machine *machine, | |
| 140 | 140 | { |
| 141 | 141 | int offs; |
| 142 | 142 | |
| r1877 | r1878 | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | |
| 166 | static void draw_sprites(running_machine *machine, | |
| 166 | static void draw_sprites(running_machine *machine, | |
| 167 | 167 | { |
| 168 | 168 | int offs; |
| 169 | 169 |
| r1877 | r1878 | |
|---|---|---|
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | |
| 99 | static void draw_sprites(running_machine *machine, | |
| 99 | static void draw_sprites(running_machine *machine, | |
| 100 | 100 | { |
| 101 | 101 | int offs; |
| 102 | 102 |
| r1877 | r1878 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | static UINT16 *LSFR; |
| 35 | 35 | |
| 36 | static | |
| 36 | static | |
| 37 | 37 | |
| 38 | 38 | static tilemap *bg_tilemap; |
| 39 | 39 | |
| r1877 | r1878 | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | |
| 172 | static void draw_starfield( | |
| 172 | static void draw_starfield( | |
| 173 | 173 | { |
| 174 | 174 | /* |
| 175 | 175 | * The LSFR is reset once per frame at the position of |
| r1877 | r1878 | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | |
| 206 | static void draw_sprites(running_machine *machine, | |
| 206 | static void draw_sprites(running_machine *machine, | |
| 207 | 207 | { |
| 208 | 208 | int i; |
| 209 | 209 | |
| r1877 | r1878 | |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | |
| 225 | static void draw_spaceship(running_machine *machine, | |
| 225 | static void draw_spaceship(running_machine *machine, | |
| 226 | 226 | { |
| 227 | 227 | double scaler = -5 * log(1 - starshp1_ship_size / 256.0); /* ? */ |
| 228 | 228 | |
| r1877 | r1878 | |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | |
| 251 | static void draw_phasor( | |
| 251 | static void draw_phasor( | |
| 252 | 252 | { |
| 253 | 253 | int i; |
| 254 | 254 | |
| r1877 | r1878 | |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | |
| 280 | static void draw_circle_line( | |
| 280 | static void draw_circle_line( | |
| 281 | 281 | { |
| 282 | 282 | if (y >= 0 && y <= bitmap->height - 1) |
| 283 | 283 | { |
| r1877 | r1878 | |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | |
| 308 | static void draw_circle( | |
| 308 | static void draw_circle( | |
| 309 | 309 | { |
| 310 | 310 | int cx = get_circle_hpos(); |
| 311 | 311 | int cy = get_circle_vpos(); |
| r1877 | r1878 | |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | |
| 337 | static int spaceship_collision( | |
| 337 | static int spaceship_collision( | |
| 338 | 338 | { |
| 339 | 339 | int x; |
| 340 | 340 | int y; |
| r1877 | r1878 | |
|---|---|---|
| 103 | 103 | void ppu2c0x_reset( int num, int scan_scale ); |
| 104 | 104 | void ppu2c0x_set_videorom_bank( int num, int start_page, int num_pages, int bank, int bank_size ); |
| 105 | 105 | void ppu2c0x_spriteram_dma(int num, const UINT8 page ); |
| 106 | void ppu2c0x_render( int num, | |
| 106 | void ppu2c0x_render( int num, | |
| 107 | 107 | int ppu2c0x_get_pixel( int num, int x, int y ); |
| 108 | 108 | int ppu2c0x_get_colorbase( int num ); |
| 109 | 109 | int ppu2c0x_get_current_scanline( int num ); |
| r1877 | r1878 | |
|---|---|---|
| 145 | 145 | |
| 146 | 146 | ***************************************************************************/ |
| 147 | 147 | |
| 148 | static void draw_sprites(running_machine *machine, | |
| 148 | static void draw_sprites(running_machine *machine, | |
| 149 | 149 | { |
| 150 | 150 | int offs; |
| 151 | 151 |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | /* Sprites */ |
| 12 | 12 | |
| 13 | static void draw_sprites(running_machine *machine, | |
| 13 | static void draw_sprites(running_machine *machine, | |
| 14 | 14 | { |
| 15 | 15 | /*- SPR RAM Format -** |
| 16 | 16 |
| r1877 | r1878 | |
|---|---|---|
| 369 | 369 | spritebank_buffered[7] = spritebank_buffered[6] + 0x400; |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | static void taito_f2_tc360_spritemixdraw( | |
| 372 | static void taito_f2_tc360_spritemixdraw( | |
| 373 | 373 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 374 | 374 | const rectangle *clip,int scalex, int scaley) |
| 375 | 375 | { |
| r1877 | r1878 | |
| 517 | 517 | } |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | static void draw_sprites(running_machine *machine, | |
| 520 | static void draw_sprites(running_machine *machine, | |
| 521 | 521 | { |
| 522 | 522 | /* |
| 523 | 523 | Sprite format: |
| r1877 | r1878 | |
| 1124 | 1124 | |
| 1125 | 1125 | |
| 1126 | 1126 | |
| 1127 | static void draw_roz_layer( | |
| 1127 | static void draw_roz_layer( | |
| 1128 | 1128 | { |
| 1129 | 1129 | if (has_TC0280GRD()) |
| 1130 | 1130 | TC0280GRD_zoom_draw(bitmap,cliprect,f2_pivot_xdisp,f2_pivot_ydisp,priority); |
| r1877 | r1878 | |
|---|---|---|
| 131 | 131 | tilemap_set_scroll_rows(bg_tilemap, 32); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | static void gberet_draw_sprites(running_machine *machine, | |
| 134 | static void gberet_draw_sprites(running_machine *machine, | |
| 135 | 135 | { |
| 136 | 136 | int offs; |
| 137 | 137 | UINT8 *sr; |
| r1877 | r1878 | |
| 190 | 190 | tilemap_set_scrollx(bg_tilemap, offset, scroll + 64-8); |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | static void gberetb_draw_sprites(running_machine *machine, | |
| 193 | static void gberetb_draw_sprites(running_machine *machine, | |
| 194 | 194 | { |
| 195 | 195 | int offs; |
| 196 | 196 |
| r1877 | r1878 | |
|---|---|---|
| 245 | 245 | |
| 246 | 246 | ***************************************************************************/ |
| 247 | 247 | |
| 248 | static void draw_sprites(running_machine *machine, | |
| 248 | static void draw_sprites(running_machine *machine, | |
| 249 | 249 | { |
| 250 | 250 | int offs,sx,sy; |
| 251 | 251 |
| r1877 | r1878 | |
|---|---|---|
| 175 | 175 | gottlieb_video_start_common(); |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | static void draw_sprites(running_machine *machine, | |
| 178 | static void draw_sprites(running_machine *machine, | |
| 179 | 179 | { |
| 180 | 180 | int offs; |
| 181 | 181 |
| r1877 | r1878 | |
|---|---|---|
| 161 | 161 | (which+order),color,flipx,flipy,sx,sy, \ |
| 162 | 162 | cliprect,TRANSPARENCY_PEN,0); |
| 163 | 163 | |
| 164 | static void draw_sprites(running_machine* machine, | |
| 164 | static void draw_sprites(running_machine* machine, | |
| 165 | 165 | { |
| 166 | 166 | const gfx_element *gfx = machine->gfx[1]; |
| 167 | 167 |
| r1877 | r1878 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | ***************************************************************************/ |
| 51 | 51 | |
| 52 | static void mrokumei_handleblit( int rom_base ) | |
| 52 | static void mrokumei_handleblit( running_machine *machine, int rom_base ) | |
| 53 | 53 | { |
| 54 | 54 | int i; |
| 55 | 55 | int DestParam; |
| r1877 | r1878 | |
| 117 | 117 | } /* i!=0 */ |
| 118 | 118 | |
| 119 | 119 | if (data) /* 00 is a nop */ |
| 120 | mrokumei_videoram_w( BaseAddr + DestAddr, data ); | |
| 120 | mrokumei_videoram_w( machine, BaseAddr + DestAddr, data ); | |
| 121 | 121 | |
| 122 | 122 | if (homedata_vreg[1] & 0x80) /* flip screen */ |
| 123 | 123 | { |
| r1877 | r1878 | |
| 136 | 136 | cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,HOLD_LINE); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | static void reikaids_handleblit( int rom_base ) | |
| 139 | static void reikaids_handleblit( running_machine *machine, int rom_base ) | |
| 140 | 140 | { |
| 141 | 141 | int i; |
| 142 | 142 | UINT16 DestParam; |
| r1877 | r1878 | |
| 221 | 221 | addr ^= 0x007c; |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | reikaids_videoram_w( addr, dat ); | |
| 224 | reikaids_videoram_w( machine, addr, dat ); | |
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
| r1877 | r1878 | |
| 236 | 236 | cpunum_set_input_line(Machine, 0,M6809_FIRQ_LINE,HOLD_LINE); |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | static void pteacher_handleblit( int rom_base ) | |
| 239 | static void pteacher_handleblit( running_machine *machine, int rom_base ) | |
| 240 | 240 | { |
| 241 | 241 | int i; |
| 242 | 242 | int DestParam; |
| r1877 | r1878 | |
| 309 | 309 | if ((addr & 0x2080) == 0) |
| 310 | 310 | { |
| 311 | 311 | addr = ((addr & 0xc000) >> 2) | ((addr & 0x1f00) >> 1) | (addr & 0x7f); |
| 312 | pteacher_videoram_w( addr, data ); | |
| 312 | pteacher_videoram_w( machine, addr, data ); | |
| 313 | 313 | } |
| 314 | 314 | } |
| 315 | 315 | |
| r1877 | r1878 | |
| 651 | 651 | |
| 652 | 652 | WRITE8_HANDLER( mrokumei_blitter_start_w ) |
| 653 | 653 | { |
| 654 | if (data & 0x80) mrokumei_handleblit(((blitter_bank & 0x04) >> 2) * 0x10000); | |
| 654 | if (data & 0x80) mrokumei_handleblit(machine, ((blitter_bank & 0x04) >> 2) * 0x10000); | |
| 655 | 655 | |
| 656 | 656 | /* bit 0 = bank switch; used by hourouki to access the |
| 657 | 657 | optional service mode ROM (not available in current dump) */ |
| r1877 | r1878 | |
| 659 | 659 | |
| 660 | 660 | WRITE8_HANDLER( reikaids_blitter_start_w ) |
| 661 | 661 | { |
| 662 | reikaids_handleblit((blitter_bank & 3) * 0x10000); | |
| 662 | reikaids_handleblit(machine, (blitter_bank & 3) * 0x10000); | |
| 663 | 663 | } |
| 664 | 664 | |
| 665 | 665 | WRITE8_HANDLER( pteacher_blitter_start_w ) |
| 666 | 666 | { |
| 667 | pteacher_handleblit((blitter_bank >> 5) * 0x10000 & (memory_region_length(REGION_USER1) - 1)); | |
| 667 | pteacher_handleblit(machine, (blitter_bank >> 5) * 0x10000 & (memory_region_length(REGION_USER1) - 1)); | |
| 668 | 668 | } |
| 669 | 669 | |
| 670 | 670 |
| r1877 | r1878 | |
|---|---|---|
| 24 | 24 | static int is_2bpp; |
| 25 | 25 | static UINT8 int_condition; |
| 26 | 26 | |
| 27 | static mame_bitmap *background_bitmap; | |
| 28 | static mame_bitmap *motion_object_1_vid; | |
| 29 | static mame_bitmap *motion_object_2_vid; | |
| 30 | static mame_bitmap *motion_object_2_clip; | |
| 27 | static bitmap_t *background_bitmap; | |
| 28 | static bitmap_t *motion_object_1_vid; | |
| 29 | static bitmap_t *motion_object_2_vid; | |
| 30 | static bitmap_t *motion_object_2_clip; | |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | |
| r1877 | r1878 | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | |
| 232 | static void draw_sprites(running_machine *machine, | |
| 232 | static void draw_sprites(running_machine *machine, | |
| 233 | 233 | { |
| 234 | 234 | /* draw sprite 2 first */ |
| 235 | 235 | int sprite_set_2 = ((*exidy_sprite_enable & 0x40) != 0); |
| r1877 | r1878 | |
|---|---|---|
| 52 | 52 | |
| 53 | 53 | WRITE8_HANDLER( xxmissio_paletteram_w ) |
| 54 | 54 | { |
| 55 | paletteram_BBGGRRII_w(offset,data); | |
| 55 | paletteram_BBGGRRII_w(machine,offset,data); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /****************************************************************************/ |
| r1877 | r1878 | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| 89 | static void draw_sprites( | |
| 89 | static void draw_sprites( | |
| 90 | 90 | { |
| 91 | 91 | int offs; |
| 92 | 92 | int chr,col; |
| r1877 | r1878 | |
|---|---|---|
| 7 | 7 | extern UINT16 *mugsmash_videoram1, *mugsmash_videoram2, *mugs_spriteram; |
| 8 | 8 | extern UINT16 *mugsmash_regs1, *mugsmash_regs2; |
| 9 | 9 | |
| 10 | static void draw_sprites(running_machine *machine, | |
| 10 | static void draw_sprites(running_machine *machine, | |
| 11 | 11 | { |
| 12 | 12 | |
| 13 | 13 | /* Each Sprite takes 16 bytes, 5 used? */ |
| r1877 | r1878 | |
|---|---|---|
| 59 | 59 | 8, 8, 32, 32); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | static void draw_sprites(running_machine *machine, | |
| 62 | static void draw_sprites(running_machine *machine, | |
| 63 | 63 | { |
| 64 | 64 | int offs; |
| 65 | 65 |
| r1877 | r1878 | |
|---|---|---|
| 21 | 21 | static int hyhoo_highcolorflag; |
| 22 | 22 | static int hyhoo_flipscreen; |
| 23 | 23 | |
| 24 | static | |
| 24 | static | |
| 25 | 25 | static void hyhoo_gfxdraw(void); |
| 26 | 26 | |
| 27 | 27 | |
| r1877 | r1878 | |
| 30 | 30 | switch (offset) |
| 31 | 31 | { |
| 32 | 32 | case 0x00: blitter_src_addr = (blitter_src_addr & 0xff00) | data; |
| 33 | nb1413m3_gfxradr_l_w(0, data); break; | |
| 33 | nb1413m3_gfxradr_l_w(machine, 0, data); break; | |
| 34 | 34 | case 0x01: blitter_src_addr = (blitter_src_addr & 0x00ff) | (data << 8); |
| 35 | nb1413m3_gfxradr_h_w(0, data); break; | |
| 35 | nb1413m3_gfxradr_h_w(machine, 0, data); break; | |
| 36 | 36 | case 0x02: blitter_destx = data; break; |
| 37 | 37 | case 0x03: blitter_desty = data; break; |
| 38 | 38 | case 0x04: blitter_sizex = data; break; |
| r1877 | r1878 | |
| 54 | 54 | { |
| 55 | 55 | hyhoo_gfxrom = (((data & 0xc0) >> 4) + (data & 0x03)); |
| 56 | 56 | hyhoo_highcolorflag = data; |
| 57 | nb1413m3_gfxrombank_w(0, data); | |
| 57 | nb1413m3_gfxrombank_w(machine, 0, data); | |
| 58 | 58 | |
| 59 | 59 | if ((0x20000 * hyhoo_gfxrom) > (memory_region_length(REGION_GFX1) - 1)) |
| 60 | 60 | { |
| r1877 | r1878 | |
|---|---|---|
| 33 | 33 | static void SetIdentity(float *matrix) ; |
| 34 | 34 | |
| 35 | 35 | |
| 36 | //static void plot(INT32 x, INT32 y, INT32 color, mame_bitmap *bitmap) ; | |
| 37 | //static void drawline2d(INT32 x0, INT32 y0, INT32 x1, INT32 y1, INT32 color, mame_bitmap *bitmap) ; | |
| 36 | //static void plot(INT32 x, INT32 y, INT32 color, bitmap_t *bitmap) ; | |
| 37 | //static void drawline2d(INT32 x0, INT32 y0, INT32 x1, INT32 y1, INT32 color, bitmap_t *bitmap) ; | |
| 38 | 38 | |
| 39 | 39 | static float *depthBuffer ; |
| 40 | 40 | static struct polygon *polys ; |
| r1877 | r1878 | |
| 74 | 74 | /* xxxx---- | I think this part of UINT32 2 is interesting as more than just a list end marker (AJG) |
| 75 | 75 | */ |
| 76 | 76 | |
| 77 | static void draw_sprites(running_machine *machine, | |
| 77 | static void draw_sprites(running_machine *machine, | |
| 78 | 78 | { |
| 79 | 79 | const gfx_element *gfx; |
| 80 | 80 | UINT32 *source = hng64_spriteram; |
| r1877 | r1878 | |
| 225 | 225 | * Or maybe it switches from fading by scaling to fading using absolute addition and subtraction... |
| 226 | 226 | * Or maybe they set transition type (there seems to be a cute scaling-squares transition in there somewhere)... |
| 227 | 227 | */ |
| 228 | static void transition_control(running_machine *machine, | |
| 228 | static void transition_control(running_machine *machine, | |
| 229 | 229 | { |
| 230 | 230 | int i, j ; |
| 231 | 231 | |
| r1877 | r1878 | |
| 356 | 356 | |
| 357 | 357 | static void PerformFrustumClip(struct polygon *p) ; |
| 358 | 358 | |
| 359 | //static void DrawWireframe(struct polygon *p, mame_bitmap *bitmap) ; | |
| 360 | static void DrawShaded(running_machine *machine, struct polygon *p, mame_bitmap *bitmap) ; | |
| 359 | //static void DrawWireframe(struct polygon *p, bitmap_t *bitmap) ; | |
| 360 | static void DrawShaded(running_machine *machine, struct polygon *p, bitmap_t *bitmap) ; | |
| 361 | 361 | |
| 362 | 362 | |
| 363 | static void draw3d(running_machine *machine, | |
| 363 | static void draw3d(running_machine *machine, | |
| 364 | 364 | { |
| 365 | 365 | int i,j,k,l,m ; |
| 366 | 366 | |
| r1877 | r1878 | |
| 979 | 979 | looks like the zoom center can move too.. |
| 980 | 980 | not sure how these features are enabled up yet */ |
| 981 | 981 | |
| 982 | static int gatherPixelsForLine( | |
| 982 | static int gatherPixelsForLine( | |
| 983 | 983 | INT32 startX, INT32 startY, INT32 endX, INT32 endY, |
| 984 | 984 | UINT16 *penList) |
| 985 | 985 | { |
| r1877 | r1878 | |
| 1047 | 1047 | } |
| 1048 | 1048 | |
| 1049 | 1049 | static void plotTilemap3Line(running_machine *machine, |
| 1050 | | |
| 1050 | | |
| 1051 | 1051 | INT32 startX, INT32 startY, INT32 endX, INT32 endY, |
| 1052 | INT32 screenY, | |
| 1052 | INT32 screenY, | |
| 1053 | 1053 | { |
| 1054 | 1054 | int i ; |
| 1055 | 1055 | |
| r1877 | r1878 | |
| 1088 | 1088 | } |
| 1089 | 1089 | } |
| 1090 | 1090 | |
| 1091 | static void hng64_drawtilemap3(running_machine *machine, | |
| 1091 | static void hng64_drawtilemap3(running_machine *machine, | |
| 1092 | 1092 | { |
| 1093 | 1093 | int i ; |
| 1094 | 1094 | |
| 1095 | | |
| 1095 | | |
| 1096 | 1096 | |
| 1097 | 1097 | // usrintf_showmessage("%d", hng64_hackTm3Count) ; |
| 1098 | 1098 | |
| r1877 | r1878 | |
| 1146 | 1146 | // 0,0); |
| 1147 | 1147 | } |
| 1148 | 1148 | |
| 1149 | static void hng64_drawtilemap2( | |
| 1149 | static void hng64_drawtilemap2( | |
| 1150 | 1150 | { |
| 1151 | 1151 | int scrollbase,xscroll,yscroll,xzoom,yzoom; |
| 1152 | 1152 | |
| r1877 | r1878 | |
| 1175 | 1175 | 0,0); |
| 1176 | 1176 | } |
| 1177 | 1177 | |
| 1178 | static void hng64_drawtilemap1( | |
| 1178 | static void hng64_drawtilemap1( | |
| 1179 | 1179 | { |
| 1180 | 1180 | int scrollbase,xscroll,yscroll,xzoom,yzoom; |
| 1181 | 1181 | |
| r1877 | r1878 | |
| 1435 | 1435 | |
| 1436 | 1436 | case HNG64_NEAR: |
| 1437 | 1437 | return (v->clipCoords[2] <= v->clipCoords[3]) ? 1 : 0; |
| 1438 | ||
| 1438 | ||
| 1439 | 1439 | case HNG64_FAR: |
| 1440 | 1440 | return (v->clipCoords[2] >= -v->clipCoords[3]) ? 1 : 0; |
| 1441 | ||
| 1441 | ||
| 1442 | 1442 | } |
| 1443 | 1443 | |
| 1444 | 1444 | return 0 ; |
| r1877 | r1878 | |
| 1569 | 1569 | ///////////////////////// |
| 1570 | 1570 | |
| 1571 | 1571 | #ifdef UNUSED_FUNCTION |
| 1572 | static void plot(INT32 x, INT32 y, INT32 color, | |
| 1572 | static void plot(INT32 x, INT32 y, INT32 color, | |
| 1573 | 1573 | { |
| 1574 | 1574 | *BITMAP_ADDR32(bitmap, y, x) = MAKE_ARGB((UINT8)255, (UINT8)color, (UINT8)color, (UINT8)color) ; |
| 1575 | 1575 | } |
| 1576 | 1576 | |
| 1577 | 1577 | // Stolen from http://en.wikipedia.org/wiki/Bresenham's_line_algorithm (no copyright denoted) - the non-optimized version |
| 1578 | static void drawline2d(INT32 x0, INT32 y0, INT32 x1, INT32 y1, INT32 color, | |
| 1578 | static void drawline2d(INT32 x0, INT32 y0, INT32 x1, INT32 y1, INT32 color, | |
| 1579 | 1579 | { |
| 1580 | 1580 | #define SWAP(a,b) tmpswap = a; a = b; b = tmpswap; |
| 1581 | 1581 | |
| r1877 | r1878 | |
| 1632 | 1632 | } |
| 1633 | 1633 | |
| 1634 | 1634 | |
| 1635 | static void DrawWireframe(struct polygon *p, | |
| 1635 | static void DrawWireframe(struct polygon *p, | |
| 1636 | 1636 | { |
| 1637 | 1637 | int j; |
| 1638 | 1638 | for (j = 0; j < p->n; j++) |
| r1877 | r1878 | |
| 1659 | 1659 | // polygon rendering // |
| 1660 | 1660 | /////////////////////// |
| 1661 | 1661 | |
| 1662 | static void RasterizeTriangle_SMOOTH_TEX_PC(running_machine *machine, | |
| 1662 | static void RasterizeTriangle_SMOOTH_TEX_PC(running_machine *machine, | |
| 1663 | 1663 | float A[4], float B[4], float C[4], |
| 1664 | 1664 | float Ca[3], float Cb[3], float Cc[3], // PER-VERTEX RGB COLORS |
| 1665 | 1665 | float Ta[2], float Tb[2], float Tc[2], // PER-VERTEX (S,T) TEX-COORDS |
| 1666 | 1666 | int Wrapping, int Filtering, int Function) ; |
| 1667 | 1667 | |
| 1668 | static void DrawShaded(running_machine *machine, struct polygon *p, | |
| 1668 | static void DrawShaded(running_machine *machine, struct polygon *p, | |
| 1669 | 1669 | { |
| 1670 | 1670 | // The perspective-correct texture divide... |
| 1671 | 1671 | // !!! There is a very good chance the HNG64 hardware does not do perspective-correct texture-mapping !!! |
| r1877 | r1878 | |
| 1701 | 1701 | /** **/ |
| 1702 | 1702 | /** Output: none **/ |
| 1703 | 1703 | /*********************************************************************/ |
| 1704 | INLINE void FillSmoothTexPCHorizontalLine(running_machine *machine, | |
| 1704 | INLINE void FillSmoothTexPCHorizontalLine(running_machine *machine, | |
| 1705 | 1705 | int Wrapping, int Filtering, int Function, |
| 1706 | 1706 | int x_start, int x_end, int y, float z_start, float z_delta, |
| 1707 | 1707 | float w_start, float w_delta, float r_start, float r_delta, |
| r1877 | r1878 | |
| 1792 | 1792 | // nearest and bilinear filtering: Filtering={0,1} |
| 1793 | 1793 | // replace and modulate application modes: Function={0,1} |
| 1794 | 1794 | //--------------------------------------------------------------------------- |
| 1795 | static void RasterizeTriangle_SMOOTH_TEX_PC(running_machine *machine, | |
| 1795 | static void RasterizeTriangle_SMOOTH_TEX_PC(running_machine *machine, | |
| 1796 | 1796 | float A[4], float B[4], float C[4], |
| 1797 | 1797 | float Ca[3], float Cb[3], float Cc[3], // PER-VERTEX RGB COLORS |
| 1798 | 1798 | float Ta[2], float Tb[2], float Tc[2], // PER-VERTEX (S,T) TEX-COORDS |
| r1877 | r1878 | |
|---|---|---|
| 68 | 68 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | static void draw_sprites(running_machine *machine, | |
| 71 | static void draw_sprites(running_machine *machine, | |
| 72 | 72 | { |
| 73 | 73 | int offs; |
| 74 | 74 |
| r1877 | r1878 | |
|---|---|---|
| 173 | 173 | |
| 174 | 174 | |
| 175 | 175 | |
| 176 | static void draw_sprites(running_machine *machine, | |
| 176 | static void draw_sprites(running_machine *machine, | |
| 177 | 177 | { |
| 178 | 178 | const gfx_element *gfx = machine->gfx[0]; |
| 179 | 179 | // UINT32 *source = macrossp_spriteram; |
| r1877 | r1878 | |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | |
| 302 | static void draw_layer( | |
| 302 | static void draw_layer( | |
| 303 | 303 | { |
| 304 | 304 | tilemap *tm; |
| 305 | 305 | UINT32 *vr; |
| r1877 | r1878 | |
|---|---|---|
| 199 | 199 | |
| 200 | 200 | ***************************************************************************/ |
| 201 | 201 | |
| 202 | static void draw_sprites(running_machine *machine, | |
| 202 | static void draw_sprites(running_machine *machine, | |
| 203 | 203 | { |
| 204 | 204 | int offs; |
| 205 | 205 | |
| r1877 | r1878 | |
| 257 | 257 | |
| 258 | 258 | /* the fg layer just selects the upper palette bank on underlying pixels */ |
| 259 | 259 | { |
| 260 | | |
| 260 | | |
| 261 | 261 | int sx = cliprect->min_x; |
| 262 | 262 | int sy = cliprect->min_y; |
| 263 | 263 |
| r1877 | r1878 | |
|---|---|---|
| 91 | 91 | |
| 92 | 92 | ***************************************************************************/ |
| 93 | 93 | |
| 94 | static void draw_sprites(running_machine *machine, | |
| 94 | static void draw_sprites(running_machine *machine, | |
| 95 | 95 | { |
| 96 | 96 | int offs,sx,sy,tile,palette; |
| 97 | 97 |
| r1877 | r1878 | |
|---|---|---|
| 254 | 254 | plgirs2 bullets and raimais big bosses. |
| 255 | 255 | */ |
| 256 | 256 | |
| 257 | static void draw_sprites(running_machine *machine, | |
| 257 | static void draw_sprites(running_machine *machine, | |
| 258 | 258 | { |
| 259 | 259 | int offs; |
| 260 | 260 |
| r1877 | r1878 | |
|---|---|---|
| 81 | 81 | |
| 82 | 82 | ***************************************************************/ |
| 83 | 83 | |
| 84 | static void draw_sprites(running_machine *machine, | |
| 84 | static void draw_sprites(running_machine *machine, | |
| 85 | 85 | { |
| 86 | 86 | UINT16 *spritemap = (UINT16 *)memory_region(REGION_USER1); |
| 87 | 87 | int offs, data, tilenum, color, flipx, flipy; |
| r1877 | r1878 | |
| 261 | 261 | it's contents the usual way. |
| 262 | 262 | |
| 263 | 263 | */ |
| 264 | if (TC0100SCN_long_r(0x4090/4,0) || TC0480SCP_long_r(0x20/4,0)==0x240866) { /* Anything in text layer - really stupid hack */ | |
| 264 | if (TC0100SCN_long_r(machine,0x4090/4,0) || TC0480SCP_long_r(machine,0x20/4,0)==0x240866) { /* Anything in text layer - really stupid hack */ | |
| 265 | 265 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,2); |
| 266 | 266 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[2],0,4); |
| 267 | 267 | TC0480SCP_tilemap_draw(bitmap,cliprect,layer[3],0,8); |
| 268 | 268 | // TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,pivlayer[2],0,0); |
| 269 | if (TC0480SCP_long_r(0x20/4,0)!=0x240866) /* Stupid hack for start of race */ | |
| 269 | if (TC0480SCP_long_r(machine,0x20/4,0)!=0x240866) /* Stupid hack for start of race */ | |
| 270 | 270 | TC0480SCP_tilemap_draw(bitmap,&hack_cliprect,layer[0],0,0); |
| 271 | 271 | draw_sprites(machine,bitmap,cliprect,1,44,-574); |
| 272 | 272 | } else { |
| r1877 | r1878 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "deprecat.h" | |
| 11 | 10 | #include "video/resnet.h" |
| 12 | 11 | |
| 13 | 12 | |
| 14 | static UINT8 flipscreen; | |
| 13 | UINT8 *gyruss_videoram; | |
| 14 | UINT8 *gyruss_colorram; | |
| 15 | UINT8 *gyruss_spriteram; | |
| 16 | UINT8 *gyruss_flipscreen; | |
| 15 | 17 | |
| 16 | /* | |
| 17 | sprites are multiplexed, so we have to buffer the spriteram | |
| 18 | scanline by scanline. | |
| 19 | */ | |
| 20 | static UINT8 *sprite_mux_buffer; | |
| 21 | static UINT32 scanline; | |
| 18 | static tilemap *gyruss_tilemap; | |
| 22 | 19 | |
| 23 | 20 | |
| 24 | 21 | /*************************************************************************** |
| r1877 | r1878 | |
| 39 | 36 | bit 0 -- 1 kohm resistor -- RED |
| 40 | 37 | |
| 41 | 38 | ***************************************************************************/ |
| 39 | ||
| 42 | 40 | PALETTE_INIT( gyruss ) |
| 43 | 41 | { |
| 44 | 42 | static const int resistances_rg[3] = { 1000, 470, 220 }; |
| 45 | 43 | static const int resistances_b [2] = { 470, 220 }; |
| 46 | double | |
| 44 | double | |
| 47 | 45 | int i; |
| 48 | 46 | |
| 49 | 47 | /* compute the color output resistor weights */ |
| 50 | 48 | 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); | |
| 49 | 3, resistances_rg, weights_rg, 470, 0, | |
| 50 | 2, resistances_b, weights_b, 470, 0, | |
| 51 | 0, 0, 0, 0, 0); | |
| 54 | 52 | |
| 55 | 53 | /* allocate the colortable */ |
| 56 | 54 | machine->colortable = colortable_alloc(machine, 32); |
| r1877 | r1878 | |
| 65 | 63 | bit0 = (color_prom[i] >> 0) & 0x01; |
| 66 | 64 | bit1 = (color_prom[i] >> 1) & 0x01; |
| 67 | 65 | bit2 = (color_prom[i] >> 2) & 0x01; |
| 68 | r = combine_3_weights( | |
| 66 | r = combine_3_weights( | |
| 69 | 67 | |
| 70 | 68 | /* green component */ |
| 71 | 69 | bit0 = (color_prom[i] >> 3) & 0x01; |
| 72 | 70 | bit1 = (color_prom[i] >> 4) & 0x01; |
| 73 | 71 | bit2 = (color_prom[i] >> 5) & 0x01; |
| 74 | g = combine_3_weights( | |
| 72 | g = combine_3_weights( | |
| 75 | 73 | |
| 76 | 74 | /* blue component */ |
| 77 | 75 | bit0 = (color_prom[i] >> 6) & 0x01; |
| 78 | 76 | bit1 = (color_prom[i] >> 7) & 0x01; |
| 79 | b = combine_2_weights( | |
| 77 | b = combine_2_weights( | |
| 80 | 78 | |
| 81 | 79 | colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b)); |
| 82 | 80 | } |
| r1877 | r1878 | |
| 101 | 99 | |
| 102 | 100 | |
| 103 | 101 | |
| 104 | ||
| 102 | WRITE8_H | |
| 105 | 103 | { |
| 106 | sprite_mux_buffer = auto_malloc(256 * spriteram_size); | |
| 107 | ||
| 108 | state_save_register_global(flipscreen); | |
| 109 | state_save_register_global(scanline); | |
| 110 | state_save_register_global_pointer(sprite_mux_buffer,256*spriteram_size); | |
| 104 | video_screen_update_now(0); | |
| 105 | gyruss_spriteram[offset] = data; | |
| 111 | 106 | } |
| 112 | 107 | |
| 113 | 108 | |
| 109 | static TILE_GET_INFO( gyruss_get_tile_info ) | |
| 110 | { | |
| 111 | int code = ((gyruss_colorram[tile_index] & 0x20) << 3) | gyruss_videoram[tile_index]; | |
| 112 | int color = gyruss_colorram[tile_index] & 0x0f; | |
| 113 | int flags = TILE_FLIPYX(gyruss_colorram[tile_index] >> 6); | |
| 114 | 114 | |
| 115 | WRITE8_HANDLER( gyruss_flipscreen_w ) | |
| 115 | tileinfo->group = (gyruss_colorram[tile_index] & 0x10) ? 0 : 1; | |
| 116 | ||
| 117 | SET_TILE_INFO(2, code, color, flags); | |
| 118 | } | |
| 119 | ||
| 120 | ||
| 121 | VIDEO_START( gyruss ) | |
| 116 | 122 | { |
| 117 | flipscreen = data & 1; | |
| 123 | gyruss_tilemap = tilemap_create(gyruss_get_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 124 | tilemap_set_transmask(gyruss_tilemap, 0, 0x00, 0); /* opaque */ | |
| 125 | tilemap_set_transmask(gyruss_tilemap, 1, 0x0f, 0); /* transparent */ | |
| 118 | 126 | } |
| 119 | 127 | |
| 120 | 128 | |
| 121 | 129 | |
| 122 | /* Return the current video scan line */ | |
| 123 | 130 | READ8_HANDLER( gyruss_scanline_r ) |
| 124 | 131 | { |
| 125 | return scanline; | |
| 132 | /* reads 1V - 128V */ | |
| 133 | return video_screen_get_vpos(0); | |
| 126 | 134 | } |
| 127 | 135 | |
| 128 | 136 | |
| 129 | ||
| 130 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap) | |
| 137 | static void draw_sprites(gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect) | |
| 131 | 138 | { |
| 132 | rectangle clip = machine->screen[0].visarea; | |
| 133 | 139 | int offs; |
| 134 | int line; | |
| 135 | 140 | |
| 136 | ||
| 137 | for (line = 0;line < 256;line++) | |
| 141 | for (offs = 0xbc; offs >= 0; offs -= 4) | |
| 138 | 142 | { |
| 139 | UINT8 *sr; | |
| 143 | int x = gyruss_spriteram[offs]; | |
| 144 | int y = 241 - gyruss_spriteram[offs + 3]; | |
| 140 | 145 | |
| 141 | sr = sprite_mux_buffer + line * spriteram_size; | |
| 142 | clip.min_y = clip.max_y = line; | |
| 146 | int gfx_bank = gyruss_spriteram[offs + 1] & 0x01; | |
| 147 | int code = ((gyruss_spriteram[offs + 2] & 0x20) << 2) | ( gyruss_spriteram[offs + 1] >> 1); | |
| 148 | int color = gyruss_spriteram[offs + 2] & 0x0f; | |
| 149 | int flip_x = ~gyruss_spriteram[offs + 2] & 0x40; | |
| 150 | int flip_y = gyruss_spriteram[offs + 2] & 0x80; | |
| 143 | 151 | |
| 144 | for (offs = spriteram_size - 4;offs >= 0;offs -= 4) | |
| 145 | { | |
| 146 | int sx,sy; | |
| 147 | ||
| 148 | sx = sr[offs]; | |
| 149 | sy = 241 - sr[offs + 3]; | |
| 150 | if (sy > line-16 && sy <= line) | |
| 151 | { | |
| 152 | drawgfx(bitmap,machine->gfx[sr[offs + 1] & 1], | |
| 153 | sr[offs + 1]/2 + 4*(sr[offs + 2] & 0x20), | |
| 154 | sr[offs + 2] & 0x0f, | |
| 155 | !(sr[offs + 2] & 0x40),sr[offs + 2] & 0x80, | |
| 156 | sx,sy, | |
| 157 | &clip,TRANSPARENCY_PEN,0); | |
| 158 | } | |
| 159 | } | |
| 152 | drawgfx(bitmap, gfx[gfx_bank], code, color, flip_x, flip_y, x, y, cliprect, TRANSPARENCY_PEN, 0); | |
| 160 | 153 | } |
| 161 | 154 | } |
| 162 | 155 | |
| 163 | 156 | |
| 164 | 157 | VIDEO_UPDATE( gyruss ) |
| 165 | 158 | { |
| 166 | int offs; | |
| 167 | ||
| 168 | ||
| 169 | /* for every character in the Video RAM, check if it has been modified */ | |
| 170 | /* since last time and update it accordingly. */ | |
| 171 | for (offs = videoram_size - 1;offs >= 0;offs--) | |
| 159 | if (cliprect->min_y == machine->screen[screen].visarea.min_y) | |
| 172 | 160 | { |
| 173 | int sx,sy,flipx,flipy; | |
| 174 | ||
| 175 | sx = offs % 32; | |
| 176 | sy = offs / 32; | |
| 177 | flipx = colorram[offs] & 0x40; | |
| 178 | flipy = colorram[offs] & 0x80; | |
| 179 | if (flipscreen) | |
| 180 | { | |
| 181 | sx = 31 - sx; | |
| 182 | sy = 31 - sy; | |
| 183 | flipx = !flipx; | |
| 184 | flipy = !flipy; | |
| 185 | } | |
| 186 | ||
| 187 | drawgfx(bitmap,machine->gfx[2], | |
| 188 | videoram[offs] + 8 * (colorram[offs] & 0x20), | |
| 189 | colorram[offs] & 0x0f, | |
| 190 | flipx,flipy, | |
| 191 | 8*sx,8*sy, | |
| 192 | cliprect,TRANSPARENCY_NONE,0); | |
| 161 | tilemap_mark_all_tiles_dirty(ALL_TILEMAPS); | |
| 162 | tilemap_set_flip(ALL_TILEMAPS, (*gyruss_flipscreen & 0x01) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); | |
| 193 | 163 | } |
| 194 | 164 | |
| 165 | tilemap_draw(bitmap, cliprect, gyruss_tilemap, TILEMAP_DRAW_OPAQUE, 0); | |
| 166 | draw_sprites(machine->gfx, bitmap, cliprect); | |
| 167 | tilemap_draw(bitmap, cliprect, gyruss_tilemap, 0, 0); | |
| 195 | 168 | |
| 196 | draw_sprites(machine, bitmap); | |
| 197 | ||
| 198 | ||
| 199 | /* redraw the characters which have priority over sprites */ | |
| 200 | for (offs = videoram_size - 1;offs >= 0;offs--) | |
| 201 | { | |
| 202 | int sx,sy,flipx,flipy; | |
| 203 | ||
| 204 | ||
| 205 | sx = offs % 32; | |
| 206 | sy = offs / 32; | |
| 207 | flipx = colorram[offs] & 0x40; | |
| 208 | flipy = colorram[offs] & 0x80; | |
| 209 | if (flipscreen) | |
| 210 | { | |
| 211 | sx = 31 - sx; | |
| 212 | sy = 31 - sy; | |
| 213 | flipx = !flipx; | |
| 214 | flipy = !flipy; | |
| 215 | } | |
| 216 | ||
| 217 | if ((colorram[offs] & 0x10) != 0) | |
| 218 | drawgfx(bitmap,machine->gfx[2], | |
| 219 | videoram[offs] + 8 * (colorram[offs] & 0x20), | |
| 220 | colorram[offs] & 0x0f, | |
| 221 | flipx,flipy, | |
| 222 | 8*sx,8*sy, | |
| 223 | cliprect,TRANSPARENCY_NONE,0); | |
| 224 | } | |
| 225 | 169 | return 0; |
| 226 | 170 | } |
| 227 | ||
| 228 | ||
| 229 | INTERRUPT_GEN( gyruss_6809_interrupt ) | |
| 230 | { | |
| 231 | scanline = 255 - cpu_getiloops(); | |
| 232 | ||
| 233 | memcpy(sprite_mux_buffer + scanline * spriteram_size,spriteram,spriteram_size); | |
| 234 | ||
| 235 | if (scanline == 255) | |
| 236 | irq0_line_hold(machine, cpunum); | |
| 237 | } |
| r1877 | r1878 | |
|---|---|---|
| 98 | 98 | |
| 99 | 99 | ********************************************************************/ |
| 100 | 100 | |
| 101 | static void draw_sprites(running_machine *machine, | |
| 101 | static void draw_sprites(running_machine *machine, | |
| 102 | 102 | { |
| 103 | 103 | int offs,data0,data1,data2; |
| 104 | 104 |
| r1877 | r1878 | |
|---|---|---|
| 158 | 158 | |
| 159 | 159 | |
| 160 | 160 | |
| 161 | INLINE void draw_pixel( | |
| 161 | INLINE void draw_pixel( | |
| 162 | 162 | { |
| 163 | 163 | if (flip_screen_get()) |
| 164 | 164 | { |
| r1877 | r1878 | |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | |
| 179 | static void draw_sprite( | |
| 179 | static void draw_sprite( | |
| 180 | 180 | { |
| 181 | 181 | int sx,sy,col,row,height,src,adjy,dy; |
| 182 | 182 | UINT8 *spr_reg; |
| r1877 | r1878 | |
| 247 | 247 | } |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | static void draw_sprites( | |
| 250 | static void draw_sprites( | |
| 251 | 251 | { |
| 252 | 252 | int spr_number; |
| 253 | 253 | UINT8 *spr_reg; |
| r1877 | r1878 | |
|---|---|---|
| 93 | 93 | /* Sprite buffer - the data written doesn't matter (confirmed by several games) */ |
| 94 | 94 | if (offset==4) |
| 95 | 95 | { |
| 96 | buffer_spriteram16_w(0,0,0); | |
| 96 | buffer_spriteram16_w(machine,0,0,0); | |
| 97 | 97 | m92_sprite_buffer_busy = 0; |
| 98 | 98 | |
| 99 | 99 | /* Pixel clock is 26.6666 MHz, we have 0x800 bytes, or 0x400 words |
| r1877 | r1878 | |
| 134 | 134 | |
| 135 | 135 | WRITE16_HANDLER( m92_paletteram_w ) |
| 136 | 136 | { |
| 137 | paletteram16_xBBBBBGGGGGRRRRR_word_w(offset + 0x400 * m92_palette_bank, data, mem_mask); | |
| 137 | paletteram16_xBBBBBGGGGGRRRRR_word_w(machine, offset + 0x400 * m92_palette_bank, data, mem_mask); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /*****************************************************************************/ |
| r1877 | r1878 | |
| 296 | 296 | |
| 297 | 297 | /*****************************************************************************/ |
| 298 | 298 | |
| 299 | static void draw_sprites(running_machine *machine, | |
| 299 | static void draw_sprites(running_machine *machine, | |
| 300 | 300 | { |
| 301 | 301 | int offs,k; |
| 302 | 302 | |
| r1877 | r1878 | |
| 429 | 429 | |
| 430 | 430 | /*****************************************************************************/ |
| 431 | 431 | |
| 432 | static void m92_screenrefresh(running_machine *machine, | |
| 432 | static void m92_screenrefresh(running_machine *machine, | |
| 433 | 433 | { |
| 434 | 434 | fillbitmap(priority_bitmap, 0, cliprect); |
| 435 | 435 |
| r1877 | r1878 | |
|---|---|---|
| 13 | 13 | UINT8 *yard_scroll_x_high; |
| 14 | 14 | UINT8 *yard_scroll_y_low; |
| 15 | 15 | UINT8 *yard_score_panel_disabled; |
| 16 | static | |
| 16 | static | |
| 17 | 17 | |
| 18 | 18 | static tilemap *bg_tilemap; |
| 19 | 19 | |
| r1877 | r1878 | |
| 214 | 214 | |
| 215 | 215 | #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)); |
| 216 | 216 | |
| 217 | static void draw_sprites(running_machine *machine, | |
| 217 | static void draw_sprites(running_machine *machine, | |
| 218 | 218 | { |
| 219 | 219 | int offs; |
| 220 | 220 | |
| r1877 | r1878 | |
| 267 | 267 | * |
| 268 | 268 | *************************************/ |
| 269 | 269 | |
| 270 | static void draw_panel( running_machine *machine, | |
| 270 | static void draw_panel( running_machine *machine, | |
| 271 | 271 | { |
| 272 | 272 | if (! *yard_score_panel_disabled) |
| 273 | 273 | { |
| r1877 | r1878 | |
|---|---|---|
| 150 | 150 | 3 | xxxxxxxx xxxxxx-- | sprite code (low bits) |
| 151 | 151 | */ |
| 152 | 152 | |
| 153 | static void draw_sprites(running_machine *machine, | |
| 153 | static void draw_sprites(running_machine *machine, | |
| 154 | 154 | { |
| 155 | 155 | int j, x, y, ex, ey; |
| 156 | 156 | const gfx_element *gfx = machine->gfx[0]; |
| r1877 | r1878 | |
|---|---|---|
| 143 | 143 | sprite drawing could probably be improved a bit |
| 144 | 144 | *******************************************************************************/ |
| 145 | 145 | |
| 146 | static void draw_sprites(running_machine *machine, | |
| 146 | static void draw_sprites(running_machine *machine, | |
| 147 | 147 | { |
| 148 | 148 | /*- SPR RAM Format -** |
| 149 | 149 |
| r1877 | r1878 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "deprecat.h" | |
| 3 | 2 | #include "deco16ic.h" |
| 4 | 3 | |
| 5 | 4 | UINT16* pcktgaldb_fgram; |
| 6 | 5 | UINT16* pcktgaldb_sprites; |
| 7 | 6 | |
| 8 | 7 | |
| 9 | static void draw_sprites(running_machine *machine, | |
| 8 | static void draw_sprites(running_machine *machine, | |
| 10 | 9 | { |
| 11 | 10 | int offs; |
| 12 | 11 | int flipscreen=!flip_screen_get(); |
| r1877 | r1878 | |
| 20 | 19 | |
| 21 | 20 | y = spriteram16[offs]; |
| 22 | 21 | flash=y&0x1000; |
| 23 | if (flash && ( | |
| 22 | if (flash && (vid | |
| 24 | 23 | |
| 25 | 24 | x = spriteram16[offs+2]; |
| 26 | 25 | colour = (x >>9) & 0x1f; |
| r1877 | r1878 | |
|---|---|---|
| 157 | 157 | * |
| 158 | 158 | *************************************/ |
| 159 | 159 | |
| 160 | static void draw_sprites(running_machine *machine, | |
| 160 | static void draw_sprites(running_machine *machine, | |
| 161 | 161 | { |
| 162 | 162 | int offs; |
| 163 | 163 |
| r1877 | r1878 | |
|---|---|---|
| 234 | 234 | |
| 235 | 235 | /* copy the motion objects on top */ |
| 236 | 236 | { |
| 237 | | |
| 237 | | |
| 238 | 238 | int left = cliprect->min_x; |
| 239 | 239 | int top = cliprect->min_y; |
| 240 | 240 | int right = cliprect->max_x + 1; |
| r1877 | r1878 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | ***************************************************************************/ |
| 146 | 146 | |
| 147 | static void draw_sprites(running_machine *machine, | |
| 147 | static void draw_sprites(running_machine *machine, | |
| 148 | 148 | { |
| 149 | 149 | int offs; |
| 150 | 150 | |
| r1877 | r1878 | |
| 268 | 268 | ***************************************************************************/ |
| 269 | 269 | |
| 270 | 270 | /* Wrapper to handle bg and bg2 ttogether */ |
| 271 | static void fuuki16_draw_layer( | |
| 271 | static void fuuki16_draw_layer( | |
| 272 | 272 | { |
| 273 | 273 | int buffer = (fuuki16_vregs[0x1e/2] & 0x40); |
| 274 | 274 |
| r1877 | r1878 | |
|---|---|---|
| 170 | 170 | |
| 171 | 171 | ***************************************************************************/ |
| 172 | 172 | |
| 173 | static void draw_sprites(running_machine *machine, | |
| 173 | static void draw_sprites(running_machine *machine, | |
| 174 | 174 | { |
| 175 | 175 | int offs; |
| 176 | 176 |
| r1877 | r1878 | |
|---|---|---|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| 67 | static void draw_sprites(running_machine *machine, | |
| 67 | static void draw_sprites(running_machine *machine, | |
| 68 | 68 | { |
| 69 | 69 | int offs; |
| 70 | 70 | int height = machine->gfx[0]->height; |
| r1877 | r1878 | |
|---|---|---|
| 51 | 51 | 8, 8, 32, 32); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | static void draw_line( | |
| 54 | static void draw_line( | |
| 55 | 55 | { |
| 56 | 56 | /* Draws horizontal and Vertical lines only! */ |
| 57 | 57 | |
| r1877 | r1878 | |
| 72 | 72 | *BITMAP_ADDR16(bitmap, y1, count) = 1; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | static void draw_robot_box( | |
| 75 | static void draw_robot_box( | |
| 76 | 76 | { |
| 77 | 77 | /* Box */ |
| 78 | 78 | |
| r1877 | r1878 | |
| 92 | 92 | draw_line(bitmap,cliprect,x+16,y,x+16,ey,0); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | static void circus_draw_fg(running_machine *machine, | |
| 95 | static void circus_draw_fg(running_machine *machine, | |
| 96 | 96 | { |
| 97 | 97 | /* The sync generator hardware is used to */ |
| 98 | 98 | /* draw the border and diving boards */ |
| r1877 | r1878 | |
| 122 | 122 | return 0; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | static void robotbwl_draw_scoreboard( | |
| 125 | static void robotbwl_draw_scoreboard( | |
| 126 | 126 | { |
| 127 | 127 | int offs; |
| 128 | 128 | |
| r1877 | r1878 | |
| 147 | 147 | draw_line(bitmap, cliprect, 39+152,137,47+152,137,0); |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | static void robotbwl_draw_bowling_alley( | |
| 150 | static void robotbwl_draw_bowling_alley( | |
| 151 | 151 | { |
| 152 | 152 | draw_line(bitmap, cliprect, 103,17,103,205,0); |
| 153 | 153 | draw_line(bitmap, cliprect, 111,17,111,203,1); |
| r1877 | r1878 | |
| 155 | 155 | draw_line(bitmap, cliprect, 144,17,144,203,1); |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | static void robotbwl_draw_ball(running_machine *machine, | |
| 158 | static void robotbwl_draw_ball(running_machine *machine, | |
| 159 | 159 | { |
| 160 | 160 | drawgfx(bitmap,machine->gfx[1], |
| 161 | 161 | clown_z, |
| r1877 | r1878 | |
| 174 | 174 | return 0; |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | static void crash_draw_car(running_machine *machine, | |
| 177 | static void crash_draw_car(running_machine *machine, | |
| 178 | 178 | { |
| 179 | 179 | drawgfx(bitmap,machine->gfx[1], |
| 180 | 180 | clown_z, |
| r1877 | r1878 | |
| 191 | 191 | return 0; |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | static void ripcord_draw_skydiver(running_machine *machine, | |
| 194 | static void ripcord_draw_skydiver(running_machine *machine, | |
| 195 | 195 | { |
| 196 | 196 | const gfx_element *gfx; |
| 197 | 197 | UINT8 *src_lineptr, *src_pixptr; |
| r1877 | r1878 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | |
| 11 | 11 | UINT8 *zac2650_s2636_0_ram; |
| 12 | static | |
| 12 | static | |
| 13 | 13 | |
| 14 | 14 | static int CollisionBackground; |
| 15 | 15 | static int CollisionSprite; |
| r1877 | r1878 | |
| 37 | 37 | |
| 38 | 38 | READ8_HANDLER( tinvader_port_0_r ) |
| 39 | 39 | { |
| 40 | return input_port_0_r(0) - CollisionBackground; | |
| 40 | return input_port_0_r(machine,0) - CollisionBackground; | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /*****************************************/ |
| r1877 | r1878 | |
| 138 | 138 | tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | static void draw_sprites(running_machine *machine, | |
| 141 | static void draw_sprites(running_machine *machine, | |
| 142 | 142 | { |
| 143 | 143 | int offs; |
| 144 | 144 |
| r1877 | r1878 | |
|---|---|---|
| 69 | 69 | int shangha3_do_shadows; |
| 70 | 70 | |
| 71 | 71 | static UINT16 gfxlist_addr; |
| 72 | static | |
| 72 | static | |
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 |
| r1877 | r1878 | |
|---|---|---|
| 127 | 127 | |
| 128 | 128 | ***************************************************************************/ |
| 129 | 129 | |
| 130 | static void draw_sprites(running_machine *machine, | |
| 130 | static void draw_sprites(running_machine *machine, | |
| 131 | 131 | { |
| 132 | 132 | int offs; |
| 133 | 133 |
| r1877 | r1878 | |
|---|---|---|
| 34 | 34 | /* sprites are like the other video system / psikyo games, we can merge this with aerofgt and plenty of other |
| 35 | 35 | things eventually */ |
| 36 | 36 | |
| 37 | static void draw_sprite(running_machine *machine, UINT16 spriteno, | |
| 37 | static void draw_sprite(running_machine *machine, UINT16 spriteno, | |
| 38 | 38 | { |
| 39 | 39 | /*- SPR RAM Format -** |
| 40 | 40 | |
| r1877 | r1878 | |
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | static void draw_sprites(running_machine *machine, | |
| 121 | static void draw_sprites(running_machine *machine, | |
| 122 | 122 | { |
| 123 | 123 | /* first part of sprite ram is the list of sprites to draw, terminated with 0x4000 */ |
| 124 | 124 | UINT16 *source = taotaido_spriteram_older; |
| r1877 | r1878 | |
|---|---|---|
| 107 | 107 | VIDEO_UPDATE( relief ) |
| 108 | 108 | { |
| 109 | 109 | struct atarimo_rect_list rectlist; |
| 110 | | |
| 110 | | |
| 111 | 111 | int x, y, r; |
| 112 | 112 | |
| 113 | 113 | /* draw the playfield */ |
| r1877 | r1878 | |
|---|---|---|
| 334 | 334 | static struct f3_spritealpha_line_inf *sa_line_inf; |
| 335 | 335 | |
| 336 | 336 | |
| 337 | static | |
| 337 | static | |
| 338 | 338 | /* |
| 339 | 339 | pri_alp_bitmap |
| 340 | 340 | ---- ---1 sprite priority 0 |
| r1877 | r1878 | |
| 366 | 366 | |
| 367 | 367 | /******************************************************************************/ |
| 368 | 368 | |
| 369 | static void print_debug_info( | |
| 369 | static void print_debug_info( | |
| 370 | 370 | { |
| 371 | 371 | int l[16]; |
| 372 | 372 | char buf[64*16]; |
| r1877 | r1878 | |
| 1358 | 1358 | /*============================================================================*/ |
| 1359 | 1359 | |
| 1360 | 1360 | INLINE void draw_scanlines(running_machine *machine, |
| 1361 | | |
| 1361 | | |
| 1362 | 1362 | const struct f3_playfield_line_inf **line_t, |
| 1363 | 1363 | const int *sprite, |
| 1364 | 1364 | UINT32 orient, |
| r1877 | r1878 | |
| 1870 | 1870 | static void get_line_ram_info(running_machine *machine, tilemap *tmap, int sx, int sy, int pos, UINT32 *f3_pf_data_n) |
| 1871 | 1871 | { |
| 1872 | 1872 | struct f3_playfield_line_inf *line_t=&pf_line_inf[pos]; |
| 1873 | const mame_bitmap *srcbitmap; | |
| 1874 | const mame_bitmap *flagsbitmap; | |
| 1873 | const bitmap_t *srcbitmap; | |
| 1874 | const bitmap_t *flagsbitmap; | |
| 1875 | 1875 | |
| 1876 | 1876 | int y,y_start,y_end,y_inc; |
| 1877 | 1877 | int line_base,zoom_base,col_base,pri_base,inc; |
| r1877 | r1878 | |
| 2091 | 2091 | { |
| 2092 | 2092 | const struct f3_spritealpha_line_inf *sprite_alpha_line_t=&sa_line_inf[0]; |
| 2093 | 2093 | struct f3_playfield_line_inf *line_t=&pf_line_inf[4]; |
| 2094 | const mame_bitmap *srcbitmap_pixel, *srcbitmap_vram; | |
| 2095 | const mame_bitmap *flagsbitmap_pixel, *flagsbitmap_vram; | |
| 2094 | const bitmap_t *srcbitmap_pixel, *srcbitmap_vram; | |
| 2095 | const bitmap_t *flagsbitmap_pixel, *flagsbitmap_vram; | |
| 2096 | 2096 | |
| 2097 | 2097 | int y,y_start,y_end,y_inc; |
| 2098 | 2098 | int pri_base,inc; |
| r1877 | r1878 | |
| 2215 | 2215 | |
| 2216 | 2216 | /******************************************************************************/ |
| 2217 | 2217 | |
| 2218 | static void scanline_draw(running_machine *machine, | |
| 2218 | static void scanline_draw(running_machine *machine, | |
| 2219 | 2219 | { |
| 2220 | 2220 | int i,j,y,ys,ye; |
| 2221 | 2221 | int y_start,y_end,y_start_next,y_end_next; |
| r1877 | r1878 | |
| 2637 | 2637 | dest++; \ |
| 2638 | 2638 | pri++; |
| 2639 | 2639 | |
| 2640 | INLINE void f3_drawgfx( | |
| 2640 | INLINE void f3_drawgfx( | |
| 2641 | 2641 | UINT32 code, |
| 2642 | 2642 | UINT32 color, |
| 2643 | 2643 | int flipx,int flipy, |
| r1877 | r1878 | |
| 2800 | 2800 | #undef NEXT_P |
| 2801 | 2801 | |
| 2802 | 2802 | |
| 2803 | INLINE void f3_drawgfxzoom( | |
| 2803 | INLINE void f3_drawgfxzoom( | |
| 2804 | 2804 | UINT32 code, |
| 2805 | 2805 | UINT32 color, |
| 2806 | 2806 | int flipx,int flipy, |
| r1877 | r1878 | |
| 3198 | 3198 | #undef CALC_ZOOM |
| 3199 | 3199 | |
| 3200 | 3200 | |
| 3201 | static void draw_sprites(running_machine *machine, | |
| 3201 | static void draw_sprites(running_machine *machine, | |
| 3202 | 3202 | { |
| 3203 | 3203 | const struct tempsprite *sprite_ptr; |
| 3204 | 3204 | const gfx_element *sprite_gfx = machine->gfx[2]; |
| r1877 | r1878 | |
|---|---|---|
| 339 | 339 | |
| 340 | 340 | ***************************************************************************/ |
| 341 | 341 | |
| 342 | static void draw_sprites(running_machine *machine, | |
| 342 | static void draw_sprites(running_machine *machine, | |
| 343 | 343 | { |
| 344 | 344 | int j, x, y, ex, ey, px, py; |
| 345 | 345 | const gfx_element *gfx = machine->gfx[0]; |
| r1877 | r1878 | |
| 507 | 507 | VIDEO_EOF( gaelco2 ) |
| 508 | 508 | { |
| 509 | 509 | /* sprites are one frame ahead */ |
| 510 | buffer_spriteram16_w(0, 0, 0); | |
| 510 | buffer_spriteram16_w(machine, 0, 0, 0); | |
| 511 | 511 | } |
| r1877 | r1878 | |
|---|---|---|
| 66 | 66 | homerun_tilemap = tilemap_create(get_homerun_tile_info,tilemap_scan_rows, 8, 8,64,64); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | static void draw_sprites(running_machine *machine, | |
| 69 | static void draw_sprites(running_machine *machine, | |
| 70 | 70 | { |
| 71 | 71 | int offs; |
| 72 | 72 | for (offs = spriteram_size-4; offs >=0; offs -= 4) |
| r1877 | r1878 | |
|---|---|---|
| 137 | 137 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | static void draw_sprites(running_machine *machine, | |
| 140 | static void draw_sprites(running_machine *machine, | |
| 141 | 141 | { |
| 142 | 142 | int offs; |
| 143 | 143 |
| r1877 | r1878 | |
|---|---|---|
| 214 | 214 | |
| 215 | 215 | ***************************************************************************/ |
| 216 | 216 | |
| 217 | static void draw_sprites(running_machine *machine, | |
| 217 | static void draw_sprites(running_machine *machine, | |
| 218 | 218 | { |
| 219 | 219 | const UINT8 *source = &spriteram[0]; |
| 220 | 220 | const UINT8 *finish = &spriteram[0x0800-16]; /* the last is NOT a sprite */ |
| r1877 | r1878 | |
|---|---|---|
| 140 | 140 | tilemap_set_transparent_pen(fg_tilemap, 0); |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | static void draw_sprites(running_machine *machine, | |
| 143 | static void draw_sprites(running_machine *machine, | |
| 144 | 144 | { |
| 145 | 145 | int offs; |
| 146 | 146 |
| r1877 | r1878 | |
|---|---|---|
| 240 | 240 | * |
| 241 | 241 | *************************************/ |
| 242 | 242 | |
| 243 | static void render_sprites_91399(running_machine *machine, | |
| 243 | static void render_sprites_91399(running_machine *machine, | |
| 244 | 244 | { |
| 245 | 245 | const gfx_element *gfx = machine->gfx[1]; |
| 246 | 246 | int offs; |
| r1877 | r1878 | |
| 311 | 311 | * |
| 312 | 312 | *************************************/ |
| 313 | 313 | |
| 314 | static void render_sprites_91464(running_machine *machine, | |
| 314 | static void render_sprites_91464(running_machine *machine, | |
| 315 | 315 | { |
| 316 | 316 | const gfx_element *gfx = machine->gfx[1]; |
| 317 | 317 | int offs; |
| r1877 | r1878 | |
|---|---|---|
| 153 | 153 | |
| 154 | 154 | /*****************************************************************************/ |
| 155 | 155 | |
| 156 | static void draw_sprites(running_machine *machine, | |
| 156 | static void draw_sprites(running_machine *machine, | |
| 157 | 157 | { |
| 158 | 158 | int offs; |
| 159 | 159 | |
| r1877 | r1878 | |
| 273 | 273 | |
| 274 | 274 | /*****************************************************************************/ |
| 275 | 275 | |
| 276 | static void m107_screenrefresh(running_machine *machine, | |
| 276 | static void m107_screenrefresh(running_machine *machine, | |
| 277 | 277 | { |
| 278 | 278 | if ((~m107_control[0x0b] >> 7) & 1) |
| 279 | 279 | { |
| r1877 | r1878 | |
|---|---|---|
| 55 | 55 | SPRITE DRAW ROUTINE |
| 56 | 56 | ************************************************************/ |
| 57 | 57 | |
| 58 | static void draw_sprites(running_machine *machine, | |
| 58 | static void draw_sprites(running_machine *machine, | |
| 59 | 59 | { |
| 60 | 60 | int offs, data, tilenum, color, flipx, flipy; |
| 61 | 61 | int x, y, priority, curx, cury; |
| r1877 | r1878 | |
|---|---|---|
| 22 | 22 | UINT8 *matmania_videoram3,*matmania_colorram3; |
| 23 | 23 | size_t matmania_videoram3_size; |
| 24 | 24 | UINT8 *matmania_scroll; |
| 25 | static | |
| 25 | static | |
| 26 | 26 | |
| 27 | 27 | UINT8 *matmania_pageselect; |
| 28 | 28 |
| r1877 | r1878 | |
|---|---|---|
| 89 | 89 | state_save_register_global(palettebank); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | static void draw_sprites(running_machine *machine, | |
| 92 | static void draw_sprites(running_machine *machine, | |
| 93 | 93 | { |
| 94 | 94 | int offs; |
| 95 | 95 |
| r1877 | r1878 | |
|---|---|---|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | static void draw_sprite( /* slow slow slow, but it's ok for now */ |
| 90 | | |
| 90 | | |
| 91 | 91 | const UINT16 *pen_data, |
| 92 | 92 | int pal_base, |
| 93 | 93 | int xpos, int ypos, |
| r1877 | r1878 | |
| 196 | 196 | |
| 197 | 197 | */ |
| 198 | 198 | |
| 199 | static void draw_sprites( | |
| 199 | static void draw_sprites( | |
| 200 | 200 | { |
| 201 | 201 | int count = 0; |
| 202 | 202 | |
| r1877 | r1878 | |
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | static void draw_layer( | |
| 285 | static void draw_layer( | |
| 286 | 286 | const UINT16 *gfx_base; |
| 287 | 287 | const UINT16 *source = videoram16; |
| 288 | 288 | int i, xxor, yxor; |
| r1877 | r1878 | |
| 440 | 440 | |
| 441 | 441 | need_process_spriteram = 1; |
| 442 | 442 | |
| 443 | buffer_spriteram16_w(0,0,0); | |
| 443 | buffer_spriteram16_w(machine,0,0,0); | |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | VIDEO_UPDATE( twin16 ) |
| r1877 | r1878 | |
|---|---|---|
| 450 | 450 | |
| 451 | 451 | case 0x300/2 : megasys1_screen_flag = new_data; |
| 452 | 452 | if (new_data & 0x10) |
| 453 | cpunum_set_input_line( | |
| 453 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 454 | 454 | else |
| 455 | cpunum_set_input_line( | |
| 455 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 456 | 456 | break; |
| 457 | 457 | |
| 458 | case 0x308/2 : soundlatch_word_w(0,new_data,0); | |
| 459 | cpunum_set_input_line(Machine, 1,4,HOLD_LINE); | |
| 458 | case 0x308/2 : soundlatch_word_w(machine,0,new_data,0); | |
| 459 | cpunum_set_input_line(machine, 1,4,HOLD_LINE); | |
| 460 | 460 | break; |
| 461 | 461 | |
| 462 | 462 | default : SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data); |
| r1877 | r1878 | |
| 472 | 472 | { |
| 473 | 473 | switch (offset) |
| 474 | 474 | { |
| 475 | case 0x8000/2: return soundlatch2_word_r(0,0); | |
| 475 | case 0x8000/2: return soundlatch2_word_r(machine,0,0); | |
| 476 | 476 | default: return megasys1_vregs[offset]; |
| 477 | 477 | } |
| 478 | 478 | } |
| r1877 | r1878 | |
| 501 | 501 | |
| 502 | 502 | case 0x2308/2 : megasys1_screen_flag = new_data; |
| 503 | 503 | if (new_data & 0x10) |
| 504 | cpunum_set_input_line( | |
| 504 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 505 | 505 | else |
| 506 | cpunum_set_input_line( | |
| 506 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 507 | 507 | break; |
| 508 | 508 | |
| 509 | 509 | case 0x8000/2 : /* Cybattler reads sound latch on irq 2 */ |
| 510 | soundlatch_word_w(0,new_data,0); | |
| 511 | cpunum_set_input_line(Machine, 1,2,HOLD_LINE); | |
| 510 | soundlatch_word_w(machine,0,new_data,0); | |
| 511 | cpunum_set_input_line(machine, 1,2,HOLD_LINE); | |
| 512 | 512 | break; |
| 513 | 513 | |
| 514 | 514 | default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data); |
| r1877 | r1878 | |
| 572 | 572 | 0C Y position |
| 573 | 573 | 0E Code */ |
| 574 | 574 | |
| 575 | static void draw_sprites(running_machine *machine, | |
| 575 | static void draw_sprites(running_machine *machine, | |
| 576 | 576 | { |
| 577 | 577 | int color,code,sx,sy,flipx,flipy,attr,sprite,offs,color_mask; |
| 578 | 578 | |
| r1877 | r1878 | |
| 923 | 923 | |
| 924 | 924 | |
| 925 | 925 | /*************************************************************************** |
| 926 | Draw the game screen in the given | |
| 926 | Draw the game screen in the given | |
| 927 | 927 | ***************************************************************************/ |
| 928 | 928 | |
| 929 | 929 |
| r1877 | r1878 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | ***************************************************************************/ |
| 101 | 101 | |
| 102 | static void draw_sprites(running_machine *machine, | |
| 102 | static void draw_sprites(running_machine *machine, | |
| 103 | 103 | { |
| 104 | 104 | int offs; |
| 105 | 105 | |
| r1877 | r1878 | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | |
| 174 | static void draw_bg( | |
| 174 | static void draw_bg( | |
| 175 | 175 | { |
| 176 | 176 | tilemap_draw(bitmap,cliprect,tilemap2,0,0); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | |
| 180 | static void draw_fg( | |
| 180 | static void draw_fg( | |
| 181 | 181 | { |
| 182 | 182 | K053936_0_zoom_draw(bitmap,cliprect,tilemap1,0,0); |
| 183 | 183 | } |
| r1877 | r1878 | |
| 215 | 215 | |
| 216 | 216 | VIDEO_EOF( crshrace ) |
| 217 | 217 | { |
| 218 | buffer_spriteram16_w(0,0,0); | |
| 219 | buffer_spriteram16_2_w(0,0,0); | |
| 218 | buffer_spriteram16_w(machine,0,0,0); | |
| 219 | buffer_spriteram16_2_w(machine,0,0,0); | |
| 220 | 220 | } |
| r1877 | r1878 | |
|---|---|---|
| 36 | 36 | UINT8 *airbustr_videoram2, *airbustr_colorram2; |
| 37 | 37 | //int airbustr_clear_sprites; |
| 38 | 38 | static tilemap *bg_tilemap, *fg_tilemap; |
| 39 | static | |
| 39 | static | |
| 40 | 40 | |
| 41 | 41 | WRITE8_HANDLER( airbustr_videoram_w ) |
| 42 | 42 | { |
| r1877 | r1878 | |
|---|---|---|
| 290 | 290 | |
| 291 | 291 | ***************************************************************************/ |
| 292 | 292 | |
| 293 | static void draw_sprites(running_machine *machine, | |
| 293 | static void draw_sprites(running_machine *machine, | |
| 294 | 294 | { |
| 295 | 295 | int i; |
| 296 | 296 |
| r1877 | r1878 | |
|---|---|---|
| 31 | 31 | static UINT16 blitter_yparam[16]; |
| 32 | 32 | static UINT16 blitter_vidparam[32]; |
| 33 | 33 | |
| 34 | static | |
| 34 | static | |
| 35 | 35 | static emu_timer *blitter_timer; |
| 36 | 36 | |
| 37 | 37 |
| r1877 | r1878 | |
|---|---|---|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | #if BW_DEBUG |
| 121 | logerror("(%1d)%04x: w=%02x a=%04x f=%d\n",cpu_getactivecpu(),activecpu_get_pc(),data,0x1b00+offset, | |
| 121 | logerror("(%1d)%04x: w=%02x a=%04x f=%d\n",cpu_getactivecpu(),activecpu_get_pc(),data,0x1b00+offset,vid | |
| 122 | 122 | #endif |
| 123 | 123 | break; |
| 124 | 124 | } |
| r1877 | r1878 | |
| 228 | 228 | //**************************************************************************** |
| 229 | 229 | // Realtime |
| 230 | 230 | |
| 231 | static void draw_sprites(running_machine *machine, | |
| 231 | static void draw_sprites(running_machine *machine, | |
| 232 | 232 | { |
| 233 | 233 | int attrib, fx, fy, code, x, y, color, i; |
| 234 | 234 | gfx_element *gfx = machine->gfx[1]; |
| r1877 | r1878 | |
|---|---|---|
| 130 | 130 | return nb ^ delta[(nb >> 3) & 3]; |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | static void draw_sprites(running_machine *machine, | |
| 133 | static void draw_sprites(running_machine *machine, | |
| 134 | 134 | { |
| 135 | 135 | int offs; |
| 136 | 136 |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | SET_TILE_INFO(2, (tile & 0xfff) + 0x3000, color, 0); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | static void draw_sprites(running_machine *machine, | |
| 64 | static void draw_sprites(running_machine *machine, | |
| 65 | 65 | { |
| 66 | 66 | int offs,fx,fy,x,y,color,sprite; |
| 67 | 67 | int dx,dy,ax,ay; |
| r1877 | r1878 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | |
| 6 | 6 | |
| 7 | static void draw_layer(running_machine *machine, | |
| 7 | static void draw_layer(running_machine *machine, | |
| 8 | 8 | { |
| 9 | 9 | int offs,scrollx,scrolly; |
| 10 | 10 | |
| r1877 | r1878 | |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | static int draw_layer_daikaiju(running_machine *machine, | |
| 53 | static int draw_layer_daikaiju(running_machine *machine, | |
| 54 | 54 | { |
| 55 | 55 | int id,scrollx,scrolly,initoffs, globalscrollx; |
| 56 | 56 | int stepx=0; |
| r1877 | r1878 | |
| 140 | 140 | return offs; |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | static void drawbg(running_machine *machine, | |
| 143 | static void drawbg(running_machine *machine, | |
| 144 | 144 | { |
| 145 | 145 | int i=0; |
| 146 | 146 | int id=-1; |
| r1877 | r1878 | |
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | static void draw_sprites(running_machine *machine, | |
| 162 | static void draw_sprites(running_machine *machine, | |
| 163 | 163 | { |
| 164 | 164 | int offs; |
| 165 | 165 |
| r1877 | r1878 | |
|---|---|---|
| 110 | 110 | static int num_sprites; |
| 111 | 111 | static struct sprite_cave *sprite_cave; |
| 112 | 112 | static struct sprite_cave *sprite_table[MAX_PRIORITY][MAX_SPRITE_NUM+1]; |
| 113 | static | |
| 113 | static | |
| 114 | 114 | static UINT16 sprite_zbuf_baseval = 0x10000-MAX_SPRITE_NUM; |
| 115 | 115 | |
| 116 | 116 | static void (*get_sprite_info)(running_machine *machine); |
| r1877 | r1878 | |
| 1304 | 1304 | ***************************************************************************/ |
| 1305 | 1305 | |
| 1306 | 1306 | INLINE void cave_tilemap_draw( |
| 1307 | | |
| 1307 | | |
| 1308 | 1308 | tilemap *TILEMAP, UINT16 *VRAM, UINT16 *VCTRL, |
| 1309 | 1309 | UINT32 flags, UINT32 priority, UINT32 priority2 ) |
| 1310 | 1310 | { |
| r1877 | r1878 | |
| 1424 | 1424 | } |
| 1425 | 1425 | } |
| 1426 | 1426 | |
| 1427 | static void cave_tilemap_0_draw( | |
| 1427 | static void cave_tilemap_0_draw( | |
| 1428 | 1428 | { cave_tilemap_draw( bitmap, cliprect, tilemap_0, cave_vram_0, cave_vctrl_0, flags, priority, priority2 ); } |
| 1429 | static void cave_tilemap_1_draw( | |
| 1429 | static void cave_tilemap_1_draw( | |
| 1430 | 1430 | { cave_tilemap_draw( bitmap, cliprect, tilemap_1, cave_vram_1, cave_vctrl_1, flags, priority, priority2 ); } |
| 1431 | static void cave_tilemap_2_draw( | |
| 1431 | static void cave_tilemap_2_draw( | |
| 1432 | 1432 | { cave_tilemap_draw( bitmap, cliprect, tilemap_2, cave_vram_2, cave_vctrl_2, flags, priority, priority2 ); } |
| 1433 | static void cave_tilemap_3_draw( | |
| 1433 | static void cave_tilemap_3_draw( | |
| 1434 | 1434 | { cave_tilemap_draw( bitmap, cliprect, tilemap_3, cave_vram_3, cave_vctrl_3, flags, priority, priority2 ); } |
| 1435 | 1435 | |
| 1436 | 1436 |
| r1877 | r1878 | |
|---|---|---|
| 94 | 94 | |
| 95 | 95 | WRITE16_HANDLER( dooyong_bgscroll16_w ) |
| 96 | 96 | { |
| 97 | if (ACCESSING_LSB) dooyong_bgscroll8_w(offset, data & 0x00ff); | |
| 97 | if (ACCESSING_LSB) dooyong_bgscroll8_w(machine, offset, data & 0x00ff); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | WRITE16_HANDLER( dooyong_bg2scroll16_w ) |
| 101 | 101 | { |
| 102 | if (ACCESSING_LSB) dooyong_bg2scroll8_w(offset, data & 0x00ff); | |
| 102 | if (ACCESSING_LSB) dooyong_bg2scroll8_w(machine, offset, data & 0x00ff); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | WRITE16_HANDLER( dooyong_fgscroll16_w ) |
| 106 | 106 | { |
| 107 | if (ACCESSING_LSB) dooyong_fgscroll8_w(offset, data & 0x00ff); | |
| 107 | if (ACCESSING_LSB) dooyong_fgscroll8_w(machine, offset, data & 0x00ff); | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | WRITE16_HANDLER( dooyong_fg2scroll16_w ) |
| 111 | 111 | { |
| 112 | if (ACCESSING_LSB) dooyong_fg2scroll8_w(offset, data & 0x00ff); | |
| 112 | if (ACCESSING_LSB) dooyong_fg2scroll8_w(machine, offset, data & 0x00ff); | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
| r1877 | r1878 | |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | |
| 347 | static void draw_sprites(running_machine *machine, | |
| 347 | static void draw_sprites(running_machine *machine, | |
| 348 | 348 | { |
| 349 | 349 | /* Sprites take 32 bytes each in memory: |
| 350 | 350 | MSB LSB |
| r1877 | r1878 | |
| 434 | 434 | } |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | static void rshark_draw_sprites(running_machine *machine, | |
| 437 | static void rshark_draw_sprites(running_machine *machine, | |
| 438 | 438 | { |
| 439 | 439 | /* Sprites take 8 16-bit words each in memory: |
| 440 | 440 | MSB LSB |
| r1877 | r1878 | |
| 866 | 866 | |
| 867 | 867 | VIDEO_EOF( dooyong ) |
| 868 | 868 | { |
| 869 | buffer_spriteram_w(0, 0); | |
| 869 | buffer_spriteram_w(machine, 0, 0); | |
| 870 | 870 | } |
| 871 | 871 | |
| 872 | 872 | VIDEO_EOF( rshark ) |
| 873 | 873 | { |
| 874 | buffer_spriteram16_w(0, 0, 0); | |
| 874 | buffer_spriteram16_w(machine, 0, 0, 0); | |
| 875 | 875 | } |
| r1877 | r1878 | |
|---|---|---|
| 163 | 163 | |
| 164 | 164 | |
| 165 | 165 | #if 0 |
| 166 | static void show_register( | |
| 166 | static void show_register( | |
| 167 | 167 | { |
| 168 | 168 | char buf[5]; |
| 169 | 169 | |
| r1877 | r1878 | |
| 173 | 173 | #endif |
| 174 | 174 | |
| 175 | 175 | |
| 176 | static void draw_sprites(running_machine *machine, | |
| 176 | static void draw_sprites(running_machine *machine, | |
| 177 | 177 | { |
| 178 | 178 | int offs; |
| 179 | 179 | /* Draw the sprites. Note that it is important to draw them exactly in this */ |
| r1877 | r1878 | |
|---|---|---|
| 244 | 244 | /******************************************************************************/ |
| 245 | 245 | |
| 246 | 246 | /* 'Karnov' sprites, used by Gondomania, Last Mission, Shackled, Ghostbusters */ |
| 247 | static void draw_sprites1(running_machine* machine, | |
| 247 | static void draw_sprites1(running_machine* machine, | |
| 248 | 248 | { |
| 249 | 249 | int offs,x,y,sprite,sprite2,colour,extra,fx,fy; |
| 250 | 250 | |
| r1877 | r1878 | |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | /* 'Dec0' sprites, used by Cobra Command, Oscar */ |
| 310 | static void draw_sprites2(running_machine* machine, | |
| 310 | static void draw_sprites2(running_machine* machine, | |
| 311 | 311 | { |
| 312 | 312 | int offs,x,y,sprite,colour,multi,fx,fy,inc,flash,mult; |
| 313 | 313 | |
| r1877 | r1878 | |
| 319 | 319 | x = buffered_spriteram[offs+5]+(buffered_spriteram[offs+4]<<8); |
| 320 | 320 | colour = ((x & 0xf000) >> 12); |
| 321 | 321 | flash=x&0x800; |
| 322 | if (flash && ( | |
| 322 | if (flash && (vid | |
| 323 | 323 | |
| 324 | 324 | if (priority==1 && (colour&4)) continue; |
| 325 | 325 | if (priority==2 && !(colour&4)) continue; |
| r1877 | r1878 | |
| 370 | 370 | } |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | static void srdarwin_draw_sprites(running_machine* machine, | |
| 373 | static void srdarwin_draw_sprites(running_machine* machine, | |
| 374 | 374 | { |
| 375 | 375 | int offs; |
| 376 | 376 | |
| r1877 | r1878 | |
| 420 | 420 | |
| 421 | 421 | /* Draw character tiles, each game has different colour masks */ |
| 422 | 422 | #if 0 |
| 423 | static void draw_characters(running_machine* machine, | |
| 423 | static void draw_characters(running_machine* machine, | |
| 424 | 424 | { |
| 425 | 425 | int mx,my,tile,color,offs; |
| 426 | 426 |
| r1877 | r1878 | |
|---|---|---|
| 159 | 159 | |
| 160 | 160 | ***************************************************************************/ |
| 161 | 161 | |
| 162 | static void draw_sprites(running_machine *machine, | |
| 162 | static void draw_sprites(running_machine *machine, | |
| 163 | 163 | { |
| 164 | 164 | int offs; |
| 165 | 165 | |
| r1877 | r1878 | |
| 300 | 300 | ***************************************************************************/ |
| 301 | 301 | |
| 302 | 302 | /* Wrapper to handle bg and bg2 ttogether */ |
| 303 | static void fuuki32_draw_layer( | |
| 303 | static void fuuki32_draw_layer( | |
| 304 | 304 | { |
| 305 | 305 | int buffer = ((fuuki32_vregs[0x1e/4]&0x0000ffff) & 0x40); |
| 306 | 306 |
| r1877 | r1878 | |
|---|---|---|
| 116 | 116 | tbowl_bg2yscroll = (tbowl_bg2yscroll & 0x00ff) | (data << 8); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | static void draw_sprites(running_machine *machine, | |
| 119 | static void draw_sprites(running_machine *machine, | |
| 120 | 120 | { |
| 121 | 121 | int offs; |
| 122 | 122 | static const UINT8 layout[8][8] = |
| r1877 | r1878 | |
|---|---|---|
| 15 | 15 | static int battlane_video_ctrl; |
| 16 | 16 | extern int battlane_cpu_control; |
| 17 | 17 | |
| 18 | static | |
| 18 | static | |
| 19 | 19 | |
| 20 | 20 | /* |
| 21 | 21 | Video control register |
| r1877 | r1878 | |
| 150 | 150 | screen_bitmap = auto_bitmap_alloc(32 * 8, 32 * 8, BITMAP_FORMAT_INDEXED8); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | static void draw_sprites(running_machine *machine, | |
| 153 | static void draw_sprites(running_machine *machine, | |
| 154 | 154 | { |
| 155 | 155 | int offs, attr, code, color, sx, sy, flipx, flipy, dy; |
| 156 | 156 | |
| r1877 | r1878 | |
| 215 | 215 | } |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | static void draw_fg_bitmap(running_machine *machine, | |
| 218 | static void draw_fg_bitmap(running_machine *machine, | |
| 219 | 219 | { |
| 220 | 220 | int x, y, data; |
| 221 | 221 |
| r1877 | r1878 | |
|---|---|---|
| 53 | 53 | * |
| 54 | 54 | *************************************/ |
| 55 | 55 | |
| 56 | static mame_bitmap *pf_bitmap; | |
| 57 | static mame_bitmap *an_bitmap; | |
| 56 | static bitmap_t *pf_bitmap; | |
| 57 | static bitmap_t *an_bitmap; | |
| 58 | 58 | |
| 59 | 59 | static UINT8 playfield_tile_bank; |
| 60 | 60 | static UINT8 playfield_color_bank; |
| r1877 | r1878 | |
| 559 | 559 | |
| 560 | 560 | VIDEO_UPDATE( atarigt ) |
| 561 | 561 | { |
| 562 | mame_bitmap *mo_bitmap = atarirle_get_vram(0, 0); | |
| 563 | mame_bitmap *tm_bitmap = atarirle_get_vram(0, 1); | |
| 562 | bitmap_t *mo_bitmap = atarirle_get_vram(0, 0); | |
| 563 | bitmap_t *tm_bitmap = atarirle_get_vram(0, 1); | |
| 564 | 564 | int color_latch; |
| 565 | 565 | int x, y; |
| 566 | 566 |
| r1877 | r1878 | |
|---|---|---|
| 296 | 296 | return 0; |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | void update_system18_vdp( | |
| 299 | void update_system18_vdp( | |
| 300 | 300 | { |
| 301 | 301 | int y; |
| 302 | 302 | |
| r1877 | r1878 | |
| 400 | 400 | case 0x0a: |
| 401 | 401 | case 0x0b: |
| 402 | 402 | if (ACCESSING_LSB && sndti_exists(SOUND_SN76496, 0)) |
| 403 | SN76496_0_w(0, data & 0xff); | |
| 403 | SN76496_0_w(machine, 0, data & 0xff); | |
| 404 | 404 | break; |
| 405 | 405 | } |
| 406 | 406 | } |
| r1877 | r1878 | |
|---|---|---|
| 219 | 219 | horizontal flip switch. (This is how the real PCB does it) */ |
| 220 | 220 | if (thepit_flip_screen_x) |
| 221 | 221 | { |
| 222 | return input_port_3_r(offset); | |
| 222 | return input_port_3_r(machine,offset); | |
| 223 | 223 | } |
| 224 | 224 | else |
| 225 | 225 | { |
| 226 | return input_port_0_r(offset); | |
| 226 | return input_port_0_r(machine,offset); | |
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | |
| r1877 | r1878 | |
| 236 | 236 | *************************************/ |
| 237 | 237 | |
| 238 | 238 | static void draw_sprites(running_machine *machine, |
| 239 | | |
| 239 | | |
| 240 | 240 | const rectangle *cliprect, |
| 241 | 241 | int priority_to_draw) |
| 242 | 242 | { |
| r1877 | r1878 | |
|---|---|---|
| 207 | 207 | * |
| 208 | 208 | *************************************/ |
| 209 | 209 | |
| 210 | static void draw_sprites(running_machine *machine, | |
| 210 | static void draw_sprites(running_machine *machine, | |
| 211 | 211 | { |
| 212 | 212 | int offs; |
| 213 | 213 | |
| r1877 | r1878 | |
| 243 | 243 | * |
| 244 | 244 | *************************************/ |
| 245 | 245 | |
| 246 | static void draw_bitmap( | |
| 246 | static void draw_bitmap( | |
| 247 | 247 | { |
| 248 | 248 | int colourbase; |
| 249 | 249 | int xxx=512/4; |
| r1877 | r1878 | |
|---|---|---|
| 17 | 17 | *************************************/ |
| 18 | 18 | |
| 19 | 19 | static double rweights[3], gweights[3], bweights[3]; |
| 20 | static | |
| 20 | static | |
| 21 | 21 | |
| 22 | 22 | static UINT8 video_control[8]; |
| 23 | 23 | static UINT8 bitmode_addr[2]; |
| r1877 | r1878 | |
|---|---|---|
| 2 | 2 | { |
| 3 | 3 | const poly_extra_data *extra = extradata; |
| 4 | 4 | const cached_texture *texture = extra->texture; |
| 5 | | |
| 5 | | |
| 6 | 6 | UINT16 *p = BITMAP_ADDR16(destmap, scanline, 0); |
| 7 | 7 | UINT32 *d = BITMAP_ADDR32(zbuffer, scanline, 0); |
| 8 | 8 | float ooz = extent->param[0].start; |
| r1877 | r1878 | |
| 51 | 51 | { |
| 52 | 52 | const poly_extra_data *extra = extradata; |
| 53 | 53 | const cached_texture *texture = extra->texture; |
| 54 | | |
| 54 | | |
| 55 | 55 | UINT16 *p = BITMAP_ADDR16(destmap, scanline, 0); |
| 56 | 56 | UINT32 *d = BITMAP_ADDR32(zbuffer, scanline, 0); |
| 57 | 57 | float ooz = extent->param[0].start; |
| r1877 | r1878 | |
| 106 | 106 | { |
| 107 | 107 | const poly_extra_data *extra = extradata; |
| 108 | 108 | const cached_texture *texture = extra->texture; |
| 109 | | |
| 109 | | |
| 110 | 110 | UINT16 *p = BITMAP_ADDR16(destmap, scanline, 0); |
| 111 | 111 | UINT32 *d = BITMAP_ADDR32(zbuffer, scanline, 0); |
| 112 | 112 | float ooz = extent->param[0].start; |
| r1877 | r1878 | |
| 164 | 164 | { |
| 165 | 165 | const poly_extra_data *extra = extradata; |
| 166 | 166 | const cached_texture *texture = extra->texture; |
| 167 | | |
| 167 | | |
| 168 | 168 | UINT16 *p = BITMAP_ADDR16(destmap, scanline, 0); |
| 169 | 169 | UINT32 *d = BITMAP_ADDR32(zbuffer, scanline, 0); |
| 170 | 170 | float ooz = extent->param[0].start; |
| r1877 | r1878 | |
| 223 | 223 | static void draw_scanline_color(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid) |
| 224 | 224 | { |
| 225 | 225 | const poly_extra_data *extra = extradata; |
| 226 | | |
| 226 | | |
| 227 | 227 | UINT16 *p = BITMAP_ADDR16(destmap, scanline, 0); |
| 228 | 228 | UINT32 *d = BITMAP_ADDR32(zbuffer, scanline, 0); |
| 229 | 229 | float ooz = extent->param[0].start; |
| r1877 | r1878 | |
|---|---|---|
| 32 | 32 | static UINT8* tree_ram; |
| 33 | 33 | static UINT32 mem_dev_selected; /* an offset within memory_devices area */ |
| 34 | 34 | |
| 35 | static | |
| 35 | static | |
| 36 | 36 | |
| 37 | 37 | static emu_timer* changela_scanline_timer; |
| 38 | 38 | static TIMER_CALLBACK( changela_scanline_callback ); |
| r1877 | r1878 | |
| 64 | 64 | Obj 0 - Sprite Layer |
| 65 | 65 | |
| 66 | 66 | ***************************************************************************/ |
| 67 | static void draw_obj0( | |
| 67 | static void draw_obj0( | |
| 68 | 68 | { |
| 69 | 69 | int sx, i; |
| 70 | 70 | |
| r1877 | r1878 | |
| 125 | 125 | Obj 1 - Text Layer |
| 126 | 126 | |
| 127 | 127 | ***************************************************************************/ |
| 128 | static void draw_obj1( | |
| 128 | static void draw_obj1( | |
| 129 | 129 | { |
| 130 | 130 | int sx, sy; |
| 131 | 131 | |
| r1877 | r1878 | |
| 188 | 188 | River Video Generator |
| 189 | 189 | |
| 190 | 190 | ***************************************************************************/ |
| 191 | static void draw_river( | |
| 191 | static void draw_river( | |
| 192 | 192 | { |
| 193 | 193 | int sx, i, j; |
| 194 | 194 | |
| r1877 | r1878 | |
| 367 | 367 | Tree Generators |
| 368 | 368 | |
| 369 | 369 | ***************************************************************************/ |
| 370 | static void draw_tree( | |
| 370 | static void draw_tree( | |
| 371 | 371 | { |
| 372 | 372 | int sx, i, j; |
| 373 | 373 |
| r1877 | r1878 | |
|---|---|---|
| 17 | 17 | int triplhnt_sprite_zoom; |
| 18 | 18 | int triplhnt_sprite_bank; |
| 19 | 19 | |
| 20 | static | |
| 20 | static | |
| 21 | 21 | static tilemap* bg_tilemap; |
| 22 | 22 | |
| 23 | 23 | |
| r1877 | r1878 | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
| 46 | static void draw_sprites(running_machine *machine, | |
| 46 | static void draw_sprites(running_machine *machine, | |
| 47 | 47 | { |
| 48 | 48 | int i; |
| 49 | 49 | |
| r1877 | r1878 | |
| 142 | 142 | |
| 143 | 143 | draw_sprites(machine, bitmap, cliprect); |
| 144 | 144 | |
| 145 | discrete_sound_w(TRIPLHNT_BEAR_ROAR_DATA, triplhnt_playfield_ram[0xfa] & 15); | |
| 146 | discrete_sound_w(TRIPLHNT_SHOT_DATA, triplhnt_playfield_ram[0xfc] & 15); | |
| 145 | discrete_sound_w(machine, TRIPLHNT_BEAR_ROAR_DATA, triplhnt_playfield_ram[0xfa] & 15); | |
| 146 | discrete_sound_w(machine, TRIPLHNT_SHOT_DATA, triplhnt_playfield_ram[0xfc] & 15); | |
| 147 | 147 | return 0; |
| 148 | 148 | } |
| r1877 | r1878 | |
|---|---|---|
| 158 | 158 | * |
| 159 | 159 | *************************************/ |
| 160 | 160 | |
| 161 | static void draw_sprites(running_machine *machine, | |
| 161 | static void draw_sprites(running_machine *machine, | |
| 162 | 162 | { |
| 163 | 163 | int offs; |
| 164 | 164 |
| r1877 | r1878 | |
|---|---|---|
| 106 | 106 | |
| 107 | 107 | ***************************************************************************/ |
| 108 | 108 | |
| 109 | static void draw_sprites(running_machine *machine, | |
| 109 | static void draw_sprites(running_machine *machine, | |
| 110 | 110 | { |
| 111 | 111 | int offs; |
| 112 | 112 |
| r1877 | r1878 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | static UINT8* LFSR; |
| 29 | 29 | |
| 30 | static | |
| 30 | static | |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | PALETTE_INIT( wolfpack ) |
| r1877 | r1878 | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | |
| 143 | static void draw_ship(running_machine *machine, | |
| 143 | static void draw_ship(running_machine *machine, | |
| 144 | 144 | { |
| 145 | 145 | static const UINT32 scaler[] = |
| 146 | 146 | { |
| r1877 | r1878 | |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | |
| 179 | static void draw_torpedo(running_machine *machine, | |
| 179 | static void draw_torpedo(running_machine *machine, | |
| 180 | 180 | { |
| 181 | 181 | int count = 0; |
| 182 | 182 | |
| r1877 | r1878 | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | |
| 213 | static void draw_pt(running_machine *machine, | |
| 213 | static void draw_pt(running_machine *machine, | |
| 214 | 214 | { |
| 215 | 215 | rectangle rect = *cliprect; |
| 216 | 216 | |
| r1877 | r1878 | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | |
| 243 | static void draw_water(colortable_t *colortable, | |
| 243 | static void draw_water(colortable_t *colortable, | |
| 244 | 244 | { |
| 245 | 245 | rectangle rect = *cliprect; |
| 246 | 246 |
| r1877 | r1878 | |
|---|---|---|
| 72 | 72 | |
| 73 | 73 | |
| 74 | 74 | |
| 75 | static void draw_sprites(running_machine *machine, | |
| 75 | static void draw_sprites(running_machine *machine, | |
| 76 | 76 | { |
| 77 | 77 | const gfx_element *gfx = machine->gfx[1]; |
| 78 | 78 | UINT16 *source = pirates_spriteram + 4; |
| r1877 | r1878 | |
|---|---|---|
| 80 | 80 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | static void draw_bullets(running_machine *machine, | |
| 83 | static void draw_bullets(running_machine *machine, | |
| 84 | 84 | { |
| 85 | 85 | int offs; |
| 86 | 86 |
| r1877 | r1878 | |
|---|---|---|
| 93 | 93 | /* fg chars and sprites */ |
| 94 | 94 | for (i = 0; i < 0x200; i++) |
| 95 | 95 | { |
| 96 | UINT8 ctabentry = 0x10 | (color_prom[(i & 0xc0) | ((i & 3) << 4) | ((i >> 2) & 0x0f)] & 0x0f); | |
| 96 | UINT8 ctabentry = 0x10 | (color_prom[(i & 0x1c0) | ((i & 3) << 4) | ((i >> 2) & 0x0f)] & 0x0f); | |
| 97 | 97 | colortable_entry_set_value(machine->colortable, i, ctabentry); |
| 98 | 98 | } |
| 99 | 99 | |
| r1877 | r1878 | |
| 236 | 236 | * |
| 237 | 237 | *************************************/ |
| 238 | 238 | |
| 239 | static void draw_background( | |
| 239 | static void draw_background( | |
| 240 | 240 | { |
| 241 | 241 | int x, y; |
| 242 | 242 |
| r1877 | r1878 | |
|---|---|---|
| 113 | 113 | preliminary |
| 114 | 114 | */ |
| 115 | 115 | |
| 116 | static void draw_sprites(running_machine *machine, | |
| 116 | static void draw_sprites(running_machine *machine, | |
| 117 | 117 | { |
| 118 | 118 | int i, x, y, ex, ey; |
| 119 | 119 | const gfx_element *gfx = machine->gfx[0]; |
| r1877 | r1878 | |
|---|---|---|
| 26 | 26 | * |
| 27 | 27 | *************************************/ |
| 28 | 28 | |
| 29 | static | |
| 29 | static | |
| 30 | 30 | |
| 31 | 31 | static UINT8 grayscale_enable; |
| 32 | 32 | static UINT8 vdp_enable; |
| r1877 | r1878 | |
| 41 | 41 | *************************************/ |
| 42 | 42 | |
| 43 | 43 | extern void start_system18_vdp(void); |
| 44 | extern void update_system18_vdp( | |
| 44 | extern void update_system18_vdp( | |
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | |
| r1877 | r1878 | |
| 123 | 123 | * |
| 124 | 124 | *************************************/ |
| 125 | 125 | |
| 126 | static void draw_vdp( | |
| 126 | static void draw_vdp( | |
| 127 | 127 | { |
| 128 | 128 | int x, y; |
| 129 | 129 |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "deprecat.h" | |
| 14 | 13 | |
| 15 | 14 | static int xsproff, ysproff; // sprite offsets |
| 16 | 15 | static tilemap *bg_layer,*fg_layer; |
| r1877 | r1878 | |
| 126 | 125 | */ |
| 127 | 126 | |
| 128 | 127 | /* jumpkids / tumbleb.c! */ |
| 129 | static void draw_sprites(running_machine *machine, | |
| 128 | static void draw_sprites(running_machine *machine, | |
| 130 | 129 | { |
| 131 | 130 | int offs; |
| 132 | 131 | int flipscreen = 0; |
| r1877 | r1878 | |
| 140 | 139 | |
| 141 | 140 | y = spriteram16[offs]; |
| 142 | 141 | flash=y&0x1000; |
| 143 | if (flash && ( | |
| 142 | if (flash && (vid | |
| 144 | 143 | |
| 145 | 144 | x = spriteram16[offs+2]; |
| 146 | 145 | colour = (x >>9) & 0xf; |
| r1877 | r1878 | |
|---|---|---|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | /* Update sound */ |
| 161 | discrete_sound_w(SUBS_LAUNCH_DATA, spriteram[5] & 0x0f); // Launch data | |
| 162 | discrete_sound_w(SUBS_CRASH_DATA, spriteram[5] >> 4); // Crash/explode data | |
| 161 | discrete_sound_w(machine, SUBS_LAUNCH_DATA, spriteram[5] & 0x0f); // Launch data | |
| 162 | discrete_sound_w(machine, SUBS_CRASH_DATA, spriteram[5] >> 4); // Crash/explode data | |
| 163 | 163 | return 0; |
| 164 | 164 | } |
| r1877 | r1878 | |
|---|---|---|
| 148 | 148 | timer_pulse(ATTOTIME_IN_HZ(75), NULL, 0, exctsccr_fm_callback); /* updates fm */ |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | static void draw_sprites(running_machine *machine, | |
| 151 | static void draw_sprites(running_machine *machine, | |
| 152 | 152 | { |
| 153 | 153 | int offs; |
| 154 | 154 | UINT8 *OBJ1, *OBJ2; |
| r1877 | r1878 | |
|---|---|---|
| 32 | 32 | { |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | static void draw_sprites(running_machine *machine, | |
| 35 | static void draw_sprites(running_machine *machine, | |
| 36 | 36 | { |
| 37 | 37 | |
| 38 | 38 |
| r1877 | r1878 | |
|---|---|---|
| 22 | 22 | static UINT8 bioship_scroll[4]; |
| 23 | 23 | |
| 24 | 24 | static tilemap *bg_tilemap,*fg_tilemap,*tx_tilemap; |
| 25 | static | |
| 25 | static | |
| 26 | 26 | extern UINT16* nmk16_mainram; |
| 27 | 27 | |
| 28 | 28 | /*************************************************************************** |
| r1877 | r1878 | |
| 423 | 423 | |
| 424 | 424 | // manybloc uses extra flip bits on the sprites, but these break other games |
| 425 | 425 | |
| 426 | static void nmk16_draw_sprites(running_machine *machine, | |
| 426 | static void nmk16_draw_sprites(running_machine *machine, | |
| 427 | 427 | { |
| 428 | 428 | int offs; |
| 429 | 429 | |
| r1877 | r1878 | |
| 474 | 474 | } |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | static void nmk16_draw_sprites_flipsupported(running_machine *machine, | |
| 477 | static void nmk16_draw_sprites_flipsupported(running_machine *machine, | |
| 478 | 478 | { |
| 479 | 479 | int offs; |
| 480 | 480 | |
| r1877 | r1878 | |
| 1040 | 1040 | |
| 1041 | 1041 | ***************************************************************************/ |
| 1042 | 1042 | |
| 1043 | static void video_update(running_machine *machine, | |
| 1043 | static void video_update(running_machine *machine, | |
| 1044 | 1044 | int dsw_flipscreen, // 1 = Horizontal and vertical screen flip are hardwired to 2 dip switches |
| 1045 | 1045 | int xoffset, int yoffset, // tilemap_0 offsets |
| 1046 | 1046 | int attr_mask // "sprite active" mask |
| r1877 | r1878 | |
|---|---|---|
| 22 | 22 | nitedrvr_hvc[offset & 0x3f] = data; |
| 23 | 23 | |
| 24 | 24 | if ((offset & 0x30) == 0x30) |
| 25 | watchdog_reset_w(0, 0); | |
| 25 | watchdog_reset_w(machine, 0, 0); | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | static TILE_GET_INFO( get_bg_tile_info ) |
| r1877 | r1878 | |
| 39 | 39 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | static void draw_box( | |
| 42 | static void draw_box( | |
| 43 | 43 | { |
| 44 | 44 | int x, y; |
| 45 | 45 | |
| r1877 | r1878 | |
| 53 | 53 | return; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | static void draw_roadway( | |
| 56 | static void draw_roadway( | |
| 57 | 57 | { |
| 58 | 58 | int roadway; |
| 59 | 59 |
| r1877 | r1878 | |
|---|---|---|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
| 81 | INLINE void plot_pixel_m10( | |
| 81 | INLINE void plot_pixel_m10( | |
| 82 | 82 | { |
| 83 | 83 | m10_state *state = Machine->driver_data; |
| 84 | 84 | |
| r1877 | r1878 | |
| 127 | 127 | |
| 128 | 128 | /*************************************************************************** |
| 129 | 129 | |
| 130 | Draw the game screen in the given | |
| 130 | Draw the game screen in the given | |
| 131 | 131 | |
| 132 | 132 | ***************************************************************************/ |
| 133 | 133 | VIDEO_UPDATE( m10 ) |
| r1877 | r1878 | |
| 167 | 167 | |
| 168 | 168 | /*************************************************************************** |
| 169 | 169 | |
| 170 | Draw the game screen in the given | |
| 170 | Draw the game screen in the given | |
| 171 | 171 | |
| 172 | 172 | ***************************************************************************/ |
| 173 | 173 | VIDEO_UPDATE( m15 ) |
| r1877 | r1878 | |
|---|---|---|
| 1497 | 1497 | MDRV_CPU_ADD(Z80, Z80_XTAL) |
| 1498 | 1498 | MDRV_CPU_PROGRAM_MAP(z80_prog_map, 0) |
| 1499 | 1499 | MDRV_CPU_IO_MAP(z80_io_map, 0) |
| 1500 | MDRV_CPU_VBLANK_INT(vblank_gen | |
| 1500 | MDRV_CPU_VBLANK_INT("main", vblank_gen | |
| 1501 | 1501 | |
| 1502 | 1502 | MDRV_CPU_ADD(M6809, M6809_XTAL) |
| 1503 | 1503 | MDRV_CPU_PROGRAM_MAP(m6809_prog_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 296 | 296 | MDRV_CPU_ADD(Z80, 8000000/2) // ??? |
| 297 | 297 | MDRV_CPU_PROGRAM_MAP(rcasino_map, 0) |
| 298 | 298 | MDRV_CPU_IO_MAP(rcasino_io_map, 0) |
| 299 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 299 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 300 | 300 | |
| 301 | 301 | // video hardware |
| 302 | 302 |
| r1877 | r1878 | |
|---|---|---|
| 98 | 98 | */ |
| 99 | 99 | |
| 100 | 100 | #include "driver.h" |
| 101 | #include "deprecat.h" | |
| 101 | 102 | #include "sound/sn76496.h" |
| 102 | 103 | |
| 103 | 104 | //arbitrary |
| r1877 | r1878 | |
| 229 | 230 | MDRV_CPU_ADD(8085A, 6000000) /* 3.00 MHz??? */ |
| 230 | 231 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 231 | 232 | MDRV_CPU_IO_MAP(readport,0) |
| 232 | MDRV_CPU_VBLANK_INT(irq3_line_hold,NUM_INTS_FRAME) | |
| 233 | MDRV_CPU_VBLANK_INT_HACK(irq3_line_hold,NUM_INTS_FRAME) | |
| 233 | 234 | |
| 234 | 235 | MDRV_GFXDECODE(sbugger) |
| 235 | 236 |
| r1877 | r1878 | |
|---|---|---|
| 190 | 190 | /* basic machine hardware */ |
| 191 | 191 | MDRV_CPU_ADD(M68000,24000000/2) /* 12 MHz */ |
| 192 | 192 | MDRV_CPU_PROGRAM_MAP(targeth_readmem,targeth_writemem) |
| 193 | MDRV_CPU_VBLANK_INT(targeth_interrupt,3) | |
| 193 | MDRV_CPU_VBLANK_INT_HACK(targeth_interrupt,3) | |
| 194 | 194 | |
| 195 | 195 | /* video hardware */ |
| 196 | 196 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 92 | 92 | MDRV_CPU_ADD(Z80,4000000) /* ? MHz */ |
| 93 | 93 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 94 | 94 | MDRV_CPU_IO_MAP(readport,0) |
| 95 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 95 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 96 | 96 | |
| 97 | 97 | /* video hardware */ |
| 98 | 98 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 270 | 270 | |
| 271 | 271 | static WRITE8_HANDLER( sound_command_w ) |
| 272 | 272 | { |
| 273 | soundlatch_w(0,data); | |
| 273 | soundlatch_w(machine,0,data); | |
| 274 | 274 | timer_call_after_resynch(NULL, data,nmi_callback); |
| 275 | 275 | } |
| 276 | 276 | |
| r1877 | r1878 | |
| 800 | 800 | /* basic machine hardware */ |
| 801 | 801 | MDRV_CPU_ADD(Z80,8000000/2) /* ??? */ |
| 802 | 802 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 803 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 803 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 804 | 804 | |
| 805 | 805 | MDRV_CPU_ADD(Z80,8000000/2) |
| 806 | 806 | MDRV_CPU_PROGRAM_MAP(readmem_sub,writemem_sub) |
| 807 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 807 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 808 | 808 | |
| 809 | 809 | MDRV_CPU_ADD(Z80,8000000/2) |
| 810 | 810 | /* audio CPU */ |
| 811 | 811 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 812 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) /* IRQ generated by ??? */ | |
| 812 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) /* IRQ generated by ??? */ | |
| 813 | 813 | |
| 814 | 814 | MDRV_CPU_ADD(M68705,2000000) |
| 815 | 815 | MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem) |
| r1877 | r1878 | |
| 853 | 853 | MDRV_CPU_ADD(Z80,8000000/2) |
| 854 | 854 | |
| 855 | 855 | MDRV_CPU_PROGRAM_MAP(cyclshtg_readmem,cyclshtg_writemem) |
| 856 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 856 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 857 | 857 | |
| 858 | 858 | MDRV_CPU_ADD(Z80,8000000/2) |
| 859 | 859 | MDRV_CPU_PROGRAM_MAP(cyclshtg_readmem_sub,cyclshtg_writemem_sub) |
| 860 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 860 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 861 | 861 | |
| 862 | 862 | MDRV_CPU_ADD(Z80,8000000/2) |
| 863 | 863 | /* audio CPU */ |
| 864 | 864 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 865 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 865 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 866 | 866 | |
| 867 | 867 | #ifdef USE_MCU |
| 868 | 868 | MDRV_CPU_ADD(M68705,2000000) |
| r1877 | r1878 | |
| 905 | 905 | MDRV_CPU_ADD(Z80,8000000/2) |
| 906 | 906 | |
| 907 | 907 | MDRV_CPU_PROGRAM_MAP(bronx_readmem, bronx_writemem) |
| 908 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 908 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 909 | 909 | |
| 910 | 910 | MDRV_CPU_ADD(Z80,8000000/2) |
| 911 | 911 | MDRV_CPU_PROGRAM_MAP(bronx_readmem_sub, bronx_writemem_sub) |
| 912 | 912 | MDRV_CPU_IO_MAP(bronx_io, 0) |
| 913 | 913 | |
| 914 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 914 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 915 | 915 | |
| 916 | 916 | MDRV_CPU_ADD(Z80,8000000/2) |
| 917 | 917 | /* audio CPU */ |
| 918 | 918 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 919 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 919 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 920 | 920 | |
| 921 | 921 | MDRV_INTERLEAVE(2) |
| 922 | 922 | MDRV_MACHINE_RESET(ta7630) |
| r1877 | r1878 | |
|---|---|---|
| 193 | 193 | if (pang_port5_kludge) /* hack... music doesn't work otherwise */ |
| 194 | 194 | bit ^= 0x08; |
| 195 | 195 | |
| 196 | return (input_port_0_r(0) & 0x76) | bit; | |
| 196 | return (input_port_0_r(machine,0) & 0x76) | bit; | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | static WRITE8_HANDLER( eeprom_cs_w ) |
| r1877 | r1878 | |
| 307 | 307 | return readinputport(1 + offset); |
| 308 | 308 | break; |
| 309 | 309 | case 1: /* Mahjong games */ |
| 310 | if (offset) return mahjong_input_r(offset-1); | |
| 310 | if (offset) return mahjong_input_r(machine,offset-1); | |
| 311 | 311 | else return readinputport(1); |
| 312 | 312 | break; |
| 313 | 313 | case 2: /* Block Block - dial control */ |
| 314 | if (offset) return block_input_r(offset-1); | |
| 314 | if (offset) return block_input_r(machine,offset-1); | |
| 315 | 315 | else return readinputport(1); |
| 316 | 316 | break; |
| 317 | 317 | case 3: /* Super Pang - simulate START 1 press to initialize EEPROM */ |
| r1877 | r1878 | |
| 335 | 335 | logerror("PC %04x: write %02x to port 01\n",activecpu_get_pc(),data); |
| 336 | 336 | break; |
| 337 | 337 | case 1: |
| 338 | mahjong_input_select_w(offset,data); | |
| 338 | mahjong_input_select_w(machine,offset,data); | |
| 339 | 339 | break; |
| 340 | 340 | case 2: |
| 341 | block_dial_control_w(offset,data); | |
| 341 | block_dial_control_w(machine,offset,data); | |
| 342 | 342 | break; |
| 343 | 343 | } |
| 344 | 344 | } |
| r1877 | r1878 | |
| 483 | 483 | |
| 484 | 484 | static WRITE8_HANDLER(mstworld_sound_w) |
| 485 | 485 | { |
| 486 | soundlatch_w(0,data); | |
| 487 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 486 | soundlatch_w(machine,0,data); | |
| 487 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | extern WRITE8_HANDLER( mstworld_gfxctrl_w ); |
| r1877 | r1878 | |
| 1331 | 1331 | MDRV_CPU_ADD(Z80, 6000000) /* ??? */ |
| 1332 | 1332 | MDRV_CPU_PROGRAM_MAP(mgakuen_readmem,mgakuen_writemem) |
| 1333 | 1333 | MDRV_CPU_IO_MAP(readport,writeport) |
| 1334 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) /* ??? one extra irq seems to be needed for music (see input5_r) */ | |
| 1334 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) /* ??? one extra irq seems to be needed for music (see input5_r) */ | |
| 1335 | 1335 | |
| 1336 | 1336 | /* video hardware */ |
| 1337 | 1337 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 1365 | 1365 | MDRV_CPU_ADD_TAG("main",Z80, 8000000) /* (verified on pcb) */ |
| 1366 | 1366 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1367 | 1367 | MDRV_CPU_IO_MAP(readport,writeport) |
| 1368 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) /* ??? one extra irq seems to be needed for music (see input5_r) */ | |
| 1368 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) /* ??? one extra irq seems to be needed for music (see input5_r) */ | |
| 1369 | 1369 | |
| 1370 | 1370 | MDRV_NVRAM_HANDLER(mitchell) |
| 1371 | 1371 | |
| r1877 | r1878 | |
| 1436 | 1436 | MDRV_CPU_MODIFY("main") |
| 1437 | 1437 | MDRV_CPU_PROGRAM_MAP(spangb_memmap,0) |
| 1438 | 1438 | MDRV_CPU_IO_MAP(spangb_portmap,0) |
| 1439 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1439 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1440 | 1440 | |
| 1441 | 1441 | MDRV_CPU_ADD_TAG("sound",Z80, 8000000) |
| 1442 | 1442 | MDRV_CPU_PROGRAM_MAP(spangb_sound_memmap,0 ) |
| 1443 | 1443 | MDRV_CPU_IO_MAP(spangb_sound_portmap,0) |
| 1444 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) | |
| 1445 | // MDRV_CPU_VBLANK_INT(nmi_line_pulse,1) | |
| 1444 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 1445 | // MDRV_CPU_VBLANK_INT("main", nmi_line_pulse) | |
| 1446 | 1446 | |
| 1447 | 1447 | MDRV_GFXDECODE(spangbl) |
| 1448 | 1448 | |
| r1877 | r1878 | |
| 1464 | 1464 | |
| 1465 | 1465 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1466 | 1466 | MDRV_CPU_IO_MAP(mstworld_readport,mstworld_writeport) |
| 1467 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1467 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1468 | 1468 | |
| 1469 | 1469 | MDRV_CPU_ADD(Z80,6000000) /* 6 MHz? */ |
| 1470 | 1470 | /* audio CPU */ |
| r1877 | r1878 | |
| 1499 | 1499 | MDRV_CPU_ADD(Z80, 8000000) /* Super Pang says 8MHZ ORIGINAL BOARD */ |
| 1500 | 1500 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1501 | 1501 | MDRV_CPU_IO_MAP(readport,writeport) |
| 1502 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) /* ??? one extra irq seems to be needed for music (see input5_r) */ | |
| 1502 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) /* ??? one extra irq seems to be needed for music (see input5_r) */ | |
| 1503 | 1503 | |
| 1504 | 1504 | MDRV_NVRAM_HANDLER(mitchell) |
| 1505 | 1505 |
| r1877 | r1878 | |
|---|---|---|
| 618 | 618 | /* basic machine hardware */ |
| 619 | 619 | MDRV_CPU_ADD(M68000, XTAL_16MHz/2) /* verified on pcb */ |
| 620 | 620 | MDRV_CPU_PROGRAM_MAP(rainbow_readmem,rainbow_writemem) |
| 621 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 621 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 622 | 622 | |
| 623 | 623 | MDRV_CPU_ADD(Z80, XTAL_16MHz/4) /* verified on pcb */ |
| 624 | 624 | MDRV_CPU_PROGRAM_MAP(rainbow_s_readmem,rainbow_s_writemem) |
| r1877 | r1878 | |
| 654 | 654 | /* basic machine hardware */ |
| 655 | 655 | MDRV_CPU_ADD(M68000, 8000000) |
| 656 | 656 | MDRV_CPU_PROGRAM_MAP(jumping_readmem,jumping_writemem) |
| 657 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 657 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 658 | 658 | |
| 659 | 659 | MDRV_CPU_ADD(Z80, 4000000) |
| 660 | 660 | MDRV_CPU_PROGRAM_MAP(jumping_sound_readmem,jumping_sound_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 25 | 25 | #include "sound/3812intf.h" |
| 26 | 26 | |
| 27 | 27 | |
| 28 | extern UINT16 *galspnbl_bgvideoram,*galspnbl_videoram,*galspnbl_colorram; | |
| 28 | extern UINT16 *galspnbl_bgvideoram; | |
| 29 | extern UINT16 *galspnbl_videoram; | |
| 30 | extern UINT16 *galspnbl_colorram; | |
| 31 | extern UINT16 *galspnbl_scroll; | |
| 29 | 32 | |
| 30 | 33 | PALETTE_INIT( galspnbl ); |
| 31 | WRITE16_HANDLER( galspnbl_bgvideoram_w ); | |
| 32 | WRITE16_HANDLER( galspnbl_scroll_w ); | |
| 33 | 34 | VIDEO_UPDATE( galspnbl ); |
| 34 | 35 | |
| 35 | 36 | |
| r1877 | r1878 | |
| 37 | 38 | { |
| 38 | 39 | if (ACCESSING_LSB) |
| 39 | 40 | { |
| 40 | soundlatch_w(offset,data & 0xff); | |
| 41 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 41 | soundlatch_w(machine,offset,data & 0xff); | |
| 42 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 42 | 43 | } |
| 43 | 44 | } |
| 44 | 45 | |
| 45 | 46 | |
| 46 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 47 | AM_RANGE(0x000000, 0x3fffff) AM_READ(MRA16_ROM) | |
| 48 | AM_RANGE(0x700000, 0x703fff) AM_READ(MRA16_RAM) /* galspnbl */ | |
| 49 | AM_RANGE(0x708000, 0x70ffff) AM_READ(MRA16_RAM) /* galspnbl */ | |
| 50 | AM_RANGE(0x800000, 0x803fff) AM_READ(MRA16_RAM) /* hotpinbl */ | |
| 51 | AM_RANGE(0x808000, 0x80ffff) AM_READ(MRA16_RAM) /* hotpinbl */ | |
| 52 | AM_RANGE(0x880000, 0x880fff) AM_READ(MRA16_RAM) | |
| 53 | AM_RANGE(0x900000, 0x900fff) AM_READ(MRA16_RAM) | |
| 54 | AM_RANGE(0x904000, 0x904fff) AM_READ(MRA16_RAM) | |
| 55 | AM_RANGE(0x980000, 0x9bffff) AM_READ(MRA16_RAM) | |
| 56 | AM_RANGE(0xa80000, 0xa80001) AM_READ(input_port_0_word_r) | |
| 57 | AM_RANGE(0xa80010, 0xa80011) AM_READ(input_port_1_word_r) | |
| 58 | AM_RANGE(0xa80020, 0xa80021) AM_READ(input_port_2_word_r) | |
| 59 | AM_RANGE(0xa80030, 0xa80031) AM_READ(input_port_3_word_r) | |
| 60 | AM_RANGE(0xa80040, 0xa80041) AM_READ(input_port_4_word_r) | |
| 61 | ADDRESS_MAP_END | |
| 62 | ||
| 63 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 64 | AM_RANGE(0x000000, 0x3fffff) AM_WRITE(MWA16_ROM) | |
| 65 | AM_RANGE(0x700000, 0x703fff) AM_WRITE(MWA16_RAM) /* galspnbl work RAM */ | |
| 66 | AM_RANGE(0x708000, 0x70ffff) AM_WRITE(MWA16_RAM) /* galspnbl work RAM, bitmaps are decompressed here */ | |
| 67 | AM_RANGE(0x800000, 0x803fff) AM_WRITE(MWA16_RAM) /* hotpinbl work RAM */ | |
| 68 | AM_RANGE(0x808000, 0x80ffff) AM_WRITE(MWA16_RAM) /* hotpinbl work RAM, bitmaps are decompressed here */ | |
| 69 | AM_RANGE(0x880000, 0x880fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 47 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 48 | AM_RANGE(0x000000, 0x3fffff) AM_ROM | |
| 49 | AM_RANGE(0x700000, 0x703fff) AM_RAM /* galspnbl work RAM */ | |
| 50 | AM_RANGE(0x708000, 0x70ffff) AM_RAM /* galspnbl work RAM, bitmaps are decompressed here */ | |
| 51 | AM_RANGE(0x800000, 0x803fff) AM_RAM /* hotpinbl work RAM */ | |
| 52 | AM_RANGE(0x808000, 0x80ffff) AM_RAM /* hotpinbl work RAM, bitmaps are decompressed here */ | |
| 53 | AM_RANGE(0x880000, 0x880fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 70 | 54 | AM_RANGE(0x8ff400, 0x8fffff) AM_WRITE(MWA16_NOP) /* ??? */ |
| 71 | AM_RANGE(0x900000, 0x900fff) AM_ | |
| 55 | AM_RANGE(0x900000, 0x900fff) AM_ | |
| 72 | 56 | AM_RANGE(0x901000, 0x903fff) AM_WRITE(MWA16_NOP) /* ??? */ |
| 73 | AM_RANGE(0x904000, 0x904fff) AM_ | |
| 57 | AM_RANGE(0x904000, 0x904fff) AM_ | |
| 74 | 58 | AM_RANGE(0x905000, 0x907fff) AM_WRITE(MWA16_NOP) /* ??? */ |
| 75 | AM_RANGE(0x980000, 0x9bffff) AM_ | |
| 59 | AM_RANGE(0x980000, 0x9bffff) AM_ | |
| 76 | 60 | AM_RANGE(0xa00000, 0xa00fff) AM_WRITE(MWA16_NOP) /* more palette ? */ |
| 77 | 61 | AM_RANGE(0xa01000, 0xa017ff) AM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16) |
| 78 | 62 | AM_RANGE(0xa01800, 0xa027ff) AM_WRITE(MWA16_NOP) /* more palette ? */ |
| 79 | AM_RANGE(0xa80010, 0xa80011) AM_WRITE(soundcommand_w) | |
| 80 | AM_RANGE(0xa80020, 0xa80021) AM_WRITE(MWA16_NOP) /* could be watchdog, but causes resets when picture is shown */ | |
| 81 | AM_RANGE(0xa80030, 0xa80031) AM_WRITE(MWA16_NOP) /* irq ack? */ | |
| 82 | AM_RANGE(0xa80050, 0xa80051) AM_WRITE(galspnbl_scroll_w) | |
| 63 | AM_RANGE(0xa80000, 0xa80001) AM_READ(input_port_0_word_r) | |
| 64 | AM_RANGE(0xa80010, 0xa80011) AM_READWRITE(input_port_1_word_r, soundcommand_w) | |
| 65 | AM_RANGE(0xa80020, 0xa80021) AM_READWRITE(input_port_2_word_r, MWA16_NOP) /* w - could be watchdog, but causes resets when picture is shown */ | |
| 66 | AM_RANGE(0xa80030, 0xa80031) AM_READWRITE(input_port_3_word_r, MWA16_NOP) /* w - irq ack? */ | |
| 67 | AM_RANGE(0xa80040, 0xa80041) AM_READ(input_port_4_word_r) | |
| 68 | AM_RANGE(0xa80050, 0xa80051) AM_WRITE(MWA16_RAM) AM_BASE(&galspnbl_scroll) /* ??? */ | |
| 83 | 69 | ADDRESS_MAP_END |
| 84 | 70 | |
| 85 | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 86 | AM_RANGE(0x0000, 0xefff) AM_READ(MRA8_ROM) | |
| 87 | AM_RANGE(0xf000, 0xf7ff) AM_READ(MRA8_RAM) | |
| 88 | AM_RANGE(0xf800, 0xf800) AM_READ(OKIM6295_status_0_r) | |
| 89 | AM_RANGE(0xfc00, 0xfc00) AM_READ(MRA8_NOP) /* irq ack ?? */ | |
| 90 | AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_r) | |
| 91 | ADDRESS_MAP_END | |
| 92 | ||
| 93 | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 94 | AM_RANGE(0x0000, 0xefff) AM_WRITE(MWA8_ROM) | |
| 95 | AM_RANGE(0xf000, 0xf7ff) AM_WRITE(MWA8_RAM) | |
| 96 | AM_RANGE(0xf800, 0xf800) AM_WRITE(OKIM6295_data_0_w) | |
| 71 | static ADDRESS_MAP_START( audio_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 72 | AM_RANGE(0x0000, 0xefff) AM_ROM | |
| 73 | AM_RANGE(0xf000, 0xf7ff) AM_RAM | |
| 74 | AM_RANGE(0xf800, 0xf800) AM_READWRITE(OKIM6295_status_0_r, OKIM6295_data_0_w) | |
| 97 | 75 | AM_RANGE(0xf810, 0xf810) AM_WRITE(YM3812_control_port_0_w) |
| 98 | 76 | AM_RANGE(0xf811, 0xf811) AM_WRITE(YM3812_write_port_0_w) |
| 99 | AM_RANGE(0xfc00, 0xfc00) AM_WRITE(MWA8_NOP) /* irq ack ?? */ | |
| 77 | AM_RANGE(0xfc00, 0xfc00) AM_READWRITE(MRA8_NOP, MWA8_NOP) /* irq ack ?? */ | |
| 78 | AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_r) | |
| 100 | 79 | ADDRESS_MAP_END |
| 101 | 80 | |
| 102 | 81 | |
| r1877 | r1878 | |
| 301 | 280 | |
| 302 | 281 | /* basic machine hardware */ |
| 303 | 282 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz ??? */ |
| 304 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 305 | MDRV_CPU_VBLANK_INT(irq3_line_hold,1)/* also has vector for 6, but it does nothing */ | |
| 283 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 284 | MDRV_CPU_VBLANK_INT("main", irq3_line_hold)/* also has vector for 6, but it does nothing */ | |
| 306 | 285 | |
| 307 | 286 | MDRV_CPU_ADD(Z80, 4000000) |
| 308 | 287 | /* audio CPU */ /* 4 MHz ??? */ |
| 309 | MDRV_CPU_PROGRAM_MAP( | |
| 288 | MDRV_CPU_PROGRAM_MAP( | |
| 310 | 289 | /* NMI is caused by the main CPU */ |
| 311 | 290 | |
| 312 | 291 | /* video hardware */ |
| r1877 | r1878 | |
| 321 | 300 | MDRV_PALETTE_LENGTH(1024 + 32768) |
| 322 | 301 | |
| 323 | 302 | MDRV_PALETTE_INIT(galspnbl) |
| 324 | MDRV_VIDEO_START(generic_bitmapped) | |
| 325 | 303 | MDRV_VIDEO_UPDATE(galspnbl) |
| 326 | 304 | |
| 327 | 305 | /* sound hardware */ |
| r1877 | r1878 | |
|---|---|---|
| 255 | 255 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz (?) */ |
| 256 | 256 | MDRV_CPU_PROGRAM_MAP(mem_map, 0) |
| 257 | 257 | MDRV_CPU_IO_MAP(port_map, 0) |
| 258 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 258 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 259 | 259 | |
| 260 | 260 | MDRV_CPU_ADD(Z80, 3000000) |
| 261 | 261 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 270 | 270 | // basic machine hardware |
| 271 | 271 | MDRV_CPU_ADD_TAG("main", V30, 16000000/2) // NEC V30-8 CPU |
| 272 | 272 | MDRV_CPU_PROGRAM_MAP(master_map, 0) |
| 273 | MDRV_CPU_VBLANK_INT(dynduke_interrupt | |
| 273 | MDRV_CPU_VBLANK_INT("main", dynduke_interrupt | |
| 274 | 274 | |
| 275 | 275 | MDRV_CPU_ADD(V30, 16000000/2) // NEC V30-8 CPU |
| 276 | 276 | MDRV_CPU_PROGRAM_MAP(slave_map, 0) |
| 277 | MDRV_CPU_VBLANK_INT(dynduke_interrupt | |
| 277 | MDRV_CPU_VBLANK_INT("main", dynduke_interrupt | |
| 278 | 278 | |
| 279 | 279 | SEIBU_SOUND_SYSTEM_CPU(14318180/4) |
| 280 | 280 |
| r1877 | r1878 | |
|---|---|---|
| 168 | 168 | static READ32_HANDLER( avengrs_sound_r ) |
| 169 | 169 | { |
| 170 | 170 | if (mem_mask==0x00ffffff) { |
| 171 | return YMZ280B_status_0_r(0)<<24; | |
| 171 | return YMZ280B_status_0_r(machine,0)<<24; | |
| 172 | 172 | } else { |
| 173 | 173 | logerror("%08x: non-byte read from sound mask %08x\n",activecpu_get_pc(),mem_mask); |
| 174 | 174 | } |
| r1877 | r1878 | |
| 180 | 180 | { |
| 181 | 181 | if (mem_mask==0x00ffffff) { |
| 182 | 182 | if (offset) |
| 183 | YMZ280B_data_0_w(0,data>>24); | |
| 183 | YMZ280B_data_0_w(machine,0,data>>24); | |
| 184 | 184 | else |
| 185 | YMZ280B_register_0_w(0,data>>24); | |
| 185 | YMZ280B_register_0_w(machine,0,data>>24); | |
| 186 | 186 | } else { |
| 187 | 187 | logerror("%08x: non-byte written to sound %08x mask %08x\n",activecpu_get_pc(),data,mem_mask); |
| 188 | 188 | } |
| r1877 | r1878 | |
|---|---|---|
| 49 | 49 | ***************************************************************************/ |
| 50 | 50 | |
| 51 | 51 | #include "driver.h" |
| 52 | #include "deprecat.h" | |
| 52 | 53 | #include "sound/pokey.h" |
| 53 | 54 | |
| 54 | 55 | |
| r1877 | r1878 | |
| 319 | 320 | /* basic machine hardware */ |
| 320 | 321 | MDRV_CPU_ADD(M6502,2000000) /* ??? */ |
| 321 | 322 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 322 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) /* ? probably wrong */ | |
| 323 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) /* ? probably wrong */ | |
| 323 | 324 | |
| 324 | 325 | /* video hardware */ |
| 325 | 326 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 35 | 35 | |
| 36 | 36 | static WRITE8_HANDLER( tryout_sound_w ) |
| 37 | 37 | { |
| 38 | soundlatch_w(0,data); | |
| 39 | cpunum_set_input_line(Machine, 1, 0, PULSE_LINE ); | |
| 38 | soundlatch_w(machine,0,data); | |
| 39 | cpunum_set_input_line(machine, 1, 0, PULSE_LINE ); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | static WRITE8_HANDLER( tryout_sound_irq_ack_w ) |
| 43 | 43 | { |
| 44 | cpunum_set_input_line( | |
| 44 | cpunum_set_input_line(machine, 1, 0, CLEAR_LINE ); | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | static WRITE8_HANDLER( tryout_bankswitch_w ) |
| r1877 | r1878 | |
| 183 | 183 | |
| 184 | 184 | static INTERRUPT_GEN( tryout_interrupt ) |
| 185 | 185 | { |
| 186 | if ((input_port_3_r(0) & 0x1c)!=0x1c) | |
| 186 | if ((input_port_3_r(machine,0) & 0x1c)!=0x1c) | |
| 187 | 187 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); |
| 188 | 188 | } |
| 189 | 189 | |
| r1877 | r1878 | |
| 191 | 191 | /* basic machine hardware */ |
| 192 | 192 | MDRV_CPU_ADD(M6502, 2000000) /* ? */ |
| 193 | 193 | MDRV_CPU_PROGRAM_MAP(main_cpu,0) |
| 194 | MDRV_CPU_VBLANK_INT(tryout_interrupt | |
| 194 | MDRV_CPU_VBLANK_INT("main", tryout_interrupt | |
| 195 | 195 | |
| 196 | 196 | MDRV_CPU_ADD(M6502, 1500000) /* ? */ |
| 197 | 197 | /* audio CPU */ |
| 198 | 198 | MDRV_CPU_PROGRAM_MAP(sound_cpu,0) |
| 199 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,16) /* ? */ | |
| 199 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,16) /* ? */ | |
| 200 | 200 | |
| 201 | 201 | /* video hardware */ |
| 202 | 202 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 141 | 141 | switch(mem_mask) |
| 142 | 142 | { |
| 143 | 143 | case 0: |
| 144 | bitmap_1_w(offset,data,0x00ff); | |
| 145 | bitmap_1_w(offset,data,0xff00); | |
| 144 | bitmap_1_w(machine,offset,data,0x00ff); | |
| 145 | bitmap_1_w(machine,offset,data,0xff00); | |
| 146 | 146 | return; |
| 147 | 147 | |
| 148 | 148 | case 0x00ff: |
| r1877 | r1878 | |
| 162 | 162 | static READ16_HANDLER( oki_0_r ) |
| 163 | 163 | { |
| 164 | 164 | if(offset) |
| 165 | return OKIM6295_status_0_r(0); | |
| 165 | return OKIM6295_status_0_r(machine, 0); | |
| 166 | 166 | else |
| 167 | 167 | return 0; |
| 168 | 168 | } |
| r1877 | r1878 | |
| 170 | 170 | static WRITE16_HANDLER( oki_0_w ) |
| 171 | 171 | { |
| 172 | 172 | if(offset) |
| 173 | OKIM6295_data_0_w(0, data); | |
| 173 | OKIM6295_data_0_w(machine, 0, data); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | static WRITE16_HANDLER( oki_1_w ) |
| 177 | 177 | { |
| 178 | 178 | if(offset) |
| 179 | OKIM6295_data_1_w(0, data); | |
| 179 | OKIM6295_data_1_w(machine, 0, data); | |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | static READ16_HANDLER( oki_1_r ) |
| 183 | 183 | { |
| 184 | 184 | if(offset) |
| 185 | return OKIM6295_status_1_r(0); | |
| 185 | return OKIM6295_status_1_r(machine, 0); | |
| 186 | 186 | else |
| 187 | 187 | return 0; |
| 188 | 188 | } |
| r1877 | r1878 | |
| 390 | 390 | MDRV_CPU_ADD(E116XT, 20000000*4) /* 4x internal multiplier */ |
| 391 | 391 | MDRV_CPU_PROGRAM_MAP(pasha2_map,0) |
| 392 | 392 | MDRV_CPU_IO_MAP(pasha2_io,0) |
| 393 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 393 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 394 | 394 | |
| 395 | 395 | MDRV_NVRAM_HANDLER(93C46) |
| 396 | 396 |
| r1877 | r1878 | |
|---|---|---|
| 119 | 119 | bit8 : freeze |
| 120 | 120 | bit9 : joysticks layout(auto detect???) |
| 121 | 121 | */ |
| 122 | return(input_port_0_word_r(0, 0)); | |
| 122 | return(input_port_0_word_r(machine, 0, 0)); | |
| 123 | 123 | break; |
| 124 | 124 | |
| 125 | 125 | case 0x06/2: |
| r1877 | r1878 | |
| 181 | 181 | static WRITE16_HANDLER( sound_cmd1_w ) |
| 182 | 182 | { |
| 183 | 183 | if (ACCESSING_MSB) |
| 184 | soundlatch_w(0, data>>8); | |
| 184 | soundlatch_w(machine, 0, data>>8); | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | static WRITE16_HANDLER( sound_cmd2_w ) |
| 188 | 188 | { |
| 189 | 189 | if (ACCESSING_MSB) |
| 190 | soundlatch2_w(0, data>>8); | |
| 190 | soundlatch2_w(machine, 0, data>>8); | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | static WRITE16_HANDLER( sound_irq_w ) |
| r1877 | r1878 | |
| 331 | 331 | /* basic machine hardware */ |
| 332 | 332 | MDRV_CPU_ADD_TAG("main", M68000, 16000000) |
| 333 | 333 | MDRV_CPU_PROGRAM_MAP(rngreadmem,rngwritemem) |
| 334 | MDRV_CPU_VBLANK_INT(rng_interrupt | |
| 334 | MDRV_CPU_VBLANK_INT("main", rng_interrupt | |
| 335 | 335 | |
| 336 | 336 | MDRV_CPU_ADD_TAG("sound", Z80, 10000000) // 8Mhz (10Mhz is much safer in self-test due to heavy sync) |
| 337 | 337 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 222 | 222 | if(IntPend&(1<<i)) |
| 223 | 223 | { |
| 224 | 224 | return (IntHigh<<5)|i; |
| 225 | break; | |
| 226 | 225 | } |
| 227 | 226 | } |
| 228 | 227 | return 0; //This should never happen |
| r1877 | r1878 | |
| 618 | 617 | { |
| 619 | 618 | } |
| 620 | 619 | |
| 621 | static void plot_pixel_rgb( | |
| 620 | static void plot_pixel_rgb( | |
| 622 | 621 | { |
| 623 | 622 | //565 to 555 |
| 624 | 623 | color=(color&0x1f)|((color>>1)&0x7fe0); |
| r1877 | r1878 | |
| 824 | 823 | static MACHINE_DRIVER_START( crystal ) |
| 825 | 824 | MDRV_CPU_ADD(SE3208, 43000000) |
| 826 | 825 | MDRV_CPU_PROGRAM_MAP(crystal_mem,0) |
| 827 | MDRV_CPU_VBLANK_INT(crystal_interrupt | |
| 826 | MDRV_CPU_VBLANK_INT("main", crystal_interrupt | |
| 828 | 827 | |
| 829 | 828 | MDRV_MACHINE_RESET(crystal) |
| 830 | 829 |
| r1877 | r1878 | |
|---|---|---|
| 43 | 43 | { |
| 44 | 44 | if (ACCESSING_LSB) |
| 45 | 45 | { |
| 46 | soundlatch_w(0,data & 0xff); | |
| 47 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 46 | soundlatch_w(machine,0,data & 0xff); | |
| 47 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
| r1877 | r1878 | |
| 89 | 89 | { |
| 90 | 90 | switch (offset) { |
| 91 | 91 | case 0: |
| 92 | YM2151_register_port_0_w(0,data); | |
| 92 | YM2151_register_port_0_w(machine,0,data); | |
| 93 | 93 | break; |
| 94 | 94 | case 1: |
| 95 | YM2151_data_port_0_w(0,data); | |
| 95 | YM2151_data_port_0_w(machine,0,data); | |
| 96 | 96 | break; |
| 97 | 97 | } |
| 98 | 98 | } |
| r1877 | r1878 | |
| 101 | 101 | { |
| 102 | 102 | switch (offset) { |
| 103 | 103 | case 0: |
| 104 | YM2203_control_port_0_w(0,data); | |
| 104 | YM2203_control_port_0_w(machine,0,data); | |
| 105 | 105 | break; |
| 106 | 106 | case 1: |
| 107 | YM2203_write_port_0_w(0,data); | |
| 107 | YM2203_write_port_0_w(machine,0,data); | |
| 108 | 108 | break; |
| 109 | 109 | } |
| 110 | 110 | } |
| r1877 | r1878 | |
| 287 | 287 | /* basic machine hardware */ |
| 288 | 288 | MDRV_CPU_ADD(M68000, 12000000) /* Custom chip 59, 24 MHz crystal */ |
| 289 | 289 | MDRV_CPU_PROGRAM_MAP(madmotor_readmem,madmotor_writemem) |
| 290 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 290 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 291 | 291 | |
| 292 | 292 | MDRV_CPU_ADD(H6280, 8053000/2) /* Custom chip 45, Crystal near CPU is 8.053 MHz */ |
| 293 | 293 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 420 | 420 | /* basic machine hardware */ |
| 421 | 421 | MDRV_CPU_ADD(M68000, ATARI_CLOCK_14MHz/2) |
| 422 | 422 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 423 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 423 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 424 | 424 | |
| 425 | 425 | MDRV_CPU_ADD(M68000, ATARI_CLOCK_14MHz/2) |
| 426 | 426 | MDRV_CPU_PROGRAM_MAP(extra_map,0) |
| r1877 | r1878 | |
| 454 | 454 | /* basic machine hardware */ |
| 455 | 455 | MDRV_CPU_ADD(M68000, ATARI_CLOCK_14MHz/2) |
| 456 | 456 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 457 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 457 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 458 | 458 | |
| 459 | 459 | MDRV_INTERLEAVE(10) |
| 460 | 460 | |
| r1877 | r1878 | |
| 484 | 484 | /* basic machine hardware */ |
| 485 | 485 | MDRV_CPU_ADD_TAG("main", M68000, ATARI_CLOCK_14MHz/2) |
| 486 | 486 | MDRV_CPU_PROGRAM_MAP(guts_map,0) |
| 487 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 487 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 488 | 488 | |
| 489 | 489 | MDRV_INTERLEAVE(10) |
| 490 | 490 |
| r1877 | r1878 | |
|---|---|---|
| 736 | 736 | // basic machine hardware |
| 737 | 737 | MDRV_CPU_ADD(Z80, MAIN_XTAL/4) // 6 MHz |
| 738 | 738 | MDRV_CPU_PROGRAM_MAP(tokio_map, 0) |
| 739 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 739 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 740 | 740 | |
| 741 | 741 | MDRV_CPU_ADD(Z80, MAIN_XTAL/4) // 6 MHz |
| 742 | 742 | MDRV_CPU_PROGRAM_MAP(tokio_slave_map, 0) |
| 743 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 743 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 744 | 744 | |
| 745 | 745 | MDRV_CPU_ADD(Z80, MAIN_XTAL/8) |
| 746 | 746 | /* audio CPU */ // 3 MHz |
| r1877 | r1878 | |
| 781 | 781 | |
| 782 | 782 | MDRV_CPU_ADD(Z80, MAIN_XTAL/4) // 6 MHz |
| 783 | 783 | MDRV_CPU_PROGRAM_MAP(slave_map, 0) |
| 784 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 784 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 785 | 785 | |
| 786 | 786 | MDRV_CPU_ADD(Z80, MAIN_XTAL/8) |
| 787 | 787 | /* audio CPU */ // 3 MHz |
| r1877 | r1878 | |
| 789 | 789 | |
| 790 | 790 | MDRV_CPU_ADD_TAG("mcu", M6801, 4000000) // actually 6801U4 // xtal is 4MHz, divided by 4 internally |
| 791 | 791 | MDRV_CPU_PROGRAM_MAP(mcu_map, 0) |
| 792 | MDRV_CPU_VBLANK_INT(irq0_line_pulse | |
| 792 | MDRV_CPU_VBLANK_INT("main", irq0_line_pulse | |
| 793 | 793 | |
| 794 | 794 | MDRV_INTERLEAVE(100) // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs |
| 795 | 795 | |
| r1877 | r1878 | |
| 825 | 825 | // basic machine hardware |
| 826 | 826 | MDRV_CPU_MODIFY("main") |
| 827 | 827 | MDRV_CPU_PROGRAM_MAP(bootleg_map, 0) |
| 828 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 828 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 829 | 829 | |
| 830 | 830 | MDRV_CPU_REMOVE("mcu") |
| 831 | 831 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
| 837 | 837 | |
| 838 | 838 | MDRV_CPU_ADD_TAG("mcu", M68705, 4000000) // xtal is 4MHz, divided by 4 internally |
| 839 | 839 | MDRV_CPU_PROGRAM_MAP(bootlegmcu_map, 0) |
| 840 | MDRV_CPU_VBLANK_INT(bublbobl_m68705_interrupt, 2) // ??? should come from the same clock which latches the INT pin on the second Z80 | |
| 840 | MDRV_CPU_VBLANK_INT_HACK(bublbobl_m68705_interrupt, 2) // ??? should come from the same clock which latches the INT pin on the second Z80 | |
| 841 | 841 | MACHINE_DRIVER_END |
| 842 | 842 | |
| 843 | 843 |
| r1877 | r1878 | |
|---|---|---|
| 461 | 461 | MDRV_CPU_ADD(Z80,10000000/2) /* ? MHz */ |
| 462 | 462 | MDRV_CPU_PROGRAM_MAP(chinsan_map,0) |
| 463 | 463 | MDRV_CPU_IO_MAP(chinsan_io,0) |
| 464 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 464 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 465 | 465 | |
| 466 | 466 | MDRV_MACHINE_RESET( chinsan ) |
| 467 | 467 |
| r1877 | r1878 | |
|---|---|---|
| 256 | 256 | /* basic machine hardware */ |
| 257 | 257 | MDRV_CPU_ADD(Z80, 4000000) |
| 258 | 258 | MDRV_CPU_PROGRAM_MAP(skyfox_readmem,skyfox_writemem) |
| 259 | MDRV_CPU_VBLANK_INT(skyfox_interrupt | |
| 259 | MDRV_CPU_VBLANK_INT("main", skyfox_interrupt | |
| 260 | 260 | |
| 261 | 261 | MDRV_CPU_ADD(Z80, 1748000) |
| 262 | 262 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 95 | 95 | |
| 96 | 96 | static void ar_coin_hack(void) |
| 97 | 97 | { |
| 98 | if(input_port_5_r(0)&1) | |
| 98 | if(input_port_5_r(Machine,0)&1) | |
| 99 | 99 | { |
| 100 | 100 | if(coin_stat==0) |
| 101 | 101 | { |
| r1877 | r1878 | |
| 221 | 221 | /* Even reads must return 0xff - Odd reads must return the contents of input port 5. |
| 222 | 222 | Code at 0x5061 is executed once during P.O.S.T. where there is one read. |
| 223 | 223 | Code at 0x50b4 is then executed each frame (not sure) where there are 2 reads. */ |
| 224 | ||
| 225 | return ( (cshooter_counter++ & 1) ? 0xff : input_port_5_r(0) ); | |
| 224 | return ( (cshooter_counter++ & 1) ? 0xff : input_port_5_r(machine,0) ); | |
| 226 | 225 | } |
| 227 | 226 | |
| 228 | 227 | static WRITE8_HANDLER ( cshooter_c500_w ) |
| r1877 | r1878 | |
| 473 | 472 | MDRV_CPU_ADD(Z80,6000000) /* ? MHz */ |
| 474 | 473 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 475 | 474 | MDRV_CPU_IO_MAP(readport,writeport) |
| 476 | MDRV_CPU_VBLANK_INT(cshooter_interrupt,2) | |
| 475 | MDRV_CPU_VBLANK_INT_HACK(cshooter_interrupt,2) | |
| 477 | 476 | |
| 478 | 477 | MDRV_CPU_ADD(Z80,6000000) /* ? MHz */ |
| 479 | 478 | MDRV_CPU_PROGRAM_MAP(s_readmem,s_writemem) |
| r1877 | r1878 | |
| 502 | 501 | MDRV_CPU_ADD(Z80,6000000) /* ? MHz */ |
| 503 | 502 | MDRV_CPU_PROGRAM_MAP(arreadmem,arwritemem) |
| 504 | 503 | MDRV_CPU_IO_MAP(readport,writeport) |
| 505 | MDRV_CPU_VBLANK_INT(cshooter_interrupt,2) | |
| 504 | MDRV_CPU_VBLANK_INT_HACK(cshooter_interrupt,2) | |
| 506 | 505 | |
| 507 | 506 | MDRV_CPU_ADD(Z80,6000000) /* ? MHz */ |
| 508 | 507 | MDRV_CPU_PROGRAM_MAP(s2_readmem,s2_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 108 | 108 | if (ACCESSING_LSB) |
| 109 | 109 | { |
| 110 | 110 | pending_command = 1; |
| 111 | soundlatch_w(offset,data & 0xff); | |
| 112 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 111 | soundlatch_w(machine,offset,data & 0xff); | |
| 112 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
| r1877 | r1878 | |
| 118 | 118 | if (ACCESSING_MSB) |
| 119 | 119 | { |
| 120 | 120 | pending_command = 1; |
| 121 | soundlatch_w(offset,(data >> 8) & 0xff); | |
| 122 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 121 | soundlatch_w(machine,offset,(data >> 8) & 0xff); | |
| 122 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
| r1877 | r1878 | |
| 127 | 127 | { |
| 128 | 128 | if(data & 0x8000) |
| 129 | 129 | { |
| 130 | soundlatch_w(0,data & 0xff); | |
| 131 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 130 | soundlatch_w(machine,0,data & 0xff); | |
| 131 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
| r1877 | r1878 | |
| 151 | 151 | |
| 152 | 152 | static MACHINE_RESET( aerofgt ) |
| 153 | 153 | { |
| 154 | aerofgt_sh_bankswitch_w(0,0); /* needed by spinlbrk */ | |
| 154 | aerofgt_sh_bankswitch_w(machine,0,0); /* needed by spinlbrk */ | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | |
| r1877 | r1878 | |
| 1264 | 1264 | /* basic machine hardware */ |
| 1265 | 1265 | MDRV_CPU_ADD(M68000,20000000/2) /* 10 MHz (?) */ |
| 1266 | 1266 | MDRV_CPU_PROGRAM_MAP(pspikes_map,0) |
| 1267 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 1267 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 1268 | 1268 | |
| 1269 | 1269 | MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz ??? */ |
| 1270 | 1270 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
| 1303 | 1303 | /* basic machine hardware */ |
| 1304 | 1304 | MDRV_CPU_ADD(M68000,20000000/2) /* 10 MHz (?) */ |
| 1305 | 1305 | MDRV_CPU_PROGRAM_MAP(pallavol_map,0) |
| 1306 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 1306 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 1307 | 1307 | |
| 1308 | 1308 | /* + Z80 for sound */ |
| 1309 | 1309 | |
| r1877 | r1878 | |
| 1334 | 1334 | /* basic machine hardware */ |
| 1335 | 1335 | MDRV_CPU_ADD(M68000,20000000/2) /* 10 MHz (?) */ |
| 1336 | 1336 | MDRV_CPU_PROGRAM_MAP(pspikesb_map,0) |
| 1337 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 1337 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 1338 | 1338 | |
| 1339 | 1339 | /* video hardware */ |
| 1340 | 1340 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 1362 | 1362 | /* basic machine hardware */ |
| 1363 | 1363 | MDRV_CPU_ADD(M68000,20000000/2) /* 10 MHz (?) */ |
| 1364 | 1364 | MDRV_CPU_PROGRAM_MAP(pspikesc_map,0) |
| 1365 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 1365 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 1366 | 1366 | |
| 1367 | 1367 | /* video hardware */ |
| 1368 | 1368 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 1390 | 1390 | /* basic machine hardware */ |
| 1391 | 1391 | MDRV_CPU_ADD(M68000,20000000/2) /* 10 MHz (?) */ |
| 1392 | 1392 | MDRV_CPU_PROGRAM_MAP(karatblz_map,0) |
| 1393 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 1393 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 1394 | 1394 | |
| 1395 | 1395 | MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz ??? */ |
| 1396 | 1396 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
| 1428 | 1428 | /* basic machine hardware */ |
| 1429 | 1429 | MDRV_CPU_ADD(M68000,20000000/2) /* 10 MHz (?) */ |
| 1430 | 1430 | MDRV_CPU_PROGRAM_MAP(spinlbrk_map,0) |
| 1431 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 1431 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 1432 | 1432 | |
| 1433 | 1433 | MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz ??? */ |
| 1434 | 1434 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
| 1466 | 1466 | /* basic machine hardware */ |
| 1467 | 1467 | MDRV_CPU_ADD(M68000,20000000/2) /* 10 MHz (verified on pcb) */ |
| 1468 | 1468 | MDRV_CPU_PROGRAM_MAP(turbofrc_map,0) |
| 1469 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 1469 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 1470 | 1470 | |
| 1471 | 1471 | MDRV_CPU_ADD(Z80,5000000) /* 5 MHz (verified on pcb) */ |
| 1472 | 1472 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
| 1504 | 1504 | /* basic machine hardware */ |
| 1505 | 1505 | MDRV_CPU_ADD(M68000,20000000/2) /* 10 MHz (?) */ |
| 1506 | 1506 | MDRV_CPU_PROGRAM_MAP(aerofgtb_map,0) |
| 1507 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 1507 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 1508 | 1508 | |
| 1509 | 1509 | MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz ??? */ |
| 1510 | 1510 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
| 1543 | 1543 | /* basic machine hardware */ |
| 1544 | 1544 | MDRV_CPU_ADD(M68000,20000000/2) /* 10 MHz (verified on pcb) */ |
| 1545 | 1545 | MDRV_CPU_PROGRAM_MAP(aerofgt_map,0) |
| 1546 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 1546 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 1547 | 1547 | |
| 1548 | 1548 | MDRV_CPU_ADD(Z80,5000000) /* 5 MHz (verified on pcb) */ |
| 1549 | 1549 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
| 1582 | 1582 | /* basic machine hardware */ |
| 1583 | 1583 | MDRV_CPU_ADD(M68000,20000000/2) /* 10 MHz (?) */ |
| 1584 | 1584 | MDRV_CPU_PROGRAM_MAP(aerfboot_map,0) |
| 1585 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 1585 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 1586 | 1586 | |
| 1587 | 1587 | MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz ??? */ |
| 1588 | 1588 | MDRV_CPU_PROGRAM_MAP(aerfboot_sound_map,0) |
| r1877 | r1878 | |
| 1614 | 1614 | /* basic machine hardware */ |
| 1615 | 1615 | MDRV_CPU_ADD(M68000,20000000/2) /* 10 MHz (?) */ |
| 1616 | 1616 | MDRV_CPU_PROGRAM_MAP(wbbc97_map,0) |
| 1617 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 1617 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 1618 | 1618 | |
| 1619 | 1619 | MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz ??? */ |
| 1620 | 1620 | MDRV_CPU_PROGRAM_MAP(wbbc97_sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 223 | 223 | /* basic machine hardware */ |
| 224 | 224 | MDRV_CPU_ADD(M6809, 1600000) /* 1.6 MHz??? Attract mode depends on this to work correctly */ |
| 225 | 225 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 226 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 226 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 227 | 227 | |
| 228 | 228 | /* video hardware */ |
| 229 | 229 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 116 | 116 | question_adr[offset] = data; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | static WRITE8_HANDLER( coinmstr_mc6845_address_w ) | |
| 120 | { | |
| 121 | mc6845_address_w(mc6845, data); | |
| 122 | } | |
| 123 | ||
| 124 | static WRITE8_HANDLER( coinmstr_mc6845_register_w ) | |
| 125 | { | |
| 126 | mc6845_register_w(mc6845, data); | |
| 127 | } | |
| 128 | ||
| 129 | 119 | // Common memory map |
| 130 | 120 | |
| 131 | 121 | static ADDRESS_MAP_START( coinmstr_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 149 | 139 | AM_RANGE(0x50, 0x53) AM_READNOP |
| 150 | 140 | AM_RANGE(0x50, 0x53) AM_WRITENOP |
| 151 | 141 | AM_RANGE(0x58, 0x5b) AM_READWRITE(pia_2_r, pia_2_w) |
| 152 | AM_RANGE(0x70, 0x70) AM_WRITE(coinmstr_mc6845_address_w) | |
| 153 | AM_RANGE(0x71, 0x71) AM_WRITE(coinmstr_mc6845_register_w) | |
| 142 | AM_RANGE(0x70, 0x70) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 143 | AM_RANGE(0x71, 0x71) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 154 | 144 | AM_RANGE(0xc0, 0xc3) AM_READNOP |
| 155 | 145 | AM_RANGE(0xc0, 0xc3) AM_WRITENOP |
| 156 | 146 | ADDRESS_MAP_END |
| r1877 | r1878 | |
| 159 | 149 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 160 | 150 | AM_RANGE(0x00, 0x00) AM_READ(question_r) |
| 161 | 151 | AM_RANGE(0x00, 0x03) AM_WRITE(question_w) |
| 162 | AM_RANGE(0x40, 0x40) AM_WRITE(coinmstr_mc6845_address_w) | |
| 163 | AM_RANGE(0x41, 0x41) AM_WRITE(coinmstr_mc6845_register_w) | |
| 152 | AM_RANGE(0x40, 0x40) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 153 | AM_RANGE(0x41, 0x41) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 164 | 154 | AM_RANGE(0x48, 0x48) AM_WRITE(AY8910_control_port_0_w) |
| 165 | 155 | AM_RANGE(0x49, 0x49) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w) |
| 166 | 156 | AM_RANGE(0x50, 0x53) AM_READWRITE(pia_0_r, pia_0_w) //? |
| r1877 | r1878 | |
| 176 | 166 | AM_RANGE(0x40, 0x41) AM_READNOP |
| 177 | 167 | AM_RANGE(0x40, 0x43) AM_WRITENOP |
| 178 | 168 | AM_RANGE(0x43, 0x43) AM_READNOP |
| 179 | AM_RANGE(0x48, 0x48) AM_WRITE(coinmstr_mc6845_address_w) | |
| 180 | AM_RANGE(0x49, 0x49) AM_WRITE(coinmstr_mc6845_register_w) | |
| 169 | AM_RANGE(0x48, 0x48) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 170 | AM_RANGE(0x49, 0x49) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 181 | 171 | AM_RANGE(0x50, 0x51) AM_READNOP |
| 182 | 172 | AM_RANGE(0x50, 0x53) AM_WRITENOP |
| 183 | 173 | AM_RANGE(0x53, 0x53) AM_READNOP |
| r1877 | r1878 | |
| 637 | 627 | static MACHINE_DRIVER_START( coinmstr ) |
| 638 | 628 | MDRV_CPU_ADD_TAG("cpu",Z80,8000000) // ? |
| 639 | 629 | MDRV_CPU_PROGRAM_MAP(coinmstr_map,0) |
| 640 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 630 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 641 | 631 | |
| 642 | 632 | /* video hardware */ |
| 643 | 633 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 126 | 126 | */ |
| 127 | 127 | |
| 128 | 128 | #include "driver.h" |
| 129 | #include "deprecat.h" | |
| 129 | 130 | #include "sound/msm5205.h" |
| 130 | 131 | #include "sound/sn76496.h" |
| 131 | 132 | #include "includes/docastle.h" |
| r1877 | r1878 | |
| 630 | 631 | MDRV_CPU_ADD_TAG("main", Z80, 3900000) // make dip switches work in docastle and dorunrun |
| 631 | 632 | MDRV_CPU_PROGRAM_MAP(docastle_map, 0) |
| 632 | 633 | MDRV_CPU_IO_MAP(docastle_io_map, 0) |
| 633 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 634 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 634 | 635 | |
| 635 | 636 | MDRV_CPU_ADD_TAG("slave", Z80, 4000000) // 4 MHz |
| 636 | 637 | MDRV_CPU_PROGRAM_MAP(docastle_map2, 0) |
| 637 | MDRV_CPU_VBLANK_INT(irq0_line_hold, 8) | |
| 638 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 8) | |
| 638 | 639 | |
| 639 | 640 | MDRV_CPU_ADD(Z80, 4000000) // 4 MHz |
| 640 | 641 | MDRV_CPU_PROGRAM_MAP(docastle_map3, 0) |
| 641 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 642 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 642 | 643 | |
| 643 | 644 | // video hardware |
| 644 | 645 |
| r1877 | r1878 | |
|---|---|---|
| 317 | 317 | /* basic machine hardware */ |
| 318 | 318 | MDRV_CPU_ADD_TAG("main", M68000, 12000000) |
| 319 | 319 | MDRV_CPU_PROGRAM_MAP(galsnew,0) |
| 320 | MDRV_CPU_VBLANK_INT(galsnew_interrupt,3) | |
| 320 | MDRV_CPU_VBLANK_INT_HACK(galsnew_interrupt,3) | |
| 321 | 321 | |
| 322 | 322 | /* CALC01 MCU @ 16Mhz (unknown type, simulated) */ |
| 323 | 323 |
| r1877 | r1878 | |
|---|---|---|
| 137 | 137 | |
| 138 | 138 | if (ACCESSING_MSB16) |
| 139 | 139 | { |
| 140 | r |= K054539_0_r(reg+0) << 8; | |
| 140 | r |= K054539_0_r(machine, reg+0) << 8; | |
| 141 | 141 | } |
| 142 | 142 | if (ACCESSING_LSB16) |
| 143 | 143 | { |
| 144 | r |= K054539_0_r(reg+1) << 0; | |
| 144 | r |= K054539_0_r(machine, reg+1) << 0; | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | return r; |
| r1877 | r1878 | |
| 153 | 153 | |
| 154 | 154 | if (ACCESSING_MSB16) |
| 155 | 155 | { |
| 156 | K054539_0_w(reg+0, (data >> 8) & 0xff); | |
| 156 | K054539_0_w(machine, reg+0, (data >> 8) & 0xff); | |
| 157 | 157 | } |
| 158 | 158 | if (ACCESSING_LSB16) |
| 159 | 159 | { |
| 160 | K054539_0_w(reg+1, (data >> 0) & 0xff); | |
| 160 | K054539_0_w(machine, reg+1, (data >> 0) & 0xff); | |
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | |
| r1877 | r1878 | |
| 167 | 167 | |
| 168 | 168 | if (!(mem_mask & 0xff00)) |
| 169 | 169 | { |
| 170 | r |= K056800_sound_r((offset*2)+0, 0xffff) << 8; | |
| 170 | r |= K056800_sound_r(machine, (offset*2)+0, 0xffff) << 8; | |
| 171 | 171 | } |
| 172 | 172 | if (!(mem_mask & 0x00ff)) |
| 173 | 173 | { |
| 174 | r |= K056800_sound_r((offset*2)+1, 0xffff) << 0; | |
| 174 | r |= K056800_sound_r(machine, (offset*2)+1, 0xffff) << 0; | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | return r; |
| r1877 | r1878 | |
| 181 | 181 | { |
| 182 | 182 | if (!(mem_mask & 0xff00)) |
| 183 | 183 | { |
| 184 | K056800_sound_w((offset*2)+0, (data >> 8) & 0xff, 0xffff); | |
| 184 | K056800_sound_w(machine, (offset*2)+0, (data >> 8) & 0xff, 0xffff); | |
| 185 | 185 | } |
| 186 | 186 | if (!(mem_mask & 0x00ff)) |
| 187 | 187 | { |
| 188 | K056800_sound_w((offset*2)+1, (data >> 0) & 0xff, 0xffff); | |
| 188 | K056800_sound_w(machine, (offset*2)+1, (data >> 0) & 0xff, 0xffff); | |
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | |
| r1877 | r1878 | |
| 273 | 273 | MDRV_CPU_ADD(PPC403, 25000000) /* PowerPC 403GA 25MHz */ |
| 274 | 274 | MDRV_CPU_CONFIG(ultrsprt_ppc_cfg) |
| 275 | 275 | MDRV_CPU_PROGRAM_MAP(ultrsprt_map, 0) |
| 276 | MDRV_CPU_VBLANK_INT(ultrsprt_vblank | |
| 276 | MDRV_CPU_VBLANK_INT("main", ultrsprt_vblank | |
| 277 | 277 | |
| 278 | 278 | MDRV_CPU_ADD(M68000, 8000000) /* Not sure about the frequency */ |
| 279 | 279 | MDRV_CPU_PROGRAM_MAP(sound_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 117 | 117 | |
| 118 | 118 | static READ8_HANDLER( mainsnk_port_0_r ) |
| 119 | 119 | { |
| 120 | int result = input_port_0_r( 0 ); | |
| 120 | int result = input_port_0_r( machine, 0 ); | |
| 121 | 121 | if( !sound_cpu_ready ) result |= 0x20; |
| 122 | 122 | return result; |
| 123 | 123 | } |
| r1877 | r1878 | |
| 374 | 374 | static MACHINE_DRIVER_START( mainsnk ) |
| 375 | 375 | MDRV_CPU_ADD(Z80, 3360000) |
| 376 | 376 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 377 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 377 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 378 | 378 | |
| 379 | 379 | MDRV_CPU_ADD(Z80,4000000) |
| 380 | 380 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | Mysterious Stones | |
| 3 | Technos Mysterious Stones hardware | |
| 4 | 4 | |
| 5 | driver by Nicola Salmoria | |
| 5 | driver by Nicola Salmoria | |
| 6 | 6 | |
| 7 | Notes: | |
| 8 | - The subtitle of the two sets is slightly different: | |
| 9 | "dr john s adventure" vs. "dr kick in adventure". | |
| 10 | The Dr John's is a bug fix. See the routine at 4376/4384 for example. The | |
| 11 | old set thrashes the Y register, the new one saves in on the stack. The | |
| 12 | newer set also resets the sound chips more often. | |
| 7 | Notes: | |
| 8 | * The subtitle of the two sets is slightly different: | |
| 9 | "Dr. John's Adventure" vs. "Dr. Kick in Adventure". | |
| 10 | The Dr John's is a bug fix. See the routine at 4376/4384 for example. | |
| 11 | The old set thrashes the Y register, the new one saves in on | |
| 12 | the stack. The newer set also resets the audio chips more often. | |
| 13 | 13 | |
| 14 | 14 | ***************************************************************************/ |
| 15 | 15 | |
| 16 | 16 | #include "driver.h" |
| 17 | #include "deprecat.h" | |
| 18 | 17 | #include "sound/ay8910.h" |
| 18 | #include "mystston.h" | |
| 19 | 19 | |
| 20 | 20 | |
| 21 | extern UINT8 *mystston_videoram2; | |
| 22 | 21 | |
| 23 | extern WRITE8_HANDLER( mystston_videoram_w ); | |
| 24 | extern WRITE8_HANDLER( mystston_videoram2_w ); | |
| 25 | extern WRITE8_HANDLER( mystston_scroll_w ); | |
| 26 | extern WRITE8_HANDLER( mystston_control_w ); | |
| 22 | /************************************* | |
| 23 | * | |
| 24 | * Clocks | |
| 25 | * | |
| 26 | *************************************/ | |
| 27 | 27 | |
| 28 | extern PALETTE_INIT( mystston ); | |
| 29 | extern VIDEO_START( mystston ); | |
| 30 | extern VIDEO_UPDATE( mystston ); | |
| 28 | #define CPU_CLOCK (MYSTSTON_MASTER_CLOCK / 8) | |
| 29 | #define AY8910_CLOCK (MYSTSTON_MASTER_CLOCK / 8) | |
| 31 | 30 | |
| 32 | 31 | |
| 33 | static int VBLK = 0x80; | |
| 34 | static int soundlatch; | |
| 35 | 32 | |
| 33 | /************************************* | |
| 34 | * | |
| 35 | * Interrupt system | |
| 36 | * | |
| 37 | *************************************/ | |
| 36 | 38 | |
| 37 | ||
| 39 | vo | |
| 38 | 40 | { |
| 39 | | |
| 41 | cpunum_set_input_line(ma | |
| 40 | 42 | } |
| 41 | 43 | |
| 42 | static WRITE8_HANDLER( mystston_soundcontrol_w ) | |
| 44 | ||
| 45 | static WRITE8_HANDLER( irq_clear_w ) | |
| 43 | 46 | { |
| 44 | static int last; | |
| 47 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 48 | } | |
| 45 | 49 | |
| 46 | /* bit 5 goes to 8910 #0 BDIR pin */ | |
| 47 | if ((last & 0x20) == 0x20 && (data & 0x20) == 0x00) | |
| 50 | ||
| 51 | ||
| 52 | /************************************* | |
| 53 | * | |
| 54 | * Coin handling | |
| 55 | * | |
| 56 | *************************************/ | |
| 57 | ||
| 58 | static INPUT_CHANGED( coin_inserted ) | |
| 59 | { | |
| 60 | /* coin insertion causes an NMI */ | |
| 61 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); | |
| 62 | } | |
| 63 | ||
| 64 | ||
| 65 | ||
| 66 | /************************************* | |
| 67 | * | |
| 68 | * AY-8910 memory interface | |
| 69 | * | |
| 70 | *************************************/ | |
| 71 | ||
| 72 | static WRITE8_HANDLER( mystston_ay8910_select_w ) | |
| 73 | { | |
| 74 | mystston_state *state = machine->driver_data; | |
| 75 | ||
| 76 | /* bit 5 goes to 8910 #0 BDIR pin */ | |
| 77 | if (((*state->ay8910_select & 0x20) == 0x20) && ((data & 0x20) == 0x00)) | |
| 48 | 78 | { |
| 49 | 79 | /* bit 4 goes to the 8910 #0 BC1 pin */ |
| 50 | if (last & 0x10) | |
| 51 | AY8910_control_port_0_w(0,soundlatch); | |
| 80 | if (*state->ay8910_select & 0x10) | |
| 81 | AY8910_control_port_0_w(machine, 0, *state->ay8910_data); | |
| 52 | 82 | else |
| 53 | AY8910_write_port_0_w(0,s | |
| 83 | AY8910_write_port_0_w(machine, 0, *state->ay8910_d | |
| 54 | 84 | } |
| 55 | /* bit 7 goes to 8910 #1 BDIR pin */ | |
| 56 | if ((last & 0x80) == 0x80 && (data & 0x80) == 0x00) | |
| 85 | ||
| 86 | /* bit 7 goes to 8910 #1 BDIR pin */ | |
| 87 | if (((*state->ay8910_select & 0x80) == 0x80) && ((data & 0x80) == 0x00)) | |
| 57 | 88 | { |
| 58 | 89 | /* bit 6 goes to the 8910 #1 BC1 pin */ |
| 59 | if (last & 0x40) | |
| 60 | AY8910_control_port_1_w(0,soundlatch); | |
| 90 | if (*state->ay8910_select & 0x40) | |
| 91 | AY8910_control_port_1_w(machine, 0, *state->ay8910_data); | |
| 61 | 92 | else |
| 62 | AY8910_write_port_1_w(0,s | |
| 93 | AY8910_write_port_1_w(machine, 0, *state->ay8910_d | |
| 63 | 94 | } |
| 64 | 95 | |
| 65 | | |
| 96 | *state->ay8910_select = data; | |
| 66 | 97 | } |
| 67 | 98 | |
| 68 | static READ8_HANDLER( port3_r ) | |
| 69 | { | |
| 70 | int port = readinputport(3); | |
| 71 | 99 | |
| 72 | return port | VBLK; | |
| 73 | } | |
| 74 | 100 | |
| 75 | static WRITE8_HANDLER( mystston_irq_reset_w ) | |
| 76 | { | |
| 77 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 78 | } | |
| 101 | /************************************* | |
| 102 | * | |
| 103 | * Memory map | |
| 104 | * | |
| 105 | *************************************/ | |
| 79 | 106 | |
| 80 | ||
| 81 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 82 | AM_RANGE(0x0000, 0x077f) AM_READ(MRA8_RAM) | |
| 83 | AM_RANGE(0x0800, 0x0fff) AM_READ(MRA8_RAM) /* work RAM? */ | |
| 84 | AM_RANGE(0x1000, 0x1fff) AM_READ(MRA8_RAM) | |
| 85 | AM_RANGE(0x2000, 0x2000) AM_READ(input_port_0_r) | |
| 86 | AM_RANGE(0x2010, 0x2010) AM_READ(input_port_1_r) | |
| 87 | AM_RANGE(0x2020, 0x2020) AM_READ(input_port_2_r) | |
| 88 | AM_RANGE(0x2030, 0x2030) AM_READ(port3_r) | |
| 89 | AM_RANGE(0x4000, 0xffff) AM_READ(MRA8_ROM) | |
| 107 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 108 | AM_RANGE(0x0000, 0x077f) AM_RAM | |
| 109 | AM_RANGE(0x0780, 0x07df) AM_RAM AM_BASE_MEMBER(mystston_state, spriteram) | |
| 110 | AM_RANGE(0x07e0, 0x0fff) AM_RAM | |
| 111 | AM_RANGE(0x1000, 0x17ff) AM_RAM AM_BASE_MEMBER(mystston_state, fg_videoram) | |
| 112 | AM_RANGE(0x1800, 0x1fff) AM_RAM AM_BASE_MEMBER(mystston_state, bg_videoram) | |
| 113 | AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x1f8f) AM_READWRITE(port_tag_to_handler8("IN0"), mystston_video_control_w) AM_BASE_MEMBER(mystston_state, video_control) | |
| 114 | AM_RANGE(0x2010, 0x2010) AM_MIRROR(0x1f8f) AM_READWRITE(port_tag_to_handler8("IN1"), irq_clear_w) | |
| 115 | AM_RANGE(0x2020, 0x2020) AM_MIRROR(0x1f8f) AM_READWRITE(port_tag_to_handler8("DSW0"), MWA8_RAM) AM_BASE_MEMBER(mystston_state, scroll) | |
| 116 | AM_RANGE(0x2030, 0x2030) AM_MIRROR(0x1f8f) AM_READWRITE(port_tag_to_handler8("DSW1"), MWA8_RAM) AM_BASE_MEMBER(mystston_state, ay8910_data) | |
| 117 | AM_RANGE(0x2040, 0x2040) AM_MIRROR(0x1f8f) AM_READWRITE(MRA8_NOP, mystston_ay8910_select_w) AM_BASE_MEMBER(mystston_state, ay8910_select) | |
| 118 | AM_RANGE(0x2050, 0x2050) AM_MIRROR(0x1f8f) AM_NOP | |
| 119 | AM_RANGE(0x2060, 0x207f) AM_MIRROR(0x1f80) AM_RAM AM_BASE_MEMBER(mystston_state, paletteram) | |
| 120 | AM_RANGE(0x4000, 0xffff) AM_ROM | |
| 90 | 121 | ADDRESS_MAP_END |
| 91 | 122 | |
| 92 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 93 | AM_RANGE(0x0000, 0x077f) AM_WRITE(MWA8_RAM) | |
| 94 | AM_RANGE(0x0780, 0x07df) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 95 | AM_RANGE(0x07e0, 0x07ff) AM_WRITE(MWA8_RAM) | |
| 96 | AM_RANGE(0x0800, 0x0fff) AM_WRITE(MWA8_RAM) /* work RAM? */ | |
| 97 | AM_RANGE(0x1000, 0x17ff) AM_WRITE(mystston_videoram_w) AM_BASE(&videoram) | |
| 98 | AM_RANGE(0x1800, 0x1bff) AM_WRITE(mystston_videoram2_w) AM_BASE(&mystston_videoram2) | |
| 99 | AM_RANGE(0x1c00, 0x1fff) AM_WRITE(MWA8_RAM) /* work RAM? This gets copied to videoram */ | |
| 100 | AM_RANGE(0x2000, 0x2000) AM_WRITE(mystston_control_w) /* text color, flip screen & coin counters */ | |
| 101 | AM_RANGE(0x2010, 0x2010) AM_WRITE(mystston_irq_reset_w) | |
| 102 | AM_RANGE(0x2020, 0x2020) AM_WRITE(mystston_scroll_w) | |
| 103 | AM_RANGE(0x2030, 0x2030) AM_WRITE(mystston_soundlatch_w) | |
| 104 | AM_RANGE(0x2040, 0x2040) AM_WRITE(mystston_soundcontrol_w) | |
| 105 | AM_RANGE(0x2060, 0x2077) AM_WRITE(paletteram_BBGGGRRR_w) AM_BASE(&paletteram) | |
| 106 | AM_RANGE(0x4000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 107 | ADDRESS_MAP_END | |
| 108 | 123 | |
| 109 | 124 | |
| 125 | /************************************* | |
| 126 | * | |
| 127 | * Input ports | |
| 128 | * | |
| 129 | *************************************/ | |
| 130 | ||
| 110 | 131 | static INPUT_PORTS_START( mystston ) |
| 111 | PORT_START | |
| 132 | PORT_START_TAG("IN0") | |
| 112 | 133 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY |
| 113 | 134 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY |
| 114 | 135 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY |
| 115 | 136 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY |
| 116 | 137 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 117 | 138 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 118 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) | |
| 119 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) | |
| 139 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 140 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 120 | 141 | |
| 121 | PORT_START | |
| 142 | PORT_START_TAG("IN1") | |
| 122 | 143 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL |
| 123 | 144 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL |
| 124 | 145 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL |
| r1877 | r1878 | |
| 128 | 149 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) |
| 129 | 150 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) |
| 130 | 151 | |
| 131 | PORT_START | |
| 152 | PORT_START_TAG("DSW0") | |
| 132 | 153 | PORT_DIPNAME(0x01, 0x01, DEF_STR( Lives ) ) |
| 133 | 154 | PORT_DIPSETTING( 0x01, "3" ) |
| 134 | 155 | PORT_DIPSETTING( 0x00, "5" ) |
| r1877 | r1878 | |
| 154 | 175 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 155 | 176 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 156 | 177 | |
| 157 | PORT_START | |
| 178 | PORT_START_TAG("DSW1") | |
| 158 | 179 | PORT_DIPNAME(0x03, 0x03, DEF_STR( Coin_A ) ) |
| 159 | 180 | PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) |
| 160 | 181 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) |
| r1877 | r1878 | |
| 174 | 195 | PORT_DIPNAME(0x40, 0x00, DEF_STR( Cabinet ) ) |
| 175 | 196 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 176 | 197 | PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ) ) |
| 177 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_ | |
| 198 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_ | |
| 178 | 199 | INPUT_PORTS_END |
| 179 | 200 | |
| 180 | 201 | |
| 181 | static const gfx_layout charlayout = | |
| 182 | { | |
| 183 | 8,8, | |
| 184 | RGN_FRAC(1,3), | |
| 185 | 3, | |
| 186 | { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, | |
| 187 | { 0, 1, 2, 3, 4, 5, 6, 7 }, | |
| 188 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, | |
| 189 | 8*8 | |
| 190 | }; | |
| 191 | 202 | |
| 192 | static const gfx_layout spritelayout = | |
| 193 | { | |
| 194 | 16,16, | |
| 195 | RGN_FRAC(1,3), | |
| 196 | 3, | |
| 197 | { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, | |
| 198 | { 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7, | |
| 199 | 0, 1, 2, 3, 4, 5, 6, 7 }, | |
| 200 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, | |
| 201 | 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, | |
| 202 | 32*8 | |
| 203 | }; | |
| 203 | /************************************* | |
| 204 | * | |
| 205 | * Machine driver | |
| 206 | * | |
| 207 | *************************************/ | |
| 204 | 208 | |
| 205 | static GFXDECODE_START( mystston ) | |
| 206 | GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 3*8, 4 ) | |
| 207 | GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 2*8, 1 ) | |
| 208 | GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0*8, 2 ) | |
| 209 | GFXDECODE_END | |
| 210 | ||
| 211 | ||
| 212 | static INTERRUPT_GEN( mystston_interrupt ) | |
| 213 | { | |
| 214 | int scanline = 271 - cpu_getiloops(); | |
| 215 | static int coin; | |
| 216 | ||
| 217 | /* Inserting a coin triggers an NMI */ | |
| 218 | if ((readinputport(0) & 0xc0) != 0xc0) | |
| 219 | { | |
| 220 | if (coin == 0) | |
| 221 | { | |
| 222 | coin = 1; | |
| 223 | nmi_line_pulse(machine, cpunum); | |
| 224 | return; | |
| 225 | } | |
| 226 | } | |
| 227 | else coin = 0; | |
| 228 | ||
| 229 | /* VBLK is lowered on scanline 8 */ | |
| 230 | if (scanline == 8) | |
| 231 | VBLK = 0; | |
| 232 | ||
| 233 | /* VBLK is raised on scanline 248 */ | |
| 234 | if (scanline == 248) | |
| 235 | VBLK = 0x80; | |
| 236 | ||
| 237 | /* IMS is triggered every time VLOC line 3 is raised, | |
| 238 | as VLOC counter starts at 16, effectively every 16 scanlines */ | |
| 239 | if ((scanline % 16) == 0) | |
| 240 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 241 | } | |
| 242 | ||
| 243 | ||
| 244 | 209 | static MACHINE_DRIVER_START( mystston ) |
| 245 | 210 | |
| 211 | MDRV_DRIVER_DATA(mystston_state) | |
| 212 | ||
| 246 | 213 | /* basic machine hardware */ |
| 247 | MDRV_CPU_ADD(M6502, 12000000/8) // 1.5 MHz | |
| 248 | MDRV_CPU_PROGRAM_MAP(readmem, writemem) | |
| 249 | MDRV_CPU_VBLANK_INT(mystston_interrupt, 272) | |
| 214 | MDRV_CPU_ADD(M6502, CPU_CLOCK) | |
| 215 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 250 | 216 | |
| 251 | 217 | /* video hardware */ |
| 252 | MDRV_SCREEN_ADD("main", RASTER) | |
| 253 | MDRV_SCREEN_REFRESH_RATE(((12000000.0 / 256.0) / 3.0) / 272.0) | |
| 254 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 255 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 256 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 257 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1) | |
| 218 | MDRV_IMPORT_FROM(mystston_video) | |
| 258 | 219 | |
| 259 | MDRV_GFXDECODE(mystston) | |
| 260 | MDRV_PALETTE_LENGTH(24+32) | |
| 261 | ||
| 262 | MDRV_PALETTE_INIT(mystston) | |
| 263 | MDRV_VIDEO_START(mystston) | |
| 264 | MDRV_VIDEO_UPDATE(mystston) | |
| 265 | ||
| 266 | /* sound hardware */ | |
| 220 | /* audio hardware */ | |
| 267 | 221 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 268 | 222 | |
| 269 | MDRV_SOUND_ADD(AY8910, 1 | |
| 223 | MDRV_SOUND_ADD(AY8910, AY891 | |
| 270 | 224 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) |
| 271 | 225 | |
| 272 | MDRV_SOUND_ADD(AY8910, 1 | |
| 226 | MDRV_SOUND_ADD(AY8910, AY891 | |
| 273 | 227 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) |
| 274 | 228 | MACHINE_DRIVER_END |
| 275 | 229 | |
| 276 | 230 | |
| 231 | ||
| 232 | /************************************* | |
| 233 | * | |
| 234 | * ROM definitions | |
| 235 | * | |
| 236 | *************************************/ | |
| 237 | ||
| 277 | 238 | ROM_START( mystston ) |
| 278 | 239 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) |
| 279 | 240 | ROM_LOAD( "rom6.bin", 0x4000, 0x2000, CRC(7bd9c6cd) SHA1(4d14edc783ba1a6c01d2fb9ea29ec85b8fec3c3b) ) |
| r1877 | r1878 | |
| 303 | 264 | ROM_LOAD( "ic61", 0x0000, 0x0020, CRC(e802d6cf) SHA1(233ceb9e3a91939e1925766a696bc65ab0dffa50) ) |
| 304 | 265 | ROM_END |
| 305 | 266 | |
| 267 | ||
| 306 | 268 | ROM_START( myststno ) |
| 307 | 269 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) |
| 308 | 270 | ROM_LOAD( "ms0", 0x4000, 0x2000, CRC(6dacc05f) SHA1(43054199901639516205c7ea145462d0abea8fb1) ) |
| r1877 | r1878 | |
| 333 | 295 | ROM_END |
| 334 | 296 | |
| 335 | 297 | |
| 336 | GAME( 1984, mystston, 0, mystston, mystston, 0, ROT270, "Technos", "Mysterious Stones - Dr. John's Adventure", 0 ) | |
| 337 | GAME( 1984, myststno, mystston, mystston, mystston, 0, ROT270, "Technos", "Mysterious Stones - Dr. Kick in Adventure", 0 ) | |
| 298 | ||
| 299 | /************************************* | |
| 300 | * | |
| 301 | * Game drivers | |
| 302 | * | |
| 303 | *************************************/ | |
| 304 | ||
| 305 | GAME( 1984, mystston, 0, mystston, mystston, 0, ROT270, "Technos", "Mysterious Stones - Dr. John's Adventure", GAME_SUPPORTS_SAVE ) | |
| 306 | GAME( 1984, myststno, mystston, mystston, mystston, 0, ROT270, "Technos", "Mysterious Stones - Dr. Kick in Adventure", GAME_SUPPORTS_SAVE ) |
| r1877 | r1878 | |
|---|---|---|
| 189 | 189 | attotime duration = attotime_make(0, ATTOSECONDS_PER_SECOND * 0.45 * 6.8e-6 * resistance * (data+1)); |
| 190 | 190 | timeout_time = attotime_add(timer_get_time(), duration); |
| 191 | 191 | |
| 192 | discrete_sound_w(HITME_DOWNCOUNT_VAL, data); | |
| 193 | discrete_sound_w(HITME_OUT0, 1); | |
| 192 | discrete_sound_w(machine, HITME_DOWNCOUNT_VAL, data); | |
| 193 | discrete_sound_w(machine, HITME_OUT0, 1); | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | |
| 197 | 197 | static WRITE8_HANDLER( output_port_1_w ) |
| 198 | 198 | { |
| 199 | discrete_sound_w(HITME_ENABLE_VAL, data); | |
| 200 | discrete_sound_w(HITME_OUT1, 1); | |
| 199 | discrete_sound_w(machine, HITME_ENABLE_VAL, data); | |
| 200 | discrete_sound_w(machine, HITME_OUT1, 1); | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 |
| r1877 | r1878 | |
|---|---|---|
| 86 | 86 | |
| 87 | 87 | static READ16_HANDLER( adpcm_r ) |
| 88 | 88 | { |
| 89 | return (OKIM6295_status_0_r(offset) << 8) | 0x00ff; | |
| 89 | return (OKIM6295_status_0_r(machine, offset) << 8) | 0x00ff; | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| 93 | 93 | static WRITE16_HANDLER( adpcm_w ) |
| 94 | 94 | { |
| 95 | 95 | if (ACCESSING_MSB) |
| 96 | OKIM6295_data_0_w(offset, (data >> 8) & 0xff); | |
| 96 | OKIM6295_data_0_w(machine, offset, (data >> 8) & 0xff); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
| r1877 | r1878 | |
| 109 | 109 | if (ACCESSING_MSB) |
| 110 | 110 | { |
| 111 | 111 | if (offset & 1) |
| 112 | YM2413_data_port_0_w(0, (data >> 8) & 0xff); | |
| 112 | YM2413_data_port_0_w(machine, 0, (data >> 8) & 0xff); | |
| 113 | 113 | else |
| 114 | YM2413_register_port_0_w(0, (data >> 8) & 0xff); | |
| 114 | YM2413_register_port_0_w(machine, 0, (data >> 8) & 0xff); | |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| r1877 | r1878 | |
| 385 | 385 | /* basic machine hardware */ |
| 386 | 386 | MDRV_CPU_ADD(M68000, MASTER_CLOCK/2) |
| 387 | 387 | MDRV_CPU_PROGRAM_MAP(main_map, 0) |
| 388 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 388 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 389 | 389 | |
| 390 | 390 | MDRV_MACHINE_RESET(rampart) |
| 391 | 391 | MDRV_NVRAM_HANDLER(atarigen) |
| r1877 | r1878 | |
|---|---|---|
| 664 | 664 | /* basic machine hardware */ |
| 665 | 665 | MDRV_CPU_ADD_TAG("main", Z80, 4000000) /* 4 MHz? */ |
| 666 | 666 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 667 | MDRV_CPU_VBLANK_INT(senjyo_interrupt | |
| 667 | MDRV_CPU_VBLANK_INT("main", senjyo_interrupt | |
| 668 | 668 | |
| 669 | 669 | MDRV_CPU_ADD_TAG("sub", Z80, 2000000) |
| 670 | 670 | MDRV_CPU_CONFIG(daisy_chain) |
| r1877 | r1878 | |
|---|---|---|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| 89 | static ADDRESS_MAP_START( | |
| 89 | static ADDRESS_MAP_START( m | |
| 90 | 90 | AM_RANGE(0x0000, 0x0000) AM_READ(yiear_speech_r) |
| 91 | AM_RANGE(0x4000, 0x4000) AM_WRITE(yiear_control_w) | |
| 92 | AM_RANGE(0x4800, 0x4800) AM_WRITE(konami_SN76496_latch_w) | |
| 93 | AM_RANGE(0x4900, 0x4900) AM_WRITE(konami_SN76496_0_w) | |
| 94 | AM_RANGE(0x4a00, 0x4a00) AM_WRITE(yiear_VLM5030_control_w) | |
| 95 | AM_RANGE(0x4b00, 0x4b00) AM_WRITE(VLM5030_data_w) | |
| 91 | 96 | AM_RANGE(0x4c00, 0x4c00) AM_READ(input_port_3_r) |
| 92 | 97 | AM_RANGE(0x4d00, 0x4d00) AM_READ(input_port_4_r) |
| 93 | 98 | AM_RANGE(0x4e00, 0x4e00) AM_READ(input_port_0_r) |
| 94 | 99 | AM_RANGE(0x4e01, 0x4e01) AM_READ(input_port_1_r) |
| 95 | 100 | AM_RANGE(0x4e02, 0x4e02) AM_READ(input_port_2_r) |
| 96 | 101 | AM_RANGE(0x4e03, 0x4e03) AM_READ(input_port_5_r) |
| 97 | AM_RANGE(0x5000, 0x5fff) AM_READ(MRA8_RAM) | |
| 98 | AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM) | |
| 99 | ADDRESS_MAP_END | |
| 100 | ||
| 101 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 102 | AM_RANGE(0x4000, 0x4000) AM_WRITE(yiear_control_w) | |
| 103 | AM_RANGE(0x4800, 0x4800) AM_WRITE(konami_SN76496_latch_w) | |
| 104 | AM_RANGE(0x4900, 0x4900) AM_WRITE(konami_SN76496_0_w) | |
| 105 | AM_RANGE(0x4a00, 0x4a00) AM_WRITE(yiear_VLM5030_control_w) | |
| 106 | AM_RANGE(0x4b00, 0x4b00) AM_WRITE(VLM5030_data_w) | |
| 107 | 102 | AM_RANGE(0x4f00, 0x4f00) AM_WRITE(watchdog_reset_w) |
| 108 | AM_RANGE(0x5000, 0x502f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 109 | AM_RANGE(0x5030, 0x53ff) AM_WRITE(MWA8_RAM) | |
| 110 | AM_RANGE(0x5400, 0x542f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram_2) | |
| 111 | AM_RANGE(0x5430, 0x57ff) AM_WRITE(MWA8_RAM) | |
| 103 | AM_RANGE(0x5000, 0x502f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 104 | AM_RANGE(0x5400, 0x542f) AM_RAM AM_BASE(&spriteram_2) | |
| 112 | 105 | AM_RANGE(0x5800, 0x5fff) AM_WRITE(yiear_videoram_w) AM_BASE(&videoram) |
| 113 | AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 106 | AM_RANGE(0x5000, 0x5fff) AM_RAM | |
| 107 | AM_RANGE(0x8000, 0xffff) AM_ROM | |
| 114 | 108 | ADDRESS_MAP_END |
| 115 | 109 | |
| 116 | 110 | |
| 117 | 111 | |
| 112 | ||
| 118 | 113 | static INPUT_PORTS_START( yiear ) |
| 119 | 114 | PORT_START /* IN0 */ |
| 120 | 115 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| r1877 | r1878 | |
| 260 | 255 | |
| 261 | 256 | /* basic machine hardware */ |
| 262 | 257 | MDRV_CPU_ADD(M6809,18432000/16) /* ???? */ |
| 263 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 264 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) /* vblank */ | |
| 258 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 259 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 265 | 260 | MDRV_CPU_PERIODIC_INT(yiear_nmi_interrupt,500) /* music tempo (correct frequency unknown) */ |
| 266 | 261 | |
| 267 | 262 | /* video hardware */ |
| r1877 | r1878 | |
|---|---|---|
| 101 | 101 | static UINT8 *murogem_videoram; |
| 102 | 102 | |
| 103 | 103 | |
| 104 | static WRITE8_HANDLER( murogem_mc6845_address_w ) | |
| 105 | { | |
| 106 | mc6845_address_w(mc6845, data); | |
| 107 | } | |
| 108 | ||
| 109 | static WRITE8_HANDLER( murogem_mc6845_register_w ) | |
| 110 | { | |
| 111 | mc6845_register_w(mc6845, data); | |
| 112 | } | |
| 113 | ||
| 114 | ||
| 115 | 104 | static ADDRESS_MAP_START( murogem_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 116 | 105 | AM_RANGE(0x0000, 0x007f) AM_RAM |
| 117 | AM_RANGE(0x4000, 0x4000) AM_WRITE(murogem_mc6845_address_w) | |
| 118 | AM_RANGE(0x4001, 0x4001) AM_WRITE(murogem_mc6845_register_w) | |
| 106 | AM_RANGE(0x4000, 0x4000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 107 | AM_RANGE(0x4001, 0x4001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 119 | 108 | AM_RANGE(0x5000, 0x5000) AM_READ(input_port_0_r) |
| 120 | 109 | AM_RANGE(0x5800, 0x5800) AM_READ(input_port_1_r) |
| 121 | 110 | AM_RANGE(0x7000, 0x7000) AM_WRITE(MWA8_NOP) // sound? payout? |
| r1877 | r1878 | |
| 213 | 202 | /* basic machine hardware */ |
| 214 | 203 | MDRV_CPU_ADD(M6802,8000000) /* ? MHz */ |
| 215 | 204 | MDRV_CPU_PROGRAM_MAP(murogem_map,0) |
| 216 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 205 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 217 | 206 | |
| 218 | 207 | /* video hardware */ |
| 219 | 208 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 111 | 111 | |
| 112 | 112 | static INTERRUPT_GEN( snowbro3_interrupt ) |
| 113 | 113 | { |
| 114 | int status = OKIM6295_status_0_r(0); | |
| 114 | int status = OKIM6295_status_0_r(machine,0); | |
| 115 | 115 | |
| 116 | 116 | cpunum_set_input_line(machine, 0, cpu_getiloops() + 2, HOLD_LINE); /* IRQs 4, 3, and 2 */ |
| 117 | 117 | |
| r1877 | r1878 | |
| 119 | 119 | { |
| 120 | 120 | if ((status&0x08)==0x00) |
| 121 | 121 | { |
| 122 | OKIM6295_data_0_w(0,0x80|sb3_music); | |
| 123 | OKIM6295_data_0_w(0,0x00|0x82); | |
| 122 | OKIM6295_data_0_w(machine,0,0x80|sb3_music); | |
| 123 | OKIM6295_data_0_w(machine,0,0x00|0x82); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | } |
| r1877 | r1878 | |
| 128 | 128 | { |
| 129 | 129 | if ((status&0x08)==0x08) |
| 130 | 130 | { |
| 131 | OKIM6295_data_0_w(0,0x40); /* Stop playing music */ | |
| 131 | OKIM6295_data_0_w(machine,0,0x40); /* Stop playing music */ | |
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
| r1877 | r1878 | |
| 139 | 139 | |
| 140 | 140 | static READ16_HANDLER( snowbros_68000_sound_r ) |
| 141 | 141 | { |
| 142 | return soundlatch_r(offset); | |
| 142 | return soundlatch_r(machine,offset); | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | |
| r1877 | r1878 | |
| 147 | 147 | { |
| 148 | 148 | if (ACCESSING_LSB) |
| 149 | 149 | { |
| 150 | soundlatch_w(offset,data & 0xff); | |
| 151 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 150 | soundlatch_w(machine,offset,data & 0xff); | |
| 151 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | static WRITE16_HANDLER( semicom_soundcmd_w ) |
| 156 | 156 | { |
| 157 | if (ACCESSING_LSB) soundlatch_w(0,data & 0xff); | |
| 157 | if (ACCESSING_LSB) soundlatch_w(machine,0,data & 0xff); | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | |
| r1877 | r1878 | |
| 289 | 289 | { |
| 290 | 290 | if (ACCESSING_LSB) |
| 291 | 291 | { |
| 292 | soundlatch_w(offset,data & 0xff); | |
| 293 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 292 | soundlatch_w(machine,offset,data & 0xff); | |
| 293 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 294 | 294 | } |
| 295 | 295 | } |
| 296 | 296 | |
| r1877 | r1878 | |
| 453 | 453 | } |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | static void sb3_play_sound (int data) | |
| 456 | static void sb3_play_sound (running_machine *machine, int data) | |
| 457 | 457 | { |
| 458 | int status = OKIM6295_status_0_r(0); | |
| 458 | int status = OKIM6295_status_0_r(machine,0); | |
| 459 | 459 | |
| 460 | 460 | if ((status&0x01)==0x00) |
| 461 | 461 | { |
| 462 | OKIM6295_data_0_w(0,0x80|data); | |
| 463 | OKIM6295_data_0_w(0,0x00|0x12); | |
| 462 | OKIM6295_data_0_w(machine,0,0x80|data); | |
| 463 | OKIM6295_data_0_w(machine,0,0x00|0x12); | |
| 464 | 464 | } |
| 465 | 465 | else if ((status&0x02)==0x00) |
| 466 | 466 | { |
| 467 | OKIM6295_data_0_w(0,0x80|data); | |
| 468 | OKIM6295_data_0_w(0,0x00|0x22); | |
| 467 | OKIM6295_data_0_w(machine,0,0x80|data); | |
| 468 | OKIM6295_data_0_w(machine,0,0x00|0x22); | |
| 469 | 469 | } |
| 470 | 470 | else if ((status&0x04)==0x00) |
| 471 | 471 | { |
| 472 | OKIM6295_data_0_w(0,0x80|data); | |
| 473 | OKIM6295_data_0_w(0,0x00|0x42); | |
| 472 | OKIM6295_data_0_w(machine,0,0x80|data); | |
| 473 | OKIM6295_data_0_w(machine,0,0x00|0x42); | |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | |
| r1877 | r1878 | |
| 481 | 481 | if (data == 0x00fe) |
| 482 | 482 | { |
| 483 | 483 | sb3_music_is_playing = 0; |
| 484 | OKIM6295_data_0_w(0,0x78); /* Stop sounds */ | |
| 484 | OKIM6295_data_0_w(machine,0,0x78); /* Stop sounds */ | |
| 485 | 485 | } |
| 486 | 486 | else /* the alternating 0x00-0x2f or 0x30-0x5f might be something to do with the channels */ |
| 487 | 487 | { |
| r1877 | r1878 | |
| 489 | 489 | |
| 490 | 490 | if (data <= 0x21) |
| 491 | 491 | { |
| 492 | sb3_play_sound(data); | |
| 492 | sb3_play_sound(machine, data); | |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | if (data>=0x22 && data<=0x31) |
| r1877 | r1878 | |
| 499 | 499 | |
| 500 | 500 | if ((data>=0x30) && (data<=0x51)) |
| 501 | 501 | { |
| 502 | sb3_play_sound(data-0x30); | |
| 502 | sb3_play_sound(machine, data-0x30); | |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | if (data>=0x52 && data<=0x5f) |
| r1877 | r1878 | |
| 1558 | 1558 | /* basic machine hardware */ |
| 1559 | 1559 | MDRV_CPU_ADD_TAG("main", M68000, 8000000) /* 8 Mhz - confirmed */ |
| 1560 | 1560 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1561 | MDRV_CPU_VBLANK_INT(snowbros_interrupt,3) | |
| 1561 | MDRV_CPU_VBLANK_INT_HACK(snowbros_interrupt,3) | |
| 1562 | 1562 | |
| 1563 | 1563 | MDRV_CPU_ADD_TAG("sound", Z80, 6000000) /* 6 MHz - confirmed */ |
| 1564 | 1564 | /* audio CPU */ |
| r1877 | r1878 | |
| 1656 | 1656 | /* basic machine hardware */ |
| 1657 | 1657 | MDRV_CPU_ADD_TAG("main", M68000, 16000000) |
| 1658 | 1658 | MDRV_CPU_PROGRAM_MAP(honeydol_readmem,honeydol_writemem) |
| 1659 | MDRV_CPU_VBLANK_INT(snowbros_interrupt,3) | |
| 1659 | MDRV_CPU_VBLANK_INT_HACK(snowbros_interrupt,3) | |
| 1660 | 1660 | |
| 1661 | 1661 | MDRV_CPU_ADD_TAG("sound", Z80, 4000000) |
| 1662 | 1662 | /* audio CPU */ |
| r1877 | r1878 | |
| 1696 | 1696 | /* basic machine hardware */ |
| 1697 | 1697 | MDRV_CPU_ADD_TAG("main", M68000, 16000000) // or 12 |
| 1698 | 1698 | MDRV_CPU_PROGRAM_MAP(twinadv_readmem,twinadv_writemem) |
| 1699 | MDRV_CPU_VBLANK_INT(snowbros_interrupt,3) | |
| 1699 | MDRV_CPU_VBLANK_INT_HACK(snowbros_interrupt,3) | |
| 1700 | 1700 | |
| 1701 | 1701 | MDRV_CPU_ADD_TAG("sound", Z80, 4000000) |
| 1702 | 1702 | /* audio CPU */ |
| 1703 | 1703 | MDRV_CPU_PROGRAM_MAP(twinadv_sound_readmem,twinadv_sound_writemem) |
| 1704 | 1704 | MDRV_CPU_IO_MAP(twinadv_sound_readport,twinadv_sound_writeport) |
| 1705 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1705 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1706 | 1706 | |
| 1707 | 1707 | /* video hardware */ |
| 1708 | 1708 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 1777 | 1777 | /* basic machine hardware */ |
| 1778 | 1778 | MDRV_CPU_ADD(M68000, 16000000) /* 16mhz or 12mhz ? */ |
| 1779 | 1779 | MDRV_CPU_PROGRAM_MAP(readmem3,writemem3) |
| 1780 | MDRV_CPU_VBLANK_INT(snowbro3_interrupt,3) | |
| 1780 | MDRV_CPU_VBLANK_INT_HACK(snowbro3_interrupt,3) | |
| 1781 | 1781 | |
| 1782 | 1782 | /* video hardware */ |
| 1783 | 1783 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 206 | 206 | int pokey_reg = (offset % 8) | control; |
| 207 | 207 | |
| 208 | 208 | if (pokey_num == 0) |
| 209 | return pokey1_r(pokey_reg); | |
| 209 | return pokey1_r(machine, pokey_reg); | |
| 210 | 210 | else |
| 211 | return pokey2_r(pokey_reg); | |
| 211 | return pokey2_r(machine, pokey_reg); | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | |
| r1877 | r1878 | |
| 219 | 219 | int pokey_reg = (offset % 8) | control; |
| 220 | 220 | |
| 221 | 221 | if (pokey_num == 0) |
| 222 | pokey1_w(pokey_reg, data); | |
| 222 | pokey1_w(machine, pokey_reg, data); | |
| 223 | 223 | else |
| 224 | pokey2_w(pokey_reg, data); | |
| 224 | pokey2_w(machine, pokey_reg, data); | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | |
| r1877 | r1878 | |
| 239 | 239 | |
| 240 | 240 | static WRITE8_HANDLER( speech_strobe_w ) |
| 241 | 241 | { |
| 242 | tms5220_data_w(0, speech_write_buffer); | |
| 242 | tms5220_data_w(machine, 0, speech_write_buffer); | |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | /************************************* |
| r1877 | r1878 | |
|---|---|---|
| 172 | 172 | |
| 173 | 173 | static TIMER_CALLBACK( delayed_sound_data_w ) |
| 174 | 174 | { |
| 175 | soundlatch_w(0, param); | |
| 175 | soundlatch_w(machine, 0, param); | |
| 176 | 176 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, ASSERT_LINE); |
| 177 | 177 | } |
| 178 | 178 | |
| r1877 | r1878 | |
| 191 | 191 | |
| 192 | 192 | static READ8_HANDLER( sound_data_r ) |
| 193 | 193 | { |
| 194 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 195 | return soundlatch_r(offset); | |
| 194 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 195 | return soundlatch_r(machine, offset); | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | |
| r1877 | r1878 | |
| 350 | 350 | D1: (CONT) - affects sprite hardware |
| 351 | 351 | D0: Sound section reset (1= normal operation, 0= reset) |
| 352 | 352 | */ |
| 353 | if (((oldval ^ data) & 0x40) && !(data & 0x40)) watchdog_reset_w(0,0); | |
| 353 | if (((oldval ^ data) & 0x40) && !(data & 0x40)) watchdog_reset_w(machine,0,0); | |
| 354 | 354 | segaic16_set_display_enable(data & 0x20); |
| 355 | 355 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); |
| 356 | 356 | return; |
| r1877 | r1878 | |
|---|---|---|
| 86 | 86 | memory_set_bankptr(1, &SNDROM[0x08000 + (0x8000 * (data & 0x03))]); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | static int nbmj9195_sound_r(int offset) | |
| 89 | static int nbmj9195_sound_r(running_machine *machine, int offset) | |
| 90 | 90 | { |
| 91 | return soundlatch_r(0); | |
| 91 | return soundlatch_r(machine, 0); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | static WRITE8_HANDLER( nbmj9195_sound_w ) |
| 95 | 95 | { |
| 96 | soundlatch_w(0, data); | |
| 96 | soundlatch_w(machine, 0, data); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | static void nbmj9195_soundclr_w(int offset, int data) | |
| 99 | static void nbmj9195_soundclr_w(running_machine *machine, int offset, int data) | |
| 100 | 100 | { |
| 101 | soundlatch_clear_w(0, 0); | |
| 101 | soundlatch_clear_w(machine, 0, 0); | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | static void nbmj9195_outcoin_flag_w(int data) |
| r1877 | r1878 | |
| 169 | 169 | |
| 170 | 170 | static UINT8 pio_dir[5 * 2], pio_latch[5 * 2]; |
| 171 | 171 | |
| 172 | static int tmpz84c011_pio_r(int offset) | |
| 172 | static int tmpz84c011_pio_r(running_machine *machine, int offset) | |
| 173 | 173 | { |
| 174 | 174 | int portdata; |
| 175 | 175 | |
| r1877 | r1878 | |
| 249 | 249 | portdata = 0xff; |
| 250 | 250 | break; |
| 251 | 251 | case 8: /* PD_1 */ |
| 252 | portdata = nbmj9195_sound_r(0); | |
| 252 | portdata = nbmj9195_sound_r(machine, 0); | |
| 253 | 253 | break; |
| 254 | 254 | case 9: /* PE_1 */ |
| 255 | 255 | portdata = 0xff; |
| r1877 | r1878 | |
| 334 | 334 | portdata = 0xff; |
| 335 | 335 | break; |
| 336 | 336 | case 8: /* PD_1 */ |
| 337 | portdata = nbmj9195_sound_r(0); | |
| 337 | portdata = nbmj9195_sound_r(machine, 0); | |
| 338 | 338 | break; |
| 339 | 339 | case 9: /* PE_1 */ |
| 340 | 340 | portdata = 0xff; |
| r1877 | r1878 | |
| 350 | 350 | return portdata; |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | static void tmpz84c011_pio_w(int offset, int data) | |
| 353 | static void tmpz84c011_pio_w(running_machine *machine, int offset, int data) | |
| 354 | 354 | { |
| 355 | 355 | if ((!strcmp(Machine->gamedrv->name, "imekura")) || |
| 356 | 356 | (!strcmp(Machine->gamedrv->name, "mscoutm")) || |
| r1877 | r1878 | |
| 377 | 377 | nbmj9195_soundbank_w(data); |
| 378 | 378 | break; |
| 379 | 379 | case 6: /* PB_1 */ |
| 380 | DAC_1_WRITE(0, data); | |
| 380 | DAC_1_WRITE(machine, 0, data); | |
| 381 | 381 | break; |
| 382 | 382 | case 7: /* PC_1 */ |
| 383 | DAC_0_WRITE(0, data); | |
| 383 | DAC_0_WRITE(machine, 0, data); | |
| 384 | 384 | break; |
| 385 | 385 | case 8: /* PD_1 */ |
| 386 | 386 | break; |
| 387 | 387 | case 9: /* PE_1 */ |
| 388 | if (!(data & 0x01)) nbmj9195_soundclr_w(0, 0); | |
| 388 | if (!(data & 0x01)) nbmj9195_soundclr_w(machine, 0, 0); | |
| 389 | 389 | break; |
| 390 | 390 | |
| 391 | 391 | default: |
| r1877 | r1878 | |
| 415 | 415 | nbmj9195_soundbank_w(data); |
| 416 | 416 | break; |
| 417 | 417 | case 6: /* PB_1 */ |
| 418 | DAC_1_WRITE(0, data); | |
| 418 | DAC_1_WRITE(machine, 0, data); | |
| 419 | 419 | break; |
| 420 | 420 | case 7: /* PC_1 */ |
| 421 | DAC_0_WRITE(0, data); | |
| 421 | DAC_0_WRITE(machine, 0, data); | |
| 422 | 422 | break; |
| 423 | 423 | case 8: /* PD_1 */ |
| 424 | 424 | break; |
| 425 | 425 | case 9: /* PE_1 */ |
| 426 | if (!(data & 0x01)) nbmj9195_soundclr_w(0, 0); | |
| 426 | if (!(data & 0x01)) nbmj9195_soundclr_w(machine, 0, 0); | |
| 427 | 427 | break; |
| 428 | 428 | |
| 429 | 429 | default: |
| r1877 | r1878 | |
| 437 | 437 | /* CPU interface */ |
| 438 | 438 | |
| 439 | 439 | /* device 0 */ |
| 440 | static READ8_HANDLER( tmpz84c011_0_pa_r ) { return (tmpz84c011_pio_r(0) & ~pio_dir[0]) | (pio_latch[0] & pio_dir[0]); } | |
| 441 | static READ8_HANDLER( tmpz84c011_0_pb_r ) { return (tmpz84c011_pio_r(1) & ~pio_dir[1]) | (pio_latch[1] & pio_dir[1]); } | |
| 442 | static READ8_HANDLER( tmpz84c011_0_pc_r ) { return (tmpz84c011_pio_r(2) & ~pio_dir[2]) | (pio_latch[2] & pio_dir[2]); } | |
| 443 | static READ8_HANDLER( tmpz84c011_0_pd_r ) { return (tmpz84c011_pio_r(3) & ~pio_dir[3]) | (pio_latch[3] & pio_dir[3]); } | |
| 444 | static READ8_HANDLER( tmpz84c011_0_pe_r ) { return (tmpz84c011_pio_r(4) & ~pio_dir[4]) | (pio_latch[4] & pio_dir[4]); } | |
| 440 | static READ8_HANDLER( tmpz84c011_0_pa_r ) { return (tmpz84c011_pio_r(machine,0) & ~pio_dir[0]) | (pio_latch[0] & pio_dir[0]); } | |
| 441 | static READ8_HANDLER( tmpz84c011_0_pb_r ) { return (tmpz84c011_pio_r(machine,1) & ~pio_dir[1]) | (pio_latch[1] & pio_dir[1]); } | |
| 442 | static READ8_HANDLER( tmpz84c011_0_pc_r ) { return (tmpz84c011_pio_r(machine,2) & ~pio_dir[2]) | (pio_latch[2] & pio_dir[2]); } | |
| 443 | static READ8_HANDLER( tmpz84c011_0_pd_r ) { return (tmpz84c011_pio_r(machine,3) & ~pio_dir[3]) | (pio_latch[3] & pio_dir[3]); } | |
| 444 | static READ8_HANDLER( tmpz84c011_0_pe_r ) { return (tmpz84c011_pio_r(machine,4) & ~pio_dir[4]) | (pio_latch[4] & pio_dir[4]); } | |
| 445 | 445 | |
| 446 | static WRITE8_HANDLER( tmpz84c011_0_pa_w ) { pio_latch[0] = data; tmpz84c011_pio_w(0, data); } | |
| 447 | static WRITE8_HANDLER( tmpz84c011_0_pb_w ) { pio_latch[1] = data; tmpz84c011_pio_w(1, data); } | |
| 448 | static WRITE8_HANDLER( tmpz84c011_0_pc_w ) { pio_latch[2] = data; tmpz84c011_pio_w(2, data); } | |
| 449 | static WRITE8_HANDLER( tmpz84c011_0_pd_w ) { pio_latch[3] = data; tmpz84c011_pio_w(3, data); } | |
| 450 | static WRITE8_HANDLER( tmpz84c011_0_pe_w ) { pio_latch[4] = data; tmpz84c011_pio_w(4, data); } | |
| 446 | static WRITE8_HANDLER( tmpz84c011_0_pa_w ) { pio_latch[0] = data; tmpz84c011_pio_w(machine, 0, data); } | |
| 447 | static WRITE8_HANDLER( tmpz84c011_0_pb_w ) { pio_latch[1] = data; tmpz84c011_pio_w(machine, 1, data); } | |
| 448 | static WRITE8_HANDLER( tmpz84c011_0_pc_w ) { pio_latch[2] = data; tmpz84c011_pio_w(machine, 2, data); } | |
| 449 | static WRITE8_HANDLER( tmpz84c011_0_pd_w ) { pio_latch[3] = data; tmpz84c011_pio_w(machine, 3, data); } | |
| 450 | static WRITE8_HANDLER( tmpz84c011_0_pe_w ) { pio_latch[4] = data; tmpz84c011_pio_w(machine, 4, data); } | |
| 451 | 451 | |
| 452 | 452 | static READ8_HANDLER( tmpz84c011_0_dir_pa_r ) { return pio_dir[0]; } |
| 453 | 453 | static READ8_HANDLER( tmpz84c011_0_dir_pb_r ) { return pio_dir[1]; } |
| r1877 | r1878 | |
| 462 | 462 | static WRITE8_HANDLER( tmpz84c011_0_dir_pe_w ) { pio_dir[4] = data; } |
| 463 | 463 | |
| 464 | 464 | /* device 1 */ |
| 465 | static READ8_HANDLER( tmpz84c011_1_pa_r ) { return (tmpz84c011_pio_r(5) & ~pio_dir[5]) | (pio_latch[5] & pio_dir[5]); } | |
| 466 | static READ8_HANDLER( tmpz84c011_1_pb_r ) { return (tmpz84c011_pio_r(6) & ~pio_dir[6]) | (pio_latch[6] & pio_dir[6]); } | |
| 467 | static READ8_HANDLER( tmpz84c011_1_pc_r ) { return (tmpz84c011_pio_r(7) & ~pio_dir[7]) | (pio_latch[7] & pio_dir[7]); } | |
| 468 | static READ8_HANDLER( tmpz84c011_1_pd_r ) { return (tmpz84c011_pio_r(8) & ~pio_dir[8]) | (pio_latch[8] & pio_dir[8]); } | |
| 469 | static READ8_HANDLER( tmpz84c011_1_pe_r ) { return (tmpz84c011_pio_r(9) & ~pio_dir[9]) | (pio_latch[9] & pio_dir[9]); } | |
| 465 | static READ8_HANDLER( tmpz84c011_1_pa_r ) { return (tmpz84c011_pio_r(machine,5) & ~pio_dir[5]) | (pio_latch[5] & pio_dir[5]); } | |
| 466 | static READ8_HANDLER( tmpz84c011_1_pb_r ) { return (tmpz84c011_pio_r(machine,6) & ~pio_dir[6]) | (pio_latch[6] & pio_dir[6]); } | |
| 467 | static READ8_HANDLER( tmpz84c011_1_pc_r ) { return (tmpz84c011_pio_r(machine,7) & ~pio_dir[7]) | (pio_latch[7] & pio_dir[7]); } | |
| 468 | static READ8_HANDLER( tmpz84c011_1_pd_r ) { return (tmpz84c011_pio_r(machine,8) & ~pio_dir[8]) | (pio_latch[8] & pio_dir[8]); } | |
| 469 | static READ8_HANDLER( tmpz84c011_1_pe_r ) { return (tmpz84c011_pio_r(machine,9) & ~pio_dir[9]) | (pio_latch[9] & pio_dir[9]); } | |
| 470 | 470 | |
| 471 | static WRITE8_HANDLER( tmpz84c011_1_pa_w ) { pio_latch[5] = data; tmpz84c011_pio_w(5, data); } | |
| 472 | static WRITE8_HANDLER( tmpz84c011_1_pb_w ) { pio_latch[6] = data; tmpz84c011_pio_w(6, data); } | |
| 473 | static WRITE8_HANDLER( tmpz84c011_1_pc_w ) { pio_latch[7] = data; tmpz84c011_pio_w(7, data); } | |
| 474 | static WRITE8_HANDLER( tmpz84c011_1_pd_w ) { pio_latch[8] = data; tmpz84c011_pio_w(8, data); } | |
| 475 | static WRITE8_HANDLER( tmpz84c011_1_pe_w ) { pio_latch[9] = data; tmpz84c011_pio_w(9, data); } | |
| 471 | static WRITE8_HANDLER( tmpz84c011_1_pa_w ) { pio_latch[5] = data; tmpz84c011_pio_w(machine, 5, data); } | |
| 472 | static WRITE8_HANDLER( tmpz84c011_1_pb_w ) { pio_latch[6] = data; tmpz84c011_pio_w(machine, 6, data); } | |
| 473 | static WRITE8_HANDLER( tmpz84c011_1_pc_w ) { pio_latch[7] = data; tmpz84c011_pio_w(machine, 7, data); } | |
| 474 | static WRITE8_HANDLER( tmpz84c011_1_pd_w ) { pio_latch[8] = data; tmpz84c011_pio_w(machine, 8, data); } | |
| 475 | static WRITE8_HANDLER( tmpz84c011_1_pe_w ) { pio_latch[9] = data; tmpz84c011_pio_w(machine, 9, data); } | |
| 476 | 476 | |
| 477 | 477 | static READ8_HANDLER( tmpz84c011_1_dir_pa_r ) { return pio_dir[5]; } |
| 478 | 478 | static READ8_HANDLER( tmpz84c011_1_dir_pb_r ) { return pio_dir[6]; } |
| r1877 | r1878 | |
| 500 | 500 | /* CTC of main cpu, ch0 trigger is vblank */ |
| 501 | 501 | static INTERRUPT_GEN( ctc0_trg1 ) |
| 502 | 502 | { |
| 503 | z80ctc_0_trg1_w(0, 1); | |
| 504 | z80ctc_0_trg1_w(0, 0); | |
| 503 | z80ctc_0_trg1_w(machine, 0, 1); | |
| 504 | z80ctc_0_trg1_w(machine, 0, 0); | |
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | static z80ctc_interface ctc_intf_1 = |
| r1877 | r1878 | |
| 541 | 541 | for (i = 0; i < (5 * 2); i++) |
| 542 | 542 | { |
| 543 | 543 | pio_dir[i] = pio_latch[i] = 0; |
| 544 | tmpz84c011_pio_w(i, 0); | |
| 544 | tmpz84c011_pio_w(machine, i, 0); | |
| 545 | 545 | } |
| 546 | 546 | } |
| 547 | 547 | |
| r1877 | r1878 | |
| 4139 | 4139 | MDRV_CPU_CONFIG(daisy_chain_main) |
| 4140 | 4140 | MDRV_CPU_PROGRAM_MAP(readmem_sailorws, writemem_sailorws) |
| 4141 | 4141 | MDRV_CPU_IO_MAP(readport_sailorws, writeport_sailorws) |
| 4142 | MDRV_CPU_VBLANK_INT(ctc0_trg | |
| 4142 | MDRV_CPU_VBLANK_INT("main", ctc0_trg | |
| 4143 | 4143 | |
| 4144 | 4144 | MDRV_CPU_ADD(Z80, 8000000/1) /* TMPZ84C011, 8.00 MHz */ |
| 4145 | 4145 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 240 | 240 | /* basic machine hardware */ |
| 241 | 241 | MDRV_CPU_ADD(M6809,12000000/6) /* 2 MHz ??? */ |
| 242 | 242 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 243 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 243 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 244 | 244 | |
| 245 | 245 | MDRV_CPU_ADD(M6809,12000000/6) |
| 246 | 246 | /* audio CPU */ /* 2 MHz ??? */ |
| 247 | 247 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 248 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) /* FIRQs are triggered by the main CPU */ | |
| 248 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* FIRQs are triggered by the main CPU */ | |
| 249 | 249 | |
| 250 | 250 | |
| 251 | 251 | /* video hardware */ |
| r1877 | r1878 | |
|---|---|---|
| 243 | 243 | { |
| 244 | 244 | int pattern = 0; |
| 245 | 245 | |
| 246 | if ((OKIM6295_status_0_r(0) & 0x08) == 0) | |
| 246 | if ((OKIM6295_status_0_r(machine,0) & 0x08) == 0) | |
| 247 | 247 | { |
| 248 | 248 | if (sslam_bar != 0) { |
| 249 | 249 | sslam_bar += 1; |
| r1877 | r1878 | |
| 264 | 264 | } |
| 265 | 265 | if (pattern) { |
| 266 | 266 | logerror("Changing bar in music track to pattern %02x\n",pattern); |
| 267 | OKIM6295_data_0_w(0,(0x80 | pattern)); | |
| 268 | OKIM6295_data_0_w(0,0x81); | |
| 267 | OKIM6295_data_0_w(machine,0,(0x80 | pattern)); | |
| 268 | OKIM6295_data_0_w(machine,0,0x81); | |
| 269 | 269 | } |
| 270 | 270 | } |
| 271 | 271 | // { |
| r1877 | r1878 | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
| 278 | static void sslam_play(int track, int data) | |
| 278 | static void sslam_play(running_machine *machine, int track, int data) | |
| 279 | 279 | { |
| 280 | int status = OKIM6295_status_0_r(0); | |
| 280 | int status = OKIM6295_status_0_r(machine,0); | |
| 281 | 281 | |
| 282 | 282 | if (data < 0x80) { |
| 283 | 283 | if (track) { |
| r1877 | r1878 | |
| 285 | 285 | sslam_track = data; |
| 286 | 286 | sslam_bar = 1; |
| 287 | 287 | if (status & 0x08) |
| 288 | OKIM6295_data_0_w(0,0x40); | |
| 289 | OKIM6295_data_0_w(0,(0x80 | data)); | |
| 290 | OKIM6295_data_0_w(0,0x81); | |
| 288 | OKIM6295_data_0_w(machine,0,0x40); | |
| 289 | OKIM6295_data_0_w(machine,0,(0x80 | data)); | |
| 290 | OKIM6295_data_0_w(machine,0,0x81); | |
| 291 | 291 | timer_adjust_periodic(music_timer, ATTOTIME_IN_MSEC(4), 0, ATTOTIME_IN_HZ(250)); /* 250Hz for smooth sequencing */ |
| 292 | 292 | } |
| 293 | 293 | } |
| 294 | 294 | else { |
| 295 | 295 | if ((status & 0x01) == 0) { |
| 296 | OKIM6295_data_0_w(0,(0x80 | data)); | |
| 297 | OKIM6295_data_0_w(0,0x11); | |
| 296 | OKIM6295_data_0_w(machine,0,(0x80 | data)); | |
| 297 | OKIM6295_data_0_w(machine,0,0x11); | |
| 298 | 298 | } |
| 299 | 299 | else if ((status & 0x02) == 0) { |
| 300 | OKIM6295_data_0_w(0,(0x80 | data)); | |
| 301 | OKIM6295_data_0_w(0,0x21); | |
| 300 | OKIM6295_data_0_w(machine,0,(0x80 | data)); | |
| 301 | OKIM6295_data_0_w(machine,0,0x21); | |
| 302 | 302 | } |
| 303 | 303 | else if ((status & 0x04) == 0) { |
| 304 | OKIM6295_data_0_w(0,(0x80 | data)); | |
| 305 | OKIM6295_data_0_w(0,0x41); | |
| 304 | OKIM6295_data_0_w(machine,0,(0x80 | data)); | |
| 305 | OKIM6295_data_0_w(machine,0,0x41); | |
| 306 | 306 | } |
| 307 | 307 | } |
| 308 | 308 | } |
| r1877 | r1878 | |
| 314 | 314 | sslam_bar = 0; |
| 315 | 315 | } |
| 316 | 316 | data &= 0x7f; |
| 317 | OKIM6295_data_0_w(0,data); | |
| 317 | OKIM6295_data_0_w(machine,0,data); | |
| 318 | 318 | } |
| 319 | 319 | } |
| 320 | 320 | |
| r1877 | r1878 | |
| 327 | 327 | if (data == 0xfe) { |
| 328 | 328 | /* This should reset the sound MCU and stop audio playback, but here, it */ |
| 329 | 329 | /* chops the first coin insert. So let's only stop any playing melodies. */ |
| 330 | sslam_play(1, (0x80 | 0x40)); /* Stop playing the melody */ | |
| 330 | sslam_play(machine, 1, (0x80 | 0x40)); /* Stop playing the melody */ | |
| 331 | 331 | } |
| 332 | 332 | else { |
| 333 | 333 | logerror("Unknown command (%02x) sent to the Sound controller\n",data); |
| r1877 | r1878 | |
| 349 | 349 | // if (sslam_snd_bank != 1) |
| 350 | 350 | // OKIM6295_set_bank_base(0, (1 * 0x40000)); |
| 351 | 351 | // sslam_snd_bank = 1; |
| 352 | sslam_play(0, sslam_sound); | |
| 352 | sslam_play(machine, 0, sslam_sound); | |
| 353 | 353 | } |
| 354 | 354 | else if (sslam_sound >= 0x69) { |
| 355 | 355 | if (sslam_snd_bank != 2) |
| r1877 | r1878 | |
| 362 | 362 | case 0x6c: sslam_melody = 7; break; |
| 363 | 363 | default: sslam_melody = 0; sslam_bar = 0; break; /* Invalid */ |
| 364 | 364 | } |
| 365 | sslam_play(sslam_melody, sslam_sound); | |
| 365 | sslam_play(machine, sslam_melody, sslam_sound); | |
| 366 | 366 | } |
| 367 | 367 | else if (sslam_sound >= 0x65) { |
| 368 | 368 | if (sslam_snd_bank != 1) |
| 369 | 369 | OKIM6295_set_bank_base(0, (1 * 0x40000)); |
| 370 | 370 | sslam_snd_bank = 1; |
| 371 | 371 | sslam_melody = 4; |
| 372 | sslam_play(sslam_melody, sslam_sound); | |
| 372 | sslam_play(machine, sslam_melody, sslam_sound); | |
| 373 | 373 | } |
| 374 | 374 | else if (sslam_sound >= 0x60) { |
| 375 | 375 | if (sslam_snd_bank != 0) |
| r1877 | r1878 | |
| 382 | 382 | case 0x64: sslam_melody = 3; break; |
| 383 | 383 | default: sslam_melody = 0; sslam_bar = 0; break; /* Invalid */ |
| 384 | 384 | } |
| 385 | sslam_play(sslam_melody, sslam_sound); | |
| 385 | sslam_play(machine, sslam_melody, sslam_sound); | |
| 386 | 386 | } |
| 387 | 387 | else { |
| 388 | sslam_play(0, sslam_sound); | |
| 388 | sslam_play(machine, 0, sslam_sound); | |
| 389 | 389 | } |
| 390 | 390 | } |
| 391 | 391 | } |
| r1877 | r1878 | |
| 395 | 395 | |
| 396 | 396 | static WRITE16_HANDLER( powerbls_sound_w ) |
| 397 | 397 | { |
| 398 | soundlatch_w(0,data & 0xff); | |
| 399 | cpunum_set_input_line(Machine, 1,I8051_INT1_LINE,PULSE_LINE); | |
| 398 | soundlatch_w(machine,0,data & 0xff); | |
| 399 | cpunum_set_input_line(machine, 1,I8051_INT1_LINE,PULSE_LINE); | |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | /* Memory Maps */ |
| r1877 | r1878 | |
| 454 | 454 | UINT8 data = 0; |
| 455 | 455 | |
| 456 | 456 | if ((playmark_oki_control & 0x38) == 0x30) { |
| 457 | data = soundlatch_r(0); | |
| 457 | data = soundlatch_r(machine,0); | |
| 458 | 458 | } |
| 459 | 459 | else if ((playmark_oki_control & 0x38) == 0x28) { |
| 460 | data = (OKIM6295_status_0_r(0) & 0x0f); | |
| 460 | data = (OKIM6295_status_0_r(machine,0) & 0x0f); | |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | return data; |
| r1877 | r1878 | |
| 483 | 483 | |
| 484 | 484 | if ((data & 0x38) == 0x18) |
| 485 | 485 | { |
| 486 | OKIM6295_data_0_w(0, playmark_oki_command); | |
| 486 | OKIM6295_data_0_w(machine, 0, playmark_oki_command); | |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | // !(data & 0x80) -> sound enable |
| r1877 | r1878 | |
| 731 | 731 | /* basic machine hardware */ |
| 732 | 732 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 733 | 733 | MDRV_CPU_PROGRAM_MAP(sslam_program_map, 0) |
| 734 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 734 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 735 | 735 | |
| 736 | 736 | MDRV_CPU_ADD(I8051, 12000000) |
| 737 | 737 | MDRV_CPU_FLAGS(CPU_DISABLE) /* Internal code is not dumped - 2 boards were protected */ |
| r1877 | r1878 | |
| 765 | 765 | /* basic machine hardware */ |
| 766 | 766 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 767 | 767 | MDRV_CPU_PROGRAM_MAP(powerbls_map, 0) |
| 768 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 768 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 769 | 769 | |
| 770 | 770 | MDRV_CPU_ADD(I8051, 12000000) |
| 771 | 771 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 193 | 193 | |
| 194 | 194 | static READ32_HANDLER( oki_r ) |
| 195 | 195 | { |
| 196 | return OKIM6295_status_0_r(0); | |
| 196 | return OKIM6295_status_0_r(machine, 0); | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | static WRITE32_HANDLER( oki_w ) |
| 200 | 200 | { |
| 201 | OKIM6295_data_0_w(0, data & 0xff); | |
| 201 | OKIM6295_data_0_w(machine, 0, data & 0xff); | |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | static READ32_HANDLER( oki2_r ) |
| 205 | 205 | { |
| 206 | return OKIM6295_status_1_r(0); | |
| 206 | return OKIM6295_status_1_r(machine, 0); | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | static WRITE32_HANDLER( oki2_w ) |
| 210 | 210 | { |
| 211 | OKIM6295_data_1_w(0, data & 0xff); | |
| 211 | OKIM6295_data_1_w(machine, 0, data & 0xff); | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | /* we need to throw away bits for all ram accesses as the devices are connected as 16-bit */ |
| r1877 | r1878 | |
| 292 | 292 | data &=0x0000ffff; |
| 293 | 293 | mem_mask &=0x0000ffff; |
| 294 | 294 | |
| 295 | deco16_pf1_data_w(offset,data,mem_mask); | |
| 295 | deco16_pf1_data_w(machine,offset,data,mem_mask); | |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | static READ32_HANDLER( simpl156_pf2_data_r ) |
| r1877 | r1878 | |
| 305 | 305 | { |
| 306 | 306 | data &=0x0000ffff; |
| 307 | 307 | mem_mask &=0x0000ffff; |
| 308 | deco16_pf2_data_w(offset,data,mem_mask); | |
| 308 | deco16_pf2_data_w(machine,offset,data,mem_mask); | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | /* Memory Map controled by PALs */ |
| r1877 | r1878 | |
| 484 | 484 | |
| 485 | 485 | MDRV_CPU_ADD_TAG("DE156", ARM, 28000000 /* /4 */) /*DE156*/ /* 7.000 MHz */ /* measured at 7.. seems to need 28? */ |
| 486 | 486 | MDRV_CPU_PROGRAM_MAP(chainrec_map,0) |
| 487 | MDRV_CPU_VBLANK_INT(simpl156_vbl_interrupt | |
| 487 | MDRV_CPU_VBLANK_INT("main", simpl156_vbl_interrupt | |
| 488 | 488 | |
| 489 | 489 | MDRV_NVRAM_HANDLER(simpl156) // 93C45 |
| 490 | 490 |
| r1877 | r1878 | |
|---|---|---|
| 345 | 345 | MDRV_CPU_ADD(Z80, CPU_PCB_CLOCK) |
| 346 | 346 | MDRV_CPU_PROGRAM_MAP(main_program_map,0) |
| 347 | 347 | MDRV_CPU_IO_MAP(main_io_map,0) |
| 348 | MDRV_CPU_VBLANK_INT(vblank_callback_lgp | |
| 348 | MDRV_CPU_VBLANK_INT("main", vblank_callback_lgp | |
| 349 | 349 | |
| 350 | 350 | /* sound cpu */ |
| 351 | 351 | MDRV_CPU_ADD(Z80, SOUND_PCB_CLOCK) |
| r1877 | r1878 | |
|---|---|---|
| 269 | 269 | /* basic machine hardware */ |
| 270 | 270 | MDRV_CPU_ADD(KONAMI, 3000000) /* Derived from 24 MHz clock */ |
| 271 | 271 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 272 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 272 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 273 | 273 | |
| 274 | 274 | MDRV_CPU_ADD(Z80, 3579545) |
| 275 | 275 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 281 | 281 | /* basic machine hardware */ |
| 282 | 282 | MDRV_CPU_ADD(V30,XTAL_16MHz/2) /* Sony 8623h9 CXQ70116D-8 (V30 compatible) */ |
| 283 | 283 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 284 | MDRV_CPU_VBLANK_INT(deadang_interrupt,2) | |
| 284 | MDRV_CPU_VBLANK_INT_HACK(deadang_interrupt,2) | |
| 285 | 285 | |
| 286 | 286 | MDRV_CPU_ADD(V30,XTAL_16MHz/2) /* Sony 8623h9 CXQ70116D-8 (V30 compatible) */ |
| 287 | 287 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| 288 | MDRV_CPU_VBLANK_INT(deadang_interrupt,2) | |
| 288 | MDRV_CPU_VBLANK_INT_HACK(deadang_interrupt,2) | |
| 289 | 289 | |
| 290 | 290 | SEIBU3A_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4) |
| 291 | 291 |
| r1877 | r1878 | |
|---|---|---|
| 90 | 90 | |
| 91 | 91 | static render_texture *video_texture; |
| 92 | 92 | static render_texture *overlay_texture; |
| 93 | static | |
| 93 | static | |
| 94 | 94 | |
| 95 | 95 | static emu_timer *irq_timer; |
| 96 | 96 | |
| r1877 | r1878 | |
| 112 | 112 | |
| 113 | 113 | if (discinfo != NULL) |
| 114 | 114 | { |
| 115 | | |
| 115 | | |
| 116 | 116 | rectangle fixedvis = *TMS9928A_get_visarea(); |
| 117 | 117 | fixedvis.max_x++; |
| 118 | 118 | fixedvis.max_y++; |
| r1877 | r1878 | |
| 205 | 205 | render_container_set_palette_alpha(render_container_get_screen(0), 1, overlay ? 0x00 : 0xff ); |
| 206 | 206 | |
| 207 | 207 | /* audio */ |
| 208 | discrete_sound_w(CLIFF_ENABLE_SND_1, sound&1); | |
| 209 | discrete_sound_w(CLIFF_ENABLE_SND_2, (sound>>1)&1); | |
| 208 | discrete_sound_w(machine, CLIFF_ENABLE_SND_1, sound&1); | |
| 209 | discrete_sound_w(machine, CLIFF_ENABLE_SND_2, (sound>>1)&1); | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | #ifdef UNUSED_FUNCTION |
| r1877 | r1878 | |
| 738 | 738 | MDRV_CPU_ADD(Z80, 4000000) /* 4MHz */ |
| 739 | 739 | MDRV_CPU_PROGRAM_MAP(mainmem,0) |
| 740 | 740 | MDRV_CPU_IO_MAP(mainport,0) |
| 741 | MDRV_CPU_VBLANK_INT(cliff_vsync | |
| 741 | MDRV_CPU_VBLANK_INT("main", cliff_vsync | |
| 742 | 742 | |
| 743 | 743 | MDRV_MACHINE_START(cliffhgr) |
| 744 | 744 | MDRV_MACHINE_RESET(cliffhgr) |
| r1877 | r1878 | |
|---|---|---|
| 90 | 90 | tilemap_set_flip(bg_tilemap, TILEMAP_FLIPX|TILEMAP_FLIPY); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | static void draw_sprites(running_machine *machine, | |
| 93 | static void draw_sprites(running_machine *machine, | |
| 94 | 94 | { |
| 95 | 95 | int offs; |
| 96 | 96 | |
| r1877 | r1878 | |
| 305 | 305 | |
| 306 | 306 | static WRITE8_HANDLER( cntsteer_sound_w ) |
| 307 | 307 | { |
| 308 | soundlatch_w(0,data); | |
| 308 | soundlatch_w(machine,0,data); | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | static WRITE8_HANDLER( zerotrgt_ctrl_w ) |
| r1877 | r1878 | |
| 564 | 564 | INPUT_PORTS_END |
| 565 | 565 | |
| 566 | 566 | |
| 567 | #ifdef UNUSED_DEFINITION | |
| 567 | 568 | static INPUT_PORTS_START( zerotrgt ) |
| 568 | 569 | PORT_START |
| 569 | 570 | PORT_DIPNAME( 0x01, 0x01, "0" ) |
| r1877 | r1878 | |
| 637 | 638 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON5 ) |
| 638 | 639 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) |
| 639 | 640 | INPUT_PORTS_END |
| 641 | #endif | |
| 640 | 642 | |
| 641 | 643 | /***************************************************************************/ |
| 642 | 644 | |
| r1877 | r1878 | |
| 716 | 718 | static MACHINE_DRIVER_START( cntsteer ) |
| 717 | 719 | MDRV_CPU_ADD(M6809, 2000000) /* ? */ |
| 718 | 720 | MDRV_CPU_PROGRAM_MAP(gekitsui_cpu1_map,0) |
| 719 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 721 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 720 | 722 | |
| 721 | 723 | MDRV_CPU_ADD(M6809, 2000000) /* ? */ |
| 722 | 724 | MDRV_CPU_PROGRAM_MAP(gekitsui_cpu2_map,0) |
| 723 | // MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 725 | // MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 724 | 726 | |
| 725 | 727 | // MDRV_CPU_ADD(M6502, 1500000) /* ? */ |
| 726 | 728 | // /* audio CPU */ |
| 727 | 729 | // MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 728 | // MDRV_CPU_VBLANK_INT(nmi_line_pulse,16) /* ? */ // should be interrupt, 16? | |
| 730 | // MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,16) /* ? */ // should be interrupt, 16? | |
| 729 | 731 | |
| 730 | 732 | /* video hardware */ |
| 731 | 733 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 751 | 753 | static MACHINE_DRIVER_START( zerotrgt ) |
| 752 | 754 | MDRV_CPU_ADD(M6809, 2000000) /* ? */ |
| 753 | 755 | MDRV_CPU_PROGRAM_MAP(gekitsui_cpu1_map,0) |
| 754 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 756 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 755 | 757 | |
| 756 | 758 | MDRV_CPU_ADD(M6809, 2000000) /* ? */ |
| 757 | 759 | MDRV_CPU_PROGRAM_MAP(gekitsui_cpu2_map,0) |
| 758 | // MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 760 | // MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 759 | 761 | |
| 760 | 762 | MDRV_CPU_ADD(M6502, 1500000) /* ? */ |
| 761 | 763 | /* audio CPU */ |
| 762 | 764 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 763 | MDRV_CPU_VBLANK_INT(irq0_line_pulse,16) /* ? */ // should be interrupt, 16? | |
| 765 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_pulse,16) /* ? */ // should be interrupt, 16? | |
| 764 | 766 | MDRV_CPU_PERIODIC_INT(sound_interrupt, 1000) |
| 765 | 767 | |
| 766 | 768 | /* video hardware */ |
| r1877 | r1878 | |
|---|---|---|
| 651 | 651 | /* basic machine hardware */ |
| 652 | 652 | MDRV_CPU_ADD(M68000,28000000/4) /* 7.0MHz - Main board Crystal is 28MHz */ |
| 653 | 653 | MDRV_CPU_PROGRAM_MAP(main_program_map, 0) |
| 654 | MDRV_CPU_VBLANK_INT(twincobr_interrupt | |
| 654 | MDRV_CPU_VBLANK_INT("main", twincobr_interrupt | |
| 655 | 655 | |
| 656 | 656 | MDRV_CPU_ADD(Z80,28000000/8) /* 3.5MHz */ |
| 657 | 657 | MDRV_CPU_PROGRAM_MAP(sound_program_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 284 | 284 | /* basic machine hardware */ |
| 285 | 285 | MDRV_CPU_ADD(Z80,24000000/4) /* Z80B 6 MHz */ |
| 286 | 286 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 287 | MDRV_CPU_VBLANK_INT(hexion_interrupt,3) /* both IRQ and NMI are used */ | |
| 287 | MDRV_CPU_VBLANK_INT_HACK(hexion_interrupt,3) /* both IRQ and NMI are used */ | |
| 288 | 288 | |
| 289 | 289 | /* video hardware */ |
| 290 | 290 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 84 | 84 | for (i = 0;i < 8;i++) |
| 85 | 85 | if (data & (1 << i)) code |= 0x80 >> i; |
| 86 | 86 | |
| 87 | soundlatch_w(offset,code); | |
| 88 | if (sndnmi_enable) cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 87 | soundlatch_w(machine,offset,code); | |
| 88 | if (sndnmi_enable) cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | static WRITE8_HANDLER( bking3_addr_l_w ) |
| r1877 | r1878 | |
| 444 | 444 | MDRV_CPU_ADD_TAG("main_cpu", Z80, XTAL_12MHz/4) /* 3 MHz */ |
| 445 | 445 | MDRV_CPU_PROGRAM_MAP(bking_map,0) |
| 446 | 446 | MDRV_CPU_IO_MAP(bking_io_map,0) |
| 447 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 447 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 448 | 448 | |
| 449 | 449 | MDRV_CPU_ADD(Z80, XTAL_6MHz/2) /* 3 MHz */ |
| 450 | 450 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 336 | 336 | /* basic machine hardware */ |
| 337 | 337 | MDRV_CPU_ADD(HD6309, 3000000*4) /* ? */ |
| 338 | 338 | MDRV_CPU_PROGRAM_MAP(battlnts_readmem,battlnts_writemem) |
| 339 | MDRV_CPU_VBLANK_INT(battlnts_interrupt | |
| 339 | MDRV_CPU_VBLANK_INT("main", battlnts_interrupt | |
| 340 | 340 | |
| 341 | 341 | MDRV_CPU_ADD(Z80, 3579545) |
| 342 | 342 | /* audio CPU */ /* ? */ |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "deprecat.h" | |
| 14 | 13 | #include "cpu/m68000/m68000.h" |
| 15 | 14 | #include "decocrpt.h" |
| 16 | 15 | #include "deco16ic.h" |
| r1877 | r1878 | |
| 50 | 49 | |
| 51 | 50 | |
| 52 | 51 | |
| 53 | static void draw_sprites(running_machine *machine, | |
| 52 | static void draw_sprites(running_machine *machine, | |
| 54 | 53 | { |
| 55 | 54 | int offs; |
| 56 | 55 | |
| r1877 | r1878 | |
| 63 | 62 | y = spriteram16[offs]; |
| 64 | 63 | flash=y&0x1000; |
| 65 | 64 | xsize = y&0x0800; |
| 66 | if (flash && ( | |
| 65 | if (flash && (vid | |
| 67 | 66 | |
| 68 | 67 | x = spriteram16[offs+2]; |
| 69 | 68 | colour = (x >>9) & 0x1f; |
| r1877 | r1878 | |
| 283 | 282 | if ((offset*2)==0x104) { dblwings_104_data = data; return; } // p1 inputs select screen OK |
| 284 | 283 | if ((offset*2)==0x200) { dblwings_200_data = data; return; } |
| 285 | 284 | if ((offset*2)==0x28c) { dblwings_28c_data = data; return; } |
| 286 | if ((offset*2)==0x380) { soundlatch_w(0,data&0xff); /*cpunum_set_input_line(Machine, 1,0,HOLD_LINE);*/ return; } // sound write | |
| 285 | if ((offset*2)==0x380) { soundlatch_w(machine,0,data&0xff); /*cpunum_set_input_line(Machine, 1,0,HOLD_LINE);*/ return; } // sound write | |
| 287 | 286 | if ((offset*2)==0x38e) { dblwings_38e_data = data; return; } |
| 288 | 287 | if ((offset*2)==0x406) { dblwings_406_data = data; return; } // p2 inputs select screen OK |
| 289 | 288 | if ((offset*2)==0x408) { dblwings_408_data = data; return; } // 3rd player 1st level? |
| r1877 | r1878 | |
| 543 | 542 | /* basic machine hardware */ |
| 544 | 543 | MDRV_CPU_ADD(M68000, 14000000) /* DE102 */ |
| 545 | 544 | MDRV_CPU_PROGRAM_MAP(dblewing_map,0) |
| 546 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 545 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 547 | 546 | |
| 548 | 547 | MDRV_CPU_ADD(Z80, 4000000) |
| 549 | 548 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 462 | 462 | /* basic machine hardware */ |
| 463 | 463 | MDRV_CPU_ADD(M68000, 16000000) /* 16MHz */ |
| 464 | 464 | MDRV_CPU_PROGRAM_MAP(galpani2_mem1, 0) |
| 465 | MDRV_CPU_VBLANK_INT(galpani2_interrupt,GALPANI2_INTERRUPTS_NUM) | |
| 465 | MDRV_CPU_VBLANK_INT_HACK(galpani2_interrupt,GALPANI2_INTERRUPTS_NUM) | |
| 466 | 466 | |
| 467 | 467 | MDRV_CPU_ADD(M68000, 16000000) /* 16MHz */ |
| 468 | 468 | MDRV_CPU_PROGRAM_MAP(galpani2_mem2, 0) |
| 469 | MDRV_CPU_VBLANK_INT(galpani2_interrupt2,GALPANI2_INTERRUPTS_NUM2) | |
| 469 | MDRV_CPU_VBLANK_INT_HACK(galpani2_interrupt2,GALPANI2_INTERRUPTS_NUM2) | |
| 470 | 470 | |
| 471 | 471 | MDRV_MACHINE_RESET(galpani2) |
| 472 | 472 | MDRV_NVRAM_HANDLER(93C46) |
| r1877 | r1878 | |
|---|---|---|
| 165 | 165 | /* error cases */ |
| 166 | 166 | default: |
| 167 | 167 | logerror("Input Port %04X read. PC=%04X\n", offset+0xd7f0, activecpu_get_pc()); |
| 168 | return 0; | |
| 169 | 168 | } |
| 170 | 169 | return 0; |
| 171 | 170 | } |
| r1877 | r1878 | |
| 353 | 352 | MDRV_CPU_ADD(Z80, MAIN_OSC/4) |
| 354 | 353 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 355 | 354 | MDRV_CPU_IO_MAP(main_io_map,0) |
| 356 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 355 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 357 | 356 | |
| 358 | 357 | /* video hardware */ |
| 359 | 358 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 241 | 241 | /* basic machine hardware */ |
| 242 | 242 | MDRV_CPU_ADD(HD6309, 3000000*4) /* 24MHz/8? */ |
| 243 | 243 | MDRV_CPU_PROGRAM_MAP(labyrunr_readmem,labyrunr_writemem) |
| 244 | MDRV_CPU_VBLANK_INT(labyrunr_interrupt,8) /* 1 IRQ + 4 NMI (generated by 007121) */ | |
| 244 | MDRV_CPU_VBLANK_INT_HACK(labyrunr_interrupt,8) /* 1 IRQ + 4 NMI (generated by 007121) */ | |
| 245 | 245 | |
| 246 | 246 | /* video hardware */ |
| 247 | 247 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 221 | 221 | |
| 222 | 222 | static WRITE8_HANDLER( shougi_watchdog_reset_w ) |
| 223 | 223 | { |
| 224 | watchdog_reset_w(0,data); | |
| 224 | watchdog_reset_w(machine,0,data); | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | static WRITE8_HANDLER( shougi_mcu_halt_off_w ) |
| r1877 | r1878 | |
| 357 | 357 | |
| 358 | 358 | MDRV_CPU_ADD(Z80,10000000/4) |
| 359 | 359 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 360 | MDRV_CPU_VBLANK_INT(shougi_vblank_nmi | |
| 360 | MDRV_CPU_VBLANK_INT("main", shougi_vblank_nmi | |
| 361 | 361 | |
| 362 | 362 | MDRV_CPU_ADD(Z80,10000000/4) |
| 363 | 363 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 367 | 367 | } |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | static void K037122_tile_draw(int chip, | |
| 370 | static void K037122_tile_draw(int chip, | |
| 371 | 371 | { |
| 372 | 372 | if (K037122_reg[chip][0xc] & 0x10000) |
| 373 | 373 | { |
| r1877 | r1878 | |
|---|---|---|
| 53 | 53 | static INTERRUPT_GEN( thief_interrupt ) |
| 54 | 54 | { |
| 55 | 55 | /* SLAM switch causes an NMI if it's pressed */ |
| 56 | if( (input_port_3_r(0) & 0x10) == 0 ) | |
| 56 | if( (input_port_3_r(machine,0) & 0x10) == 0 ) | |
| 57 | 57 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); |
| 58 | 58 | else |
| 59 | 59 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); |
| r1877 | r1878 | |
| 464 | 464 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz? */ |
| 465 | 465 | MDRV_CPU_PROGRAM_MAP(sharkatt_readmem,sharkatt_writemem) |
| 466 | 466 | MDRV_CPU_IO_MAP(io_map,0) |
| 467 | MDRV_CPU_VBLANK_INT(thief_interrupt | |
| 467 | MDRV_CPU_VBLANK_INT("main", thief_interrupt | |
| 468 | 468 | |
| 469 | 469 | /* video hardware */ |
| 470 | 470 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 500 | 500 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz? */ |
| 501 | 501 | MDRV_CPU_PROGRAM_MAP(thief_readmem,thief_writemem) |
| 502 | 502 | MDRV_CPU_IO_MAP(io_map,0) |
| 503 | MDRV_CPU_VBLANK_INT(thief_interrupt | |
| 503 | MDRV_CPU_VBLANK_INT("main", thief_interrupt | |
| 504 | 504 | |
| 505 | 505 | /* video hardware */ |
| 506 | 506 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 536 | 536 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz? */ |
| 537 | 537 | MDRV_CPU_PROGRAM_MAP(thief_readmem,thief_writemem) |
| 538 | 538 | MDRV_CPU_IO_MAP(io_map,0) |
| 539 | MDRV_CPU_VBLANK_INT(thief_interrupt | |
| 539 | MDRV_CPU_VBLANK_INT("main", thief_interrupt | |
| 540 | 540 | |
| 541 | 541 | /* video hardware */ |
| 542 | 542 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 155 | 155 | memory_set_bank(1, data & 0x7); |
| 156 | 156 | |
| 157 | 157 | /* map to the fromance gfx register */ |
| 158 | fromance_gfxreg_w(offset, ((data >> 6) & 0x01) | /* flipscreen */ | |
| 158 | fromance_gfxreg_w(machine, offset, ((data >> 6) & 0x01) | /* flipscreen */ | |
| 159 | 159 | ((~data >> 2) & 0x02)); /* videoram select */ |
| 160 | 160 | } |
| 161 | 161 | |
| r1877 | r1878 | |
| 559 | 559 | MDRV_CPU_ADD(Z80,12000000/2) |
| 560 | 560 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 561 | 561 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 562 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 562 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 563 | 563 | |
| 564 | 564 | MDRV_CPU_ADD(Z80,14318000/4) |
| 565 | 565 | /* audio CPU */ |
| r1877 | r1878 | |
| 599 | 599 | MDRV_CPU_ADD(Z80,12000000/2) |
| 600 | 600 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 601 | 601 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 602 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 602 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 603 | 603 | |
| 604 | 604 | MDRV_CPU_ADD(Z80,14318000/4) |
| 605 | 605 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 64 | 64 | break; |
| 65 | 65 | |
| 66 | 66 | case 1: /* soundlatch_w */ |
| 67 | soundlatch_w(1,reg[1]&0xff); | |
| 68 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 67 | soundlatch_w(machine,1,reg[1]&0xff); | |
| 68 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 69 | 69 | break; |
| 70 | 70 | |
| 71 | 71 | case 2: |
| r1877 | r1878 | |
| 505 | 505 | /* basic machine hardware */ |
| 506 | 506 | MDRV_CPU_ADD_TAG("main", M68000, 12000000) // Guess |
| 507 | 507 | MDRV_CPU_PROGRAM_MAP(readmem, writemem) |
| 508 | MDRV_CPU_VBLANK_INT(ddragon3_cpu_interrupt, 2) | |
| 508 | MDRV_CPU_VBLANK_INT_HACK(ddragon3_cpu_interrupt, 2) | |
| 509 | 509 | |
| 510 | 510 | MDRV_CPU_ADD_TAG("audio", Z80, 3579545) // Guess |
| 511 | 511 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | discrete_sound_w(SPRINT2_MOTORSND1_DATA, sprint2_video_ram[0x394] & 15); // also DOMINOS_FREQ_DATA | |
| 107 | discrete_sound_w(SPRINT2_MOTORSND2_DATA, sprint2_video_ram[0x395] & 15); | |
| 108 | discrete_sound_w(SPRINT2_CRASHSND_DATA, sprint2_video_ram[0x396] & 15); // also DOMINOS_AMP_DATA | |
| 106 | discrete_sound_w(machine, SPRINT2_MOTORSND1_DATA, sprint2_video_ram[0x394] & 15); // also DOMINOS_FREQ_DATA | |
| 107 | discrete_sound_w(machine, SPRINT2_MOTORSND2_DATA, sprint2_video_ram[0x395] & 15); | |
| 108 | discrete_sound_w(machine, SPRINT2_CRASHSND_DATA, sprint2_video_ram[0x396] & 15); // also DOMINOS_AMP_DATA | |
| 109 | 109 | |
| 110 | 110 | /* interrupts and watchdog are disabled during service mode */ |
| 111 | 111 | |
| r1877 | r1878 | |
| 217 | 217 | attract = offset & 1; |
| 218 | 218 | |
| 219 | 219 | // also DOMINOS_ATTRACT_EN |
| 220 | discrete_sound_w(SPRINT2_ATTRACT_EN, attract); | |
| 220 | discrete_sound_w(machine, SPRINT2_ATTRACT_EN, attract); | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | |
| 224 | 224 | static WRITE8_HANDLER( sprint2_noise_reset_w ) |
| 225 | 225 | { |
| 226 | discrete_sound_w(SPRINT2_NOISE_RESET, 0); | |
| 226 | discrete_sound_w(machine, SPRINT2_NOISE_RESET, 0); | |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | |
| 230 | 230 | static WRITE8_HANDLER( sprint2_skid1_w ) |
| 231 | 231 | { |
| 232 | 232 | // also DOMINOS_TUMBLE_EN |
| 233 | discrete_sound_w(SPRINT2_SKIDSND1_EN, offset & 1); | |
| 233 | discrete_sound_w(machine, SPRINT2_SKIDSND1_EN, offset & 1); | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | static WRITE8_HANDLER( sprint2_skid2_w ) |
| 237 | 237 | { |
| 238 | discrete_sound_w(SPRINT2_SKIDSND2_EN, offset & 1); | |
| 238 | discrete_sound_w(machine, SPRINT2_SKIDSND2_EN, offset & 1); | |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | |
| r1877 | r1878 | |
| 508 | 508 | /* basic machine hardware */ |
| 509 | 509 | MDRV_CPU_ADD(M6502, 12096000 / 16) |
| 510 | 510 | MDRV_CPU_PROGRAM_MAP(readmem, writemem) |
| 511 | MDRV_CPU_VBLANK_INT(sprint2 | |
| 511 | MDRV_CPU_VBLANK_INT("main", sprint2 | |
| 512 | 512 | MDRV_WATCHDOG_VBLANK_INIT(8) |
| 513 | 513 | |
| 514 | 514 | /* video hardware */ |
| r1877 | r1878 | |
|---|---|---|
| 135 | 135 | * |
| 136 | 136 | *************************************/ |
| 137 | 137 | |
| 138 | static UINT16 exterm_trackball_port_r(int which, UINT16 mem_mask) | |
| 138 | static UINT16 exterm_trackball_port_r(running_machine *machine, int which, UINT16 mem_mask) | |
| 139 | 139 | { |
| 140 | 140 | UINT16 port; |
| 141 | 141 | |
| r1877 | r1878 | |
| 156 | 156 | aimpos[which] = (aimpos[which] + trackball_diff) & 0x3f; |
| 157 | 157 | |
| 158 | 158 | /* Combine it with the standard input bits */ |
| 159 | port = which ? input_port_1_word_r(0, mem_mask) : | |
| 160 | input_port_0_word_r(0, mem_mask); | |
| 159 | port = which ? input_port_1_word_r(machine, 0, mem_mask) : | |
| 160 | input_port_0_word_r(machine, 0, mem_mask); | |
| 161 | 161 | |
| 162 | 162 | return (port & 0xc0ff) | (aimpos[which] << 8); |
| 163 | 163 | } |
| r1877 | r1878 | |
| 165 | 165 | |
| 166 | 166 | static READ16_HANDLER( exterm_input_port_0_r ) |
| 167 | 167 | { |
| 168 | return exterm_trackball_port_r(0, mem_mask); | |
| 168 | return exterm_trackball_port_r(machine, 0, mem_mask); | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | |
| 172 | 172 | static READ16_HANDLER( exterm_input_port_1_r ) |
| 173 | 173 | { |
| 174 | return exterm_trackball_port_r(1, mem_mask); | |
| 174 | return exterm_trackball_port_r(machine, 1, mem_mask); | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | |
| r1877 | r1878 | |
| 246 | 246 | { |
| 247 | 247 | /* bit 7 of the sound control selects which port */ |
| 248 | 248 | if (sound_control & 0x80) |
| 249 | YM2151_data_port_0_w(offset, data); | |
| 249 | YM2151_data_port_0_w(machine, offset, data); | |
| 250 | 250 | else |
| 251 | YM2151_register_port_0_w(offset, data); | |
| 251 | YM2151_register_port_0_w(machine, offset, data); | |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "deprecat.h" | |
| 8 | 9 | #include "dragrace.h" |
| 9 | 10 | #include "sound/discrete.h" |
| 10 | 11 | |
| r1877 | r1878 | |
| 39 | 40 | timer_pulse(video_screen_get_frame_period(0), NULL, 0, dragrace_frame_callback); |
| 40 | 41 | } |
| 41 | 42 | |
| 42 | static void dragrace_update_misc_flags( | |
| 43 | static void dragrace_update_misc_flags(running_machine *machine) | |
| 43 | 44 | { |
| 44 | 45 | /* 0x0900 = set 3SPEED1 0x00000001 |
| 45 | 46 | * 0x0901 = set 4SPEED1 0x00000002 |
| r1877 | r1878 | |
| 75 | 76 | set_led_status(0, dragrace_misc_flags & 0x00008000); |
| 76 | 77 | set_led_status(1, dragrace_misc_flags & 0x80000000); |
| 77 | 78 | |
| 78 | discrete_sound_w(DRAGRACE_MOTOR1_DATA, ~dragrace_misc_flags & 0x0000001f); // Speed1 data* | |
| 79 | discrete_sound_w(DRAGRACE_EXPLODE1_EN, (dragrace_misc_flags & 0x00000020) ? 1: 0); // Explosion1 enable | |
| 80 | discrete_sound_w(DRAGRACE_SCREECH1_EN, (dragrace_misc_flags & 0x00000040) ? 1: 0); // Screech1 enable | |
| 81 | discrete_sound_w(DRAGRACE_KLEXPL1_EN, (dragrace_misc_flags & 0x00000200) ? 1: 0); // KLEXPL1 enable | |
| 82 | discrete_sound_w(DRAGRACE_MOTOR1_EN, (dragrace_misc_flags & 0x00000800) ? 1: 0); // Motor1 enable | |
| 79 | discrete_sound_w(machine, DRAGRACE_MOTOR1_DATA, ~dragrace_misc_flags & 0x0000001f); // Speed1 data* | |
| 80 | discrete_sound_w(machine, DRAGRACE_EXPLODE1_EN, (dragrace_misc_flags & 0x00000020) ? 1: 0); // Explosion1 enable | |
| 81 | discrete_sound_w(machine, DRAGRACE_SCREECH1_EN, (dragrace_misc_flags & 0x00000040) ? 1: 0); // Screech1 enable | |
| 82 | discrete_sound_w(machine, DRAGRACE_KLEXPL1_EN, (dragrace_misc_flags & 0x00000200) ? 1: 0); // KLEXPL1 enable | |
| 83 | discrete_sound_w(machine, DRAGRACE_MOTOR1_EN, (dragrace_misc_flags & 0x00000800) ? 1: 0); // Motor1 enable | |
| 83 | 84 | |
| 84 | discrete_sound_w(DRAGRACE_MOTOR2_DATA, (~dragrace_misc_flags & 0x001f0000) >> 0x10); // Speed2 data* | |
| 85 | discrete_sound_w(DRAGRACE_EXPLODE2_EN, (dragrace_misc_flags & 0x00200000) ? 1: 0); // Explosion2 enable | |
| 86 | discrete_sound_w(DRAGRACE_SCREECH2_EN, (dragrace_misc_flags & 0x00400000) ? 1: 0); // Screech2 enable | |
| 87 | discrete_sound_w(DRAGRACE_KLEXPL2_EN, (dragrace_misc_flags & 0x02000000) ? 1: 0); // KLEXPL2 enable | |
| 88 | discrete_sound_w(DRAGRACE_MOTOR2_EN, (dragrace_misc_flags & 0x08000000) ? 1: 0); // Motor2 enable | |
| 85 | discrete_sound_w(machine, DRAGRACE_MOTOR2_DATA, (~dragrace_misc_flags & 0x001f0000) >> 0x10); // Speed2 data* | |
| 86 | discrete_sound_w(machine, DRAGRACE_EXPLODE2_EN, (dragrace_misc_flags & 0x00200000) ? 1: 0); // Explosion2 enable | |
| 87 | discrete_sound_w(machine, DRAGRACE_SCREECH2_EN, (dragrace_misc_flags & 0x00400000) ? 1: 0); // Screech2 enable | |
| 88 | discrete_sound_w(machine, DRAGRACE_KLEXPL2_EN, (dragrace_misc_flags & 0x02000000) ? 1: 0); // KLEXPL2 enable | |
| 89 | discrete_sound_w(machine, DRAGRACE_MOTOR2_EN, (dragrace_misc_flags & 0x08000000) ? 1: 0); // Motor2 enable | |
| 89 | 90 | |
| 90 | discrete_sound_w(DRAGRACE_ATTRACT_EN, (dragrace_misc_flags & 0x00001000) ? 1: 0); // Attract enable | |
| 91 | discrete_sound_w(DRAGRACE_LOTONE_EN, (dragrace_misc_flags & 0x00002000) ? 1: 0); // LoTone enable | |
| 92 | discrete_sound_w(DRAGRACE_HITONE_EN, (dragrace_misc_flags & 0x20000000) ? 1: 0); // HiTone enable | |
| 91 | discrete_sound_w(machine, DRAGRACE_ATTRACT_EN, (dragrace_misc_flags & 0x00001000) ? 1: 0); // Attract enable | |
| 92 | discrete_sound_w(machine, DRAGRACE_LOTONE_EN, (dragrace_misc_flags & 0x00002000) ? 1: 0); // LoTone enable | |
| 93 | discrete_sound_w(machine, DRAGRACE_HITONE_EN, (dragrace_misc_flags & 0x20000000) ? 1: 0); // HiTone enable | |
| 93 | 94 | } |
| 94 | 95 | |
| 95 | 96 | static WRITE8_HANDLER( dragrace_misc_w ) |
| r1877 | r1878 | |
| 101 | 102 | else |
| 102 | 103 | dragrace_misc_flags &= (~mask); |
| 103 | 104 | logerror("Set %#6x, Mask=%#10x, Flag=%#10x, Data=%x\n", 0x0900+offset, mask, dragrace_misc_flags, data & 0x01); |
| 104 | dragrace_update_misc_flags(); | |
| 105 | } | |
| 105 | dragrace_update_misc_flags(machine); | |
| 106 | } | |
| 106 | 107 | |
| 107 | 108 | static WRITE8_HANDLER( dragrace_misc_clear_w ) |
| 108 | 109 | { |
| r1877 | r1878 | |
| 110 | 111 | UINT32 mask = 0xff << (((offset >> 3) & 0x03) * 8); |
| 111 | 112 | dragrace_misc_flags &= (~mask); |
| 112 | 113 | logerror("Clear %#6x, Mask=%#10x, Flag=%#10x, Data=%x\n", 0x0920+offset, mask, dragrace_misc_flags, data & 0x01); |
| 113 | dragrace_update_misc_flags(); | |
| 114 | dragrace_update_misc_flags(machine); | |
| 114 | 115 | } |
| 115 | 116 | |
| 116 | 117 | static READ8_HANDLER( dragrace_input_r ) |
| r1877 | r1878 | |
| 326 | 327 | /* basic machine hardware */ |
| 327 | 328 | MDRV_CPU_ADD(M6800, 12096000 / 12) |
| 328 | 329 | MDRV_CPU_PROGRAM_MAP(dragrace_readmem, dragrace_writemem) |
| 329 | MDRV_CPU_VBLANK_INT(irq0_line_hold, 4) | |
| 330 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 4) | |
| 330 | 331 | MDRV_WATCHDOG_VBLANK_INIT(8) |
| 331 | 332 | |
| 332 | 333 | MDRV_MACHINE_RESET(dragrace) |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | { |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | static void draw_sprites(running_machine *machine, | |
| 57 | static void draw_sprites(running_machine *machine, | |
| 58 | 58 | { |
| 59 | 59 | int flipscreen = 0; |
| 60 | 60 | int offs,sx,sy; |
| r1877 | r1878 | |
| 203 | 203 | { |
| 204 | 204 | // printf("unk discoboy_port_03_w %02x\n",data); |
| 205 | 205 | // cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,HOLD_LINE); |
| 206 | soundlatch_w(0,data); | |
| 207 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 206 | soundlatch_w(machine,0,data); | |
| 207 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | static WRITE8_HANDLER( discoboy_port_06_w ) |
| r1877 | r1878 | |
| 477 | 477 | MDRV_CPU_ADD(Z80,12000000/2) /* 6 MHz? */ |
| 478 | 478 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 479 | 479 | MDRV_CPU_IO_MAP(readport,writeport) |
| 480 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 480 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 481 | 481 | |
| 482 | 482 | MDRV_CPU_ADD(Z80,10000000/2) /* 5 MHz? */ |
| 483 | 483 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 484 | 484 | MDRV_CPU_IO_MAP(sound_readport,sound_writeport) |
| 485 | // MDRV_CPU_VBLANK_INT(irq0_line_hold,1) | |
| 486 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,32) | |
| 485 | // MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 486 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,32) | |
| 487 | 487 | |
| 488 | 488 | /* video hardware */ |
| 489 | 489 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | static void draw_char(running_machine *machine, | |
| 172 | static void draw_char(running_machine *machine, | |
| 173 | 173 | { |
| 174 | 174 | int i,j; |
| 175 | 175 | UINT8 *dp; |
| r1877 | r1878 | |
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | static void draw_framebuffer(running_machine *machine, | |
| 196 | static void draw_framebuffer(running_machine *machine, | |
| 197 | 197 | { |
| 198 | 198 | int i, j; |
| 199 | 199 | int width, height; |
| r1877 | r1878 | |
| 284 | 284 | } |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | static void draw_cga(running_machine *machine, | |
| 287 | static void draw_cga(running_machine *machine, | |
| 288 | 288 | { |
| 289 | 289 | int i, j; |
| 290 | 290 | const gfx_element *gfx = machine->gfx[0]; |
| r1877 | r1878 | |
| 352 | 352 | |
| 353 | 353 | static READ8_HANDLER(at_dma8237_1_r) |
| 354 | 354 | { |
| 355 | return dma8237_1_r(offset / 2); | |
| 355 | return dma8237_1_r(machine, offset / 2); | |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | static WRITE8_HANDLER(at_dma8237_1_w) |
| 359 | 359 | { |
| 360 | dma8237_1_w(offset / 2, data); | |
| 360 | dma8237_1_w(machine, offset / 2, data); | |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | static READ32_HANDLER(at32_dma8237_1_r) |
| 364 | 364 | { |
| 365 | return read32le_with_read8_handler(at_dma8237_1_r, offset, mem_mask); | |
| 365 | return read32le_with_read8_handler(at_dma8237_1_r, machine, offset, mem_mask); | |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | static WRITE32_HANDLER(at32_dma8237_1_w) |
| 369 | 369 | { |
| 370 | write32le_with_write8_handler(at_dma8237_1_w, offset, data, mem_mask); | |
| 370 | write32le_with_write8_handler(at_dma8237_1_w, machine, offset, data, mem_mask); | |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | |
| 374 | 374 | |
| 375 | 375 | static READ32_HANDLER( ide0_r ) |
| 376 | 376 | { |
| 377 | return ide_controller32_0_r(0x1f0/4 + offset, mem_mask); | |
| 377 | return ide_controller32_0_r(machine, 0x1f0/4 + offset, mem_mask); | |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | static WRITE32_HANDLER( ide0_w ) |
| 381 | 381 | { |
| 382 | ide_controller32_0_w(0x1f0/4 + offset, data, mem_mask); | |
| 382 | ide_controller32_0_w(machine, 0x1f0/4 + offset, data, mem_mask); | |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | static READ32_HANDLER( fdc_r ) |
| 386 | 386 | { |
| 387 | return ide_controller32_0_r(0x3f0/4 + offset, mem_mask); | |
| 387 | return ide_controller32_0_r(machine, 0x3f0/4 + offset, mem_mask); | |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | static WRITE32_HANDLER( fdc_w ) |
| 391 | 391 | { |
| 392 | ide_controller32_0_w(0x3f0/4 + offset, data, mem_mask); | |
| 392 | ide_controller32_0_w(machine, 0x3f0/4 + offset, data, mem_mask); | |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | |
| r1877 | r1878 | |
| 469 | 469 | // 0x20 - 0x21, PIC |
| 470 | 470 | if ((mem_mask & 0x0000ffff) != 0xffff) |
| 471 | 471 | { |
| 472 | r |= pic8259_32le_0_r(offset, mem_mask); | |
| 472 | r |= pic8259_32le_0_r(machine, offset, mem_mask); | |
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | // 0x22, 0x23, Cyrix configuration registers |
| r1877 | r1878 | |
| 489 | 489 | // 0x20 - 0x21, PIC |
| 490 | 490 | if ((mem_mask & 0x0000ffff) != 0xffff) |
| 491 | 491 | { |
| 492 | pic8259_32le_0_w(offset, data, mem_mask); | |
| 492 | pic8259_32le_0_w(machine, offset, data, mem_mask); | |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | // 0x22, 0x23, Cyrix configuration registers |
| r1877 | r1878 | |
| 976 | 976 | static READ32_HANDLER( speedup10_r ) { return generic_speedup(&speedup_table[10]); } |
| 977 | 977 | static READ32_HANDLER( speedup11_r ) { return generic_speedup(&speedup_table[11]); } |
| 978 | 978 | |
| 979 | static const read32_ | |
| 979 | static const read32_machin | |
| 980 | 980 | { |
| 981 | 981 | speedup0_r, speedup1_r, speedup2_r, speedup3_r, |
| 982 | 982 | speedup4_r, speedup5_r, speedup6_r, speedup7_r, |
| r1877 | r1878 | |
|---|---|---|
| 176 | 176 | MDRV_CPU_ADD(Z80, 4000000) /* 4.00 MHz??? */ |
| 177 | 177 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 178 | 178 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 179 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 179 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 180 | 180 | |
| 181 | 181 | /* video hardware */ |
| 182 | 182 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |
| 37 | static void update_misc_flags(UINT8 val) | |
| 37 | static void update_misc_flags(running_machine *machine, UINT8 val) | |
| 38 | 38 | { |
| 39 | 39 | orbit_misc_flags = val; |
| 40 | 40 | |
| r1877 | r1878 | |
| 48 | 48 | /* BIT7 => WARNING SND */ |
| 49 | 49 | |
| 50 | 50 | orbit_nmi_enable = (orbit_misc_flags >> 2) & 1; |
| 51 | discrete_sound_w(ORBIT_WARNING_EN, orbit_misc_flags & 0x80); | |
| 51 | discrete_sound_w(machine, ORBIT_WARNING_EN, orbit_misc_flags & 0x80); | |
| 52 | 52 | |
| 53 | 53 | set_led_status(0, orbit_misc_flags & 0x08); |
| 54 | 54 | set_led_status(1, orbit_misc_flags & 0x40); |
| r1877 | r1878 | |
| 60 | 60 | |
| 61 | 61 | static MACHINE_RESET( orbit ) |
| 62 | 62 | { |
| 63 | update_misc_flags(0); | |
| 63 | update_misc_flags(machine, 0); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| r1877 | r1878 | |
| 70 | 70 | |
| 71 | 71 | if (offset & 1) |
| 72 | 72 | { |
| 73 | update_misc_flags(orbit_misc_flags | (1 << bit)); | |
| 73 | update_misc_flags(machine, orbit_misc_flags | (1 << bit)); | |
| 74 | 74 | } |
| 75 | 75 | else |
| 76 | 76 | { |
| 77 | update_misc_flags(orbit_misc_flags & ~(1 << bit)); | |
| 77 | update_misc_flags(machine, orbit_misc_flags & ~(1 << bit)); | |
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | |
| r1877 | r1878 | |
| 264 | 264 | /* basic machine hardware */ |
| 265 | 265 | MDRV_CPU_ADD(M6800, 12096000 / 16) |
| 266 | 266 | MDRV_CPU_PROGRAM_MAP(orbit_map, 0) |
| 267 | MDRV_CPU_VBLANK_INT(irq0_line_pulse | |
| 267 | MDRV_CPU_VBLANK_INT("main", irq0_line_pulse | |
| 268 | 268 | MDRV_CPU_PERIODIC_INT(orbit_interrupt, 240) |
| 269 | 269 | |
| 270 | 270 | MDRV_MACHINE_RESET(orbit) |
| r1877 | r1878 | |
|---|---|---|
| 188 | 188 | /* toggling BSMT off then on causes a reset */ |
| 189 | 189 | if (!(old & 0x80000000) && (control_data & 0x80000000)) |
| 190 | 190 | { |
| 191 | BSMT2000_data_0_w(bsmt_data_bank, 0, 0); | |
| 191 | BSMT2000_data_0_w(machine, bsmt_data_bank, 0, 0); | |
| 192 | 192 | sndti_reset(SOUND_BSMT2000, 0); |
| 193 | 193 | } |
| 194 | 194 | |
| r1877 | r1878 | |
| 208 | 208 | static WRITE32_HANDLER( bsmt2000_reg_w ) |
| 209 | 209 | { |
| 210 | 210 | if (control_data & 0x80000000) |
| 211 | BSMT2000_data_0_w(bsmt_reg, data & 0xffff, mem_mask | 0xffff0000); | |
| 211 | BSMT2000_data_0_w(machine, bsmt_reg, data & 0xffff, mem_mask | 0xffff0000); | |
| 212 | 212 | else |
| 213 | 213 | COMBINE_DATA(&bsmt_data_offset); |
| 214 | 214 | } |
| r1877 | r1878 | |
| 466 | 466 | MDRV_CPU_ADD_TAG("main", R3000BE, MASTER_CLOCK/2) |
| 467 | 467 | MDRV_CPU_CONFIG(config) |
| 468 | 468 | MDRV_CPU_PROGRAM_MAP(policetr_map,0) |
| 469 | MDRV_CPU_VBLANK_INT(irq4_gen | |
| 469 | MDRV_CPU_VBLANK_INT("main", irq4_gen | |
| 470 | 470 | |
| 471 | 471 | MDRV_NVRAM_HANDLER(policetr) |
| 472 | 472 |
| r1877 | r1878 | |
|---|---|---|
| 853 | 853 | static WRITE32_HANDLER( ds2404_reset_w ) |
| 854 | 854 | { |
| 855 | 855 | if( ACCESSING_LSB32 ) { |
| 856 | DS2404_1W_reset_w(offset, data); | |
| 856 | DS2404_1W_reset_w(machine, offset, data); | |
| 857 | 857 | } |
| 858 | 858 | } |
| 859 | 859 | |
| 860 | 860 | static READ32_HANDLER( ds2404_data_r ) |
| 861 | 861 | { |
| 862 | 862 | if( ACCESSING_LSB32 ) { |
| 863 | return DS2404_data_r(offset); | |
| 863 | return DS2404_data_r(machine, offset); | |
| 864 | 864 | } |
| 865 | 865 | return 0; |
| 866 | 866 | } |
| r1877 | r1878 | |
| 868 | 868 | static WRITE32_HANDLER( ds2404_data_w ) |
| 869 | 869 | { |
| 870 | 870 | if( ACCESSING_LSB32 ) { |
| 871 | DS2404_data_w(offset, data); | |
| 871 | DS2404_data_w(machine, offset, data); | |
| 872 | 872 | } |
| 873 | 873 | } |
| 874 | 874 | |
| 875 | 875 | static WRITE32_HANDLER( ds2404_clk_w ) |
| 876 | 876 | { |
| 877 | 877 | if( ACCESSING_LSB32 ) { |
| 878 | DS2404_clk_w(offset, data); | |
| 878 | DS2404_clk_w(machine, offset, data); | |
| 879 | 879 | } |
| 880 | 880 | } |
| 881 | 881 | |
| r1877 | r1878 | |
| 938 | 938 | |
| 939 | 939 | static READ32_HANDLER( spi_6295_0_r ) |
| 940 | 940 | { |
| 941 | return OKIM6295_status_0_r(0); | |
| 941 | return OKIM6295_status_0_r(machine, 0); | |
| 942 | 942 | } |
| 943 | 943 | |
| 944 | 944 | static READ32_HANDLER( spi_6295_1_r ) |
| 945 | 945 | { |
| 946 | return OKIM6295_status_1_r(0); | |
| 946 | return OKIM6295_status_1_r(machine, 0); | |
| 947 | 947 | } |
| 948 | 948 | |
| 949 | 949 | static WRITE32_HANDLER( spi_6295_0_w ) |
| 950 | 950 | { |
| 951 | 951 | if( ACCESSING_LSB32 ) { |
| 952 | OKIM6295_data_0_w(0, data & 0xff); | |
| 952 | OKIM6295_data_0_w(machine, 0, data & 0xff); | |
| 953 | 953 | } |
| 954 | 954 | } |
| 955 | 955 | |
| 956 | 956 | static WRITE32_HANDLER( spi_6295_1_w ) |
| 957 | 957 | { |
| 958 | 958 | if( ACCESSING_LSB32 ) { |
| 959 | OKIM6295_data_1_w(0, data & 0xff); | |
| 959 | OKIM6295_data_1_w(machine, 0, data & 0xff); | |
| 960 | 960 | } |
| 961 | 961 | } |
| 962 | 962 | |
| r1877 | r1878 | |
| 1780 | 1780 | /* basic machine hardware */ |
| 1781 | 1781 | MDRV_CPU_ADD_TAG("main",I386, 50000000/2) /* Intel 386DX, 25MHz */ |
| 1782 | 1782 | MDRV_CPU_PROGRAM_MAP(spi_map, 0) |
| 1783 | MDRV_CPU_VBLANK_INT(spi_interrupt | |
| 1783 | MDRV_CPU_VBLANK_INT("main", spi_interrupt | |
| 1784 | 1784 | |
| 1785 | 1785 | MDRV_CPU_ADD_TAG("sound", Z80, 28636360/4) |
| 1786 | 1786 | /* audio CPU */ |
| r1877 | r1878 | |
| 2099 | 2099 | /* basic machine hardware */ |
| 2100 | 2100 | MDRV_CPU_ADD(I386, 40000000) /* AMD 386DX, 40MHz */ |
| 2101 | 2101 | MDRV_CPU_PROGRAM_MAP(seibu386_map, 0) |
| 2102 | MDRV_CPU_VBLANK_INT(spi_interrupt | |
| 2102 | MDRV_CPU_VBLANK_INT("main", spi_interrupt | |
| 2103 | 2103 | |
| 2104 | 2104 | MDRV_NVRAM_HANDLER(sxx2f) |
| 2105 | 2105 | MDRV_MACHINE_RESET(seibu386) |
| r1877 | r1878 | |
|---|---|---|
| 76 | 76 | * |
| 77 | 77 | *************************************/ |
| 78 | 78 | |
| 79 | static void amerdart_scanline(running_machine *machine, int screen, | |
| 79 | static void amerdart_scanline(running_machine *machine, int screen, | |
| 80 | 80 | { |
| 81 | 81 | UINT16 *vram = &vram_base[(params->rowaddr << 8) & 0xff00]; |
| 82 | 82 | UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0); |
| r1877 | r1878 | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | |
| 106 | static void coolpool_scanline(running_machine *machine, int screen, | |
| 106 | static void coolpool_scanline(running_machine *machine, int screen, | |
| 107 | 107 | { |
| 108 | 108 | UINT16 *vram = &vram_base[(params->rowaddr << 8) & 0x1ff00]; |
| 109 | 109 | UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0); |
| r1877 | r1878 | |
| 202 | 202 | |
| 203 | 203 | static WRITE16_HANDLER( nvram_thrash_data_w ) |
| 204 | 204 | { |
| 205 | nvram_data_w(offset, data, mem_mask); | |
| 206 | nvram_thrash_w(offset, data, mem_mask); | |
| 205 | nvram_data_w(machine, offset, data, mem_mask); | |
| 206 | nvram_thrash_w(machine, offset, data, mem_mask); | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 |
| r1877 | r1878 | |
|---|---|---|
| 326 | 326 | tilemap_set_scroll_rows(mhigh_tilemap, 256); |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | static void draw_sprites(running_machine *machine, | |
| 329 | static void draw_sprites(running_machine *machine, | |
| 330 | 330 | { |
| 331 | 331 | const UINT16 *source = sprites_buffer+0x800-4; |
| 332 | 332 | const UINT16 *finish = sprites_buffer; |
| r1877 | r1878 | |
| 453 | 453 | static MACHINE_DRIVER_START( mwarr ) |
| 454 | 454 | MDRV_CPU_ADD(M68000, 12000000) |
| 455 | 455 | MDRV_CPU_PROGRAM_MAP(mwarr_map,0) |
| 456 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 456 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 457 | 457 | |
| 458 | 458 | MDRV_GFXDECODE(mwarr) |
| 459 | 459 |
| r1877 | r1878 | |
|---|---|---|
| 103 | 103 | static WRITE8_HANDLER( sauro_sound_command_w ) |
| 104 | 104 | { |
| 105 | 105 | data |= 0x80; |
| 106 | soundlatch_w(offset, data); | |
| 106 | soundlatch_w(machine, offset, data); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | static READ8_HANDLER( sauro_sound_command_r ) |
| 110 | 110 | { |
| 111 | int ret = soundlatch_r(offset); | |
| 112 | soundlatch_clear_w(offset, 0); | |
| 111 | int ret = soundlatch_r(machine, offset); | |
| 112 | soundlatch_clear_w(machine, offset, 0); | |
| 113 | 113 | return ret; |
| 114 | 114 | } |
| 115 | 115 | |
| r1877 | r1878 | |
| 132 | 132 | |
| 133 | 133 | static WRITE8_HANDLER( adpcm_w ) |
| 134 | 134 | { |
| 135 | sp0256_ALD_w(0, data); | |
| 135 | sp0256_ALD_w(machine, 0, data); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | static void lrq_callback(int state) |
| r1877 | r1878 | |
| 363 | 363 | static MACHINE_DRIVER_START( tecfri ) |
| 364 | 364 | /* basic machine hardware */ |
| 365 | 365 | MDRV_CPU_ADD_TAG("main", Z80, 4000000) // 4 MHz??? |
| 366 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 366 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 367 | 367 | |
| 368 | 368 | /* video hardware */ |
| 369 | 369 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 406 | 406 | MDRV_CPU_ADD(Z80, 4000000) // 4 MHz? |
| 407 | 407 | /* audio CPU */ |
| 408 | 408 | MDRV_CPU_PROGRAM_MAP(sauro_sound_readmem, sauro_sound_writemem) |
| 409 | MDRV_CPU_VBLANK_INT(sauro_interrupt, 8) // ? | |
| 409 | MDRV_CPU_VBLANK_INT_HACK(sauro_interrupt, 8) // ? | |
| 410 | 410 | |
| 411 | 411 | MDRV_GFXDECODE(sauro) |
| 412 | 412 |
| r1877 | r1878 | |
|---|---|---|
| 264 | 264 | static WRITE8_HANDLER( gaplus_snd_sharedram_w ) |
| 265 | 265 | { |
| 266 | 266 | if (offset < 0x40) |
| 267 | namco_15xx_w(offset,data); | |
| 267 | namco_15xx_w(machine,offset,data); | |
| 268 | 268 | else |
| 269 | 269 | namco_soundregs[offset] = data; |
| 270 | 270 | } |
| r1877 | r1878 | |
| 758 | 758 | /* basic machine hardware */ |
| 759 | 759 | MDRV_CPU_ADD(M6809, 24576000/16) /* 1.536 MHz */ |
| 760 | 760 | MDRV_CPU_PROGRAM_MAP(readmem_cpu1,writemem_cpu1) |
| 761 | MDRV_CPU_VBLANK_INT(gaplus_interrupt_ | |
| 761 | MDRV_CPU_VBLANK_INT("main", gaplus_interrupt_ | |
| 762 | 762 | |
| 763 | 763 | MDRV_CPU_ADD(M6809, 24576000/16) /* 1.536 MHz */ |
| 764 | 764 | MDRV_CPU_PROGRAM_MAP(readmem_cpu2,writemem_cpu2) |
| 765 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 765 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 766 | 766 | |
| 767 | 767 | MDRV_CPU_ADD(M6809, 24576000/16) /* 1.536 MHz */ |
| 768 | 768 | MDRV_CPU_PROGRAM_MAP(readmem_cpu3,writemem_cpu3) |
| 769 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 769 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 770 | 770 | |
| 771 | 771 | MDRV_INTERLEAVE(100) /* a high value to ensure proper synchronization of the CPUs */ |
| 772 | 772 | MDRV_MACHINE_RESET(gaplus) |
| r1877 | r1878 | |
|---|---|---|
| 238 | 238 | /* basic machine hardware */ |
| 239 | 239 | MDRV_CPU_ADD(M6502,11289000/12) /* 940.75 kHz */ |
| 240 | 240 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 241 | MDRV_CPU_VBLANK_INT(carpolo_timer_interrupt | |
| 241 | MDRV_CPU_VBLANK_INT("main", carpolo_timer_interrupt | |
| 242 | 242 | but it's supposed to happen 60 |
| 243 | 243 | times a sec, so it's a good place */ |
| 244 | 244 | MDRV_MACHINE_START(carpolo) |
| r1877 | r1878 | |
|---|---|---|
| 232 | 232 | MDRV_CPU_ADD(Z80,MCLK/6) /* 3.072MHz? */ |
| 233 | 233 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 234 | 234 | MDRV_CPU_IO_MAP(readport,writeport) |
| 235 | MDRV_CPU_VBLANK_INT(drmicro_interrupt | |
| 235 | MDRV_CPU_VBLANK_INT("main", drmicro_interrupt | |
| 236 | 236 | |
| 237 | 237 | MDRV_INTERLEAVE(1) |
| 238 | 238 |
| r1877 | r1878 | |
|---|---|---|
| 270 | 270 | MDRV_CPU_ADD(Z80,12000000/2) |
| 271 | 271 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 272 | 272 | MDRV_CPU_IO_MAP(readport,writeport) |
| 273 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 273 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 274 | 274 | |
| 275 | 275 | /* video hardware */ |
| 276 | 276 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 258 | 258 | MDRV_CPU_ADD(Z80, 4000000) //??? |
| 259 | 259 | MDRV_CPU_PROGRAM_MAP(vroulet_map, 0) |
| 260 | 260 | MDRV_CPU_IO_MAP(vroulet_io_map, 0) |
| 261 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 261 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 262 | 262 | |
| 263 | 263 | MDRV_MACHINE_RESET(vroulet) |
| 264 | 264 |
| r1877 | r1878 | |
|---|---|---|
| 168 | 168 | MDRV_CPU_ADD(V30, 8000000) |
| 169 | 169 | MDRV_CPU_PROGRAM_MAP(twins_map, 0) |
| 170 | 170 | MDRV_CPU_IO_MAP(twins_io,0) |
| 171 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 171 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 172 | 172 | |
| 173 | 173 | /* video hardware */ |
| 174 | 174 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 256 | 256 | MDRV_CPU_ADD(V30, XTAL_16MHz/2) /* verified on pcb */ |
| 257 | 257 | MDRV_CPU_PROGRAM_MAP(twins_map, 0) |
| 258 | 258 | MDRV_CPU_IO_MAP(twinsa_io,0) |
| 259 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 259 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 260 | 260 | |
| 261 | 261 | /* video hardware */ |
| 262 | 262 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 97 | 97 | static WRITE8_HANDLER( hvymetal_videomode_w ) |
| 98 | 98 | { |
| 99 | 99 | memory_set_bank(1, ((data & 0x04)>>2) + ((data & 0x40)>>5)); |
| 100 | system1_videomode_w(0, data); | |
| 100 | system1_videomode_w(machine, 0, data); | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | static WRITE8_HANDLER( brain_videomode_w ) |
| 104 | 104 | { |
| 105 | 105 | memory_set_bank(1, ((data & 0x04)>>2) + ((data & 0x40)>>5)); |
| 106 | system1_videomode_w(0, data); | |
| 106 | system1_videomode_w(machine, 0, data); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | static WRITE8_HANDLER( chplft_videomode_w ) |
| 110 | 110 | { |
| 111 | 111 | memory_set_bank(1, (data & 0x0c)>>2); |
| 112 | system1_videomode_w(0, data); | |
| 112 | system1_videomode_w(machine, 0, data); | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
| 116 | 116 | static WRITE8_HANDLER( system1_soundport_w ) |
| 117 | 117 | { |
| 118 | soundlatch_w(0,data); | |
| 119 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 118 | soundlatch_w(machine,0,data); | |
| 119 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 120 | 120 | /* spin for a while to let the Z80 read the command (fixes hanging sound in Regulus) */ |
| 121 | 121 | cpu_spinuntil_time(ATTOTIME_IN_USEC(50)); |
| 122 | 122 | } |
| r1877 | r1878 | |
| 2486 | 2486 | MDRV_CPU_ADD_TAG("main", Z80, 4000000) /* My Hero has 2 OSCs 8 & 20 MHz (Cabbe Info) */ |
| 2487 | 2487 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 2488 | 2488 | MDRV_CPU_IO_MAP(readport,writeport) |
| 2489 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 2489 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 2490 | 2490 | |
| 2491 | 2491 | MDRV_CPU_ADD_TAG("sound", Z80, 4000000) |
| 2492 | 2492 | /* audio CPU */ |
| 2493 | 2493 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 2494 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) /* NMIs are caused by the main CPU */ | |
| 2494 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* NMIs are caused by the main CPU */ | |
| 2495 | 2495 | |
| 2496 | 2496 | MDRV_MACHINE_RESET(system1) |
| 2497 | 2497 | |
| r1877 | r1878 | |
| 4789 | 4789 | static WRITE8_HANDLER( dakkochn_port_15_w ) |
| 4790 | 4790 | { |
| 4791 | 4791 | dakkochn_control = data; // check if any control multiplex bits are in here! |
| 4792 | chplft_videomode_w(offset,data); | |
| 4792 | chplft_videomode_w(machine,offset,data); | |
| 4793 | 4793 | } |
| 4794 | 4794 | |
| 4795 | 4795 | static DRIVER_INIT( dakkochn ) |
| r1877 | r1878 | |
|---|---|---|
| 360 | 360 | MDRV_CPU_ADD(Z80, MCLK/2) /* 8.000 MHz */ |
| 361 | 361 | MDRV_CPU_PROGRAM_MAP(cultures_map,0) |
| 362 | 362 | MDRV_CPU_IO_MAP(cultures_io_map,0) |
| 363 | MDRV_CPU_VBLANK_INT(cultures_interrupt | |
| 363 | MDRV_CPU_VBLANK_INT("main", cultures_interrupt | |
| 364 | 364 | |
| 365 | 365 | /* video hardware */ |
| 366 | 366 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 77 | 77 | { |
| 78 | 78 | if (ACCESSING_LSB) |
| 79 | 79 | { |
| 80 | soundlatch_w(0, data & 0xff); | |
| 80 | soundlatch_w(machine, 0, data & 0xff); | |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | static READ8_HANDLER( powerinb_fake_ym2203_r ) |
| r1877 | r1878 | |
| 349 | 349 | /* basic machine hardware */ |
| 350 | 350 | MDRV_CPU_ADD(M68000, 12000000) /* 12MHz */ |
| 351 | 351 | MDRV_CPU_PROGRAM_MAP(powerins_readmem,powerins_writemem) |
| 352 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 352 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 353 | 353 | |
| 354 | 354 | MDRV_CPU_ADD_TAG("sound", Z80, 6000000) /* 6 MHz */ |
| 355 | 355 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 194 | 194 | MDRV_CPU_PROGRAM_MAP(memmap, 0) |
| 195 | 195 | MDRV_CPU_IO_MAP(portmap, 0) |
| 196 | 196 | |
| 197 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 197 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 198 | 198 | |
| 199 | 199 | /* video hardware */ |
| 200 | 200 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 84 | 84 | memory_set_bankptr(1, &SNDROM[0x08000 + (0x8000 * (data & 0x03))]); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | static int niyanpai_sound_r(int offset) | |
| 87 | static int niyanpai_sound_r(running_machine *machine, int offset) | |
| 88 | 88 | { |
| 89 | return soundlatch_r(0); | |
| 89 | return soundlatch_r(machine, 0); | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | static WRITE16_HANDLER( niyanpai_sound_w ) |
| 93 | 93 | { |
| 94 | soundlatch_w(0, ((data >> 8) & 0xff)); | |
| 94 | soundlatch_w(machine, 0, ((data >> 8) & 0xff)); | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | static void niyanpai_soundclr_w(int offset, int data) | |
| 97 | static void niyanpai_soundclr_w(running_machine *machine, int offset, int data) | |
| 98 | 98 | { |
| 99 | soundlatch_clear_w(0, 0); | |
| 99 | soundlatch_clear_w(machine, 0, 0); | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | |
| 103 | 103 | /* TMPZ84C011 PIO emulation */ |
| 104 | 104 | static UINT8 pio_dir[5], pio_latch[5]; |
| 105 | 105 | |
| 106 | static int tmpz84c011_pio_r(int offset) | |
| 106 | static int tmpz84c011_pio_r(running_machine *machine, int offset) | |
| 107 | 107 | { |
| 108 | 108 | int portdata; |
| 109 | 109 | |
| r1877 | r1878 | |
| 119 | 119 | portdata = 0xff; |
| 120 | 120 | break; |
| 121 | 121 | case 3: /* PD_0 */ |
| 122 | portdata = niyanpai_sound_r(0); | |
| 122 | portdata = niyanpai_sound_r(machine, 0); | |
| 123 | 123 | break; |
| 124 | 124 | case 4: /* PE_0 */ |
| 125 | 125 | portdata = 0xff; |
| r1877 | r1878 | |
| 134 | 134 | return portdata; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | static void tmpz84c011_pio_w(int offset, int data) | |
| 137 | static void tmpz84c011_pio_w(running_machine *machine, int offset, int data) | |
| 138 | 138 | { |
| 139 | 139 | switch (offset) |
| 140 | 140 | { |
| r1877 | r1878 | |
| 142 | 142 | niyanpai_soundbank_w(data & 0x03); |
| 143 | 143 | break; |
| 144 | 144 | case 1: /* PB_0 */ |
| 145 | DAC_1_WRITE(0, data); | |
| 145 | DAC_1_WRITE(machine, 0, data); | |
| 146 | 146 | break; |
| 147 | 147 | case 2: /* PC_0 */ |
| 148 | DAC_0_WRITE(0, data); | |
| 148 | DAC_0_WRITE(machine, 0, data); | |
| 149 | 149 | break; |
| 150 | 150 | case 3: /* PD_0 */ |
| 151 | 151 | break; |
| 152 | 152 | case 4: /* PE_0 */ |
| 153 | if (!(data & 0x01)) niyanpai_soundclr_w(0, 0); | |
| 153 | if (!(data & 0x01)) niyanpai_soundclr_w(machine, 0, 0); | |
| 154 | 154 | break; |
| 155 | 155 | |
| 156 | 156 | default: |
| r1877 | r1878 | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /* CPU interface */ |
| 163 | static READ8_HANDLER( tmpz84c011_0_pa_r ) { return (tmpz84c011_pio_r(0) & ~pio_dir[0]) | (pio_latch[0] & pio_dir[0]); } | |
| 164 | static READ8_HANDLER( tmpz84c011_0_pb_r ) { return (tmpz84c011_pio_r(1) & ~pio_dir[1]) | (pio_latch[1] & pio_dir[1]); } | |
| 165 | static READ8_HANDLER( tmpz84c011_0_pc_r ) { return (tmpz84c011_pio_r(2) & ~pio_dir[2]) | (pio_latch[2] & pio_dir[2]); } | |
| 166 | static READ8_HANDLER( tmpz84c011_0_pd_r ) { return (tmpz84c011_pio_r(3) & ~pio_dir[3]) | (pio_latch[3] & pio_dir[3]); } | |
| 167 | static READ8_HANDLER( tmpz84c011_0_pe_r ) { return (tmpz84c011_pio_r(4) & ~pio_dir[4]) | (pio_latch[4] & pio_dir[4]); } | |
| 163 | static READ8_HANDLER( tmpz84c011_0_pa_r ) { return (tmpz84c011_pio_r(machine,0) & ~pio_dir[0]) | (pio_latch[0] & pio_dir[0]); } | |
| 164 | static READ8_HANDLER( tmpz84c011_0_pb_r ) { return (tmpz84c011_pio_r(machine,1) & ~pio_dir[1]) | (pio_latch[1] & pio_dir[1]); } | |
| 165 | static READ8_HANDLER( tmpz84c011_0_pc_r ) { return (tmpz84c011_pio_r(machine,2) & ~pio_dir[2]) | (pio_latch[2] & pio_dir[2]); } | |
| 166 | static READ8_HANDLER( tmpz84c011_0_pd_r ) { return (tmpz84c011_pio_r(machine,3) & ~pio_dir[3]) | (pio_latch[3] & pio_dir[3]); } | |
| 167 | static READ8_HANDLER( tmpz84c011_0_pe_r ) { return (tmpz84c011_pio_r(machine,4) & ~pio_dir[4]) | (pio_latch[4] & pio_dir[4]); } | |
| 168 | 168 | |
| 169 | static WRITE8_HANDLER( tmpz84c011_0_pa_w ) { pio_latch[0] = data; tmpz84c011_pio_w(0, data); } | |
| 170 | static WRITE8_HANDLER( tmpz84c011_0_pb_w ) { pio_latch[1] = data; tmpz84c011_pio_w(1, data); } | |
| 171 | static WRITE8_HANDLER( tmpz84c011_0_pc_w ) { pio_latch[2] = data; tmpz84c011_pio_w(2, data); } | |
| 172 | static WRITE8_HANDLER( tmpz84c011_0_pd_w ) { pio_latch[3] = data; tmpz84c011_pio_w(3, data); } | |
| 173 | static WRITE8_HANDLER( tmpz84c011_0_pe_w ) { pio_latch[4] = data; tmpz84c011_pio_w(4, data); } | |
| 169 | static WRITE8_HANDLER( tmpz84c011_0_pa_w ) { pio_latch[0] = data; tmpz84c011_pio_w(machine, 0, data); } | |
| 170 | static WRITE8_HANDLER( tmpz84c011_0_pb_w ) { pio_latch[1] = data; tmpz84c011_pio_w(machine, 1, data); } | |
| 171 | static WRITE8_HANDLER( tmpz84c011_0_pc_w ) { pio_latch[2] = data; tmpz84c011_pio_w(machine, 2, data); } | |
| 172 | static WRITE8_HANDLER( tmpz84c011_0_pd_w ) { pio_latch[3] = data; tmpz84c011_pio_w(machine, 3, data); } | |
| 173 | static WRITE8_HANDLER( tmpz84c011_0_pe_w ) { pio_latch[4] = data; tmpz84c011_pio_w(machine, 4, data); } | |
| 174 | 174 | |
| 175 | 175 | static READ8_HANDLER( tmpz84c011_0_dir_pa_r ) { return pio_dir[0]; } |
| 176 | 176 | static READ8_HANDLER( tmpz84c011_0_dir_pb_r ) { return pio_dir[1]; } |
| r1877 | r1878 | |
| 215 | 215 | for (i = 0; i < 5; i++) |
| 216 | 216 | { |
| 217 | 217 | pio_dir[i] = pio_latch[i] = 0; |
| 218 | tmpz84c011_pio_w(i, 0); | |
| 218 | tmpz84c011_pio_w(machine, i, 0); | |
| 219 | 219 | } |
| 220 | 220 | } |
| 221 | 221 | |
| r1877 | r1878 | |
| 295 | 295 | // bit 2 motor on |
| 296 | 296 | // bit 3 coin lock |
| 297 | 297 | |
| 298 | if (tmp68301_parallel_interface_r(0x0005, 0x00ff) & 0x0004) musobana_outcoin_flag ^= 1; | |
| 298 | if (tmp68301_parallel_interface_r(machine, 0x0005, 0x00ff) & 0x0004) musobana_outcoin_flag ^= 1; | |
| 299 | 299 | else musobana_outcoin_flag = 1; |
| 300 | 300 | |
| 301 | 301 | return (((readinputport(2) & 0xdf) | ((musobana_outcoin_flag & 0x01) << 5)) << 8); |
| r1877 | r1878 | |
| 852 | 852 | /* basic machine hardware */ |
| 853 | 853 | MDRV_CPU_ADD_TAG("main", M68000, 12288000/2) /* TMP68301, 6.144 MHz */ |
| 854 | 854 | MDRV_CPU_PROGRAM_MAP(niyanpai_readmem,niyanpai_writemem) |
| 855 | MDRV_CPU_VBLANK_INT(niyanpai_interrupt | |
| 855 | MDRV_CPU_VBLANK_INT("main", niyanpai_interrupt | |
| 856 | 856 | |
| 857 | 857 | MDRV_CPU_ADD(Z80, 8000000/1) /* TMPZ84C011, 8.00 MHz */ |
| 858 | 858 | MDRV_CPU_CONFIG(daisy_chain_sound) |
| r1877 | r1878 | |
|---|---|---|
| 225 | 225 | /* basic machine hardware */ |
| 226 | 226 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz (?) */ |
| 227 | 227 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 228 | MDRV_CPU_VBLANK_INT(exedexes_interrupt,2) | |
| 228 | MDRV_CPU_VBLANK_INT_HACK(exedexes_interrupt,2) | |
| 229 | 229 | |
| 230 | 230 | MDRV_CPU_ADD(Z80, 3000000) |
| 231 | 231 | /* audio CPU */ /* 3 MHz ??? */ |
| 232 | 232 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 233 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 233 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 234 | 234 | |
| 235 | 235 | /* video hardware */ |
| 236 | 236 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r1877 | r1878 | |
|---|---|---|
| 210 | 210 | |
| 211 | 211 | static READ8_HANDLER( a2d_data_r ) |
| 212 | 212 | { |
| 213 | jedi_state *state = | |
| 213 | jedi_state *state = machine->driver_data; | |
| 214 | 214 | UINT8 ret = 0; |
| 215 | 215 | |
| 216 | 216 | switch (state->a2d_select) |
| r1877 | r1878 | |
| 225 | 225 | |
| 226 | 226 | static WRITE8_HANDLER( a2d_select_w ) |
| 227 | 227 | { |
| 228 | jedi_state *state = | |
| 228 | jedi_state *state = machine->driver_data; | |
| 229 | 229 | |
| 230 | 230 | state->a2d_select = offset; |
| 231 | 231 | } |
| r1877 | r1878 | |
| 246 | 246 | |
| 247 | 247 | static WRITE8_HANDLER( nvram_data_w ) |
| 248 | 248 | { |
| 249 | jedi_state *state = | |
| 249 | jedi_state *state = machine->driver_data; | |
| 250 | 250 | |
| 251 | 251 | if (state->nvram_enabled) |
| 252 | 252 | generic_nvram[offset] = data; |
| r1877 | r1878 | |
| 255 | 255 | |
| 256 | 256 | static WRITE8_HANDLER( nvram_enable_w ) |
| 257 | 257 | { |
| 258 | jedi_state *state = | |
| 258 | jedi_state *state = machine->driver_data; | |
| 259 | 259 | |
| 260 | 260 | state->nvram_enabled = ~offset & 1; |
| 261 | 261 | } |
| r1877 | r1878 | |
|---|---|---|
| 894 | 894 | |
| 895 | 895 | static READ8_HANDLER( coin_input_r ) |
| 896 | 896 | { |
| 897 | return input_port_0_r(0); | |
| 897 | return input_port_0_r(machine, 0); | |
| 898 | 898 | } |
| 899 | 899 | |
| 900 | 900 | /////////////////////////////////////////////////////////////////////////// |
| r1877 | r1878 | |
| 3000 | 3000 | |
| 3001 | 3001 | MDRV_CPU_ADD_TAG("adder2", M6809, MASTER_CLOCK/4 ) // adder2 board 6809 CPU at 2 Mhz |
| 3002 | 3002 | MDRV_CPU_PROGRAM_MAP(adder2_memmap,0) // setup adder2 board memorymap |
| 3003 | MDRV_CPU_VBLANK_INT(adder2_vbl | |
| 3003 | MDRV_CPU_VBLANK_INT("ADDER", adder2_vbl | |
| 3004 | 3004 | |
| 3005 | 3005 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 3006 | 3006 | MDRV_SOUND_ADD(UPD7759, UPD7759_STANDARD_CLOCK) |
| r1877 | r1878 | |
|---|---|---|
| 853 | 853 | static WRITE32_HANDLER( skns_ymz280_w ) |
| 854 | 854 | { |
| 855 | 855 | if ((mem_mask & 0xff000000) == 0) |
| 856 | YMZ280B_register_0_w(offset,(data >> 24) & 0xff); | |
| 856 | YMZ280B_register_0_w(machine,offset,(data >> 24) & 0xff); | |
| 857 | 857 | if ((mem_mask & 0x00ff0000) == 0) |
| 858 | YMZ280B_data_0_w(offset,(data >> 16) & 0xff); | |
| 858 | YMZ280B_data_0_w(machine,offset,(data >> 16) & 0xff); | |
| 859 | 859 | } |
| 860 | 860 | |
| 861 | 861 | static ADDRESS_MAP_START( skns_readmem, ADDRESS_SPACE_PROGRAM, 32 ) |
| r1877 | r1878 | |
| 951 | 951 | static MACHINE_DRIVER_START(skns) |
| 952 | 952 | MDRV_CPU_ADD(SH2,28638000) |
| 953 | 953 | MDRV_CPU_PROGRAM_MAP(skns_readmem,skns_writemem) |
| 954 | MDRV_CPU_VBLANK_INT(skns_interrupt,2) | |
| 954 | MDRV_CPU_VBLANK_INT_HACK(skns_interrupt,2) | |
| 955 | 955 | |
| 956 | 956 | MDRV_MACHINE_RESET(skns) |
| 957 | 957 | MDRV_NVRAM_HANDLER(generic_1fill) |
| r1877 | r1878 | |
|---|---|---|
| 1814 | 1814 | /* basic machine hardware */ |
| 1815 | 1815 | MDRV_CPU_ADD_TAG("main",M68000,50000000/3) /* !! TMP68301 @ 16.666666MHz !! */ |
| 1816 | 1816 | MDRV_CPU_PROGRAM_MAP(mj4simai_readmem,mj4simai_writemem) |
| 1817 | MDRV_CPU_VBLANK_INT(seta2_interrupt | |
| 1817 | MDRV_CPU_VBLANK_INT("main", seta2_interrupt | |
| 1818 | 1818 | |
| 1819 | 1819 | MDRV_MACHINE_RESET( tmp68301 ) |
| 1820 | 1820 | |
| r1877 | r1878 | |
| 1929 | 1929 | MDRV_IMPORT_FROM(mj4simai) |
| 1930 | 1930 | MDRV_CPU_MODIFY("main") |
| 1931 | 1931 | MDRV_CPU_PROGRAM_MAP(samshoot_map,0) |
| 1932 | MDRV_CPU_VBLANK_INT(samshoot_interrupt,2) | |
| 1932 | MDRV_CPU_VBLANK_INT_HACK(samshoot_interrupt,2) | |
| 1933 | 1933 | |
| 1934 | 1934 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 1935 | 1935 |
| r1877 | r1878 | |
|---|---|---|
| 321 | 321 | case 0x02: return reg_a002; |
| 322 | 322 | case 0x04: return readinputportbytag("A004"); |
| 323 | 323 | case 0x05: return readinputportbytag("A005"); |
| 324 | case 0x0c: return input_port_0_r(0); // stats / reset | |
| 324 | case 0x0c: return input_port_0_r(machine,0); // stats / reset | |
| 325 | 325 | case 0x0e: return readinputportbytag("A00E");// coin/reset |
| 326 | 326 | } |
| 327 | 327 | |
| r1877 | r1878 | |
| 331 | 331 | switch(reg_a002&0x3f) |
| 332 | 332 | { |
| 333 | 333 | case 0x3b: |
| 334 | return input_port_2_r(0);//bet10 / pay out | |
| 334 | return input_port_2_r(machine,0);//bet10 / pay out | |
| 335 | 335 | case 0x3e: |
| 336 | return input_port_3_r(0);//TODO : trace f564 | |
| 336 | return input_port_3_r(machine,0);//TODO : trace f564 | |
| 337 | 337 | case 0x3d: |
| 338 | return input_port_4_r(0); | |
| 338 | return input_port_4_r(machine,0); | |
| 339 | 339 | default: |
| 340 | 340 | logerror("A000 read with mux=0x%02x\n",reg_a002&0x3f); |
| 341 | 341 | } |
| r1877 | r1878 | |
| 691 | 691 | tilemap_set_palette_offset(gfx1_tilemap,0x200); |
| 692 | 692 | } |
| 693 | 693 | |
| 694 | static void draw_sprites(running_machine *machine, | |
| 694 | static void draw_sprites(running_machine *machine, | |
| 695 | 695 | { |
| 696 | 696 | int i,sx,sy,tileno,flags,color; |
| 697 | 697 | int flipx=0; |
| r1877 | r1878 | |
| 770 | 770 | /* basic machine hardware */ |
| 771 | 771 | MDRV_CPU_ADD(Z80,8000000) /* ? MHz */ |
| 772 | 772 | MDRV_CPU_PROGRAM_MAP(map_main, 0) |
| 773 | MDRV_CPU_VBLANK_INT(witch_main_interrupt | |
| 773 | MDRV_CPU_VBLANK_INT("main", witch_main_interrupt | |
| 774 | 774 | |
| 775 | 775 | /* 2nd z80 */ |
| 776 | 776 | MDRV_CPU_ADD(Z80,8000000) /* ? MHz */ |
| 777 | 777 | MDRV_CPU_PROGRAM_MAP(map_sub, 0) |
| 778 | MDRV_CPU_VBLANK_INT(witch_sub_interrupt | |
| 778 | MDRV_CPU_VBLANK_INT("main", witch_sub_interrupt | |
| 779 | 779 | |
| 780 | 780 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 781 | 781 |
| r1877 | r1878 | |
|---|---|---|
| 78 | 78 | { |
| 79 | 79 | switch ((offset & 0x1c) >> 2){ |
| 80 | 80 | case 0x04: /* bankswitch */ |
| 81 | flkatck_bankswitch_w(0, data); | |
| 81 | flkatck_bankswitch_w(machine, 0, data); | |
| 82 | 82 | break; |
| 83 | 83 | case 0x05: /* sound code number */ |
| 84 | soundlatch_w(0, data); | |
| 84 | soundlatch_w(machine, 0, data); | |
| 85 | 85 | break; |
| 86 | 86 | case 0x06: /* Cause interrupt on audio CPU */ |
| 87 | cpunum_set_input_line( | |
| 87 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 88 | 88 | break; |
| 89 | 89 | case 0x07: /* watchdog reset */ |
| 90 | watchdog_reset_w(0, data); | |
| 90 | watchdog_reset_w(machine, 0, data); | |
| 91 | 91 | break; |
| 92 | 92 | } |
| 93 | 93 | } |
| r1877 | r1878 | |
| 273 | 273 | /* basic machine hardware */ |
| 274 | 274 | MDRV_CPU_ADD(HD6309,3000000*4) /* HD63C09EP, 24/8 MHz */ |
| 275 | 275 | MDRV_CPU_PROGRAM_MAP(flkatck_readmem,flkatck_writemem) |
| 276 | MDRV_CPU_VBLANK_INT(flkatck_interrupt | |
| 276 | MDRV_CPU_VBLANK_INT("main", flkatck_interrupt | |
| 277 | 277 | |
| 278 | 278 | MDRV_CPU_ADD(Z80,3579545) /* NEC D780C-1, 3.579545 MHz */ |
| 279 | 279 | MDRV_CPU_PROGRAM_MAP(flkatck_readmem_sound,flkatck_writemem_sound) |
| r1877 | r1878 | |
|---|---|---|
| 122 | 122 | */ |
| 123 | 123 | |
| 124 | 124 | #include "driver.h" |
| 125 | #include "deprecat.h" | |
| 125 | 126 | #include "machine/eeprom.h" |
| 126 | 127 | #include "namconb1.h" |
| 127 | 128 | #include "namcos2.h" |
| r1877 | r1878 | |
|---|---|---|
| 295 | 295 | static WRITE8_HANDLER( hnoridur_palbank_w ) |
| 296 | 296 | { |
| 297 | 297 | palbank = data & 0x0f; |
| 298 | dynax_blit_palbank_w(0,data); | |
| 298 | dynax_blit_palbank_w(machine,0,data); | |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | static WRITE8_HANDLER( hnoridur_palette_w ) |
| r1877 | r1878 | |
| 338 | 338 | static WRITE8_HANDLER( yarunara_palette_w ) |
| 339 | 339 | { |
| 340 | 340 | int addr = 512*palbank + offset; |
| 341 | ||
| 342 | 341 | switch (hnoridur_bank) |
| 343 | 342 | { |
| 344 | 343 | case 0x10: |
| r1877 | r1878 | |
| 346 | 345 | break; |
| 347 | 346 | |
| 348 | 347 | case 0x1c: // RTC |
| 349 | msm6242_w(offset,data); | |
| 348 | msm6242_w(machine,offset,data); | |
| 350 | 349 | return; |
| 351 | 350 | |
| 352 | 351 | default: |
| r1877 | r1878 | |
| 360 | 359 | int r = br & 0x1f; |
| 361 | 360 | int g = bg & 0x1f; |
| 362 | 361 | int b = ((bg & 0xc0)>>3) | ((br & 0xe0)>>5); |
| 363 | palette_set_color_rgb( | |
| 362 | palette_set_color_rgb(machine, 256*palbank + ((offset&0xf)|((offset&0x1e0)>>1)) ,pal5bit(r),pal5bit(g),pal5bit(b)); | |
| 364 | 363 | } |
| 365 | 364 | } |
| 366 | 365 | |
| r1877 | r1878 | |
| 444 | 443 | |
| 445 | 444 | static WRITE8_HANDLER( yarunara_layer_half_w ) |
| 446 | 445 | { |
| 447 | hanamai_layer_half_w(0,data >> 1); | |
| 446 | hanamai_layer_half_w(machine,0,data >> 1); | |
| 448 | 447 | } |
| 449 | 448 | static WRITE8_HANDLER( yarunara_layer_half2_w ) |
| 450 | 449 | { |
| 451 | hnoridur_layer_half2_w(0,data >> 1); | |
| 450 | hnoridur_layer_half2_w(machine,0,data >> 1); | |
| 452 | 451 | } |
| 453 | 452 | |
| 454 | 453 | static ADDRESS_MAP_START( sprtmtch_mem_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 657 | 656 | |
| 658 | 657 | static WRITE8_HANDLER( yarunara_flipscreen_w ) |
| 659 | 658 | { |
| 660 | dynax_flipscreen_w(0,(data&2)?1:0); | |
| 659 | dynax_flipscreen_w(machine,0,(data&2)?1:0); | |
| 661 | 660 | } |
| 662 | 661 | |
| 663 | 662 | static WRITE8_HANDLER( yarunara_blit_romregion_w ) |
| 664 | 663 | { |
| 665 | 664 | switch(data) |
| 666 | 665 | { |
| 667 | case 0x00: dynax_blit_romregion_w(0,0); return; | |
| 668 | case 0x01: dynax_blit_romregion_w(0,1); return; | |
| 669 | case 0x80: dynax_blit_romregion_w(0,2); return; | |
| 670 | case 0x81: dynax_blit_romregion_w(0,3); return; | |
| 671 | case 0x82: dynax_blit_romregion_w(0,4); return; // mjcomv1 | |
| 666 | case 0x00: dynax_blit_romregion_w(machine,0,0); return; | |
| 667 | case 0x01: dynax_blit_romregion_w(machine,0,1); return; | |
| 668 | case 0x80: dynax_blit_romregion_w(machine,0,2); return; | |
| 669 | case 0x81: dynax_blit_romregion_w(machine,0,3); return; | |
| 670 | case 0x82: dynax_blit_romregion_w(machine,0,4); return; // mjcomv1 | |
| 672 | 671 | } |
| 673 | 672 | logerror("%04x: unmapped romregion=%02X\n",activecpu_get_pc(),data); |
| 674 | 673 | } |
| r1877 | r1878 | |
| 955 | 954 | |
| 956 | 955 | static READ8_HANDLER( mjelctrn_keyboard_1_r ) |
| 957 | 956 | { |
| 958 | return (hanamai_keyboard_1_r(0) & 0x3f) | (readinputport(15) ? 0x40 : 0); | |
| 957 | return (hanamai_keyboard_1_r(machine,0) & 0x3f) | (readinputport(15) ? 0x40 : 0); | |
| 959 | 958 | } |
| 960 | 959 | |
| 961 | 960 | static READ8_HANDLER( mjelctrn_dsw_r ) |
| r1877 | r1878 | |
| 1079 | 1078 | { |
| 1080 | 1079 | case 0x00: return readinputport(0); |
| 1081 | 1080 | case 0x01: return 0xff; //? |
| 1082 | case 0x02: return 0xbf | ((htengoku_hopper && !( | |
| 1081 | case 0x02: return 0xbf | ((htengoku_hopper && !(vid | |
| 1083 | 1082 | case 0x03: return htengoku_coins; |
| 1084 | 1083 | } |
| 1085 | 1084 | logerror("%04x: coin_r with select = %02x\n",activecpu_get_pc(),htengoku_select); |
| r1877 | r1878 | |
| 1098 | 1097 | { |
| 1099 | 1098 | switch(data) |
| 1100 | 1099 | { |
| 1101 | case 0x80: dynax_blit_romregion_w(0,0); return; | |
| 1102 | case 0x81: dynax_blit_romregion_w(0,1); return; | |
| 1103 | case 0x00: dynax_blit_romregion_w(0,2); return; | |
| 1100 | case 0x80: dynax_blit_romregion_w(machine,0,0); return; | |
| 1101 | case 0x81: dynax_blit_romregion_w(machine,0,1); return; | |
| 1102 | case 0x00: dynax_blit_romregion_w(machine,0,2); return; | |
| 1104 | 1103 | } |
| 1105 | 1104 | logerror("%04x: unmapped romregion=%02X\n",activecpu_get_pc(),data); |
| 1106 | 1105 | } |
| r1877 | r1878 | |
| 1328 | 1327 | } |
| 1329 | 1328 | else if ( (rombank == 0x10) && (offset < 0x10) ) |
| 1330 | 1329 | { |
| 1331 | return msm6242_r(offset); | |
| 1330 | return msm6242_r(machine,offset); | |
| 1332 | 1331 | } |
| 1333 | 1332 | else if (rombank == 0x12) |
| 1334 | 1333 | { |
| 1335 | return tenkai_palette_r(offset); | |
| 1334 | return tenkai_palette_r(machine,offset); | |
| 1336 | 1335 | } |
| 1337 | 1336 | |
| 1338 | 1337 | logerror("%04x: unmapped offset %04X read with rombank=%02X\n",activecpu_get_pc(),offset,rombank); |
| r1877 | r1878 | |
| 1343 | 1342 | { |
| 1344 | 1343 | if ( (rombank == 0x10) && (offset < 0x10) ) |
| 1345 | 1344 | { |
| 1346 | msm6242_w(offset,data); | |
| 1345 | msm6242_w(machine,offset,data); | |
| 1347 | 1346 | return; |
| 1348 | 1347 | } |
| 1349 | 1348 | else if (rombank == 0x12) |
| 1350 | 1349 | { |
| 1351 | tenkai_palette_w(offset,data); | |
| 1350 | tenkai_palette_w(machine,offset,data); | |
| 1352 | 1351 | return; |
| 1353 | 1352 | } |
| 1354 | 1353 | |
| r1877 | r1878 | |
| 1375 | 1374 | { |
| 1376 | 1375 | switch(data) |
| 1377 | 1376 | { |
| 1378 | case 0x00: dynax_blit_romregion_w(0,0); return; | |
| 1379 | case 0x83: dynax_blit_romregion_w(0,1); return; | |
| 1380 | case 0x80: dynax_blit_romregion_w(0,2); return; | |
| 1377 | case 0x00: dynax_blit_romregion_w(machine,0,0); return; | |
| 1378 | case 0x83: dynax_blit_romregion_w(machine,0,1); return; | |
| 1379 | case 0x80: dynax_blit_romregion_w(machine,0,2); return; | |
| 1381 | 1380 | } |
| 1382 | 1381 | logerror("%04x: unmapped romregion=%02X\n",activecpu_get_pc(),data); |
| 1383 | 1382 | } |
| r1877 | r1878 | |
| 3605 | 3604 | MDRV_CPU_ADD_TAG("main",Z80,22000000 / 4) /* 5.5MHz */ |
| 3606 | 3605 | MDRV_CPU_PROGRAM_MAP(sprtmtch_mem_map,0) |
| 3607 | 3606 | MDRV_CPU_IO_MAP(hanamai_io_map,0) |
| 3608 | MDRV_CPU_VBLANK_INT(sprtmtch_vblank_interrupt | |
| 3607 | MDRV_CPU_VBLANK_INT("main", sprtmtch_vblank_interrupt | |
| 3609 | 3608 | |
| 3610 | 3609 | MDRV_MACHINE_RESET(adpcm) |
| 3611 | 3610 | |
| r1877 | r1878 | |
| 3660 | 3659 | MDRV_CPU_ADD_TAG("main",Z80,22000000 / 4) /* 5.5MHz */ |
| 3661 | 3660 | MDRV_CPU_PROGRAM_MAP(hnoridur_mem_map,0) |
| 3662 | 3661 | MDRV_CPU_IO_MAP(hnoridur_io_map,0) |
| 3663 | MDRV_CPU_VBLANK_INT(sprtmtch_vblank_interrupt | |
| 3662 | MDRV_CPU_VBLANK_INT("main", sprtmtch_vblank_interrupt | |
| 3664 | 3663 | |
| 3665 | 3664 | MDRV_MACHINE_RESET(adpcm) |
| 3666 | 3665 | |
| r1877 | r1878 | |
| 3714 | 3713 | MDRV_CPU_ADD(Z80,22000000 / 4) /* 5.5MHz */ |
| 3715 | 3714 | MDRV_CPU_PROGRAM_MAP(sprtmtch_mem_map,0) |
| 3716 | 3715 | MDRV_CPU_IO_MAP(sprtmtch_io_map,0) |
| 3717 | MDRV_CPU_VBLANK_INT(sprtmtch_vblank_interrupt | |
| 3716 | MDRV_CPU_VBLANK_INT("main", sprtmtch_vblank_interrupt | |
| 3718 | 3717 | |
| 3719 | 3718 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 3720 | 3719 | |
| r1877 | r1878 | |
| 3754 | 3753 | MDRV_CPU_ADD_TAG("main",Z80,24000000/4) /* 6 MHz? */ |
| 3755 | 3754 | MDRV_CPU_PROGRAM_MAP(sprtmtch_mem_map,0) |
| 3756 | 3755 | MDRV_CPU_IO_MAP(mjfriday_io_map,0) |
| 3757 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 3756 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 3758 | 3757 | |
| 3759 | 3758 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 3760 | 3759 | |
| r1877 | r1878 | |
| 3891 | 3890 | MDRV_CPU_ADD_TAG("main",Z80,22000000 / 4) /* 5.5MHz */ |
| 3892 | 3891 | MDRV_CPU_PROGRAM_MAP(jantouki_mem_map,0) |
| 3893 | 3892 | MDRV_CPU_IO_MAP(jantouki_io_map,0) |
| 3894 | MDRV_CPU_VBLANK_INT(jantouki_vblank_interrupt | |
| 3893 | MDRV_CPU_VBLANK_INT("top", jantouki_vblank_interrupt | |
| 3895 | 3894 | |
| 3896 | 3895 | MDRV_CPU_ADD_TAG("sound",Z80,22000000 / 4) /* 5.5MHz */ |
| 3897 | 3896 | MDRV_CPU_PROGRAM_MAP(jantouki_sound_mem_map,0) |
| 3898 | 3897 | MDRV_CPU_IO_MAP(jantouki_sound_io_map,0) |
| 3899 | MDRV_CPU_VBLANK_INT(jantouki_sound_vblank_interrupt | |
| 3898 | MDRV_CPU_VBLANK_INT("top", jantouki_sound_vblank_interrupt | |
| 3900 | 3899 | |
| 3901 | 3900 | MDRV_MACHINE_RESET(adpcm) |
| 3902 | 3901 | |
| r1877 | r1878 | |
| 3970 | 3969 | MDRV_CPU_MODIFY("main") |
| 3971 | 3970 | MDRV_CPU_PROGRAM_MAP(nanajign_mem_map,0) |
| 3972 | 3971 | MDRV_CPU_IO_MAP(mjelctrn_io_map,0) |
| 3973 | MDRV_CPU_VBLANK_INT(mjelctrn_vblank_interrupt | |
| 3972 | MDRV_CPU_VBLANK_INT("main", mjelctrn_vblank_interrupt | |
| 3974 | 3973 | |
| 3975 | 3974 | MDRV_VIDEO_START(mjelctrn) |
| 3976 | 3975 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
| 4007 | 4006 | |
| 4008 | 4007 | MDRV_IMPORT_FROM( mjelctrn ) |
| 4009 | 4008 | MDRV_CPU_MODIFY("main") |
| 4010 | MDRV_CPU_VBLANK_INT(neruton_vblank_interrupt,1+10) /* IM 2 needs a vector on the data bus */ | |
| 4009 | MDRV_CPU_VBLANK_INT_HACK(neruton_vblank_interrupt,1+10) /* IM 2 needs a vector on the data bus */ | |
| 4011 | 4010 | |
| 4012 | 4011 | MDRV_VIDEO_START(neruton) |
| 4013 | 4012 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
| 4032 | 4031 | |
| 4033 | 4032 | MDRV_IMPORT_FROM( neruton ) |
| 4034 | 4033 | MDRV_CPU_MODIFY("main") |
| 4035 | MDRV_CPU_VBLANK_INT(majxtal7_vblank_interrupt | |
| 4034 | MDRV_CPU_VBLANK_INT("main", majxtal7_vblank_interrupt | |
| 4036 | 4035 | |
| 4037 | 4036 | MACHINE_DRIVER_END |
| 4038 | 4037 | |
| r1877 | r1878 | |
| 4054 | 4053 | MDRV_CPU_ADD_TAG("main",Z80,20000000 / 4) |
| 4055 | 4054 | MDRV_CPU_PROGRAM_MAP(yarunara_mem_map,0) |
| 4056 | 4055 | MDRV_CPU_IO_MAP(htengoku_io_map,0) |
| 4057 | MDRV_CPU_VBLANK_INT(sprtmtch_vblank_interrupt | |
| 4056 | MDRV_CPU_VBLANK_INT("main", sprtmtch_vblank_interrupt | |
| 4058 | 4057 | MDRV_CPU_PERIODIC_INT(yarunara_clock_interrupt, 60) // RTC |
| 4059 | 4058 | |
| 4060 | 4059 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r1877 | r1878 | |
| 4112 | 4111 | MDRV_CPU_ADD_TAG("main",TMP91640, 21472700 / 2) |
| 4113 | 4112 | MDRV_CPU_PROGRAM_MAP(tenkai_map,0) |
| 4114 | 4113 | MDRV_CPU_IO_MAP(tenkai_io_map,0) |
| 4115 | MDRV_CPU_VBLANK_INT(tenkai_interrupt,3) | |
| 4114 | MDRV_CPU_VBLANK_INT_HACK(tenkai_interrupt,3) | |
| 4116 | 4115 | |
| 4117 | 4116 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 4118 | 4117 |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | |
| 62 | 62 | static WRITE8_HANDLER( sound_cpu_command_w ) |
| 63 | 63 | { |
| 64 | soundlatch_w( offset, data ); | |
| 65 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 64 | soundlatch_w( machine, offset, data ); | |
| 65 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static WRITE8_HANDLER( shootout_flipscreen_w ) |
| r1877 | r1878 | |
| 305 | 305 | /* basic machine hardware */ |
| 306 | 306 | MDRV_CPU_ADD(M6502, 2000000) /* 2 MHz? */ |
| 307 | 307 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 308 | MDRV_CPU_VBLANK_INT(shootout_interrupt | |
| 308 | MDRV_CPU_VBLANK_INT("main", shootout_interrupt | |
| 309 | 309 | |
| 310 | 310 | MDRV_CPU_ADD(M6502, 1500000) |
| 311 | 311 | /* audio CPU */ |
| r1877 | r1878 | |
| 340 | 340 | /* basic machine hardware */ |
| 341 | 341 | MDRV_CPU_ADD(M6502, 2000000) /* 2 MHz? */ |
| 342 | 342 | MDRV_CPU_PROGRAM_MAP(readmem_alt,writemem_alt) |
| 343 | MDRV_CPU_VBLANK_INT(shootout_interrupt | |
| 343 | MDRV_CPU_VBLANK_INT("main", shootout_interrupt | |
| 344 | 344 | |
| 345 | 345 | /* video hardware */ |
| 346 | 346 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | |
| 62 | 62 | static WRITE8_HANDLER( cpu_sound_command_w ) |
| 63 | 63 | { |
| 64 | soundlatch_w(offset,data); | |
| 64 | soundlatch_w(machine,offset,data); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| r1877 | r1878 | |
| 249 | 249 | /* basic machine hardware */ |
| 250 | 250 | MDRV_CPU_ADD(M6809, 1500000) |
| 251 | 251 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 252 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 252 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 253 | 253 | |
| 254 | 254 | MDRV_CPU_ADD(M6809, 2000000) |
| 255 | 255 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 426 | 426 | /* basic machine hardware */ |
| 427 | 427 | MDRV_CPU_ADD_TAG( "MAIN", PSXCPU, XTAL_67_7376MHz ) |
| 428 | 428 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) |
| 429 | MDRV_CPU_VBLANK_INT( psx_vblank | |
| 429 | MDRV_CPU_VBLANK_INT("main", psx_vblank | |
| 430 | 430 | |
| 431 | 431 | /* video hardware */ |
| 432 | 432 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 462 | 462 | /* basic machine hardware */ |
| 463 | 463 | MDRV_CPU_ADD_TAG( "MAIN", PSXCPU, XTAL_100MHz ) |
| 464 | 464 | MDRV_CPU_PROGRAM_MAP( zn_map, 0 ) |
| 465 | MDRV_CPU_VBLANK_INT( psx_vblank | |
| 465 | MDRV_CPU_VBLANK_INT("main", psx_vblank | |
| 466 | 466 | |
| 467 | 467 | /* video hardware */ |
| 468 | 468 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 624 | 624 | |
| 625 | 625 | static WRITE32_HANDLER( zn_qsound_w ) |
| 626 | 626 | { |
| 627 | soundlatch_w(0, data); | |
| 628 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 627 | soundlatch_w(machine, 0, data); | |
| 628 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 629 | 629 | } |
| 630 | 630 | |
| 631 | 631 | static DRIVER_INIT( coh1000c ) |
| r1877 | r1878 | |
| 691 | 691 | /* audio CPU */ /* 8MHz ?? */ |
| 692 | 692 | MDRV_CPU_PROGRAM_MAP( qsound_readmem, qsound_writemem ) |
| 693 | 693 | MDRV_CPU_IO_MAP( qsound_readport, 0 ) |
| 694 | MDRV_CPU_VBLANK_INT( qsound_interrupt, 4 ) /* 4 interrupts per frame ?? */ | |
| 694 | MDRV_CPU_VBLANK_INT_HACK( qsound_interrupt, 4 ) /* 4 interrupts per frame ?? */ | |
| 695 | 695 | |
| 696 | 696 | MDRV_MACHINE_RESET( coh1000c ) |
| 697 | 697 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| r1877 | r1878 | |
| 709 | 709 | /* audio CPU */ /* 8MHz ?? */ |
| 710 | 710 | MDRV_CPU_PROGRAM_MAP( qsound_readmem, qsound_writemem ) |
| 711 | 711 | MDRV_CPU_IO_MAP( qsound_readport, 0 ) |
| 712 | MDRV_CPU_VBLANK_INT( qsound_interrupt, 4 ) /* 4 interrupts per frame ?? */ | |
| 712 | MDRV_CPU_VBLANK_INT_HACK( qsound_interrupt, 4 ) /* 4 interrupts per frame ?? */ | |
| 713 | 713 | |
| 714 | 714 | MDRV_MACHINE_RESET( coh1000c ) |
| 715 | 715 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| r1877 | r1878 | |
| 893 | 893 | MDRV_CPU_ADD( Z80, 8000000 ) |
| 894 | 894 | MDRV_CPU_PROGRAM_MAP( qsound_readmem, qsound_writemem ) |
| 895 | 895 | MDRV_CPU_IO_MAP( qsound_readport, 0 ) |
| 896 | MDRV_CPU_VBLANK_INT( qsound_interrupt, 4 ) /* 4 interrupts per frame ?? */ | |
| 896 | MDRV_CPU_VBLANK_INT_HACK( qsound_interrupt, 4 ) /* 4 interrupts per frame ?? */ | |
| 897 | 897 | |
| 898 | 898 | MDRV_MACHINE_RESET( coh3002c ) |
| 899 | 899 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| r1877 | r1878 | |
| 1197 | 1197 | |
| 1198 | 1198 | static READ32_HANDLER( taitofx1a_ymsound_r ) |
| 1199 | 1199 | { |
| 1200 | return taitosound_comm_r(0)<<16; | |
| 1200 | return taitosound_comm_r(machine, 0)<<16; | |
| 1201 | 1201 | } |
| 1202 | 1202 | |
| 1203 | 1203 | static WRITE32_HANDLER( taitofx1a_ymsound_w ) |
| 1204 | 1204 | { |
| 1205 | 1205 | if (mem_mask == 0xffff0000) |
| 1206 | 1206 | { |
| 1207 | taitosound_port_w(0, data&0xff); | |
| 1207 | taitosound_port_w(machine, 0, data&0xff); | |
| 1208 | 1208 | } |
| 1209 | 1209 | else |
| 1210 | 1210 | { |
| 1211 | taitosound_comm_w(0, (data>>16)&0xff); | |
| 1211 | taitosound_comm_w(machine, 0, (data>>16)&0xff); | |
| 1212 | 1212 | } |
| 1213 | 1213 | } |
| 1214 | 1214 | |
| r1877 | r1878 | |
| 1306 | 1306 | MDRV_IMPORT_FROM( zn1_1mb_vram ) |
| 1307 | 1307 | |
| 1308 | 1308 | MDRV_CPU_MODIFY( "MAIN" ) |
| 1309 | MDRV_CPU_VBLANK_INT( coh1000t_vblank | |
| 1309 | MDRV_CPU_VBLANK_INT("main", coh1000t_vblank | |
| 1310 | 1310 | |
| 1311 | 1311 | MDRV_CPU_ADD( Z80, 16000000 / 4 ) |
| 1312 | 1312 | /* audio CPU */ /* 4 MHz */ |
| r1877 | r1878 | |
| 1390 | 1390 | MDRV_IMPORT_FROM( zn1_2mb_vram ) |
| 1391 | 1391 | |
| 1392 | 1392 | MDRV_CPU_MODIFY( "MAIN" ) |
| 1393 | MDRV_CPU_VBLANK_INT( coh1000t_vblank | |
| 1393 | MDRV_CPU_VBLANK_INT("main", coh1000t_vblank | |
| 1394 | 1394 | |
| 1395 | 1395 | MDRV_MACHINE_RESET( coh1000tb ) |
| 1396 | 1396 | MDRV_NVRAM_HANDLER( coh1000tb ) |
| r1877 | r1878 | |
| 1705 | 1705 | n_size <<= 2; |
| 1706 | 1706 | while( n_size > 0 ) |
| 1707 | 1707 | { |
| 1708 | psxwritebyte( n_address, ide_controller32_0_r( 0x1f0 / 4, 0xffffff00 ) ); | |
| 1708 | psxwritebyte( n_address, ide_controller32_0_r( Machine, 0x1f0 / 4, 0xffffff00 ) ); | |
| 1709 | 1709 | n_address++; |
| 1710 | 1710 | n_size--; |
| 1711 | 1711 | } |
| r1877 | r1878 | |
| 1899 | 1899 | |
| 1900 | 1900 | static WRITE32_HANDLER( coh1002e_bank_w ) |
| 1901 | 1901 | { |
| 1902 | znsecsel_w( offset, data, mem_mask ); | |
| 1902 | znsecsel_w( machine, offset, data, mem_mask ); | |
| 1903 | 1903 | |
| 1904 | 1904 | memory_set_bankptr( 1, memory_region( REGION_USER2 ) + ( ( data & 3 ) * 0x800000 ) ); |
| 1905 | 1905 | } |
| r1877 | r1878 | |
| 1907 | 1907 | static WRITE32_HANDLER( coh1002e_latch_w ) |
| 1908 | 1908 | { |
| 1909 | 1909 | if (offset) |
| 1910 | cpunum_set_input_line( | |
| 1910 | cpunum_set_input_line(machine, 1, 2, HOLD_LINE); // irq 2 on the 68k | |
| 1911 | 1911 | else |
| 1912 | soundlatch_w(0, data); | |
| 1912 | soundlatch_w(machine, 0, data); | |
| 1913 | 1913 | } |
| 1914 | 1914 | |
| 1915 | 1915 | static DRIVER_INIT( coh1002e ) |
| r1877 | r1878 | |
| 1929 | 1929 | |
| 1930 | 1930 | static READ16_HANDLER( psarc_ymf_r ) |
| 1931 | 1931 | { |
| 1932 | return YMF271_0_r(0); | |
| 1932 | return YMF271_0_r(machine,0); | |
| 1933 | 1933 | } |
| 1934 | 1934 | |
| 1935 | 1935 | static WRITE16_HANDLER( psarc_ymf_w ) |
| 1936 | 1936 | { |
| 1937 | YMF271_0_w(offset, data); | |
| 1937 | YMF271_0_w(machine, offset, data); | |
| 1938 | 1938 | } |
| 1939 | 1939 | |
| 1940 | 1940 | static READ16_HANDLER( psarc_latch_r ) |
| 1941 | 1941 | { |
| 1942 | return soundlatch_r(0); | |
| 1942 | return soundlatch_r(machine,0); | |
| 1943 | 1943 | } |
| 1944 | 1944 | |
| 1945 | 1945 | static ADDRESS_MAP_START( psarc_snd_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1877 | r1878 | |
| 2486 | 2486 | MDRV_IMPORT_FROM( zn1_2mb_vram ) |
| 2487 | 2487 | |
| 2488 | 2488 | MDRV_CPU_MODIFY( "MAIN" ) |
| 2489 | MDRV_CPU_VBLANK_INT( coh1002v_vblank | |
| 2489 | MDRV_CPU_VBLANK_INT("main", coh1002v_vblank | |
| 2490 | 2490 | |
| 2491 | 2491 | MDRV_MACHINE_RESET( coh1002v ) |
| 2492 | 2492 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| r1877 | r1878 | |
| 2664 | 2664 | |
| 2665 | 2665 | cbaj_to_r3k &= ~2; |
| 2666 | 2666 | |
| 2667 | return soundlatch2_r(0) | ready<<24; | |
| 2667 | return soundlatch2_r(machine,0) | ready<<24; | |
| 2668 | 2668 | } |
| 2669 | 2669 | |
| 2670 | 2670 | static WRITE32_HANDLER( cbaj_z80_w ) |
| r1877 | r1878 | |
| 2698 | 2698 | static WRITE8_HANDLER( cbaj_z80_latch_w ) |
| 2699 | 2699 | { |
| 2700 | 2700 | cbaj_to_r3k |= 2; |
| 2701 | soundlatch2_w(0, data); | |
| 2701 | soundlatch2_w(machine, 0, data); | |
| 2702 | 2702 | } |
| 2703 | 2703 | |
| 2704 | 2704 | static READ8_HANDLER( cbaj_z80_ready_r ) |
| r1877 | r1878 | |
|---|---|---|
| 30 | 30 | ***************************************************************************/ |
| 31 | 31 | |
| 32 | 32 | #include "driver.h" |
| 33 | #include "deprecat.h" | |
| 33 | 34 | #include "paradise.h" |
| 34 | 35 | #include "sound/okim6295.h" |
| 35 | 36 | |
| r1877 | r1878 | |
| 539 | 540 | MDRV_CPU_ADD_TAG("main", Z80, XTAL_12MHz/2) /* Z8400B - 6mhz Verified */ |
| 540 | 541 | MDRV_CPU_PROGRAM_MAP(paradise_map,0) |
| 541 | 542 | MDRV_CPU_IO_MAP(paradise_readport,paradise_writeport) |
| 542 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) /* No nmi routine */ | |
| 543 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* No nmi routine */ | |
| 543 | 544 | |
| 544 | 545 | /* video hardware */ |
| 545 | 546 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 265 | 265 | /* basic machine hardware */ |
| 266 | 266 | MDRV_CPU_ADD(M68000, 8000000) /* 8MHz */ |
| 267 | 267 | MDRV_CPU_PROGRAM_MAP(volfied_readmem,volfied_writemem) |
| 268 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 268 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 269 | 269 | |
| 270 | 270 | MDRV_CPU_ADD(Z80, 4000000) /* sound CPU, required to run the game */ |
| 271 | 271 | MDRV_CPU_PROGRAM_MAP(z80_readmem,z80_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 142 | 142 | { |
| 143 | 143 | /* bit 3 = watchdog */ |
| 144 | 144 | if (data & 0x08) |
| 145 | watchdog_reset | |
| 145 | watchdog_reset | |
| 146 | 146 | |
| 147 | 147 | /* bit 2-0 = SH0-2 */ |
| 148 | 148 | sh = data & 0x07; |
| r1877 | r1878 | |
| 159 | 159 | static READ8_HANDLER( ioread ) |
| 160 | 160 | { |
| 161 | 161 | if (offset & 0x08) |
| 162 | return ppi8255_0_r(offset & 3); | |
| 162 | return ppi8255_0_r(machine, offset & 3); | |
| 163 | 163 | else if (offset & 0x10) |
| 164 | return ppi8255_1_r(offset & 3); | |
| 164 | return ppi8255_1_r(machine, offset & 3); | |
| 165 | 165 | return 0xff; |
| 166 | 166 | } |
| 167 | 167 | |
| r1877 | r1878 | |
| 169 | 169 | static WRITE8_HANDLER( iowrite ) |
| 170 | 170 | { |
| 171 | 171 | if (offset & 0x08) |
| 172 | ppi8255_0_w(offset & 3, data); | |
| 172 | ppi8255_0_w(machine, offset & 3, data); | |
| 173 | 173 | else if (offset & 0x10) |
| 174 | ppi8255_1_w(offset & 3, data); | |
| 174 | ppi8255_1_w(machine, offset & 3, data); | |
| 175 | 175 | else if (offset & 0x40) |
| 176 | 176 | { |
| 177 | 177 | dr = ds; |
| r1877 | r1878 | |
| 301 | 301 | MDRV_CPU_ADD(Z80, 5000000) |
| 302 | 302 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 303 | 303 | MDRV_CPU_IO_MAP(readport,writeport) |
| 304 | MDRV_CPU_VBLANK_INT(dribling_irq_gen | |
| 304 | MDRV_CPU_VBLANK_INT("main", dribling_irq_gen | |
| 305 | 305 | |
| 306 | 306 | MDRV_MACHINE_RESET(dribling) |
| 307 | 307 |
| r1877 | r1878 | |
|---|---|---|
| 43 | 43 | |
| 44 | 44 | static READ8_HANDLER(frogger_ppi8255_0_r) |
| 45 | 45 | { |
| 46 | return ppi8255_0_r(offset >> 1); | |
| 46 | return ppi8255_0_r(machine, offset >> 1); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | static READ8_HANDLER(frogger_ppi8255_1_r) |
| 50 | 50 | { |
| 51 | return ppi8255_1_r(offset >> 1); | |
| 51 | return ppi8255_1_r(machine, offset >> 1); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | static WRITE8_HANDLER(frogger_ppi8255_0_w) |
| 55 | 55 | { |
| 56 | ppi8255_0_w(offset >> 1, data); | |
| 56 | ppi8255_0_w(machine, offset >> 1, data); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | static WRITE8_HANDLER(frogger_ppi8255_1_w) |
| 60 | 60 | { |
| 61 | ppi8255_1_w(offset >> 1, data); | |
| 61 | ppi8255_1_w(machine, offset >> 1, data); | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 |
| r1877 | r1878 | |
|---|---|---|
| 212 | 212 | 9e0e W - R 1800e ($e,A3) : \ |
| 213 | 213 | 9e0f W - 1800f ($f,A3) : / partial pointer into SHM gfx data |
| 214 | 214 | |
| 215 | *************************************************************************** | |
| 216 | ||
| 217 | DIP locations verified for: | |
| 218 | - stompin (manual) | |
| 219 | ||
| 215 | 220 | ***************************************************************************/ |
| 216 | 221 | |
| 217 | 222 | #include "driver.h" |
| r1877 | r1878 | |
| 297 | 302 | * |
| 298 | 303 | *************************************/ |
| 299 | 304 | |
| 300 | #define UNUSED_ANALOG \ | |
| 301 | PORT_START\ | |
| 302 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 303 | #define UNUSED_ANALOG_X2 UNUSED_ANALOG UNUSED_ANALOG | |
| 304 | #define UNUSED_ANALOG_X3 UNUSED_ANALOG_X2 UNUSED_ANALOG | |
| 305 | #define UNUSED_ANALOG_X4 UNUSED_ANALOG_X2 UNUSED_ANALOG_X2 | |
| 305 | #define UNUSED_ANALOG PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 306 | 306 | |
| 307 | #define PLAYER1_ANALOG_JOYSTICK \ | |
| 308 | PORT_START\ | |
| 309 | PORT_BIT( 0xff, 0, IPT_AD_STICK_Y ) PORT_MINMAX(0x80,0x7f) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_PLAYER(1)\ | |
| 310 | PORT_START\ | |
| 311 | PORT_BIT( 0xff, 0, IPT_AD_STICK_X ) PORT_MINMAX(0x80,0x7f) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_REVERSE PORT_PLAYER(1) | |
| 307 | #define BALSENTE_COINAGE_ALT \ | |
| 308 | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ) ) PORT_DIPLOCATION("H1:1,2") \ | |
| 309 | PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) ) \ | |
| 310 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) \ | |
| 311 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) \ | |
| 312 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) | |
| 312 | 313 | |
| 313 | #define PLAYER2_ANALOG_JOYSTICK \ | |
| 314 | PORT_START\ | |
| 315 | PORT_BIT( 0xff, 0, IPT_AD_STICK_Y ) PORT_MINMAX(0x80,0x7f) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_PLAYER(2)\ | |
| 316 | PORT_START\ | |
| 317 | PORT_BIT( 0xff, 0, IPT_AD_STICK_X ) PORT_MINMAX(0x80,0x7f) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_REVERSE PORT_PLAYER(2) | |
| 314 | #define BALSENTE_COINAGE_ALT2 \ | |
| 315 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("H1:1,2") \ | |
| 316 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) ) \ | |
| 317 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) \ | |
| 318 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) \ | |
| 319 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 318 | 320 | |
| 319 | #define PLAYER1_TRACKBALL \ | |
| 320 | PORT_START\ | |
| 321 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_PLAYER(1)\ | |
| 322 | PORT_START\ | |
| 323 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_REVERSE PORT_PLAYER(1) | |
| 321 | #define BALSENTE_PLAYERS_PER_COIN \ | |
| 322 | PORT_DIPNAME( 0x04, 0x04, "Players Per Credit" ) PORT_DIPLOCATION("H1:3") \ | |
| 323 | PORT_DIPSETTING( 0x00, "1" ) \ | |
| 324 | PORT_DIPSETTING( 0x04, "1 Or 2" ) | |
| 324 | 325 | |
| 325 | #define PLAYER2_TRACKBALL \ | |
| 326 | PORT_START\ | |
| 327 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_PLAYER(2)\ | |
| 328 | PORT_START\ | |
| 329 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_REVERSE PORT_PLAYER(2) | |
| 330 | ||
| 331 | #define PLAYER1_DIAL \ | |
| 332 | PORT_START\ | |
| 333 | PORT_BIT( 0xff, 0, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_REVERSE PORT_PLAYER(1) | |
| 334 | ||
| 335 | #define PLAYER2_DIAL \ | |
| 336 | PORT_START\ | |
| 337 | PORT_BIT( 0xff, 0, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_REVERSE PORT_PLAYER(2) | |
| 338 | ||
| 339 | #define PLAYER1_WHEEL \ | |
| 340 | PORT_START\ | |
| 341 | PORT_BIT( 0xff, 0, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_PLAYER(1) | |
| 342 | ||
| 343 | #define PLAYER1_CROSSHAIRS \ | |
| 344 | PORT_START /* fake analog X */\ | |
| 345 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10)\ | |
| 346 | PORT_START /* fake analog Y */\ | |
| 347 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) | |
| 348 | ||
| 349 | ||
| 350 | 326 | static INPUT_PORTS_START( sentetst ) |
| 351 | PORT_START /* IN0 */ | |
| 352 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) | |
| 327 | PORT_START_TAG("IN0") | |
| 328 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION("H1:1,2") | |
| 353 | 329 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) |
| 354 | 330 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) |
| 355 | 331 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) |
| 356 | 332 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) |
| 357 | PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 358 | PORT_DIPNAME( 0x80, 0x80, "High Scores" ) | |
| 333 | PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "H1:3" ) | |
| 334 | PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "H1:4" ) | |
| 335 | PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "H1:5" ) | |
| 336 | PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "H1:6" ) | |
| 337 | PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "H1:7" ) | |
| 338 | PORT_DIPNAME( 0x80, 0x80, "High Scores" ) PORT_DIPLOCATION("H1:8") | |
| 359 | 339 | PORT_DIPSETTING( 0x80, "Keep Top 5" ) |
| 360 | 340 | PORT_DIPSETTING( 0x00, "Keep All" ) |
| 361 | 341 | |
| 362 | PORT_START /* IN1 */ | |
| 363 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) ) | |
| 342 | PORT_START_TAG("IN1") | |
| 343 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("G1:1,2") | |
| 364 | 344 | PORT_DIPSETTING( 0x00, "Every 10,000" ) |
| 365 | 345 | PORT_DIPSETTING( 0x01, "Every 15,000" ) |
| 366 | 346 | PORT_DIPSETTING( 0x02, "Every 20,000" ) |
| 367 | 347 | PORT_DIPSETTING( 0x03, "Every 25,000" ) |
| 368 | PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) ) | |
| 348 | PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) ) PORT_DIPLOCATION("G1:3,4") | |
| 369 | 349 | PORT_DIPSETTING( 0x00, "2" ) |
| 370 | 350 | PORT_DIPSETTING( 0x04, "3" ) |
| 371 | 351 | PORT_DIPSETTING( 0x08, "4" ) |
| 372 | 352 | PORT_DIPSETTING( 0x0c, "5" ) |
| 373 | PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 374 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) | |
| 353 | PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "G1:5" ) | |
| 354 | PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "G1:6" ) | |
| 355 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("G1:7") | |
| 375 | 356 | PORT_DIPSETTING( 0x40, DEF_STR( Easy ) ) |
| 376 | 357 | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) |
| 377 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 358 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("G1:8") | |
| 378 | 359 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 379 | 360 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 380 | 361 | |
| 381 | PORT_START | |
| 362 | PORT_START_TAG("IN2") | |
| 382 | 363 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(1) |
| 383 | 364 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(1) |
| 384 | 365 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(1) |
| r1877 | r1878 | |
| 387 | 368 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 388 | 369 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 389 | 370 | |
| 390 | PORT_START | |
| 371 | PORT_START_TAG("IN3") | |
| 391 | 372 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 392 | 373 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 393 | 374 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| r1877 | r1878 | |
| 395 | 376 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 396 | 377 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) |
| 397 | 378 | |
| 398 | /* analog ports */ | |
| 399 | UNUSED_ANALOG_X2 | |
| 400 | PLAYER1_TRACKBALL | |
| 379 | /* Analog ports */ | |
| 380 | PORT_START_TAG("AN0") | |
| 381 | UNUSED_ANALOG | |
| 382 | ||
| 383 | PORT_START_TAG("AN1") | |
| 384 | UNUSED_ANALOG | |
| 385 | ||
| 386 | /* Player 1 Trackball */ | |
| 387 | PORT_START_TAG("AN2") | |
| 388 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_PLAYER(1) | |
| 389 | ||
| 390 | PORT_START_TAG("AN3") | |
| 391 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_REVERSE PORT_PLAYER(1) | |
| 401 | 392 | INPUT_PORTS_END |
| 402 | 393 | |
| 403 | 394 | |
| 404 | 395 | static INPUT_PORTS_START( cshift ) |
| 405 | PORT_START /* IN0 */ | |
| 406 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) | |
| 407 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 408 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) | |
| 409 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 410 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) | |
| 411 | PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 412 | PORT_DIPNAME( 0x80, 0x80, "High Scores" ) | |
| 413 | PORT_DIPSETTING( 0x80, "Keep Top 5" ) | |
| 414 | PORT_DIPSETTING( 0x00, "Keep All" ) | |
| 396 | PORT_INCLUDE( sentetst ) | |
| 415 | 397 | |
| 416 | PORT_START /* IN1 */ | |
| 417 | PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 418 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) ) | |
| 398 | PORT_MODIFY("IN1") | |
| 399 | PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "G1:1" ) | |
| 400 | PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "G1:2" ) | |
| 401 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) ) PORT_DIPLOCATION("G1:3") | |
| 419 | 402 | PORT_DIPSETTING( 0x00, "2" ) |
| 420 | 403 | PORT_DIPSETTING( 0x04, "3" ) |
| 421 | PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 422 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 423 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 424 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 404 | PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "G1:4" ) | |
| 405 | PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "G1:5" ) | |
| 406 | PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "G1:6" ) | |
| 407 | PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "G1:7" ) | |
| 425 | 408 | |
| 426 | PORT_ | |
| 409 | PORT_MOD | |
| 427 | 410 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 428 | 411 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 429 | 412 | PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 430 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 431 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 432 | 413 | |
| 433 | PORT_START /* IN3 */ | |
| 434 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 435 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 414 | PORT_MODIFY("IN3") | |
| 436 | 415 | PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 437 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 438 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 439 | 416 | |
| 440 | /* analog ports */ | |
| 441 | UNUSED_ANALOG_X4 | |
| 417 | PORT_MODIFY("AN2") | |
| 418 | UNUSED_ANALOG | |
| 419 | ||
| 420 | PORT_MODIFY("AN3") | |
| 421 | UNUSED_ANALOG | |
| 442 | 422 | INPUT_PORTS_END |
| 443 | 423 | |
| 444 | 424 | |
| 445 | 425 | static INPUT_PORTS_START( gghost ) |
| 446 | PORT_START /* IN0 */ | |
| 447 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) | |
| 448 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 449 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) | |
| 450 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 451 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) | |
| 452 | PORT_DIPNAME( 0x04, 0x04, "Players per Credit" ) | |
| 453 | PORT_DIPSETTING( 0x00, "1" ) | |
| 454 | PORT_DIPSETTING( 0x04, "1 or 2" ) | |
| 455 | PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 426 | PORT_INCLUDE( sentetst ) | |
| 456 | 427 | |
| 457 | PORT_START /* IN1 */ | |
| 458 | PORT_DIPNAME( 0x07, 0x05, "Game Duration" ) | |
| 459 | PORT_DIPSETTING( 0x00, "9 points" ) | |
| 460 | PORT_DIPSETTING( 0x02, "11 points" ) | |
| 461 | PORT_DIPSETTING( 0x04, "15 points" ) | |
| 462 | PORT_DIPSETTING( 0x06, "21 points" ) | |
| 463 | PORT_DIPSETTING( 0x01, "timed, 1:15" ) | |
| 464 | PORT_DIPSETTING( 0x03, "timed, 1:30" ) | |
| 465 | PORT_DIPSETTING( 0x05, "timed, 2:00" ) | |
| 466 | PORT_DIPSETTING( 0x07, "timed, 2:30" ) | |
| 467 | PORT_BIT( 0x78, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 468 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 469 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 470 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 428 | PORT_MODIFY("IN0") | |
| 429 | BALSENTE_PLAYERS_PER_COIN | |
| 430 | PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "H1:8" ) | |
| 471 | 431 | |
| 472 | PORT_START /* IN2 */ | |
| 432 | PORT_MODIFY("IN1") | |
| 433 | PORT_DIPNAME( 0x07, 0x05, "Game Duration" ) PORT_DIPLOCATION("G1:1,2,3") | |
| 434 | PORT_DIPSETTING( 0x00, "9 Points" ) | |
| 435 | PORT_DIPSETTING( 0x02, "11 Points" ) | |
| 436 | PORT_DIPSETTING( 0x04, "15 Points" ) | |
| 437 | PORT_DIPSETTING( 0x06, "21 Points" ) | |
| 438 | PORT_DIPSETTING( 0x01, "Timed, 1:15" ) | |
| 439 | PORT_DIPSETTING( 0x03, "Timed, 1:30" ) | |
| 440 | PORT_DIPSETTING( 0x05, "Timed, 2:00" ) | |
| 441 | PORT_DIPSETTING( 0x07, "Timed, 2:30" ) | |
| 442 | PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "G1:5" ) | |
| 443 | PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "G1:4" ) | |
| 444 | PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "G1:3" ) | |
| 445 | PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "G1:2" ) | |
| 446 | ||
| 447 | PORT_MODIFY("IN2") | |
| 473 | 448 | PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 474 | 449 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 475 | 450 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 476 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 477 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 478 | 451 | |
| 479 | PORT_START /* IN3 */ | |
| 480 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 481 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 452 | PORT_MODIFY("IN3") | |
| 482 | 453 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 483 | 454 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 484 | 455 | PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 485 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 486 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 487 | 456 | |
| 488 | /* analog ports */ | |
| 489 | PLAYER2_TRACKBALL | |
| 490 | PLAYER1_TRACKBALL | |
| 457 | /* Player 2 Trackball */ | |
| 458 | PORT_MODIFY("AN0") | |
| 459 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_PLAYER(2) | |
| 460 | ||
| 461 | PORT_MODIFY("AN1") | |
| 462 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_REVERSE PORT_PLAYER(2) | |
| 463 | ||
| 464 | /* Player 1 Trackball */ | |
| 465 | PORT_MODIFY("AN2") | |
| 466 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_PLAYER(1) | |
| 467 | ||
| 468 | PORT_MODIFY("AN3") | |
| 469 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_REVERSE PORT_PLAYER(1) | |
| 491 | 470 | INPUT_PORTS_END |
| 492 | 471 | |
| 493 | 472 | |
| 494 | 473 | static INPUT_PORTS_START( hattrick ) |
| 495 | PORT_START /* IN0 */ | |
| 496 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) | |
| 497 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 498 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) | |
| 499 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 500 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) | |
| 501 | PORT_DIPNAME( 0x04, 0x04, "Players Per Credit" ) | |
| 502 | PORT_DIPSETTING( 0x00, "1" ) | |
| 503 | PORT_DIPSETTING( 0x04, "1 or 2" ) | |
| 504 | PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 474 | PORT_INCLUDE( sentetst ) | |
| 505 | 475 | |
| 506 | PORT_START /* IN1 */ | |
| 507 | PORT_DIPNAME( 0x07, 0x02, DEF_STR( Game_Time ) ) | |
| 476 | PORT_MODIFY("IN0") | |
| 477 | BALSENTE_PLAYERS_PER_COIN | |
| 478 | PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "H1:8" ) | |
| 479 | ||
| 480 | PORT_MODIFY("IN1") | |
| 481 | PORT_DIPNAME( 0x07, 0x02, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("G1:1,2,3") | |
| 508 | 482 | PORT_DIPSETTING( 0x00, "1:15" ) |
| 509 | 483 | PORT_DIPSETTING( 0x01, "1:30" ) |
| 510 | 484 | PORT_DIPSETTING( 0x02, "1:45" ) |
| r1877 | r1878 | |
| 513 | 487 | PORT_DIPSETTING( 0x05, "2:30" ) |
| 514 | 488 | PORT_DIPSETTING( 0x06, "2:45" ) |
| 515 | 489 | PORT_DIPSETTING( 0x07, "3:00" ) |
| 516 | PORT_BIT( 0x78, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 517 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 518 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 519 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 490 | PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "G1:4" ) | |
| 491 | PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "G1:5" ) | |
| 492 | PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "G1:6" ) | |
| 493 | PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "G1:7" ) | |
| 520 | 494 | |
| 521 | PORT_START /* IN2 */ | |
| 522 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) | |
| 523 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) | |
| 524 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) | |
| 525 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) | |
| 495 | PORT_MODIFY("IN2") | |
| 526 | 496 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 527 | 497 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 528 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 529 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 530 | 498 | |
| 531 | PORT_START /* IN3 */ | |
| 532 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 533 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 499 | PORT_MODIFY("IN3") | |
| 534 | 500 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) |
| 535 | 501 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) |
| 536 | 502 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) |
| 537 | 503 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) |
| 538 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 539 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 540 | 504 | |
| 541 | /* analog ports */ | |
| 542 | UNUSED_ANALOG_X4 | |
| 505 | PORT_MODIFY("AN2") | |
| 506 | UNUSED_ANALOG | |
| 507 | ||
| 508 | PORT_MODIFY("AN3") | |
| 509 | UNUSED_ANALOG | |
| 543 | 510 | INPUT_PORTS_END |
| 544 | 511 | |
| 545 | 512 | |
| 546 | 513 | static INPUT_PORTS_START( otwalls ) |
| 547 | PORT_START /* IN0 */ | |
| 548 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) | |
| 549 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 550 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) | |
| 551 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 552 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) | |
| 553 | PORT_DIPNAME( 0x04, 0x04, "Players Per Credit" ) | |
| 554 | PORT_DIPSETTING( 0x00, "1" ) | |
| 555 | PORT_DIPSETTING( 0x04, "1 or 2" ) | |
| 556 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 514 | PORT_INCLUDE( sentetst ) | |
| 557 | 515 | |
| 558 | PORT_START /* IN1 */ | |
| 559 | PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 560 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 561 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 562 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 516 | PORT_MODIFY("IN0") | |
| 517 | BALSENTE_PLAYERS_PER_COIN | |
| 518 | PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "H1:8" ) | |
| 563 | 519 | |
| 564 | PORT_START /* IN2 */ | |
| 520 | PORT_MODIFY("IN1") | |
| 521 | PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "G1:1" ) | |
| 522 | PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "G1:2" ) | |
| 523 | PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "G1:3" ) | |
| 524 | PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "G1:4" ) | |
| 525 | PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "G1:7" ) | |
| 526 | ||
| 527 | PORT_MODIFY("IN2") | |
| 565 | 528 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(2) |
| 566 | 529 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(2) |
| 567 | 530 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(1) |
| 568 | 531 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(1) |
| 569 | PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 570 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 571 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 572 | 532 | |
| 573 | PORT_START /* IN3 */ | |
| 574 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 575 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 576 | PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 577 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 578 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 533 | PORT_MODIFY("IN3") | |
| 534 | UNUSED_ANALOG | |
| 579 | 535 | |
| 580 | /* analog ports */ | |
| 581 | UNUSED_ANALOG_X2 | |
| 582 | PLAYER1_DIAL | |
| 583 | PLAYER2_DIAL | |
| 584 | INPUT_PORTS_END | |
| 536 | /* Player 1 Dial */ | |
| 537 | PORT_MODIFY("AN2") | |
| 538 | PORT_BIT( 0xff, 0, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_REVERSE PORT_PLAYER(1) | |
| 585 | 539 | |
| 586 | ||
| 587 | static INPUT_PORTS_START( snakepit ) | |
| 588 | PORT_START /* IN0 */ | |
| 589 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) | |
| 590 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 591 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) | |
| 592 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 593 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) | |
| 594 | PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 595 | PORT_DIPNAME( 0x80, 0x80, "High Scores" ) | |
| 596 | PORT_DIPSETTING( 0x80, "Keep Top 5" ) | |
| 597 | PORT_DIPSETTING( 0x00, "Keep All" ) | |
| 598 | ||
| 599 | PORT_START /* IN1 */ | |
| 600 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) ) | |
| 601 | PORT_DIPSETTING( 0x00, "Every 10,000" ) | |
| 602 | PORT_DIPSETTING( 0x01, "Every 15,000" ) | |
| 603 | PORT_DIPSETTING( 0x02, "Every 20,000" ) | |
| 604 | PORT_DIPSETTING( 0x03, "Every 25,000" ) | |
| 605 | PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) ) | |
| 606 | PORT_DIPSETTING( 0x00, "2" ) | |
| 607 | PORT_DIPSETTING( 0x04, "3" ) | |
| 608 | PORT_DIPSETTING( 0x08, "4" ) | |
| 609 | PORT_DIPSETTING( 0x0c, "5" ) | |
| 610 | PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 611 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) | |
| 612 | PORT_DIPSETTING( 0x40, DEF_STR( Easy ) ) | |
| 613 | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) | |
| 614 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 615 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 616 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 617 | ||
| 618 | PORT_START /* IN2 */ | |
| 619 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(1) | |
| 620 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(1) | |
| 621 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(1) | |
| 622 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(1) | |
| 623 | PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 624 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 625 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 626 | ||
| 627 | PORT_START /* IN3 */ | |
| 628 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 629 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 630 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 631 | PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 632 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 633 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 634 | ||
| 635 | /* analog ports */ | |
| 636 | UNUSED_ANALOG_X2 | |
| 637 | PLAYER1_TRACKBALL | |
| 540 | /* Player 2 Dial */ | |
| 541 | PORT_MODIFY("AN3") | |
| 542 | PORT_BIT( 0xff, 0, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_REVERSE PORT_PLAYER(2) | |
| 638 | 543 | INPUT_PORTS_END |
| 639 | 544 | |
| 640 | 545 | |
| 641 | 546 | static INPUT_PORTS_START( snakjack ) |
| 642 | PORT_START /* IN0 */ | |
| 643 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) | |
| 644 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 645 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) | |
| 646 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 647 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) | |
| 648 | PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 649 | PORT_DIPNAME( 0x80, 0x80, "High Scores" ) | |
| 650 | PORT_DIPSETTING( 0x80, "Keep Top 5" ) | |
| 651 | PORT_DIPSETTING( 0x00, "Keep All" ) | |
| 547 | PORT_INCLUDE( sentetst ) | |
| 652 | 548 | |
| 653 | PORT_START /* IN1 */ | |
| 654 | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) ) | |
| 549 | PORT_MODIFY("IN1") | |
| 550 | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("G1:1,2") | |
| 655 | 551 | PORT_DIPSETTING( 0x00, "Every 15,000" ) |
| 656 | 552 | PORT_DIPSETTING( 0x01, "Every 20,000" ) |
| 657 | 553 | PORT_DIPSETTING( 0x02, "Every 25,000" ) |
| 658 | 554 | PORT_DIPSETTING( 0x03, "Every 30,000" ) |
| 659 | PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) ) | |
| 660 | PORT_DIPSETTING( 0x00, "2" ) | |
| 661 | PORT_DIPSETTING( 0x04, "3" ) | |
| 662 | PORT_DIPSETTING( 0x08, "4" ) | |
| 663 | PORT_DIPSETTING( 0x0c, "5" ) | |
| 664 | PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 665 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 666 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 667 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 555 | PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "G1:7" ) | |
| 668 | 556 | |
| 669 | PORT_START /* IN2 */ | |
| 670 | PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 671 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 672 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 673 | ||
| 674 | PORT_START /* IN3 */ | |
| 675 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 676 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 677 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 678 | PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 679 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 680 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 681 | ||
| 682 | /* analog ports */ | |
| 683 | UNUSED_ANALOG_X2 | |
| 684 | PLAYER1_TRACKBALL | |
| 557 | PORT_MODIFY("IN2") | |
| 558 | PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 685 | 559 | INPUT_PORTS_END |
| 686 | 560 | |
| 687 | 561 | |
| 688 | 562 | static INPUT_PORTS_START( stocker ) |
| 689 | PORT_START /* IN0 */ | |
| 690 | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ) ) | |
| 691 | PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) ) | |
| 692 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) | |
| 693 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) | |
| 694 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) | |
| 695 | PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" ) | |
| 563 | PORT_INCLUDE( sentetst ) | |
| 564 | ||
| 565 | PORT_MODIFY("IN0") | |
| 566 | PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" ) PORT_DIPLOCATION("H1:3,4,5") | |
| 696 | 567 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) |
| 697 | 568 | PORT_DIPSETTING( 0x04, "2 Coins = 1 Bonus" ) |
| 698 | 569 | PORT_DIPSETTING( 0x08, "3 Coins = 1 Bonus" ) |
| r1877 | r1878 | |
| 701 | 572 | PORT_DIPSETTING( 0x14, "5 Coins = 1 Bonus" ) |
| 702 | 573 | PORT_DIPSETTING( 0x18, "5 Coins = 2 Bonus" ) |
| 703 | 574 | PORT_DIPSETTING( 0x1c, "5 Coins = 3 Bonus" ) |
| 704 | PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" ) | |
| 575 | PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" ) PORT_DIPLOCATION("H1:6") | |
| 705 | 576 | PORT_DIPSETTING( 0x00, "x1" ) |
| 706 | 577 | PORT_DIPSETTING( 0x20, "x2" ) |
| 707 | PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" ) | |
| 578 | PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" ) PORT_DIPLOCATION("H1:7,8") | |
| 708 | 579 | PORT_DIPSETTING( 0x00, "x1" ) |
| 709 | 580 | PORT_DIPSETTING( 0x40, "x4" ) |
| 710 | 581 | PORT_DIPSETTING( 0x80, "x5" ) |
| 711 | 582 | PORT_DIPSETTING( 0xc0, "x6" ) |
| 712 | 583 | |
| 713 | PORT_START /* IN1 */ | |
| 714 | PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 715 | PORT_DIPNAME( 0x40, 0x40, "End of Game" ) | |
| 584 | PORT_MODIFY("IN1") | |
| 585 | PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "G1:1" ) | |
| 586 | PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "G1:2" ) | |
| 587 | PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "G1:3" ) | |
| 588 | PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "G1:4" ) | |
| 589 | PORT_DIPNAME( 0x40, 0x40, "End Of Game" ) PORT_DIPLOCATION("G1:7") | |
| 716 | 590 | PORT_DIPSETTING( 0x40, DEF_STR( Normal ) ) |
| 717 | 591 | PORT_DIPSETTING( 0x00, "3 Tickets" ) |
| 718 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 719 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 720 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 721 | 592 | |
| 722 | PORT_START /* IN2 */ | |
| 723 | PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 724 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 725 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 593 | PORT_MODIFY("IN2") | |
| 594 | PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 726 | 595 | |
| 727 | PORT_START /* IN3 */ | |
| 728 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 596 | PORT_MODIFY("IN3") | |
| 729 | 597 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 730 | PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 731 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 732 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 598 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 733 | 599 | |
| 734 | /* analog ports */ | |
| 735 | UNUSED_ANALOG_X3 | |
| 736 | PLAYER1_WHEEL | |
| 600 | PORT_MODIFY("AN2") | |
| 601 | UNUSED_ANALOG | |
| 602 | ||
| 603 | /* Player 1 Wheel */ | |
| 604 | PORT_MODIFY("AN3") | |
| 605 | PORT_BIT( 0xff, 0, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_PLAYER(1) | |
| 737 | 606 | INPUT_PORTS_END |
| 738 | 607 | |
| 739 | 608 | |
| 740 | 609 | static INPUT_PORTS_START( triviag1 ) |
| 741 | PORT_START /* IN0 */ | |
| 742 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) | |
| 743 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 744 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) | |
| 745 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 746 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) | |
| 747 | PORT_BIT( 0x1c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 748 | PORT_DIPNAME( 0x20, 0x00, "Sound" ) | |
| 610 | PORT_INCLUDE( sentetst ) | |
| 611 | ||
| 612 | PORT_MODIFY("IN0") | |
| 613 | PORT_DIPNAME( 0x20, 0x00, "Sound" ) PORT_DIPLOCATION("H1:6") | |
| 749 | 614 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 750 | 615 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 751 | PORT_DIPNAME( 0x40, 0x00, "Sound Test" ) | |
| 616 | PORT_DIPNAME( 0x40, 0x00, "Sound Test" ) PORT_DIPLOCATION("H1:7") | |
| 752 | 617 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 753 | 618 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 754 | PORT_DIPNAME( 0x80, 0x80, "High Scores" ) | |
| 619 | PORT_DIPNAME( 0x80, 0x80, "High Scores" ) PORT_DIPLOCATION("H1:8") | |
| 755 | 620 | PORT_DIPSETTING( 0x00, "Keep Top 5" ) |
| 756 | 621 | PORT_DIPSETTING( 0x80, "Keep Top 10" ) |
| 757 | 622 | |
| 758 | PORT_START /* IN1 */ | |
| 759 | PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 760 | PORT_DIPNAME( 0x0c, 0x04, "Guesses" ) | |
| 623 | PORT_MODIFY("IN1") | |
| 624 | PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "G1:1" ) | |
| 625 | PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "G1:2" ) | |
| 626 | PORT_DIPNAME( 0x0c, 0x04, "Guesses" ) PORT_DIPLOCATION("G1:3,4") | |
| 761 | 627 | PORT_DIPSETTING( 0x00, "3" ) |
| 762 | 628 | PORT_DIPSETTING( 0x04, "4" ) |
| 763 | 629 | PORT_DIPSETTING( 0x08, "5" ) |
| 764 | 630 | PORT_DIPSETTING( 0x0c, "6" ) |
| 765 | PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 766 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 767 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 768 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 631 | PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "G1:7" ) | |
| 769 | 632 | |
| 770 | PORT_START /* IN2 */ | |
| 771 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) | |
| 772 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) | |
| 773 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) | |
| 774 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) | |
| 633 | PORT_MODIFY("IN2") | |
| 775 | 634 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 776 | 635 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 777 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 778 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 779 | 636 | |
| 780 | PORT_START /* IN3 */ | |
| 781 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 782 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 637 | PORT_MODIFY("IN3") | |
| 783 | 638 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 ) |
| 784 | 639 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START4 ) |
| 785 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Red Button") | |
| 786 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Green Button") | |
| 787 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 788 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 640 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Red Button") | |
| 641 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Green Button") | |
| 789 | 642 | |
| 790 | /* analog ports */ | |
| 791 | UNUSED_ANALOG_X4 | |
| 643 | PORT_MODIFY("AN2") | |
| 644 | UNUSED_ANALOG | |
| 645 | ||
| 646 | PORT_MODIFY("AN3") | |
| 647 | UNUSED_ANALOG | |
| 792 | 648 | INPUT_PORTS_END |
| 793 | 649 | |
| 794 | 650 | |
| 795 | 651 | static INPUT_PORTS_START( triviaes ) |
| 796 | PORT_START /* IN0 */ | |
| 797 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) | |
| 652 | PORT_INCLUDE( triviag1 ) | |
| 653 | ||
| 654 | PORT_MODIFY("IN0") | |
| 655 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("H1:1,2") | |
| 798 | 656 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) |
| 799 | 657 | PORT_DIPSETTING( 0x03, DEF_STR( Free_Play ) ) |
| 800 | 658 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C) ) |
| 801 | 659 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) |
| 802 | PORT_BIT( 0x1c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 803 | PORT_DIPNAME( 0x20, 0x00, "Sound" ) | |
| 804 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 805 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 806 | PORT_DIPNAME( 0x40, 0x00, "Sound Test" ) | |
| 807 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 808 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 809 | PORT_DIPNAME( 0x80, 0x80, "High Scores" ) | |
| 810 | PORT_DIPSETTING( 0x00, "Keep Top 5" ) | |
| 811 | PORT_DIPSETTING( 0x80, "Keep Top 10" ) | |
| 812 | 660 | |
| 813 | PORT_START /* IN1 */ | |
| 814 | PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 815 | PORT_DIPNAME( 0x0c, 0x04, "Guesses" ) | |
| 661 | PORT_MODIFY("IN1") | |
| 662 | PORT_DIPNAME( 0x0c, 0x04, "Guesses" ) PORT_DIPLOCATION("G1:3,4") | |
| 816 | 663 | PORT_DIPSETTING( 0x00, "2" ) |
| 817 | 664 | PORT_DIPSETTING( 0x04, "3" ) |
| 818 | 665 | PORT_DIPSETTING( 0x08, "4" ) |
| 819 | 666 | PORT_DIPSETTING( 0x0c, "5" ) |
| 820 | PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 821 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 822 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 823 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 824 | ||
| 825 | PORT_START /* IN2 */ | |
| 826 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) | |
| 827 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) | |
| 828 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) | |
| 829 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) | |
| 830 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 831 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 832 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 833 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 834 | ||
| 835 | PORT_START /* IN3 */ | |
| 836 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 837 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 838 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 ) | |
| 839 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START4 ) | |
| 840 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Red Button") | |
| 841 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Green Button") | |
| 842 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 843 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 844 | ||
| 845 | /* analog ports */ | |
| 846 | UNUSED_ANALOG_X4 | |
| 847 | 667 | INPUT_PORTS_END |
| 848 | 668 | |
| 849 | 669 | |
| 850 | 670 | static INPUT_PORTS_START( gimeabrk ) |
| 851 | PORT_START /* IN0 */ | |
| 852 | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ) ) | |
| 853 | PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) ) | |
| 854 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) | |
| 855 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) | |
| 856 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) | |
| 857 | PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" ) | |
| 858 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 859 | PORT_DIPSETTING( 0x04, "2 Coins = 1 Bonus" ) | |
| 860 | PORT_DIPSETTING( 0x08, "3 Coins = 1 Bonus" ) | |
| 861 | PORT_DIPSETTING( 0x0c, "4 Coins = 1 Bonus" ) | |
| 862 | PORT_DIPSETTING( 0x10, "4 Coins = 2 Bonus" ) | |
| 863 | PORT_DIPSETTING( 0x14, "5 Coins = 1 Bonus" ) | |
| 864 | PORT_DIPSETTING( 0x18, "5 Coins = 2 Bonus" ) | |
| 865 | PORT_DIPSETTING( 0x1c, "5 Coins = 3 Bonus" ) | |
| 866 | PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" ) | |
| 867 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 868 | PORT_DIPSETTING( 0x20, "x2" ) | |
| 869 | PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" ) | |
| 870 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 871 | PORT_DIPSETTING( 0x40, "x4" ) | |
| 872 | PORT_DIPSETTING( 0x80, "x5" ) | |
| 873 | PORT_DIPSETTING( 0xc0, "x6" ) | |
| 874 | PORT_START /* IN1 */ | |
| 875 | PORT_DIPNAME( 0x03, 0x01, "Bonus Shot" ) | |
| 671 | PORT_INCLUDE( stocker ) | |
| 672 | ||
| 673 | PORT_MODIFY("IN0") | |
| 674 | BALSENTE_COINAGE_ALT | |
| 675 | ||
| 676 | PORT_MODIFY("IN1") | |
| 677 | PORT_DIPNAME( 0x03, 0x01, "Bonus Shot" ) PORT_DIPLOCATION("G1:1,2") | |
| 876 | 678 | PORT_DIPSETTING( 0x00, "Every 6 Balls" ) |
| 877 | 679 | PORT_DIPSETTING( 0x01, "Every 8 Balls" ) |
| 878 | 680 | PORT_DIPSETTING( 0x02, "Every 10 Balls" ) |
| 879 | 681 | PORT_DIPSETTING( 0x03, "Every 12 Balls" ) |
| 880 | PORT_DIPNAME( 0x0c, 0x08, "Initial Shots" ) | |
| 682 | PORT_DIPNAME( 0x0c, 0x08, "Initial Shots" ) PORT_DIPLOCATION("G1:3,4") | |
| 881 | 683 | PORT_DIPSETTING( 0x00, "8" ) |
| 882 | 684 | PORT_DIPSETTING( 0x04, "10" ) |
| 883 | 685 | PORT_DIPSETTING( 0x08, "12" ) |
| 884 | 686 | PORT_DIPSETTING( 0x0c, "14" ) |
| 885 | PORT_DIPNAME( 0x10, 0x00, "Players Per Credit" ) | |
| 687 | PORT_DIPNAME( 0x10, 0x00, "Players Per Credit" ) PORT_DIPLOCATION("G1:5") | |
| 886 | 688 | PORT_DIPSETTING( 0x00, "1" ) |
| 887 | PORT_DIPSETTING( 0x10, "1 or 2" ) | |
| 888 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ) ) | |
| 689 | PORT_DIPSETTING( 0x10, "1 Or 2" ) | |
| 690 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("G1:6") | |
| 889 | 691 | PORT_DIPSETTING( 0x20, DEF_STR( Upright ) ) |
| 890 | 692 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) |
| 891 | PORT_DIPNAME( 0x40, 0x40, "High Scores" ) | |
| 693 | PORT_DIPNAME( 0x40, 0x40, "High Scores" ) PORT_DIPLOCATION("G1:7") | |
| 892 | 694 | PORT_DIPSETTING( 0x40, "Keep Top 5" ) |
| 893 | 695 | PORT_DIPSETTING( 0x00, "Keep All" ) |
| 894 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 895 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 896 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 897 | 696 | |
| 898 | PORT_START /* IN2 */ | |
| 899 | PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 900 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 901 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 902 | ||
| 903 | PORT_START /* IN3 */ | |
| 904 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 905 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 697 | PORT_MODIFY("IN3") | |
| 906 | 698 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 907 | 699 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 908 | 700 | PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 909 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 910 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 911 | 701 | |
| 912 | /* analog ports */ | |
| 913 | PLAYER1_TRACKBALL | |
| 914 | UNUSED_ANALOG_X2 | |
| 702 | /* Player 1 Trackball */ | |
| 703 | PORT_MODIFY("AN0") | |
| 704 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_PLAYER(1) | |
| 705 | ||
| 706 | PORT_MODIFY("AN1") | |
| 707 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_REVERSE PORT_PLAYER(1) | |
| 708 | ||
| 709 | PORT_MODIFY("AN3") | |
| 710 | UNUSED_ANALOG | |
| 915 | 711 | INPUT_PORTS_END |
| 916 | 712 | |
| 917 | 713 | |
| 918 | 714 | static INPUT_PORTS_START( minigolf ) |
| 919 | PORT_START /* IN0 */ | |
| 920 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) | |
| 921 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) ) | |
| 922 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 923 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 924 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 925 | PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" ) | |
| 926 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 927 | PORT_DIPSETTING( 0x04, "2 Coins = 1 Bonus" ) | |
| 928 | PORT_DIPSETTING( 0x08, "3 Coins = 1 Bonus" ) | |
| 929 | PORT_DIPSETTING( 0x0c, "4 Coins = 1 Bonus" ) | |
| 930 | PORT_DIPSETTING( 0x10, "4 Coins = 2 Bonus" ) | |
| 931 | PORT_DIPSETTING( 0x14, "5 Coins = 1 Bonus" ) | |
| 932 | PORT_DIPSETTING( 0x18, "5 Coins = 2 Bonus" ) | |
| 933 | PORT_DIPSETTING( 0x1c, "5 Coins = 3 Bonus" ) | |
| 934 | PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" ) | |
| 935 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 936 | PORT_DIPSETTING( 0x20, "x2" ) | |
| 937 | PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" ) | |
| 938 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 939 | PORT_DIPSETTING( 0x40, "x4" ) | |
| 940 | PORT_DIPSETTING( 0x80, "x5" ) | |
| 941 | PORT_DIPSETTING( 0xc0, "x6" ) | |
| 715 | PORT_INCLUDE( stocker ) | |
| 942 | 716 | |
| 943 | PORT_START /* IN1 */ | |
| 944 | PORT_DIPNAME( 0x01, 0x01, "Add-A-Coin" ) | |
| 717 | PORT_MODIFY("IN0") | |
| 718 | BALSENTE_COINAGE_ALT2 | |
| 719 | ||
| 720 | PORT_MODIFY("IN1") | |
| 721 | PORT_DIPNAME( 0x01, 0x01, "Add-A-Coin" ) PORT_DIPLOCATION("G1:1") | |
| 945 | 722 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 946 | 723 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 947 | PORT_DIPNAME( 0x02, 0x02, "Display Kids" ) | |
| 724 | PORT_DIPNAME( 0x02, 0x02, "Display Kids" ) PORT_DIPLOCATION("G1:2") | |
| 948 | 725 | PORT_DIPSETTING( 0x02, DEF_STR( No ) ) |
| 949 | 726 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 950 | PORT_DIPNAME( 0x04, 0x04, "Kid | |
| 727 | PORT_DIPNAME( 0x04, 0x04, "Kid On Left Located" ) PORT_DIPLOCATION("G1:3") | |
| 951 | 728 | PORT_DIPSETTING( 0x04, DEF_STR( No ) ) |
| 952 | 729 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 953 | PORT_DIPNAME( 0x08, 0x08, "Kid | |
| 730 | PORT_DIPNAME( 0x08, 0x08, "Kid On Right Located" ) PORT_DIPLOCATION("G1:4") | |
| 954 | 731 | PORT_DIPSETTING( 0x08, DEF_STR( No ) ) |
| 955 | 732 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 956 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 957 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 958 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 959 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 960 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 961 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 962 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 963 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 964 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 965 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 966 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 967 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 733 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "G1:5" ) | |
| 734 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "G1:6" ) | |
| 735 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "G1:7" ) | |
| 968 | 736 | |
| 969 | PORT_START /* IN2 */ | |
| 970 | PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 971 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 972 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 973 | ||
| 974 | PORT_START /* IN3 */ | |
| 975 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 737 | PORT_MODIFY("IN3") | |
| 976 | 738 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 977 | 739 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 ) |
| 978 | 740 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START4 ) |
| 979 | 741 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 980 | 742 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 981 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 982 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 983 | 743 | |
| 984 | /* analog ports */ | |
| 985 | UNUSED_ANALOG_X2 | |
| 986 | PLAYER1_TRACKBALL | |
| 744 | /* Player 1 Trackball */ | |
| 745 | PORT_MODIFY("AN2") | |
| 746 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_PLAYER(1) | |
| 747 | ||
| 748 | PORT_MODIFY("AN3") | |
| 749 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_REVERSE PORT_PLAYER(1) | |
| 987 | 750 | INPUT_PORTS_END |
| 988 | 751 | |
| 989 | 752 | |
| 990 | 753 | static INPUT_PORTS_START( minigol2 ) |
| 991 | PORT_START /* IN0 */ | |
| 992 | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ) ) | |
| 993 | PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) ) | |
| 994 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) | |
| 995 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) | |
| 996 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) | |
| 997 | PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" ) | |
| 998 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 999 | PORT_DIPSETTING( 0x04, "2 Coins = 1 Bonus" ) | |
| 1000 | PORT_DIPSETTING( 0x08, "3 Coins = 1 Bonus" ) | |
| 1001 | PORT_DIPSETTING( 0x0c, "4 Coins = 1 Bonus" ) | |
| 1002 | PORT_DIPSETTING( 0x10, "4 Coins = 2 Bonus" ) | |
| 1003 | PORT_DIPSETTING( 0x14, "5 Coins = 1 Bonus" ) | |
| 1004 | PORT_DIPSETTING( 0x18, "5 Coins = 2 Bonus" ) | |
| 1005 | PORT_DIPSETTING( 0x1c, "5 Coins = 3 Bonus" ) | |
| 1006 | PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" ) | |
| 1007 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 1008 | PORT_DIPSETTING( 0x20, "x2" ) | |
| 1009 | PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" ) | |
| 1010 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 1011 | PORT_DIPSETTING( 0x40, "x4" ) | |
| 1012 | PORT_DIPSETTING( 0x80, "x5" ) | |
| 1013 | PORT_DIPSETTING( 0xc0, "x6" ) | |
| 754 | PORT_INCLUDE( minigolf ) | |
| 1014 | 755 | |
| 1015 | PORT_START /* IN1 */ | |
| 1016 | PORT_DIPNAME( 0x01, 0x01, "Add-A-Coin" ) | |
| 1017 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 1018 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1019 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 1020 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 1021 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1022 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 1023 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 1024 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1025 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 1026 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 1027 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1028 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 1029 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 1030 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1031 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 1032 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 1033 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1034 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 1035 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 1036 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1037 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 1038 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 1039 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 756 | PORT_MODIFY("IN0") | |
| 757 | BALSENTE_COINAGE_ALT | |
| 1040 | 758 | |
| 1041 | PORT_START /* IN2 */ | |
| 1042 | PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1043 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 1044 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 1045 | ||
| 1046 | PORT_START /* IN3 */ | |
| 1047 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 1048 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 1049 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 ) | |
| 1050 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START4 ) | |
| 1051 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 1052 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1053 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 1054 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 1055 | ||
| 1056 | /* analog ports */ | |
| 1057 | UNUSED_ANALOG_X2 | |
| 1058 | PLAYER1_TRACKBALL | |
| 759 | PORT_MODIFY("IN1") | |
| 760 | PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "G1:2" ) | |
| 761 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "G1:3" ) | |
| 762 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "G1:4" ) | |
| 1059 | 763 | INPUT_PORTS_END |
| 1060 | 764 | |
| 1061 | 765 | |
| 1062 | 766 | static INPUT_PORTS_START( toggle ) |
| 1063 | PORT_START /* IN0 */ | |
| 1064 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) | |
| 1065 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 1066 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) | |
| 1067 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 1068 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) | |
| 1069 | PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1070 | PORT_DIPNAME( 0x80, 0x80, "High Scores" ) | |
| 1071 | PORT_DIPSETTING( 0x80, "Keep Top 5" ) | |
| 1072 | PORT_DIPSETTING( 0x00, "Keep All" ) | |
| 767 | PORT_INCLUDE( sentetst ) | |
| 1073 | 768 | |
| 1074 | PORT_START /* IN1 */ | |
| 1075 | PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1076 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) ) | |
| 769 | PORT_MODIFY("IN1") | |
| 770 | PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "G1:1" ) | |
| 771 | PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "G1:2" ) | |
| 772 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) ) PORT_DIPLOCATION("G1:3") | |
| 1077 | 773 | PORT_DIPSETTING( 0x00, "2" ) |
| 1078 | 774 | PORT_DIPSETTING( 0x04, "3" ) |
| 1079 | PORT_BIT( 0x78, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1080 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 1081 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 1082 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 775 | PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "G1:4" ) | |
| 776 | PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "G1:5" ) | |
| 777 | PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "G1:6" ) | |
| 778 | PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "G1:7" ) | |
| 1083 | 779 | |
| 1084 | PORT_START /* IN2 */ | |
| 1085 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) | |
| 1086 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) | |
| 1087 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) | |
| 1088 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) | |
| 780 | PORT_MODIFY("IN2") | |
| 1089 | 781 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1090 | 782 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1091 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 1092 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 1093 | 783 | |
| 1094 | PORT_START /* IN3 */ | |
| 1095 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 1096 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 784 | PORT_MODIFY("IN3") | |
| 1097 | 785 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) |
| 1098 | 786 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) |
| 1099 | 787 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) |
| 1100 | 788 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) |
| 1101 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 1102 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 1103 | 789 | |
| 1104 | /* analog ports */ | |
| 1105 | UNUSED_ANALOG_X4 | |
| 790 | PORT_MODIFY("AN2") | |
| 791 | UNUSED_ANALOG | |
| 792 | ||
| 793 | PORT_MODIFY("AN3") | |
| 794 | UNUSED_ANALOG | |
| 1106 | 795 | INPUT_PORTS_END |
| 1107 | 796 | |
| 1108 | 797 | |
| 1109 | 798 | static INPUT_PORTS_START( nametune ) |
| 1110 | PORT_START /* IN0 */ | |
| 1111 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) | |
| 799 | PORT_INCLUDE( stocker ) | |
| 800 | ||
| 801 | PORT_MODIFY("IN0") | |
| 802 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("H1:1,2") | |
| 1112 | 803 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) |
| 1113 | 804 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_2C ) ) |
| 1114 | 805 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 1115 | 806 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) |
| 1116 | PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" ) | |
| 1117 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 1118 | PORT_DIPSETTING( 0x04, "2 Coins = 1 Bonus" ) | |
| 1119 | PORT_DIPSETTING( 0x08, "3 Coins = 1 Bonus" ) | |
| 1120 | PORT_DIPSETTING( 0x0c, "4 Coins = 1 Bonus" ) | |
| 1121 | PORT_DIPSETTING( 0x10, "4 Coins = 2 Bonus" ) | |
| 1122 | PORT_DIPSETTING( 0x14, "5 Coins = 1 Bonus" ) | |
| 1123 | PORT_DIPSETTING( 0x18, "5 Coins = 2 Bonus" ) | |
| 1124 | PORT_DIPSETTING( 0x1c, "5 Coins = 3 Bonus" ) | |
| 1125 | PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" ) | |
| 1126 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 1127 | PORT_DIPSETTING( 0x20, "x2" ) | |
| 1128 | PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" ) | |
| 1129 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 1130 | PORT_DIPSETTING( 0x40, "x4" ) | |
| 1131 | PORT_DIPSETTING( 0x80, "x5" ) | |
| 1132 | PORT_DIPSETTING( 0xc0, "x6" ) | |
| 1133 | 807 | |
| 1134 | PORT_START /* IN1 */ | |
| 1135 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 1136 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 1137 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1138 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 1139 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 1140 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1141 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 1142 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 1143 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1144 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 1145 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 1146 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1147 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 1148 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 1149 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1150 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 1151 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 1152 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1153 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 1154 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 1155 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1156 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 1157 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 1158 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 808 | PORT_MODIFY("IN1") | |
| 809 | PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "G1:1" ) | |
| 810 | PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "G1:2" ) | |
| 811 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "G1:3" ) | |
| 812 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "G1:4" ) | |
| 813 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "G1:5" ) | |
| 814 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "G1:6" ) | |
| 815 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "G1:7" ) | |
| 1159 | 816 | |
| 1160 | PORT_START /* IN2 */ | |
| 1161 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Blue Button") PORT_PLAYER(1) | |
| 1162 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Green Button") PORT_PLAYER(1) | |
| 1163 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Yellow Button") PORT_PLAYER(1) | |
| 1164 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Red Button") PORT_PLAYER(1) | |
| 817 | PORT_MODIFY("IN2") | |
| 818 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Blue Button") PORT_PLAYER(1) | |
| 819 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Green Button") PORT_PLAYER(1) | |
| 820 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Yellow Button") PORT_PLAYER(1) | |
| 821 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Red Button") PORT_PLAYER(1) | |
| 1165 | 822 | PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1166 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 1167 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 1168 | 823 | |
| 1169 | PORT_START /* IN3 */ | |
| 1170 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 824 | PORT_MODIFY("IN3") | |
| 1171 | 825 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1172 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Red Button") PORT_PLAYER(2) | |
| 1173 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Yellow Button") PORT_PLAYER(2) | |
| 1174 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Green Button") PORT_PLAYER(2) | |
| 1175 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Blue Button") PORT_PLAYER(2) | |
| 1176 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 1177 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) | |
| 826 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Red Button") PORT_PLAYER(2) | |
| 827 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Yellow Button") PORT_PLAYER(2) | |
| 828 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Green Button") PORT_PLAYER(2) | |
| 829 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Blue Button") PORT_PLAYER(2) | |
| 1178 | 830 | |
| 1179 | /* analog ports */ | |
| 1180 | UNUSED_ANALOG_X4 | |
| 831 | PORT_MODIFY("AN3") | |
| 832 | UNUSED_ANALOG | |
| 1181 | 833 | INPUT_PORTS_END |
| 1182 | 834 | |
| 1183 | 835 | |
| 1184 | 836 | static INPUT_PORTS_START( nstocker ) |
| 1185 | PORT_START /* IN0 */ | |
| 1186 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) | |
| 1187 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) ) | |
| 1188 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 1189 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 1190 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 1191 | PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" ) | |
| 1192 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 1193 | PORT_DIPSETTING( 0x04, "2 Coins = 1 Bonus" ) | |
| 1194 | PORT_DIPSETTING( 0x08, "3 Coins = 1 Bonus" ) | |
| 1195 | PORT_DIPSETTING( 0x0c, "4 Coins = 1 Bonus" ) | |
| 1196 | PORT_DIPSETTING( 0x10, "4 Coins = 2 Bonus" ) | |
| 1197 | PORT_DIPSETTING( 0x14, "5 Coins = 1 Bonus" ) | |
| 1198 | PORT_DIPSETTING( 0x18, "5 Coins = 2 Bonus" ) | |
| 1199 | PORT_DIPSETTING( 0x1c, "5 Coins = 3 Bonus" ) | |
| 1200 | PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" ) | |
| 1201 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 1202 | PORT_DIPSETTING( 0x20, "x2" ) | |
| 1203 | PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" ) | |
| 1204 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 1205 | PORT_DIPSETTING( 0x40, "x4" ) | |
| 1206 | PORT_DIPSETTING( 0x80, "x5" ) | |
| 1207 | PORT_DIPSETTING( 0xc0, "x6" ) | |
| 837 | PORT_INCLUDE( stocker ) | |
| 1208 | 838 | |
| 1209 | PORT_START /* IN1 */ | |
| 1210 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Difficulty ) ) | |
| 839 | PORT_MODIFY("IN0") | |
| 840 | BALSENTE_COINAGE_ALT2 | |
| 841 | ||
| 842 | PORT_MODIFY("IN1") | |
| 843 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("G1:1") | |
| 1211 | 844 | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) |
| 1212 | 845 | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) |
| 1213 | PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1214 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 1215 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 1216 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 846 | PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "G1:7" ) | |
| 1217 | 847 | |
| 1218 | PORT_START /* IN2 */ | |
| 1219 | PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1220 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 1221 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 1222 | ||
| 1223 | PORT_START /* IN3 */ | |
| 1224 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 1225 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 1226 | PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1227 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 1228 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 1229 | ||
| 1230 | /* analog ports */ | |
| 1231 | UNUSED_ANALOG_X3 | |
| 1232 | /* cheese alert -- we have to map this to player 2 so that it doesn't interfere with */ | |
| 1233 | /* the crosshair controls */ | |
| 1234 | PORT_START | |
| 848 | /* cheese alert -- we have to map this to player 2 so that it doesn't interfere with | |
| 849 | the crosshair controls */ | |
| 850 | PORT_MODIFY("AN3") | |
| 1235 | 851 | PORT_BIT( 0xff, 0, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) |
| 1236 | 852 | PORT_CODE_DEC(KEYCODE_S) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(KEYCODE_F) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_RESET PORT_PLAYER(2) |
| 1237 | 853 | |
| 1238 | 854 | /* extra ports for shooters */ |
| 1239 | PLAYER1_CROSSHAIRS | |
| 855 | PORT_START /* fake analog X */ | |
| 856 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) | |
| 857 | ||
| 858 | PORT_START /* fake analog Y */ | |
| 859 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) | |
| 1240 | 860 | INPUT_PORTS_END |
| 1241 | 861 | |
| 1242 | 862 | |
| 1243 | 863 | static INPUT_PORTS_START( sfootbal ) |
| 1244 | PORT_START /* IN0 */ | |
| 1245 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) | |
| 1246 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) ) | |
| 1247 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 1248 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 1249 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 1250 | PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" ) | |
| 1251 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 1252 | PORT_DIPSETTING( 0x04, "2 Coins = 1 Bonus" ) | |
| 1253 | PORT_DIPSETTING( 0x08, "3 Coins = 1 Bonus" ) | |
| 1254 | PORT_DIPSETTING( 0x0c, "4 Coins = 1 Bonus" ) | |
| 1255 | PORT_DIPSETTING( 0x10, "4 Coins = 2 Bonus" ) | |
| 1256 | PORT_DIPSETTING( 0x14, "5 Coins = 1 Bonus" ) | |
| 1257 | PORT_DIPSETTING( 0x18, "5 Coins = 2 Bonus" ) | |
| 1258 | PORT_DIPSETTING( 0x1c, "5 Coins = 3 Bonus" ) | |
| 1259 | PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" ) | |
| 1260 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 1261 | PORT_DIPSETTING( 0x20, "x2" ) | |
| 1262 | PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" ) | |
| 1263 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 1264 | PORT_DIPSETTING( 0x40, "x4" ) | |
| 1265 | PORT_DIPSETTING( 0x80, "x5" ) | |
| 1266 | PORT_DIPSETTING( 0xc0, "x6" ) | |
| 864 | PORT_INCLUDE( stocker ) | |
| 1267 | 865 | |
| 1268 | PORT_START /* IN1 */ | |
| 1269 | PORT_DIPNAME( 0x07, 0x03, "Game Duration" ) | |
| 866 | PORT_MODIFY("IN0") | |
| 867 | BALSENTE_COINAGE_ALT2 | |
| 868 | ||
| 869 | PORT_MODIFY("IN1") | |
| 870 | PORT_DIPNAME( 0x07, 0x03, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("G1:1,2,3") | |
| 1270 | 871 | PORT_DIPSETTING( 0x00, "1:30" ) |
| 1271 | 872 | PORT_DIPSETTING( 0x01, "1:40" ) |
| 1272 | 873 | PORT_DIPSETTING( 0x02, "1:50" ) |
| r1877 | r1878 | |
| 1275 | 876 | PORT_DIPSETTING( 0x05, "2:40" ) |
| 1276 | 877 | PORT_DIPSETTING( 0x06, "3:00" ) |
| 1277 | 878 | PORT_DIPSETTING( 0x07, "3:30" ) |
| 1278 | PORT_DIPNAME( 0x08, 0x00, "Players Per Credit" ) | |
| 879 | PORT_DIPNAME( 0x08, 0x00, "Players Per Credit" ) PORT_DIPLOCATION("G1:4") | |
| 1279 | 880 | PORT_DIPSETTING( 0x00, "1" ) |
| 1280 | PORT_DIPSETTING( 0x08, "1 or 2" ) | |
| 1281 | PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 1282 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 1283 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 1284 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 881 | PORT_DIPSETTING( 0x08, "1 Or 2" ) | |
| 882 | PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "G1:7" ) | |
| 1285 | 883 | |
| 1286 | PORT_ | |
| 884 | PORT_MOD | |
| 1287 | 885 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 1288 | 886 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1289 | PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1290 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 1291 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 887 | PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1292 | 888 | |
| 1293 | PORT_START /* IN3 */ | |
| 1294 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 889 | PORT_MODIFY("IN3") | |
| 1295 | 890 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1296 | PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1297 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 1298 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 891 | PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1299 | 892 | |
| 1300 | /* analog ports */ | |
| 1301 | PLAYER2_ANALOG_JOYSTICK | |
| 1302 | PLAYER1_ANALOG_JOYSTICK | |
| 893 | /* Player 2 Analog Joystick */ | |
| 894 | PORT_MODIFY("AN0") | |
| 895 | PORT_BIT( 0xff, 0, IPT_AD_STICK_Y ) PORT_MINMAX(0x80,0x7f) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_PLAYER(2) | |
| 896 | ||
| 897 | PORT_MODIFY("AN1") | |
| 898 | PORT_BIT( 0xff, 0, IPT_AD_STICK_X ) PORT_MINMAX(0x80,0x7f) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_REVERSE PORT_PLAYER(2) | |
| 899 | ||
| 900 | /* Player 1 Analog Joystick */ | |
| 901 | PORT_MODIFY("AN2") | |
| 902 | PORT_BIT( 0xff, 0, IPT_AD_STICK_Y ) PORT_MINMAX(0x80,0x7f) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_PLAYER(1) | |
| 903 | ||
| 904 | PORT_MODIFY("AN3") | |
| 905 | PORT_BIT( 0xff, 0, IPT_AD_STICK_X ) PORT_MINMAX(0x80,0x7f) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_REVERSE PORT_PLAYER(1) | |
| 1303 | 906 | INPUT_PORTS_END |
| 1304 | 907 | |
| 1305 | 908 | |
| 1306 | 909 | static INPUT_PORTS_START( spiker ) |
| 1307 | PORT_START /* IN0 */ | |
| 1308 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) | |
| 1309 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) ) | |
| 1310 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 1311 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 1312 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 1313 | PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" ) | |
| 1314 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 1315 | PORT_DIPSETTING( 0x04, "2 Coins = 1 Bonus" ) | |
| 1316 | PORT_DIPSETTING( 0x08, "3 Coins = 1 Bonus" ) | |
| 1317 | PORT_DIPSETTING( 0x0c, "4 Coins = 1 Bonus" ) | |
| 1318 | PORT_DIPSETTING( 0x10, "4 Coins = 2 Bonus" ) | |
| 1319 | PORT_DIPSETTING( 0x14, "5 Coins = 1 Bonus" ) | |
| 1320 | PORT_DIPSETTING( 0x18, "5 Coins = 2 Bonus" ) | |
| 1321 | PORT_DIPSETTING( 0x1c, "5 Coins = 3 Bonus" ) | |
| 1322 | PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" ) | |
| 1323 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 1324 | PORT_DIPSETTING( 0x20, "x2" ) | |
| 1325 | PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" ) | |
| 1326 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 1327 | PORT_DIPSETTING( 0x40, "x4" ) | |
| 1328 | PORT_DIPSETTING( 0x80, "x5" ) | |
| 1329 | PORT_DIPSETTING( 0xc0, "x6" ) | |
| 910 | PORT_INCLUDE( stocker ) | |
| 1330 | 911 | |
| 1331 | PORT_START /* IN1 */ | |
| 1332 | PORT_DIPNAME( 0x01, 0x00, "Game Duration" ) | |
| 1333 | PORT_DIPSETTING( 0x00, "11 points" ) | |
| 1334 | PORT_DIPSETTING( 0x01, "15 points" ) | |
| 1335 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 1336 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 1337 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1338 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 1339 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 1340 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1341 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 1342 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 1343 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1344 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 1345 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 1346 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1347 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 1348 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 1349 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1350 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 1351 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 1352 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1353 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 1354 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 1355 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 912 | PORT_MODIFY("IN0") | |
| 913 | BALSENTE_COINAGE_ALT2 | |
| 1356 | 914 | |
| 1357 | PORT_START /* IN2 */ | |
| 1358 | PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 915 | PORT_MODIFY("IN1") | |
| 916 | PORT_DIPNAME( 0x01, 0x00, "Game Duration" ) PORT_DIPLOCATION("G1:1") | |
| 917 | PORT_DIPSETTING( 0x00, "11 Points" ) | |
| 918 | PORT_DIPSETTING( 0x01, "15 Points" ) | |
| 919 | PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "G1:2" ) | |
| 920 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "G1:3" ) | |
| 921 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "G1:4" ) | |
| 922 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "G1:5" ) | |
| 923 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "G1:6" ) | |
| 924 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "G1:7" ) | |
| 925 | ||
| 926 | PORT_MODIFY("IN2") | |
| 1359 | 927 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1360 | 928 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1361 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 1362 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 1363 | 929 | |
| 1364 | PORT_START /* IN3 */ | |
| 1365 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 930 | PORT_MODIFY("IN3") | |
| 1366 | 931 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1367 | 932 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 1368 | PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1369 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 1370 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 1371 | 933 | |
| 1372 | /* analog ports */ | |
| 1373 | PLAYER2_TRACKBALL | |
| 1374 | PLAYER1_TRACKBALL | |
| 934 | /* Player 2 Trackball */ | |
| 935 | PORT_MODIFY("AN0") | |
| 936 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_PLAYER(2) | |
| 937 | ||
| 938 | PORT_MODIFY("AN1") | |
| 939 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_REVERSE PORT_PLAYER(2) | |
| 940 | ||
| 941 | /* Player 1 Trackball */ | |
| 942 | PORT_MODIFY("AN2") | |
| 943 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_PLAYER(1) | |
| 944 | ||
| 945 | PORT_MODIFY("AN3") | |
| 946 | PORT_BIT( 0xff, 0, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_RESET PORT_REVERSE PORT_PLAYER(1) | |
| 1375 | 947 | INPUT_PORTS_END |
| 1376 | 948 | |
| 1377 | 949 | |
| 1378 | 950 | static INPUT_PORTS_START( stompin ) |
| 1379 | PORT_START /* IN0 */ | |
| 1380 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) | |
| 1381 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) ) | |
| 1382 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 1383 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 1384 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 1385 | PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" ) | |
| 1386 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 1387 | PORT_DIPSETTING( 0x04, "2 Coins = 1 Bonus" ) | |
| 1388 | PORT_DIPSETTING( 0x08, "3 Coins = 1 Bonus" ) | |
| 1389 | PORT_DIPSETTING( 0x0c, "4 Coins = 1 Bonus" ) | |
| 1390 | PORT_DIPSETTING( 0x10, "4 Coins = 2 Bonus" ) | |
| 1391 | PORT_DIPSETTING( 0x14, "5 Coins = 1 Bonus" ) | |
| 1392 | PORT_DIPSETTING( 0x18, "5 Coins = 2 Bonus" ) | |
| 1393 | PORT_DIPSETTING( 0x1c, "5 Coins = 3 Bonus" ) | |
| 1394 | PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" ) | |
| 1395 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 1396 | PORT_DIPSETTING( 0x20, "x2" ) | |
| 1397 | PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" ) | |
| 1398 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 1399 | PORT_DIPSETTING( 0x40, "x4" ) | |
| 1400 | PORT_DIPSETTING( 0x80, "x5" ) | |
| 1401 | PORT_DIPSETTING( 0xc0, "x6" ) | |
| 951 | PORT_INCLUDE( stocker ) | |
| 952 | /* Set H:1-8 all to OFF to enable Free Play */ | |
| 953 | PORT_MODIFY("IN0") | |
| 954 | BALSENTE_COINAGE_ALT2 | |
| 1402 | 955 | |
| 1403 | PORT_START /* IN1 */ | |
| 1404 | PORT_DIPNAME( 0x01, 0x00, "Display Kids" ) | |
| 956 | PORT_MODIFY("IN1") | |
| 957 | PORT_DIPNAME( 0x01, 0x00, "Display Kids" ) PORT_DIPLOCATION("G1:1") | |
| 1405 | 958 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 1406 | 959 | PORT_DIPSETTING( 0x01, DEF_STR( Yes ) ) |
| 1407 | PORT_DIPNAME( 0x02, 0x02, "Kid | |
| 960 | PORT_DIPNAME( 0x02, 0x02, "Kid On Right Located" ) PORT_DIPLOCATION("G1:2") | |
| 1408 | 961 | PORT_DIPSETTING( 0x02, DEF_STR( No ) ) |
| 1409 | 962 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 1410 | PORT_DIPNAME( 0x04, 0x04, "Kid | |
| 963 | PORT_DIPNAME( 0x04, 0x04, "Kid On Left Located" ) PORT_DIPLOCATION("G1:3") | |
| 1411 | 964 | PORT_DIPSETTING( 0x04, DEF_STR( No ) ) |
| 1412 | 965 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 1413 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 1414 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 1415 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1416 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 1417 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 1418 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1419 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) | |
| 966 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("G1:6") | |
| 1420 | 967 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1421 | 968 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1422 | PORT_DIPNAME( 0x40, 0x00, "Bee In Game" ) | |
| 969 | PORT_DIPNAME( 0x40, 0x00, "Bee In Game" ) PORT_DIPLOCATION("G1:7") | |
| 1423 | 970 | PORT_DIPSETTING( 0x40, DEF_STR( No ) ) |
| 1424 | 971 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 1425 | PORT_DIPNAME( 0x80, 0x00, "Bug Generation" ) | |
| 972 | PORT_DIPNAME( 0x80, 0x00, "Bug Generation" ) PORT_DIPLOCATION("G1:8") | |
| 1426 | 973 | PORT_DIPSETTING( 0x00, "Regular" ) |
| 1427 | 974 | PORT_DIPSETTING( 0x80, DEF_STR( None ) ) |
| 1428 | 975 | |
| 1429 | PORT_ | |
| 976 | PORT_MOD | |
| 1430 | 977 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(1) |
| 1431 | 978 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_PLAYER(1) |
| 1432 | 979 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_PLAYER(1) |
| 1433 | 980 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_PLAYER(1) |
| 1434 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1435 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1436 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 1437 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 1438 | 981 | |
| 1439 | PORT_START /* IN3 */ | |
| 1440 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 1441 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 982 | PORT_MODIFY("IN3") | |
| 1442 | 983 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(1) |
| 1443 | 984 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(1) |
| 1444 | 985 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(1) |
| 1445 | 986 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(1) |
| 1446 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 1447 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 1448 | 987 | |
| 1449 | /* "analog" ports */ | |
| 1450 | PORT_START | |
| 988 | PORT_MODIFY("AN0") | |
| 1451 | 989 | PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1452 | 990 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Top-Right") PORT_CODE(KEYCODE_9_PAD) PORT_PLAYER(1) |
| 1453 | 991 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Top") PORT_CODE(KEYCODE_8_PAD) PORT_PLAYER(1) |
| 1454 | 992 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Top-Left") PORT_CODE(KEYCODE_7_PAD) PORT_PLAYER(1) |
| 1455 | 993 | |
| 1456 | PORT_ | |
| 994 | PORT_MODIFY("AN1") | |
| 1457 | 995 | PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1458 | 996 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Right") PORT_CODE(KEYCODE_6_PAD) PORT_PLAYER(1) |
| 1459 | 997 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1460 | 998 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Left") PORT_CODE(KEYCODE_4_PAD) PORT_PLAYER(1) |
| 1461 | 999 | |
| 1462 | PORT_ | |
| 1000 | PORT_MODIFY("AN2") | |
| 1463 | 1001 | PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1464 | 1002 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Bot-Right") PORT_CODE(KEYCODE_3_PAD) PORT_PLAYER(1) |
| 1465 | 1003 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Bottom") PORT_CODE(KEYCODE_2_PAD) PORT_PLAYER(1) |
| 1466 | 1004 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Bot-Left") PORT_CODE(KEYCODE_1_PAD) PORT_PLAYER(1) |
| 1467 | 1005 | |
| 1006 | PORT_MODIFY("AN3") | |
| 1468 | 1007 | UNUSED_ANALOG |
| 1469 | 1008 | INPUT_PORTS_END |
| 1470 | 1009 | |
| 1471 | 1010 | |
| 1472 | 1011 | static INPUT_PORTS_START( grudge ) |
| 1473 | PORT_START /* IN0 */ | |
| 1474 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Unknown ) ) | |
| 1012 | PORT_INCLUDE( sentetst ) | |
| 1013 | ||
| 1014 | PORT_MODIFY("IN0") | |
| 1015 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Unknown ) ) PORT_DIPLOCATION("H1:1,2") | |
| 1475 | 1016 | PORT_DIPSETTING( 0x00, "0" ) |
| 1476 | 1017 | PORT_DIPSETTING( 0x01, "1" ) |
| 1477 | 1018 | PORT_DIPSETTING( 0x02, "2" ) |
| 1478 | 1019 | PORT_DIPSETTING( 0x03, "3" ) |
| 1479 | PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1480 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 1020 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("H1:8") | |
| 1481 | 1021 | PORT_DIPSETTING( 0x00, "0" ) |
| 1482 | 1022 | PORT_DIPSETTING( 0x80, "1" ) |
| 1483 | 1023 | |
| 1484 | PORT_START /* IN1 */ | |
| 1485 | PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1486 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Players ) ) | |
| 1024 | PORT_MODIFY("IN1") | |
| 1025 | PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "G1:1" ) | |
| 1026 | PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "G1:2" ) | |
| 1027 | PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "G1:3" ) | |
| 1028 | PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "G1:4" ) | |
| 1029 | PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "G1:7" ) | |
| 1030 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Players ) ) PORT_DIPLOCATION("G1:8") | |
| 1487 | 1031 | PORT_DIPSETTING( 0x80, "2" ) |
| 1488 | 1032 | PORT_DIPSETTING( 0x00, "3" ) |
| 1489 | 1033 | |
| 1490 | PORT_ | |
| 1034 | PORT_MOD | |
| 1491 | 1035 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1492 | 1036 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 1493 | 1037 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| r1877 | r1878 | |
| 1495 | 1039 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1496 | 1040 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1497 | 1041 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 ) |
| 1498 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 1499 | 1042 | |
| 1500 | PORT_START /* IN3 */ | |
| 1501 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 1502 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 1043 | PORT_MODIFY("IN3") | |
| 1503 | 1044 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 ) |
| 1504 | 1045 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 1505 | 1046 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1506 | 1047 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) |
| 1507 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 1508 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 1509 | 1048 | |
| 1510 | /* analog ports */ | |
| 1511 | PORT_START | |
| 1049 | PORT_MODIFY("AN0") | |
| 1512 | 1050 | PORT_BIT( 0xff, 0, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(20) PORT_PLAYER(1) |
| 1513 | PORT_START | |
| 1051 | ||
| 1052 | PORT_MODIFY("AN1") | |
| 1514 | 1053 | PORT_BIT( 0xff, 0, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(20) PORT_PLAYER(2) |
| 1515 | PORT_START | |
| 1054 | ||
| 1055 | PORT_MODIFY("AN2") | |
| 1516 | 1056 | PORT_BIT( 0xff, 0, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(20) PORT_PLAYER(3) |
| 1057 | ||
| 1058 | PORT_MODIFY("AN3") | |
| 1517 | 1059 | UNUSED_ANALOG |
| 1518 | 1060 | INPUT_PORTS_END |
| 1519 | 1061 | |
| 1520 | 1062 | |
| 1521 | 1063 | static INPUT_PORTS_START( rescraid ) |
| 1522 | PORT_START /* IN0 */ | |
| 1523 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) | |
| 1524 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) ) | |
| 1525 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 1526 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 1527 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 1528 | PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" ) | |
| 1529 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 1530 | PORT_DIPSETTING( 0x04, "2 Coins = 1 Bonus" ) | |
| 1531 | PORT_DIPSETTING( 0x08, "3 Coins = 1 Bonus" ) | |
| 1532 | PORT_DIPSETTING( 0x0c, "4 Coins = 1 Bonus" ) | |
| 1533 | PORT_DIPSETTING( 0x10, "4 Coins = 2 Bonus" ) | |
| 1534 | PORT_DIPSETTING( 0x14, "5 Coins = 1 Bonus" ) | |
| 1535 | PORT_DIPSETTING( 0x18, "5 Coins = 2 Bonus" ) | |
| 1536 | PORT_DIPSETTING( 0x1c, "5 Coins = 3 Bonus" ) | |
| 1537 | PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" ) | |
| 1538 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 1539 | PORT_DIPSETTING( 0x20, "x2" ) | |
| 1540 | PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" ) | |
| 1541 | PORT_DIPSETTING( 0x00, "x1" ) | |
| 1542 | PORT_DIPSETTING( 0x40, "x4" ) | |
| 1543 | PORT_DIPSETTING( 0x80, "x5" ) | |
| 1544 | PORT_DIPSETTING( 0xc0, "x6" ) | |
| 1064 | PORT_INCLUDE( stocker ) | |
| 1545 | 1065 | |
| 1546 | PORT_START /* IN1 */ | |
| 1547 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) | |
| 1066 | PORT_MODIFY("IN0") | |
| 1067 | BALSENTE_COINAGE_ALT2 | |
| 1068 | ||
| 1069 | PORT_MODIFY("IN1") | |
| 1070 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("G1:1") | |
| 1548 | 1071 | PORT_DIPSETTING( 0x00, "4" ) |
| 1549 | 1072 | PORT_DIPSETTING( 0x01, "5" ) |
| 1550 | PORT_DIPNAME( 0x0c, 0x04, "Minimum Game Time" ) | |
| 1073 | PORT_DIPNAME( 0x0c, 0x04, "Minimum Game Time" ) PORT_DIPLOCATION("G1:3,4") | |
| 1551 | 1074 | PORT_DIPSETTING( 0x08, "45" ) |
| 1552 | 1075 | PORT_DIPSETTING( 0x04, "60" ) |
| 1553 | 1076 | PORT_DIPSETTING( 0x00, "90" ) |
| 1554 | 1077 | PORT_DIPSETTING( 0x0c, "120" ) |
| 1555 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 1556 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 1557 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1558 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 1559 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 1560 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1561 | PORT_DIPNAME( 0x40, 0x40, "Keep High Scores" ) | |
| 1078 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "G1:5" ) | |
| 1079 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "G1:6" ) | |
| 1080 | PORT_DIPNAME( 0x40, 0x40, "Keep High Scores" ) PORT_DIPLOCATION("G1:7") | |
| 1562 | 1081 | PORT_DIPSETTING( 0x40, DEF_STR( No ) ) |
| 1563 | 1082 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 1564 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 1565 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 1566 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1567 | 1083 | |
| 1568 | PORT_ | |
| 1084 | PORT_MOD | |
| 1569 | 1085 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(1) |
| 1570 | 1086 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_PLAYER(1) |
| 1571 | 1087 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_PLAYER(1) |
| 1572 | 1088 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_PLAYER(1) |
| 1573 | 1089 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 1574 | 1090 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1575 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 1576 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 1577 | 1091 | |
| 1578 | PORT_START /* IN3 */ | |
| 1579 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 1092 | PORT_MODIFY("IN3") | |
| 1580 | 1093 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 1581 | 1094 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(1) |
| 1582 | 1095 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(1) |
| 1583 | 1096 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(1) |
| 1584 | 1097 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(1) |
| 1585 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 1586 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 1587 | 1098 | |
| 1588 | /* analog ports */ | |
| 1589 | UNUSED_ANALOG_X4 | |
| 1099 | PORT_MODIFY("AN3") | |
| 1100 | UNUSED_ANALOG | |
| 1590 | 1101 | INPUT_PORTS_END |
| 1591 | 1102 | |
| 1592 | 1103 | |
| 1593 | 1104 | static INPUT_PORTS_START( shrike ) |
| 1594 | PORT_START /* IN0 */ | |
| 1595 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage )) | |
| 1105 | PORT_INCLUDE( sentetst ) | |
| 1106 | ||
| 1107 | PORT_MODIFY("IN0") | |
| 1108 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage )) PORT_DIPLOCATION("H1:1,2") | |
| 1596 | 1109 | PORT_DIPSETTING( 0x02, DEF_STR( 4C_1C )) |
| 1597 | 1110 | PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C )) |
| 1598 | 1111 | PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C )) |
| 1599 | 1112 | PORT_DIPSETTING( 0x03, DEF_STR( Free_Play )) |
| 1600 | PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1601 | PORT_DIPNAME( 0x40, 0x40, "Reset High Scores" ) | |
| 1113 | PORT_DIPNAME( 0x40, 0x40, "Reset High Scores" ) PORT_DIPLOCATION("H1:7") | |
| 1602 | 1114 | PORT_DIPSETTING( 0x40, DEF_STR( No )) |
| 1603 | 1115 | PORT_DIPSETTING( 0x00, DEF_STR( Yes )) |
| 1604 | PORT_ | |
| 1116 | PORT_DIPUNUSED_DIPLOC( 0x80, 0x80 | |
| 1605 | 1117 | |
| 1606 | PORT_START /* IN1 */ | |
| 1607 | PORT_DIPNAME( 0x03, 0x03, "Minimum Game Time" ) | |
| 1118 | PORT_MODIFY("IN1") | |
| 1119 | PORT_DIPNAME( 0x03, 0x03, "Minimum Game Time" ) PORT_DIPLOCATION("G1:1,2") | |
| 1608 | 1120 | PORT_DIPSETTING( 0x00, "1:00" ) |
| 1609 | 1121 | PORT_DIPSETTING( 0x01, "1:30" ) |
| 1610 | 1122 | PORT_DIPSETTING( 0x02, "2:00" ) |
| 1611 | 1123 | PORT_DIPSETTING( 0x03, "2:30" ) |
| 1612 | PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1613 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds )) | |
| 1614 | PORT_DIPSETTING( 0x80, DEF_STR( Off )) | |
| 1615 | PORT_DIPSETTING( 0x00, DEF_STR( On )) | |
| 1124 | PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "G1:3" ) | |
| 1125 | PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "G1:4" ) | |
| 1126 | PORT_DIPUNUSED_DIPLOC( 0x40, 0x20, "G1:7" ) | |
| 1616 | 1127 | |
| 1617 | PORT_ | |
| 1128 | PORT_MOD | |
| 1618 | 1129 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 1619 | 1130 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 1620 | 1131 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 1621 | 1132 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) |
| 1622 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1623 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1624 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 1625 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 1626 | 1133 | |
| 1627 | PORT_START /* IN3 */ | |
| 1628 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 1629 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 1630 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1631 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1632 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1134 | PORT_MODIFY("IN3") | |
| 1135 | PORT_BIT( 0x1c, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1633 | 1136 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) // carpet switch |
| 1634 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 1635 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 1636 | 1137 | |
| 1637 | /* analog ports */ | |
| 1638 | PORT_START | |
| 1138 | PORT_MODIFY("AN0") | |
| 1639 | 1139 | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_PLAYER(1) |
| 1640 | PORT_START | |
| 1140 | ||
| 1141 | PORT_MODIFY("AN1") | |
| 1641 | 1142 | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_PLAYER(1) |
| 1642 | UNUSED_ANALOG_X2 | |
| 1143 | ||
| 1144 | PORT_MODIFY("AN2") | |
| 1145 | UNUSED_ANALOG | |
| 1146 | ||
| 1147 | PORT_MODIFY("AN3") | |
| 1148 | UNUSED_ANALOG | |
| 1643 | 1149 | INPUT_PORTS_END |
| 1644 | 1150 | |
| 1645 | 1151 | |
| r1877 | r1878 | |
| 1670 | 1176 | /* basic machine hardware */ |
| 1671 | 1177 | MDRV_CPU_ADD(M6809, 5000000/4) |
| 1672 | 1178 | MDRV_CPU_PROGRAM_MAP(cpu1_map,0) |
| 1673 | MDRV_CPU_VBLANK_INT(balsente_update_analog_inputs | |
| 1179 | MDRV_CPU_VBLANK_INT("main", balsente_update_analog_inputs | |
| 1674 | 1180 | |
| 1675 | 1181 | MDRV_CPU_ADD(Z80, 4000000) |
| 1676 | 1182 | /* audio CPU */ |
| r1877 | r1878 | |
| 2487 | 1993 | * |
| 2488 | 1994 | *************************************/ |
| 2489 | 1995 | |
| 2490 | GAME( 1984, sentetst, 0, balsente, sentetst, sentetst, ROT0, "Bally/Sente", "Sente Diagnostic Cartridge", GAME_SUPPORTS_SAVE ) | |
| 2491 | GAME( 1984, cshift, 0, balsente, cshift, cshift, ROT0, "Bally/Sente", "Chicken Shift", GAME_SUPPORTS_SAVE ) | |
| 2492 | GAME( 1984, gghost, 0, balsente, gghost, gghost, ROT0, "Bally/Sente", "Goalie Ghost", GAME_SUPPORTS_SAVE ) | |
| 2493 | GAME( 1984, hattrick, 0, balsente, hattrick, hattrick, ROT0, "Bally/Sente", "Hat Trick", GAME_SUPPORTS_SAVE ) | |
| 2494 | GAME( 1984, otwalls, 0, balsente, otwalls, otwalls, ROT0, "Bally/Sente", "Off the Wall (Sente)", GAME_SUPPORTS_SAVE ) | |
| 2495 | GAME( 1984, snakepit, 0, balsente, snakepit, snakepit, ROT0, "Bally/Sente", "Snake Pit", GAME_SUPPORTS_SAVE ) | |
| 2496 | GAME( 1984, snakjack, 0, balsente, snakjack, snakjack, ROT0, "Bally/Sente", "Snacks'n Jaxson", GAME_SUPPORTS_SAVE ) | |
| 2497 | GAME( 1984, stocker, 0, balsente, stocker, stocker, ROT0, "Bally/Sente", "Stocker", GAME_SUPPORTS_SAVE ) | |
| 2498 | GAME( 1984, triviag1, 0, balsente, triviag1, triviag1, ROT0, "Bally/Sente", "Trivial Pursuit (Genus I) (set 1)", GAME_SUPPORTS_SAVE ) | |
| 2499 | GAME( 1984, trivia12, 0, balsente, triviag1, triviag1, ROT0, "Bally/Sente", "Trivial Pursuit (Genus I) (set 2)", GAME_SUPPORTS_SAVE ) | |
| 2500 | GAME( 1984, triviag2, 0, balsente, triviag1, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (Genus II)", GAME_SUPPORTS_SAVE ) | |
| 2501 | GAME( 1984, triviasp, 0, balsente, triviag1, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (All Star Sports Edition)", GAME_SUPPORTS_SAVE ) | |
| 2502 | GAME( 1984, triviayp, 0, balsente, triviag1, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (Young Players Edition)", GAME_SUPPORTS_SAVE ) | |
| 2503 | GAME( 1984, triviabb, 0, balsente, triviag1, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (Baby Boomer Edition)", GAME_SUPPORTS_SAVE ) | |
| 2504 | GAME( 1987, triviaes, 0, balsente, triviaes, triviaes, ROT0, "Bally/Sente", "Trivial Pursuit (Spanish Edition)", GAME_SUPPORTS_SAVE ) | |
| 2505 | GAME( 1985, gimeabrk, 0, balsente, gimeabrk, gimeabrk, ROT0, "Bally/Sente", "Gimme A Break", GAME_SUPPORTS_SAVE ) | |
| 2506 | GAME( 1985, minigolf, 0, balsente, minigolf, minigolf, ROT0, "Bally/Sente", "Mini Golf (set 1)", GAME_SUPPORTS_SAVE ) | |
| 2507 | GAME( 1985, minigol2, minigolf, balsente, minigol2, minigol2, ROT0, "Bally/Sente", "Mini Golf (set 2)", GAME_SUPPORTS_SAVE ) | |
| 2508 | GAME( 1985, toggle, 0, balsente, toggle, toggle, ROT0, "Bally/Sente", "Toggle (prototype)", GAME_SUPPORTS_SAVE ) | |
| 2509 | GAME( 1986, nametune, 0, balsente, nametune, nametune, ROT0, "Bally/Sente", "Name That Tune", GAME_SUPPORTS_SAVE ) | |
| 2510 | GAME( 1986, nstocker, 0, balsente, nstocker, nstocker, ROT0, "Bally/Sente", "Night Stocker (set 1)", GAME_SUPPORTS_SAVE ) | |
| 2511 | GAME( 1986, nstockr2, 0, balsente, nstocker, nstocker, ROT0, "Bally/Sente", "Night Stocker (set 2)", GAME_SUPPORTS_SAVE ) | |
| 2512 | GAME( 1986, sfootbal, 0, balsente, sfootbal, sfootbal, ROT0, "Bally/Sente", "Street Football", GAME_SUPPORTS_SAVE ) | |
| 2513 | GAME( 1986, spiker, 0, balsente, spiker, spiker, ROT0, "Bally/Sente", "Spiker", GAME_SUPPORTS_SAVE ) | |
| 2514 | GAME( 1986, stompin, 0, balsente, stompin, stompin, ROT0, "Bally/Sente", "Stompin'", GAME_SUPPORTS_SAVE ) | |
| 1996 | GAME( 1984, sentetst, 0, balsente, sentetst, sentetst, ROT0, "Bally/Sente", "Sente Diagnostic Cartridge", GAME_SUPPORTS_SAVE ) | |
| 1997 | GAME( 1984, cshift, 0, balsente, cshift, cshift, ROT0, "Bally/Sente", "Chicken Shift", GAME_SUPPORTS_SAVE ) | |
| 1998 | GAME( 1984, gghost, 0, balsente, gghost, gghost, ROT0, "Bally/Sente", "Goalie Ghost", GAME_SUPPORTS_SAVE ) | |
| 1999 | GAME( 1984, hattrick, 0, balsente, hattrick, hattrick, ROT0, "Bally/Sente", "Hat Trick", GAME_SUPPORTS_SAVE ) | |
| 2000 | GAME( 1984, otwalls, 0, balsente, otwalls, otwalls, ROT0, "Bally/Sente", "Off the Wall (Sente)", GAME_SUPPORTS_SAVE ) | |
| 2001 | GAME( 1984, snakepit, 0, balsente, sentetst, snakepit, ROT0, "Bally/Sente", "Snake Pit", GAME_SUPPORTS_SAVE ) | |
| 2002 | GAME( 1984, snakjack, 0, balsente, snakjack, snakjack, ROT0, "Bally/Sente", "Snacks'n Jaxson", GAME_SUPPORTS_SAVE ) | |
| 2003 | GAME( 1984, stocker, 0, balsente, stocker, stocker, ROT0, "Bally/Sente", "Stocker", GAME_SUPPORTS_SAVE ) | |
| 2004 | GAME( 1984, triviag1, 0, balsente, triviag1, triviag1, ROT0, "Bally/Sente", "Trivial Pursuit (Genus I) (set 1)", GAME_SUPPORTS_SAVE ) | |
| 2005 | GAME( 1984, trivia12, 0, balsente, triviag1, triviag1, ROT0, "Bally/Sente", "Trivial Pursuit (Genus I) (set 2)", GAME_SUPPORTS_SAVE ) | |
| 2006 | GAME( 1984, triviag2, 0, balsente, triviag1, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (Genus II)", GAME_SUPPORTS_SAVE ) | |
| 2007 | GAME( 1984, triviasp, 0, balsente, triviag1, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (All Star Sports Edition)", GAME_SUPPORTS_SAVE ) | |
| 2008 | GAME( 1984, triviayp, 0, balsente, triviag1, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (Young Players Edition)", GAME_SUPPORTS_SAVE ) | |
| 2009 | GAME( 1984, triviabb, 0, balsente, triviag1, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (Baby Boomer Edition)", GAME_SUPPORTS_SAVE ) | |
| 2010 | GAME( 1987, triviaes, 0, balsente, triviaes, triviaes, ROT0, "Bally/Sente", "Trivial Pursuit (Spanish Edition)", GAME_SUPPORTS_SAVE ) | |
| 2011 | GAME( 1985, gimeabrk, 0, balsente, gimeabrk, gimeabrk, ROT0, "Bally/Sente", "Gimme A Break", GAME_SUPPORTS_SAVE ) | |
| 2012 | GAME( 1985, minigolf, 0, balsente, minigolf, minigolf, ROT0, "Bally/Sente", "Mini Golf (set 1)", GAME_SUPPORTS_SAVE ) | |
| 2013 | GAME( 1985, minigol2, minigolf, balsente, minigol2, minigol2, ROT0, "Bally/Sente", "Mini Golf (set 2)", GAME_SUPPORTS_SAVE ) | |
| 2014 | GAME( 1985, toggle, 0, balsente, toggle, toggle, ROT0, "Bally/Sente", "Toggle (prototype)", GAME_SUPPORTS_SAVE ) | |
| 2015 | GAME( 1986, nametune, 0, balsente, nametune, nametune, ROT0, "Bally/Sente", "Name That Tune", GAME_SUPPORTS_SAVE ) | |
| 2016 | GAME( 1986, nstocker, 0, balsente, nstocker, nstocker, ROT0, "Bally/Sente", "Night Stocker (set 1)", GAME_SUPPORTS_SAVE ) | |
| 2017 | GAME( 1986, nstockr2, 0, balsente, nstocker, nstocker, ROT0, "Bally/Sente", "Night Stocker (set 2)", GAME_SUPPORTS_SAVE ) | |
| 2018 | GAME( 1986, sfootbal, 0, balsente, sfootbal, sfootbal, ROT0, "Bally/Sente", "Street Football", GAME_SUPPORTS_SAVE ) | |
| 2019 | GAME( 1986, spiker, 0, balsente, spiker, spiker, ROT0, "Bally/Sente", "Spiker", GAME_SUPPORTS_SAVE ) | |
| 2020 | GAME( 1986, stompin, 0, balsente, stompin, stompin, ROT0, "Bally/Sente", "Stompin'", GAME_SUPPORTS_SAVE ) | |
| 2515 | 2021 | GAME( 1987, rescraid, 0, balsente, rescraid, rescraid, ROT0, "Bally/Midway", "Rescue Raider", GAME_SUPPORTS_SAVE ) |
| 2516 | 2022 | GAME( 1987, rescrdsa, rescraid, balsente, rescraid, rescraid, ROT0, "Bally/Midway", "Rescue Raider (stand-alone)", GAME_SUPPORTS_SAVE ) |
| 2517 | 2023 | GAME( 198?, grudge, 0, balsente, grudge, grudge, ROT0, "Bally/Midway", "Grudge Match (prototype)", GAME_SUPPORTS_SAVE ) |
| 2518 | GAME( 198?, shrike, 0, shrike, shrike, shrike, ROT0, "Bally/Sente", "Shrike Avenger (prototype)", GAME_SUPPORTS_SAVE ) | |
| 2024 | GAME( 198?, shrike, 0, shrike, shrike, shrike, ROT0, "Bally/Sente", "Shrike Avenger (prototype)", GAME_SUPPORTS_SAVE ) |
| r1877 | r1878 | |
|---|---|---|
| 92 | 92 | static emu_timer* scanline_timer; |
| 93 | 93 | static emu_timer* irq6_on_timer; |
| 94 | 94 | static emu_timer* irq4_on_timer; |
| 95 | static | |
| 95 | static | |
| 96 | 96 | //emu_timer* vblankirq_off_timer; |
| 97 | 97 | |
| 98 | 98 | |
| r1877 | r1878 | |
| 889 | 889 | |
| 890 | 890 | static WRITE16_HANDLER( megadriv_vdp_w ) |
| 891 | 891 | { |
| 892 | ||
| 893 | ||
| 894 | 892 | switch (offset<<1) |
| 895 | 893 | { |
| 896 | 894 | case 0x00: |
| r1877 | r1878 | |
| 925 | 923 | case 0x12: |
| 926 | 924 | case 0x14: |
| 927 | 925 | case 0x16: |
| 928 | if (ACCESSING_LSB) SN76496_0_w(0, data & 0xff); | |
| 929 | //if (ACCESSING_MSB) SN76496_0_w(0, (data >>8) & 0xff); | |
| 926 | if (ACCESSING_LSB) SN76496_0_w(machine, 0, data & 0xff); | |
| 927 | //if (ACCESSING_MSB) SN76496_0_w(machine, 0, (data >>8) & 0xff); | |
| 930 | 928 | break; |
| 931 | 929 | |
| 932 | 930 | default: |
| r1877 | r1878 | |
| 1334 | 1332 | switch (offset) |
| 1335 | 1333 | { |
| 1336 | 1334 | case 0: |
| 1337 | if (ACCESSING_MSB) return YM2612_status_port_0_A_r(0) << 8; | |
| 1338 | else return YM2612_status_port_0_A_r(0); | |
| 1335 | if (ACCESSING_MSB) return YM2612_status_port_0_A_r(machine, 0) << 8; | |
| 1336 | else return YM2612_status_port_0_A_r(machine, 0); | |
| 1339 | 1337 | break; |
| 1340 | 1338 | case 1: |
| 1341 | if (ACCESSING_MSB) return YM2612_status_port_0_A_r(0) << 8; | |
| 1342 | else return YM2612_status_port_0_A_r(0); | |
| 1339 | if (ACCESSING_MSB) return YM2612_status_port_0_A_r(machine, 0) << 8; | |
| 1340 | else return YM2612_status_port_0_A_r(machine, 0); | |
| 1343 | 1341 | break; |
| 1344 | 1342 | } |
| 1345 | 1343 | } |
| r1877 | r1878 | |
| 1362 | 1360 | switch (offset) |
| 1363 | 1361 | { |
| 1364 | 1362 | case 0: |
| 1365 | if (ACCESSING_MSB) YM2612_control_port_0_A_w (0, (data >> 8) & 0xff); | |
| 1366 | else YM2612_data_port_0_A_w (0, (data >> 0) & 0xff); | |
| 1363 | if (ACCESSING_MSB) YM2612_control_port_0_A_w (machine, 0, (data >> 8) & 0xff); | |
| 1364 | else YM2612_data_port_0_A_w (machine, 0, (data >> 0) & 0xff); | |
| 1367 | 1365 | break; |
| 1368 | 1366 | case 1: |
| 1369 | if (ACCESSING_MSB) YM2612_control_port_0_B_w (0, (data >> 8) & 0xff); | |
| 1370 | else YM2612_data_port_0_B_w (0, (data >> 0) & 0xff); | |
| 1367 | if (ACCESSING_MSB) YM2612_control_port_0_B_w (machine, 0, (data >> 8) & 0xff); | |
| 1368 | else YM2612_data_port_0_B_w (machine, 0, (data >> 0) & 0xff); | |
| 1371 | 1369 | break; |
| 1372 | 1370 | } |
| 1373 | 1371 | } |
| r1877 | r1878 | |
| 1381 | 1379 | { |
| 1382 | 1380 | switch (offset) |
| 1383 | 1381 | { |
| 1384 | case 0: return YM2612_status_port_0_A_r(0); | |
| 1385 | case 1: return YM2612_status_port_0_A_r(0); | |
| 1386 | case 2: return YM2612_status_port_0_A_r(0); | |
| 1387 | case 3: return YM2612_status_port_0_A_r(0); | |
| 1382 | case 0: return YM2612_status_port_0_A_r(machine,0); | |
| 1383 | case 1: return YM2612_status_port_0_A_r(machine,0); | |
| 1384 | case 2: return YM2612_status_port_0_A_r(machine,0); | |
| 1385 | case 3: return YM2612_status_port_0_A_r(machine,0); | |
| 1388 | 1386 | |
| 1389 | 1387 | } |
| 1390 | 1388 | |
| r1877 | r1878 | |
| 1396 | 1394 | //mame_printf_debug("megadriv_z80_YM2612_write %02x %02x\n",offset,data); |
| 1397 | 1395 | switch (offset) |
| 1398 | 1396 | { |
| 1399 | case 0: YM2612_control_port_0_A_w(0, data); break; | |
| 1400 | case 1: YM2612_data_port_0_A_w(0, data); break; | |
| 1401 | case 2: YM2612_control_port_0_B_w(0, data); break; | |
| 1402 | case 3: YM2612_data_port_0_B_w(0, data); break; | |
| 1397 | case 0: YM2612_control_port_0_A_w(machine, 0, data); break; | |
| 1398 | case 1: YM2612_data_port_0_A_w(machine, 0, data); break; | |
| 1399 | case 2: YM2612_control_port_0_B_w(machine, 0, data); break; | |
| 1400 | case 3: YM2612_data_port_0_B_w(machine, 0, data); break; | |
| 1403 | 1401 | } |
| 1404 | 1402 | } |
| 1405 | 1403 | |
| r1877 | r1878 | |
| 2373 | 2371 | |
| 2374 | 2372 | static WRITE8_HANDLER( megadriv_z80_vdp_write ) |
| 2375 | 2373 | { |
| 2376 | ||
| 2377 | ||
| 2378 | 2374 | switch (offset) |
| 2379 | 2375 | { |
| 2380 | 2376 | case 0x11: |
| 2381 | 2377 | case 0x13: |
| 2382 | 2378 | case 0x15: |
| 2383 | 2379 | case 0x17: |
| 2384 | SN76496_0_w(0, data); | |
| 2380 | SN76496_0_w(machine, 0, data); | |
| 2385 | 2381 | break; |
| 2386 | 2382 | |
| 2387 | 2383 | default: |
| r1877 | r1878 | |
| 2412 | 2408 | else if (fulladdress == 0xc00011) |
| 2413 | 2409 | { |
| 2414 | 2410 | /* quite a few early games write here, most of the later ones don't */ |
| 2415 | SN76496_0_w(0, data); | |
| 2411 | SN76496_0_w(machine, 0, data); | |
| 2416 | 2412 | } |
| 2417 | 2413 | else |
| 2418 | 2414 | { |
| r1877 | r1878 | |
|---|---|---|
| 97 | 97 | skns_spc_regs = auto_malloc (0x40); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | extern void skns_draw_sprites(running_machine *machine, | |
| 100 | extern void skns_draw_sprites(running_machine *machine, | |
| 101 | 101 | |
| 102 | 102 | |
| 103 | 103 | static VIDEO_UPDATE(galpani3) |
| r1877 | r1878 | |
| 373 | 373 | static MACHINE_DRIVER_START( galpani3 ) |
| 374 | 374 | MDRV_CPU_ADD_TAG("main", M68000, 16000000) // ? (from which clock?) |
| 375 | 375 | MDRV_CPU_PROGRAM_MAP(galpani3_map,0) |
| 376 | MDRV_CPU_VBLANK_INT(galpani3_vblank, 3) | |
| 376 | MDRV_CPU_VBLANK_INT_HACK(galpani3_vblank, 3) | |
| 377 | 377 | |
| 378 | 378 | |
| 379 | 379 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | * Time Killers (2 sets) |
| 11 | 11 | * Bloodstorm (4 sets) |
| 12 | 12 | * Hard Yardage (2 sets) |
| 13 | * Pairs ( | |
| 13 | * Pairs (3 sets) | |
| 14 | 14 | * Driver's Edge (1 set) |
| 15 | 15 | * World Class Bowling (8 sets) |
| 16 | 16 | * Street Fighter: The Movie (4 sets) |
| r1877 | r1878 | |
| 23 | 23 | * Golden Tee Classic (3 Sets) |
| 24 | 24 | |
| 25 | 25 | Known issues: |
| 26 | * volume controls don | |
| 26 | * volume controls do not work in the Golden Tee games | |
| 27 | 27 | * Driver's Edge accesses many uninitialized RAM locations; |
| 28 | 28 | requires hack to make steering in attract mode work |
| 29 | 29 | |
| r1877 | r1878 | |
| 466 | 466 | |
| 467 | 467 | static READ32_HANDLER( trackball32_4bit_combined_r ) |
| 468 | 468 | { |
| 469 | return trackball32_4bit_r(offset, mem_mask) | | |
| 470 | (trackball32_4bit_p2_r(offset, mem_mask) << 8); | |
| 469 | return trackball32_4bit_r(machine, offset, mem_mask) | | |
| 470 | (trackball32_4bit_p2_r(machine, offset, mem_mask) << 8); | |
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | |
| r1877 | r1878 | |
| 601 | 601 | set_led_status(1, data & 0x01); |
| 602 | 602 | set_led_status(2, data & 0x02); |
| 603 | 603 | set_led_status(3, data & 0x04); |
| 604 | ticket_dispenser_w(0, (data & 0x10) << 3); | |
| 604 | ticket_dispenser_w(machine, 0, (data & 0x10) << 3); | |
| 605 | 605 | coin_counter_w(0, (data & 0x20) >> 5); |
| 606 | 606 | } |
| 607 | 607 | |
| r1877 | r1878 | |
| 619 | 619 | /* bit 4 controls the ticket dispenser */ |
| 620 | 620 | /* bit 5 controls the coin counter */ |
| 621 | 621 | /* bit 6 controls the diagnostic sound LED */ |
| 622 | ticket_dispenser_w(0, (data & 0x10) << 3); | |
| 622 | ticket_dispenser_w(machine, 0, (data & 0x10) << 3); | |
| 623 | 623 | coin_counter_w(0, (data & 0x20) >> 5); |
| 624 | 624 | } |
| 625 | 625 | |
| r1877 | r1878 | |
| 759 | 759 | |
| 760 | 760 | static READ32_HANDLER( input_port_0_msw_r ) |
| 761 | 761 | { |
| 762 | return input_port_0_word_r(offset,0) << 16; | |
| 762 | return input_port_0_word_r(machine,offset,0) << 16; | |
| 763 | 763 | } |
| 764 | 764 | |
| 765 | 765 | static READ32_HANDLER( input_port_1_msw_r ) |
| 766 | 766 | { |
| 767 | return input_port_1_word_r(offset,0) << 16; | |
| 767 | return input_port_1_word_r(machine,offset,0) << 16; | |
| 768 | 768 | } |
| 769 | 769 | |
| 770 | 770 | static READ32_HANDLER( input_port_2_msw_r ) |
| 771 | 771 | { |
| 772 | return input_port_2_word_r(offset,0) << 16; | |
| 772 | return input_port_2_word_r(machine,offset,0) << 16; | |
| 773 | 773 | } |
| 774 | 774 | |
| 775 | 775 | static READ32_HANDLER( input_port_3_msw_r ) |
| 776 | 776 | { |
| 777 | return input_port_3_word_r(offset,0) << 16; | |
| 777 | return input_port_3_word_r(machine,offset,0) << 16; | |
| 778 | 778 | } |
| 779 | 779 | |
| 780 | 780 | static READ32_HANDLER( input_port_4_msw_r ) |
| 781 | 781 | { |
| 782 | return special_port4_r(offset,0) << 16; | |
| 782 | return special_port4_r(machine,offset,0) << 16; | |
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | static WRITE32_HANDLER( int1_ack32_w ) |
| 786 | 786 | { |
| 787 | int1_ack_w(offset, data, mem_mask); | |
| 787 | int1_ack_w(machine, offset, data, mem_mask); | |
| 788 | 788 | } |
| 789 | 789 | |
| 790 | 790 | |
| r1877 | r1878 | |
| 1262 | 1262 | PORT_BIT( 0x00f0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1263 | 1263 | |
| 1264 | 1264 | PORT_START_TAG("TRACKX1") |
| 1265 | ||
| 1265 | | |
| 1266 | 1266 | |
| 1267 | 1267 | PORT_START_TAG("TRACKY1") |
| 1268 | ||
| 1268 | | |
| 1269 | 1269 | INPUT_PORTS_END |
| 1270 | 1270 | |
| 1271 | 1271 | |
| r1877 | r1878 | |
| 1288 | 1288 | PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) |
| 1289 | 1289 | |
| 1290 | 1290 | PORT_START_TAG("TRACKX2") |
| 1291 | ||
| 1291 | | |
| 1292 | 1292 | |
| 1293 | 1293 | PORT_START_TAG("TRACKY2") |
| 1294 | ||
| 1294 | | |
| 1295 | 1295 | INPUT_PORTS_END |
| 1296 | 1296 | |
| 1297 | 1297 | |
| r1877 | r1878 | |
| 1347 | 1347 | PORT_DIPSETTING( 0x0020, DEF_STR( Cocktail ) ) |
| 1348 | 1348 | |
| 1349 | 1349 | PORT_START_TAG("TRACKX1") |
| 1350 | ||
| 1350 | | |
| 1351 | 1351 | |
| 1352 | 1352 | PORT_START_TAG("TRACKY1") |
| 1353 | ||
| 1353 | | |
| 1354 | 1354 | |
| 1355 | 1355 | PORT_START_TAG("TRACKX2") |
| 1356 | ||
| 1356 | | |
| 1357 | 1357 | |
| 1358 | 1358 | PORT_START_TAG("TRACKY2") |
| 1359 | ||
| 1359 | | |
| 1360 | 1360 | INPUT_PORTS_END |
| 1361 | 1361 | |
| 1362 | 1362 | |
| r1877 | r1878 | |
| 1383 | 1383 | PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) |
| 1384 | 1384 | |
| 1385 | 1385 | PORT_START_TAG("TRACKX1") |
| 1386 | ||
| 1386 | | |
| 1387 | 1387 | |
| 1388 | 1388 | PORT_START_TAG("TRACKY1") |
| 1389 | ||
| 1389 | | |
| 1390 | 1390 | |
| 1391 | 1391 | PORT_START_TAG("TRACKX2") |
| 1392 | ||
| 1392 | | |
| 1393 | 1393 | |
| 1394 | 1394 | PORT_START_TAG("TRACKY2") |
| 1395 | ||
| 1395 | | |
| 1396 | 1396 | INPUT_PORTS_END |
| 1397 | 1397 | |
| 1398 | 1398 | |
| r1877 | r1878 | |
| 1423 | 1423 | PORT_DIPSETTING( 0x0040, "Two Trackballs" ) |
| 1424 | 1424 | |
| 1425 | 1425 | PORT_START_TAG("TRACKX1") |
| 1426 | ||
| 1426 | | |
| 1427 | 1427 | |
| 1428 | 1428 | PORT_START_TAG("TRACKY1") |
| 1429 | ||
| 1429 | | |
| 1430 | 1430 | |
| 1431 | 1431 | PORT_START_TAG("TRACKX2") |
| 1432 | ||
| 1432 | | |
| 1433 | 1433 | |
| 1434 | 1434 | PORT_START_TAG("TRACKY2") |
| 1435 | ||
| 1435 | | |
| 1436 | 1436 | INPUT_PORTS_END |
| 1437 | 1437 | |
| 1438 | 1438 | |
| r1877 | r1878 | |
| 1561 | 1561 | /* basic machine hardware */ |
| 1562 | 1562 | MDRV_CPU_ADD_TAG("main", M68000, CPU_CLOCK) |
| 1563 | 1563 | MDRV_CPU_PROGRAM_MAP(timekill_map,0) |
| 1564 | MDRV_CPU_VBLANK_INT(generate_int | |
| 1564 | MDRV_CPU_VBLANK_INT("main", generate_int | |
| 1565 | 1565 | |
| 1566 | 1566 | MDRV_CPU_ADD_TAG("sound", M6809, SOUND_CLOCK/8) |
| 1567 | 1567 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
| 1609 | 1609 | |
| 1610 | 1610 | MDRV_CPU_REPLACE("main", M68EC020, CPU020_CLOCK) |
| 1611 | 1611 | MDRV_CPU_PROGRAM_MAP(drivedge_map,0) |
| 1612 | MDRV_CPU_VBLANK_INT(NULL,0) | |
| 1612 | MDRV_CPU_VBLANK_INT_HACK(NULL,0) | |
| 1613 | 1613 | |
| 1614 | 1614 | MDRV_CPU_ADD(TMS32031, TMS_CLOCK) |
| 1615 | 1615 | MDRV_CPU_PROGRAM_MAP(drivedge_tms1_map,0) |
| r1877 | r1878 | |
| 1634 | 1634 | |
| 1635 | 1635 | MDRV_CPU_MODIFY("sound") |
| 1636 | 1636 | MDRV_CPU_PROGRAM_MAP(sound_020_map,0) |
| 1637 | MDRV_CPU_VBLANK_INT(irq1_line_assert,4) | |
| 1637 | MDRV_CPU_VBLANK_INT_HACK(irq1_line_assert,4) | |
| 1638 | 1638 | |
| 1639 | 1639 | MDRV_NVRAM_HANDLER(itech020) |
| 1640 | 1640 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
| 2045 | 2045 | |
| 2046 | 2046 | ROM_START( wcbwl140 ) /* Version 1.40 Tournament (PCB P/N 1082 Rev 2) */ |
| 2047 | 2047 | ROM_REGION32_BE( CODE_SIZE, REGION_USER1, 0 ) |
| 2048 | ROM_LOAD32_BYTE( "wcbtprm0.140", 0x00000, 0x20000, CRC(9d31ceb1) SHA1(d147976a763ba1e18d861351b12c5d275b94a562) ) | |
| 2049 | ROM_LOAD32_BYTE( "wcbtprm1.140", 0x00001, 0x20000, CRC(c6669452) SHA1(ba58da7bee5120682e2306454da287c969014899) ) | |
| 2050 | ROM_LOAD32_BYTE( "wcbtprm2.140", 0x00002, 0x20000, CRC(d2fc4d09) SHA1(17983759ad6137a2e67b8414ea58880865311534) ) | |
| 2051 | ROM_LOAD32_BYTE( "wcbtprm3.140", 0x00003, 0x20000, CRC(c41258a4) SHA1(182e8a25bdb126a4de8a44a1c26fd8b66f06d66e) ) | |
| 2048 | ROM_LOAD32_BYTE( "wcbfprm0.140", 0x00000, 0x20000, CRC(9d31ceb1) SHA1(d147976a763ba1e18d861351b12c5d275b94a562) ) /* Labeled "WCBF PROM0 1.40" ect */ | |
| 2049 | ROM_LOAD32_BYTE( "wcbfprm1.140", 0x00001, 0x20000, CRC(c6669452) SHA1(ba58da7bee5120682e2306454da287c969014899) ) | |
| 2050 | ROM_LOAD32_BYTE( "wcbfprm2.140", 0x00002, 0x20000, CRC(d2fc4d09) SHA1(17983759ad6137a2e67b8414ea58880865311534) ) | |
| 2051 | ROM_LOAD32_BYTE( "wcbfprm3.140", 0x00003, 0x20000, CRC(c41258a4) SHA1(182e8a25bdb126a4de8a44a1c26fd8b66f06d66e) ) | |
| 2052 | 2052 | |
| 2053 | 2053 | ROM_REGION( 0x28000, REGION_CPU2, 0 ) |
| 2054 | 2054 | ROM_LOAD( "wcb_snd.u88", 0x10000, 0x18000, CRC(e97a6d28) SHA1(96d7b7856918abcc460083f2a46582ba2a689288) ) /* Actual version is 4.01 but may be labeled V4.0 or V4.01 */ |
| r1877 | r1878 | |
| 2176 | 2176 | |
| 2177 | 2177 | |
| 2178 | 2178 | ROM_START( wcbwl15 ) /* Version 1.5 (3-tier board set: P/N 1059 Rev 3, P/N 1079 Rev 1 & P/N 1060 Rev 0) */ |
| 2179 | /* v1.0 for this platform ha | |
| 2179 | /* v1.0 for this platform has | |
| 2180 | 2180 | ROM_REGION16_BE( 0x80000, REGION_USER1, 0 ) |
| 2181 | 2181 | ROM_LOAD16_BYTE( "wcb_v15.u83", 0x00000, 0x20000, CRC(3ca9ab85) SHA1(364946dceb3f7279b7d67d9d685a98ba7f4901aa) ) /* Labeled as "WCB V1.5 (U83)" */ |
| 2182 | 2182 | ROM_LOAD16_BYTE( "wcb_v15.u88", 0x00001, 0x20000, CRC(d43e6fad) SHA1(fd72f6945e7f5ef86dc28503749d18086dd29906) ) /* Labeled as "WCB V1.5 (U88)" */ |
| r1877 | r1878 | |
| 3104 | 3104 | ROM_END |
| 3105 | 3105 | |
| 3106 | 3106 | |
| 3107 | ROM_START( gt97t24 | |
| 3107 | ROM_START( gt97t243 ) /* Version 2.43 Tournament Edition (PCB P/N 1082 Rev 2) */ | |
| 3108 | 3108 | ROM_REGION32_BE( CODE_SIZE, REGION_USER1, 0 ) |
| 3109 | ROM_LOAD32_BYTE( "gt97prm0.240", 0x00000, 0x100000, CRC(88a386d0) SHA1(003dbf784125b1a442f85e18f8161695dcacc3a8) ) | |
| 3110 | ROM_LOAD32_BYTE( "gt97prm1.240", 0x00001, 0x100000, CRC(b0d751aa) SHA1(7e6ab9c2bb0bd4f50360655c59f48c44f6135f4f) ) | |
| 3111 | ROM_LOAD32_BYTE( "gt97prm2.240", 0x00002, 0x100000, CRC(451be534) SHA1(2f78cdba607c4b936b5cbdb520757d038d9aa7a3) ) | |
| 3112 | ROM_LOAD32_BYTE( "gt97prm3.240", 0x00003, 0x100000, CRC(70da8ca5) SHA1(baf56d04c5d75165fc9f3269650847e46bbbe2d3) ) | |
| 3109 | ROM_LOAD32_BYTE( "gt97prm0.243", 0x00000, 0x100000, CRC(b8de60f1) SHA1(06b1f8b9d0b878d5a19e6756957e2df19e013ad6) ) | |
| 3110 | ROM_LOAD32_BYTE( "gt97prm1.243", 0x00001, 0x100000, CRC(8152e5d3) SHA1(2a4f8acc6a4e33864c97d5974e2230b1cf3632ea) ) | |
| 3111 | ROM_LOAD32_BYTE( "gt97prm2.243", 0x00002, 0x100000, CRC(b80061be) SHA1(9a6a6281690b3bd2eabb081467bfda074639fa6a) ) | |
| 3112 | ROM_LOAD32_BYTE( "gt97prm3.243", 0x00003, 0x100000, CRC(d184968d) SHA1(eecd4e9d060e4b8feabca715d3d7f9738641cfcc) ) | |
| 3113 | 3113 | |
| 3114 | 3114 | ROM_REGION( 0x28000, REGION_CPU2, 0 ) |
| 3115 | 3115 | ROM_LOAD( "gt_nr.u88", 0x10000, 0x18000, CRC(2cee9e98) SHA1(02edac7abab2335c1cd824d1d9b26aa32238a2de) ) |
| r1877 | r1878 | |
| 3135 | 3135 | ROM_END |
| 3136 | 3136 | |
| 3137 | 3137 | |
| 3138 | ROM_START( gt97t24 | |
| 3138 | ROM_START( gt97t240 ) /* Version 2.40 Tournament Edition (PCB P/N 1082 Rev 2) */ | |
| 3139 | 3139 | ROM_REGION32_BE( CODE_SIZE, REGION_USER1, 0 ) |
| 3140 | ROM_LOAD32_BYTE( "gt97prm0.243", 0x00000, 0x100000, CRC(b8de60f1) SHA1(06b1f8b9d0b878d5a19e6756957e2df19e013ad6) ) | |
| 3141 | ROM_LOAD32_BYTE( "gt97prm1.243", 0x00001, 0x100000, CRC(8152e5d3) SHA1(2a4f8acc6a4e33864c97d5974e2230b1cf3632ea) ) | |
| 3142 | ROM_LOAD32_BYTE( "gt97prm2.243", 0x00002, 0x100000, CRC(b80061be) SHA1(9a6a6281690b3bd2eabb081467bfda074639fa6a) ) | |
| 3143 | ROM_LOAD32_BYTE( "gt97prm3.243", 0x00003, 0x100000, CRC(d184968d) SHA1(eecd4e9d060e4b8feabca715d3d7f9738641cfcc) ) | |
| 3140 | ROM_LOAD32_BYTE( "gt97prm0.240", 0x00000, 0x100000, CRC(88a386d0) SHA1(003dbf784125b1a442f85e18f8161695dcacc3a8) ) | |
| 3141 | ROM_LOAD32_BYTE( "gt97prm1.240", 0x00001, 0x100000, CRC(b0d751aa) SHA1(7e6ab9c2bb0bd4f50360655c59f48c44f6135f4f) ) | |
| 3142 | ROM_LOAD32_BYTE( "gt97prm2.240", 0x00002, 0x100000, CRC(451be534) SHA1(2f78cdba607c4b936b5cbdb520757d038d9aa7a3) ) | |
| 3143 | ROM_LOAD32_BYTE( "gt97prm3.240", 0x00003, 0x100000, CRC(70da8ca5) SHA1(baf56d04c5d75165fc9f3269650847e46bbbe2d3) ) | |
| 3144 | 3144 | |
| 3145 | 3145 | ROM_REGION( 0x28000, REGION_CPU2, 0 ) |
| 3146 | 3146 | ROM_LOAD( "gt_nr.u88", 0x10000, 0x18000, CRC(2cee9e98) SHA1(02edac7abab2335c1cd824d1d9b26aa32238a2de) ) |
| r1877 | r1878 | |
| 3807 | 3807 | init_shuffle_bowl_common(machine, 0x1116); |
| 3808 | 3808 | } |
| 3809 | 3809 | |
| 3810 | static DRIVER_INIT( wcbowlt ) /* PIC 16C54 labeled as ITBWL- | |
| 3810 | static DRIVER_INIT( wcbowlt ) /* PIC 16C54 labeled as ITBWL-3 */ | |
| 3811 | 3811 | { |
| 3812 | /* Tournament Version */ | |
| 3812 | /* Tournament Version, Same protection memory address as WCB Deluxe, but uses the standard WCB pic ITBWL-3 */ | |
| 3813 | 3813 | init_shuffle_bowl_common(machine, 0x111a); |
| 3814 | 3814 | |
| 3815 | 3815 | timekeeper_init( 0, TIMEKEEPER_M48T02, NULL ); |
| r1877 | r1878 | |
| 3832 | 3832 | { |
| 3833 | 3833 | /* |
| 3834 | 3834 | This is the 3 tier PCB with the short ROM board: |
| 3835 | Known GT versions on this board: GT3D v1.4 through v1.92S | |
| 3835 | Known (dumped) GT versions on this board: GT3D v1.4 through v1.92S | |
| 3836 | 3836 | |
| 3837 | 3837 | Hacked versions of this PCB have been found with GT97 |
| 3838 | 3838 | through GTClassic. This is _NOT_ a factory modification |
| r1877 | r1878 | |
| 3859 | 3859 | static DRIVER_INIT( aamat ) |
| 3860 | 3860 | { |
| 3861 | 3861 | /* |
| 3862 | Tournament Version | |
| 3862 | Tournament Version - So install needed handler for the TimeKeeper ram | |
| 3863 | 3863 | */ |
| 3864 | 3864 | DRIVER_INIT_CALL(aama); |
| 3865 | 3865 | timekeeper_init( 0, TIMEKEEPER_M48T02, NULL ); |
| r1877 | r1878 | |
| 3909 | 3909 | move.b 680002,d0 ; Read protection result |
| 3910 | 3910 | andi.b #$C0,d0 |
| 3911 | 3911 | cmpi.b #$80,d0 |
| 3912 | Label1 bne.s Label1 ; Infinite loop if re | |
| 3912 | Label1 bne.s Label1 ; Infinite loop if re | |
| 3913 | 3913 | rts ; Otherwise just return to the game :-) |
| 3914 | 3914 | |
| 3915 | 3915 | */ |
| r1877 | r1878 | |
| 3948 | 3948 | GAME( 1997, shufshot, 0, sftm, shufshot, shufshot, ROT0, "Strata/Incredible Technologies", "Shuffleshot (v1.40)" , 0) /* PIC 16C54 labeled as ITSHF-1 */ |
| 3949 | 3949 | GAME( 1997, sshot139, shufshot, sftm, shufshot, shufshot, ROT0, "Strata/Incredible Technologies", "Shuffleshot (v1.39)" , 0) /* PIC 16C54 labeled as ITSHF-1 */ |
| 3950 | 3950 | GAME( 1997, sshot137, shufshot, sftm, shufbowl, shufshot, ROT0, "Strata/Incredible Technologies", "Shuffleshot (v1.37)" , 0) /* PIC 16C54 labeled as ITSHF-1 */ |
| 3951 | GAME( 1997, wcbwl140, wcbowldx, tourny, wcbowldx, wcbowlt, ROT0, "Incredible Technologies", "World Class Bowling Tournament (v1.40)" , 0) /* PIC 16C54 labeled as ITBWL- | |
| 3951 | GAME( 1997, wcbwl140, wcbowldx, tourny, wcbowldx, wcbowlt, ROT0, "Incredible Technologies", "World Class Bowling Tournament (v1.40)" , 0) /* PIC 16C54 labeled as ITBWL-3 */ | |
| 3952 | 3952 | GAME( 1999, wcbowldx, 0, sftm, wcbowldx, shufshot, ROT0, "Incredible Technologies", "World Class Bowling Deluxe (v2.00)" , 0) /* PIC 16C54 labeled as ITBWL-4 */ |
| 3953 | 3953 | |
| 3954 | 3954 | /* |
| r1877 | r1878 | |
| 3969 | 3969 | Sound P/N 1078 Rev 1 or P/N 1066 Rev 2 |
| 3970 | 3970 | n = Non-tournament (AAMA 676266+) PCB P/N 1082 Rev 2 - Applies only for GT3D |
| 3971 | 3971 | t = Tournament PCB P/N 1082 Rev 2, with necessary chips on board: |
| 3972 | Philips SCN68681 (DUART) & ST Timekeeper (M48T02-120PC1) | |
| 3972 | Philips SCN68681 (DUART) & ST Timekeeper (M48T02-120PC1) with an additional 3.6864MHz OSC | |
| 3973 | 3973 | |
| 3974 | 3974 | NOTE: Due to various different upgrade packages from IT, the 3 tier boards can end up with any combination |
| 3975 | 3975 | of rom boards and sound boards. For historical reasons, GTG3 3 tier S versions will use the oldest |
| r1877 | r1878 | |
| 4009 | 4009 | GAME( 1997, gt97v121, gt97, sftm, gt97o, aama, ROT0, "Incredible Technologies", "Golden Tee '97 (v1.21)" , 0) /* PIC 16C54 labeled as ITGFS-3 */ |
| 4010 | 4010 | GAME( 1997, gt97s121, gt97, sftm, gt97s, s_ver, ROT0, "Incredible Technologies", "Golden Tee '97 (v1.21S)" , 0) /* PIC 16C54 labeled as ITGFM-3 */ |
| 4011 | 4011 | GAME( 1997, gt97v120, gt97, sftm, gt97o, aama, ROT0, "Incredible Technologies", "Golden Tee '97 (v1.20)" , 0) /* PIC 16C54 labeled as ITGFS-3 */ |
| 4012 | GAME( 1997, gt97t243, gt97, tourny, gt97o, aamat, ROT0, "Incredible Technologies", "Golden Tee '97 Tournament (v2.43)" , 0) /* PIC 16C54 labeled as ITGFS-3 */ | |
| 4012 | 4013 | GAME( 1997, gt97t240, gt97, tourny, gt97o, aamat, ROT0, "Incredible Technologies", "Golden Tee '97 Tournament (v2.40)" , 0) /* PIC 16C54 labeled as ITGFS-3 */ |
| 4013 | GAME( 1997, gt97t243, gt97, tourny, gt97o, aamat, ROT0, "Incredible Technologies", "Golden Tee '97 Tournament (v2.43)" , 0) /* PIC 16C54 labeled as ITGFS-3 */ | |
| 4014 | 4014 | |
| 4015 | 4015 | GAME( 1998, gt98, 0, sftm, aama, aama, ROT0, "Incredible Technologies", "Golden Tee '98 (v1.10)" , 0) /* PIC 16C54 labeled as ITGF98 */ |
| 4016 | 4016 | GAME( 1998, gt98v100, gt98, sftm, gt98, aama, ROT0, "Incredible Technologies", "Golden Tee '98 (v1.00)" , 0) /* PIC 16C54 labeled as ITGF98 */ |
| r1877 | r1878 | |
|---|---|---|
| 45 | 45 | ***************************************************************************/ |
| 46 | 46 | |
| 47 | 47 | #include "driver.h" |
| 48 | #include "deprecat.h" | |
| 48 | 49 | #include "cpu/z80/z80.h" |
| 49 | 50 | #include "cpu/m6805/m6805.h" |
| 50 | 51 | #include "sound/2203intf.h" |
| r1877 | r1878 | |
| 71 | 72 | //AT |
| 72 | 73 | static READ8_HANDLER( kiki_2203_r ) |
| 73 | 74 | { |
| 74 | return(YM2203_status_port_0_r(0) & 0x7f); | |
| 75 | return(YM2203_status_port_0_r(machine,0) & 0x7f); | |
| 75 | 76 | } |
| 76 | 77 | //ZT |
| 77 | 78 | |
| r1877 | r1878 | |
| 385 | 386 | |
| 386 | 387 | MDRV_CPU_ADD(Z80, 24000000/4) /* 6 MHz, Uses clock divided 24MHz OSC */ |
| 387 | 388 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 388 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 389 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 389 | 390 | |
| 390 | 391 | MDRV_CPU_ADD_TAG("mcu", M68705, 4000000) /* xtal is 4MHz, divided by 4 internally */ |
| 391 | 392 | MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem) |
| 392 | MDRV_CPU_VBLANK_INT(mexico86_m68705_interrupt,2) | |
| 393 | MDRV_CPU_VBLANK_INT_HACK(mexico86_m68705_interrupt,2) | |
| 393 | 394 | |
| 394 | 395 | MDRV_CPU_ADD_TAG("sub", Z80, 8000000/2) /* 4 MHz, Uses 8Mhz OSC */ |
| 395 | 396 | MDRV_CPU_PROGRAM_MAP(sub_cpu_map,0) |
| 396 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 397 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 397 | 398 | |
| 398 | 399 | MDRV_INTERLEAVE(100) /* 100 CPU slices per frame - an high value to ensure proper */ |
| 399 | 400 | /* synchronization of the CPUs */ |
| r1877 | r1878 | |
| 441 | 442 | MDRV_IMPORT_FROM(knightb) |
| 442 | 443 | |
| 443 | 444 | MDRV_CPU_MODIFY("main") |
| 444 | MDRV_CPU_VBLANK_INT(kikikai_interrupt | |
| 445 | MDRV_CPU_VBLANK_INT("main", kikikai_interrupt | |
| 445 | 446 | |
| 446 | 447 | MDRV_CPU_REMOVE("mcu") // we don't have code for the 68701 |
| 447 | 448 |
| r1877 | r1878 | |
|---|---|---|
| 289 | 289 | MDRV_CPU_ADD(Z80, 2350000) |
| 290 | 290 | //MDRV_CPU_ADD(Z80, 2760000) |
| 291 | 291 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 292 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 292 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 293 | 293 | |
| 294 | 294 | MDRV_MACHINE_RESET(chaknpop) |
| 295 | 295 |
| r1877 | r1878 | |
|---|---|---|
| 753 | 753 | static MACHINE_DRIVER_START( fitfight ) |
| 754 | 754 | MDRV_CPU_ADD_TAG("main",M68000, 12000000) |
| 755 | 755 | MDRV_CPU_PROGRAM_MAP(fitfight_main_map,0) |
| 756 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 756 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 757 | 757 | |
| 758 | 758 | MDRV_CPU_ADD(UPD7810, 12000000) |
| 759 | 759 | /* audio CPU */ |
| 760 | 760 | MDRV_CPU_CONFIG(sound_cpu_config) |
| 761 | 761 | MDRV_CPU_PROGRAM_MAP(snd_mem, 0) |
| 762 | 762 | MDRV_CPU_IO_MAP(snd_io, 0) |
| 763 | MDRV_CPU_VBLANK_INT(snd_irq | |
| 763 | MDRV_CPU_VBLANK_INT("main", snd_irq | |
| 764 | 764 | |
| 765 | 765 | MDRV_GFXDECODE(fitfight) |
| 766 | 766 | |
| r1877 | r1878 | |
| 787 | 787 | static MACHINE_DRIVER_START( bbprot ) |
| 788 | 788 | MDRV_CPU_ADD_TAG("main",M68000, 12000000) |
| 789 | 789 | MDRV_CPU_PROGRAM_MAP(bbprot_main_map,0) |
| 790 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 790 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 791 | 791 | |
| 792 | 792 | MDRV_GFXDECODE(prot) |
| 793 | 793 |
| r1877 | r1878 | |
|---|---|---|
| 223 | 223 | MDRV_CPU_ADD(Z80, 19968000 / 8) |
| 224 | 224 | MDRV_CPU_PROGRAM_MAP(readmem, writemem) |
| 225 | 225 | MDRV_CPU_IO_MAP(readport, writeport) |
| 226 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 226 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 227 | 227 | |
| 228 | 228 | /* video hardware */ |
| 229 | 229 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 89 | 89 | #define RES_320x200 0 |
| 90 | 90 | #define RES_640x200 1 |
| 91 | 91 | |
| 92 | static void cga_alphanumeric_tilemap(running_machine *machine, | |
| 92 | static void cga_alphanumeric_tilemap(running_machine *machine, | |
| 93 | 93 | |
| 94 | 94 | static VIDEO_START( filetto ) |
| 95 | 95 | { |
| r1877 | r1878 | |
| 109 | 109 | |
| 110 | 110 | |
| 111 | 111 | /*Basic Graphic mode */ |
| 112 | static void cga_graphic_bitmap(running_machine *machine, | |
| 112 | static void cga_graphic_bitmap(running_machine *machine, | |
| 113 | 113 | { |
| 114 | 114 | static UINT16 x,y,pen = 0; |
| 115 | 115 | static UINT32 offs; |
| r1877 | r1878 | |
| 197 | 197 | |
| 198 | 198 | |
| 199 | 199 | |
| 200 | static void cga_alphanumeric_tilemap(running_machine *machine, | |
| 200 | static void cga_alphanumeric_tilemap(running_machine *machine, | |
| 201 | 201 | { |
| 202 | 202 | static UINT32 offs,x,y,max_x,max_y; |
| 203 | 203 | |
| r1877 | r1878 | |
| 738 | 738 | MDRV_CPU_ADD_TAG("main", I8088, 8000000) |
| 739 | 739 | MDRV_CPU_PROGRAM_MAP(filetto_map,0) |
| 740 | 740 | MDRV_CPU_IO_MAP(filetto_io,0) |
| 741 | MDRV_CPU_VBLANK_INT(filetto_irq,200) | |
| 741 | MDRV_CPU_VBLANK_INT_HACK(filetto_irq,200) | |
| 742 | 742 | |
| 743 | 743 | MDRV_GFXDECODE(filetto) |
| 744 | 744 |
| r1877 | r1878 | |
|---|---|---|
| 102 | 102 | //if it returns 1 there's no sound. is it used to sync the game and sound? |
| 103 | 103 | //or just a debug enable/disble register? |
| 104 | 104 | return 0; |
| 105 | return 1; | |
| 105 | //return 1; | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | static WRITE16_HANDLER( ashnojoe_soundlatch_w ) |
| 109 | 109 | { |
| 110 | 110 | if(ACCESSING_LSB) |
| 111 | 111 | { |
| 112 | soundlatch_w(0,data & 0xff); | |
| 112 | soundlatch_w(machine,0,data & 0xff); | |
| 113 | 113 | //needed? |
| 114 | cpunum_set_input_line( | |
| 114 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| r1877 | r1878 | |
| 143 | 143 | int ret = 0; |
| 144 | 144 | ret ^= 1; |
| 145 | 145 | return ret; |
| 146 | return 1; | |
| 147 | return 0; | |
| 148 | return mame_rand(Machine); | |
| 146 | /* FIXME: earlier attemts to remove ? | |
| 147 | return 1; | |
| 148 | return 0; | |
| 149 | return mame_rand(Machine); | |
| 150 | */ | |
| 149 | 151 | } |
| 150 | 152 | |
| 151 | 153 | static WRITE8_HANDLER( adpcm_data_w ) |
| r1877 | r1878 | |
| 335 | 337 | /* basic machine hardware */ |
| 336 | 338 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz (verified on pcb) */ |
| 337 | 339 | MDRV_CPU_PROGRAM_MAP(ashnojoe_map,0) |
| 338 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 340 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 339 | 341 | |
| 340 | 342 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz (verified on pcb) */ |
| 341 | 343 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 81 | 81 | */ |
| 82 | 82 | |
| 83 | 83 | #include "driver.h" |
| 84 | #include "deprecat.h" | |
| 84 | 85 | #include "cpu/z80/z80.h" |
| 85 | 86 | #include "sound/dac.h" |
| 86 | 87 | #include "sound/2203intf.h" |
| r1877 | r1878 | |
| 158 | 159 | |
| 159 | 160 | static WRITE16_HANDLER( amazon_sound_w ) |
| 160 | 161 | { |
| 161 | soundlatch_w(0,((data & 0x7f) << 1) | 1); | |
| 162 | soundlatch_w(machine,0,((data & 0x7f) << 1) | 1); | |
| 162 | 163 | } |
| 163 | 164 | |
| 164 | 165 | static READ8_HANDLER( soundlatch_clear_r ) |
| 165 | 166 | { |
| 166 | soundlatch_clear_w(0,0); | |
| 167 | soundlatch_clear_w(machine,0,0); | |
| 167 | 168 | return 0; |
| 168 | 169 | } |
| 169 | 170 | |
| r1877 | r1878 | |
| 604 | 605 | static MACHINE_DRIVER_START( amazon ) |
| 605 | 606 | MDRV_CPU_ADD(M68000, 8000000 ) |
| 606 | 607 | MDRV_CPU_PROGRAM_MAP(amazon_readmem,amazon_writemem) |
| 607 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 608 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 608 | 609 | |
| 609 | 610 | MDRV_CPU_ADD(Z80, 4000000) |
| 610 | 611 | /* audio CPU */ /* 4 MHz???? */ |
| 611 | 612 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 612 | 613 | MDRV_CPU_IO_MAP(sound_readport,sound_writeport_3526) |
| 613 | MDRV_CPU_VBLANK_INT(irq0_line_hold,128) /* ??? */ | |
| 614 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128) /* ??? */ | |
| 614 | 615 | |
| 615 | 616 | MDRV_MACHINE_START(amazon) |
| 616 | 617 | |
| r1877 | r1878 | |
| 644 | 645 | static MACHINE_DRIVER_START( ym3526 ) |
| 645 | 646 | MDRV_CPU_ADD(M68000, 8000000 ) |
| 646 | 647 | MDRV_CPU_PROGRAM_MAP(terracre_readmem,terracre_writemem) |
| 647 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 648 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 648 | 649 | |
| 649 | 650 | MDRV_CPU_ADD(Z80, 4000000) |
| 650 | 651 | /* audio CPU */ /* 4 MHz???? */ |
| 651 | 652 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 652 | 653 | MDRV_CPU_IO_MAP(sound_readport,sound_writeport_3526) |
| 653 | MDRV_CPU_VBLANK_INT(irq0_line_hold,128) /* ??? */ | |
| 654 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128) /* ??? */ | |
| 654 | 655 | |
| 655 | 656 | |
| 656 | 657 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 682 | 683 | static MACHINE_DRIVER_START( ym2203 ) |
| 683 | 684 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz?? */ |
| 684 | 685 | MDRV_CPU_PROGRAM_MAP(terracre_readmem,terracre_writemem) |
| 685 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 686 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 686 | 687 | |
| 687 | 688 | MDRV_CPU_ADD(Z80, 4000000) |
| 688 | 689 | /* audio CPU */ /* 4 MHz???? */ |
| 689 | 690 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 690 | 691 | MDRV_CPU_IO_MAP(sound_readport,sound_writeport_2203) |
| 691 | MDRV_CPU_VBLANK_INT(irq0_line_hold,128) /* ??? */ | |
| 692 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128) /* ??? */ | |
| 692 | 693 | |
| 693 | 694 | |
| 694 | 695 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 66 | 66 | |
| 67 | 67 | static READ8_HANDLER( port1_r ) |
| 68 | 68 | { |
| 69 | return input_port_1_r(0) | (ticket_dispenser_0_r(0) >> 5); | |
| 69 | return input_port_1_r(machine, 0) | (ticket_dispenser_0_r(machine, 0) >> 5); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | static WRITE8_HANDLER( lamps_w ) |
| r1877 | r1878 | |
| 90 | 90 | set_led_status(9,data & 0x08); |
| 91 | 91 | |
| 92 | 92 | /* bit 5 - ticket out in trivia games */ |
| 93 | ticket_dispenser_w(0, (data & 0x20)<< 2); | |
| 93 | ticket_dispenser_w(machine, 0, (data & 0x20)<< 2); | |
| 94 | 94 | |
| 95 | 95 | /* bit 6 enables NMI */ |
| 96 | interrupt_enable_w(0,data & 0x40); | |
| 96 | interrupt_enable_w(machine, 0,data & 0x40); | |
| 97 | 97 | |
| 98 | 98 | /* bit 7 goes directly to the sound amplifier */ |
| 99 | 99 | DAC_data_w(0,((data & 0x80) >> 7) * 255); |
| r1877 | r1878 | |
| 446 | 446 | /* basic machine hardware */ |
| 447 | 447 | MDRV_CPU_ADD(Z80,4000000) /* 4 MHz */ |
| 448 | 448 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 449 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 449 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 450 | 450 | |
| 451 | 451 | MDRV_MACHINE_RESET(findout) |
| 452 | 452 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r1877 | r1878 | |
|---|---|---|
| 72 | 72 | /* basic machine hardware */ |
| 73 | 73 | MDRV_CPU_ADD(Z80,24000000 / 6) /* 4 MHz ? */ |
| 74 | 74 | MDRV_CPU_PROGRAM_MAP(minivadr_map,0) |
| 75 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 75 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 76 | 76 | |
| 77 | 77 | /* video hardware */ |
| 78 | 78 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 202 | 202 | /* basic machine hardware */ |
| 203 | 203 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz ? */ |
| 204 | 204 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 205 | MDRV_CPU_VBLANK_INT(mouser_nmi_interrupt | |
| 205 | MDRV_CPU_VBLANK_INT("main", mouser_nmi_interrupt | |
| 206 | 206 | |
| 207 | 207 | MDRV_CPU_ADD(Z80, 4000000) /* ??? */ |
| 208 | 208 | MDRV_CPU_PROGRAM_MAP(readmem2,writemem2) |
| 209 | 209 | MDRV_CPU_IO_MAP(readport2,writeport2) |
| 210 | 210 | /* audio CPU */ |
| 211 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,4) /* ??? This controls the sound tempo */ | |
| 211 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,4) /* ??? This controls the sound tempo */ | |
| 212 | 212 | |
| 213 | 213 | /* video hardware */ |
| 214 | 214 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 222 | 222 | { |
| 223 | 223 | case 0x00: |
| 224 | 224 | { |
| 225 | return (input_port_0_word_r(0,0) << 16) | input_port_1_word_r(0,0) | | |
| 225 | return (input_port_0_word_r(machine,0,0) << 16) | input_port_1_word_r(machine,0,0) | | |
| 226 | 226 | (EEPROM_read_bit() << 7) | frame_counter; |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | case 0x01: |
| 230 | 230 | { |
| 231 | return input_port_2_word_r(0,0) | (coin_word << 16); | |
| 231 | return input_port_2_word_r(machine,0,0) | (coin_word << 16); | |
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | 234 | |
| r1877 | r1878 | |
| 243 | 243 | { |
| 244 | 244 | if (ACCESSING_MSB32) /* $500000 is watchdog */ |
| 245 | 245 | { |
| 246 | watchdog_reset | |
| 246 | watchdog_reset | |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | if (ACCESSING_LSB32) |
| r1877 | r1878 | |
| 313 | 313 | |
| 314 | 314 | case 0x00: /* P1 */ |
| 315 | 315 | { |
| 316 | x = input_port_3_word_r(0,0) << 6; | |
| 317 | y = input_port_4_word_r(0,0) << 6; | |
| 316 | x = input_port_3_word_r(machine,0,0) << 6; | |
| 317 | y = input_port_4_word_r(machine,0,0) << 6; | |
| 318 | 318 | |
| 319 | 319 | return ((x << 24) &0xff000000) | ((x << 8) &0xff0000) |
| 320 | 320 | | ((y << 8) &0xff00) | ((y >> 8) &0xff) ; |
| r1877 | r1878 | |
| 322 | 322 | |
| 323 | 323 | case 0x01: /* P2 */ |
| 324 | 324 | { |
| 325 | x = input_port_5_word_r(0,0) << 6; | |
| 326 | y = input_port_6_word_r(0,0) << 6; | |
| 325 | x = input_port_5_word_r(machine,0,0) << 6; | |
| 326 | y = input_port_6_word_r(machine,0,0) << 6; | |
| 327 | 327 | |
| 328 | 328 | return ((x << 24) &0xff000000) | ((x << 8) &0xff0000) |
| 329 | 329 | | ((y << 8) &0xff00) | ((y >> 8) &0xff) ; |
| r1877 | r1878 | |
| 551 | 551 | /* basic machine hardware */ |
| 552 | 552 | MDRV_CPU_ADD(M68EC020, 16000000) /* 16 MHz */ |
| 553 | 553 | MDRV_CPU_PROGRAM_MAP(undrfire_readmem,undrfire_writemem) |
| 554 | MDRV_CPU_VBLANK_INT(undrfire_interrupt | |
| 554 | MDRV_CPU_VBLANK_INT("main", undrfire_interrupt | |
| 555 | 555 | |
| 556 | 556 | TAITO_F3_SOUND_SYSTEM_CPU(16000000) |
| 557 | 557 |
| r1877 | r1878 | |
|---|---|---|
| 316 | 316 | |
| 317 | 317 | static WRITE32_HANDLER( deco32_sound_w ) |
| 318 | 318 | { |
| 319 | soundlatch_w(0,data & 0xff); | |
| 320 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 319 | soundlatch_w(machine,0,data & 0xff); | |
| 320 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | static READ32_HANDLER( deco32_71_r ) |
| r1877 | r1878 | |
| 445 | 445 | |
| 446 | 446 | static READ32_HANDLER(dragngun_oki_2_r) |
| 447 | 447 | { |
| 448 | return OKIM6295_status_2_r(0); | |
| 448 | return OKIM6295_status_2_r(machine, 0); | |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | static WRITE32_HANDLER(dragngun_oki_2_w) |
| 452 | 452 | { |
| 453 | OKIM6295_data_2_w(0,data&0xff); | |
| 453 | OKIM6295_data_2_w(machine, 0, data&0xff); | |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | /**********************************************************************************/ |
| r1877 | r1878 | |
| 477 | 477 | /* 'Swap bits 0 and 3 to correct for design error from BSMT schematic' */ |
| 478 | 478 | int soundcommand = (data>>16)&0xff; |
| 479 | 479 | soundcommand = BITSWAP8(soundcommand,7,6,5,4,0,2,1,3); |
| 480 | soundlatch_w(0,soundcommand); | |
| 480 | soundlatch_w(machine,0,soundcommand); | |
| 481 | 481 | } |
| 482 | 482 | } |
| 483 | 483 | |
| r1877 | r1878 | |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | /* Playfield control - Only written in full word memory accesses */ |
| 606 | deco32_pri_w(0,data&0x3,0); /* Bit 0 - layer priority toggle, Bit 1 - BG2/3 Joint mode (8bpp) */ | |
| 606 | deco32_pri_w(machine,0,data&0x3,0); /* Bit 0 - layer priority toggle, Bit 1 - BG2/3 Joint mode (8bpp) */ | |
| 607 | 607 | |
| 608 | 608 | /* Sound board reset control */ |
| 609 | 609 | if (data&0x80) |
| r1877 | r1878 | |
| 641 | 641 | EEPROM_write_bit(data & 0x10); |
| 642 | 642 | EEPROM_set_cs_line((data & 0x40) ? CLEAR_LINE : ASSERT_LINE); |
| 643 | 643 | |
| 644 | deco32_pri_w(0,data&0x3,0); /* Bit 0 - layer priority toggle, Bit 1 - BG2/3 Joint mode (8bpp) */ | |
| 644 | deco32_pri_w(machine,0,data&0x3,0); /* Bit 0 - layer priority toggle, Bit 1 - BG2/3 Joint mode (8bpp) */ | |
| 645 | 645 | } |
| 646 | 646 | } |
| 647 | 647 | |
| r1877 | r1878 | |
| 654 | 654 | if (offset==0x700/4) { |
| 655 | 655 | |
| 656 | 656 | /* bit 1 of nslasher_sound_irq specifies IRQ command writes */ |
| 657 | soundlatch_w(0,(data>>16)&0xff); | |
| 657 | soundlatch_w(machine,0,(data>>16)&0xff); | |
| 658 | 658 | nslasher_sound_irq |= 0x02; |
| 659 | cpunum_set_input_line( | |
| 659 | cpunum_set_input_line(machine, 1, 0, (nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 660 | 660 | } |
| 661 | 661 | } |
| 662 | 662 | |
| r1877 | r1878 | |
| 1133 | 1133 | |
| 1134 | 1134 | static WRITE8_HANDLER(deco32_bsmt1_w) |
| 1135 | 1135 | { |
| 1136 | BSMT2000_data_0_w(offset^ 0xff, ((bsmt_latch<<8)|data), 0); | |
| 1137 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, HOLD_LINE); /* BSMT is ready */ | |
| 1136 | BSMT2000_data_0_w(machine, offset^ 0xff, ((bsmt_latch<<8)|data), 0); | |
| 1137 | cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, HOLD_LINE); /* BSMT is ready */ | |
| 1138 | 1138 | } |
| 1139 | 1139 | |
| 1140 | 1140 | static READ8_HANDLER(deco32_bsmt_status_r) |
| r1877 | r1878 | |
| 1180 | 1180 | { |
| 1181 | 1181 | /* bit 1 of nslasher_sound_irq specifies IRQ command writes */ |
| 1182 | 1182 | nslasher_sound_irq &= ~0x02; |
| 1183 | cpunum_set_input_line(Machine, 1, 0, (nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 1184 | return soundlatch_r(0); | |
| 1183 | cpunum_set_input_line(machine, 1, 0, (nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); | |
| 1184 | return soundlatch_r(machine,0); | |
| 1185 | 1185 | } |
| 1186 | 1186 | |
| 1187 | 1187 | static ADDRESS_MAP_START( nslasher_sound, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 1877 | 1877 | /* basic machine hardware */ |
| 1878 | 1878 | MDRV_CPU_ADD(ARM, 28000000/4) |
| 1879 | 1879 | MDRV_CPU_PROGRAM_MAP(captaven_readmem,captaven_writemem) |
| 1880 | MDRV_CPU_VBLANK_INT(deco32_vbl_interrupt | |
| 1880 | MDRV_CPU_VBLANK_INT("main", deco32_vbl_interrupt | |
| 1881 | 1881 | |
| 1882 | 1882 | MDRV_CPU_ADD(H6280, 32220000/8) |
| 1883 | 1883 | /* audio CPU */ |
| r1877 | r1878 | |
| 1925 | 1925 | /* basic machine hardware */ |
| 1926 | 1926 | MDRV_CPU_ADD(ARM, 28000000/4) |
| 1927 | 1927 | MDRV_CPU_PROGRAM_MAP(fghthist_readmem,fghthist_writemem) |
| 1928 | MDRV_CPU_VBLANK_INT(deco32_vbl_interrupt | |
| 1928 | MDRV_CPU_VBLANK_INT("main", deco32_vbl_interrupt | |
| 1929 | 1929 | |
| 1930 | 1930 | MDRV_CPU_ADD(H6280, 32220000/8) |
| 1931 | 1931 | /* audio CPU */ |
| r1877 | r1878 | |
| 1972 | 1972 | /* basic machine hardware */ |
| 1973 | 1973 | MDRV_CPU_ADD(ARM, 28000000/4) |
| 1974 | 1974 | MDRV_CPU_PROGRAM_MAP(fghthsta_memmap,0) |
| 1975 | MDRV_CPU_VBLANK_INT(deco32_vbl_interrupt | |
| 1975 | MDRV_CPU_VBLANK_INT("main", deco32_vbl_interrupt | |
| 1976 | 1976 | |
| 1977 | 1977 | MDRV_CPU_ADD(H6280, 32220000/8) /* audio CPU */ |
| 1978 | 1978 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 2018 | 2018 | /* basic machine hardware */ |
| 2019 | 2019 | MDRV_CPU_ADD(ARM, 28000000/4) |
| 2020 | 2020 | MDRV_CPU_PROGRAM_MAP(dragngun_readmem,dragngun_writemem) |
| 2021 | MDRV_CPU_VBLANK_INT(deco32_vbl_interrupt | |
| 2021 | MDRV_CPU_VBLANK_INT("main", deco32_vbl_interrupt | |
| 2022 | 2022 | |
| 2023 | 2023 | MDRV_CPU_ADD(H6280, 32220000/8) |
| 2024 | 2024 | /* audio CPU */ |
| r1877 | r1878 | |
| 2072 | 2072 | /* basic machine hardware */ |
| 2073 | 2073 | MDRV_CPU_ADD(ARM, 28000000/4) |
| 2074 | 2074 | MDRV_CPU_PROGRAM_MAP(lockload_readmem,lockload_writemem) |
| 2075 | MDRV_CPU_VBLANK_INT(deco32_vbl_interrupt,2) // From 2 | |
| 2075 | MDRV_CPU_VBLANK_INT_HACK(deco32_vbl_interrupt,2) // From 2 | |
| 2076 | 2076 | |
| 2077 | 2077 | MDRV_CPU_ADD(H6280, 32220000/8) |
| 2078 | 2078 | /* audio CPU */ |
| r1877 | r1878 | |
| 2126 | 2126 | /* basic machine hardware */ |
| 2127 | 2127 | MDRV_CPU_ADD(ARM, 28000000/4) /* Unconfirmed */ |
| 2128 | 2128 | MDRV_CPU_PROGRAM_MAP(tattass_readmem,tattass_writemem) |
| 2129 | MDRV_CPU_VBLANK_INT(deco32_vbl_interrupt | |
| 2129 | MDRV_CPU_VBLANK_INT("main", deco32_vbl_interrupt | |
| 2130 | 2130 | |
| 2131 | 2131 | MDRV_CPU_ADD(M6809, 2000000) |
| 2132 | 2132 | /* audio CPU */ |
| r1877 | r1878 | |
| 2164 | 2164 | /* basic machine hardware */ |
| 2165 | 2165 | MDRV_CPU_ADD(ARM, 28322000/4) |
| 2166 | 2166 | MDRV_CPU_PROGRAM_MAP(nslasher_readmem,nslasher_writemem) |
| 2167 | MDRV_CPU_VBLANK_INT(deco32_vbl_interrupt | |
| 2167 | MDRV_CPU_VBLANK_INT("main", deco32_vbl_interrupt | |
| 2168 | 2168 | |
| 2169 | 2169 | MDRV_CPU_ADD(Z80, 32220000/9) |
| 2170 | 2170 | MDRV_CPU_PROGRAM_MAP(nslasher_sound,0) |
| r1877 | r1878 | |
|---|---|---|
| 164 | 164 | |
| 165 | 165 | static READ32_HANDLER( timekeeper_r ) |
| 166 | 166 | { |
| 167 | return timekeeper_0_r(offset) | 0xffffff00; | |
| 167 | return timekeeper_0_r(machine, offset) | 0xffffff00; | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | |
| 171 | 171 | static WRITE32_HANDLER( timekeeper_w ) |
| 172 | 172 | { |
| 173 | 173 | if (bitlatch[2] && !cmos_protected) |
| 174 | timekeeper_0_w(offset, data); | |
| 174 | timekeeper_0_w(machine, offset, data); | |
| 175 | 175 | else |
| 176 | 176 | logerror("%06X:timekeeper_w with bitlatch[2] = %d, cmos_protected = %d\n", activecpu_get_pc(), bitlatch[2], cmos_protected); |
| 177 | 177 | cmos_protected = TRUE; |
| r1877 | r1878 | |
| 1116 | 1116 | /* basic machine hardware */ |
| 1117 | 1117 | MDRV_CPU_ADD_TAG("main", TMS32032, CPU_CLOCK) |
| 1118 | 1118 | MDRV_CPU_PROGRAM_MAP(zeus_map,0) |
| 1119 | MDRV_CPU_VBLANK_INT(display_irq | |
| 1119 | MDRV_CPU_VBLANK_INT("main", display_irq | |
| 1120 | 1120 | |
| 1121 | 1121 | MDRV_MACHINE_START(midzeus) |
| 1122 | 1122 | MDRV_MACHINE_RESET(midzeus) |
| r1877 | r1878 | |
| 1142 | 1142 | /* basic machine hardware */ |
| 1143 | 1143 | MDRV_CPU_ADD_TAG("main", TMS32032, CPU_CLOCK) |
| 1144 | 1144 | MDRV_CPU_PROGRAM_MAP(zeus2_map,0) |
| 1145 | MDRV_CPU_VBLANK_INT(display_irq | |
| 1145 | MDRV_CPU_VBLANK_INT("main", display_irq | |
| 1146 | 1146 | |
| 1147 | 1147 | MDRV_MACHINE_START(midzeus2) |
| 1148 | 1148 | MDRV_MACHINE_RESET(midzeus) |
| r1877 | r1878 | |
|---|---|---|
| 118 | 118 | |
| 119 | 119 | static WRITE8_HANDLER( cpu0_outputs_w ) |
| 120 | 120 | { |
| 121 | grchamp_state *state = | |
| 121 | grchamp_state *state = machine->driver_data; | |
| 122 | 122 | UINT8 diff = data ^ state->cpu0_out[offset]; |
| 123 | 123 | state->cpu0_out[offset] = data; |
| 124 | 124 | |
| r1877 | r1878 | |
| 133 | 133 | /* bit 6: FOG OUT */ |
| 134 | 134 | /* bit 7: RADARON */ |
| 135 | 135 | if ((diff & 0x01) && !(data & 0x01)) |
| 136 | cpunum_set_input_line( | |
| 136 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 137 | 137 | if ((diff & 0x02) && !(data & 0x02)) |
| 138 | 138 | state->collide = state->collmode = 0; |
| 139 | 139 | break; |
| r1877 | r1878 | |
| 186 | 186 | break; |
| 187 | 187 | |
| 188 | 188 | case 0x0d: /* OUT13 */ |
| 189 | watchdog_reset( | |
| 189 | watchdog_reset(machine); | |
| 190 | 190 | break; |
| 191 | 191 | |
| 192 | 192 | case 0x0e: /* OUT14 */ |
| 193 | 193 | /* O-21 connector */ |
| 194 | soundlatch_w(0, data); | |
| 195 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 194 | soundlatch_w(machine, 0, data); | |
| 195 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 196 | 196 | break; |
| 197 | 197 | } |
| 198 | 198 | } |
| r1877 | r1878 | |
| 245 | 245 | |
| 246 | 246 | static WRITE8_HANDLER( cpu1_outputs_w ) |
| 247 | 247 | { |
| 248 | grchamp_state *state = | |
| 248 | grchamp_state *state = machine->driver_data; | |
| 249 | 249 | UINT8 diff = data ^ state->cpu1_out[offset]; |
| 250 | 250 | state->cpu1_out[offset] = data; |
| 251 | 251 | |
| r1877 | r1878 | |
| 272 | 272 | case 0x04: /* OUT4 */ |
| 273 | 273 | /* bit 0: interrupt enable for CPU 1 */ |
| 274 | 274 | if ((diff & 0x01) && !(data & 0x01)) |
| 275 | cpunum_set_input_line( | |
| 275 | cpunum_set_input_line(machine, 1, 0, CLEAR_LINE); | |
| 276 | 276 | break; |
| 277 | 277 | |
| 278 | 278 | case 0x05: /* OUT5 - unused */ |
| r1877 | r1878 | |
| 308 | 308 | /* bit 2-4: ATTACK UP 1-3 */ |
| 309 | 309 | /* bit 5-6: SIFT 1-2 */ |
| 310 | 310 | /* bit 7: ENGINE CS */ |
| 311 | discrete_sound_w(GRCHAMP_ENGINE_CS_EN, data & 0x80); | |
| 312 | discrete_sound_w(GRCHAMP_SIFT_DATA, (data >> 5) & 0x03); | |
| 313 | discrete_sound_w(GRCHAMP_ATTACK_UP_DATA, (data >> 2) & 0x07); | |
| 314 | discrete_sound_w(GRCHAMP_IDLING_EN, data & 0x02); | |
| 315 | discrete_sound_w(GRCHAMP_FOG_EN, data & 0x01); | |
| 311 | discrete_sound_w(machine, GRCHAMP_ENGINE_CS_EN, data & 0x80); | |
| 312 | discrete_sound_w(machine, GRCHAMP_SIFT_DATA, (data >> 5) & 0x03); | |
| 313 | discrete_sound_w(machine, GRCHAMP_ATTACK_UP_DATA, (data >> 2) & 0x07); | |
| 314 | discrete_sound_w(machine, GRCHAMP_IDLING_EN, data & 0x02); | |
| 315 | discrete_sound_w(machine, GRCHAMP_FOG_EN, data & 0x01); | |
| 316 | 316 | break; |
| 317 | 317 | |
| 318 | 318 | case 0x0d: /* OUTD */ |
| 319 | 319 | /* bit 0-3: ATTACK SPEED 1-4 */ |
| 320 | 320 | /* bit 4-7: PLAYER SPEED 1-4 */ |
| 321 | discrete_sound_w(GRCHAMP_PLAYER_SPEED_DATA, (data >> 4) & 0x0f); | |
| 322 | discrete_sound_w(GRCHAMP_ATTACK_SPEED_DATA, data & 0x0f); | |
| 321 | discrete_sound_w(machine, GRCHAMP_PLAYER_SPEED_DATA, (data >> 4) & 0x0f); | |
| 322 | discrete_sound_w(machine, GRCHAMP_ATTACK_SPEED_DATA, data & 0x0f); | |
| 323 | 323 | break; |
| 324 | 324 | |
| 325 | 325 | default: |
| r1877 | r1878 | |
| 424 | 424 | |
| 425 | 425 | static WRITE8_HANDLER( grchamp_portA_0_w ) |
| 426 | 426 | { |
| 427 | discrete_sound_w(GRCHAMP_A_DATA, data); | |
| 427 | discrete_sound_w(machine, GRCHAMP_A_DATA, data); | |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | static WRITE8_HANDLER( grchamp_portB_0_w ) |
| 431 | 431 | { |
| 432 | discrete_sound_w(GRCHAMP_B_DATA, 255-data); | |
| 432 | discrete_sound_w(machine, GRCHAMP_B_DATA, 255-data); | |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | static WRITE8_HANDLER( grchamp_portA_2_w ) |
| r1877 | r1878 | |
| 675 | 675 | MDRV_CPU_ADD(Z80, PIXEL_CLOCK/2) |
| 676 | 676 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 677 | 677 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 678 | MDRV_CPU_VBLANK_INT(grchamp_cpu0_interrupt | |
| 678 | MDRV_CPU_VBLANK_INT("main", grchamp_cpu0_interrupt | |
| 679 | 679 | |
| 680 | 680 | /* GAME BOARD */ |
| 681 | 681 | MDRV_CPU_ADD(Z80, PIXEL_CLOCK/2) |
| 682 | 682 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| 683 | 683 | MDRV_CPU_IO_MAP(sub_portmap,0) |
| 684 | MDRV_CPU_VBLANK_INT(grchamp_cpu1_interrupt | |
| 684 | MDRV_CPU_VBLANK_INT("main", grchamp_cpu1_interrupt | |
| 685 | 685 | |
| 686 | 686 | /* SOUND BOARD */ |
| 687 | 687 | MDRV_CPU_ADD(Z80, SOUND_CLOCK/2) |
| r1877 | r1878 | |
|---|---|---|
| 220 | 220 | { |
| 221 | 221 | if (offset < 0x0800) /* BG0 RAM */ |
| 222 | 222 | { |
| 223 | return butasan_bg0ram_r( offset ); | |
| 223 | return butasan_bg0ram_r( machine, offset ); | |
| 224 | 224 | } |
| 225 | 225 | else if (offset < 0x1000) /* Back BG0 RAM */ |
| 226 | 226 | { |
| 227 | return butasan_bg0backram_r( offset - 0x0800 ); | |
| 227 | return butasan_bg0backram_r( machine, offset - 0x0800 ); | |
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | else |
| 231 | 231 | { |
| 232 | 232 | if (offset < 0x0800) /* Text RAM */ |
| 233 | 233 | { |
| 234 | return butasan_txram_r( offset ); | |
| 234 | return butasan_txram_r( machine, offset ); | |
| 235 | 235 | } |
| 236 | 236 | else if (offset < 0x1000) /* Back text RAM */ |
| 237 | 237 | { |
| 238 | return butasan_txbackram_r( offset - 0x0800 ); | |
| 238 | return butasan_txbackram_r( machine, offset - 0x0800 ); | |
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | |
| r1877 | r1878 | |
| 248 | 248 | { |
| 249 | 249 | if (offset < 0x0800) /* BG0 RAM */ |
| 250 | 250 | { |
| 251 | butasan_bg0ram_w( offset, data ); | |
| 251 | butasan_bg0ram_w( machine, offset, data ); | |
| 252 | 252 | } |
| 253 | 253 | else if (offset < 0x1000) /* Back BG0 RAM */ |
| 254 | 254 | { |
| 255 | butasan_bg0backram_w( offset - 0x0800, data ); | |
| 255 | butasan_bg0backram_w( machine, offset - 0x0800, data ); | |
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | |
| r1877 | r1878 | |
| 260 | 260 | { |
| 261 | 261 | if (offset < 0x0800) /* Text RAM */ |
| 262 | 262 | { |
| 263 | butasan_txram_w( offset, data ); | |
| 263 | butasan_txram_w( machine, offset, data ); | |
| 264 | 264 | } |
| 265 | 265 | else if (offset < 0x1000) /* Back text RAM */ |
| 266 | 266 | { |
| 267 | butasan_txbackram_w( offset - 0x0800, data ); | |
| 267 | butasan_txbackram_w( machine, offset - 0x0800, data ); | |
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | 270 | } |
| r1877 | r1878 | |
| 773 | 773 | /* basic machine hardware */ |
| 774 | 774 | MDRV_CPU_ADD(Z80, 5000000) /* 4 MHz */ |
| 775 | 775 | MDRV_CPU_PROGRAM_MAP(argus_readmem,argus_writemem) |
| 776 | MDRV_CPU_VBLANK_INT(argus_interrupt,2) | |
| 776 | MDRV_CPU_VBLANK_INT_HACK(argus_interrupt,2) | |
| 777 | 777 | |
| 778 | 778 | MDRV_CPU_ADD(Z80, 5000000) |
| 779 | 779 | /* audio CPU */ /* 4 MHz */ |
| r1877 | r1878 | |
| 811 | 811 | /* basic machine hardware */ |
| 812 | 812 | MDRV_CPU_ADD(Z80, 5000000) /* 5 MHz */ |
| 813 | 813 | MDRV_CPU_PROGRAM_MAP(valtric_readmem,valtric_writemem) |
| 814 | MDRV_CPU_VBLANK_INT(argus_interrupt,2) | |
| 814 | MDRV_CPU_VBLANK_INT_HACK(argus_interrupt,2) | |
| 815 | 815 | |
| 816 | 816 | MDRV_CPU_ADD(Z80, 5000000) |
| 817 | 817 | /* audio CPU */ /* 5 MHz */ |
| r1877 | r1878 | |
| 855 | 855 | /* basic machine hardware */ |
| 856 | 856 | MDRV_CPU_ADD(Z80, 5000000) /* 5 MHz */ |
| 857 | 857 | MDRV_CPU_PROGRAM_MAP(butasan_readmem,butasan_writemem) |
| 858 | MDRV_CPU_VBLANK_INT(argus_interrupt,2) | |
| 858 | MDRV_CPU_VBLANK_INT_HACK(argus_interrupt,2) | |
| 859 | 859 | |
| 860 | 860 | MDRV_CPU_ADD(Z80, 5000000) |
| 861 | 861 | /* audio CPU */ /* 5 MHz */ |
| r1877 | r1878 | |
| 899 | 899 | /* basic machine hardware */ |
| 900 | 900 | MDRV_CPU_ADD(Z80, 5000000) /* 5 MHz */ |
| 901 | 901 | MDRV_CPU_PROGRAM_MAP(bombsa_readmem,bombsa_writemem) |
| 902 | MDRV_CPU_VBLANK_INT(argus_interrupt,2) | |
| 902 | MDRV_CPU_VBLANK_INT_HACK(argus_interrupt,2) | |
| 903 | 903 | |
| 904 | 904 | MDRV_CPU_ADD(Z80, 12000000 / 2) |
| 905 | 905 | /* audio CPU */ /* 6 MHz */ /* maybe CPU speeds are reversed? Probably not (ajg) */ |
| r1877 | r1878 | |
|---|---|---|
| 223 | 223 | MDRV_CPU_ADD_TAG("main", I8039, 7864300) |
| 224 | 224 | MDRV_CPU_PROGRAM_MAP(drw80pkr_map, 0) |
| 225 | 225 | MDRV_CPU_IO_MAP(drw80pkr_io_map, 0) |
| 226 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 226 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 227 | 227 | |
| 228 | 228 | // video hardware |
| 229 | 229 |
| r1877 | r1878 | |
|---|---|---|
| 62 | 62 | |
| 63 | 63 | static WRITE8_HANDLER( lkage_sound_command_w ) |
| 64 | 64 | { |
| 65 | soundlatch_w(offset,data); | |
| 65 | soundlatch_w(machine,offset,data); | |
| 66 | 66 | timer_call_after_resynch(NULL, data,nmi_callback); |
| 67 | 67 | } |
| 68 | 68 | |
| r1877 | r1878 | |
| 328 | 328 | MDRV_CPU_ADD(Z80,6000000) |
| 329 | 329 | MDRV_CPU_PROGRAM_MAP(lkage,0) |
| 330 | 330 | MDRV_CPU_IO_MAP(readport,0) |
| 331 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 331 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 332 | 332 | |
| 333 | 333 | MDRV_CPU_ADD(Z80, 6000000) |
| 334 | 334 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| r1877 | r1878 | |
| 373 | 373 | MDRV_CPU_ADD(Z80,6000000) |
| 374 | 374 | MDRV_CPU_PROGRAM_MAP(lkage,0) |
| 375 | 375 | MDRV_CPU_IO_MAP(readport,0) |
| 376 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 376 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 377 | 377 | |
| 378 | 378 | MDRV_CPU_ADD(Z80, 6000000) |
| 379 | 379 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| r1877 | r1878 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | static render_texture *video_texture; |
| 38 | 38 | static render_texture *overlay_texture; |
| 39 | static | |
| 39 | static | |
| 40 | 40 | |
| 41 | 41 | static void video_cleanup(running_machine *machine) |
| 42 | 42 | { |
| r1877 | r1878 | |
| 66 | 66 | |
| 67 | 67 | if (!video_skip_this_frame() && discinfo != NULL) |
| 68 | 68 | { |
| 69 | | |
| 69 | | |
| 70 | 70 | rectangle fixedvis = machine->screen[screen].visarea; |
| 71 | 71 | fixedvis.max_x++; |
| 72 | 72 | fixedvis.max_y++; |
| r1877 | r1878 | |
| 338 | 338 | MDRV_CPU_ADD(Z80, MASTER_CLOCK/8) |
| 339 | 339 | MDRV_CPU_PROGRAM_MAP(superdq_map,0) |
| 340 | 340 | MDRV_CPU_IO_MAP(superdq_io,0) |
| 341 | MDRV_CPU_VBLANK_INT(superdq_vblank | |
| 341 | MDRV_CPU_VBLANK_INT("main", superdq_vblank | |
| 342 | 342 | |
| 343 | 343 | MDRV_MACHINE_START(superdq) |
| 344 | 344 |
| r1877 | r1878 | |
|---|---|---|
| 278 | 278 | MDRV_CPU_ADD(V30, GOODEJAN_MHZ2/2) |
| 279 | 279 | MDRV_CPU_PROGRAM_MAP(goodejan_map,0) |
| 280 | 280 | MDRV_CPU_IO_MAP(goodejan_io_map,0) |
| 281 | MDRV_CPU_VBLANK_INT(goodejan_interrupt,2) | |
| 281 | MDRV_CPU_VBLANK_INT_HACK(goodejan_interrupt,2) | |
| 282 | 282 | |
| 283 | 283 | SEIBU_SOUND_SYSTEM_CPU(GOODEJAN_MHZ1/2) |
| 284 | 284 |
| r1877 | r1878 | |
|---|---|---|
| 84 | 84 | include several similiarities with other Playmark games (including |
| 85 | 85 | the sprite end code and the data being offset (i.e. spriteram starting from 0x16/2)) |
| 86 | 86 | */ |
| 87 | static void draw_sprites(running_machine *machine, | |
| 87 | static void draw_sprites(running_machine *machine, | |
| 88 | 88 | { |
| 89 | 89 | |
| 90 | 90 | /* |
| r1877 | r1878 | |
| 315 | 315 | static MACHINE_DRIVER_START( bestleag ) |
| 316 | 316 | MDRV_CPU_ADD(M68000, 12000000) |
| 317 | 317 | MDRV_CPU_PROGRAM_MAP(bestleag_map,0) |
| 318 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 318 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 319 | 319 | |
| 320 | 320 | |
| 321 | 321 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 163 | 163 | |
| 164 | 164 | static WRITE16_HANDLER( gaiden_sound_command_w ) |
| 165 | 165 | { |
| 166 | if (ACCESSING_LSB) soundlatch_w(0,data & 0xff); /* Ninja Gaiden */ | |
| 167 | if (ACCESSING_MSB) soundlatch_w(0,data >> 8); /* Tecmo Knight */ | |
| 168 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 166 | if (ACCESSING_LSB) soundlatch_w(machine,0,data & 0xff); /* Ninja Gaiden */ | |
| 167 | if (ACCESSING_MSB) soundlatch_w(machine,0,data >> 8); /* Tecmo Knight */ | |
| 168 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | static WRITE16_HANDLER( drgnbowl_sound_command_w ) |
| 172 | 172 | { |
| 173 | 173 | if (ACCESSING_MSB) |
| 174 | 174 | { |
| 175 | soundlatch_w(0,data >> 8); | |
| 176 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 175 | soundlatch_w(machine,0,data >> 8); | |
| 176 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 177 | 177 | } |
| 178 | 178 | } |
| 179 | 179 | |
| r1877 | r1878 | |
| 972 | 972 | /* basic machine hardware */ |
| 973 | 973 | MDRV_CPU_ADD(M68000, 18432000/2) /* 9.216 MHz */ |
| 974 | 974 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 975 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 975 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 976 | 976 | |
| 977 | 977 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 978 | 978 | /* audio CPU */ |
| r1877 | r1878 | |
| 1032 | 1032 | /* basic machine hardware */ |
| 1033 | 1033 | MDRV_CPU_ADD(M68000, 20000000/2) /* 10 MHz */ |
| 1034 | 1034 | MDRV_CPU_PROGRAM_MAP(drgnbowl_map,0) |
| 1035 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 1035 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 1036 | 1036 | |
| 1037 | 1037 | MDRV_CPU_ADD(Z80, 12000000/2) /* 6 MHz */ |
| 1038 | 1038 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 355 | 355 | * |
| 356 | 356 | *************************************/ |
| 357 | 357 | |
| 358 | static | |
| 358 | static INPUT_CHANGED( service_switch | |
| 359 | 359 | { |
| 360 | 360 | /* pressing the service switch sends an NMI */ |
| 361 | 361 | if (newval) |
| 362 | cpunum_set_input_line( | |
| 362 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | |
| r1877 | r1878 | |
| 387 | 387 | |
| 388 | 388 | static MACHINE_START( zaxxon ) |
| 389 | 389 | { |
| 390 | /* request a callback if the service switch is pressed */ | |
| 391 | input_port_set_changed_callback(port_tag_to_index("SERVICESW"), 0x01, service_switch, NULL); | |
| 392 | ||
| 393 | 390 | /* register for save states */ |
| 394 | 391 | state_save_register_global(int_enabled); |
| 395 | 392 | } |
| r1877 | r1878 | |
| 567 | 564 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) |
| 568 | 565 | |
| 569 | 566 | PORT_START_TAG("SERVICESW") |
| 570 | PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_HIGH ) | |
| 567 | PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_HIGH ) PORT_CHANGED(service_switch, 0) | |
| 571 | 568 | |
| 572 | 569 | PORT_START_TAG("DSW02") |
| 573 | 570 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:!1,!2") |
| r1877 | r1878 | |
| 935 | 932 | /* basic machine hardware */ |
| 936 | 933 | MDRV_CPU_ADD_TAG("main", Z80, MASTER_CLOCK/16) |
| 937 | 934 | MDRV_CPU_PROGRAM_MAP(zaxxon_map, 0) |
| 938 | MDRV_CPU_VBLANK_INT(vblank_int | |
| 935 | MDRV_CPU_VBLANK_INT("main", vblank_int | |
| 939 | 936 | |
| 940 | 937 | MDRV_MACHINE_START(zaxxon) |
| 941 | 938 |
| r1877 | r1878 | |
|---|---|---|
| 103 | 103 | static WRITE8_HANDLER( shangkid_bbx_AY8910_control_w ) |
| 104 | 104 | { |
| 105 | 105 | bbx_AY8910_control = data; |
| 106 | AY8910_control_port_0_w( offset, data ); | |
| 106 | AY8910_control_port_0_w( machine, offset, data ); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | static WRITE8_HANDLER( chinhero_bbx_AY8910_write_w ) |
| r1877 | r1878 | |
| 124 | 124 | break; |
| 125 | 125 | |
| 126 | 126 | default: |
| 127 | AY8910_write_port_0_w( offset, data ); | |
| 127 | AY8910_write_port_0_w( machine, offset, data ); | |
| 128 | 128 | break; |
| 129 | 129 | } |
| 130 | 130 | } |
| r1877 | r1878 | |
| 149 | 149 | break; |
| 150 | 150 | |
| 151 | 151 | default: |
| 152 | AY8910_write_port_0_w( offset, data ); | |
| 152 | AY8910_write_port_0_w( machine, offset, data ); | |
| 153 | 153 | break; |
| 154 | 154 | } |
| 155 | 155 | } |
| r1877 | r1878 | |
| 387 | 387 | /* basic machine hardware */ |
| 388 | 388 | MDRV_CPU_ADD_TAG("main", Z80, XTAL_18_432MHz/6) /* verified on pcb */ |
| 389 | 389 | MDRV_CPU_PROGRAM_MAP(chinhero_main_map,0) |
| 390 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 390 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 391 | 391 | |
| 392 | 392 | MDRV_CPU_ADD_TAG("bbx", Z80, XTAL_18_432MHz/6) /* verified on pcb */ |
| 393 | 393 | MDRV_CPU_PROGRAM_MAP(chinhero_bbx_map,0) |
| 394 | 394 | MDRV_CPU_IO_MAP(chinhero_bbx_portmap,0) |
| 395 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 395 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 396 | 396 | |
| 397 | 397 | MDRV_CPU_ADD_TAG("audio", Z80, XTAL_18_432MHz/6) /* verified on pcb */ |
| 398 | 398 | MDRV_CPU_PROGRAM_MAP(chinhero_sound_map,0) |
| r1877 | r1878 | |
| 478 | 478 | MDRV_CPU_ADD(Z80, 3000000) /* ? */ |
| 479 | 479 | MDRV_CPU_PROGRAM_MAP(dynamski_map,0) |
| 480 | 480 | MDRV_CPU_IO_MAP(dynamski_portmap,0) |
| 481 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 481 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 482 | 482 | |
| 483 | 483 | /* video hardware */ |
| 484 | 484 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 430 | 430 | MDRV_CPU_ADD(R4600BE, 93750000) |
| 431 | 431 | MDRV_CPU_CONFIG(config) |
| 432 | 432 | MDRV_CPU_PROGRAM_MAP(n64_map, 0) |
| 433 | MDRV_CPU_VBLANK_INT( n64_vblank | |
| 433 | MDRV_CPU_VBLANK_INT("main", n64_vblank | |
| 434 | 434 | |
| 435 | 435 | MDRV_CPU_ADD(RSP, 62500000) |
| 436 | 436 | MDRV_CPU_CONFIG(n64_rsp_config) |
| r1877 | r1878 | |
|---|---|---|
| 863 | 863 | /* basic machine hardware */ |
| 864 | 864 | MDRV_CPU_ADD_TAG("main", M6809, 2048000) /* 1.400 MHz ??? */ |
| 865 | 865 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 866 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 866 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 867 | 867 | |
| 868 | 868 | MDRV_CPU_ADD(Z80,14318180/4) |
| 869 | 869 | /* audio CPU */ /* Z80 Clock is derived from a 14.31818 MHz crystal */ |
| r1877 | r1878 | |
| 907 | 907 | /* basic machine hardware */ |
| 908 | 908 | MDRV_CPU_ADD(M6809, 2048000) /* 1.400 MHz ??? */ |
| 909 | 909 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 910 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 910 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 911 | 911 | |
| 912 | 912 | MDRV_CPU_ADD(Z80,14318180/4) |
| 913 | 913 | /* audio CPU */ /* Z80 Clock is derived from a 14.31818 MHz crystal */ |
| r1877 | r1878 | |
| 962 | 962 | // right cpu? |
| 963 | 963 | MDRV_CPU_REPLACE("main",M6800,2048000) /* 1.400 MHz ??? */ |
| 964 | 964 | MDRV_CPU_PROGRAM_MAP(wizzquiz_map,0) |
| 965 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 965 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 966 | 966 | |
| 967 | 967 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 968 | 968 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
| 974 | 974 | MDRV_CPU_REPLACE("main",Z80,18432000/6) |
| 975 | 975 | MDRV_CPU_PROGRAM_MAP(reaktor_readmem,reaktor_writemem) |
| 976 | 976 | MDRV_CPU_IO_MAP(reaktor_readport,reaktor_writeport) |
| 977 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 977 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 978 | 978 | MACHINE_DRIVER_END |
| 979 | 979 | |
| 980 | 980 |
| r1877 | r1878 | |
|---|---|---|
| 6 | 6 | ***************************************************************************/ |
| 7 | 7 | |
| 8 | 8 | #include "driver.h" |
| 9 | #include "deprecat.h" | |
| 9 | 10 | #include "fastfred.h" |
| 10 | 11 | #include "sound/ay8910.h" |
| 11 | 12 | |
| r1877 | r1878 | |
| 558 | 559 | /* basic machine hardware */ |
| 559 | 560 | MDRV_CPU_ADD_TAG("main", Z80, CLOCK/6) /* 3.072 MHz */ |
| 560 | 561 | MDRV_CPU_PROGRAM_MAP(fastfred_map,0) |
| 561 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 562 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 562 | 563 | |
| 563 | 564 | MDRV_CPU_ADD_TAG("audio", Z80, CLOCK/12) |
| 564 | 565 | /* audio CPU */ /* 1.536 MHz */ |
| 565 | 566 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 566 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,4) | |
| 567 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,4) | |
| 567 | 568 | |
| 568 | 569 | /* video hardware */ |
| 569 | 570 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 123 | 123 | * |
| 124 | 124 | *************************************/ |
| 125 | 125 | |
| 126 | static IN | |
| 126 | static IN | |
| 127 | 127 | { |
| 128 | UINT32 coin = readinputportbytag("COIN"); | |
| 129 | UINT32 service = readinputportbytag("SERVICE"); | |
| 128 | /* coin insertion causes an NMI */ | |
| 129 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE); | |
| 130 | coin_counter_w(0, newval); | |
| 131 | } | |
| 130 | 132 | |
| 131 | /* both the coin input and the serice credit generates an NMI */ | |
| 132 | if (coin || service) | |
| 133 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 134 | 133 | |
| 135 | /* the coin input is also connected to the coin counter */ | |
| 136 | if (coin) | |
| 137 | { | |
| 138 | coin_counter_w(0, 1); | |
| 139 | coin_counter_w(0, 0); | |
| 140 | } | |
| 134 | static INPUT_CHANGED( service_coin_inserted ) | |
| 135 | { | |
| 136 | /* service coin insertion causes an NMI */ | |
| 137 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE); | |
| 141 | 138 | } |
| 142 | 139 | |
| 143 | 140 | |
| r1877 | r1878 | |
| 311 | 308 | } |
| 312 | 309 | |
| 313 | 310 | |
| 314 | static void video_update_common( | |
| 311 | static void video_update_common( | |
| 315 | 312 | { |
| 316 | 313 | offs_t offs; |
| 317 | 314 | |
| r1877 | r1878 | |
| 614 | 611 | PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 615 | 612 | |
| 616 | 613 | PORT_START_TAG("COIN") |
| 617 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) | |
| 614 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 615 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CHANGED(service_coin_inserted, 0) | |
| 618 | 616 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 619 | 617 | |
| 620 | PORT_START_TAG("SERVICE") | |
| 621 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) | |
| 622 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 623 | ||
| 624 | 618 | PORT_START_TAG("FLIP") |
| 625 | 619 | PORT_DIPNAME( 0x01, 0x00, "Flip Screen for Player 2" ) |
| 626 | 620 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| r1877 | r1878 | |
| 676 | 670 | PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 677 | 671 | |
| 678 | 672 | PORT_START_TAG("COIN") |
| 679 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) | |
| 673 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 674 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CHANGED(service_coin_inserted, 0) | |
| 680 | 675 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 681 | 676 | |
| 682 | PORT_START_TAG("SERVICE") | |
| 683 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) | |
| 684 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 685 | ||
| 686 | 677 | PORT_START_TAG("FLIP") |
| 687 | 678 | PORT_DIPNAME( 0x01, 0x00, "Flip Screen for Player 2" ) PORT_DIPLOCATION("SW:8") |
| 688 | 679 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| r1877 | r1878 | |
| 739 | 730 | PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 740 | 731 | |
| 741 | 732 | PORT_START_TAG("COIN") |
| 742 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) | |
| 733 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 734 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CHANGED(service_coin_inserted, 0) | |
| 743 | 735 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 744 | 736 | |
| 745 | PORT_START_TAG("SERVICE") | |
| 746 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) | |
| 747 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 748 | ||
| 749 | 737 | PORT_START_TAG("FLIP") |
| 750 | 738 | PORT_DIPNAME( 0x01, 0x00, "Flip Screen for Player 2" ) |
| 751 | 739 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| r1877 | r1878 | |
| 802 | 790 | PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 803 | 791 | |
| 804 | 792 | PORT_START_TAG("COIN") |
| 805 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) | |
| 793 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 794 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CHANGED(service_coin_inserted, 0) | |
| 806 | 795 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 807 | 796 | |
| 808 | PORT_START_TAG("SERVICE") | |
| 809 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) | |
| 810 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 811 | ||
| 812 | 797 | PORT_START_TAG("FLIP") |
| 813 | 798 | PORT_DIPNAME( 0x01, 0x00, "Flip Screen for Player 2" ) |
| 814 | 799 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| r1877 | r1878 | |
| 856 | 841 | PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 857 | 842 | |
| 858 | 843 | PORT_START_TAG("COIN") |
| 859 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) | |
| 844 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 845 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CHANGED(service_coin_inserted, 0) | |
| 860 | 846 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 861 | 847 | |
| 862 | PORT_START_TAG("SERVICE") | |
| 863 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) | |
| 864 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 865 | ||
| 866 | 848 | PORT_START_TAG("FLIP") |
| 867 | 849 | PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) |
| 868 | 850 | PORT_CONFSETTING( 0x00, DEF_STR( Upright ) ) |
| r1877 | r1878 | |
| 882 | 864 | |
| 883 | 865 | /* basic machine hardware */ |
| 884 | 866 | MDRV_CPU_ADD_TAG("main", M6502, MAIN_CPU_CLOCK) |
| 885 | MDRV_CPU_VBLANK_INT(coin_nmi,1) | |
| 886 | 867 | |
| 887 | 868 | MDRV_MACHINE_RESET(astrof) |
| 888 | 869 | |
| r1877 | r1878 | |
| 892 | 873 | MDRV_SCREEN_ADD("main", RASTER) |
| 893 | 874 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 894 | 875 | MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) |
| 895 | ||
| 896 | 876 | MACHINE_DRIVER_END |
| 897 | 877 | |
| 898 | 878 | |
| r1877 | r1878 | |
| 910 | 890 | |
| 911 | 891 | /* audio hardware */ |
| 912 | 892 | MDRV_IMPORT_FROM(astrof_audio) |
| 913 | ||
| 914 | 893 | MACHINE_DRIVER_END |
| 915 | 894 | |
| 916 | 895 | |
| r1877 | r1878 | |
| 921 | 900 | |
| 922 | 901 | MDRV_MACHINE_START(abattle) |
| 923 | 902 | MDRV_MACHINE_RESET(abattle) |
| 924 | ||
| 925 | 903 | MACHINE_DRIVER_END |
| 926 | 904 | |
| 927 | 905 | |
| r1877 | r1878 | |
| 939 | 917 | |
| 940 | 918 | /* audio hardware */ |
| 941 | 919 | MDRV_IMPORT_FROM(spfghmk2_audio) |
| 942 | ||
| 943 | 920 | MACHINE_DRIVER_END |
| 944 | 921 | |
| 945 | 922 | |
| r1877 | r1878 | |
| 957 | 934 | |
| 958 | 935 | /* audio hardware */ |
| 959 | 936 | MDRV_IMPORT_FROM(tomahawk_audio) |
| 960 | ||
| 961 | 937 | MACHINE_DRIVER_END |
| 962 | 938 | |
| 963 | 939 |
| r1877 | r1878 | |
|---|---|---|
| 262 | 262 | /* Mnemonics filled in from the schematics, brackets are my comments */ |
| 263 | 263 | switch (offset<<1) { |
| 264 | 264 | case 0: /* SECLR (Interrupt ack for Level 6 i8751 interrupt) */ |
| 265 | cpunum_set_input_line( | |
| 265 | cpunum_set_input_line(machine, 0,6,CLEAR_LINE); | |
| 266 | 266 | |
| 267 | 267 | if (i8751_needs_ack) { |
| 268 | 268 | /* If a command and coin insert happen at once, then the i8751 will queue the |
| 269 | 269 | coin command until the previous command is ACK'd */ |
| 270 | 270 | if (i8751_coin_pending) { |
| 271 | 271 | i8751_return=i8751_coin_pending; |
| 272 | cpunum_set_input_line( | |
| 272 | cpunum_set_input_line(machine, 0,6,HOLD_LINE); | |
| 273 | 273 | i8751_coin_pending=0; |
| 274 | 274 | } else if (i8751_command_queue) { |
| 275 | 275 | /* Pending control command - just write it back as SECREQ */ |
| 276 | 276 | i8751_needs_ack=0; |
| 277 | karnov_control_w(3,i8751_command_queue,0xffff); | |
| 277 | karnov_control_w(machine,3,i8751_command_queue,0xffff); | |
| 278 | 278 | i8751_command_queue=0; |
| 279 | 279 | } else { |
| 280 | 280 | i8751_needs_ack=0; |
| r1877 | r1878 | |
| 283 | 283 | return; |
| 284 | 284 | |
| 285 | 285 | case 2: /* SONREQ (Sound CPU byte) */ |
| 286 | soundlatch_w(0,data&0xff); | |
| 287 | cpunum_set_input_line (Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 286 | soundlatch_w(machine,0,data&0xff); | |
| 287 | cpunum_set_input_line (machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 288 | 288 | break; |
| 289 | 289 | |
| 290 | 290 | case 4: /* DM (DMA to buffer spriteram) */ |
| 291 | buffer_spriteram16_w(0,0,0); | |
| 291 | buffer_spriteram16_w(machine,0,0,0); | |
| 292 | 292 | break; |
| 293 | 293 | |
| 294 | 294 | case 6: /* SECREQ (Interrupt & Data to i8751) */ |
| r1877 | r1878 | |
| 689 | 689 | /* basic machine hardware */ |
| 690 | 690 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz */ |
| 691 | 691 | MDRV_CPU_PROGRAM_MAP(karnov_readmem,karnov_writemem) |
| 692 | MDRV_CPU_VBLANK_INT(karnov_interrupt | |
| 692 | MDRV_CPU_VBLANK_INT("main", karnov_interrupt | |
| 693 | 693 | |
| 694 | 694 | MDRV_CPU_ADD(M6502, 1500000) |
| 695 | 695 | /* audio CPU */ /* Accurate */ |
| r1877 | r1878 | |
| 731 | 731 | /* basic machine hardware */ |
| 732 | 732 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz */ |
| 733 | 733 | MDRV_CPU_PROGRAM_MAP(karnov_readmem,karnov_writemem) |
| 734 | MDRV_CPU_VBLANK_INT(karnov_interrupt | |
| 734 | MDRV_CPU_VBLANK_INT("main", karnov_interrupt | |
| 735 | 735 | |
| 736 | 736 | MDRV_CPU_ADD(M6502, 1500000) |
| 737 | 737 | /* audio CPU */ /* Accurate */ |
| r1877 | r1878 | |
|---|---|---|
| 46 | 46 | ***************************************************************************/ |
| 47 | 47 | |
| 48 | 48 | #include "driver.h" |
| 49 | #include "deprecat.h" | |
| 49 | 50 | #include "lwings.h" |
| 50 | 51 | #include "sound/2203intf.h" |
| 51 | 52 | #include "sound/msm5205.h" |
| r1877 | r1878 | |
| 87 | 88 | memory_set_bankptr(1,&RAM[0x10000 + bank*0x4000]); |
| 88 | 89 | |
| 89 | 90 | /* bit 3 enables NMI */ |
| 90 | interrupt_enable_w(0,data & 0x08); | |
| 91 | interrupt_enable_w(machine,0,data & 0x08); | |
| 91 | 92 | |
| 92 | 93 | /* bits 6 and 7 are coin counters */ |
| 93 | 94 | coin_counter_w(1,data & 0x40); |
| r1877 | r1878 | |
| 96 | 97 | |
| 97 | 98 | static INTERRUPT_GEN( lwings_interrupt ) |
| 98 | 99 | { |
| 99 | if (interrupt_enable_r(0)) | |
| 100 | if (interrupt_enable_r(machine, 0)) | |
| 100 | 101 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0xd7); /* RST 10h */ |
| 101 | 102 | } |
| 102 | 103 | |
| r1877 | r1878 | |
| 124 | 125 | else if( pc == 0x0445 ) |
| 125 | 126 | { |
| 126 | 127 | avengers_soundstate = 0x80; |
| 127 | soundlatch_w( 0, data ); | |
| 128 | soundlatch_w( machine, 0, data ); | |
| 128 | 129 | } |
| 129 | 130 | } |
| 130 | 131 | |
| r1877 | r1878 | |
| 855 | 856 | /* basic machine hardware */ |
| 856 | 857 | MDRV_CPU_ADD(Z80, 6000000) /* 4 MHz (?) */ |
| 857 | 858 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 858 | MDRV_CPU_VBLANK_INT(lwings_interrupt | |
| 859 | MDRV_CPU_VBLANK_INT("main", lwings_interrupt | |
| 859 | 860 | |
| 860 | 861 | MDRV_CPU_ADD(Z80, 4000000) |
| 861 | 862 | /* audio CPU */ |
| 862 | 863 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 863 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 864 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 864 | 865 | |
| 865 | 866 | /* video hardware */ |
| 866 | 867 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r1877 | r1878 | |
| 901 | 902 | /* basic machine hardware */ |
| 902 | 903 | MDRV_CPU_ADD(Z80, 6000000) /* 4 MHz (?) */ |
| 903 | 904 | MDRV_CPU_PROGRAM_MAP(readmem,trojan_writemem) |
| 904 | MDRV_CPU_VBLANK_INT(lwings_interrupt | |
| 905 | MDRV_CPU_VBLANK_INT("main", lwings_interrupt | |
| 905 | 906 | |
| 906 | 907 | MDRV_CPU_ADD(Z80, 4000000) |
| 907 | 908 | /* audio CPU */ |
| 908 | 909 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 909 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 910 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 910 | 911 | |
| 911 | 912 | MDRV_CPU_ADD(Z80, 4000000) // 3.579545 Mhz (?) |
| 912 | 913 | /* audio CPU */ /* ? */ |
| r1877 | r1878 | |
| 957 | 958 | /* basic machine hardware */ |
| 958 | 959 | MDRV_CPU_ADD(Z80, 6000000) //AT: (avengers37b16gre) |
| 959 | 960 | MDRV_CPU_PROGRAM_MAP(avengers_readmem,avengers_writemem) |
| 960 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 961 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 961 | 962 | |
| 962 | 963 | MDRV_CPU_ADD(Z80, 4000000) |
| 963 | 964 | /* audio CPU */ |
| 964 | 965 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 965 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 966 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 966 | 967 | |
| 967 | 968 | MDRV_CPU_ADD(Z80, 4000000) // 3.579545 Mhz (?) |
| 968 | 969 | /* audio CPU */ /* ? */ |
| r1877 | r1878 | |
|---|---|---|
| 45 | 45 | * |
| 46 | 46 | *************************************/ |
| 47 | 47 | |
| 48 | static void xtheball_scanline_update(running_machine *machine, int screen, | |
| 48 | static void xtheball_scanline_update(running_machine *machine, int screen, | |
| 49 | 49 | { |
| 50 | 50 | UINT16 *srcbg = &vram_bg[(params->rowaddr << 8) & 0xff00]; |
| 51 | 51 | UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0); |
| r1877 | r1878 | |
| 148 | 148 | switch (offset) |
| 149 | 149 | { |
| 150 | 150 | case 7: |
| 151 | ticket_dispenser_w(0, data << 7); | |
| 151 | ticket_dispenser_w(machine, 0, data << 7); | |
| 152 | 152 | break; |
| 153 | 153 | |
| 154 | 154 | case 8: |
| r1877 | r1878 | |
| 208 | 208 | static READ16_HANDLER( port0_r ) |
| 209 | 209 | { |
| 210 | 210 | int result = readinputport(0); |
| 211 | result ^= ticket_dispenser_r(0) >> 3; | |
| 211 | result ^= ticket_dispenser_r(machine,0) >> 3; | |
| 212 | 212 | return result; |
| 213 | 213 | } |
| 214 | 214 | |
| r1877 | r1878 | |
| 222 | 222 | static READ16_HANDLER( analogy_watchdog_r ) |
| 223 | 223 | { |
| 224 | 224 | /* doubles as a watchdog address */ |
| 225 | watchdog_reset_w(0,0); | |
| 225 | watchdog_reset_w(machine,0,0); | |
| 226 | 226 | return (readinputportbytag("ANALOGY") << 8) | 0x00ff; |
| 227 | 227 | } |
| 228 | 228 |
| r1877 | r1878 | |
|---|---|---|
| 223 | 223 | output_set_digit_value(2, 0x00); |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | static IN | |
| 226 | static IN | |
| 227 | 227 | { |
| 228 | if ( !readinputport(4) ) | |
| 229 | { | |
| 228 | if (!newval) | |
| 230 | 229 | cpunum_set_input_line(machine, 1, M6805_IRQ_LINE, HOLD_LINE ); |
| 231 | } | |
| 232 | 230 | } |
| 233 | 231 | |
| 234 | 232 | int atari_input_disabled(void) |
| r1877 | r1878 | |
| 308 | 306 | |
| 309 | 307 | /* Max-A-Flex specific ports */ |
| 310 | 308 | PORT_START /* IN4 coin */ |
| 311 | PORT_BIT(0x1, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 309 | PORT_BIT(0x1, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 312 | 310 | |
| 313 | 311 | PORT_START /* IN5 DSW */ |
| 314 | 312 | PORT_DIPNAME(0xf, 0x9, "Coin/Time" ) |
| r1877 | r1878 | |
| 433 | 431 | /* basic machine hardware */ |
| 434 | 432 | MDRV_CPU_ADD_TAG("main", M6502, FREQ_17_EXACT) |
| 435 | 433 | MDRV_CPU_PROGRAM_MAP(a600xl_mem, 0) |
| 436 | MDRV_CPU_VBLANK_INT(a800xl_interrupt, TOTAL_LINES_60HZ) | |
| 434 | MDRV_CPU_VBLANK_INT_HACK(a800xl_interrupt, TOTAL_LINES_60HZ) | |
| 437 | 435 | |
| 438 | 436 | MDRV_CPU_ADD(M68705, 3579545) |
| 439 | 437 | MDRV_CPU_PROGRAM_MAP(mcu_mem,0) |
| 440 | MDRV_CPU_PERIODIC_INT( supervisor_board_check_coin_input, 10 ) | |
| 441 | 438 | |
| 442 | 439 | /* video hardware */ |
| 443 | 440 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 136 | 136 | |
| 137 | 137 | static READ8_HANDLER( punchout_input_3_r ) |
| 138 | 138 | { |
| 139 | int data = input_port_3_r(offset); | |
| 139 | int data = input_port_3_r(machine, offset); | |
| 140 | 140 | /* bit 4 is busy pin level */ |
| 141 | 141 | if( VLM5030_BSY() ) data &= ~0x10; |
| 142 | 142 | else data |= 0x10; |
| r1877 | r1878 | |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | static READ8_HANDLER( spunchout_prot_0_r ) { |
| 308 | return spunchout_prot_r( 0 ); | |
| 308 | return spunchout_prot_r( machine, 0 ); | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | static WRITE8_HANDLER( spunchout_prot_0_w ) { |
| 312 | spunchout_prot_w( 0, data ); | |
| 312 | spunchout_prot_w( machine, 0, data ); | |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | static READ8_HANDLER( spunchout_prot_1_r ) { |
| 316 | return spunchout_prot_r( 1 ); | |
| 316 | return spunchout_prot_r( machine, 1 ); | |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | static WRITE8_HANDLER( spunchout_prot_1_w ) { |
| 320 | spunchout_prot_w( 1, data ); | |
| 320 | spunchout_prot_w( machine, 1, data ); | |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | static READ8_HANDLER( spunchout_prot_2_r ) { |
| 324 | return spunchout_prot_r( 2 ); | |
| 324 | return spunchout_prot_r( machine, 2 ); | |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | static WRITE8_HANDLER( spunchout_prot_2_w ) { |
| 328 | spunchout_prot_w( 2, data ); | |
| 328 | spunchout_prot_w( machine, 2, data ); | |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | static READ8_HANDLER( spunchout_prot_3_r ) { |
| 332 | return spunchout_prot_r( 3 ); | |
| 332 | return spunchout_prot_r( machine, 3 ); | |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | static WRITE8_HANDLER( spunchout_prot_3_w ) { |
| 336 | spunchout_prot_w( 3, data ); | |
| 336 | spunchout_prot_w( machine, 3, data ); | |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | static READ8_HANDLER( spunchout_prot_5_r ) { |
| 340 | return spunchout_prot_r( 5 ); | |
| 340 | return spunchout_prot_r( machine, 5 ); | |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | static WRITE8_HANDLER( spunchout_prot_5_w ) { |
| 344 | spunchout_prot_w( 5, data ); | |
| 344 | spunchout_prot_w( machine, 5, data ); | |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | |
| 348 | 348 | static READ8_HANDLER( spunchout_prot_6_r ) { |
| 349 | return spunchout_prot_r( 6 ); | |
| 349 | return spunchout_prot_r( machine, 6 ); | |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | static WRITE8_HANDLER( spunchout_prot_6_w ) { |
| 353 | spunchout_prot_w( 6, data ); | |
| 353 | spunchout_prot_w( machine, 6, data ); | |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | static READ8_HANDLER( spunchout_prot_9_r ) { |
| 357 | return spunchout_prot_r( 9 ); | |
| 357 | return spunchout_prot_r( machine, 9 ); | |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | static READ8_HANDLER( spunchout_prot_b_r ) { |
| 361 | return spunchout_prot_r( 11 ); | |
| 361 | return spunchout_prot_r( machine, 11 ); | |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | static WRITE8_HANDLER( spunchout_prot_b_w ) { |
| 365 | spunchout_prot_w( 11, data ); | |
| 365 | spunchout_prot_w( machine, 11, data ); | |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | static READ8_HANDLER( spunchout_prot_c_r ) { |
| 369 | return spunchout_prot_r( 12 ); | |
| 369 | return spunchout_prot_r( machine, 12 ); | |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | static WRITE8_HANDLER( spunchout_prot_d_w ) { |
| 373 | spunchout_prot_w( 13, data ); | |
| 373 | spunchout_prot_w( machine, 13, data ); | |
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | static READ8_HANDLER( spunchout_prot_a_r ) { |
| 377 | return spunchout_prot_r( 10 ); | |
| 377 | return spunchout_prot_r( machine, 10 ); | |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | static WRITE8_HANDLER( spunchout_prot_a_w ) { |
| 381 | spunchout_prot_w( 10, data ); | |
| 381 | spunchout_prot_w( machine, 10, data ); | |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | #if 0 |
| 385 | 385 | static READ8_HANDLER( spunchout_prot_f_r ) { |
| 386 | return spunchout_prot_r( 15 ); | |
| 386 | return spunchout_prot_r( machine, 15 ); | |
| 387 | 387 | } |
| 388 | 388 | #endif |
| 389 | 389 | |
| 390 | 390 | static WRITE8_HANDLER( spunchout_prot_f_w ) { |
| 391 | spunchout_prot_w( 15, data ); | |
| 391 | spunchout_prot_w( machine, 15, data ); | |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | |
| r1877 | r1878 | |
| 787 | 787 | MDRV_CPU_ADD_TAG("main", Z80, 8000000/2) /* 4 MHz */ |
| 788 | 788 | MDRV_CPU_PROGRAM_MAP(punchout_map,0) |
| 789 | 789 | MDRV_CPU_IO_MAP(readport,writeport) |
| 790 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 790 | MDRV_CPU_VBLANK_INT("top", nmi_line_pulse | |
| 791 | 791 | |
| 792 | 792 | MDRV_CPU_ADD(N2A03, N2A03_DEFAULTCLOCK) |
| 793 | 793 | /* audio CPU */ |
| 794 | 794 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 795 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 795 | MDRV_CPU_VBLANK_INT("top", nmi_line_pulse | |
| 796 | 796 | |
| 797 | 797 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 798 | 798 |
| r1877 | r1878 | |
|---|---|---|
| 484 | 484 | { |
| 485 | 485 | offs_t start; |
| 486 | 486 | offs_t end; |
| 487 | read32_handler read; | |
| 488 | write32_handler write; | |
| 487 | read32_machine_func read; | |
| 488 | write32_machine_func write; | |
| 489 | 489 | const char * rdname; |
| 490 | 490 | const char * wrname; |
| 491 | 491 | } dynamic[MAX_DYNAMIC_ADDRESSES]; |
| r1877 | r1878 | |
| 1086 | 1086 | case NREG_BAR7: |
| 1087 | 1087 | case NREG_BAR8: |
| 1088 | 1088 | case NREG_BARB: |
| 1089 | result = pci_bridge_r(offset & 0x3f, mem_mask); | |
| 1089 | result = pci_bridge_r(machine, offset & 0x3f, mem_mask); | |
| 1090 | 1090 | break; |
| 1091 | 1091 | |
| 1092 | 1092 | } |
| r1877 | r1878 | |
| 1235 | 1235 | case NREG_BAR7: |
| 1236 | 1236 | case NREG_BAR8: |
| 1237 | 1237 | case NREG_BARB: |
| 1238 | pci_bridge_w(offset & 0x3f, data, mem_mask); | |
| 1238 | pci_bridge_w(machine, offset & 0x3f, data, mem_mask); | |
| 1239 | 1239 | break; |
| 1240 | 1240 | |
| 1241 | 1241 | case NREG_DCS2: |
| r1877 | r1878 | |
| 1482 | 1482 | |
| 1483 | 1483 | static READ32_HANDLER( ide_main_r ) |
| 1484 | 1484 | { |
| 1485 | return ide_controller32_0_r(0x1f0/4 + offset, mem_mask); | |
| 1485 | return ide_controller32_0_r(machine, 0x1f0/4 + offset, mem_mask); | |
| 1486 | 1486 | } |
| 1487 | 1487 | |
| 1488 | 1488 | |
| 1489 | 1489 | static WRITE32_HANDLER( ide_main_w ) |
| 1490 | 1490 | { |
| 1491 | ide_controller32_0_w(0x1f0/4 + offset, data, mem_mask); | |
| 1491 | ide_controller32_0_w(machine, 0x1f0/4 + offset, data, mem_mask); | |
| 1492 | 1492 | } |
| 1493 | 1493 | |
| 1494 | 1494 | |
| 1495 | 1495 | static READ32_HANDLER( ide_alt_r ) |
| 1496 | 1496 | { |
| 1497 | return ide_controller32_0_r(0x3f4/4 + offset, mem_mask); | |
| 1497 | return ide_controller32_0_r(machine, 0x3f4/4 + offset, mem_mask); | |
| 1498 | 1498 | } |
| 1499 | 1499 | |
| 1500 | 1500 | |
| 1501 | 1501 | static WRITE32_HANDLER( ide_alt_w ) |
| 1502 | 1502 | { |
| 1503 | ide_controller32_0_w(0x3f4/4 + offset, data, mem_mask); | |
| 1503 | ide_controller32_0_w(machine, 0x3f4/4 + offset, data, mem_mask); | |
| 1504 | 1504 | } |
| 1505 | 1505 | |
| 1506 | 1506 | |
| r1877 | r1878 | |
| 1508 | 1508 | { |
| 1509 | 1509 | UINT32 result = 0; |
| 1510 | 1510 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 1511 | result |= smc91c94_r(offset * 2 + 0, mem_mask); | |
| 1511 | result |= smc91c94_r(machine, offset * 2 + 0, mem_mask); | |
| 1512 | 1512 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 1513 | result |= smc91c94_r(offset * 2 + 1, mem_mask >> 16) << 16; | |
| 1513 | result |= smc91c94_r(machine, offset * 2 + 1, mem_mask >> 16) << 16; | |
| 1514 | 1514 | return result; |
| 1515 | 1515 | } |
| 1516 | 1516 | |
| r1877 | r1878 | |
| 1518 | 1518 | static WRITE32_HANDLER( ethernet_w ) |
| 1519 | 1519 | { |
| 1520 | 1520 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 1521 | smc91c94_w(offset * 2 + 0, data, mem_mask); | |
| 1521 | smc91c94_w(machine, offset * 2 + 0, data, mem_mask); | |
| 1522 | 1522 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 1523 | smc91c94_w(offset * 2 + 1, data >> 16, mem_mask >> 16); | |
| 1523 | smc91c94_w(machine, offset * 2 + 1, data >> 16, mem_mask >> 16); | |
| 1524 | 1524 | } |
| 1525 | 1525 | |
| 1526 | 1526 | |
| r1877 | r1878 | |
| 1539 | 1539 | |
| 1540 | 1540 | #define add_dynamic_address(s,e,r,w) _add_dynamic_address(s,e,r,w,#r,#w) |
| 1541 | 1541 | |
| 1542 | INLINE void _add_dynamic_address(offs_t start, offs_t end, read32_ | |
| 1542 | INLINE void _add_dynamic_address(offs_t start, offs_t end, read32_machin | |
| 1543 | 1543 | { |
| 1544 | 1544 | dynamic[dynamic_count].start = start; |
| 1545 | 1545 | dynamic[dynamic_count].end = end; |
| r1877 | r1878 | |
|---|---|---|
| 18 | 18 | { |
| 19 | 19 | if (cpu_getiloops() == 0) |
| 20 | 20 | { |
| 21 | if (~input_port_1_r(0) & 0x80) /* coin 1 */ | |
| 21 | if (~input_port_1_r(machine,0) & 0x80) /* coin 1 */ | |
| 22 | 22 | { |
| 23 | 23 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0xf7); /* RST 30h */ |
| 24 | 24 | return; |
| 25 | 25 | } |
| 26 | else if (~input_port_1_r(0) & 0x08) /* coin 2 */ | |
| 26 | else if (~input_port_1_r(machine,0) & 0x08) /* coin 2 */ | |
| 27 | 27 | { |
| 28 | 28 | cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0xef); /* RST 28h */ |
| 29 | 29 | return; |
| r1877 | r1878 | |
| 37 | 37 | { |
| 38 | 38 | /* port 31 + low 3 bits of port 32 contain the punch strength */ |
| 39 | 39 | if (offset == 0) |
| 40 | return mame_rand( | |
| 40 | return mame_rand(machine); | |
| 41 | 41 | else |
| 42 | return (mame_rand( | |
| 42 | return (mame_rand(machine) & 0x07) | input_port_1_r(machine,0); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | static WRITE8_HANDLER( kopunch_lamp_w ) |
| r1877 | r1878 | |
| 168 | 168 | MDRV_CPU_ADD(8080, 4000000) /* 4 MHz ???? appears to use 8080 instructions, not z80 */ |
| 169 | 169 | MDRV_CPU_PROGRAM_MAP(kopunch_map,0) |
| 170 | 170 | MDRV_CPU_IO_MAP(kopunch_io_map,0) |
| 171 | MDRV_CPU_VBLANK_INT(kopunch_interrupt,4) /* ??? */ | |
| 171 | MDRV_CPU_VBLANK_INT_HACK(kopunch_interrupt,4) /* ??? */ | |
| 172 | 172 | |
| 173 | 173 | /* video hardware */ |
| 174 | 174 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | static WRITE8_HANDLER( tecmo_sound_command_w ) |
| 81 | 81 | { |
| 82 | soundlatch_w(offset,data); | |
| 83 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 82 | soundlatch_w(machine,offset,data); | |
| 83 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | static int adpcm_pos,adpcm_end; |
| r1877 | r1878 | |
| 568 | 568 | /* basic machine hardware */ |
| 569 | 569 | MDRV_CPU_ADD_TAG("main", Z80, 4000000) |
| 570 | 570 | MDRV_CPU_PROGRAM_MAP(readmem,rygar_writemem) |
| 571 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 571 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 572 | 572 | |
| 573 | 573 | MDRV_CPU_ADD_TAG("sound", Z80, 4000000) |
| 574 | 574 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 123 | 123 | /* basic machine hardware */ |
| 124 | 124 | MDRV_CPU_ADD(Z80,8000000) /* ? MHz */ |
| 125 | 125 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 126 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 126 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 127 | 127 | |
| 128 | 128 | /* video hardware */ |
| 129 | 129 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 212 | 212 | for(i = 0; i < 8; i++) |
| 213 | 213 | { |
| 214 | 214 | // or offset + i * 0x2000 ? |
| 215 | galpanic_bgvideoram_w(offset * 8 + i, data, mem_mask); | |
| 215 | galpanic_bgvideoram_w(machine, offset * 8 + i, data, mem_mask); | |
| 216 | 216 | } |
| 217 | 217 | } |
| 218 | 218 | |
| r1877 | r1878 | |
| 930 | 930 | static MACHINE_DRIVER_START( galpanic ) |
| 931 | 931 | |
| 932 | 932 | /* basic machine hardware */ |
| 933 | MDRV_CPU_ADD_TAG("main", M68000, | |
| 933 | MDRV_CPU_ADD_TAG("main", M68000, XTAL_12MHz) /* verified on pcb */ | |
| 934 | 934 | MDRV_CPU_PROGRAM_MAP(galpanic,0) |
| 935 | MDRV_CPU_VBLANK_INT(galpanic_interrupt,2) | |
| 935 | MDRV_CPU_VBLANK_INT_HACK(galpanic_interrupt,2) | |
| 936 | 936 | |
| 937 | 937 | /* video hardware */ |
| 938 | 938 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 953 | 953 | /* sound hardware */ |
| 954 | 954 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 955 | 955 | |
| 956 | MDRV_SOUND_ADD_TAG("oki", OKIM6295, 1584000) | |
| 957 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified | |
| 956 | MDRV_SOUND_ADD_TAG("oki", OKIM6295, XTAL_12MHz/6) /* verified on pcb */ | |
| 957 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7low) /* verified on pcb */ | |
| 958 | 958 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 959 | 959 | MACHINE_DRIVER_END |
| 960 | 960 | |
| r1877 | r1878 | |
| 986 | 986 | MDRV_IMPORT_FROM(comad) |
| 987 | 987 | MDRV_CPU_REPLACE("main", M68000, 12000000) /* ? */ |
| 988 | 988 | MDRV_CPU_PROGRAM_MAP(supmodel_readmem,supmodel_writemem) |
| 989 | MDRV_CPU_VBLANK_INT(galpanic_interrupt,2) | |
| 989 | MDRV_CPU_VBLANK_INT_HACK(galpanic_interrupt,2) | |
| 990 | 990 | |
| 991 | 991 | /* video hardware */ |
| 992 | 992 | MDRV_VIDEO_UPDATE(comad) |
| r1877 | r1878 | |
| 1017 | 1017 | MDRV_IMPORT_FROM(comad) |
| 1018 | 1018 | MDRV_CPU_REPLACE("main", M68000, 12000000) /* ? */ |
| 1019 | 1019 | MDRV_CPU_PROGRAM_MAP(galhustl_readmem,galhustl_writemem) |
| 1020 | MDRV_CPU_VBLANK_INT(galhustl_interrupt,3) | |
| 1020 | MDRV_CPU_VBLANK_INT_HACK(galhustl_interrupt,3) | |
| 1021 | 1021 | |
| 1022 | 1022 | /* video hardware */ |
| 1023 | 1023 | MDRV_VIDEO_UPDATE(comad) |
| r1877 | r1878 | |
| 1034 | 1034 | MDRV_IMPORT_FROM(comad) |
| 1035 | 1035 | MDRV_CPU_REPLACE("main", M68000, 12000000) /* ? */ |
| 1036 | 1036 | MDRV_CPU_PROGRAM_MAP(zipzap_readmem,zipzap_writemem) |
| 1037 | MDRV_CPU_VBLANK_INT(galhustl_interrupt,3) | |
| 1037 | MDRV_CPU_VBLANK_INT_HACK(galhustl_interrupt,3) | |
| 1038 | 1038 | |
| 1039 | 1039 | /* video hardware */ |
| 1040 | 1040 | MDRV_VIDEO_UPDATE(comad) |
| r1877 | r1878 | |
|---|---|---|
| 407 | 407 | /* basic machine hardware */ |
| 408 | 408 | MDRV_CPU_ADD(M6809,18432000/6) /* ??? */ |
| 409 | 409 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 410 | MDRV_CPU_VBLANK_INT(finalizr_interrupt,16) /* 1 IRQ + 8 NMI (generated by a custom IC) */ | |
| 410 | MDRV_CPU_VBLANK_INT_HACK(finalizr_interrupt,16) /* 1 IRQ + 8 NMI (generated by a custom IC) */ | |
| 411 | 411 | |
| 412 | 412 | MDRV_CPU_ADD(I8039,18432000/2) /* 9.216MHz clkin ?? */ |
| 413 | 413 | /* audio CPU */ /* DAC */ |
| r1877 | r1878 | |
|---|---|---|
| 210 | 210 | |
| 211 | 211 | static TIMER_CALLBACK( delayed_sound_data_w ) |
| 212 | 212 | { |
| 213 | soundlatch_w(0, param); | |
| 213 | soundlatch_w(machine, 0, param); | |
| 214 | 214 | cpunum_set_input_line(machine, 3, INPUT_LINE_NMI, ASSERT_LINE); |
| 215 | 215 | } |
| 216 | 216 | |
| r1877 | r1878 | |
| 224 | 224 | |
| 225 | 225 | static READ8_HANDLER( sound_data_r ) |
| 226 | 226 | { |
| 227 | cpunum_set_input_line(Machine, 3, INPUT_LINE_NMI, CLEAR_LINE); | |
| 228 | return soundlatch_r(offset); | |
| 227 | cpunum_set_input_line(machine, 3, INPUT_LINE_NMI, CLEAR_LINE); | |
| 228 | return soundlatch_r(machine,offset); | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | |
| r1877 | r1878 | |
| 314 | 314 | D1-D0 = ADC0-1 |
| 315 | 315 | */ |
| 316 | 316 | segaic16_set_display_enable(data & 0x80); |
| 317 | if (((old ^ data) & 0x20) && !(data & 0x20)) watchdog_reset_w(0,0); | |
| 317 | if (((old ^ data) & 0x20) && !(data & 0x20)) watchdog_reset_w(machine,0,0); | |
| 318 | 318 | cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); |
| 319 | 319 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE); |
| 320 | 320 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE); |
| r1877 | r1878 | |
|---|---|---|
| 102 | 102 | |
| 103 | 103 | static READ16_HANDLER( adpcm_r ) |
| 104 | 104 | { |
| 105 | return OKIM6295_status_0_r(offset) | 0xff00; | |
| 105 | return OKIM6295_status_0_r(machine, offset) | 0xff00; | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
| 109 | 109 | static WRITE16_HANDLER( adpcm_w ) |
| 110 | 110 | { |
| 111 | 111 | if (ACCESSING_LSB) |
| 112 | OKIM6295_data_0_w(offset, data & 0xff); | |
| 112 | OKIM6295_data_0_w(machine, offset, data & 0xff); | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 |
| r1877 | r1878 | |
|---|---|---|
| 205 | 205 | |
| 206 | 206 | static WRITE8_HANDLER( swimmer_sh_soundlatch_w ) |
| 207 | 207 | { |
| 208 | soundlatch_w(offset,data); | |
| 209 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 208 | soundlatch_w(machine,offset,data); | |
| 209 | cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff); | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | |
| r1877 | r1878 | |
| 1070 | 1070 | MDRV_CPU_ADD_TAG("main", Z80, MASTER_CLOCK/3/2) /* 3.072 MHz */ |
| 1071 | 1071 | MDRV_CPU_PROGRAM_MAP(cclimber_map,0) |
| 1072 | 1072 | MDRV_CPU_IO_MAP(cclimber_portmap,0) |
| 1073 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 1073 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 1074 | 1074 | |
| 1075 | 1075 | MDRV_MACHINE_RESET(cclimber) |
| 1076 | 1076 | |
| r1877 | r1878 | |
| 1173 | 1173 | /* basic machine hardware */ |
| 1174 | 1174 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz */ |
| 1175 | 1175 | MDRV_CPU_PROGRAM_MAP(swimmer_map,0) |
| 1176 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 1176 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 1177 | 1177 | |
| 1178 | 1178 | MDRV_CPU_ADD(Z80,4000000/2) |
| 1179 | 1179 | MDRV_CPU_PROGRAM_MAP(swimmer_audio_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 208 | 208 | // basic machine hardware |
| 209 | 209 | MDRV_CPU_ADD(M68000, 10000000) // 10 MHz |
| 210 | 210 | MDRV_CPU_PROGRAM_MAP(xorworld_map, 0) |
| 211 | MDRV_CPU_VBLANK_INT(xorworld_interrupt, 4) // 1 IRQ2 + 1 IRQ4 + 1 IRQ6 | |
| 211 | MDRV_CPU_VBLANK_INT_HACK(xorworld_interrupt, 4) // 1 IRQ2 + 1 IRQ4 + 1 IRQ6 | |
| 212 | 212 | |
| 213 | 213 | MDRV_INTERLEAVE(1) |
| 214 | 214 |
| r1877 | r1878 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | static WRITE8_HANDLER(speedspn_sound_w) |
| 105 | 105 | { |
| 106 | soundlatch_w(1,data); | |
| 107 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 106 | soundlatch_w(machine,1,data); | |
| 107 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | static WRITE8_HANDLER( oki_banking_w ) |
| r1877 | r1878 | |
| 306 | 306 | MDRV_CPU_ADD_TAG("main",Z80,6000000) /* 6 MHz */ |
| 307 | 307 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 308 | 308 | MDRV_CPU_IO_MAP(readport, writeport) |
| 309 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 309 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 310 | 310 | |
| 311 | 311 | MDRV_CPU_ADD(Z80,6000000) /* 6 MHz */ |
| 312 | 312 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 566 | 566 | MDRV_CPU_PROGRAM_MAP(engima2_main_cpu_map,0) |
| 567 | 567 | |
| 568 | 568 | MDRV_CPU_ADD(Z80, 2500000) |
| 569 | MDRV_CPU_VBLANK_INT(irq0_line_hold,8) | |
| 569 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,8) | |
| 570 | 570 | MDRV_CPU_PROGRAM_MAP(engima2_audio_cpu_map,0) |
| 571 | 571 | |
| 572 | 572 | MDRV_MACHINE_START(enigma2) |
| r1877 | r1878 | |
| 596 | 596 | MDRV_CPU_IO_MAP(engima2a_main_cpu_io_map,0) |
| 597 | 597 | |
| 598 | 598 | MDRV_CPU_ADD(Z80, 2500000) |
| 599 | MDRV_CPU_VBLANK_INT(irq0_line_hold,8) | |
| 599 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,8) | |
| 600 | 600 | MDRV_CPU_PROGRAM_MAP(engima2_audio_cpu_map,0) |
| 601 | 601 | |
| 602 | 602 | MDRV_MACHINE_START(enigma2) |
| r1877 | r1878 | |
|---|---|---|
| 164 | 164 | MDRV_CPU_ADD(Z80, 4000000) |
| 165 | 165 | MDRV_CPU_PROGRAM_MAP(mem_map_cowrace,0) |
| 166 | 166 | MDRV_CPU_IO_MAP(io_map_cowrace,0) |
| 167 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 167 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 168 | 168 | |
| 169 | 169 | MDRV_CPU_ADD(Z80, 4000000) |
| 170 | 170 | MDRV_CPU_PROGRAM_MAP(mem_map_sound_cowrace,0) |
| 171 | 171 | MDRV_CPU_IO_MAP(io_map_sound_cowrace,0) |
| 172 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 172 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 173 | 173 | |
| 174 | 174 | /* video hardware */ |
| 175 | 175 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 43 | 43 | static UINT8 irq2_state; |
| 44 | 44 | static UINT8 vblank_irq_state; |
| 45 | 45 | |
| 46 | static read16_handler custom_io_r; | |
| 47 | static write16_handler custom_io_w; | |
| 46 | static read16_machine_func custom_io_r; | |
| 47 | static write16_machine_func custom_io_w; | |
| 48 | 48 | |
| 49 | 49 | static const UINT8 *custom_map; |
| 50 | 50 | |
| r1877 | r1878 | |
| 122 | 122 | |
| 123 | 123 | static TIMER_CALLBACK( delayed_sound_data_w ) |
| 124 | 124 | { |
| 125 | soundlatch_w(0, param); | |
| 125 | soundlatch_w(machine, 0, param); | |
| 126 | 126 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, ASSERT_LINE); |
| 127 | 127 | } |
| 128 | 128 | |
| r1877 | r1878 | |
| 135 | 135 | |
| 136 | 136 | static READ8_HANDLER( sound_data_r ) |
| 137 | 137 | { |
| 138 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 139 | return soundlatch_r(offset); | |
| 138 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 139 | return soundlatch_r(machine,offset); | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | |
| r1877 | r1878 | |
| 348 | 348 | */ |
| 349 | 349 | segaic16_set_display_enable(data & 0x20); |
| 350 | 350 | adc_select = (data >> 2) & 7; |
| 351 | cpunum_set_input_line( | |
| 351 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | |
| r1877 | r1878 | |
| 362 | 362 | static READ16_HANDLER( misc_io_r ) |
| 363 | 363 | { |
| 364 | 364 | if (custom_io_r) |
| 365 | return custom_io_r(offset, mem_mask); | |
| 365 | return custom_io_r(machine, offset, mem_mask); | |
| 366 | 366 | logerror("%06X:misc_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2); |
| 367 | return segaic16_open_bus_r(0,0); | |
| 367 | return segaic16_open_bus_r(machine,0,0); | |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | |
| r1877 | r1878 | |
| 372 | 372 | { |
| 373 | 373 | if (custom_io_w) |
| 374 | 374 | { |
| 375 | custom_io_w(offset, data, mem_mask); | |
| 375 | custom_io_w(machine, offset, data, mem_mask); | |
| 376 | 376 | return; |
| 377 | 377 | } |
| 378 | 378 | logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask ^ 0xffff); |
| r1877 | r1878 | |
| 385 | 385 | switch (offset & 0x70/2) |
| 386 | 386 | { |
| 387 | 387 | case 0x00/2: |
| 388 | return ppi8255_0_r(offset & 3); | |
| 388 | return ppi8255_0_r(machine, offset & 3); | |
| 389 | 389 | |
| 390 | 390 | case 0x10/2: |
| 391 | 391 | return readinputport(offset & 3); |
| r1877 | r1878 | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | case 0x60/2: |
| 400 | return watchdog_reset_r(0); | |
| 400 | return watchdog_reset_r(machine,0); | |
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | logerror("%06X:outrun_custom_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2); |
| 404 | return segaic16_open_bus_r(0,0); | |
| 404 | return segaic16_open_bus_r(machine,0,0); | |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | |
| r1877 | r1878 | |
| 412 | 412 | { |
| 413 | 413 | case 0x00/2: |
| 414 | 414 | if (ACCESSING_LSB) |
| 415 | ppi8255_0_w(offset & 3, data); | |
| 415 | ppi8255_0_w(machine, offset & 3, data); | |
| 416 | 416 | return; |
| 417 | 417 | |
| 418 | 418 | case 0x20/2: |
| r1877 | r1878 | |
| 431 | 431 | return; |
| 432 | 432 | |
| 433 | 433 | case 0x60/2: |
| 434 | watchdog_reset_w(0,0); | |
| 434 | watchdog_reset_w(machine,0,0); | |
| 435 | 435 | return; |
| 436 | 436 | |
| 437 | 437 | case 0x70/2: |
| 438 | segaic16_sprites_draw_0_w(offset, data, mem_mask); | |
| 438 | segaic16_sprites_draw_0_w(machine, offset, data, mem_mask); | |
| 439 | 439 | return; |
| 440 | 440 | } |
| 441 | 441 | logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask ^ 0xffff); |
| r1877 | r1878 | |
| 460 | 460 | } |
| 461 | 461 | } |
| 462 | 462 | logerror("%06X:misc_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2); |
| 463 | return segaic16_open_bus_r(0,0); | |
| 463 | return segaic16_open_bus_r(machine,0,0); | |
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | |
| r1877 | r1878 | |
| 482 | 482 | /* Output port: |
| 483 | 483 | D0: Sound section reset (1= normal operation, 0= reset) |
| 484 | 484 | */ |
| 485 | cpunum_set_input_line( | |
| 485 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 486 | 486 | return; |
| 487 | 487 | |
| 488 | 488 | case 0x3000/2: |
| 489 | watchdog_reset_w(0,0); | |
| 489 | watchdog_reset_w(machine,0,0); | |
| 490 | 490 | return; |
| 491 | 491 | |
| 492 | 492 | case 0x3020/2: |
| r1877 | r1878 | |
|---|---|---|
| 73 | 73 | if(inputcnt<0){ return 0; } |
| 74 | 74 | if(!inputcnt) |
| 75 | 75 | { |
| 76 | int key=input_port_2_word_r(0,0); | |
| 76 | int key=input_port_2_word_r(machine,0,0); | |
| 77 | 77 | int keyval=0; //we must return 0 (0x2 in 2nd read) to clear 4 bit at $6600 and allow next read |
| 78 | 78 | |
| 79 | 79 | if(key) |
| r1877 | r1878 | |
| 104 | 104 | { |
| 105 | 105 | if(!offset) |
| 106 | 106 | { |
| 107 | return input_port_1_r(0)^ioram[4]; //coin | |
| 107 | return input_port_1_r(machine,0)^ioram[4]; //coin | |
| 108 | 108 | } |
| 109 | 109 | return 0; |
| 110 | 110 | } |
| r1877 | r1878 | |
| 252 | 252 | MDRV_CPU_ADD(Z80,KOIKOI_CRYSTAL/4) /* ?? */ |
| 253 | 253 | MDRV_CPU_PROGRAM_MAP(readmem, 0) |
| 254 | 254 | MDRV_CPU_IO_MAP(readport, 0) |
| 255 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 255 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 256 | 256 | |
| 257 | 257 | /* video hardware */ |
| 258 | 258 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 134 | 134 | /* basic machine hardware */ |
| 135 | 135 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz ??????? */ |
| 136 | 136 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 137 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 137 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 138 | 138 | |
| 139 | 139 | /* video hardware */ |
| 140 | 140 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | |
| 55 | 55 | int K001604_vh_start(running_machine *machine, int chip); |
| 56 | 56 | void K001604_tile_update(int chip); |
| 57 | void K001604_draw_front_layer(int chip, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 58 | void K001604_draw_back_layer(int chip, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 57 | void K001604_draw_front_layer(int chip, bitmap_t *bitmap, const rectangle *cliprect); | |
| 58 | void K001604_draw_back_layer(int chip, bitmap_t *bitmap, const rectangle *cliprect); | |
| 59 | 59 | READ32_HANDLER(K001604_tile_r); |
| 60 | 60 | READ32_HANDLER(K001604_char_r); |
| 61 | 61 | WRITE32_HANDLER(K001604_tile_w); |
| r1877 | r1878 | |
| 755 | 755 | MDRV_CPU_ADD(PPC403, 64000000/2) /* PowerPC 403GA 32MHz */ |
| 756 | 756 | MDRV_CPU_CONFIG(gticlub_ppc_cfg) |
| 757 | 757 | MDRV_CPU_PROGRAM_MAP(gticlub_map, 0) |
| 758 | MDRV_CPU_VBLANK_INT(gticlub_vblank | |
| 758 | MDRV_CPU_VBLANK_INT("main", gticlub_vblank | |
| 759 | 759 | |
| 760 | 760 | MDRV_CPU_ADD(M68000, 64000000/4) /* 16MHz */ |
| 761 | 761 | MDRV_CPU_PROGRAM_MAP(sound_memmap, 0) |
| r1877 | r1878 | |
|---|---|---|
| 337 | 337 | /* basic machine hardware */ |
| 338 | 338 | MDRV_CPU_ADD(M6502,1000000) /* 1 MHz ???? */ |
| 339 | 339 | MDRV_CPU_PROGRAM_MAP(master_map,0) |
| 340 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 340 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 341 | 341 | |
| 342 | 342 | MDRV_CPU_ADD(M6502,1250000) /* 1.25 MHz ???? */ |
| 343 | 343 | MDRV_CPU_PROGRAM_MAP(slave_map,0) |
| 344 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 344 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 345 | 345 | |
| 346 | 346 | MDRV_INTERLEAVE(5) |
| 347 | 347 |
| r1877 | r1878 | |
|---|---|---|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | |
| 103 | static | |
| 103 | static | |
| 104 | 104 | |
| 105 | 105 | static VIDEO_START( mazerbla ) |
| 106 | 106 | { |
| r1877 | r1878 | |
| 1502 | 1502 | and cleared on ANY port access. |
| 1503 | 1503 | but handled differently for now |
| 1504 | 1504 | */ |
| 1505 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1505 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1506 | 1506 | |
| 1507 | 1507 | /* synchronization forced on the fly */ |
| 1508 | 1508 | |
| r1877 | r1878 | |
| 1544 | 1544 | and cleared on ANY port access. |
| 1545 | 1545 | but handled differently for now |
| 1546 | 1546 | */ |
| 1547 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1547 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1548 | 1548 | |
| 1549 | 1549 | MDRV_MACHINE_RESET(greatgun) |
| 1550 | 1550 |
| r1877 | r1878 | |
|---|---|---|
| 180 | 180 | /* bit 1 = UPDATE */ |
| 181 | 181 | |
| 182 | 182 | if (!(data & 0x04)) |
| 183 | atarigen_scanline_int_ack_w(0,0,0); | |
| 183 | atarigen_scanline_int_ack_w(machine,0,0,0); | |
| 184 | 184 | if (!(data & 0x08)) |
| 185 | atarigen_video_int_ack_w(0,0,0); | |
| 185 | atarigen_video_int_ack_w(machine,0,0,0); | |
| 186 | 186 | |
| 187 | 187 | output_set_led_value(0, (data >> 4) & 1); |
| 188 | 188 | output_set_led_value(1, (data >> 5) & 1); |
| r1877 | r1878 | |
| 219 | 219 | * |
| 220 | 220 | *************************************/ |
| 221 | 221 | |
| 222 | static READ16_HANDLER( pokey1_word_r ) { return pokey1_r(offset); } | |
| 223 | static READ16_HANDLER( pokey2_word_r ) { return pokey2_r(offset); } | |
| 224 | static READ16_HANDLER( pokey3_word_r ) { return pokey3_r(offset); } | |
| 222 | static READ16_HANDLER( pokey1_word_r ) { return pokey1_r(machine, offset); } | |
| 223 | static READ16_HANDLER( pokey2_word_r ) { return pokey2_r(machine, offset); } | |
| 224 | static READ16_HANDLER( pokey3_word_r ) { return pokey3_r(machine, offset); } | |
| 225 | 225 | |
| 226 | static WRITE16_HANDLER( pokey1_word_w ) { if (ACCESSING_LSB) pokey1_w(offset, data & 0xff); } | |
| 227 | static WRITE16_HANDLER( pokey2_word_w ) { if (ACCESSING_LSB) pokey2_w(offset, data & 0xff); } | |
| 228 | static WRITE16_HANDLER( pokey3_word_w ) { if (ACCESSING_LSB) pokey3_w(offset, data & 0xff); } | |
| 226 | static WRITE16_HANDLER( pokey1_word_w ) { if (ACCESSING_LSB) pokey1_w(machine, offset, data & 0xff); } | |
| 227 | static WRITE16_HANDLER( pokey2_word_w ) { if (ACCESSING_LSB) pokey2_w(machine, offset, data & 0xff); } | |
| 228 | static WRITE16_HANDLER( pokey3_word_w ) { if (ACCESSING_LSB) pokey3_w(machine, offset, data & 0xff); } | |
| 229 | 229 | |
| 230 | 230 | |
| 231 | 231 | |
| r1877 | r1878 | |
| 374 | 374 | /* basic machine hardware */ |
| 375 | 375 | MDRV_CPU_ADD(M68000, MASTER_CLOCK/2) |
| 376 | 376 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 377 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 377 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 378 | 378 | |
| 379 | 379 | MDRV_MACHINE_START(foodf) |
| 380 | 380 | MDRV_MACHINE_RESET(foodf) |
| r1877 | r1878 | |
|---|---|---|
| 813 | 813 | } /* namcona1_vreg_r */ |
| 814 | 814 | |
| 815 | 815 | static int |
| 816 | transfer_dword( UINT32 dest, UINT32 source ) | |
| 816 | transfer_dword( running_machine *machine, UINT32 dest, UINT32 source ) | |
| 817 | 817 | { |
| 818 | 818 | UINT16 data; |
| 819 | 819 | |
| r1877 | r1878 | |
| 836 | 836 | } |
| 837 | 837 | if( dest>=0xf00000 && dest<=0xf02000 ) |
| 838 | 838 | { |
| 839 | namcona1_paletteram_w( (dest-0xf00000)/2, data, 0x0000 ); | |
| 839 | namcona1_paletteram_w( machine, (dest-0xf00000)/2, data, 0x0000 ); | |
| 840 | 840 | } |
| 841 | 841 | else if( dest>=0xf40000 && dest<=0xf80000 ) |
| 842 | 842 | { |
| 843 | namcona1_gfxram_w( (dest-0xf40000)/2, data, 0x0000 ); | |
| 843 | namcona1_gfxram_w( machine, (dest-0xf40000)/2, data, 0x0000 ); | |
| 844 | 844 | } |
| 845 | 845 | else if( dest>=0xff0000 && dest<0xff8000 ) |
| 846 | 846 | { |
| 847 | namcona1_videoram_w( (dest-0xff0000)/2, data, 0x0000 ); | |
| 847 | namcona1_videoram_w( machine, (dest-0xff0000)/2, data, 0x0000 ); | |
| 848 | 848 | } |
| 849 | 849 | else if( dest>=0xff8000 && dest<=0xffdfff ) |
| 850 | 850 | { |
| r1877 | r1878 | |
| 957 | 957 | $efff80: 0048 0177 0020 0100 0000 00fd 0000 GFXE |
| 958 | 958 | */ |
| 959 | 959 | |
| 960 | static void namcona1_blit( | |
| 960 | static void namcona1_blit( running_machine *machine ) | |
| 961 | 961 | { |
| 962 | 962 | int src0 = namcona1_vreg[0x0]; |
| 963 | 963 | int src1 = namcona1_vreg[0x1]; |
| r1877 | r1878 | |
| 1009 | 1009 | |
| 1010 | 1010 | while( num_bytes>0 ) |
| 1011 | 1011 | { |
| 1012 | if( transfer_dword( | |
| 1012 | if( transfer_dword(machine, | |
| 1013 | 1013 | dst_baseaddr + dest_offset, |
| 1014 | 1014 | src_baseaddr + source_offset ) ) |
| 1015 | 1015 | { |
| r1877 | r1878 | |
| 1041 | 1041 | switch( offset ) |
| 1042 | 1042 | { |
| 1043 | 1043 | case 0x18/2: |
| 1044 | namcona1_blit(); | |
| 1044 | namcona1_blit(machine); | |
| 1045 | 1045 | /* see also 0x1e */ |
| 1046 | 1046 | break; |
| 1047 | 1047 | |
| r1877 | r1878 | |
| 1154 | 1154 | |
| 1155 | 1155 | static READ16_HANDLER(snd_r) |
| 1156 | 1156 | { |
| 1157 | return C140_r(offset*2+1) | C140_r(offset*2)<<8; | |
| 1157 | return C140_r(machine,offset*2+1) | C140_r(machine,offset*2)<<8; | |
| 1158 | 1158 | } |
| 1159 | 1159 | |
| 1160 | 1160 | static WRITE16_HANDLER(snd_w) |
| 1161 | 1161 | { |
| 1162 | 1162 | if (ACCESSING_LSB16) |
| 1163 | 1163 | { |
| 1164 | C140_w((offset*2)+1, data); | |
| 1164 | C140_w(machine,(offset*2)+1, data); | |
| 1165 | 1165 | } |
| 1166 | 1166 | |
| 1167 | 1167 | if (ACCESSING_MSB16) |
| 1168 | 1168 | { |
| 1169 | C140_w((offset*2), data>>8); | |
| 1169 | C140_w(machine,(offset*2), data>>8); | |
| 1170 | 1170 | } |
| 1171 | 1171 | } |
| 1172 | 1172 | |
| r1877 | r1878 | |
| 1346 | 1346 | /* basic machine hardware */ |
| 1347 | 1347 | MDRV_CPU_ADD(M68000, 50113000/4) |
| 1348 | 1348 | MDRV_CPU_PROGRAM_MAP(namcona1_mcu_readmem,namcona1_mcu_writemem) |
| 1349 | MDRV_CPU_VBLANK_INT(namcona1_interrupt,5) | |
| 1349 | MDRV_CPU_VBLANK_INT_HACK(namcona1_interrupt,5) | |
| 1350 | 1350 | |
| 1351 | 1351 | MDRV_CPU_ADD(M37710, 50113000/4) |
| 1352 | 1352 | MDRV_CPU_PROGRAM_MAP(namcona1_mcu_map, 0) |
| 1353 | 1353 | MDRV_CPU_IO_MAP( namcona1_mcu_io_map, 0 ) |
| 1354 | MDRV_CPU_VBLANK_INT(mcu_interrupt, 2) | |
| 1354 | MDRV_CPU_VBLANK_INT_HACK(mcu_interrupt, 2) | |
| 1355 | 1355 | |
| 1356 | 1356 | MDRV_NVRAM_HANDLER(namcosna1) |
| 1357 | 1357 | MDRV_MACHINE_START(namcona1) |
| r1877 | r1878 | |
| 1445 | 1445 | /* basic machine hardware */ |
| 1446 | 1446 | MDRV_CPU_ADD(M68000, 50113000/4) |
| 1447 | 1447 | MDRV_CPU_PROGRAM_MAP(namcona2_readmem,namcona2_writemem) |
| 1448 | MDRV_CPU_VBLANK_INT(namcona1_interrupt,5) | |
| 1448 | MDRV_CPU_VBLANK_INT_HACK(namcona1_interrupt,5) | |
| 1449 | 1449 | |
| 1450 | 1450 | MDRV_NVRAM_HANDLER(namcosna1) |
| 1451 | 1451 | MDRV_INTERLEAVE(40) |
| r1877 | r1878 | |
|---|---|---|
| 22 | 22 | ***************************************************************************/ |
| 23 | 23 | |
| 24 | 24 | #include "driver.h" |
| 25 | #include "deprecat.h" | |
| 25 | 26 | #include "bsktball.h" |
| 26 | 27 | #include "sound/discrete.h" |
| 27 | 28 | |
| r1877 | r1878 | |
| 210 | 211 | /* basic machine hardware */ |
| 211 | 212 | MDRV_CPU_ADD(M6502,750000) |
| 212 | 213 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 213 | MDRV_CPU_VBLANK_INT(bsktball_interrupt,8) | |
| 214 | MDRV_CPU_VBLANK_INT_HACK(bsktball_interrupt,8) | |
| 214 | 215 | |
| 215 | 216 | /* video hardware */ |
| 216 | 217 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 226 | 226 | int i; |
| 227 | 227 | for (i = 0; i < 0x1000; i++) |
| 228 | 228 | { |
| 229 | armedf_text_videoram_w(i, ' ', 0); | |
| 229 | armedf_text_videoram_w(machine,i, ' ', 0); | |
| 230 | 230 | } |
| 231 | 231 | } |
| 232 | 232 | } |
| r1877 | r1878 | |
| 234 | 234 | static WRITE16_HANDLER( sound_command_w ) |
| 235 | 235 | { |
| 236 | 236 | if (ACCESSING_LSB) |
| 237 | soundlatch_w(0,((data & 0x7f) << 1) | 1); | |
| 237 | soundlatch_w(machine,0,((data & 0x7f) << 1) | 1); | |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | #ifdef UNUSED_FUNCTION |
| r1877 | r1878 | |
| 446 | 446 | |
| 447 | 447 | static READ8_HANDLER( soundlatch_clear_r ) |
| 448 | 448 | { |
| 449 | soundlatch_clear_w(0,0); | |
| 449 | soundlatch_clear_w(machine,0,0); | |
| 450 | 450 | return 0; |
| 451 | 451 | } |
| 452 | 452 | |
| r1877 | r1878 | |
| 762 | 762 | /* basic machine hardware */ |
| 763 | 763 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz?? */ |
| 764 | 764 | MDRV_CPU_PROGRAM_MAP(terraf_readmem,terraf_writemem) |
| 765 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 765 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 766 | 766 | |
| 767 | 767 | MDRV_CPU_ADD(Z80, 3072000) |
| 768 | 768 | /* audio CPU */ /* 3.072 MHz???? */ |
| 769 | 769 | MDRV_CPU_PROGRAM_MAP(soundreadmem,soundwritemem) |
| 770 | 770 | MDRV_CPU_IO_MAP(readport,writeport) |
| 771 | MDRV_CPU_VBLANK_INT(irq0_line_hold,128) | |
| 771 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128) | |
| 772 | 772 | |
| 773 | 773 | /* video hardware */ |
| 774 | 774 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r1877 | r1878 | |
| 804 | 804 | /* basic machine hardware */ |
| 805 | 805 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz?? */ |
| 806 | 806 | MDRV_CPU_PROGRAM_MAP(kodure_readmem,kodure_writemem) |
| 807 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 807 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 808 | 808 | |
| 809 | 809 | MDRV_CPU_ADD(Z80, 3072000) |
| 810 | 810 | /* audio CPU */ /* 3.072 MHz???? */ |
| 811 | 811 | MDRV_CPU_PROGRAM_MAP(soundreadmem,soundwritemem) |
| 812 | 812 | MDRV_CPU_IO_MAP(readport,writeport) |
| 813 | MDRV_CPU_VBLANK_INT(irq0_line_hold,128) | |
| 813 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128) | |
| 814 | 814 | |
| 815 | 815 | /* video hardware */ |
| 816 | 816 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r1877 | r1878 | |
| 846 | 846 | /* basic machine hardware */ |
| 847 | 847 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz?? */ |
| 848 | 848 | MDRV_CPU_PROGRAM_MAP(armedf_readmem,armedf_writemem) |
| 849 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 849 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 850 | 850 | |
| 851 | 851 | MDRV_CPU_ADD(Z80, 3072000) |
| 852 | 852 | /* audio CPU */ /* 3.072 MHz???? */ |
| 853 | 853 | MDRV_CPU_PROGRAM_MAP(soundreadmem,soundwritemem) |
| 854 | 854 | MDRV_CPU_IO_MAP(readport,writeport) |
| 855 | MDRV_CPU_VBLANK_INT(irq0_line_hold,128) | |
| 855 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128) | |
| 856 | 856 | |
| 857 | 857 | /* video hardware */ |
| 858 | 858 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r1877 | r1878 | |
| 888 | 888 | /* basic machine hardware */ |
| 889 | 889 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz?? */ |
| 890 | 890 | MDRV_CPU_PROGRAM_MAP(cclimbr2_readmem,cclimbr2_writemem) |
| 891 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 891 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 892 | 892 | |
| 893 | 893 | MDRV_CPU_ADD(Z80, 3072000) |
| 894 | 894 | /* audio CPU */ /* 3.072 MHz???? */ |
| 895 | 895 | MDRV_CPU_PROGRAM_MAP(cclimbr2_soundreadmem,cclimbr2_soundwritemem) |
| 896 | 896 | MDRV_CPU_IO_MAP(readport,writeport) |
| 897 | MDRV_CPU_VBLANK_INT(irq0_line_hold,128) | |
| 897 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128) | |
| 898 | 898 | |
| 899 | 899 | /* video hardware */ |
| 900 | 900 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r1877 | r1878 | |
| 930 | 930 | /* basic machine hardware */ |
| 931 | 931 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz?? */ |
| 932 | 932 | MDRV_CPU_PROGRAM_MAP(cclimbr2_readmem,legion_writemem) |
| 933 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 933 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 934 | 934 | |
| 935 | 935 | MDRV_CPU_ADD(Z80, 3072000) |
| 936 | 936 | /* audio CPU */ /* 3.072 MHz???? */ |
| 937 | 937 | MDRV_CPU_PROGRAM_MAP(cclimbr2_soundreadmem,cclimbr2_soundwritemem) |
| 938 | 938 | MDRV_CPU_IO_MAP(readport,writeport) |
| 939 | MDRV_CPU_VBLANK_INT(irq0_line_hold,128) | |
| 939 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128) | |
| 940 | 940 | |
| 941 | 941 | /* video hardware */ |
| 942 | 942 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r1877 | r1878 | |
| 972 | 972 | /* basic machine hardware */ |
| 973 | 973 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz?? */ |
| 974 | 974 | MDRV_CPU_PROGRAM_MAP(cclimbr2_readmem,legiono_writemem) |
| 975 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 975 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 976 | 976 | |
| 977 | 977 | MDRV_CPU_ADD(Z80, 3072000) |
| 978 | 978 | /* audio CPU */ /* 3.072 MHz???? */ |
| 979 | 979 | MDRV_CPU_PROGRAM_MAP(cclimbr2_soundreadmem,cclimbr2_soundwritemem) |
| 980 | 980 | MDRV_CPU_IO_MAP(readport,writeport) |
| 981 | MDRV_CPU_VBLANK_INT(irq0_line_hold,128) | |
| 981 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128) | |
| 982 | 982 | |
| 983 | 983 | /* video hardware */ |
| 984 | 984 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r1877 | r1878 | |
|---|---|---|
| 549 | 549 | MDRV_CPU_PROGRAM_MAP(acefruit_map,0) |
| 550 | 550 | MDRV_CPU_IO_MAP(acefruit_io,0) |
| 551 | 551 | MDRV_GFXDECODE(acefruit) |
| 552 | MDRV_CPU_VBLANK_INT(acefruit_vblank | |
| 552 | MDRV_CPU_VBLANK_INT("main", acefruit_vblank | |
| 553 | 553 | |
| 554 | 554 | /* video hardware */ |
| 555 | 555 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 249 | 249 | Jul 27 99 Chad Hendrickson |
| 250 | 250 | * Added cocktail mode flipscreen |
| 251 | 251 | |
| 252 | Donkey Kong Junior Notes | |
| 253 | ======================== | |
| 254 | ||
| 255 | DJR-03 Donkey Kong Modification Kits 02-23-83 | |
| 256 | -------------------------------------------------------------- | |
| 257 | Nintendo Service Department Bulletin # DJR-03 02-23-83 | |
| 258 | GAME: Donkey Kong Junior | |
| 259 | SUBJECT: Play Time | |
| 260 | ||
| 261 | It has come to our attention that play time on Donkey Kong | |
| 262 | Junior is, in some cases, excessive, while in other cases | |
| 263 | there is concern over the ability of players to learn the | |
| 264 | game and thereby retain an interest in playing. | |
| 265 | ||
| 266 | We are making available, through our Nintendo Distributors, | |
| 267 | two EPROM change kits, designated DJR1-E and DJR1-P. | |
| 268 | ||
| 269 | The E kit consists of four (4) chips and is an easier version | |
| 270 | of the program. it presents the board sequence in a way which | |
| 271 | familiarizes the players with the game faster. The board | |
| 272 | order is vines, springboard, Mario's hideout and keys. | |
| 273 | ||
| 274 | The P kit is a more difficult version consisting of two chips. | |
| 275 | The order remains the same while more and faster | |
| 276 | obstacles (snapjaws, nitpickers, etc.) are presented. | |
| 277 | -------------------------------------------------------------- | |
| 278 | ||
| 279 | E-Kit - roms | |
| 280 | ------------------------------------------------ | |
| 281 | Filename Label Type Loc/PCB CSum | |
| 282 | ----------- -------------- ------ ------- ---- -- | |
| 283 | 2732.5Ae DJR1-C-5A e 2732 5A(CPU) 68E9 | |
| 284 | 2764.5Be DJR1-C-5B e 2764 5B(CPU) B0CF | |
| 285 | 2764.5Ce DJR1-C-5C e 2764 5C(CPU) FC64 | |
| 286 | 2764.5Ee DJR1-C-5E e 2764 5E(CPU) 7CC6 | |
| 287 | ------------------------------------------------ | |
| 288 | ||
| 289 | P-Kit roms (Still looking for these, suffix is | |
| 290 | more than likely P. :) | |
| 291 | ------------------------------------------------ | |
| 292 | Filename Label Type Loc/PCB CSum | |
| 293 | ----------- -------------- ------ ------- ---- -- | |
| 294 | empty --------- ---- 5A(CPU) ---- | |
| 295 | 2764.5Bp DJR1-C-5B p 2764 5B(CPU) 1B58 | |
| 296 | 2764.5Cp DJR1-C-5C p 2764 5C(CPU) F4FE | |
| 297 | ------------------------------------------------ | |
| 298 | ||
| 252 | 299 | ***************************************************************************/ |
| 253 | 300 | |
| 254 | 301 | #include "driver.h" |
| 255 | #include "deprecat.h" | |
| 256 | 302 | #include "cpu/s2650/s2650.h" |
| 257 | 303 | #include "cpu/m6502/m6502.h" |
| 258 | 304 | #include "includes/dkong.h" |
| 259 | 305 | #include "machine/8257dma.h" |
| 260 | 306 | #include "machine/z80dma.h" |
| 261 | 307 | |
| 308 | #include "deprecat.h" | |
| 309 | ||
| 262 | 310 | /************************************* |
| 263 | 311 | * |
| 264 | 312 | * Defines |
| r1877 | r1878 | |
| 278 | 326 | static void hb_dma_write_byte(int channel, offs_t offset, UINT8 data); |
| 279 | 327 | static UINT8 dk_dma_read_byte(int channel, offs_t offset); |
| 280 | 328 | static void dk_dma_write_byte(int channel, offs_t offset, UINT8 data); |
| 281 | static UINT8 dk3_dma_read_byte(offs_t offset); | |
| 282 | static void dk3_dma_write_byte(offs_t offset, UINT8 data); | |
| 329 | static Z80DMA_READ(dk3_dma_read_byte); | |
| 330 | static Z80DMA_WRITE(dk3_dma_write_byte); | |
| 283 | 331 | static UINT8 p8257_ctl_r(void); |
| 284 | 332 | static void p8257_ctl_w(UINT8 data); |
| 285 | 333 | |
| r1877 | r1878 | |
| 289 | 337 | * |
| 290 | 338 | *************************************/ |
| 291 | 339 | |
| 292 | static | |
| 340 | static | |
| 293 | 341 | { |
| 294 | 342 | 0, |
| 295 | 343 | CLOCK_1H, |
| r1877 | r1878 | |
| 395 | 443 | |
| 396 | 444 | static MACHINE_START( dkong3 ) |
| 397 | 445 | { |
| 398 | MACHINE_START_CALL(dkong2b); | |
| 399 | z80dma_init(1); | |
| 400 | z80dma_config(0, &dk3_dma); | |
| 446 | dkong_state *state = machine->driver_data; | |
| 447 | ||
| 448 | state->hardware_type = HARDWARE_TKG04; | |
| 401 | 449 | } |
| 402 | 450 | |
| 403 | 451 | static MACHINE_RESET( dkong ) |
| 404 | 452 | { |
| 405 | ||
| 406 | 453 | dma8257_reset(); |
| 407 | ||
| 408 | 454 | } |
| 409 | 455 | |
| 410 | static MACHINE_RESET( dkong3 ) | |
| 411 | { | |
| 412 | ||
| 413 | z80dma_reset(); | |
| 414 | ||
| 415 | } | |
| 416 | ||
| 417 | 456 | static MACHINE_RESET( strtheat ) |
| 418 | 457 | { |
| 419 | 458 | dkong_state *state = machine->driver_data; |
| r1877 | r1878 | |
| 464 | 503 | cpuintrf_pop_context(); |
| 465 | 504 | } |
| 466 | 505 | |
| 467 | static | |
| 506 | static Z | |
| 468 | 507 | { |
| 469 | 508 | UINT8 result; |
| 470 | 509 | |
| r1877 | r1878 | |
| 475 | 514 | return result; |
| 476 | 515 | } |
| 477 | 516 | |
| 478 | static | |
| 517 | static Z80DMA_WRITE( dk3_dma_write_byte | |
| 479 | 518 | { |
| 480 | 519 | cpuintrf_push_context(0); |
| 481 | 520 | program_write_byte(offset, data); |
| r1877 | r1878 | |
| 566 | 605 | dkongjr_snd_w2(ui_snd-8, (readinputportbytag("TST") & 0x02)>>1); |
| 567 | 606 | #endif |
| 568 | 607 | |
| 569 | r = (readinputportbytag("IN2") & 0xBF) | (dkong_audio_status_r(0) << 6); | |
| 608 | r = (readinputportbytag("IN2") & 0xBF) | (dkong_audio_status_r(machine,0) << 6); | |
| 570 | 609 | coin_counter_w(offset, r >> 7); |
| 571 | 610 | if (r & 0x10) |
| 572 | 611 | r = (r & ~0x10) | 0x80; /* service ==> coint */ |
| r1877 | r1878 | |
| 594 | 633 | |
| 595 | 634 | static READ8_HANDLER( epos_decrypt_rom ) |
| 596 | 635 | { |
| 597 | dkong_state *state = | |
| 636 | dkong_state *state = machine->driver_data; | |
| 598 | 637 | |
| 599 | 638 | if (offset & 0x01) |
| 600 | 639 | { |
| r1877 | r1878 | |
| 623 | 662 | |
| 624 | 663 | static WRITE8_HANDLER( hunchbkd_data_w ) |
| 625 | 664 | { |
| 626 | dkong_state *state = | |
| 665 | dkong_state *state = machine->driver_data; | |
| 627 | 666 | |
| 628 | 667 | state->hunchloopback = data; |
| 629 | 668 | } |
| 630 | 669 | |
| 631 | 670 | static READ8_HANDLER( hunchbkd_port0_r ) |
| 632 | 671 | { |
| 633 | dkong_state *state = | |
| 672 | dkong_state *state = machine->driver_data; | |
| 634 | 673 | #if DEBUG_PROTECTION |
| 635 | 674 | logerror("port 0 : pc = %4x\n",activecpu_get_pc()); |
| 636 | 675 | #endif |
| r1877 | r1878 | |
| 647 | 686 | |
| 648 | 687 | static READ8_HANDLER( hunchbkd_port1_r ) |
| 649 | 688 | { |
| 650 | dkong_state *state = | |
| 689 | dkong_state *state = machine->driver_data; | |
| 651 | 690 | |
| 652 | 691 | return state->hunchloopback; |
| 653 | 692 | } |
| r1877 | r1878 | |
| 701 | 740 | { |
| 702 | 741 | if (data & 1) |
| 703 | 742 | { |
| 704 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 705 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 743 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE); | |
| 744 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, CLEAR_LINE); | |
| 706 | 745 | } |
| 707 | 746 | else |
| 708 | 747 | { |
| 709 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 710 | cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 748 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); | |
| 749 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE); | |
| 711 | 750 | } |
| 712 | 751 | } |
| 713 | 752 | |
| r1877 | r1878 | |
| 1558 | 1597 | /* basic machine hardware */ |
| 1559 | 1598 | MDRV_CPU_ADD_TAG("main", Z80, CLOCK_1H) |
| 1560 | 1599 | MDRV_CPU_PROGRAM_MAP(dkong_map, 0) |
| 1561 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 1600 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 1562 | 1601 | |
| 1563 | 1602 | MDRV_MACHINE_START(dkong2b) |
| 1564 | 1603 | MDRV_MACHINE_RESET(dkong) |
| r1877 | r1878 | |
| 1625 | 1664 | MDRV_CPU_REPLACE("main", S2650, CLOCK_1H / 2) /* ??? */ |
| 1626 | 1665 | MDRV_CPU_PROGRAM_MAP(hunchbkd_map, 0) |
| 1627 | 1666 | MDRV_CPU_IO_MAP(hunchbkd_io_map, 0) |
| 1628 | MDRV_CPU_VBLANK_INT(hunchbkd_interrupt | |
| 1667 | MDRV_CPU_VBLANK_INT("main", hunchbkd_interrupt | |
| 1629 | 1668 | |
| 1630 | 1669 | MDRV_MACHINE_START(hunchbkd) |
| 1631 | 1670 | |
| r1877 | r1878 | |
| 1640 | 1679 | MDRV_CPU_ADD_TAG("main", Z80, XTAL_8MHz / 2) /* verified in schematics */ |
| 1641 | 1680 | MDRV_CPU_PROGRAM_MAP(dkong3_map, 0) |
| 1642 | 1681 | MDRV_CPU_IO_MAP(0, dkong3_io_map) |
| 1643 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 1682 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 1644 | 1683 | |
| 1645 | 1684 | MDRV_MACHINE_START(dkong3) |
| 1646 | MDRV_MACHINE_RESET(dkong3) | |
| 1647 | 1685 | |
| 1686 | MDRV_DEVICE_ADD(Z80DMA_DEV_0_TAG, Z80DMA) | |
| 1687 | MDRV_DEVICE_CONFIG(dk3_dma) | |
| 1688 | ||
| 1648 | 1689 | /* video hardware */ |
| 1649 | 1690 | MDRV_SCREEN_ADD("main", RASTER) |
| 1650 | 1691 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| r1877 | r1878 | |
| 2113 | 2154 | ROM_LOAD( "v-2n.bpr", 0x0200, 0x0100, CRC(dbf185bf) SHA1(2697a991a4afdf079dd0b7e732f71c7618f43b70) ) /* character color codes on a per-column basis */ |
| 2114 | 2155 | ROM_END |
| 2115 | 2156 | |
| 2116 | ROM_START( dkngj | |
| 2157 | ROM_START( dkongj | |
| 2117 | 2158 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) |
| 2118 | 2159 | ROM_LOAD( "djr1-c.5b", 0x0000, 0x1000, CRC(ffe9e1a5) SHA1(715dc79d85169b4c1faf43458592e69b434afefd) ) |
| 2119 | 2160 | ROM_CONTINUE( 0x3000, 0x1000 ) |
| r1877 | r1878 | |
| 2807 | 2848 | GAME( 1982, dkongjrj, dkongjr, dkongjr, dkongjr, 0, ROT90, "Nintendo", "Donkey Kong Jr. (Japan)", GAME_SUPPORTS_SAVE ) |
| 2808 | 2849 | GAME( 1982, dkngjnrj, dkongjr, dkongjr, dkongjr, 0, ROT90, "Nintendo", "Donkey Kong Junior (Japan?)", GAME_SUPPORTS_SAVE ) |
| 2809 | 2850 | GAME( 1982, dkongjrb, dkongjr, dkongjr, dkongjr, 0, ROT90, "bootleg", "Donkey Kong Jr. (bootleg)", GAME_SUPPORTS_SAVE ) |
| 2810 | GAME( 1982, dkngj | |
| 2851 | GAME( 1982, dkongj | |
| 2811 | 2852 | |
| 2812 | 2853 | GAME( 1983, dkong3, 0, dkong3, dkong3, 0, ROT90, "Nintendo of America", "Donkey Kong 3 (US)", GAME_SUPPORTS_SAVE ) |
| 2813 | 2854 | GAME( 1983, dkong3j, dkong3, dkong3, dkong3, 0, ROT90, "Nintendo", "Donkey Kong 3 (Japan)", GAME_SUPPORTS_SAVE ) |
| r1877 | r1878 | |
|---|---|---|
| 200 | 200 | |
| 201 | 201 | static WRITE8_HANDLER( sprint4_screech_1_w ) |
| 202 | 202 | { |
| 203 | discrete_sound_w(SPRINT4_SCREECH_EN_1, offset & 1); | |
| 203 | discrete_sound_w(machine, SPRINT4_SCREECH_EN_1, offset & 1); | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | |
| 207 | 207 | static WRITE8_HANDLER( sprint4_screech_2_w ) |
| 208 | 208 | { |
| 209 | discrete_sound_w(SPRINT4_SCREECH_EN_2, offset & 1); | |
| 209 | discrete_sound_w(machine, SPRINT4_SCREECH_EN_2, offset & 1); | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | |
| 213 | 213 | static WRITE8_HANDLER( sprint4_screech_3_w ) |
| 214 | 214 | { |
| 215 | discrete_sound_w(SPRINT4_SCREECH_EN_3, offset & 1); | |
| 215 | discrete_sound_w(machine, SPRINT4_SCREECH_EN_3, offset & 1); | |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | |
| 219 | 219 | static WRITE8_HANDLER( sprint4_screech_4_w ) |
| 220 | 220 | { |
| 221 | discrete_sound_w(SPRINT4_SCREECH_EN_4, offset & 1); | |
| 221 | discrete_sound_w(machine, SPRINT4_SCREECH_EN_4, offset & 1); | |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | |
| r1877 | r1878 | |
| 226 | 226 | |
| 227 | 227 | static WRITE8_HANDLER( sprint4_bang_w ) |
| 228 | 228 | { |
| 229 | discrete_sound_w(SPRINT4_BANG_DATA, data & 0x0f); | |
| 229 | discrete_sound_w(machine, SPRINT4_BANG_DATA, data & 0x0f); | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | |
| 233 | 233 | static WRITE8_HANDLER( sprint4_attract_w ) |
| 234 | 234 | { |
| 235 | discrete_sound_w(SPRINT4_ATTRACT_EN, data & 1); | |
| 235 | discrete_sound_w(machine, SPRINT4_ATTRACT_EN, data & 1); | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 |
| r1877 | r1878 | |
|---|---|---|
| 216 | 216 | MDRV_CPU_ADD(Z80,18432000/6) /* ??? the main xtal is 18.432 MHz */ |
| 217 | 217 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 218 | 218 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 219 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 219 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 220 | 220 | |
| 221 | 221 | /* video hardware */ |
| 222 | 222 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 418 | 418 | MDRV_CPU_ADD(Z80,18432000/6) /* ??? the main xtal is 18.432 MHz */ |
| 419 | 419 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 420 | 420 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 421 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 421 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 422 | 422 | |
| 423 | 423 | /* video hardware */ |
| 424 | 424 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 263 | 263 | /* basic machine hardware */ |
| 264 | 264 | MDRV_CPU_ADD(M6502, 12096000 / 12) |
| 265 | 265 | MDRV_CPU_PROGRAM_MAP(skyraid_readmem, skyraid_writemem) |
| 266 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 266 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 267 | 267 | |
| 268 | 268 | /* video hardware */ |
| 269 | 269 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 328 | 328 | /* basic machine hardware */ |
| 329 | 329 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz (?) */ |
| 330 | 330 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 331 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 331 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 332 | 332 | |
| 333 | 333 | /* video hardware */ |
| 334 | 334 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 40 | 40 | { |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | static void draw_sprites(running_machine *machine, | |
| 43 | static void draw_sprites(running_machine *machine, | |
| 44 | 44 | { |
| 45 | 45 | int i; |
| 46 | 46 | |
| r1877 | r1878 | |
| 238 | 238 | static MACHINE_DRIVER_START( hanaroku ) |
| 239 | 239 | MDRV_CPU_ADD(Z80,6000000) /* ? MHz */ |
| 240 | 240 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 241 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 241 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 242 | 242 | |
| 243 | 243 | /* video hardware */ |
| 244 | 244 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 320 | 320 | |
| 321 | 321 | MDRV_CPU_ADD(M6809, 1500000) // ? |
| 322 | 322 | MDRV_CPU_PROGRAM_MAP(metlclsh_readmem2, metlclsh_writemem2) |
| 323 | MDRV_CPU_VBLANK_INT(metlclsh_interrupt2,2) | |
| 323 | MDRV_CPU_VBLANK_INT_HACK(metlclsh_interrupt2,2) | |
| 324 | 324 | // IRQ by cpu #1, NMI by coins insertion |
| 325 | 325 | |
| 326 | 326 | MDRV_MACHINE_RESET(metlclsh) |
| r1877 | r1878 | |
|---|---|---|
| 44 | 44 | static WRITE8_HANDLER( bankedram_w ) |
| 45 | 45 | { |
| 46 | 46 | if (palette_selected) |
| 47 | paletteram_xBBBBBGGGGGRRRRR_be_w(offset,data); | |
| 47 | paletteram_xBBBBBGGGGGRRRRR_be_w(machine,offset,data); | |
| 48 | 48 | else |
| 49 | 49 | ram[offset] = data; |
| 50 | 50 | } |
| r1877 | r1878 | |
| 73 | 73 | |
| 74 | 74 | static WRITE8_HANDLER( aliens_sh_irqtrigger_w ) |
| 75 | 75 | { |
| 76 | soundlatch_w(offset,data); | |
| 77 | cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff); | |
| 76 | soundlatch_w(machine,offset,data); | |
| 77 | cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0xff); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | static WRITE8_HANDLER( aliens_snd_bankswitch_w ) |
| r1877 | r1878 | |
| 238 | 238 | /* basic machine hardware */ |
| 239 | 239 | MDRV_CPU_ADD(KONAMI, 3000000) /* ? */ |
| 240 | 240 | MDRV_CPU_PROGRAM_MAP(aliens_map,0) |
| 241 | MDRV_CPU_VBLANK_INT(aliens_interrupt | |
| 241 | MDRV_CPU_VBLANK_INT("main", aliens_interrupt | |
| 242 | 242 | |
| 243 | 243 | MDRV_CPU_ADD(Z80, 3579545) |
| 244 | 244 | MDRV_CPU_PROGRAM_MAP(aliens_sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "deprecat.h" | |
| 10 | 11 | #include "machine/6522via.h" |
| 11 | 12 | #include "cpu/m6809/m6809.h" |
| 12 | 13 | #include "sound/dac.h" |
| r1877 | r1878 | |
| 92 | 93 | /* basic machine hardware */ |
| 93 | 94 | MDRV_CPU_ADD(M6809, 1000000) /* 1 MHz */ |
| 94 | 95 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 95 | MDRV_CPU_VBLANK_INT(beezer_interrupt,128) | |
| 96 | MDRV_CPU_VBLANK_INT_HACK(beezer_interrupt,128) | |
| 96 | 97 | |
| 97 | 98 | MDRV_CPU_ADD(M6809, 1000000) /* 1 MHz */ |
| 98 | 99 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| r1877 | r1878 | |
|---|---|---|
| 40 | 40 | else |
| 41 | 41 | { |
| 42 | 42 | if (zoomreadroms) |
| 43 | return K051316_rom_0_r(offset); | |
| 43 | return K051316_rom_0_r(machine,offset); | |
| 44 | 44 | else |
| 45 | return K051316_0_r(offset); | |
| 45 | return K051316_0_r(machine,offset); | |
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | static WRITE8_HANDLER( bankedram_w ) |
| 50 | 50 | { |
| 51 | 51 | if (videobank) ram[offset] = data; |
| 52 | else K051316_0_w(offset,data); | |
| 52 | else K051316_0_w(machine,offset,data); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | static WRITE8_HANDLER( k88games_5f84_w ) |
| r1877 | r1878 | |
| 279 | 279 | /* basic machine hardware */ |
| 280 | 280 | MDRV_CPU_ADD(KONAMI, 3000000) /* ? */ |
| 281 | 281 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 282 | MDRV_CPU_VBLANK_INT(k88games_interrupt | |
| 282 | MDRV_CPU_VBLANK_INT("main", k88games_interrupt | |
| 283 | 283 | |
| 284 | 284 | MDRV_CPU_ADD(Z80, 3579545) |
| 285 | 285 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 104 | 104 | |
| 105 | 105 | |
| 106 | 106 | UINT8 *ddenlovr_pixmap[8]; |
| 107 | static | |
| 107 | static | |
| 108 | 108 | static int extra_layers; |
| 109 | 109 | |
| 110 | 110 | |
| r1877 | r1878 | |
| 236 | 236 | static WRITE16_HANDLER( ddenlovr16_bgcolor_w ) |
| 237 | 237 | { |
| 238 | 238 | if (ACCESSING_LSB) |
| 239 | ddenlovr_bgcolor_w(offset,data); | |
| 239 | ddenlovr_bgcolor_w(machine,offset,data); | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | |
| r1877 | r1878 | |
| 253 | 253 | static WRITE16_HANDLER( ddenlovr16_priority_w ) |
| 254 | 254 | { |
| 255 | 255 | if (ACCESSING_LSB) |
| 256 | ddenlovr_priority_w(offset,data); | |
| 256 | ddenlovr_priority_w(machine,offset,data); | |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | |
| r1877 | r1878 | |
| 271 | 271 | static WRITE16_HANDLER( ddenlovr16_layer_enable_w ) |
| 272 | 272 | { |
| 273 | 273 | if (ACCESSING_LSB) |
| 274 | ddenlovr_layer_enable_w(offset,data); | |
| 274 | ddenlovr_layer_enable_w(machine,offset,data); | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
| r1877 | r1878 | |
| 1062 | 1062 | break; |
| 1063 | 1063 | |
| 1064 | 1064 | case 0xe4: |
| 1065 | ddenlovr_priority_w(0,data); | |
| 1065 | ddenlovr_priority_w(machine,0,data); | |
| 1066 | 1066 | break; |
| 1067 | 1067 | |
| 1068 | 1068 | case 0xe6: |
| 1069 | ddenlovr_layer_enable_w(0,data); | |
| 1069 | ddenlovr_layer_enable_w(machine,0,data); | |
| 1070 | 1070 | break; |
| 1071 | 1071 | |
| 1072 | 1072 | case 0xe8: |
| r1877 | r1878 | |
| 1171 | 1171 | |
| 1172 | 1172 | static READ16_HANDLER( ddenlovr_gfxrom_r ) |
| 1173 | 1173 | { |
| 1174 | return rongrong_gfxrom_r(offset); | |
| 1174 | return rongrong_gfxrom_r(machine, offset); | |
| 1175 | 1175 | } |
| 1176 | 1176 | |
| 1177 | 1177 | |
| 1178 | 1178 | |
| 1179 | static void copylayer( | |
| 1179 | static void copylayer( | |
| 1180 | 1180 | { |
| 1181 | 1181 | int x,y; |
| 1182 | 1182 | int scrollx = ddenlovr_scroll[layer/4*8 + (layer%4) + 0]; |
| r1877 | r1878 | |
| 1358 | 1358 | /* what were they smoking??? */ |
| 1359 | 1359 | b = ((d1 & 0xe0) >> 5) | (d2 & 0xc0) >> 3; |
| 1360 | 1360 | |
| 1361 | palette_set_color_rgb( | |
| 1361 | palette_set_color_rgb(machine,indx,pal5bit(r),pal5bit(g),pal5bit(b)); | |
| 1362 | 1362 | } |
| 1363 | 1363 | |
| 1364 | 1364 | static WRITE16_HANDLER( ddenlovr_palette_w ) |
| 1365 | 1365 | { |
| 1366 | 1366 | if (ACCESSING_LSB) |
| 1367 | rongrong_palette_w(offset,data & 0xff); | |
| 1367 | rongrong_palette_w(machine,offset,data & 0xff); | |
| 1368 | 1368 | } |
| 1369 | 1369 | |
| 1370 | 1370 | |
| r1877 | r1878 | |
| 1471 | 1471 | |
| 1472 | 1472 | static READ16_HANDLER( unk16_r ) |
| 1473 | 1473 | { |
| 1474 | return unk_r(offset); | |
| 1474 | return unk_r(machine,offset); | |
| 1475 | 1475 | } |
| 1476 | 1476 | |
| 1477 | 1477 | |
| r1877 | r1878 | |
| 1965 | 1965 | |
| 1966 | 1966 | static WRITE8_HANDLER( mmpanic_soundlatch_w ) |
| 1967 | 1967 | { |
| 1968 | soundlatch_w(0,data); | |
| 1969 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1968 | soundlatch_w(machine,0,data); | |
| 1969 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1970 | 1970 | } |
| 1971 | 1971 | |
| 1972 | 1972 | static WRITE8_HANDLER( mmpanic_blitter_w ) |
| r1877 | r1878 | |
| 2503 | 2503 | |
| 2504 | 2504 | static WRITE8_HANDLER( mjchuuka_blitter_w ) |
| 2505 | 2505 | { |
| 2506 | hanakanz_blitter_reg_w(0,offset >> 8); | |
| 2507 | hanakanz_blitter_data_w(0,data); | |
| 2506 | hanakanz_blitter_reg_w(machine,0,offset >> 8); | |
| 2507 | hanakanz_blitter_data_w(machine,0,data); | |
| 2508 | 2508 | } |
| 2509 | 2509 | |
| 2510 | 2510 | static UINT8 mjchuuka_romdata[2]; |
| r1877 | r1878 | |
| 2602 | 2602 | |
| 2603 | 2603 | static ADDRESS_MAP_START( mjchuuka_writeport, ADDRESS_SPACE_IO, 8 ) // 16 bit I/O |
| 2604 | 2604 | AM_RANGE(0x1c, 0x1c) AM_MIRROR(0xff00) AM_WRITE( hanakanz_rombank_w ) |
| 2605 | AM_SPACE(0x20, 0xff) AM_WRITE( mjchuuka_blitter_w ) | |
| 2606 | AM_SPACE(0x21, 0xff) AM_WRITE( mjchuuka_palette_w ) | |
| 2605 | AM_RANGE(0x20, 0x20) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_WRITE( mjchuuka_blitter_w ) | |
| 2606 | AM_RANGE(0x21, 0x21) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_WRITE( mjchuuka_palette_w ) | |
| 2607 | 2607 | AM_RANGE(0x40, 0x40) AM_MIRROR(0xff00) AM_WRITE( mjchuuka_coincounter_w ) |
| 2608 | 2608 | AM_RANGE(0x41, 0x41) AM_MIRROR(0xff00) AM_WRITE( hanakanz_keyb_w ) |
| 2609 | 2609 | AM_RANGE(0x80, 0x80) AM_MIRROR(0xff00) AM_WRITE( OKIM6295_data_0_w ) |
| r1877 | r1878 | |
| 2763 | 2763 | { |
| 2764 | 2764 | UINT8 *rom = memory_region(REGION_CPU1); |
| 2765 | 2765 | if (hginga_rombank & 0x10) |
| 2766 | return hanakanz_rand_r(0); | |
| 2766 | return hanakanz_rand_r(machine,0); | |
| 2767 | 2767 | return rom[0x10000 + 0x8000 * (hginga_rombank & 0x7) + 0xf601 - 0x8000]; |
| 2768 | 2768 | } |
| 2769 | 2769 | |
| r1877 | r1878 | |
| 2931 | 2931 | |
| 2932 | 2932 | static UINT8 hgokou_player_r(int player) |
| 2933 | 2933 | { |
| 2934 | UINT8 hopper_bit = ((hgokou_hopper && !( | |
| 2934 | UINT8 hopper_bit = ((hgokou_hopper && !(vid | |
| 2935 | 2935 | |
| 2936 | 2936 | if (!(ddenlovr_select2 & 0x01)) return readinputport(player * 5 + 1) | hopper_bit; |
| 2937 | 2937 | if (!(ddenlovr_select2 & 0x02)) return readinputport(player * 5 + 2) | hopper_bit; |
| r1877 | r1878 | |
| 2985 | 2985 | { |
| 2986 | 2986 | UINT8 *rom = memory_region(REGION_CPU1); |
| 2987 | 2987 | if (hginga_rombank == 0) |
| 2988 | return hanakanz_rand_r(0); | |
| 2988 | return hanakanz_rand_r(machine,0); | |
| 2989 | 2989 | return rom[0x10000 + 0x8000 * (hginga_rombank & 0x7) + 0xe601 - 0x8000]; |
| 2990 | 2990 | } |
| 2991 | 2991 | |
| r1877 | r1878 | |
| 5931 | 5931 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 5932 | 5932 | INPUT_PORTS_END |
| 5933 | 5933 | |
| 5934 | #ifdef UNUSED_DEFINITION | |
| 5934 | 5935 | static INPUT_PORTS_START( mjmyuniv ) |
| 5935 | 5936 | PORT_START // IN0 - Coins + Service Keys |
| 5936 | 5937 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out |
| r1877 | r1878 | |
| 6111 | 6112 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 6112 | 6113 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 6113 | 6114 | INPUT_PORTS_END |
| 6115 | #endif | |
| 6114 | 6116 | |
| 6115 | 6117 | static INPUT_PORTS_START( akamaru ) |
| 6116 | 6118 | PORT_START // IN0 - Player 1 |
| r1877 | r1878 | |
| 6523 | 6525 | /* basic machine hardware */ |
| 6524 | 6526 | MDRV_CPU_ADD_TAG("main",M68000,24000000 / 2) |
| 6525 | 6527 | MDRV_CPU_PROGRAM_MAP(ddenlovr_readmem,ddenlovr_writemem) |
| 6526 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 6528 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 6527 | 6529 | |
| 6528 | 6530 | /* video hardware */ |
| 6529 | 6531 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 6638 | 6640 | MDRV_CPU_ADD_TAG("main", Z80, 8000000) /* ? */ |
| 6639 | 6641 | MDRV_CPU_PROGRAM_MAP(quizchq_readmem,quizchq_writemem) |
| 6640 | 6642 | MDRV_CPU_IO_MAP(quizchq_readport,quizchq_writeport) |
| 6641 | MDRV_CPU_VBLANK_INT(quizchq_irq | |
| 6643 | MDRV_CPU_VBLANK_INT("main", quizchq_irq | |
| 6642 | 6644 | |
| 6643 | 6645 | /* video hardware */ |
| 6644 | 6646 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 6708 | 6710 | MDRV_CPU_ADD_TAG("main", Z80, 8000000) |
| 6709 | 6711 | MDRV_CPU_PROGRAM_MAP(mmpanic_readmem,mmpanic_writemem) |
| 6710 | 6712 | MDRV_CPU_IO_MAP(mmpanic_readport,mmpanic_writeport) |
| 6711 | MDRV_CPU_VBLANK_INT(mmpanic_irq | |
| 6713 | MDRV_CPU_VBLANK_INT("main", mmpanic_irq | |
| 6712 | 6714 | |
| 6713 | 6715 | MDRV_CPU_ADD_TAG("sound", Z80, 3579545) |
| 6714 | 6716 | MDRV_CPU_PROGRAM_MAP(mmpanic_sound_readmem,mmpanic_sound_writemem) |
| 6715 | 6717 | MDRV_CPU_IO_MAP(mmpanic_sound_readport,mmpanic_sound_writeport) |
| 6716 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 6718 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 6717 | 6719 | |
| 6718 | 6720 | /* video hardware */ |
| 6719 | 6721 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 6777 | 6779 | MDRV_CPU_ADD_TAG("main",Z80,8000000) // TMPZ84C015BF-8 |
| 6778 | 6780 | MDRV_CPU_PROGRAM_MAP(hanakanz_readmem,hanakanz_writemem) |
| 6779 | 6781 | MDRV_CPU_IO_MAP(hanakanz_readport,hanakanz_writeport) |
| 6780 | MDRV_CPU_VBLANK_INT(hanakanz_irq | |
| 6782 | MDRV_CPU_VBLANK_INT("main", hanakanz_irq | |
| 6781 | 6783 | |
| 6782 | 6784 | /* video hardware */ |
| 6783 | 6785 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 6850 | 6852 | MDRV_IMPORT_FROM( hanakanz ) |
| 6851 | 6853 | MDRV_CPU_MODIFY("main") |
| 6852 | 6854 | MDRV_CPU_IO_MAP(mjchuuka_readport,mjchuuka_writeport) |
| 6853 | MDRV_CPU_VBLANK_INT(mjchuuka_irq | |
| 6855 | MDRV_CPU_VBLANK_INT("main", mjchuuka_irq | |
| 6854 | 6856 | |
| 6855 | 6857 | MDRV_SOUND_ADD(AY8910, 1789772) |
| 6856 | 6858 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| r1877 | r1878 | |
| 6863 | 6865 | MDRV_CPU_MODIFY("main") |
| 6864 | 6866 | MDRV_CPU_PROGRAM_MAP(funkyfig_readmem,funkyfig_writemem) |
| 6865 | 6867 | MDRV_CPU_IO_MAP(funkyfig_readport,funkyfig_writeport) |
| 6866 | MDRV_CPU_VBLANK_INT(mjchuuka_irq | |
| 6868 | MDRV_CPU_VBLANK_INT("main", mjchuuka_irq | |
| 6867 | 6869 | |
| 6868 | 6870 | MDRV_CPU_MODIFY("sound") |
| 6869 | 6871 | MDRV_CPU_IO_MAP(funkyfig_sound_readport,mmpanic_sound_writeport) |
| r1877 | r1878 | |
| 6922 | 6924 | MDRV_CPU_MODIFY("main") |
| 6923 | 6925 | MDRV_CPU_PROGRAM_MAP(mjmyster_readmem,mjmyster_writemem) |
| 6924 | 6926 | MDRV_CPU_IO_MAP(mjmyster_readport,mjmyster_writeport) |
| 6925 | MDRV_CPU_VBLANK_INT(mjmyster_irq, 2) | |
| 6927 | MDRV_CPU_VBLANK_INT_HACK(mjmyster_irq, 2) | |
| 6926 | 6928 | MDRV_CPU_PERIODIC_INT(rtc_nmi_irq, 1) |
| 6927 | 6929 | |
| 6928 | 6930 | MDRV_SOUND_ADD(AY8910, 3579545) |
| r1877 | r1878 | |
| 6969 | 6971 | MDRV_CPU_MODIFY("main") |
| 6970 | 6972 | MDRV_CPU_PROGRAM_MAP(hginga_readmem,hginga_writemem) |
| 6971 | 6973 | MDRV_CPU_IO_MAP(hginga_readport,hginga_writeport) |
| 6972 | MDRV_CPU_VBLANK_INT(hginga_irq | |
| 6974 | MDRV_CPU_VBLANK_INT("main", hginga_irq | |
| 6973 | 6975 | |
| 6974 | 6976 | MDRV_SOUND_ADD(AY8910, 3579545) |
| 6975 | 6977 | MDRV_SOUND_CONFIG(hginga_ay8910_interface) |
| r1877 | r1878 | |
| 6982 | 6984 | MDRV_CPU_MODIFY("main") |
| 6983 | 6985 | MDRV_CPU_PROGRAM_MAP(hgokou_readmem,hgokou_writemem) |
| 6984 | 6986 | MDRV_CPU_IO_MAP(hgokou_readport,hgokou_writeport) |
| 6985 | MDRV_CPU_VBLANK_INT(hginga_irq | |
| 6987 | MDRV_CPU_VBLANK_INT("main", hginga_irq | |
| 6986 | 6988 | |
| 6987 | 6989 | MDRV_SOUND_ADD(AY8910, 3579545) |
| 6988 | 6990 | MDRV_SOUND_CONFIG(hginga_ay8910_interface) |
| r1877 | r1878 | |
| 7003 | 7005 | MDRV_CPU_MODIFY("main") |
| 7004 | 7006 | MDRV_CPU_PROGRAM_MAP(mjmyster_readmem,mjmyster_writemem) |
| 7005 | 7007 | MDRV_CPU_IO_MAP(mjmyster_readport,mjmyster_writeport) |
| 7006 | MDRV_CPU_VBLANK_INT(mjmyster_irq, 2) | |
| 7008 | MDRV_CPU_VBLANK_INT_HACK(mjmyster_irq, 2) | |
| 7007 | 7009 | MDRV_CPU_PERIODIC_INT(rtc_nmi_irq, 1) |
| 7008 | 7010 | |
| 7009 | 7011 | MDRV_SOUND_ADD(AY8910, 1789772) |
| r1877 | r1878 | |
| 7016 | 7018 | MDRV_IMPORT_FROM( quizchq ) |
| 7017 | 7019 | MDRV_CPU_MODIFY("main") |
| 7018 | 7020 | MDRV_CPU_IO_MAP(mjmyster_readport,mjmyster_writeport) |
| 7019 | MDRV_CPU_VBLANK_INT(mjmyster_irq, 2) | |
| 7021 | MDRV_CPU_VBLANK_INT_HACK(mjmyster_irq, 2) | |
| 7020 | 7022 | MDRV_CPU_PERIODIC_INT(rtc_nmi_irq, 1) |
| 7021 | 7023 | |
| 7022 | 7024 | MDRV_SOUND_ADD(AY8910, 1789772) |
| r1877 | r1878 | |
| 7047 | 7049 | MDRV_CPU_MODIFY("main") |
| 7048 | 7050 | MDRV_CPU_PROGRAM_MAP(rongrong_readmem,rongrong_writemem) |
| 7049 | 7051 | MDRV_CPU_IO_MAP(mjflove_readport,mjflove_writeport) |
| 7050 | MDRV_CPU_VBLANK_INT(mjflove_irq, 2) | |
| 7052 | MDRV_CPU_VBLANK_INT_HACK(mjflove_irq, 2) | |
| 7051 | 7053 | |
| 7052 | 7054 | MDRV_VIDEO_START(mjflove) // blitter commands in the roms are shuffled around |
| 7053 | 7055 | |
| r1877 | r1878 | |
| 7068 | 7070 | MDRV_CPU_MODIFY("main") |
| 7069 | 7071 | MDRV_CPU_PROGRAM_MAP(hparadis_readmem,hparadis_writemem) |
| 7070 | 7072 | MDRV_CPU_IO_MAP(hparadis_readport,hparadis_writeport) |
| 7071 | MDRV_CPU_VBLANK_INT(hparadis_irq | |
| 7073 | MDRV_CPU_VBLANK_INT("main", hparadis_irq | |
| 7072 | 7074 | MACHINE_DRIVER_END |
| 7073 | 7075 | |
| 7074 | 7076 |
| r1877 | r1878 | |
|---|---|---|
| 147 | 147 | |
| 148 | 148 | static WRITE8_HANDLER( chinagat_cpu_sound_cmd_w ) |
| 149 | 149 | { |
| 150 | soundlatch_w( offset, data ); | |
| 151 | cpunum_set_input_line(Machine, 2, sound_irq, (sound_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE ); | |
| 150 | soundlatch_w( machine, offset, data ); | |
| 151 | cpunum_set_input_line(machine, 2, sound_irq, (sound_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE ); | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | static READ8_HANDLER( saiyugb1_mcu_command_r ) |
| r1877 | r1878 | |
| 495 | 495 | /* basic machine hardware */ |
| 496 | 496 | MDRV_CPU_ADD(HD6309,12000000/2) /* 1.5 MHz (12MHz oscillator ???) */ |
| 497 | 497 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 498 | MDRV_CPU_VBLANK_INT(chinagat_interrupt | |
| 498 | MDRV_CPU_VBLANK_INT("main", chinagat_interrupt | |
| 499 | 499 | |
| 500 | 500 | MDRV_CPU_ADD(HD6309,12000000/2) /* 1.5 MHz (12MHz oscillator ???) */ |
| 501 | 501 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| r1877 | r1878 | |
| 539 | 539 | /* basic machine hardware */ |
| 540 | 540 | MDRV_CPU_ADD(M6809,12000000/8) /* 68B09EP 1.5 MHz (12MHz oscillator) */ |
| 541 | 541 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 542 | MDRV_CPU_VBLANK_INT(chinagat_interrupt | |
| 542 | MDRV_CPU_VBLANK_INT("main", chinagat_interrupt | |
| 543 | 543 | |
| 544 | 544 | MDRV_CPU_ADD(M6809,12000000/8) /* 68B09EP 1.5 MHz (12MHz oscillator) */ |
| 545 | 545 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| r1877 | r1878 | |
| 587 | 587 | /* basic machine hardware */ |
| 588 | 588 | MDRV_CPU_ADD(M6809,12000000/8) /* 1.5 MHz (12MHz oscillator) */ |
| 589 | 589 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 590 | MDRV_CPU_VBLANK_INT(chinagat_interrupt | |
| 590 | MDRV_CPU_VBLANK_INT("main", chinagat_interrupt | |
| 591 | 591 | |
| 592 | 592 | MDRV_CPU_ADD(M6809,12000000/8) /* 1.5 MHz (12MHz oscillator) */ |
| 593 | 593 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 272 | 272 | { |
| 273 | 273 | if (ACCESSING_MSB) |
| 274 | 274 | { |
| 275 | soundlatch_w(0, (data & 0xff00) >> 8 ); | |
| 276 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 275 | soundlatch_w(machine, 0, (data & 0xff00) >> 8 ); | |
| 276 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | |
| r1877 | r1878 | |
| 282 | 282 | static READ16_HANDLER( kaneko16_YM2149_0_r ) |
| 283 | 283 | { |
| 284 | 284 | /* Each 2149 register is mapped to a different address */ |
| 285 | AY8910_control_port_0_w(0,offset); | |
| 286 | return AY8910_read_port_0_r(0); | |
| 285 | AY8910_control_port_0_w(machine,0,offset); | |
| 286 | return AY8910_read_port_0_r(machine,0); | |
| 287 | 287 | } |
| 288 | 288 | static READ16_HANDLER( kaneko16_YM2149_1_r ) |
| 289 | 289 | { |
| 290 | 290 | /* Each 2149 register is mapped to a different address */ |
| 291 | AY8910_control_port_1_w(0,offset); | |
| 292 | return AY8910_read_port_1_r(0); | |
| 291 | AY8910_control_port_1_w(machine,0,offset); | |
| 292 | return AY8910_read_port_1_r(machine,0); | |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | static WRITE16_HANDLER( kaneko16_YM2149_0_w ) |
| 296 | 296 | { |
| 297 | 297 | /* Each 2149 register is mapped to a different address */ |
| 298 | AY8910_control_port_0_w(0,offset); | |
| 298 | AY8910_control_port_0_w(machine,0,offset); | |
| 299 | 299 | /* The registers are mapped to odd addresses, except one! */ |
| 300 | if (ACCESSING_LSB) AY8910_write_port_0_w(0, data & 0xff); | |
| 301 | else AY8910_write_port_0_w(0,(data >> 8) & 0xff); | |
| 300 | if (ACCESSING_LSB) AY8910_write_port_0_w(machine,0, data & 0xff); | |
| 301 | else AY8910_write_port_0_w(machine,0,(data >> 8) & 0xff); | |
| 302 | 302 | } |
| 303 | 303 | static WRITE16_HANDLER( kaneko16_YM2149_1_w ) |
| 304 | 304 | { |
| 305 | 305 | /* Each 2149 register is mapped to a different address */ |
| 306 | AY8910_control_port_1_w(0,offset); | |
| 306 | AY8910_control_port_1_w(machine,0,offset); | |
| 307 | 307 | /* The registers are mapped to odd addresses, except one! */ |
| 308 | if (ACCESSING_LSB) AY8910_write_port_1_w(0, data & 0xff); | |
| 309 | else AY8910_write_port_1_w(0,(data >> 8) & 0xff); | |
| 308 | if (ACCESSING_LSB) AY8910_write_port_1_w(machine,0, data & 0xff); | |
| 309 | else AY8910_write_port_1_w(machine,0,(data >> 8) & 0xff); | |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | |
| r1877 | r1878 | |
| 631 | 631 | { |
| 632 | 632 | if (ACCESSING_LSB) |
| 633 | 633 | { |
| 634 | OKIM6295_data_0_w(0,data); | |
| 634 | OKIM6295_data_0_w(machine,0,data); | |
| 635 | 635 | // logerror("CPU #0 PC %06X : OKI0 <- %08X\n",activecpu_get_pc(),data); |
| 636 | 636 | } |
| 637 | 637 | } |
| r1877 | r1878 | |
| 640 | 640 | { |
| 641 | 641 | if (ACCESSING_LSB) |
| 642 | 642 | { |
| 643 | OKIM6295_data_1_w(0,data); | |
| 643 | OKIM6295_data_1_w(machine,0,data); | |
| 644 | 644 | // logerror("CPU #0 PC %06X : OKI1 <- %08X\n",activecpu_get_pc(),data); |
| 645 | 645 | } |
| 646 | 646 | } |
| r1877 | r1878 | |
| 1680 | 1680 | /* basic machine hardware */ |
| 1681 | 1681 | MDRV_CPU_ADD(M68000, 12000000) /* MC68000P12 */ |
| 1682 | 1682 | MDRV_CPU_PROGRAM_MAP(berlwall,0) |
| 1683 | MDRV_CPU_VBLANK_INT(kaneko16_interrupt,KANEKO16_INTERRUPTS_NUM) | |
| 1683 | MDRV_CPU_VBLANK_INT_HACK(kaneko16_interrupt,KANEKO16_INTERRUPTS_NUM) | |
| 1684 | 1684 | |
| 1685 | 1685 | MDRV_MACHINE_RESET(berlwall) |
| 1686 | 1686 | |
| r1877 | r1878 | |
| 1727 | 1727 | /* basic machine hardware */ |
| 1728 | 1728 | MDRV_CPU_ADD(M68000, XTAL_12MHz) /* verified on pcb */ |
| 1729 | 1729 | MDRV_CPU_PROGRAM_MAP(bakubrkr,0) |
| 1730 | MDRV_CPU_VBLANK_INT(kaneko16_interrupt,KANEKO16_INTERRUPTS_NUM) | |
| 1730 | MDRV_CPU_VBLANK_INT_HACK(kaneko16_interrupt,KANEKO16_INTERRUPTS_NUM) | |
| 1731 | 1731 | |
| 1732 | 1732 | MDRV_MACHINE_RESET(bakubrkr) |
| 1733 | 1733 | MDRV_NVRAM_HANDLER(93C46) |
| r1877 | r1878 | |
| 1783 | 1783 | /* basic machine hardware */ |
| 1784 | 1784 | MDRV_CPU_ADD(M68000,12000000) /* TMP68HC000-12 */ |
| 1785 | 1785 | MDRV_CPU_PROGRAM_MAP(blazeon,0) |
| 1786 | MDRV_CPU_VBLANK_INT(kaneko16_interrupt,KANEKO16_INTERRUPTS_NUM) | |
| 1786 | MDRV_CPU_VBLANK_INT_HACK(kaneko16_interrupt,KANEKO16_INTERRUPTS_NUM) | |
| 1787 | 1787 | |
| 1788 | 1788 | MDRV_CPU_ADD(Z80,4000000) /* D780C-2 */ |
| 1789 | 1789 | MDRV_CPU_PROGRAM_MAP(blazeon_soundmem,0) |
| r1877 | r1878 | |
| 1834 | 1834 | static MACHINE_DRIVER_START( gtmr ) |
| 1835 | 1835 | |
| 1836 | 1836 | /* basic machine hardware */ |
| 1837 | MDRV_CPU_ADD_TAG("gtmr", M68000, 16 | |
| 1837 | MDRV_CPU_ADD_TAG("gtmr", M68000, XTAL_16MHz | |
| 1838 | 1838 | MDRV_CPU_PROGRAM_MAP(gtmr_readmem,gtmr_writemem) |
| 1839 | MDRV_CPU_VBLANK_INT(kaneko16_interrupt,KANEKO16_INTERRUPTS_NUM) | |
| 1839 | MDRV_CPU_VBLANK_INT_HACK(kaneko16_interrupt,KANEKO16_INTERRUPTS_NUM) | |
| 1840 | 1840 | |
| 1841 | 1841 | MDRV_MACHINE_RESET(gtmr) |
| 1842 | 1842 | |
| r1877 | r1878 | |
| 1859 | 1859 | /* sound hardware */ |
| 1860 | 1860 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1861 | 1861 | |
| 1862 | MDRV_SOUND_ADD(OKIM6295, 1980000) | |
| 1863 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7low) // clock frequency & pin 7 not verified | |
| 1862 | MDRV_SOUND_ADD(OKIM6295, XTAL_16MHz/8) /* verified on pcb */ | |
| 1863 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7low) /* verified on pcb */ | |
| 1864 | 1864 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) |
| 1865 | 1865 | |
| 1866 | MDRV_SOUND_ADD(OKIM6295, 1980000) | |
| 1867 | MDRV_SOUND_CONFIG(okim6295_interface_region_2_pin7low) // clock frequency & pin 7 not verified | |
| 1866 | MDRV_SOUND_ADD(OKIM6295, XTAL_16MHz/8) /* verified on pcb */ | |
| 1867 | MDRV_SOUND_CONFIG(okim6295_interface_region_2_pin7low) /* verified on pcb */ | |
| 1868 | 1868 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) |
| 1869 | 1869 | MACHINE_DRIVER_END |
| 1870 | 1870 | |
| r1877 | r1878 | |
| 1914 | 1914 | MDRV_IMPORT_FROM(gtmr) |
| 1915 | 1915 | MDRV_CPU_MODIFY("gtmr") |
| 1916 | 1916 | MDRV_CPU_PROGRAM_MAP(bonkadv,0) |
| 1917 | MDRV_CPU_VBLANK_INT(kaneko16_interrupt,KANEKO16_INTERRUPTS_NUM + 1 ) // comment above | |
| 1917 | MDRV_CPU_VBLANK_INT_HACK(kaneko16_interrupt,KANEKO16_INTERRUPTS_NUM + 1 ) // comment above | |
| 1918 | 1918 | |
| 1919 | 1919 | MDRV_MACHINE_RESET( bonkadv ) |
| 1920 | 1920 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
| 1928 | 1928 | /* basic machine hardware */ |
| 1929 | 1929 | MDRV_CPU_ADD(M68000, XTAL_12MHz) /* verified on pcb */ |
| 1930 | 1930 | MDRV_CPU_PROGRAM_MAP(mgcrystl,0) |
| 1931 | MDRV_CPU_VBLANK_INT(kaneko16_interrupt,KANEKO16_INTERRUPTS_NUM) | |
| 1931 | MDRV_CPU_VBLANK_INT_HACK(kaneko16_interrupt,KANEKO16_INTERRUPTS_NUM) | |
| 1932 | 1932 | |
| 1933 | 1933 | MDRV_MACHINE_RESET(mgcrystl) |
| 1934 | 1934 | MDRV_NVRAM_HANDLER(93C46) |
| r1877 | r1878 | |
| 1998 | 1998 | /* basic machine hardware */ |
| 1999 | 1999 | MDRV_CPU_ADD(M68000, 12000000) |
| 2000 | 2000 | MDRV_CPU_PROGRAM_MAP(shogwarr,0) |
| 2001 | MDRV_CPU_VBLANK_INT(shogwarr_interrupt,SHOGWARR_INTERRUPTS_NUM) | |
| 2001 | MDRV_CPU_VBLANK_INT_HACK(shogwarr_interrupt,SHOGWARR_INTERRUPTS_NUM) | |
| 2002 | 2002 | |
| 2003 | 2003 | MDRV_MACHINE_RESET(shogwarr) |
| 2004 | 2004 |
| r1877 | r1878 | |
|---|---|---|
| 287 | 287 | MDRV_CPU_ADD(Z80, 3579545)//(4000000?) |
| 288 | 288 | MDRV_CPU_PROGRAM_MAP(map,0) |
| 289 | 289 | MDRV_CPU_IO_MAP(readport,0) |
| 290 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 290 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 291 | 291 | |
| 292 | 292 | /* video hardware */ |
| 293 | 293 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 323 | 323 | MDRV_CPU_ADD(Z80, 3579545)//(4000000?) |
| 324 | 324 | MDRV_CPU_PROGRAM_MAP(map,0) |
| 325 | 325 | MDRV_CPU_IO_MAP(readport,0) |
| 326 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 326 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 327 | 327 | |
| 328 | 328 | /* video hardware */ |
| 329 | 329 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 358 | 358 | MDRV_CPU_ADD(Z80, 3579545)//(4000000?) |
| 359 | 359 | MDRV_CPU_PROGRAM_MAP(map,0) |
| 360 | 360 | MDRV_CPU_IO_MAP(readport,0) |
| 361 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 361 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 362 | 362 | |
| 363 | 363 | /* video hardware */ |
| 364 | 364 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 130 | 130 | |
| 131 | 131 | static WRITE16_HANDLER( dbz_sound_command_w ) |
| 132 | 132 | { |
| 133 | soundlatch_w(0, data>>8); | |
| 133 | soundlatch_w(machine, 0, data>>8); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | static WRITE16_HANDLER( dbz_sound_cause_nmi ) |
| r1877 | r1878 | |
| 439 | 439 | /* basic machine hardware */ |
| 440 | 440 | MDRV_CPU_ADD(M68000, 16000000) |
| 441 | 441 | MDRV_CPU_PROGRAM_MAP(dbz_readmem,dbz_writemem) |
| 442 | MDRV_CPU_VBLANK_INT(dbz_interrupt,2) | |
| 442 | MDRV_CPU_VBLANK_INT_HACK(dbz_interrupt,2) | |
| 443 | 443 | |
| 444 | 444 | MDRV_CPU_ADD(Z80, 4000000) |
| 445 | 445 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 565 | 565 | static MACHINE_DRIVER_START( cybertnk ) |
| 566 | 566 | MDRV_CPU_ADD(M68000,20000000/2) |
| 567 | 567 | MDRV_CPU_PROGRAM_MAP(master_mem,0) |
| 568 | MDRV_CPU_VBLANK_INT(master_irq,2) | |
| 568 | MDRV_CPU_VBLANK_INT_HACK(master_irq,2) | |
| 569 | 569 | |
| 570 | 570 | MDRV_CPU_ADD(M68000,20000000/2) |
| 571 | 571 | MDRV_CPU_PROGRAM_MAP(slave_mem,0) |
| 572 | MDRV_CPU_VBLANK_INT(slave_irq,2) | |
| 572 | MDRV_CPU_VBLANK_INT_HACK(slave_irq,2) | |
| 573 | 573 | |
| 574 | 574 | MDRV_CPU_ADD(Z80,3579500) |
| 575 | 575 | MDRV_CPU_PROGRAM_MAP(sound_mem,0) |
| r1877 | r1878 | |
|---|---|---|
| 379 | 379 | /* basic machine hardware */ |
| 380 | 380 | MDRV_CPU_ADD( PSXCPU, XTAL_101_4912MHz ) |
| 381 | 381 | MDRV_CPU_PROGRAM_MAP( namcos10_map, 0 ) |
| 382 | MDRV_CPU_VBLANK_INT( psx_vblank | |
| 382 | MDRV_CPU_VBLANK_INT("main", psx_vblank | |
| 383 | 383 | |
| 384 | 384 | MDRV_MACHINE_RESET( namcos10 ) |
| 385 | 385 |
| r1877 | r1878 | |
|---|---|---|
| 110 | 110 | |
| 111 | 111 | static WRITE8_HANDLER( wc90_sound_command_w ) |
| 112 | 112 | { |
| 113 | soundlatch_w(offset,data); | |
| 114 | cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 113 | soundlatch_w(machine,offset,data); | |
| 114 | cpunum_set_input_line(machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| r1877 | r1878 | |
| 348 | 348 | /* basic machine hardware */ |
| 349 | 349 | MDRV_CPU_ADD(Z80, 6000000) /* 6.0 MHz ??? */ |
| 350 | 350 | MDRV_CPU_PROGRAM_MAP(wc90_readmem1,wc90_writemem1) |
| 351 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 351 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 352 | 352 | |
| 353 | 353 | MDRV_CPU_ADD(Z80, 6000000) /* 6.0 MHz ??? */ |
| 354 | 354 | MDRV_CPU_PROGRAM_MAP(wc90_readmem2,wc90_writemem2) |
| 355 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 355 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 356 | 356 | |
| 357 | 357 | MDRV_CPU_ADD(Z80, 4000000) |
| 358 | 358 | /* audio CPU */ /* 4 MHz ???? */ |
| r1877 | r1878 | |
|---|---|---|
| 168 | 168 | if (scanline & 32) |
| 169 | 169 | atarigen_6502_irq_gen(machine, 0); |
| 170 | 170 | else |
| 171 | atarigen_6502_irq_ack_r(0); | |
| 171 | atarigen_6502_irq_ack_r(machine, 0); | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | |
| r1877 | r1878 | |
| 273 | 273 | |
| 274 | 274 | case 1: /* speech write, bit D7, active low */ |
| 275 | 275 | if (((data ^ last_speech_write) & 0x80) && (data & 0x80)) |
| 276 | tms5220_data_w(0, speech_val); | |
| 276 | tms5220_data_w(machine, 0, speech_val); | |
| 277 | 277 | last_speech_write = data; |
| 278 | 278 | break; |
| 279 | 279 | |
| r1877 | r1878 | |
| 532 | 532 | /* basic machine hardware */ |
| 533 | 533 | MDRV_CPU_ADD(M68010, ATARI_CLOCK_14MHz/2) |
| 534 | 534 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 535 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 535 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 536 | 536 | |
| 537 | 537 | MDRV_CPU_ADD(M6502, ATARI_CLOCK_14MHz/8) |
| 538 | 538 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 275 | 275 | |
| 276 | 276 | static WRITE32_HANDLER( ms32_sound_w ) |
| 277 | 277 | { |
| 278 | soundlatch_w(0, data & 0xff); | |
| 279 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 278 | soundlatch_w(machine,0, data & 0xff); | |
| 279 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 280 | 280 | |
| 281 | 281 | // give the Z80 time to respond |
| 282 | 282 | cpu_spinuntil_time(ATTOTIME_IN_USEC(40)); |
| r1877 | r1878 | |
| 1306 | 1306 | |
| 1307 | 1307 | static READ8_HANDLER( latch_r ) |
| 1308 | 1308 | { |
| 1309 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 1310 | return soundlatch_r(0)^0xff; | |
| 1309 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 1310 | return soundlatch_r(machine,0)^0xff; | |
| 1311 | 1311 | } |
| 1312 | 1312 | |
| 1313 | 1313 | static WRITE8_HANDLER( ms32_snd_bank_w ) |
| r1877 | r1878 | |
| 1366 | 1366 | /* basic machine hardware */ |
| 1367 | 1367 | MDRV_CPU_ADD(V70, 20000000) // 20MHz |
| 1368 | 1368 | MDRV_CPU_PROGRAM_MAP(ms32_readmem,ms32_writemem) |
| 1369 | MDRV_CPU_VBLANK_INT(ms32_interrupt,32) | |
| 1369 | MDRV_CPU_VBLANK_INT_HACK(ms32_interrupt,32) | |
| 1370 | 1370 | |
| 1371 | 1371 | MDRV_CPU_ADD(Z80, 4000000) |
| 1372 | 1372 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 454 | 454 | memory_set_bank(1,data & 0x07); |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | static READ8_HANDLER( bankswitch_r ) | |
| 458 | { | |
| 459 | return memory_get_bank(1); | |
| 460 | } | |
| 461 | ||
| 457 | 462 | // IC2 6840 PTM handler /////////////////////////////////////////////////////// |
| 458 | 463 | |
| 459 | 464 | static WRITE8_HANDLER( ic2_o1_callback ) |
| r1877 | r1878 | |
| 715 | 720 | */ |
| 716 | 721 | /* PSG function selected */ |
| 717 | 722 | |
| 718 | static void update_ay( | |
| 723 | static void update_ay(running_machine *machine) | |
| 719 | 724 | { |
| 720 | 725 | if (!pia_get_output_cb2(2)) |
| 721 | 726 | { |
| r1877 | r1878 | |
| 733 | 738 | } |
| 734 | 739 | case 0x02: |
| 735 | 740 | {/* CA2 = 0 CB2 = 1? : Write to selected PSG register and write data to Port A */ |
| 736 | AY8910_write_port_0_w(0, pia_get_output_a(3)); | |
| 741 | AY8910_write_port_0_w(machine, 0, pia_get_output_a(3)); | |
| 737 | 742 | LOG(("AY Chip Write \n")); |
| 738 | 743 | break; |
| 739 | 744 | } |
| 740 | 745 | case 0x03: |
| 741 | 746 | {/* CA2 = 1 CB2 = 1? : The register will now be selected and the user can read from or write to it. The register will remain selected until another is chosen.*/ |
| 742 | AY8910_control_port_0_w(0, pia_get_output_a(3)); | |
| 747 | AY8910_control_port_0_w(machine, 0, pia_get_output_a(3)); | |
| 743 | 748 | LOG(("AY Chip Select \n")); |
| 744 | 749 | break; |
| 745 | 750 | } |
| r1877 | r1878 | |
| 754 | 759 | |
| 755 | 760 | static WRITE8_HANDLER( pia_ic5_cb2_w ) |
| 756 | 761 | { |
| 757 | update_ay(); | |
| 762 | update_ay(machine); | |
| 758 | 763 | } |
| 759 | 764 | |
| 760 | 765 | static const pia6821_interface pia_ic5_intf = |
| r1877 | r1878 | |
| 789 | 794 | if (mod_number <4) |
| 790 | 795 | { |
| 791 | 796 | aydata = data; |
| 792 | update_ay(); | |
| 797 | update_ay(machine); | |
| 793 | 798 | } |
| 794 | 799 | } |
| 795 | 800 | |
| r1877 | r1878 | |
| 800 | 805 | { |
| 801 | 806 | if ( data ) ay8913_address |= 0x01; |
| 802 | 807 | else ay8913_address &= ~0x01; |
| 803 | update_ay(); | |
| 808 | update_ay(machine); | |
| 804 | 809 | } |
| 805 | 810 | } |
| 806 | 811 | |
| r1877 | r1878 | |
| 811 | 816 | { |
| 812 | 817 | if ( data ) ay8913_address |= 0x02; |
| 813 | 818 | else ay8913_address &= ~0x02; |
| 814 | update_ay(); | |
| 819 | update_ay(machine); | |
| 815 | 820 | } |
| 816 | 821 | } |
| 817 | 822 | |
| r1877 | r1878 | |
| 1325 | 1330 | AM_RANGE(0x0800, 0x0810) AM_WRITE(characteriser_w) |
| 1326 | 1331 | AM_RANGE(0x0800, 0x0810) AM_READ( characteriser_r) |
| 1327 | 1332 | |
| 1328 | AM_RANGE(0x0850, 0x0850) AM_WRITE(bankswitch_w) // write bank (rom page select) | |
| 1333 | AM_RANGE(0x0850, 0x0850) AM_READWRITE(bankswitch_r,bankswitch_w) // write bank (rom page select) | |
| 1329 | 1334 | |
| 1330 | 1335 | // AM_RANGE(0x08E0, 0x08E7) AM_READ( 68681_duart_r) |
| 1331 | 1336 | // AM_RANGE(0x08E0, 0x08E7) AM_WRITE( 68681_duart_w) |
| r1877 | r1878 | |
|---|---|---|
| 429 | 429 | MDRV_CPU_ADD(Z80, 12000000/4) |
| 430 | 430 | MDRV_CPU_PROGRAM_MAP(mem_map_skylncr,0) |
| 431 | 431 | MDRV_CPU_IO_MAP(io_map_skylncr,0) |
| 432 | MDRV_CPU_VBLANK_INT(skylncr_vblank_interrupt | |
| 432 | MDRV_CPU_VBLANK_INT("main", skylncr_vblank_interrupt | |
| 433 | 433 | |
| 434 | 434 | /* video hardware */ |
| 435 | 435 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 38 | 38 | { |
| 39 | 39 | switch (offset<<1) { |
| 40 | 40 | case 6: /* DMA flag */ |
| 41 | buffer_spriteram16_w(0,0,0); | |
| 41 | buffer_spriteram16_w(machine,0,0,0); | |
| 42 | 42 | return; |
| 43 | 43 | case 8: /* Sound CPU write */ |
| 44 | soundlatch_w(0,data & 0xff); | |
| 45 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 44 | soundlatch_w(machine,0,data & 0xff); | |
| 45 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 46 | 46 | return; |
| 47 | 47 | case 0xa: /* IRQ Ack (VBL) */ |
| 48 | 48 | return; |
| r1877 | r1878 | |
| 102 | 102 | { |
| 103 | 103 | switch (offset) { |
| 104 | 104 | case 0: |
| 105 | YM2151_register_port_0_w(0,data); | |
| 105 | YM2151_register_port_0_w(machine,0,data); | |
| 106 | 106 | break; |
| 107 | 107 | case 1: |
| 108 | YM2151_data_port_0_w(0,data); | |
| 108 | YM2151_data_port_0_w(machine,0,data); | |
| 109 | 109 | break; |
| 110 | 110 | } |
| 111 | 111 | } |
| r1877 | r1878 | |
| 114 | 114 | { |
| 115 | 115 | switch (offset) { |
| 116 | 116 | case 0: |
| 117 | YM2203_control_port_0_w(0,data); | |
| 117 | YM2203_control_port_0_w(machine,0,data); | |
| 118 | 118 | break; |
| 119 | 119 | case 1: |
| 120 | YM2203_write_port_0_w(0,data); | |
| 120 | YM2203_write_port_0_w(machine,0,data); | |
| 121 | 121 | break; |
| 122 | 122 | } |
| 123 | 123 | } |
| r1877 | r1878 | |
| 289 | 289 | /* basic machine hardware */ |
| 290 | 290 | MDRV_CPU_ADD(M68000,12000000) /* Custom chip 59 */ |
| 291 | 291 | MDRV_CPU_PROGRAM_MAP(darkseal_readmem,darkseal_writemem) |
| 292 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 292 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 293 | 293 | |
| 294 | 294 | MDRV_CPU_ADD(H6280, 32220000/4) /* Custom chip 45, Audio section crystal is 32.220 MHz */ |
| 295 | 295 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 291 | 291 | MDRV_CPU_ADD(Z180, MAIN_CPU_CLOCK) |
| 292 | 292 | MDRV_CPU_PROGRAM_MAP(20pacgal_map,0) |
| 293 | 293 | MDRV_CPU_IO_MAP(20pacgal_io_map,0) |
| 294 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 294 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 295 | 295 | |
| 296 | 296 | MDRV_NVRAM_HANDLER(eeprom) |
| 297 | 297 |
| r1877 | r1878 | |
|---|---|---|
| 404 | 404 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz? */ |
| 405 | 405 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 406 | 406 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 407 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 407 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 408 | 408 | |
| 409 | 409 | MDRV_CPU_ADD_TAG("mcu", NSC8105, 6000000) /* ??? */ |
| 410 | 410 | MDRV_CPU_PROGRAM_MAP(mcu_nvram_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 139 | 139 | { |
| 140 | 140 | if (ACCESSING_LSB) |
| 141 | 141 | { |
| 142 | soundlatch_w(offset,data & 0xff); | |
| 143 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 142 | soundlatch_w(machine,offset,data & 0xff); | |
| 143 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
| r1877 | r1878 | |
| 356 | 356 | /* basic machine hardware */ |
| 357 | 357 | MDRV_CPU_ADD(M68000, 12000000) |
| 358 | 358 | MDRV_CPU_PROGRAM_MAP(spbactn_readmem,spbactn_writemem) |
| 359 | MDRV_CPU_VBLANK_INT(irq3_line_hold | |
| 359 | MDRV_CPU_VBLANK_INT("main", irq3_line_hold | |
| 360 | 360 | |
| 361 | 361 | MDRV_CPU_ADD(Z80, 4000000) |
| 362 | 362 | /* audio CPU */ /* 4 MHz ??? */ |
| r1877 | r1878 | |
|---|---|---|
| 411 | 411 | { |
| 412 | 412 | if( ACCESSING_LSB ) |
| 413 | 413 | { |
| 414 | soundlatch_w( 0,data&0xff ); | |
| 415 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE ); | |
| 414 | soundlatch_w( machine,0,data&0xff ); | |
| 415 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE ); | |
| 416 | 416 | } |
| 417 | 417 | } |
| 418 | 418 | |
| r1877 | r1878 | |
| 420 | 420 | { |
| 421 | 421 | if( ACCESSING_LSB ) |
| 422 | 422 | { |
| 423 | soundlatch_w( 0,data&0xff ); | |
| 424 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 423 | soundlatch_w( machine,0,data&0xff ); | |
| 424 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 425 | 425 | } |
| 426 | 426 | } |
| 427 | 427 | |
| r1877 | r1878 | |
| 450 | 450 | |
| 451 | 451 | /* basic machine hardware */ |
| 452 | 452 | MDRV_CPU_ADD_TAG("main", M68000, 10000000) |
| 453 | MDRV_CPU_VBLANK_INT(sys16_interrupt | |
| 453 | MDRV_CPU_VBLANK_INT("main", sys16_interrupt | |
| 454 | 454 | |
| 455 | 455 | MDRV_CPU_ADD_TAG("sound", Z80, 4000000) |
| 456 | 456 | /* audio CPU */ |
| r1877 | r1878 | |
| 577 | 577 | |
| 578 | 578 | /***************************************************************************/ |
| 579 | 579 | |
| 580 | #ifdef UNUSED_DEFINITION | |
| 580 | 581 | static INPUT_PORTS_START( aliensyn ) |
| 581 | 582 | SYS16_JOY1 |
| 582 | 583 | SYS16_JOY2 |
| r1877 | r1878 | |
| 604 | 605 | PORT_DIPSETTING( 0x40, DEF_STR( Hard ) ) |
| 605 | 606 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 606 | 607 | INPUT_PORTS_END |
| 607 | ||
| 608 | #endif | |
| 608 | 609 | /****************************************************************************/ |
| 609 | 610 | |
| 610 | 611 | |
| r1877 | r1878 | |
| 1204 | 1205 | } |
| 1205 | 1206 | static READ16_HANDLER( ga_io_service_r ) |
| 1206 | 1207 | { |
| 1207 | return (input_port_2_word_r(0,0) << 8) | (sys16_workingram[0x2c96/2] & 0x00ff); | |
| 1208 | return (input_port_2_word_r(machine,0,0) << 8) | (sys16_workingram[0x2c96/2] & 0x00ff); | |
| 1208 | 1209 | } |
| 1209 | 1210 | |
| 1210 | 1211 | static ADDRESS_MAP_START( goldnaxe_readmem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1877 | r1878 | |
| 1229 | 1230 | COMBINE_DATA( &sys16_workingram[(0xecfc-0xc000)/2] ); |
| 1230 | 1231 | if( ACCESSING_MSB ) |
| 1231 | 1232 | { |
| 1232 | soundlatch_w( 0,data>>8 ); | |
| 1233 | soundlatch_w( machine,0,data>>8 ); | |
| 1233 | 1234 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE ); |
| 1234 | 1235 | } |
| 1235 | 1236 | } |
| r1877 | r1878 | |
| 1399 | 1400 | |
| 1400 | 1401 | static READ16_HANDLER( passht4b_service_r ) |
| 1401 | 1402 | { |
| 1402 | UINT16 val=input_port_2_word_r(offset,0); | |
| 1403 | UINT16 val=input_port_2_word_r(machine,offset,0); | |
| 1403 | 1404 | if(!(readinputport(0) & 0x40)) val&=0xef; |
| 1404 | 1405 | if(!(readinputport(1) & 0x40)) val&=0xdf; |
| 1405 | 1406 | if(!(readinputport(5) & 0x40)) val&=0xbf; |
| r1877 | r1878 | |
| 1907 | 1908 | /***************************************************************************/ |
| 1908 | 1909 | |
| 1909 | 1910 | static READ16_HANDLER( tt_io_player1_r ) |
| 1910 | { return input_port_0_r( offset ) << 8; } | |
| 1911 | { return input_port_0_r( machine, offset ) << 8; } | |
| 1911 | 1912 | static READ16_HANDLER( tt_io_player2_r ) |
| 1912 | { return input_port_1_r( offset ) << 8; } | |
| 1913 | { return input_port_1_r( machine, offset ) << 8; } | |
| 1913 | 1914 | static READ16_HANDLER( tt_io_service_r ) |
| 1914 | { return input_port_2_r( offset ) << 8; } | |
| 1915 | { return input_port_2_r( machine, offset ) << 8; } | |
| 1915 | 1916 | |
| 1916 | 1917 | |
| 1917 | 1918 | |
| r1877 | r1878 | |
| 2523 | 2524 | |
| 2524 | 2525 | |
| 2525 | 2526 | // pre16 |
| 2527 | #ifdef UNUSED_DEFINITION | |
| 2526 | 2528 | ROM_START( mjleague ) |
| 2527 | 2529 | ROM_REGION( 0x030000, REGION_CPU1, 0 ) /* 68000 code */ |
| 2528 | 2530 | ROM_LOAD16_BYTE( "epr-7404.09b", 0x000000, 0x8000, CRC(ec1655b5) SHA1(5c1df364fa9733daa4478c5f88298089e4963c33) ) |
| r1877 | r1878 | |
| 2561 | 2563 | ROM_LOAD( "epr-7064.03a", 0x10000, 0x8000, CRC(159f6636) SHA1(66fa3f3e95a6ef3d3ff4ded09c05ab1131d9fbbb) ) |
| 2562 | 2564 | ROM_LOAD( "epr-7066.04a", 0x18000, 0x8000, CRC(f5cfa91f) SHA1(c85d68cbcd03fe1436bed12235c033610acc11ee) ) |
| 2563 | 2565 | ROM_END |
| 2566 | #endif | |
| 2564 | 2567 | |
| 2565 | 2568 | ROM_START( passht4b ) |
| 2566 | 2569 | ROM_REGION( 0x20000, REGION_CPU1, 0 ) /* 68000 code */ |
| r1877 | r1878 | |
|---|---|---|
| 56 | 56 | { |
| 57 | 57 | if (ACCESSING_MSB) |
| 58 | 58 | { |
| 59 | soundlatch_w(offset,(data >> 8) & 0xff); | |
| 60 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 59 | soundlatch_w(machine,offset,(data >> 8) & 0xff); | |
| 60 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
| r1877 | r1878 | |
| 81 | 81 | static WRITE16_HANDLER( YM3812_control_port_0_msb_w ) |
| 82 | 82 | { |
| 83 | 83 | if (ACCESSING_MSB) |
| 84 | YM3812_control_port_0_w(0,(data >> 8) & 0xff); | |
| 84 | YM3812_control_port_0_w(machine,0,(data >> 8) & 0xff); | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | static WRITE16_HANDLER( YM3812_write_port_0_msb_w ) |
| 88 | 88 | { |
| 89 | 89 | if (ACCESSING_MSB) |
| 90 | YM3812_write_port_0_w(0,(data >> 8) & 0xff); | |
| 90 | YM3812_write_port_0_w(machine,0,(data >> 8) & 0xff); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
| r1877 | r1878 | |
| 324 | 324 | /* basic machine hardware */ |
| 325 | 325 | MDRV_CPU_ADD(M68000,25000000/2) /* ??? */ |
| 326 | 326 | MDRV_CPU_PROGRAM_MAP(deniam16b_readmem,deniam16b_writemem) |
| 327 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 327 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 328 | 328 | |
| 329 | 329 | MDRV_CPU_ADD(Z80,25000000/4) /* (makes logicpro music tempo correct) */ |
| 330 | 330 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 363 | 363 | /* basic machine hardware */ |
| 364 | 364 | MDRV_CPU_ADD(M68000,25000000/2) /* ??? */ |
| 365 | 365 | MDRV_CPU_PROGRAM_MAP(deniam16c_readmem,deniam16c_writemem) |
| 366 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 366 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 367 | 367 | |
| 368 | 368 | MDRV_MACHINE_RESET(deniam) |
| 369 | 369 |
| r1877 | r1878 | |
|---|---|---|
| 139 | 139 | /* update the different PIA pins from the input ports */ |
| 140 | 140 | |
| 141 | 141 | /* CA1 - copy of PA0 (COIN1) */ |
| 142 | pia_1_ca1_w(0, input_port_0_r(0) & 0x01); | |
| 142 | pia_1_ca1_w(machine, 0, input_port_0_r(machine, 0) & 0x01); | |
| 143 | 143 | |
| 144 | 144 | /* CA2 - copy of PA1 (SERVICE1) */ |
| 145 | pia_1_ca2_w(0, input_port_0_r(0) & 0x02); | |
| 145 | pia_1_ca2_w(machine, 0, input_port_0_r(machine, 0) & 0x02); | |
| 146 | 146 | |
| 147 | 147 | /* CB1 - (crosshatch) */ |
| 148 | pia_1_cb1_w(0, input_port_5_r(0)); | |
| 148 | pia_1_cb1_w(machine, 0, input_port_5_r(machine, 0)); | |
| 149 | 149 | |
| 150 | 150 | /* CB2 - NOT CONNECTED */ |
| 151 | 151 | } |
| r1877 | r1878 | |
| 181 | 181 | star_enable = data & 0x10; |
| 182 | 182 | |
| 183 | 183 | /* bits 5-7 go to the music board connector */ |
| 184 | audio_2_command_w(0, data & 0xe0); | |
| 184 | audio_2_command_w(machine, 0, data & 0xe0); | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | |
| r1877 | r1878 | |
| 208 | 208 | |
| 209 | 209 | static void ic48_1_74123_output_changed(int output) |
| 210 | 210 | { |
| 211 | pia_2_ca1_w(0, output); | |
| 211 | pia_2_ca1_w(Machine, 0, output); | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | |
| r1877 | r1878 | |
| 270 | 270 | #define NUM_PENS (8) |
| 271 | 271 | |
| 272 | 272 | |
| 273 | static WRITE8_HANDLER( nyny_mc6845_address_w ) | |
| 274 | { | |
| 275 | mc6845_address_w(mc6845, data); | |
| 276 | } | |
| 277 | ||
| 278 | ||
| 279 | static WRITE8_HANDLER( nyny_mc6845_register_w ) | |
| 280 | { | |
| 281 | mc6845_register_w(mc6845, data); | |
| 282 | } | |
| 283 | ||
| 284 | ||
| 285 | 273 | static WRITE8_HANDLER( flipscreen_w ) |
| 286 | 274 | { |
| 287 | 275 | flipscreen = data ? 0 : 1; |
| 288 | 276 | } |
| 289 | 277 | |
| 290 | 278 | |
| 291 | static | |
| 279 | static MC6845 | |
| 292 | 280 | { |
| 293 | 281 | /* create the pens */ |
| 294 | 282 | offs_t i; |
| r1877 | r1878 | |
| 303 | 291 | } |
| 304 | 292 | |
| 305 | 293 | |
| 306 | static void nyny_update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect, | |
| 307 | UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) | |
| 294 | static MC6845_UPDATE_ROW( update_row ) | |
| 308 | 295 | { |
| 309 | 296 | UINT8 cx; |
| 310 | 297 | |
| r1877 | r1878 | |
| 373 | 360 | } |
| 374 | 361 | |
| 375 | 362 | |
| 376 | static | |
| 363 | static MC | |
| 377 | 364 | { |
| 378 | 365 | /* draw the star field into the bitmap */ |
| 379 | 366 | int y; |
| r1877 | r1878 | |
| 409 | 396 | } |
| 410 | 397 | |
| 411 | 398 | |
| 412 | static | |
| 399 | static MC6845 | |
| 413 | 400 | { |
| 414 | 401 | TTL74123_A_w(0, display_enabled); |
| 415 | 402 | } |
| r1877 | r1878 | |
| 417 | 404 | |
| 418 | 405 | static const mc6845_interface mc6845_intf = |
| 419 | 406 | { |
| 420 | 0, /* screen we are acting on */ | |
| 421 | CRTC_CLOCK, /* the clock (pin 21) of the chip */ | |
| 422 | 8, /* number of pixels per video memory address */ | |
| 423 | nyny_begin_update, /* before pixel update callback */ | |
| 424 | nyny_update_row, /* row update callback */ | |
| 425 | nyny_end_update, /* after pixel update callback */ | |
| 426 | nyny_display_enable_changed /* call back for display state changes */ | |
| 407 | 0, /* screen we are acting on */ | |
| 408 | CRTC_CLOCK, /* the clock (pin 21) of the chip */ | |
| 409 | 8, /* number of pixels per video memory address */ | |
| 410 | begin_update, /* before pixel update callback */ | |
| 411 | update_row, /* row update callback */ | |
| 412 | end_update, /* after pixel update callback */ | |
| 413 | display_enable_changed, /* callback for display state changes */ | |
| 414 | NULL, /* HSYNC callback */ | |
| 415 | NULL /* VSYNC callback */ | |
| 427 | 416 | }; |
| 428 | 417 | |
| 429 | 418 | |
| r1877 | r1878 | |
| 450 | 439 | |
| 451 | 440 | static WRITE8_HANDLER( audio_1_command_w ) |
| 452 | 441 | { |
| 453 | soundlatch_w(0, data); | |
| 454 | cpunum_set_input_line(Machine, 1, M6802_IRQ_LINE, HOLD_LINE); | |
| 442 | soundlatch_w(machine, 0, data); | |
| 443 | cpunum_set_input_line(machine, 1, M6802_IRQ_LINE, HOLD_LINE); | |
| 455 | 444 | } |
| 456 | 445 | |
| 457 | 446 | |
| 458 | 447 | static WRITE8_HANDLER( audio_1_answer_w ) |
| 459 | 448 | { |
| 460 | soundlatch3_w(0, data); | |
| 461 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, HOLD_LINE); | |
| 449 | soundlatch3_w(machine, 0, data); | |
| 450 | cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, HOLD_LINE); | |
| 462 | 451 | } |
| 463 | 452 | |
| 464 | 453 | |
| r1877 | r1878 | |
| 501 | 490 | |
| 502 | 491 | static WRITE8_HANDLER( audio_2_command_w ) |
| 503 | 492 | { |
| 504 | soundlatch2_w(0, (data & 0x60) >> 5); | |
| 505 | cpunum_set_input_line(Machine, 2, M6802_IRQ_LINE, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 493 | soundlatch2_w(machine, 0, (data & 0x60) >> 5); | |
| 494 | cpunum_set_input_line(machine, 2, M6802_IRQ_LINE, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 506 | 495 | } |
| 507 | 496 | |
| 508 | 497 | |
| r1877 | r1878 | |
| 518 | 507 | UINT8 ret = 0; |
| 519 | 508 | |
| 520 | 509 | /* the address bits are directly connected to the chip selects */ |
| 521 | if (offset & 0x04) ret = pia_1_r(offset & 0x03); | |
| 522 | if (offset & 0x08) ret = pia_2_alt_r(offset & 0x03); | |
| 510 | if (offset & 0x04) ret = pia_1_r(machine, offset & 0x03); | |
| 511 | if (offset & 0x08) ret = pia_2_alt_r(machine, offset & 0x03); | |
| 523 | 512 | |
| 524 | 513 | return ret; |
| 525 | 514 | } |
| r1877 | r1878 | |
| 528 | 517 | static WRITE8_HANDLER( nyny_pia_1_2_w ) |
| 529 | 518 | { |
| 530 | 519 | /* the address bits are directly connected to the chip selects */ |
| 531 | if (offset & 0x04) pia_1_w(offset & 0x03, data); | |
| 532 | if (offset & 0x08) pia_2_alt_w(offset & 0x03, data); | |
| 520 | if (offset & 0x04) pia_1_w(machine, offset & 0x03, data); | |
| 521 | if (offset & 0x08) pia_2_alt_w(machine, offset & 0x03, data); | |
| 533 | 522 | } |
| 534 | 523 | |
| 535 | 524 | |
| r1877 | r1878 | |
| 540 | 529 | AM_RANGE(0x6000, 0x7fff) AM_RAM AM_BASE(&nyny_colorram_2) |
| 541 | 530 | AM_RANGE(0x8000, 0x9fff) AM_RAM |
| 542 | 531 | AM_RANGE(0xa000, 0xa0ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) /* SRAM (coin counter, shown when holding F2) */ |
| 543 | AM_RANGE(0xa100, 0xa100) AM_MIRROR(0x00fe) AM_WRITE(nyny_mc6845_address_w) | |
| 544 | AM_RANGE(0xa101, 0xa101) AM_MIRROR(0x00fe) AM_WRITE(nyny_mc6845_register_w) | |
| 532 | AM_RANGE(0xa100, 0xa100) AM_MIRROR(0x00fe) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 533 | AM_RANGE(0xa101, 0xa101) AM_MIRROR(0x00fe) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 545 | 534 | AM_RANGE(0xa200, 0xa20f) AM_MIRROR(0x00f0) AM_READWRITE(nyny_pia_1_2_r, nyny_pia_1_2_w) |
| 546 | 535 | AM_RANGE(0xa300, 0xa300) AM_MIRROR(0x00ff) AM_READWRITE(soundlatch3_r, audio_1_command_w) |
| 547 | 536 | AM_RANGE(0xa400, 0xa7ff) AM_NOP |
| r1877 | r1878 | |
|---|---|---|
| 94 | 94 | |
| 95 | 95 | static WRITE32_HANDLER( spotty_soundlatch_w ) |
| 96 | 96 | { |
| 97 | soundlatch_w(0, (data >> 16) & 0xff); | |
| 97 | soundlatch_w(machine, 0, (data >> 16) & 0xff); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /***************************************************************************************************** |
| r1877 | r1878 | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | // sprites aren't tile based (except for 8x8 ones) |
| 192 | static void draw_sprites(running_machine *machine, | |
| 192 | static void draw_sprites(running_machine *machine, | |
| 193 | 193 | { |
| 194 | 194 | int i; |
| 195 | 195 | int sprites_on_screen = (limenko_videoreg[0] & 0x1ff0000) >> 16; |
| r1877 | r1878 | |
| 479 | 479 | MDRV_CPU_ADD(E132XN, 20000000*4) /* 4x internal multiplier */ |
| 480 | 480 | MDRV_CPU_PROGRAM_MAP(limenko_map,0) |
| 481 | 481 | MDRV_CPU_IO_MAP(limenko_io_map,0) |
| 482 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 482 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 483 | 483 | |
| 484 | 484 | MDRV_NVRAM_HANDLER(93C46) |
| 485 | 485 | |
| r1877 | r1878 | |
| 504 | 504 | MDRV_CPU_ADD(GMS30C2232, 20000000) /* 20 MHz, no internal multiplier */ |
| 505 | 505 | MDRV_CPU_PROGRAM_MAP(spotty_map,0) |
| 506 | 506 | MDRV_CPU_IO_MAP(spotty_io_map,0) |
| 507 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 507 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 508 | 508 | |
| 509 | 509 | MDRV_CPU_ADD(I8051, 4000000) /* 4 MHz */ |
| 510 | 510 | MDRV_CPU_PROGRAM_MAP(spotty_sound_prg_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | static WRITE8_HANDLER( redalert_interrupt_clear_w ) |
| 107 | 107 | { |
| 108 | redalert_interrupt_clear_r(0); | |
| 108 | redalert_interrupt_clear_r(machine, 0); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| r1877 | r1878 | |
| 275 | 275 | /* basic machine hardware */ |
| 276 | 276 | MDRV_CPU_ADD(M6502, MAIN_CPU_CLOCK) |
| 277 | 277 | MDRV_CPU_PROGRAM_MAP(redalert_main_map,0) |
| 278 | MDRV_CPU_VBLANK_INT(redalert_vblank_interrupt | |
| 278 | MDRV_CPU_VBLANK_INT("main", redalert_vblank_interrupt | |
| 279 | 279 | |
| 280 | 280 | /* video hardware */ |
| 281 | 281 | MDRV_IMPORT_FROM(redalert_video) |
| r1877 | r1878 | |
| 290 | 290 | /* basic machine hardware */ |
| 291 | 291 | MDRV_CPU_ADD(M6502, MAIN_CPU_CLOCK) |
| 292 | 292 | MDRV_CPU_PROGRAM_MAP(demoneye_main_map,0) |
| 293 | MDRV_CPU_VBLANK_INT(redalert_vblank_interrupt | |
| 293 | MDRV_CPU_VBLANK_INT("main", redalert_vblank_interrupt | |
| 294 | 294 | |
| 295 | 295 | /* video hardware */ |
| 296 | 296 | MDRV_IMPORT_FROM(demoneye_video) |
| r1877 | r1878 | |
|---|---|---|
| 137 | 137 | if (data & 0x40) input_mux = 1; |
| 138 | 138 | |
| 139 | 139 | /* low 5 bits control the turbo CS */ |
| 140 | turbocs_data_w(offset, data); | |
| 140 | turbocs_data_w(machine, offset, data); | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
| r1877 | r1878 | |
| 204 | 204 | maxrpm_adc_control = data & 0x0f; |
| 205 | 205 | |
| 206 | 206 | /* remaining bits go to standard connections */ |
| 207 | mcrmono_control_port_w(offset, data); | |
| 207 | mcrmono_control_port_w(machine, offset, data); | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | |
| 211 | 211 | static WRITE8_HANDLER( maxrpm_op6_w ) |
| 212 | 212 | { |
| 213 | 213 | static const char *const inputs[] = { "MONO.IP1", "MONO.IP1.ALT1", "MONO.IP1.ALT2", "MONO.IP1.ALT3" }; |
| 214 | ||
| 215 | 214 | /* |
| 216 | 215 | Reflective Sensor Control: |
| 217 | 216 | 4 bits of input from OP5 are routed to a transceiver at U2, and |
| r1877 | r1878 | |
| 241 | 240 | maxrpm_adc_select = (maxrpm_adc_control >> 1) & 3; |
| 242 | 241 | |
| 243 | 242 | /* low 5 bits control the turbo CS */ |
| 244 | turbocs_data_w(offset, data); | |
| 243 | turbocs_data_w(machine, offset, data); | |
| 245 | 244 | } |
| 246 | 245 | |
| 247 | 246 | |
| r1877 | r1878 | |
| 254 | 253 | |
| 255 | 254 | static READ8_HANDLER( rampage_ip4_r ) |
| 256 | 255 | { |
| 257 | return readinputportbytag("MONO.IP4") | (soundsgood_status_r(0) << 7); | |
| 256 | return readinputportbytag("MONO.IP4") | (soundsgood_status_r(machine,0) << 7); | |
| 258 | 257 | } |
| 259 | 258 | |
| 260 | 259 | |
| r1877 | r1878 | |
| 264 | 263 | soundsgood_reset_w((~data >> 5) & 1); |
| 265 | 264 | |
| 266 | 265 | /* low 5 bits go directly to the Sounds Good board */ |
| 267 | soundsgood_data_w(offset, data); | |
| 266 | soundsgood_data_w(machine, offset, data); | |
| 268 | 267 | } |
| 269 | 268 | |
| 270 | 269 | |
| r1877 | r1878 | |
| 277 | 276 | |
| 278 | 277 | static READ8_HANDLER( powerdrv_ip2_r ) |
| 279 | 278 | { |
| 280 | return readinputportbytag("MONO.IP2") | (soundsgood_status_r(0) << 7); | |
| 279 | return readinputportbytag("MONO.IP2") | (soundsgood_status_r(machine, 0) << 7); | |
| 281 | 280 | } |
| 282 | 281 | |
| 283 | 282 | |
| r1877 | r1878 | |
| 298 | 297 | set_led_status(2, (data >> 1) & 1); |
| 299 | 298 | |
| 300 | 299 | /* remaining bits go to standard connections */ |
| 301 | mcrmono_control_port_w(offset, data); | |
| 300 | mcrmono_control_port_w(machine, offset, data); | |
| 302 | 301 | } |
| 303 | 302 | |
| 304 | 303 | |
| r1877 | r1878 | |
| 308 | 307 | soundsgood_reset_w((~data >> 5) & 1); |
| 309 | 308 | |
| 310 | 309 | /* low 5 bits go directly to the Sounds Good board */ |
| 311 | soundsgood_data_w(offset, data); | |
| 310 | soundsgood_data_w(machine, offset, data); | |
| 312 | 311 | } |
| 313 | 312 | |
| 314 | 313 | |
| r1877 | r1878 | |
| 322 | 321 | static READ8_HANDLER( stargrds_ip0_r ) |
| 323 | 322 | { |
| 324 | 323 | UINT8 result = readinputportbytag(input_mux ? "MONO.IP0.ALT" : "MONO.IP0"); |
| 325 | return result | ((soundsgood_status_r(0) << 4) & 0x10); | |
| 324 | return result | ((soundsgood_status_r(machine, 0) << 4) & 0x10); | |
| 326 | 325 | } |
| 327 | 326 | |
| 328 | 327 | |
| r1877 | r1878 | |
| 339 | 338 | set_led_status(2, (data >> 4) & 1); |
| 340 | 339 | |
| 341 | 340 | /* remaining bits go to standard connections */ |
| 342 | mcrmono_control_port_w(offset, data); | |
| 341 | mcrmono_control_port_w(machine, offset, data); | |
| 343 | 342 | } |
| 344 | 343 | |
| 345 | 344 | |
| r1877 | r1878 | |
| 349 | 348 | soundsgood_reset_w((~data >> 6) & 1); |
| 350 | 349 | |
| 351 | 350 | /* unline the other games, the STROBE is in the high bit instead of the low bit */ |
| 352 | soundsgood_data_w(offset, (data << 1) | (data >> 7)); | |
| 351 | soundsgood_data_w(machine, offset, (data << 1) | (data >> 7)); | |
| 353 | 352 | } |
| 354 | 353 | |
| 355 | 354 | |
| r1877 | r1878 | |
| 362 | 361 | |
| 363 | 362 | static READ8_HANDLER( spyhunt_ip1_r ) |
| 364 | 363 | { |
| 365 | return readinputportbytag("SSIO.IP1") | (csdeluxe_status_r(0) << 5); | |
| 364 | return readinputportbytag("SSIO.IP1") | (csdeluxe_status_r(machine, 0) << 5); | |
| 366 | 365 | } |
| 367 | 366 | |
| 368 | 367 | |
| r1877 | r1878 | |
| 406 | 405 | last_op4 = data; |
| 407 | 406 | |
| 408 | 407 | /* low 5 bits go to control the Chip Squeak Deluxe */ |
| 409 | csdeluxe_data_w(offset, data); | |
| 408 | csdeluxe_data_w(machine, offset, data); | |
| 410 | 409 | } |
| 411 | 410 | |
| 412 | 411 | |
| r1877 | r1878 | |
| 423 | 422 | if (input_mux) |
| 424 | 423 | return readinputportbytag("SSIO.IP2.ALT"); |
| 425 | 424 | |
| 426 | return readinputportbytag("SSIO.IP2") + 5 * ( | |
| 425 | return readinputportbytag("SSIO.IP2") + 5 * (vid | |
| 427 | 426 | } |
| 428 | 427 | |
| 429 | 428 | |
| r1877 | r1878 | |
| 1055 | 1054 | /* basic machine hardware */ |
| 1056 | 1055 | MDRV_CPU_ADD_TAG("main", Z80, MASTER_CLOCK/4) |
| 1057 | 1056 | MDRV_CPU_CONFIG(mcr_daisy_chain) |
| 1058 | MDRV_CPU_VBLANK_INT(mcr_interrupt,2) | |
| 1057 | MDRV_CPU_VBLANK_INT_HACK(mcr_interrupt,2) | |
| 1059 | 1058 | |
| 1060 | 1059 | MDRV_WATCHDOG_VBLANK_INIT(16) |
| 1061 | 1060 | MDRV_MACHINE_START(mcr) |
| r1877 | r1878 | |
|---|---|---|
| 357 | 357 | |
| 358 | 358 | MDRV_CPU_ADD(Z80, 7372800/2) |
| 359 | 359 | MDRV_CPU_PROGRAM_MAP(cpu0_mem, 0) |
| 360 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 360 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 361 | 361 | |
| 362 | 362 | MDRV_CPU_ADD(Z80, 7372800/2) |
| 363 | 363 | MDRV_CPU_CONFIG(daisy_chain_sound) |
| r1877 | r1878 | |
|---|---|---|
| 348 | 348 | /* basic machine hardware */ |
| 349 | 349 | MDRV_CPU_ADD_TAG("main", Z80, MASTER_CLOCK/6) |
| 350 | 350 | MDRV_CPU_PROGRAM_MAP(pengo_map,0) |
| 351 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 351 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 352 | 352 | |
| 353 | 353 | /* video hardware */ |
| 354 | 354 | MDRV_GFXDECODE(pengo) |
| r1877 | r1878 | |
|---|---|---|
| 52 | 52 | case 4: /* Interrupt ack (VBL - IRQ 5) */ |
| 53 | 53 | break; |
| 54 | 54 | case 6: /* 6502 sound cpu */ |
| 55 | soundlatch_w(0,data & 0xff); | |
| 56 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 55 | soundlatch_w(machine,0,data & 0xff); | |
| 56 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 57 | 57 | break; |
| 58 | 58 | default: |
| 59 | 59 | logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",activecpu_get_pc(),data,0x30c010+offset); |
| r1877 | r1878 | |
| 82 | 82 | { |
| 83 | 83 | switch (offset) { |
| 84 | 84 | case 0: |
| 85 | YM3812_control_port_0_w(0,data); | |
| 85 | YM3812_control_port_0_w(machine,0,data); | |
| 86 | 86 | break; |
| 87 | 87 | case 1: |
| 88 | YM3812_write_port_0_w(0,data); | |
| 88 | YM3812_write_port_0_w(machine,0,data); | |
| 89 | 89 | break; |
| 90 | 90 | } |
| 91 | 91 | } |
| r1877 | r1878 | |
| 94 | 94 | { |
| 95 | 95 | switch (offset) { |
| 96 | 96 | case 0: |
| 97 | YM2203_control_port_0_w(0,data); | |
| 97 | YM2203_control_port_0_w(machine,0,data); | |
| 98 | 98 | break; |
| 99 | 99 | case 1: |
| 100 | YM2203_write_port_0_w(0,data); | |
| 100 | YM2203_write_port_0_w(machine,0,data); | |
| 101 | 101 | break; |
| 102 | 102 | } |
| 103 | 103 | } |
| r1877 | r1878 | |
| 259 | 259 | /* basic machine hardware */ |
| 260 | 260 | MDRV_CPU_ADD(M68000, 10000000) |
| 261 | 261 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 262 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 262 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 263 | 263 | |
| 264 | 264 | MDRV_CPU_ADD(M6502, 1500000) |
| 265 | 265 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | static WRITE16_HANDLER( prehisle_sound16_w ) |
| 31 | 31 | { |
| 32 | soundlatch_w(0, data & 0xff); | |
| 33 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 32 | soundlatch_w(machine, 0, data & 0xff); | |
| 33 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /*******************************************************************************/ |
| r1877 | r1878 | |
| 237 | 237 | /* basic machine hardware */ |
| 238 | 238 | MDRV_CPU_ADD(M68000, 12000000) |
| 239 | 239 | MDRV_CPU_PROGRAM_MAP(prehisle_readmem,prehisle_writemem) |
| 240 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 240 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 241 | 241 | |
| 242 | 242 | MDRV_CPU_ADD(Z80, 4000000) |
| 243 | 243 | /* audio CPU */ |
| r1877 | r1878 | |
| 261 | 261 | /* sound hardware */ |
| 262 | 262 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 263 | 263 | |
| 264 | MDRV_SOUND_ADD(YM3812, 4 | |
| 264 | MDRV_SOUND_ADD(YM3812, XTAL_4MHz | |
| 265 | 265 | MDRV_SOUND_CONFIG(ym3812_interface) |
| 266 | 266 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 267 | 267 |
| r1877 | r1878 | |
|---|---|---|
| 279 | 279 | /* basic machine hardware */ |
| 280 | 280 | MDRV_CPU_ADD(KONAMI, XTAL_24MHz/2/4) /* pin 18 of konami cpu is 12Mhz, while pin 17 is 3mhz. Clock probably divided internally by 4 */ |
| 281 | 281 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 282 | MDRV_CPU_VBLANK_INT(simpsons_irq | |
| 282 | MDRV_CPU_VBLANK_INT("main", simpsons_irq | |
| 283 | 283 | |
| 284 | 284 | MDRV_CPU_ADD(Z80, XTAL_3_579545MHz) /* verified on pcb */ |
| 285 | 285 | MDRV_CPU_PROGRAM_MAP(z80_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 110 | 110 | static WRITE8_HANDLER( sound_command_w ) |
| 111 | 111 | { |
| 112 | 112 | sound_cpu_busy = snk_sound_busy_bit; |
| 113 | soundlatch_w(0, data); | |
| 114 | cpunum_set_input_line(Machine, 2, 0, HOLD_LINE); | |
| 113 | soundlatch_w(machine, 0, data); | |
| 114 | cpunum_set_input_line(machine, 2, 0, HOLD_LINE); | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | static READ8_HANDLER( sound_command_r ) |
| 118 | 118 | { |
| 119 | 119 | sound_cpu_busy = 0; |
| 120 | return(soundlatch_r(0)); | |
| 120 | return(soundlatch_r(machine,0)); | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | static READ8_HANDLER( sound_nmi_ack_r ) |
| r1877 | r1878 | |
| 129 | 129 | /* this input port has one of its bits mapped to sound CPU status */ |
| 130 | 130 | static READ8_HANDLER( marvins_port_0_r ) |
| 131 | 131 | { |
| 132 | return(input_port_0_r(0) | sound_cpu_busy); | |
| 132 | return(input_port_0_r(machine,0) | sound_cpu_busy); | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 513 | 513 | /* basic machine hardware */ |
| 514 | 514 | MDRV_CPU_ADD(Z80, 3360000) /* 3.36 MHz */ |
| 515 | 515 | MDRV_CPU_PROGRAM_MAP(marvins_cpuA_map,0) |
| 516 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 516 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 517 | 517 | |
| 518 | 518 | MDRV_CPU_ADD(Z80, 3360000) /* 3.36 MHz */ |
| 519 | 519 | MDRV_CPU_PROGRAM_MAP(marvins_cpuB_map,0) |
| 520 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 520 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 521 | 521 | |
| 522 | 522 | MDRV_CPU_ADD(Z80, 4000000) /* 4.0 MHz */ |
| 523 | 523 | /* audio CPU */ |
| r1877 | r1878 | |
| 563 | 563 | /* basic machine hardware */ |
| 564 | 564 | MDRV_CPU_ADD_TAG("main", Z80, 3360000) /* 3.36 MHz */ |
| 565 | 565 | MDRV_CPU_PROGRAM_MAP(madcrash_cpuA_map,0) |
| 566 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 566 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 567 | 567 | |
| 568 | 568 | MDRV_CPU_ADD_TAG("sub", Z80, 3360000) /* 3.36 MHz */ |
| 569 | 569 | MDRV_CPU_PROGRAM_MAP(madcrash_cpuB_map,0) |
| 570 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 570 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 571 | 571 | |
| 572 | 572 | MDRV_CPU_ADD(Z80, 4000000) /* 4.0 MHz */ |
| 573 | 573 | /* audio CPU */ |
| r1877 | r1878 | |
| 614 | 614 | MDRV_IMPORT_FROM( vangrd2 ) |
| 615 | 615 | |
| 616 | 616 | MDRV_CPU_MODIFY("main") |
| 617 | MDRV_CPU_VBLANK_INT(0, 0) | |
| 617 | MDRV_CPU_VBLANK_INT_HACK(0, 0) | |
| 618 | 618 | |
| 619 | 619 | MDRV_CPU_MODIFY("sub") |
| 620 | MDRV_CPU_VBLANK_INT(snk_irq_BA | |
| 620 | MDRV_CPU_VBLANK_INT("main", snk_irq_BA | |
| 621 | 621 | |
| 622 | 622 | MDRV_INTERLEAVE(300) |
| 623 | 623 |
| r1877 | r1878 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | static WRITE16_HANDLER ( wwfsstar_soundwrite ) |
| 146 | 146 | { |
| 147 | soundlatch_w(1,data & 0xff); | |
| 148 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 147 | soundlatch_w(machine,1,data & 0xff); | |
| 148 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | static WRITE16_HANDLER( wwfsstar_flipscreen_w ) |
| r1877 | r1878 | |
| 362 | 362 | /* basic machine hardware */ |
| 363 | 363 | MDRV_CPU_ADD(M68000, 10000000) |
| 364 | 364 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 365 | MDRV_CPU_VBLANK_INT(wwfsstars_interrupt,272) | |
| 365 | MDRV_CPU_VBLANK_INT_HACK(wwfsstars_interrupt,272) | |
| 366 | 366 | |
| 367 | 367 | MDRV_CPU_ADD(Z80, 3579545) |
| 368 | 368 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| r1877 | r1878 | |
|---|---|---|
| 822 | 822 | static WRITE16_HANDLER(p_w) |
| 823 | 823 | { |
| 824 | 824 | UINT16 old = paletteram16[offset]; |
| 825 | paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, data, mem_mask); | |
| 825 | paletteram16_xBBBBBGGGGGRRRRR_word_w(machine, offset, data, mem_mask); | |
| 826 | 826 | if(0 && paletteram16[offset] != old) |
| 827 | 827 | logerror("XVIDEO: p_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, activecpu_get_pc()); |
| 828 | 828 | } |
| r1877 | r1878 | |
| 1000 | 1000 | |
| 1001 | 1001 | static READ16_HANDLER( m1_snd_mpcm0_r ) |
| 1002 | 1002 | { |
| 1003 | return MultiPCM_reg_0_r(0); | |
| 1003 | return MultiPCM_reg_0_r(machine, 0); | |
| 1004 | 1004 | } |
| 1005 | 1005 | |
| 1006 | 1006 | static WRITE16_HANDLER( m1_snd_mpcm0_w ) |
| 1007 | 1007 | { |
| 1008 | MultiPCM_reg_0_w(offset, data); | |
| 1008 | MultiPCM_reg_0_w(machine, offset, data); | |
| 1009 | 1009 | } |
| 1010 | 1010 | |
| 1011 | 1011 | static WRITE16_HANDLER( m1_snd_mpcm0_bnk_w ) |
| r1877 | r1878 | |
| 1015 | 1015 | |
| 1016 | 1016 | static READ16_HANDLER( m1_snd_mpcm1_r ) |
| 1017 | 1017 | { |
| 1018 | return MultiPCM_reg_1_r(0); | |
| 1018 | return MultiPCM_reg_1_r(machine, 0); | |
| 1019 | 1019 | } |
| 1020 | 1020 | |
| 1021 | 1021 | static WRITE16_HANDLER( m1_snd_mpcm1_w ) |
| 1022 | 1022 | { |
| 1023 | MultiPCM_reg_1_w(offset, data); | |
| 1023 | MultiPCM_reg_1_w(machine, offset, data); | |
| 1024 | 1024 | } |
| 1025 | 1025 | |
| 1026 | 1026 | static WRITE16_HANDLER( m1_snd_mpcm1_bnk_w ) |
| r1877 | r1878 | |
| 1030 | 1030 | |
| 1031 | 1031 | static READ16_HANDLER( m1_snd_ym_r ) |
| 1032 | 1032 | { |
| 1033 | return YM3438_status_port_0_A_r(0); | |
| 1033 | return YM3438_status_port_0_A_r(machine, 0); | |
| 1034 | 1034 | } |
| 1035 | 1035 | |
| 1036 | 1036 | static WRITE16_HANDLER( m1_snd_ym_w ) |
| r1877 | r1878 | |
| 1038 | 1038 | switch (offset) |
| 1039 | 1039 | { |
| 1040 | 1040 | case 0: |
| 1041 | YM3438_control_port_0_A_w(0, data); | |
| 1041 | YM3438_control_port_0_A_w(machine, 0, data); | |
| 1042 | 1042 | break; |
| 1043 | 1043 | |
| 1044 | 1044 | case 1: |
| 1045 | YM3438_data_port_0_A_w(0, data); | |
| 1045 | YM3438_data_port_0_A_w(machine, 0, data); | |
| 1046 | 1046 | break; |
| 1047 | 1047 | |
| 1048 | 1048 | case 2: |
| 1049 | YM3438_control_port_0_B_w(0, data); | |
| 1049 | YM3438_control_port_0_B_w(machine, 0, data); | |
| 1050 | 1050 | break; |
| 1051 | 1051 | |
| 1052 | 1052 | case 3: |
| 1053 | YM3438_data_port_0_B_w(0, data); | |
| 1053 | YM3438_data_port_0_B_w(machine, 0, data); | |
| 1054 | 1054 | break; |
| 1055 | 1055 | } |
| 1056 | 1056 | } |
| r1877 | r1878 | |
| 1534 | 1534 | MDRV_CPU_ADD(V60, 16000000) |
| 1535 | 1535 | MDRV_CPU_PROGRAM_MAP(model1_mem, 0) |
| 1536 | 1536 | MDRV_CPU_IO_MAP(model1_io, 0) |
| 1537 | MDRV_CPU_VBLANK_INT(model1_interrupt, 2) | |
| 1537 | MDRV_CPU_VBLANK_INT_HACK(model1_interrupt, 2) | |
| 1538 | 1538 | |
| 1539 | 1539 | MDRV_CPU_ADD(M68000, 10000000) // verified on real h/w |
| 1540 | 1540 | MDRV_CPU_PROGRAM_MAP(model1_snd, 0) |
| r1877 | r1878 | |
| 1580 | 1580 | MDRV_CPU_ADD(V60, 16000000) |
| 1581 | 1581 | MDRV_CPU_PROGRAM_MAP(model1_vr_mem, 0) |
| 1582 | 1582 | MDRV_CPU_IO_MAP(model1_vr_io, 0) |
| 1583 | MDRV_CPU_VBLANK_INT(model1_interrupt, 2) | |
| 1583 | MDRV_CPU_VBLANK_INT_HACK(model1_interrupt, 2) | |
| 1584 | 1584 | |
| 1585 | 1585 | MDRV_CPU_ADD(M68000, 10000000) // verified on real h/w |
| 1586 | 1586 | MDRV_CPU_PROGRAM_MAP(model1_snd, 0) |
| r1877 | r1878 | |
|---|---|---|
| 84 | 84 | |
| 85 | 85 | static WRITE8_HANDLER( actfancr_sound_w ) |
| 86 | 86 | { |
| 87 | soundlatch_w(0,data & 0xff); | |
| 88 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 87 | soundlatch_w(machine,0,data & 0xff); | |
| 88 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /******************************************************************************/ |
| r1877 | r1878 | |
| 352 | 352 | /* basic machine hardware */ |
| 353 | 353 | MDRV_CPU_ADD(H6280,21477200/3) /* Should be accurate */ |
| 354 | 354 | MDRV_CPU_PROGRAM_MAP(actfan_map,0) |
| 355 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 355 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 356 | 356 | |
| 357 | 357 | MDRV_CPU_ADD(M6502, 1500000) |
| 358 | 358 | /* audio CPU */ /* Should be accurate */ |
| r1877 | r1878 | |
| 396 | 396 | /* basic machine hardware */ |
| 397 | 397 | MDRV_CPU_ADD(H6280,XTAL_21_4772MHz/3) /* XIN=21.4772Mhz, verified on pcb */ |
| 398 | 398 | MDRV_CPU_PROGRAM_MAP(triothep_map,0) |
| 399 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 399 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 400 | 400 | |
| 401 | 401 | MDRV_CPU_ADD(M6502, XTAL_12MHz/8) /* verified on pcb */ |
| 402 | 402 | /* audio CPU */ /* Should be accurate */ |
| r1877 | r1878 | |
|---|---|---|
| 327 | 327 | case 0x00: /* IRQON */ |
| 328 | 328 | cpu_interrupt_enable(0,bit); |
| 329 | 329 | if (!bit) |
| 330 | cpunum_set_input_line( | |
| 330 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 331 | 331 | break; |
| 332 | 332 | |
| 333 | 333 | case 0x01: /* IOSEL */ |
| r1877 | r1878 | |
| 338 | 338 | polepos_sound_enable(bit); |
| 339 | 339 | if (!bit) |
| 340 | 340 | { |
| 341 | polepos_engine_sound_lsb_w(0,0); | |
| 342 | polepos_engine_sound_msb_w(0,0); | |
| 341 | polepos_engine_sound_lsb_w(machine,0,0); | |
| 342 | polepos_engine_sound_msb_w(machine,0,0); | |
| 343 | 343 | } |
| 344 | 344 | break; |
| 345 | 345 | |
| r1877 | r1878 | |
| 348 | 348 | break; |
| 349 | 349 | |
| 350 | 350 | case 0x04: /* RESB */ |
| 351 | cpunum_set_input_line( | |
| 351 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 352 | 352 | break; |
| 353 | 353 | |
| 354 | 354 | case 0x05: /* RESA */ |
| 355 | cpunum_set_input_line( | |
| 355 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); | |
| 356 | 356 | break; |
| 357 | 357 | |
| 358 | 358 | case 0x06: /* SB0 */ |
| r1877 | r1878 | |
| 360 | 360 | break; |
| 361 | 361 | |
| 362 | 362 | case 0x07: /* CHACL */ |
| 363 | polepos_chacl_w(offset,data); | |
| 363 | polepos_chacl_w(machine,offset,data); | |
| 364 | 364 | break; |
| 365 | 365 | } |
| 366 | 366 | } |
| r1877 | r1878 | |
| 417 | 417 | |
| 418 | 418 | /* Reset all latches */ |
| 419 | 419 | for (i = 0;i < 8;i++) |
| 420 | polepos_latch_w(i,0); | |
| 420 | polepos_latch_w(machine,i,0); | |
| 421 | 421 | |
| 422 | 422 | namco_06xx_init(0, 0, |
| 423 | 423 | NAMCOIO_51XX, &intf0, |
| r1877 | r1878 | |
| 882 | 882 | MDRV_CPU_ADD(Z80, 24576000/8) /* 3.072 MHz */ |
| 883 | 883 | MDRV_CPU_PROGRAM_MAP(z80_map,0) |
| 884 | 884 | MDRV_CPU_IO_MAP(z80_io,0) |
| 885 | MDRV_CPU_VBLANK_INT(irq0_line_assert,2) /* 64V */ | |
| 885 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_assert,2) /* 64V */ | |
| 886 | 886 | |
| 887 | 887 | MDRV_CPU_ADD(Z8000, 24576000/8) /* 3.072 MHz */ |
| 888 | 888 | MDRV_CPU_PROGRAM_MAP(z8002_map,0) |
| 889 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 889 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 890 | 890 | |
| 891 | 891 | MDRV_CPU_ADD(Z8000, 24576000/8) /* 3.072 MHz */ |
| 892 | 892 | MDRV_CPU_PROGRAM_MAP(z8002_map,0) |
| 893 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 893 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 894 | 894 | |
| 895 | 895 | MDRV_CPU_ADD_TAG(CPUTAG_54XX, MB8844, 18432000/12/6) /* 1.536 MHz, internally divided by 6 */ |
| 896 | 896 | MDRV_CPU_PROGRAM_MAP(namco_54xx_map_program,0) |
| r1877 | r1878 | |
|---|---|---|
| 328 | 328 | |
| 329 | 329 | static READ16_HANDLER( tracky1_hi_r ) |
| 330 | 330 | { |
| 331 | return input_port_5_word_r(0,0); | |
| 331 | return input_port_5_word_r(machine,0,0); | |
| 332 | 332 | } |
| 333 | 333 | static READ16_HANDLER( tracky1_lo_r ) |
| 334 | 334 | { |
| 335 | return (input_port_5_word_r(0,0) & 0xff) <<8; | |
| 335 | return (input_port_5_word_r(machine,0,0) & 0xff) <<8; | |
| 336 | 336 | } |
| 337 | 337 | static READ16_HANDLER( trackx1_hi_r ) |
| 338 | 338 | { |
| 339 | return input_port_6_word_r(0,0); | |
| 339 | return input_port_6_word_r(machine,0,0); | |
| 340 | 340 | } |
| 341 | 341 | static READ16_HANDLER( trackx1_lo_r ) |
| 342 | 342 | { |
| 343 | return (input_port_6_word_r(0,0) & 0xff) <<8; | |
| 343 | return (input_port_6_word_r(machine,0,0) & 0xff) <<8; | |
| 344 | 344 | } |
| 345 | 345 | static READ16_HANDLER( tracky2_hi_r ) |
| 346 | 346 | { |
| 347 | return input_port_7_word_r(0,0); | |
| 347 | return input_port_7_word_r(machine,0,0); | |
| 348 | 348 | } |
| 349 | 349 | static READ16_HANDLER( tracky2_lo_r ) |
| 350 | 350 | { |
| 351 | return (input_port_7_word_r(0,0) & 0xff) <<8; | |
| 351 | return (input_port_7_word_r(machine,0,0) & 0xff) <<8; | |
| 352 | 352 | } |
| 353 | 353 | static READ16_HANDLER( trackx2_hi_r ) |
| 354 | 354 | { |
| 355 | return input_port_8_word_r(0,0); | |
| 355 | return input_port_8_word_r(machine,0,0); | |
| 356 | 356 | } |
| 357 | 357 | static READ16_HANDLER( trackx2_lo_r ) |
| 358 | 358 | { |
| 359 | return (input_port_8_word_r(0,0) & 0xff) <<8; | |
| 359 | return (input_port_8_word_r(machine,0,0) & 0xff) <<8; | |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | |
| r1877 | r1878 | |
| 413 | 413 | int res; |
| 414 | 414 | |
| 415 | 415 | res = (EEPROM_read_bit() & 0x01); |
| 416 | res |= input_port_1_word_r(0,0) & 0xfe; /* coin inputs */ | |
| 416 | res |= input_port_1_word_r(machine,0,0) & 0xfe; /* coin inputs */ | |
| 417 | 417 | |
| 418 | 418 | return res; |
| 419 | 419 | } |
| r1877 | r1878 | |
| 482 | 482 | switch (offset) |
| 483 | 483 | { |
| 484 | 484 | case 0x01: |
| 485 | return eeprom_r(0,mem_mask) << 8; | |
| 485 | return eeprom_r(machine,0,mem_mask) << 8; | |
| 486 | 486 | |
| 487 | 487 | default: |
| 488 | return TC0640FIO_r( offset ) << 8; | |
| 488 | return TC0640FIO_r( machine,offset ) << 8; | |
| 489 | 489 | } |
| 490 | 490 | } |
| 491 | 491 | |
| r1877 | r1878 | |
| 2641 | 2641 | /* basic machine hardware */ |
| 2642 | 2642 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 2643 | 2643 | MDRV_CPU_PROGRAM_MAP(rastsag2_readmem,rastsag2_writemem) |
| 2644 | MDRV_CPU_VBLANK_INT(rastansaga2_interrupt | |
| 2644 | MDRV_CPU_VBLANK_INT("main", rastansaga2_interrupt | |
| 2645 | 2645 | |
| 2646 | 2646 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 2647 | 2647 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 2679 | 2679 | /* basic machine hardware */ |
| 2680 | 2680 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 2681 | 2681 | MDRV_CPU_PROGRAM_MAP(rastsag2_readmem,rastsag2_writemem) |
| 2682 | MDRV_CPU_VBLANK_INT(rastansaga2_interrupt | |
| 2682 | MDRV_CPU_VBLANK_INT("main", rastansaga2_interrupt | |
| 2683 | 2683 | |
| 2684 | 2684 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 2685 | 2685 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 2717 | 2717 | /* basic machine hardware */ |
| 2718 | 2718 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 2719 | 2719 | MDRV_CPU_PROGRAM_MAP(crimec_readmem,crimec_writemem) |
| 2720 | MDRV_CPU_VBLANK_INT(crimec_interrupt | |
| 2720 | MDRV_CPU_VBLANK_INT("main", crimec_interrupt | |
| 2721 | 2721 | |
| 2722 | 2722 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 2723 | 2723 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 2755 | 2755 | /* basic machine hardware */ |
| 2756 | 2756 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ???*/ |
| 2757 | 2757 | MDRV_CPU_PROGRAM_MAP(tetrist_readmem,tetrist_writemem) |
| 2758 | MDRV_CPU_VBLANK_INT(rastansaga2_interrupt | |
| 2758 | MDRV_CPU_VBLANK_INT("main", rastansaga2_interrupt | |
| 2759 | 2759 | |
| 2760 | 2760 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 2761 | 2761 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 2792 | 2792 | /* basic machine hardware */ |
| 2793 | 2793 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 2794 | 2794 | MDRV_CPU_PROGRAM_MAP(tetrista_readmem,tetrista_writemem) |
| 2795 | MDRV_CPU_VBLANK_INT(masterw_interrupt | |
| 2795 | MDRV_CPU_VBLANK_INT("main", masterw_interrupt | |
| 2796 | 2796 | |
| 2797 | 2797 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 2798 | 2798 | MDRV_CPU_PROGRAM_MAP(masterw_sound_readmem,masterw_sound_writemem) |
| r1877 | r1878 | |
| 2830 | 2830 | /* basic machine hardware */ |
| 2831 | 2831 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 2832 | 2832 | MDRV_CPU_PROGRAM_MAP(hitice_readmem, hitice_writemem) |
| 2833 | MDRV_CPU_VBLANK_INT(hitice_interrupt | |
| 2833 | MDRV_CPU_VBLANK_INT("main", hitice_interrupt | |
| 2834 | 2834 | |
| 2835 | 2835 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 2836 | 2836 | MDRV_CPU_PROGRAM_MAP(viofight_sound_readmem, viofight_sound_writemem) |
| r1877 | r1878 | |
| 2874 | 2874 | /* basic machine hardware */ |
| 2875 | 2875 | MDRV_CPU_ADD(M68000, XTAL_24MHz/2) /* verified on pcb */ |
| 2876 | 2876 | MDRV_CPU_PROGRAM_MAP(rambo3_readmem,rambo3_writemem) |
| 2877 | MDRV_CPU_VBLANK_INT(rambo3_interrupt | |
| 2877 | MDRV_CPU_VBLANK_INT("main", rambo3_interrupt | |
| 2878 | 2878 | |
| 2879 | 2879 | MDRV_CPU_ADD(Z80, XTAL_24MHz/6) /* verified on pcb */ |
| 2880 | 2880 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 2912 | 2912 | /* basic machine hardware */ |
| 2913 | 2913 | MDRV_CPU_ADD(M68000, XTAL_24MHz/2) /* verified on pcb */ |
| 2914 | 2914 | MDRV_CPU_PROGRAM_MAP(rambo3_readmem,rambo3_writemem) |
| 2915 | MDRV_CPU_VBLANK_INT(rambo3_interrupt | |
| 2915 | MDRV_CPU_VBLANK_INT("main", rambo3_interrupt | |
| 2916 | 2916 | |
| 2917 | 2917 | MDRV_CPU_ADD(Z80, XTAL_24MHz/6) /* verified on pcb */ |
| 2918 | 2918 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 2950 | 2950 | /* basic machine hardware */ |
| 2951 | 2951 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 2952 | 2952 | MDRV_CPU_PROGRAM_MAP(pbobble_readmem,pbobble_writemem) |
| 2953 | MDRV_CPU_VBLANK_INT(pbobble_interrupt | |
| 2953 | MDRV_CPU_VBLANK_INT("main", pbobble_interrupt | |
| 2954 | 2954 | |
| 2955 | 2955 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 2956 | 2956 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 2991 | 2991 | /* basic machine hardware */ |
| 2992 | 2992 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 2993 | 2993 | MDRV_CPU_PROGRAM_MAP(spacedx_readmem,spacedx_writemem) |
| 2994 | MDRV_CPU_VBLANK_INT(pbobble_interrupt | |
| 2994 | MDRV_CPU_VBLANK_INT("main", pbobble_interrupt | |
| 2995 | 2995 | |
| 2996 | 2996 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 2997 | 2997 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 3032 | 3032 | /* basic machine hardware */ |
| 3033 | 3033 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 3034 | 3034 | MDRV_CPU_PROGRAM_MAP(spacedxo_readmem,spacedxo_writemem) |
| 3035 | MDRV_CPU_VBLANK_INT(selfeena_interrupt | |
| 3035 | MDRV_CPU_VBLANK_INT("main", selfeena_interrupt | |
| 3036 | 3036 | |
| 3037 | 3037 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 3038 | 3038 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 3070 | 3070 | /* basic machine hardware */ |
| 3071 | 3071 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz according to the readme*/ |
| 3072 | 3072 | MDRV_CPU_PROGRAM_MAP(qzshowby_readmem,qzshowby_writemem) |
| 3073 | MDRV_CPU_VBLANK_INT(pbobble_interrupt | |
| 3073 | MDRV_CPU_VBLANK_INT("main", pbobble_interrupt | |
| 3074 | 3074 | |
| 3075 | 3075 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 3076 | 3076 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 3111 | 3111 | /* basic machine hardware */ |
| 3112 | 3112 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 3113 | 3113 | MDRV_CPU_PROGRAM_MAP(viofight_readmem,viofight_writemem) |
| 3114 | MDRV_CPU_VBLANK_INT(viofight_interrupt | |
| 3114 | MDRV_CPU_VBLANK_INT("main", viofight_interrupt | |
| 3115 | 3115 | |
| 3116 | 3116 | MDRV_CPU_ADD(Z80, 6000000) /* 6 MHz verified */ |
| 3117 | 3117 | MDRV_CPU_PROGRAM_MAP(viofight_sound_readmem, viofight_sound_writemem) |
| r1877 | r1878 | |
| 3153 | 3153 | /* basic machine hardware */ |
| 3154 | 3154 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 3155 | 3155 | MDRV_CPU_PROGRAM_MAP(masterw_readmem,masterw_writemem) |
| 3156 | MDRV_CPU_VBLANK_INT(masterw_interrupt | |
| 3156 | MDRV_CPU_VBLANK_INT("main", masterw_interrupt | |
| 3157 | 3157 | |
| 3158 | 3158 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 3159 | 3159 | MDRV_CPU_PROGRAM_MAP(masterw_sound_readmem,masterw_sound_writemem) |
| r1877 | r1878 | |
| 3192 | 3192 | /* basic machine hardware */ |
| 3193 | 3193 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz ??? */ |
| 3194 | 3194 | MDRV_CPU_PROGRAM_MAP(silentd_readmem,silentd_writemem) |
| 3195 | MDRV_CPU_VBLANK_INT(silentd_interrupt | |
| 3195 | MDRV_CPU_VBLANK_INT("main", silentd_interrupt | |
| 3196 | 3196 | |
| 3197 | 3197 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 3198 | 3198 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 3230 | 3230 | /* basic machine hardware */ |
| 3231 | 3231 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 3232 | 3232 | MDRV_CPU_PROGRAM_MAP(selfeena_readmem,selfeena_writemem) |
| 3233 | MDRV_CPU_VBLANK_INT(selfeena_interrupt | |
| 3233 | MDRV_CPU_VBLANK_INT("main", selfeena_interrupt | |
| 3234 | 3234 | |
| 3235 | 3235 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 3236 | 3236 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 3277 | 3277 | /* basic machine hardware */ |
| 3278 | 3278 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 3279 | 3279 | MDRV_CPU_PROGRAM_MAP(selfeena_readmem,selfeena_writemem) |
| 3280 | MDRV_CPU_VBLANK_INT(selfeena_interrupt | |
| 3280 | MDRV_CPU_VBLANK_INT("main", selfeena_interrupt | |
| 3281 | 3281 | |
| 3282 | 3282 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 3283 | 3283 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 3322 | 3322 | /* basic machine hardware */ |
| 3323 | 3323 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 3324 | 3324 | MDRV_CPU_PROGRAM_MAP(sbm_readmem,sbm_writemem) |
| 3325 | MDRV_CPU_VBLANK_INT(sbm_interrupt | |
| 3325 | MDRV_CPU_VBLANK_INT("main", sbm_interrupt | |
| 3326 | 3326 | |
| 3327 | 3327 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 3328 | 3328 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 259 | 259 | // basic machine hardware |
| 260 | 260 | MDRV_CPU_ADD(M6809, MASTER_CLOCK/12) // verified on pcb |
| 261 | 261 | MDRV_CPU_PROGRAM_MAP(master_map, 0) |
| 262 | MDRV_CPU_VBLANK_INT(jackal_interrupt | |
| 262 | MDRV_CPU_VBLANK_INT("main", jackal_interrupt | |
| 263 | 263 | |
| 264 | 264 | MDRV_CPU_ADD(M6809, MASTER_CLOCK/12) // verified on pcb |
| 265 | 265 | MDRV_CPU_PROGRAM_MAP(slave_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 41 | 41 | { |
| 42 | 42 | collision_index &= ~0x3f; |
| 43 | 43 | |
| 44 | cpunum_set_input_line( | |
| 44 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | static WRITE8_HANDLER( tank8_crash_w ) |
| 48 | 48 | { |
| 49 | discrete_sound_w(TANK8_CRASH_EN, data); | |
| 49 | discrete_sound_w(machine, TANK8_CRASH_EN, data); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | static WRITE8_HANDLER( tank8_explosion_w ) |
| 53 | 53 | { |
| 54 | discrete_sound_w(TANK8_EXPLOSION_EN, data); | |
| 54 | discrete_sound_w(machine, TANK8_EXPLOSION_EN, data); | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | static WRITE8_HANDLER( tank8_bugle_w ) |
| 58 | 58 | { |
| 59 | discrete_sound_w(TANK8_BUGLE_EN, data); | |
| 59 | discrete_sound_w(machine, TANK8_BUGLE_EN, data); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | static WRITE8_HANDLER( tank8_bug_w ) |
| r1877 | r1878 | |
| 64 | 64 | /* D0 and D1 determine the on/off time off the square wave */ |
| 65 | 65 | switch(data & 3) { |
| 66 | 66 | case 0: |
| 67 | discrete_sound_w(TANK8_BUGLE_DATA1,8.0); | |
| 68 | discrete_sound_w(TANK8_BUGLE_DATA2,4.0); | |
| 67 | discrete_sound_w(machine, TANK8_BUGLE_DATA1,8.0); | |
| 68 | discrete_sound_w(machine, TANK8_BUGLE_DATA2,4.0); | |
| 69 | 69 | break; |
| 70 | 70 | case 1: |
| 71 | discrete_sound_w(TANK8_BUGLE_DATA1,8.0); | |
| 72 | discrete_sound_w(TANK8_BUGLE_DATA2,7.0); | |
| 71 | discrete_sound_w(machine, TANK8_BUGLE_DATA1,8.0); | |
| 72 | discrete_sound_w(machine, TANK8_BUGLE_DATA2,7.0); | |
| 73 | 73 | break; |
| 74 | 74 | case 2: |
| 75 | discrete_sound_w(TANK8_BUGLE_DATA1,8.0); | |
| 76 | discrete_sound_w(TANK8_BUGLE_DATA2,2.0); | |
| 75 | discrete_sound_w(machine, TANK8_BUGLE_DATA1,8.0); | |
| 76 | discrete_sound_w(machine, TANK8_BUGLE_DATA2,2.0); | |
| 77 | 77 | break; |
| 78 | 78 | case 3: |
| 79 | discrete_sound_w(TANK8_BUGLE_DATA1,16.0); | |
| 80 | discrete_sound_w(TANK8_BUGLE_DATA2,4.0); | |
| 79 | discrete_sound_w(machine, TANK8_BUGLE_DATA1,16.0); | |
| 80 | discrete_sound_w(machine, TANK8_BUGLE_DATA2,4.0); | |
| 81 | 81 | break; |
| 82 | 82 | } |
| 83 | 83 | |
| r1877 | r1878 | |
| 85 | 85 | |
| 86 | 86 | static WRITE8_HANDLER( tank8_attract_w ) |
| 87 | 87 | { |
| 88 | discrete_sound_w(TANK8_ATTRACT_EN, data); | |
| 88 | discrete_sound_w(machine, TANK8_ATTRACT_EN, data); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | static WRITE8_HANDLER( tank8_motor_w ) |
| 92 | 92 | { |
| 93 | discrete_sound_w(TANK8_MOTOR1_EN+offset, data); | |
| 93 | discrete_sound_w(machine, TANK8_MOTOR1_EN+offset, data); | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | static ADDRESS_MAP_START( tank8_cpu_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
|---|---|---|
| 81 | 81 | |
| 82 | 82 | static READ64_HANDLER( pci_config_addr_r ) |
| 83 | 83 | { |
| 84 | return pci_64be_r(0, U64(0x00000000ffffffff)); | |
| 84 | return pci_64be_r(machine, 0, U64(0x00000000ffffffff)); | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | static WRITE64_HANDLER( pci_config_addr_w ) |
| 88 | 88 | { |
| 89 | pci_64be_w(0, data, U64(0x00000000ffffffff)); | |
| 89 | pci_64be_w(machine, 0, data, U64(0x00000000ffffffff)); | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | static READ64_HANDLER( pci_config_data_r ) |
| 93 | 93 | { |
| 94 | return pci_64be_r(1, U64(0xffffffff00000000)) << 32; | |
| 94 | return pci_64be_r(machine, 1, U64(0xffffffff00000000)) << 32; | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | static WRITE64_HANDLER( pci_config_data_w ) |
| 98 | 98 | { |
| 99 | pci_64be_w(1, data >> 32, U64(0xffffffff00000000)); | |
| 99 | pci_64be_w(machine, 1, data >> 32, U64(0xffffffff00000000)); | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | |
| r1877 | r1878 | |
| 153 | 153 | |
| 154 | 154 | static READ64_HANDLER(epic_64be_r) |
| 155 | 155 | { |
| 156 | return read64be_with_32le_handler(epic_r, offset, mem_mask); | |
| 156 | return read64be_with_32le_handler(epic_r, machine, offset, mem_mask); | |
| 157 | 157 | } |
| 158 | 158 | static WRITE64_HANDLER(epic_64be_w) |
| 159 | 159 | { |
| 160 | write64be_with_32le_handler(epic_w, offset, data, mem_mask); | |
| 160 | write64be_with_32le_handler(epic_w, machine, offset, data, mem_mask); | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | |
| r1877 | r1878 | |
| 529 | 529 | |
| 530 | 530 | static READ64_HANDLER(voodoo3_io_r) |
| 531 | 531 | { |
| 532 | return read64be_with_32le_handler(banshee_io_0_r, offset, mem_mask); | |
| 532 | return read64be_with_32le_handler(banshee_io_0_r, machine, offset, mem_mask); | |
| 533 | 533 | } |
| 534 | 534 | static WRITE64_HANDLER(voodoo3_io_w) |
| 535 | 535 | { |
| 536 | 536 | // printf("voodoo3_io_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, activecpu_get_pc()); |
| 537 | write64be_with_32le_handler(banshee_io_0_w, offset, data, mem_mask); | |
| 537 | write64be_with_32le_handler(banshee_io_0_w, machine, offset, data, mem_mask); | |
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | static READ64_HANDLER(voodoo3_r) |
| 541 | 541 | { |
| 542 | return read64be_with_32le_handler(banshee_0_r, offset, mem_mask); | |
| 542 | return read64be_with_32le_handler(banshee_0_r, machine, offset, mem_mask); | |
| 543 | 543 | } |
| 544 | 544 | static WRITE64_HANDLER(voodoo3_w) |
| 545 | 545 | { |
| 546 | 546 | // printf("voodoo3_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, activecpu_get_pc()); |
| 547 | write64be_with_32le_handler(banshee_0_w, offset, data, mem_mask); | |
| 547 | write64be_with_32le_handler(banshee_0_w, machine, offset, data, mem_mask); | |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | static READ64_HANDLER(voodoo3_lfb_r) |
| 551 | 551 | { |
| 552 | return read64be_with_32le_handler(banshee_fb_0_r, offset, mem_mask); | |
| 552 | return read64be_with_32le_handler(banshee_fb_0_r, machine, offset, mem_mask); | |
| 553 | 553 | } |
| 554 | 554 | static WRITE64_HANDLER(voodoo3_lfb_w) |
| 555 | 555 | { |
| 556 | 556 | // printf("voodoo3_lfb_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, activecpu_get_pc()); |
| 557 | write64be_with_32le_handler(banshee_fb_0_w, offset, data, mem_mask); | |
| 557 | write64be_with_32le_handler(banshee_fb_0_w, machine, offset, data, mem_mask); | |
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | |
| r1877 | r1878 | |
| 565 | 565 | |
| 566 | 566 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 567 | 567 | { |
| 568 | r |= (UINT64)timekeeper_0_32be_r((offset * 2) + 0, (UINT32)(mem_mask >> 32)) << 32; | |
| 568 | r |= (UINT64)timekeeper_0_32be_r(machine, (offset * 2) + 0, (UINT32)(mem_mask >> 32)) << 32; | |
| 569 | 569 | } |
| 570 | 570 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 571 | 571 | { |
| 572 | r |= timekeeper_0_32be_r((offset * 2) + 1, (UINT32)(mem_mask)); | |
| 572 | r |= timekeeper_0_32be_r(machine, (offset * 2) + 1, (UINT32)(mem_mask)); | |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | return r; |
| r1877 | r1878 | |
| 579 | 579 | { |
| 580 | 580 | if (!(mem_mask & U64(0xffffffff00000000))) |
| 581 | 581 | { |
| 582 | timekeeper_0_32be_w((offset * 2) + 0, (UINT32)(data >> 32), (UINT32)(mem_mask >> 32)); | |
| 582 | timekeeper_0_32be_w(machine, (offset * 2) + 0, (UINT32)(data >> 32), (UINT32)(mem_mask >> 32)); | |
| 583 | 583 | } |
| 584 | 584 | if (!(mem_mask & U64(0x00000000ffffffff))) |
| 585 | 585 | { |
| 586 | timekeeper_0_32be_w((offset * 2) + 1, (UINT32)(data), (UINT32)(mem_mask)); | |
| 586 | timekeeper_0_32be_w(machine, (offset * 2) + 1, (UINT32)(data), (UINT32)(mem_mask)); | |
| 587 | 587 | } |
| 588 | 588 | } |
| 589 | 589 | |
| r1877 | r1878 | |
| 636 | 636 | MDRV_CPU_ADD(MPC8240, 200000000) |
| 637 | 637 | MDRV_CPU_CONFIG(viper_ppc_cfg) |
| 638 | 638 | MDRV_CPU_PROGRAM_MAP(viper_map, 0) |
| 639 | MDRV_CPU_VBLANK_INT(viper_vblank | |
| 639 | MDRV_CPU_VBLANK_INT("main", viper_vblank | |
| 640 | 640 | |
| 641 | 641 | MDRV_MACHINE_RESET(viper) |
| 642 | 642 |
| r1877 | r1878 | |
|---|---|---|
| 34 | 34 | ****************************************************************************/ |
| 35 | 35 | |
| 36 | 36 | #include "driver.h" |
| 37 | #include "deprecat.h" | |
| 37 | 38 | #include "machine/pcecommn.h" |
| 38 | 39 | #include "video/vdc.h" |
| 39 | 40 | #include "cpu/h6280/h6280.h" |
| r1877 | r1878 | |
| 132 | 133 | MDRV_CPU_ADD(H6280, PCE_MAIN_CLOCK/3) |
| 133 | 134 | MDRV_CPU_PROGRAM_MAP(pce_mem, 0) |
| 134 | 135 | MDRV_CPU_IO_MAP(pce_io, 0) |
| 135 | MDRV_CPU_VBLANK_INT(pce_interrupt, VDC_LPF) | |
| 136 | MDRV_CPU_VBLANK_INT_HACK(pce_interrupt, VDC_LPF) | |
| 136 | 137 | |
| 137 | 138 | MDRV_INTERLEAVE(1) |
| 138 | 139 | |
| r1877 | r1878 | |
| 181 | 182 | static DRIVER_INIT(paranoia) |
| 182 | 183 | { |
| 183 | 184 | DRIVER_INIT_CALL(pce); |
| 184 | } | |
| 185 | } | |
| 185 | 186 | |
| 186 | 187 | GAME( 1990, paranoia, 0, paranoia, paranoia, paranoia, ROT0, "Naxat Soft", "Paranoia", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) |
| r1877 | r1878 | |
|---|---|---|
| 141 | 141 | ****************************************************************************/ |
| 142 | 142 | |
| 143 | 143 | #include "driver.h" |
| 144 | #include "deprecat.h" | |
| 144 | 145 | #include "rendlay.h" |
| 145 | 146 | #include "rescap.h" |
| 146 | 147 | #include "mw8080bw.h" |
| r1877 | r1878 | |
| 163 | 164 | |
| 164 | 165 | static READ8_HANDLER( mw8080bw_shift_result_rev_r ) |
| 165 | 166 | { |
| 166 | UINT8 ret = mb14241_0_shift_result_r(0); | |
| 167 | UINT8 ret = mb14241_0_shift_result_r(machine, 0); | |
| 167 | 168 | |
| 168 | 169 | return BITSWAP8(ret,0,1,2,3,4,5,6,7); |
| 169 | 170 | } |
| r1877 | r1878 | |
| 175 | 176 | |
| 176 | 177 | if (rev_shift_res) |
| 177 | 178 | { |
| 178 | ret = mw8080bw_shift_result_rev_r(0); | |
| 179 | ret = mw8080bw_shift_result_rev_r(machine, 0); | |
| 179 | 180 | } |
| 180 | 181 | else |
| 181 | 182 | { |
| 182 | ret = mb14241_0_shift_result_r(0); | |
| 183 | ret = mb14241_0_shift_result_r(machine, 0); | |
| 183 | 184 | } |
| 184 | 185 | |
| 185 | 186 | return ret; |
| r1877 | r1878 | |
| 187 | 188 | |
| 188 | 189 | static WRITE8_HANDLER( mw8080bw_reversable_shift_count_w) |
| 189 | 190 | { |
| 190 | mb14241_0_shift_count_w(offset, data); | |
| 191 | mb14241_0_shift_count_w(machine, offset, data); | |
| 191 | 192 | |
| 192 | 193 | rev_shift_res = data & 0x08; |
| 193 | 194 | } |
| r1877 | r1878 | |
| 421 | 422 | |
| 422 | 423 | static WRITE8_HANDLER( gunfight_io_w ) |
| 423 | 424 | { |
| 424 | if (offset & 0x01) gunfight_audio_w(0, data); | |
| 425 | if (offset & 0x01) gunfight_audio_w(machine, 0, data); | |
| 425 | 426 | |
| 426 | if (offset & 0x02) mb14241_0_shift_count_w(0, data); | |
| 427 | if (offset & 0x02) mb14241_0_shift_count_w(machine, 0, data); | |
| 427 | 428 | |
| 428 | if (offset & 0x04) mb14241_0_shift_data_w(0, data); | |
| 429 | if (offset & 0x04) mb14241_0_shift_data_w(machine, 0, data); | |
| 429 | 430 | } |
| 430 | 431 | |
| 431 | 432 | |
| r1877 | r1878 | |
| 610 | 611 | |
| 611 | 612 | static WRITE8_HANDLER( tornbase_io_w ) |
| 612 | 613 | { |
| 613 | if (offset & 0x01) tornbase_audio_w(0, data); | |
| 614 | if (offset & 0x01) tornbase_audio_w(machine, 0, data); | |
| 614 | 615 | |
| 615 | if (offset & 0x02) mb14241_0_shift_count_w(0, data); | |
| 616 | if (offset & 0x02) mb14241_0_shift_count_w(machine, 0, data); | |
| 616 | 617 | |
| 617 | if (offset & 0x04) mb14241_0_shift_data_w(0, data); | |
| 618 | if (offset & 0x04) mb14241_0_shift_data_w(machine, 0, data); | |
| 618 | 619 | } |
| 619 | 620 | |
| 620 | 621 | |
| r1877 | r1878 | |
| 858 | 859 | |
| 859 | 860 | static void maze_update_discrete(void) |
| 860 | 861 | { |
| 861 | maze_write_discrete(maze_tone_timing_state); | |
| 862 | maze_write_discrete(Machine, maze_tone_timing_state); | |
| 862 | 863 | } |
| 863 | 864 | |
| 864 | 865 | |
| 865 | 866 | static TIMER_CALLBACK( maze_tone_timing_timer_callback ) |
| 866 | 867 | { |
| 867 | 868 | maze_tone_timing_state = !maze_tone_timing_state; |
| 868 | maze_write_discrete(maze_tone_timing_state); | |
| 869 | maze_write_discrete(machine, maze_tone_timing_state); | |
| 869 | 870 | } |
| 870 | 871 | |
| 871 | 872 | |
| r1877 | r1878 | |
| 895 | 896 | |
| 896 | 897 | static WRITE8_HANDLER( maze_io_w ) |
| 897 | 898 | { |
| 898 | if (offset & 0x01) maze_coin_counter_w(0, data); | |
| 899 | if (offset & 0x01) maze_coin_counter_w(machine, 0, data); | |
| 899 | 900 | |
| 900 | if (offset & 0x02) watchdog_reset_w(0, data); | |
| 901 | if (offset & 0x02) watchdog_reset_w(machine, 0, data); | |
| 901 | 902 | } |
| 902 | 903 | |
| 903 | 904 | |
| r1877 | r1878 | |
| 1054 | 1055 | |
| 1055 | 1056 | static WRITE8_HANDLER( checkmat_io_w ) |
| 1056 | 1057 | { |
| 1057 | if (offset & 0x01) checkmat_audio_w(0, data); | |
| 1058 | if (offset & 0x01) checkmat_audio_w(machine, 0, data); | |
| 1058 | 1059 | |
| 1059 | if (offset & 0x02) watchdog_reset_w(0, data); | |
| 1060 | if (offset & 0x02) watchdog_reset_w(machine, 0, data); | |
| 1060 | 1061 | } |
| 1061 | 1062 | |
| 1062 | 1063 | |
| r1877 | r1878 | |
| 2095 | 2096 | { /* A7 A6 A5 A4 A3 A2 A1 A0 */ |
| 2096 | 2097 | if ((offset & 0x07) == 0x02) |
| 2097 | 2098 | { |
| 2098 | watchdog_reset_w(0, data); /* - - - - - 0 1 0 */ | |
| 2099 | watchdog_reset_w(machine, 0, data); /* - - - - - 0 1 0 */ | |
| 2099 | 2100 | } |
| 2100 | 2101 | else if ((offset & 0x5f) == 0x01) |
| 2101 | 2102 | { |
| 2102 | spcenctr_audio_1_w(0, data); /* - 0 - 0 0 0 0 1 */ | |
| 2103 | spcenctr_audio_1_w(machine, 0, data); /* - 0 - 0 0 0 0 1 */ | |
| 2103 | 2104 | } |
| 2104 | 2105 | else if ((offset & 0x5f) == 0x09) |
| 2105 | 2106 | { |
| 2106 | spcenctr_audio_2_w(0, data); /* - 0 - 0 1 0 0 1 */ | |
| 2107 | spcenctr_audio_2_w(machine, 0, data); /* - 0 - 0 1 0 0 1 */ | |
| 2107 | 2108 | } |
| 2108 | 2109 | else if ((offset & 0x5f) == 0x11) |
| 2109 | 2110 | { |
| 2110 | spcenctr_audio_3_w(0, data); /* - 0 - 1 0 0 0 1 */ | |
| 2111 | spcenctr_audio_3_w(machine, 0, data); /* - 0 - 1 0 0 0 1 */ | |
| 2111 | 2112 | } |
| 2112 | 2113 | else if ((offset & 0x07) == 0x03) |
| 2113 | 2114 | { /* - - - - - 0 1 1 */ |
| r1877 | r1878 | |
| 2324 | 2325 | anything unusual on the schematics that would cause |
| 2325 | 2326 | the bits to flip */ |
| 2326 | 2327 | |
| 2327 | return ~mb14241_0_shift_result_r(0); | |
| 2328 | return ~mb14241_0_shift_result_r(machine,0); | |
| 2328 | 2329 | } |
| 2329 | 2330 | |
| 2330 | 2331 |
| r1877 | r1878 | |
|---|---|---|
| 283 | 283 | if (wdog == 3) |
| 284 | 284 | { |
| 285 | 285 | wdog = 0; |
| 286 | watchdog_reset_w(0,0); | |
| 286 | watchdog_reset_w(machine,0,0); | |
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | |
| r1877 | r1878 | |
| 293 | 293 | if (wdog == 3) |
| 294 | 294 | { |
| 295 | 295 | wdog = 0; |
| 296 | watchdog_reset_w(0,0); | |
| 296 | watchdog_reset_w(machine,0,0); | |
| 297 | 297 | } |
| 298 | 298 | } |
| 299 | 299 | |
| r1877 | r1878 | |
| 331 | 331 | break; |
| 332 | 332 | |
| 333 | 333 | case 4: |
| 334 | bankswitch1_ext_w(0,data); | |
| 334 | bankswitch1_ext_w(machine,0,data); | |
| 335 | 335 | break; |
| 336 | 336 | |
| 337 | 337 | case 5: // not used? |
| r1877 | r1878 | |
| 1066 | 1066 | /* basic machine hardware */ |
| 1067 | 1067 | MDRV_CPU_ADD_TAG("cpu1", M6809, 49152000/32) |
| 1068 | 1068 | MDRV_CPU_PROGRAM_MAP(cpu1_map,0) |
| 1069 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1069 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1070 | 1070 | |
| 1071 | 1071 | MDRV_CPU_ADD_TAG("cpu2", M6809, 49152000/32) |
| 1072 | 1072 | MDRV_CPU_PROGRAM_MAP(hopmappy_cpu2_map,0) |
| 1073 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1073 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1074 | 1074 | |
| 1075 | 1075 | MDRV_CPU_ADD_TAG("mcu", HD63701, 49152000/8) /* or compatible 6808 with extra instructions */ |
| 1076 | 1076 | MDRV_CPU_PROGRAM_MAP(hopmappy_mcu_map,0) |
| 1077 | 1077 | MDRV_CPU_IO_MAP(mcu_port_map,0) |
| 1078 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1078 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1079 | 1079 | |
| 1080 | 1080 | MDRV_INTERLEAVE(800) /* heavy interleaving needed to avoid hangs in rthunder */ |
| 1081 | 1081 |
| r1877 | r1878 | |
|---|---|---|
| 659 | 659 | if (data & ~0x02) logerror("CPU #0 - PC %04X: unknown palettebank bits: %02X\n",activecpu_get_pc(),data); |
| 660 | 660 | |
| 661 | 661 | /* Also used as soundlatch - depending on c0c0? */ |
| 662 | soundlatch_w(0,data); | |
| 662 | soundlatch_w(machine,0,data); | |
| 663 | 663 | } |
| 664 | 664 | |
| 665 | 665 | /* |
| r1877 | r1878 | |
| 960 | 960 | |
| 961 | 961 | static READ8_HANDLER( sparkman_c0a3_r ) |
| 962 | 962 | { |
| 963 | return ( | |
| 963 | return (vid | |
| 964 | 964 | } |
| 965 | 965 | |
| 966 | 966 | static ADDRESS_MAP_START( sparkman_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 1553 | 1553 | MDRV_CPU_ADD(Z80, 24000000 / 4) /* ? */ |
| 1554 | 1554 | MDRV_CPU_PROGRAM_MAP(hardhead_readmem,hardhead_writemem) |
| 1555 | 1555 | MDRV_CPU_IO_MAP(hardhead_readport,hardhead_writeport) |
| 1556 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1556 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1557 | 1557 | |
| 1558 | 1558 | MDRV_CPU_ADD(Z80, 24000000 / 4) |
| 1559 | 1559 | /* audio CPU */ /* ? */ |
| 1560 | 1560 | MDRV_CPU_PROGRAM_MAP(hardhead_sound_readmem,hardhead_sound_writemem) |
| 1561 | 1561 | MDRV_CPU_IO_MAP(hardhead_sound_readport,hardhead_sound_writeport) |
| 1562 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) /* No NMI */ | |
| 1562 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* No NMI */ | |
| 1563 | 1563 | |
| 1564 | 1564 | /* video hardware */ |
| 1565 | 1565 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 1608 | 1608 | MDRV_CPU_ADD(Z80, 24000000 / 4) /* ? */ |
| 1609 | 1609 | MDRV_CPU_PROGRAM_MAP(rranger_readmem,rranger_writemem) |
| 1610 | 1610 | MDRV_CPU_IO_MAP(rranger_readport,rranger_writeport) |
| 1611 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1611 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1612 | 1612 | |
| 1613 | 1613 | MDRV_CPU_ADD(Z80, 24000000 / 4) |
| 1614 | 1614 | /* audio CPU */ /* ? */ |
| 1615 | 1615 | MDRV_CPU_PROGRAM_MAP(rranger_sound_readmem,rranger_sound_writemem) |
| 1616 | 1616 | MDRV_CPU_IO_MAP(rranger_sound_readport,rranger_sound_writeport) |
| 1617 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) /* NMI = retn */ | |
| 1617 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* NMI = retn */ | |
| 1618 | 1618 | |
| 1619 | 1619 | /* video hardware */ |
| 1620 | 1620 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 1666 | 1666 | MDRV_CPU_ADD_TAG("main", Z80, 24000000 / 4) /* SUNA PROTECTION BLOCK */ |
| 1667 | 1667 | MDRV_CPU_PROGRAM_MAP(brickzn_readmem,brickzn_writemem) |
| 1668 | 1668 | MDRV_CPU_IO_MAP(brickzn_readport,brickzn_writeport) |
| 1669 | // MDRV_CPU_VBLANK_INT(brickzn_interrupt, 2) | |
| 1670 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) // nmi breaks ramtest but is needed! | |
| 1669 | // MDRV_CPU_VBLANK_INT_HACK(brickzn_interrupt, 2) | |
| 1670 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) // nmi breaks ramtest but is needed! | |
| 1671 | 1671 | |
| 1672 | 1672 | MDRV_CPU_ADD_TAG("sound", Z80, 24000000 / 4) /* Z0840006PSC */ |
| 1673 | 1673 | /* audio CPU */ |
| r1877 | r1878 | |
| 1736 | 1736 | |
| 1737 | 1737 | static MACHINE_RESET( hardhea2 ) |
| 1738 | 1738 | { |
| 1739 | hardhea2_rambank_0_w(0,0); | |
| 1739 | hardhea2_rambank_0_w(machine,0,0); | |
| 1740 | 1740 | } |
| 1741 | 1741 | |
| 1742 | 1742 | static MACHINE_DRIVER_START( hardhea2 ) |
| r1877 | r1878 | |
| 1744 | 1744 | MDRV_IMPORT_FROM( brickzn ) |
| 1745 | 1745 | MDRV_CPU_MODIFY("main") /* SUNA T568009 */ |
| 1746 | 1746 | MDRV_CPU_PROGRAM_MAP(hardhea2_readmem,hardhea2_writemem) |
| 1747 | MDRV_CPU_VBLANK_INT(hardhea2_interrupt,2) /* IRQ & NMI */ | |
| 1747 | MDRV_CPU_VBLANK_INT_HACK(hardhea2_interrupt,2) /* IRQ & NMI */ | |
| 1748 | 1748 | |
| 1749 | 1749 | MDRV_MACHINE_RESET(hardhea2) |
| 1750 | 1750 | MDRV_PALETTE_LENGTH(256) |
| r1877 | r1878 | |
| 1769 | 1769 | MDRV_CPU_ADD(Z80, 24000000 / 4) /* ? */ |
| 1770 | 1770 | MDRV_CPU_PROGRAM_MAP(starfigh_readmem,starfigh_writemem) |
| 1771 | 1771 | MDRV_CPU_IO_MAP(starfigh_readport,starfigh_writeport) |
| 1772 | MDRV_CPU_VBLANK_INT(brickzn_interrupt,2) /* IRQ & NMI */ | |
| 1772 | MDRV_CPU_VBLANK_INT_HACK(brickzn_interrupt,2) /* IRQ & NMI */ | |
| 1773 | 1773 | |
| 1774 | 1774 | /* The sound section is identical to that of hardhead */ |
| 1775 | 1775 | MDRV_CPU_ADD(Z80, 24000000 / 4) |
| 1776 | 1776 | /* audio CPU */ /* ? */ |
| 1777 | 1777 | MDRV_CPU_PROGRAM_MAP(hardhead_sound_readmem,hardhead_sound_writemem) |
| 1778 | 1778 | MDRV_CPU_IO_MAP(hardhead_sound_readport,hardhead_sound_writeport) |
| 1779 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) /* No NMI */ | |
| 1779 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* No NMI */ | |
| 1780 | 1780 | |
| 1781 | 1781 | /* video hardware */ |
| 1782 | 1782 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 1829 | 1829 | /* basic machine hardware */ |
| 1830 | 1830 | MDRV_CPU_ADD(Z80, 24000000 / 4) /* ? */ |
| 1831 | 1831 | MDRV_CPU_PROGRAM_MAP(sparkman_readmem,sparkman_writemem) |
| 1832 | MDRV_CPU_VBLANK_INT(sparkman_interrupt,2) /* IRQ & NMI */ | |
| 1832 | MDRV_CPU_VBLANK_INT_HACK(sparkman_interrupt,2) /* IRQ & NMI */ | |
| 1833 | 1833 | |
| 1834 | 1834 | MDRV_CPU_ADD(Z80, 24000000 / 4) |
| 1835 | 1835 | /* audio CPU */ /* ? */ |
| 1836 | 1836 | MDRV_CPU_PROGRAM_MAP(hardhead_sound_readmem,hardhead_sound_writemem) |
| 1837 | 1837 | MDRV_CPU_IO_MAP(hardhead_sound_readport,hardhead_sound_writeport) |
| 1838 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) /* No NMI */ | |
| 1838 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* No NMI */ | |
| 1839 | 1839 | |
| 1840 | 1840 | /* video hardware */ |
| 1841 | 1841 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 29 | 29 | { |
| 30 | 30 | /* Force synchronisation between CPUs with fake timer */ |
| 31 | 31 | timer_call_after_resynch(NULL, 0, NULL); |
| 32 | soundlatch_w(0,data & 0xff); | |
| 33 | cpunum_set_input_line(Machine, 1,0,ASSERT_LINE); | |
| 32 | soundlatch_w(machine,0,data & 0xff); | |
| 33 | cpunum_set_input_line(machine, 1,0,ASSERT_LINE); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | static READ16_HANDLER( vaportra_control_r ) |
| r1877 | r1878 | |
| 93 | 93 | |
| 94 | 94 | static READ8_HANDLER( vaportra_soundlatch_r ) |
| 95 | 95 | { |
| 96 | cpunum_set_input_line(Machine, 1,0,CLEAR_LINE); | |
| 97 | return soundlatch_r(offset); | |
| 96 | cpunum_set_input_line(machine, 1,0,CLEAR_LINE); | |
| 97 | return soundlatch_r(machine, offset); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | static WRITE8_HANDLER( YM2151_w ) |
| 101 | 101 | { |
| 102 | 102 | switch (offset) { |
| 103 | 103 | case 0: |
| 104 | YM2151_register_port_0_w(0,data); | |
| 104 | YM2151_register_port_0_w(machine,0,data); | |
| 105 | 105 | break; |
| 106 | 106 | case 1: |
| 107 | YM2151_data_port_0_w(0,data); | |
| 107 | YM2151_data_port_0_w(machine,0,data); | |
| 108 | 108 | break; |
| 109 | 109 | } |
| 110 | 110 | } |
| r1877 | r1878 | |
| 113 | 113 | { |
| 114 | 114 | switch (offset) { |
| 115 | 115 | case 0: |
| 116 | YM2203_control_port_0_w(0,data); | |
| 116 | YM2203_control_port_0_w(machine,0,data); | |
| 117 | 117 | break; |
| 118 | 118 | case 1: |
| 119 | YM2203_write_port_0_w(0,data); | |
| 119 | YM2203_write_port_0_w(machine,0,data); | |
| 120 | 120 | break; |
| 121 | 121 | } |
| 122 | 122 | } |
| r1877 | r1878 | |
| 275 | 275 | /* basic machine hardware */ |
| 276 | 276 | MDRV_CPU_ADD(M68000,12000000) /* Custom chip 59 */ |
| 277 | 277 | MDRV_CPU_PROGRAM_MAP(vaportra_readmem,vaportra_writemem) |
| 278 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 278 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 279 | 279 | |
| 280 | 280 | MDRV_CPU_ADD(H6280, 32220000/4) /* Custom chip 45; Audio section crystal is 32.220 MHz */ |
| 281 | 281 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 98 | 98 | |
| 99 | 99 | INTERRUPT_GEN( lnc_sound_interrupt ); |
| 100 | 100 | |
| 101 | static WRITE8_HANDLER( | |
| 101 | static WRITE8_HANDLER( a | |
| 102 | 102 | |
| 103 | 103 | READ8_HANDLER( mmonkey_protection_r ); |
| 104 | 104 | WRITE8_HANDLER( mmonkey_protection_w ); |
| r1877 | r1878 | |
| 106 | 106 | |
| 107 | 107 | static UINT8 *decrypted; |
| 108 | 108 | static UINT8 *rambase; |
| 109 | static UINT8 * | |
| 109 | static UINT8 *a | |
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | |
| r1877 | r1878 | |
| 149 | 149 | static WRITE8_HANDLER( lnc_w ) |
| 150 | 150 | { |
| 151 | 151 | if (offset <= 0x3bff) ; |
| 152 | else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(offset - 0x3c00,data); return; } | |
| 153 | else if (offset >= 0x7c00 && offset <= 0x7fff) { lnc_mirrorvideoram_w(offset - 0x7c00,data); return; } | |
| 152 | else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(machine,offset - 0x3c00,data); return; } | |
| 153 | else if (offset >= 0x7c00 && offset <= 0x7fff) { lnc_mirrorvideoram_w(machine,offset - 0x7c00,data); return; } | |
| 154 | 154 | else if (offset == 0x8000) { return; } /* MWA8_NOP */ |
| 155 | else if (offset == 0x8001) { lnc_video_control_w(0,data); return; } | |
| 155 | else if (offset == 0x8001) { lnc_video_control_w(machine,0,data); return; } | |
| 156 | 156 | else if (offset == 0x8003) ; |
| 157 | 157 | else if (offset == 0x9000) { return; } /* MWA8_NOP */ |
| 158 | else if (offset == 0x9002) { | |
| 158 | else if (offset == 0x9002) { a | |
| 159 | 159 | else if (offset >= 0xb000 && offset <= 0xb1ff) ; |
| 160 | 160 | else logerror("CPU #%d PC %04x: warning - write %02x to unmapped memory address %04x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); |
| 161 | 161 | |
| r1877 | r1878 | |
| 168 | 168 | static WRITE8_HANDLER( mmonkey_w ) |
| 169 | 169 | { |
| 170 | 170 | if (offset <= 0x3bff) ; |
| 171 | else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(offset - 0x3c00,data); return; } | |
| 172 | else if (offset >= 0x7c00 && offset <= 0x7fff) { lnc_mirrorvideoram_w(offset - 0x7c00,data); return; } | |
| 173 | else if (offset == 0x8001) { lnc_video_control_w(0,data); return; } | |
| 171 | else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(machine,offset - 0x3c00,data); return; } | |
| 172 | else if (offset >= 0x7c00 && offset <= 0x7fff) { lnc_mirrorvideoram_w(machine,offset - 0x7c00,data); return; } | |
| 173 | else if (offset == 0x8001) { lnc_video_control_w(machine,0,data); return; } | |
| 174 | 174 | else if (offset == 0x8003) ; |
| 175 | 175 | else if (offset == 0x9000) { return; } /* MWA8_NOP */ |
| 176 | else if (offset == 0x9002) { sound_command_w(0,data); return; } | |
| 177 | else if (offset >= 0xb000 && offset <= 0xbfff) { mmonkey_protection_w(offset - 0xb000, data); return; } | |
| 176 | else if (offset == 0x9002) { audio_command_w(machine,0,data); return; } | |
| 177 | else if (offset >= 0xb000 && offset <= 0xbfff) { mmonkey_protection_w(machine,offset - 0xb000, data); return; } | |
| 178 | 178 | else logerror("CPU #%d PC %04x: warning - write %02x to unmapped memory address %04x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); |
| 179 | 179 | |
| 180 | 180 | rambase[offset] = data; |
| r1877 | r1878 | |
| 186 | 186 | static WRITE8_HANDLER( btime_w ) |
| 187 | 187 | { |
| 188 | 188 | if (offset <= 0x07ff) ; |
| 189 | else if (offset >= 0x0c00 && offset <= 0x0c0f) btime_paletteram_w(offset - 0x0c00,data); | |
| 189 | else if (offset >= 0x0c00 && offset <= 0x0c0f) btime_paletteram_w(machine,offset - 0x0c00,data); | |
| 190 | 190 | else if (offset >= 0x1000 && offset <= 0x17ff) ; |
| 191 | else if (offset >= 0x1800 && offset <= 0x1bff) btime_mirrorvideoram_w(offset - 0x1800,data); | |
| 192 | else if (offset >= 0x1c00 && offset <= 0x1fff) btime_mirrorcolorram_w(offset - 0x1c00,data); | |
| 193 | else if (offset == 0x4002) btime_video_control_w(0,data); | |
| 194 | else if (offset == 0x4003) sound_command_w(0,data); | |
| 195 | else if (offset == 0x4004) bnj_scroll1_w(0,data); | |
| 191 | else if (offset >= 0x1800 && offset <= 0x1bff) btime_mirrorvideoram_w(machine,offset - 0x1800,data); | |
| 192 | else if (offset >= 0x1c00 && offset <= 0x1fff) btime_mirrorcolorram_w(machine,offset - 0x1c00,data); | |
| 193 | else if (offset == 0x4002) btime_video_control_w(machine,0,data); | |
| 194 | else if (offset == 0x4003) audio_command_w(machine,0,data); | |
| 195 | else if (offset == 0x4004) bnj_scroll1_w(machine,0,data); | |
| 196 | 196 | else logerror("CPU #%d PC %04x: warning - write %02x to unmapped memory address %04x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); |
| 197 | 197 | |
| 198 | 198 | rambase[offset] = data; |
| r1877 | r1878 | |
| 204 | 204 | { |
| 205 | 205 | if (offset <= 0x07ff) ; |
| 206 | 206 | else if (offset >= 0x8000 && offset <= 0x87ff) ; |
| 207 | else if (offset >= 0x8800 && offset <= 0x8bff) btime_mirrorvideoram_w(offset - 0x8800,data); | |
| 208 | else if (offset >= 0x8c00 && offset <= 0x8fff) btime_mirrorcolorram_w(offset - 0x8c00,data); | |
| 209 | else if (offset == 0x9000) zoar_video_control_w(0, data); | |
| 207 | else if (offset >= 0x8800 && offset <= 0x8bff) btime_mirrorvideoram_w(machine,offset - 0x8800,data); | |
| 208 | else if (offset >= 0x8c00 && offset <= 0x8fff) btime_mirrorcolorram_w(machine,offset - 0x8c00,data); | |
| 209 | else if (offset == 0x9000) zoar_video_control_w(machine,0, data); | |
| 210 | 210 | else if (offset >= 0x9800 && offset <= 0x9803) ; |
| 211 | else if (offset == 0x9804) bnj_scroll2_w(0,data); | |
| 212 | else if (offset == 0x9805) bnj_scroll1_w(0,data); | |
| 213 | else if (offset == 0x9806) sound_command_w(0,data); | |
| 211 | else if (offset == 0x9804) bnj_scroll2_w(machine,0,data); | |
| 212 | else if (offset == 0x9805) bnj_scroll1_w(machine,0,data); | |
| 213 | else if (offset == 0x9806) audio_command_w(machine,0,data); | |
| 214 | 214 | else logerror("CPU #%d PC %04x: warning - write %02x to unmapped memory address %04x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); |
| 215 | 215 | |
| 216 | 216 | rambase[offset] = data; |
| r1877 | r1878 | |
| 221 | 221 | static WRITE8_HANDLER( disco_w ) |
| 222 | 222 | { |
| 223 | 223 | if (offset <= 0x04ff) ; |
| 224 | else if (offset >= 0x2000 && offset <= 0x7fff) deco_charram_w(offset - 0x2000,data); | |
| 224 | else if (offset >= 0x2000 && offset <= 0x7fff) deco_charram_w(machine,offset - 0x2000,data); | |
| 225 | 225 | else if (offset >= 0x8000 && offset <= 0x881f) ; |
| 226 | else if (offset == 0x9a00) sound_command_w(0,data); | |
| 227 | else if (offset == 0x9c00) disco_video_control_w(0,data); | |
| 226 | else if (offset == 0x9a00) audio_command_w(machine,0,data); | |
| 227 | else if (offset == 0x9c00) disco_video_control_w(machine,0,data); | |
| 228 | 228 | else logerror("CPU #%d PC %04x: warning - write %02x to unmapped memory address %04x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); |
| 229 | 229 | |
| 230 | 230 | rambase[offset] = data; |
| r1877 | r1878 | |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | |
| 236 | static ADDRESS_MAP_START( btime_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 237 | AM_RANGE(0x0000, 0x07ff) AM_READ(MRA8_RAM) | |
| 238 | AM_RANGE(0x1000, 0x17ff) AM_READ(MRA8_RAM) | |
| 239 | AM_RANGE(0x1800, 0x1bff) AM_READ(btime_mirrorvideoram_r) | |
| 240 | AM_RANGE(0x1c00, 0x1fff) AM_READ(btime_mirrorcolorram_r) | |
| 241 | AM_RANGE(0x4000, 0x4000) AM_READ(input_port_0_r) /* IN0 */ | |
| 242 | AM_RANGE(0x4001, 0x4001) AM_READ(input_port_1_r) /* IN1 */ | |
| 243 | AM_RANGE(0x4002, 0x4002) AM_READ(input_port_2_r) /* coin */ | |
| 244 | AM_RANGE(0x4003, 0x4003) AM_READ(input_port_3_r) /* DSW1 */ | |
| 245 | AM_RANGE(0x4004, 0x4004) AM_READ(input_port_4_r) /* DSW2 */ | |
| 236 | static ADDRESS_MAP_START( btime_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 237 | AM_RANGE(0x0000, 0xffff) AM_WRITE(btime_w) /* override the following entries to */ | |
| 238 | /* support ROM decryption */ | |
| 239 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&rambase) | |
| 240 | AM_RANGE(0x0c00, 0x0c0f) AM_WRITE(btime_paletteram_w) AM_BASE(&paletteram) | |
| 241 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size) | |
| 242 | AM_RANGE(0x1400, 0x17ff) AM_RAM AM_BASE(&btime_colorram) | |
| 243 | AM_RANGE(0x1800, 0x1bff) AM_READWRITE(btime_mirrorvideoram_r, btime_mirrorvideoram_w) | |
| 244 | AM_RANGE(0x1c00, 0x1fff) AM_READWRITE(btime_mirrorcolorram_r, btime_mirrorcolorram_w) | |
| 245 | AM_RANGE(0x4000, 0x4000) AM_READWRITE(input_port_0_r, MWA8_NOP) | |
| 246 | AM_RANGE(0x4001, 0x4001) AM_READ(input_port_1_r) | |
| 247 | AM_RANGE(0x4002, 0x4002) AM_READWRITE(input_port_2_r, btime_video_control_w) | |
| 248 | AM_RANGE(0x4003, 0x4003) AM_READWRITE(input_port_3_r, audio_command_w) | |
| 249 | AM_RANGE(0x4004, 0x4004) AM_READWRITE(input_port_4_r, bnj_scroll1_w) | |
| 246 | 250 | AM_RANGE(0xb000, 0xffff) AM_READ(MRA8_ROM) |
| 247 | 251 | ADDRESS_MAP_END |
| 248 | 252 | |
| 249 | static ADDRESS_MAP_START( btime_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 250 | AM_RANGE(0x0000, 0xffff) AM_WRITE(btime_w) /* override the following entries to */ | |
| 251 | /* support ROM decryption */ | |
| 252 | AM_RANGE(0x0000, 0x07ff) AM_WRITE(MWA8_RAM) AM_BASE(&rambase) | |
| 253 | AM_RANGE(0x0c00, 0x0c0f) AM_WRITE(btime_paletteram_w) AM_BASE(&paletteram) | |
| 254 | AM_RANGE(0x1000, 0x13ff) AM_WRITE(MWA8_RAM) AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size) | |
| 255 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(MWA8_RAM) AM_BASE(&btime_colorram) | |
| 256 | AM_RANGE(0x1800, 0x1bff) AM_WRITE(btime_mirrorvideoram_w) | |
| 257 | AM_RANGE(0x1c00, 0x1fff) AM_WRITE(btime_mirrorcolorram_w) | |
| 258 | AM_RANGE(0x4000, 0x4000) AM_WRITE(MWA8_NOP) | |
| 259 | AM_RANGE(0x4002, 0x4002) AM_WRITE(btime_video_control_w) | |
| 260 | AM_RANGE(0x4003, 0x4003) AM_WRITE(sound_command_w) | |
| 261 | AM_RANGE(0x4004, 0x4004) AM_WRITE(bnj_scroll1_w) | |
| 262 | ADDRESS_MAP_END | |
| 263 | ||
| 264 | static ADDRESS_MAP_START( cookrace_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 265 | AM_RANGE(0x0000, 0x03ff) AM_READ(MRA8_RAM) | |
| 266 | AM_RANGE(0x0500, 0x3fff) AM_READ(MRA8_ROM) | |
| 267 | AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM) | |
| 268 | AM_RANGE(0xc800, 0xcbff) AM_READ(btime_mirrorvideoram_r) | |
| 269 | AM_RANGE(0xcc00, 0xcfff) AM_READ(btime_mirrorcolorram_r) | |
| 270 | AM_RANGE(0xd000, 0xd0ff) AM_READ(MRA8_RAM) /* background */ | |
| 271 | AM_RANGE(0xd100, 0xd3ff) AM_READ(MRA8_RAM) /* ? */ | |
| 272 | AM_RANGE(0xd400, 0xd7ff) AM_READ(MRA8_RAM) /* background? */ | |
| 273 | AM_RANGE(0xe000, 0xe000) AM_READ(input_port_3_r) /* DSW1 */ | |
| 274 | AM_RANGE(0xe300, 0xe300) AM_READ(input_port_3_r) /* mirror address used on high score name enter */ | |
| 253 | static ADDRESS_MAP_START( cookrace_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 254 | AM_RANGE(0x0000, 0x03ff) AM_RAM AM_BASE(&rambase) | |
| 255 | AM_RANGE(0x0500, 0x3fff) AM_ROM | |
| 256 | AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size) | |
| 257 | AM_RANGE(0xc400, 0xc7ff) AM_RAM AM_BASE(&btime_colorram) | |
| 258 | AM_RANGE(0xc800, 0xcbff) AM_READWRITE(btime_mirrorvideoram_r, btime_mirrorvideoram_w) | |
| 259 | AM_RANGE(0xcc00, 0xcfff) AM_READWRITE(btime_mirrorcolorram_r, btime_mirrorcolorram_w) | |
| 260 | AM_RANGE(0xd000, 0xd0ff) AM_RAM /* background? */ | |
| 261 | AM_RANGE(0xd100, 0xd3ff) AM_RAM /* ? */ | |
| 262 | AM_RANGE(0xd400, 0xd7ff) AM_RAM AM_BASE(&bnj_backgroundram) AM_SIZE(&bnj_backgroundram_size) | |
| 263 | AM_RANGE(0xe000, 0xe000) AM_READWRITE(input_port_3_r, bnj_video_control_w) | |
| 264 | AM_RANGE(0xe300, 0xe300) AM_READ(input_port_3_r) /* mirror address used on high score name entry */ | |
| 275 | 265 | /* screen */ |
| 276 | AM_RANGE(0xe001, 0xe001) AM_READ(input_port_4_r) /* DSW2 */ | |
| 277 | AM_RANGE(0xe002, 0xe002) AM_READ(input_port_0_r) /* IN0 */ | |
| 278 | AM_RANGE(0xe003, 0xe003) AM_READ(input_port_1_r) /* IN1 */ | |
| 279 | AM_RANGE(0xe004, 0xe004) AM_READ(input_port_2_r) /* coin */ | |
| 280 | AM_RANGE(0xfff9, 0xffff) AM_READ(MRA8_ROM) | |
| 266 | AM_RANGE(0xe001, 0xe001) AM_READWRITE(input_port_4_r, audio_command_w) | |
| 267 | AM_RANGE(0xe002, 0xe002) AM_READ(input_port_0_r) | |
| 268 | AM_RANGE(0xe003, 0xe003) AM_READ(input_port_1_r) | |
| 269 | AM_RANGE(0xe004, 0xe004) AM_READ(input_port_2_r) | |
| 270 | AM_RANGE(0xfff9, 0xffff) AM_ROM | |
| 281 | 271 | ADDRESS_MAP_END |
| 282 | 272 | |
| 283 | static ADDRESS_MAP_START( cookrace_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 284 | AM_RANGE(0x0000, 0x03ff) AM_WRITE(MWA8_RAM) AM_BASE(&rambase) | |
| 285 | AM_RANGE(0x0500, 0x3fff) AM_WRITE(MWA8_ROM) | |
| 286 | AM_RANGE(0xc000, 0xc3ff) AM_WRITE(MWA8_RAM) AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size) | |
| 287 | AM_RANGE(0xc400, 0xc7ff) AM_WRITE(MWA8_RAM) AM_BASE(&btime_colorram) | |
| 288 | AM_RANGE(0xc800, 0xcbff) AM_WRITE(btime_mirrorvideoram_w) | |
| 289 | AM_RANGE(0xcc00, 0xcfff) AM_WRITE(btime_mirrorcolorram_w) | |
| 290 | AM_RANGE(0xd000, 0xd0ff) AM_WRITE(MWA8_RAM) /* background? */ | |
| 291 | AM_RANGE(0xd100, 0xd3ff) AM_WRITE(MWA8_RAM) /* ? */ | |
| 292 | AM_RANGE(0xd400, 0xd7ff) AM_WRITE(MWA8_RAM) AM_BASE(&bnj_backgroundram) AM_SIZE(&bnj_backgroundram_size) | |
| 293 | AM_RANGE(0xe000, 0xe000) AM_WRITE(bnj_video_control_w) | |
| 294 | AM_RANGE(0xe001, 0xe001) AM_WRITE(sound_command_w) | |
| 295 | #if 0 | |
| 296 | AM_RANGE(0x4004, 0x4004) AM_WRITE(bnj_scroll1_w) | |
| 297 | #endif | |
| 298 | AM_RANGE(0xfff9, 0xffff) AM_WRITE(MWA8_ROM) | |
| 299 | ADDRESS_MAP_END | |
| 300 | ||
| 301 | static ADDRESS_MAP_START( zoar_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 302 | AM_RANGE(0x0000, 0x07ff) AM_READ(MRA8_RAM) | |
| 303 | AM_RANGE(0x9800, 0x9800) AM_READ(input_port_3_r) /* DSW 1 */ | |
| 304 | AM_RANGE(0x9801, 0x9801) AM_READ(input_port_4_r) /* DSW 2 */ | |
| 305 | AM_RANGE(0x9802, 0x9802) AM_READ(input_port_0_r) /* IN 0 */ | |
| 306 | AM_RANGE(0x9803, 0x9803) AM_READ(input_port_1_r) /* IN 1 */ | |
| 307 | AM_RANGE(0x9804, 0x9804) AM_READ(input_port_2_r) /* coin */ | |
| 308 | AM_RANGE(0xd000, 0xffff) AM_READ(MRA8_ROM) | |
| 309 | ADDRESS_MAP_END | |
| 310 | ||
| 311 | static ADDRESS_MAP_START( zoar_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 312 | AM_RANGE(0x0000, 0xffff) AM_WRITE(zoar_w) /* override the following entries to */ | |
| 313 | /* support ROM decryption */ | |
| 314 | AM_RANGE(0x0000, 0x07ff) AM_WRITE(MWA8_RAM) AM_BASE(&rambase) | |
| 273 | static ADDRESS_MAP_START( zoar_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 274 | AM_RANGE(0x0000, 0xffff) AM_WRITE(zoar_w) /* override the following entries to */ | |
| 275 | /* support ROM decryption */ | |
| 276 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&rambase) | |
| 315 | 277 | AM_RANGE(0x8000, 0x83ff) AM_WRITE(MWA8_RAM) AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size) |
| 316 | 278 | AM_RANGE(0x8400, 0x87ff) AM_WRITE(MWA8_RAM) AM_BASE(&btime_colorram) |
| 317 | 279 | AM_RANGE(0x8800, 0x8bff) AM_WRITE(btime_mirrorvideoram_w) |
| 318 | 280 | AM_RANGE(0x8c00, 0x8fff) AM_WRITE(btime_mirrorcolorram_w) |
| 319 | 281 | AM_RANGE(0x9000, 0x9000) AM_WRITE(zoar_video_control_w) |
| 282 | AM_RANGE(0x9800, 0x9800) AM_READ(input_port_3_r) | |
| 283 | AM_RANGE(0x9801, 0x9801) AM_READ(input_port_4_r) | |
| 284 | AM_RANGE(0x9802, 0x9802) AM_READ(input_port_0_r) | |
| 285 | AM_RANGE(0x9803, 0x9803) AM_READ(input_port_1_r) | |
| 320 | 286 | AM_RANGE(0x9800, 0x9803) AM_WRITE(MWA8_RAM) AM_BASE(&zoar_scrollram) |
| 321 | AM_RANGE(0x980 | |
| 287 | AM_RANGE(0x9804, 0x9804) AM_READWRITE(input_port_2_r, bnj_scroll2_w) | |
| 322 | 288 | AM_RANGE(0x9805, 0x9805) AM_WRITE(bnj_scroll1_w) |
| 323 | AM_RANGE(0x9806, 0x9806) AM_WRITE(sound_command_w) | |
| 324 | /*AM_RANGE(0x9807, 0x9807) AM_WRITE(MWA8_RAM) */ /* Marked as ACK on schematics (Board 2 Pg 5) */ | |
| 289 | AM_RANGE(0x9806, 0x9806) AM_WRITE(audio_command_w) | |
| 290 | AM_RANGE(0xd000, 0xffff) AM_READ(MRA8_ROM) | |
| 325 | 291 | ADDRESS_MAP_END |
| 326 | 292 | |
| 327 | static ADDRESS_MAP_START( lnc_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 328 | AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_RAM) | |
| 329 | AM_RANGE(0x7c00, 0x7fff) AM_READ(btime_mirrorvideoram_r) | |
| 330 | AM_RANGE(0x8000, 0x8000) AM_READ(input_port_3_r) /* DSW1 */ | |
| 331 | AM_RANGE(0x8001, 0x8001) AM_READ(input_port_4_r) /* DSW2 */ | |
| 332 | AM_RANGE(0x9000, 0x9000) AM_READ(input_port_0_r) /* IN0 */ | |
| 333 | AM_RANGE(0x9001, 0x9001) AM_READ(input_port_1_r) /* IN1 */ | |
| 334 | AM_RANGE(0x9002, 0x9002) AM_READ(input_port_2_r) /* coin */ | |
| 335 | AM_RANGE(0xb000, 0xb1ff) AM_READ(MRA8_RAM) | |
| 293 | static ADDRESS_MAP_START( lnc_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 294 | AM_RANGE(0x0000, 0xffff) AM_WRITE(lnc_w) /* override the following entries to */ | |
| 295 | /* support ROM decryption */ | |
| 296 | AM_RANGE(0x0000, 0x3bff) AM_RAM AM_BASE(&rambase) | |
| 297 | AM_RANGE(0x3c00, 0x3fff) AM_READWRITE(MRA8_RAM, lnc_videoram_w) AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size) | |
| 298 | AM_RANGE(0x7800, 0x7bff) AM_WRITE(MWA8_RAM) AM_BASE(&btime_colorram) /* this is just here to initialize the pointer */ | |
| 299 | AM_RANGE(0x7c00, 0x7fff) AM_READWRITE(btime_mirrorvideoram_r, lnc_mirrorvideoram_w) | |
| 300 | AM_RANGE(0x8000, 0x8000) AM_READWRITE(input_port_3_r, MWA8_NOP) /* ??? */ | |
| 301 | AM_RANGE(0x8001, 0x8001) AM_READWRITE(input_port_4_r, lnc_video_control_w) | |
| 302 | AM_RANGE(0x8003, 0x8003) AM_WRITE(MWA8_RAM) AM_BASE(&lnc_charbank) | |
| 303 | AM_RANGE(0x9000, 0x9000) AM_READWRITE(input_port_0_r, MWA8_NOP) /* IRQ ack??? */ | |
| 304 | AM_RANGE(0x9001, 0x9001) AM_READ(input_port_1_r) | |
| 305 | AM_RANGE(0x9002, 0x9002) AM_READWRITE(input_port_2_r, audio_command_w) | |
| 306 | AM_RANGE(0xb000, 0xb1ff) AM_RAM | |
| 336 | 307 | AM_RANGE(0xc000, 0xffff) AM_READ(MRA8_ROM) |
| 337 | 308 | ADDRESS_MAP_END |
| 338 | 309 | |
| 339 | static ADDRESS_MAP_START( lnc_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 340 | AM_RANGE(0x0000, 0xffff) AM_WRITE(lnc_w) /* override the following entries to */ | |
| 310 | static ADDRESS_MAP_START( mmonkey_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 311 | AM_RANGE(0x0000, 0xffff) AM_WRITE(mmonkey_w) /* override the following entries to */ | |
| 341 | 312 | /* support ROM decryption */ |
| 342 | AM_RANGE(0x0000, 0x3bff) AM_WRITE(MWA8_RAM) AM_BASE(&rambase) | |
| 343 | AM_RANGE(0x3c00, 0x3fff) AM_WRITE(lnc_videoram_w) AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size) | |
| 313 | AM_RANGE(0x0000, 0x3bff) AM_RAM AM_BASE(&rambase) | |
| 314 | AM_RANGE(0x3c00, 0x3fff) AM_READWRITE(MRA8_RAM, lnc_videoram_w) AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size) | |
| 344 | 315 | AM_RANGE(0x7800, 0x7bff) AM_WRITE(MWA8_RAM) AM_BASE(&btime_colorram) /* this is just here to initialize the pointer */ |
| 345 | AM_RANGE(0x7c00, 0x7fff) AM_WRITE(lnc_mirrorvideoram_w) | |
| 346 | AM_RANGE(0x8000, 0x8000) AM_WRITE(MWA8_NOP) /* ??? */ | |
| 347 | AM_RANGE(0x8001, 0x8001) AM_WRITE(lnc_video_control_w) | |
| 316 | AM_RANGE(0x7c00, 0x7fff) AM_READWRITE(btime_mirrorvideoram_r, lnc_mirrorvideoram_w) | |
| 317 | AM_RANGE(0x8000, 0x8000) AM_READ(input_port_3_r) | |
| 318 | AM_RANGE(0x8001, 0x8001) AM_READWRITE(input_port_4_r, lnc_video_control_w) | |
| 348 | 319 | AM_RANGE(0x8003, 0x8003) AM_WRITE(MWA8_RAM) AM_BASE(&lnc_charbank) |
| 349 | AM_RANGE(0x9000, 0x9000) AM_WRITE(MWA8_NOP) /* IRQ ACK ??? */ | |
| 350 | AM_RANGE(0x9002, 0x9002) AM_WRITE(sound_command_w) | |
| 351 | AM_RANGE(0xb000, 0xb1ff) AM_WRITE(MWA8_RAM) | |
| 352 | ADDRESS_MAP_END | |
| 353 | ||
| 354 | ||
| 355 | static ADDRESS_MAP_START( mmonkey_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 356 | AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_RAM) | |
| 357 | AM_RANGE(0x7c00, 0x7fff) AM_READ(btime_mirrorvideoram_r) | |
| 358 | AM_RANGE(0x8000, 0x8000) AM_READ(input_port_3_r) /* DSW1 */ | |
| 359 | AM_RANGE(0x8001, 0x8001) AM_READ(input_port_4_r) /* DSW2 */ | |
| 360 | AM_RANGE(0x9000, 0x9000) AM_READ(input_port_0_r) /* IN0 */ | |
| 361 | AM_RANGE(0x9001, 0x9001) AM_READ(input_port_1_r) /* IN1 */ | |
| 362 | AM_RANGE(0x9002, 0x9002) AM_READ(input_port_2_r) /* coin */ | |
| 363 | AM_RANGE(0xb000, 0xbfff) AM_READ(mmonkey_protection_r) | |
| 320 | AM_RANGE(0x9000, 0x9000) AM_READWRITE(input_port_0_r, MWA8_NOP) /* IRQ ack??? */ | |
| 321 | AM_RANGE(0x9001, 0x9001) AM_READ(input_port_1_r) | |
| 322 | AM_RANGE(0x9002, 0x9002) AM_READWRITE(input_port_2_r, audio_command_w) | |
| 323 | AM_RANGE(0xb000, 0xbfff) AM_READWRITE(mmonkey_protection_r, mmonkey_protection_w) | |
| 364 | 324 | AM_RANGE(0xc000, 0xffff) AM_READ(MRA8_ROM) |
| 365 | 325 | ADDRESS_MAP_END |
| 366 | 326 | |
| 367 | static ADDRESS_MAP_START( mmonkey_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 368 | AM_RANGE(0x0000, 0xffff) AM_WRITE(mmonkey_w) /* override the following entries to */ | |
| 369 | /* support ROM decryption */ | |
| 370 | AM_RANGE(0x0000, 0x3bff) AM_WRITE(MWA8_RAM) AM_BASE(&rambase) | |
| 371 | AM_RANGE(0x3c00, 0x3fff) AM_WRITE(lnc_videoram_w) AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size) | |
| 372 | AM_RANGE(0x7800, 0x7bff) AM_WRITE(MWA8_RAM) AM_BASE(&btime_colorram) /* this is just here to initialize the pointer */ | |
| 373 | AM_RANGE(0x7c00, 0x7fff) AM_WRITE(lnc_mirrorvideoram_w) | |
| 374 | AM_RANGE(0x8001, 0x8001) AM_WRITE(lnc_video_control_w) | |
| 375 | AM_RANGE(0x8003, 0x8003) AM_WRITE(MWA8_RAM) AM_BASE(&lnc_charbank) | |
| 376 | AM_RANGE(0x9000, 0x9000) AM_WRITE(MWA8_NOP) /* IRQ ACK ??? */ | |
| 377 | AM_RANGE(0x9002, 0x9002) AM_WRITE(sound_command_w) | |
| 378 | AM_RANGE(0xb000, 0xbfff) AM_WRITE(mmonkey_protection_w) | |
| 379 | ADDRESS_MAP_END | |
| 380 | ||
| 381 | ||
| 382 | static ADDRESS_MAP_START( bnj_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 383 | AM_RANGE(0x0000, 0x07ff) AM_READ(MRA8_RAM) | |
| 384 | AM_RANGE(0x1000, 0x1000) AM_READ(input_port_3_r) /* DSW1 */ | |
| 385 | AM_RANGE(0x1001, 0x1001) AM_READ(input_port_4_r) /* DSW2 */ | |
| 386 | AM_RANGE(0x1002, 0x1002) AM_READ(input_port_0_r) /* IN0 */ | |
| 387 | AM_RANGE(0x1003, 0x1003) AM_READ(input_port_1_r) /* IN1 */ | |
| 388 | AM_RANGE(0x1004, 0x1004) AM_READ(input_port_2_r) /* coin */ | |
| 389 | AM_RANGE(0x4000, 0x47ff) AM_READ(MRA8_RAM) | |
| 390 | AM_RANGE(0x4800, 0x4bff) AM_READ(btime_mirrorvideoram_r) | |
| 391 | AM_RANGE(0x4c00, 0x4fff) AM_READ(btime_mirrorcolorram_r) | |
| 392 | AM_RANGE(0xa000, 0xffff) AM_READ(MRA8_ROM) | |
| 393 | ADDRESS_MAP_END | |
| 394 | ||
| 395 | static ADDRESS_MAP_START( bnj_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 396 | AM_RANGE(0x0000, 0x07ff) AM_WRITE(MWA8_RAM) AM_BASE(&rambase) | |
| 397 | AM_RANGE(0x1001, 0x1001) AM_WRITE(bnj_video_control_w) | |
| 398 | AM_RANGE(0x1002, 0x1002) AM_WRITE(sound_command_w) | |
| 399 | AM_RANGE(0x4000, 0x43ff) AM_WRITE(MWA8_RAM) AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size) | |
| 400 | AM_RANGE(0x4400, 0x47ff) AM_WRITE(MWA8_RAM) AM_BASE(&btime_colorram) | |
| 401 | AM_RANGE(0x4800, 0x4bff) AM_WRITE(btime_mirrorvideoram_w) | |
| 402 | AM_RANGE(0x4c00, 0x4fff) AM_WRITE(btime_mirrorcolorram_w) | |
| 327 | static ADDRESS_MAP_START( bnj_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 328 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&rambase) | |
| 329 | AM_RANGE(0x1000, 0x1000) AM_READ(input_port_3_r) | |
| 330 | AM_RANGE(0x1001, 0x1001) AM_READWRITE(input_port_4_r, bnj_video_control_w) | |
| 331 | AM_RANGE(0x1002, 0x1002) AM_READWRITE(input_port_0_r, audio_command_w) | |
| 332 | AM_RANGE(0x1003, 0x1003) AM_READ(input_port_1_r) | |
| 333 | AM_RANGE(0x1004, 0x1004) AM_READ(input_port_2_r) | |
| 334 | AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size) | |
| 335 | AM_RANGE(0x4400, 0x47ff) AM_RAM AM_BASE(&btime_colorram) | |
| 336 | AM_RANGE(0x4800, 0x4bff) AM_READWRITE(btime_mirrorvideoram_r, btime_mirrorvideoram_w) | |
| 337 | AM_RANGE(0x4c00, 0x4fff) AM_READWRITE(btime_mirrorcolorram_r, btime_mirrorcolorram_w) | |
| 403 | 338 | AM_RANGE(0x5000, 0x51ff) AM_WRITE(bnj_background_w) AM_BASE(&bnj_backgroundram) AM_SIZE(&bnj_backgroundram_size) |
| 404 | 339 | AM_RANGE(0x5400, 0x5400) AM_WRITE(bnj_scroll1_w) |
| 405 | 340 | AM_RANGE(0x5800, 0x5800) AM_WRITE(bnj_scroll2_w) |
| 406 | 341 | AM_RANGE(0x5c00, 0x5c0f) AM_WRITE(btime_paletteram_w) AM_BASE(&paletteram) |
| 407 | ADDRESS_MAP_END | |
| 408 | ||
| 409 | static ADDRESS_MAP_START( disco_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 410 | AM_RANGE(0x0000, 0x04ff) AM_READ(MRA8_RAM) | |
| 411 | AM_RANGE(0x2000, 0x881f) AM_READ(MRA8_RAM) | |
| 412 | AM_RANGE(0x9000, 0x9000) AM_READ(input_port_2_r) /* coin */ | |
| 413 | AM_RANGE(0x9200, 0x9200) AM_READ(input_port_0_r) /* IN0 */ | |
| 414 | AM_RANGE(0x9400, 0x9400) AM_READ(input_port_1_r) /* IN1 */ | |
| 415 | AM_RANGE(0x9800, 0x9800) AM_READ(input_port_3_r) /* DSW1 */ | |
| 416 | AM_RANGE(0x9a00, 0x9a00) AM_READ(input_port_4_r) /* DSW2 */ | |
| 417 | AM_RANGE(0x9c00, 0x9c00) AM_READ(input_port_5_r) /* VBLANK */ | |
| 418 | 342 | AM_RANGE(0xa000, 0xffff) AM_READ(MRA8_ROM) |
| 419 | 343 | ADDRESS_MAP_END |
| 420 | 344 | |
| 421 | static ADDRESS_MAP_START( disco_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 422 | AM_RANGE(0x0000, 0xffff) AM_WRITE(disco_w) /* override the following entries to */ | |
| 345 | static ADDRESS_MAP_START( disco_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 346 | AM_RANGE(0x0000, 0xffff) AM_WRITE(disco_w) /* override the following entries to */ | |
| 423 | 347 | /* support ROM decryption */ |
| 424 | AM_RANGE(0x0000, 0x04ff) AM_WRITE(MWA8_RAM) AM_BASE(&rambase) | |
| 425 | AM_RANGE(0x2000, 0x7fff) AM_WRITE(deco_charram_w) AM_BASE(&deco_charram) | |
| 426 | AM_RANGE(0x8000, 0x83ff) AM_WRITE(MWA8_RAM) AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size) | |
| 427 | AM_RANGE(0x8400, 0x87ff) AM_WRITE(MWA8_RAM) AM_BASE(&btime_colorram) | |
| 428 | AM_RANGE(0x8800, 0x881f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 429 | AM_RANGE(0x9a00, 0x9a00) AM_WRITE(sound_command_w) | |
| 430 | AM_RANGE(0x9c00, 0x9c00) AM_WRITE(disco_video_control_w) | |
| 348 | AM_RANGE(0x0000, 0x04ff) AM_RAM AM_BASE(&rambase) | |
| 349 | AM_RANGE(0x2000, 0x7fff) AM_READWRITE(MRA8_RAM, deco_charram_w) AM_BASE(&deco_charram) | |
| 350 | AM_RANGE(0x8000, 0x83ff) AM_RAM AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size) | |
| 351 | AM_RANGE(0x8400, 0x87ff) AM_RAM AM_BASE(&btime_colorram) | |
| 352 | AM_RANGE(0x8800, 0x881f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 353 | AM_RANGE(0x9000, 0x9000) AM_READ(input_port_2_r) | |
| 354 | AM_RANGE(0x9200, 0x9200) AM_READ(input_port_0_r) | |
| 355 | AM_RANGE(0x9400, 0x9400) AM_READ(input_port_1_r) | |
| 356 | AM_RANGE(0x9800, 0x9800) AM_READ(input_port_3_r) | |
| 357 | AM_RANGE(0x9a00, 0x9a00) AM_READWRITE(input_port_4_r, audio_command_w) | |
| 358 | AM_RANGE(0x9c00, 0x9c00) AM_READWRITE(input_port_5_r, disco_video_control_w) | |
| 359 | AM_RANGE(0xa000, 0xffff) AM_READ(MRA8_ROM) | |
| 431 | 360 | ADDRESS_MAP_END |
| 432 | 361 | |
| 433 | 362 | |
| 434 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 435 | AM_RANGE(0x0000, 0x03ff) AM_RAM AM_BASE(&sound_rambase) | |
| 363 | static ADDRESS_MAP_START( audio_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 364 | AM_RANGE(0x0000, 0x03ff) AM_RAM AM_BASE(&audio_rambase) | |
| 436 | 365 | AM_RANGE(0x0400, 0x0fff) AM_ROM AM_REGION(REGION_CPU2, 0xf400) |
| 437 | 366 | AM_RANGE(0x2000, 0x2fff) AM_WRITE(AY8910_write_port_0_w) |
| 438 | 367 | AM_RANGE(0x4000, 0x4fff) AM_WRITE(AY8910_control_port_0_w) |
| r1877 | r1878 | |
| 443 | 372 | AM_RANGE(0xf000, 0xffff) AM_ROM |
| 444 | 373 | ADDRESS_MAP_END |
| 445 | 374 | |
| 446 | ||
| 447 | static ADDRESS_MAP_START( disco_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 448 | AM_RANGE(0x0000, 0x03ff) AM_READ(MRA8_RAM) | |
| 449 | AM_RANGE(0x8000, 0x8fff) AM_READ(soundlatch_r) | |
| 450 | AM_RANGE(0xf000, 0xffff) AM_READ(MRA8_ROM) | |
| 451 | ADDRESS_MAP_END | |
| 452 | ||
| 453 | static ADDRESS_MAP_START( disco_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 454 | AM_RANGE(0x0000, 0x03ff) AM_WRITE(MWA8_RAM) | |
| 375 | static ADDRESS_MAP_START( disco_audio_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 376 | AM_RANGE(0x0000, 0x03ff) AM_RAM | |
| 455 | 377 | AM_RANGE(0x4000, 0x4fff) AM_WRITE(AY8910_write_port_0_w) |
| 456 | 378 | AM_RANGE(0x5000, 0x5fff) AM_WRITE(AY8910_control_port_0_w) |
| 457 | 379 | AM_RANGE(0x6000, 0x6fff) AM_WRITE(AY8910_write_port_1_w) |
| 458 | 380 | AM_RANGE(0x7000, 0x7fff) AM_WRITE(AY8910_control_port_1_w) |
| 459 | AM_RANGE(0x8000, 0x8fff) AM_WRITE(MWA8_NOP) /* ACK ? */ | |
| 460 | AM_RANGE(0xf000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 381 | AM_RANGE(0x8000, 0x8fff) AM_READWRITE(soundlatch_r, MWA8_NOP) /* ack ? */ | |
| 382 | AM_RANGE(0xf000, 0xffff) AM_ROM | |
| 461 | 383 | ADDRESS_MAP_END |
| 462 | 384 | |
| 463 | 385 | |
| 464 | /*************************************************************************** | |
| 465 | ||
| 466 | These games don't have VBlank interrupts. | |
| 467 | Interrupts are still used by the game, coin insertion generates an IRQ. | |
| 468 | ||
| 469 | ***************************************************************************/ | |
| 470 | static void btime_interrupt(running_machine *machine, int generated_interrupt, int active_high) | |
| 386 | static INPUT_CHANGED( coin_inserted_irq_hi ) | |
| 471 | 387 | { |
| 472 | static int coin; | |
| 473 | int port; | |
| 474 | ||
| 475 | port = readinputport(2) & 0xc0; | |
| 476 | if (active_high) port ^= 0xc0; | |
| 477 | ||
| 478 | if (port != 0xc0) /* Coin */ | |
| 479 | { | |
| 480 | if (coin == 0) | |
| 481 | { | |
| 482 | coin = 1; | |
| 483 | cpunum_set_input_line(machine, 0, generated_interrupt, (generated_interrupt == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE); | |
| 484 | } | |
| 485 | } | |
| 486 | else coin = 0; | |
| 388 | if (newval) | |
| 389 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 487 | 390 | } |
| 488 | 391 | |
| 489 | static IN | |
| 392 | static IN | |
| 490 | 393 | { |
| 491 | btime_interrupt(machine, 0, 1); | |
| 394 | if (!newval) | |
| 395 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 492 | 396 | } |
| 493 | 397 | |
| 494 | static IN | |
| 398 | static IN | |
| 495 | 399 | { |
| 496 | | |
| 400 | cpunum_set_in | |
| 497 | 401 | } |
| 498 | 402 | |
| 499 | static INTERRUPT_GEN( btime_nmi_interrupt ) | |
| 500 | { | |
| 501 | btime_interrupt(machine, INPUT_LINE_NMI, 0); | |
| 502 | } | |
| 503 | 403 | |
| 504 | static WRITE8_HANDLER( | |
| 404 | static WRITE8_HANDLER( a | |
| 505 | 405 | { |
| 506 | soundlatch_w(offset,data); | |
| 507 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 406 | soundlatch_w(machine,offset,data); | |
| 407 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 508 | 408 | } |
| 509 | 409 | |
| 510 | 410 | #define COMMON_INPUTS\ |
| r1877 | r1878 | |
| 531 | 431 | COMMON_INPUTS |
| 532 | 432 | |
| 533 | 433 | PORT_START_TAG("IN2") |
| 534 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 535 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 536 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) | |
| 537 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 538 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 539 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 540 | PORT_BIT( 0x40, IP_ACTIVE_HIGH,IPT_COIN1 ) | |
| 541 | PORT_BIT( 0x80, IP_ACTIVE_HIGH,IPT_COIN2 ) | |
| 434 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 435 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) | |
| 436 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) | |
| 437 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 438 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 439 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 440 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted_irq_hi, 0) | |
| 441 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED(coin_inserted_irq_hi, 0) | |
| 542 | 442 | |
| 543 | 443 | PORT_START_TAG("DSW1") |
| 544 | 444 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) |
| r1877 | r1878 | |
| 609 | 509 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 610 | 510 | |
| 611 | 511 | PORT_START_TAG("IN2") |
| 612 | PORT_BIT( 0x01, IP_ACTIVE_HIGH,IPT_UNKNOWN ) | |
| 613 | PORT_BIT( 0x02, IP_ACTIVE_HIGH,IPT_UNKNOWN ) | |
| 614 | PORT_BIT( 0x04, IP_ACTIVE_HIGH,IPT_UNKNOWN ) | |
| 615 | PORT_BIT( 0x08, IP_ACTIVE_HIGH,IPT_START1 ) | |
| 616 | PORT_BIT( 0x10, IP_ACTIVE_HIGH,IPT_START2 ) | |
| 617 | PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_UNKNOWN ) | |
| 618 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 619 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 512 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 513 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 514 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 515 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 516 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 ) | |
| 517 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 518 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted_nmi_lo, 0) | |
| 519 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted_nmi_lo, 0) | |
| 620 | 520 | |
| 621 | 521 | PORT_START_TAG("DSW1") |
| 622 | 522 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) |
| r1877 | r1878 | |
| 691 | 591 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL |
| 692 | 592 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 693 | 593 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 694 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 695 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 594 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted_irq_lo, 0) | |
| 595 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted_irq_lo, 0) | |
| 696 | 596 | |
| 697 | 597 | PORT_START_TAG("DSW1") |
| 698 | 598 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) |
| r1877 | r1878 | |
| 761 | 661 | PORT_START_TAG("IN2") |
| 762 | 662 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 763 | 663 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 764 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 765 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 664 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted_nmi_lo, 0) | |
| 665 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted_nmi_lo, 0) | |
| 766 | 666 | |
| 767 | 667 | PORT_START_TAG("DSW1") |
| 768 | 668 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) |
| r1877 | r1878 | |
| 831 | 731 | PORT_START_TAG("IN2") |
| 832 | 732 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 833 | 733 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 834 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 835 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 734 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted_nmi_lo, 0) | |
| 735 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted_nmi_lo, 0) | |
| 836 | 736 | |
| 837 | 737 | PORT_START_TAG("DSW1") |
| 838 | 738 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) ) |
| r1877 | r1878 | |
| 902 | 802 | PORT_START_TAG("IN2") |
| 903 | 803 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| 904 | 804 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) |
| 905 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 906 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 805 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted_nmi_lo, 0) | |
| 806 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted_nmi_lo, 0) | |
| 907 | 807 | |
| 908 | 808 | PORT_START_TAG("DSW1") |
| 909 | 809 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) |
| r1877 | r1878 | |
| 978 | 878 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| 979 | 879 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) |
| 980 | 880 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 981 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 982 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 881 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted_nmi_lo, 0) | |
| 882 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted_nmi_lo, 0) | |
| 983 | 883 | |
| 984 | 884 | PORT_START_TAG("DSW1") |
| 985 | 885 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) |
| r1877 | r1878 | |
| 1049 | 949 | |
| 1050 | 950 | PORT_START_TAG("IN2") |
| 1051 | 951 | PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1052 | PORT_BIT( 0x40, IP_ACTIVE_HIGH,IPT_COIN1 ) | |
| 1053 | PORT_BIT( 0x80, IP_ACTIVE_HIGH,IPT_COIN2 ) | |
| 952 | PORT_BIT( 0x40, IP_ACTIVE_HIGH,IPT_COIN1 ) PORT_CHANGED(coin_inserted_irq_hi, 0) | |
| 953 | PORT_BIT( 0x80, IP_ACTIVE_HIGH,IPT_COIN2 ) PORT_CHANGED(coin_inserted_irq_hi, 0) | |
| 1054 | 954 | |
| 1055 | 955 | PORT_START_TAG("DSW1") |
| 1056 | 956 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) ) |
| r1877 | r1878 | |
| 1134 | 1034 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| 1135 | 1035 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) |
| 1136 | 1036 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1137 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 1138 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 1037 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted_nmi_lo, 0) | |
| 1038 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted_nmi_lo, 0) | |
| 1139 | 1039 | |
| 1140 | 1040 | PORT_START_TAG("DSW1") |
| 1141 | 1041 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) |
| r1877 | r1878 | |
| 1295 | 1195 | |
| 1296 | 1196 | /* basic machine hardware */ |
| 1297 | 1197 | MDRV_CPU_ADD_TAG("main", M6502, 1500000) |
| 1298 | MDRV_CPU_PROGRAM_MAP(btime_readmem,btime_writemem) | |
| 1299 | MDRV_CPU_VBLANK_INT(btime_irq_interrupt,1) | |
| 1198 | MDRV_CPU_PROGRAM_MAP(btime_map,0) | |
| 1300 | 1199 | |
| 1301 | MDRV_CPU_ADD_TAG("sound", M6502, 500000) | |
| 1302 | 1200 | /* audio CPU */ |
| 1303 | MDRV_CPU_PROGRAM_MAP(sound_map,0) | |
| 1304 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,16) | |
| 1201 | MDRV_CPU_ADD_TAG("audio", M6502, 500000) | |
| 1202 | MDRV_CPU_PROGRAM_MAP(audio_map,0) | |
| 1203 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,16) | |
| 1305 | 1204 | |
| 1306 | 1205 | /* video hardware */ |
| 1307 | 1206 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 1318 | 1217 | MDRV_VIDEO_START(btime) |
| 1319 | 1218 | MDRV_VIDEO_UPDATE(btime) |
| 1320 | 1219 | |
| 1321 | /* | |
| 1220 | /* a | |
| 1322 | 1221 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1323 | 1222 | |
| 1324 | 1223 | MDRV_SOUND_ADD(AY8910, 1500000) |
| r1877 | r1878 | |
| 1334 | 1233 | /* basic machine hardware */ |
| 1335 | 1234 | MDRV_IMPORT_FROM(btime) |
| 1336 | 1235 | MDRV_CPU_MODIFY("main") |
| 1337 | MDRV_CPU_PROGRAM_MAP(cookrace_readmem,cookrace_writemem) | |
| 1338 | MDRV_CPU_VBLANK_INT(btime_nmi_interrupt,1) | |
| 1236 | MDRV_CPU_PROGRAM_MAP(cookrace_map,0) | |
| 1339 | 1237 | |
| 1340 | MDRV_CPU_MODIFY("sound") | |
| 1341 | MDRV_CPU_PROGRAM_MAP(sound_map,0) | |
| 1238 | MDRV_CPU_MODIFY("audio") | |
| 1239 | MDRV_CPU_PROGRAM_MAP(audio_map,0) | |
| 1342 | 1240 | |
| 1343 | 1241 | /* video hardware */ |
| 1344 | 1242 | MDRV_GFXDECODE(cookrace) |
| r1877 | r1878 | |
| 1353 | 1251 | /* basic machine hardware */ |
| 1354 | 1252 | MDRV_IMPORT_FROM(btime) |
| 1355 | 1253 | MDRV_CPU_MODIFY("main") |
| 1356 | MDRV_CPU_PROGRAM_MAP(lnc_readmem,lnc_writemem) | |
| 1357 | MDRV_CPU_VBLANK_INT(btime_nmi_interrupt,1) | |
| 1254 | MDRV_CPU_PROGRAM_MAP(lnc_map,0) | |
| 1358 | 1255 | |
| 1359 | MDRV_CPU_MODIFY("sound") | |
| 1360 | MDRV_CPU_VBLANK_INT(lnc_sound_interrupt,16) | |
| 1256 | MDRV_CPU_MODIFY("audio") | |
| 1257 | MDRV_CPU_VBLANK_INT_HACK(lnc_sound_interrupt,16) | |
| 1361 | 1258 | |
| 1362 | 1259 | MDRV_MACHINE_RESET(lnc) |
| 1363 | 1260 | |
| r1877 | r1878 | |
| 1374 | 1271 | |
| 1375 | 1272 | /* basic machine hardware */ |
| 1376 | 1273 | MDRV_IMPORT_FROM(lnc) |
| 1377 | MDRV_CPU_MODIFY("sound") | |
| 1378 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,16) | |
| 1274 | MDRV_CPU_MODIFY("audio") | |
| 1275 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,16) | |
| 1379 | 1276 | |
| 1380 | 1277 | /* video hardware */ |
| 1381 | 1278 | MDRV_VIDEO_UPDATE(eggs) |
| r1877 | r1878 | |
| 1387 | 1284 | /* basic machine hardware */ |
| 1388 | 1285 | MDRV_IMPORT_FROM(wtennis) |
| 1389 | 1286 | MDRV_CPU_MODIFY("main") |
| 1390 | MDRV_CPU_PROGRAM_MAP(mmonkey_ | |
| 1287 | MDRV_CPU_PROGRAM_MAP(mmonkey_ | |
| 1391 | 1288 | MACHINE_DRIVER_END |
| 1392 | 1289 | |
| 1393 | 1290 | |
| r1877 | r1878 | |
| 1396 | 1293 | /* basic machine hardware */ |
| 1397 | 1294 | MDRV_IMPORT_FROM(btime) |
| 1398 | 1295 | MDRV_CPU_REPLACE("main", M6502, 750000) |
| 1399 | MDRV_CPU_PROGRAM_MAP(bnj_readmem,bnj_writemem) | |
| 1400 | MDRV_CPU_VBLANK_INT(btime_nmi_interrupt,1) | |
| 1296 | MDRV_CPU_PROGRAM_MAP(bnj_map,0) | |
| 1401 | 1297 | |
| 1402 | 1298 | /* video hardware */ |
| 1403 | 1299 | MDRV_GFXDECODE(bnj) |
| r1877 | r1878 | |
| 1413 | 1309 | /* basic machine hardware */ |
| 1414 | 1310 | MDRV_IMPORT_FROM(btime) |
| 1415 | 1311 | MDRV_CPU_MODIFY("main") |
| 1416 | MDRV_CPU_PROGRAM_MAP(zoar_readmem,zoar_writemem) | |
| 1417 | MDRV_CPU_VBLANK_INT(zoar_irq_interrupt,1) | |
| 1312 | MDRV_CPU_PROGRAM_MAP(zoar_map,0) | |
| 1418 | 1313 | |
| 1419 | 1314 | /* video hardware */ |
| 1420 | 1315 | MDRV_GFXDECODE(zoar) |
| r1877 | r1878 | |
| 1429 | 1324 | /* basic machine hardware */ |
| 1430 | 1325 | MDRV_IMPORT_FROM(btime) |
| 1431 | 1326 | MDRV_CPU_REPLACE("main", M6502, 750000) |
| 1432 | MDRV_CPU_PROGRAM_MAP(disco_ | |
| 1327 | MDRV_CPU_PROGRAM_MAP(disco_ | |
| 1433 | 1328 | |
| 1434 | MDRV_CPU_MODIFY("sound") | |
| 1435 | MDRV_CPU_PROGRAM_MAP(disco_sound_readmem,disco_sound_writemem) | |
| 1329 | MDRV_CPU_MODIFY("audio") | |
| 1330 | MDRV_CPU_PROGRAM_MAP(disco_audio_map,0) | |
| 1436 | 1331 | |
| 1437 | 1332 | /* video hardware */ |
| 1438 | 1333 | MDRV_GFXDECODE(disco) |
| r1877 | r1878 | |
| 1851 | 1746 | |
| 1852 | 1747 | static DRIVER_INIT( cookrace ) |
| 1853 | 1748 | { |
| 1854 | memcpy(& | |
| 1749 | memcpy(&a | |
| 1855 | 1750 | decrypt_C10707_cpu(0, REGION_CPU1); |
| 1856 | 1751 | } |
| 1857 | 1752 | |
| 1858 | 1753 | static DRIVER_INIT( wtennis ) |
| 1859 | 1754 | { |
| 1860 | memcpy(& | |
| 1755 | memcpy(&a | |
| 1861 | 1756 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc15f, 0xc15f, 0, 0, wtennis_reset_hack_r); |
| 1862 | 1757 | decrypt_C10707_cpu(0, REGION_CPU1); |
| 1863 | 1758 | } |
| r1877 | r1878 | |
|---|---|---|
| 47 | 47 | static READ16_HANDLER( i_port1_r ) |
| 48 | 48 | { |
| 49 | 49 | if (control & 0x0080) |
| 50 | return input_port_0_word_r(0,0); | |
| 50 | return input_port_0_word_r(machine,0,0); | |
| 51 | 51 | else |
| 52 | return input_port_1_word_r(0,0); | |
| 52 | return input_port_1_word_r(machine,0,0); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | static READ16_HANDLER( i_port2_r ) |
| 56 | 56 | { |
| 57 | 57 | /* bit 0-1 battery power sensor: 3=good, 2=low, other=bad */ |
| 58 | ||
| 59 | return (input_port_2_word_r(0,0) & 0xfffc) | 0x0003; | |
| 58 | return (input_port_2_word_r(machine,0,0) & 0xfffc) | 0x0003; | |
| 60 | 59 | } |
| 61 | 60 | |
| 62 | 61 | |
| r1877 | r1878 | |
| 129 | 128 | static READ16_HANDLER( v_rom_r ) |
| 130 | 129 | { |
| 131 | 130 | UINT8 *mem8 = memory_region(REGION_GFX1); |
| 132 | int bank = K056832_word_r(0x34/2, 0xffff); | |
| 131 | int bank = K056832_word_r(machine, 0x34/2, 0xffff); | |
| 133 | 132 | |
| 134 | 133 | offset += bank * 0x800 * 4; |
| 135 | 134 | |
| r1877 | r1878 | |
| 143 | 142 | static READ16_HANDLER( gp2_vram_r ) |
| 144 | 143 | { |
| 145 | 144 | if (offset < 0x1000/2) |
| 146 | return K056832_ram_word_r(offset*2+1, mem_mask); | |
| 145 | return K056832_ram_word_r(machine, offset*2+1, mem_mask); | |
| 147 | 146 | else |
| 148 | return K056832_ram_word_r((offset-0x1000/2)*2, mem_mask); | |
| 147 | return K056832_ram_word_r(machine, (offset-0x1000/2)*2, mem_mask); | |
| 149 | 148 | } |
| 150 | 149 | |
| 151 | 150 | static READ16_HANDLER( gp2_vram_mirror_r ) |
| 152 | 151 | { |
| 153 | 152 | if (offset < 0x1000/2) |
| 154 | return K056832_ram_word_r(offset*2, mem_mask); | |
| 153 | return K056832_ram_word_r(machine, offset*2, mem_mask); | |
| 155 | 154 | else |
| 156 | return K056832_ram_word_r((offset-0x1000/2)*2+1, mem_mask); | |
| 155 | return K056832_ram_word_r(machine, (offset-0x1000/2)*2+1, mem_mask); | |
| 157 | 156 | } |
| 158 | 157 | |
| 159 | 158 | static WRITE16_HANDLER( gp2_vram_w ) |
| 160 | 159 | { |
| 161 | 160 | if (offset < 0x1000/2) |
| 162 | K056832_ram_word_w(offset*2+1, data, mem_mask); | |
| 161 | K056832_ram_word_w(machine, offset*2+1, data, mem_mask); | |
| 163 | 162 | else |
| 164 | K056832_ram_word_w((offset-0x1000/2)*2, data, mem_mask); | |
| 163 | K056832_ram_word_w(machine, (offset-0x1000/2)*2, data, mem_mask); | |
| 165 | 164 | } |
| 166 | 165 | |
| 167 | 166 | static WRITE16_HANDLER( gp2_vram_mirror_w ) |
| 168 | 167 | { |
| 169 | 168 | if (offset < 0x1000/2) |
| 170 | K056832_ram_word_w(offset*2, data, mem_mask); | |
| 169 | K056832_ram_word_w(machine, offset*2, data, mem_mask); | |
| 171 | 170 | else |
| 172 | K056832_ram_word_w((offset-0x1000/2)*2+1, data, mem_mask); | |
| 171 | K056832_ram_word_w(machine, (offset-0x1000/2)*2+1, data, mem_mask); | |
| 173 | 172 | } |
| 174 | 173 | |
| 175 | 174 | |
| r1877 | r1878 | |
| 196 | 195 | static READ16_HANDLER( k054539_word_r ) |
| 197 | 196 | { |
| 198 | 197 | if (ACCESSING_LSB16) |
| 199 | return K054539_0_r(offset); | |
| 198 | return K054539_0_r(machine, offset); | |
| 200 | 199 | |
| 201 | 200 | return 0; |
| 202 | 201 | } |
| r1877 | r1878 | |
| 204 | 203 | static WRITE16_HANDLER( k054539_word_w ) |
| 205 | 204 | { |
| 206 | 205 | if (ACCESSING_LSB16) |
| 207 | K054539_0_w(offset, data); | |
| 206 | K054539_0_w(machine, offset, data); | |
| 208 | 207 | } |
| 209 | 208 | |
| 210 | 209 | /*************/ |
| r1877 | r1878 | |
| 215 | 214 | static READ16_HANDLER( ide_std_r ) |
| 216 | 215 | { |
| 217 | 216 | if (offset & 0x01) |
| 218 | return ide_controller16_0_r(IDE_STD_OFFSET + offset/2, 0x00ff) >> 8; | |
| 217 | return ide_controller16_0_r(machine, IDE_STD_OFFSET + offset/2, 0x00ff) >> 8; | |
| 219 | 218 | else |
| 220 | return ide_controller16_0_r(IDE_STD_OFFSET + offset/2, 0x0000); | |
| 219 | return ide_controller16_0_r(machine, IDE_STD_OFFSET + offset/2, 0x0000); | |
| 221 | 220 | } |
| 222 | 221 | |
| 223 | 222 | static WRITE16_HANDLER( ide_std_w ) |
| 224 | 223 | { |
| 225 | 224 | if (offset & 0x01) |
| 226 | ide_controller16_0_w(IDE_STD_OFFSET + offset/2, data << 8, 0x00ff); | |
| 225 | ide_controller16_0_w(machine, IDE_STD_OFFSET + offset/2, data << 8, 0x00ff); | |
| 227 | 226 | else |
| 228 | ide_controller16_0_w(IDE_STD_OFFSET + offset/2, data, 0x0000); | |
| 227 | ide_controller16_0_w(machine, IDE_STD_OFFSET + offset/2, data, 0x0000); | |
| 229 | 228 | } |
| 230 | 229 | |
| 231 | 230 | static READ16_HANDLER( ide_alt_r ) |
| 232 | 231 | { |
| 233 | 232 | if (offset == 0) |
| 234 | return ide_controller16_0_r(IDE_ALT_OFFSET, 0xff00); | |
| 233 | return ide_controller16_0_r(machine, IDE_ALT_OFFSET, 0xff00); | |
| 235 | 234 | |
| 236 | 235 | return 0; |
| 237 | 236 | } |
| r1877 | r1878 | |
| 239 | 238 | static WRITE16_HANDLER( ide_alt_w ) |
| 240 | 239 | { |
| 241 | 240 | if (offset == 0) |
| 242 | ide_controller16_0_w(IDE_ALT_OFFSET, data, 0xff00); | |
| 241 | ide_controller16_0_w(machine, IDE_ALT_OFFSET, data, 0xff00); | |
| 243 | 242 | } |
| 244 | 243 | |
| 245 | 244 | |
| r1877 | r1878 | |
| 261 | 260 | break; |
| 262 | 261 | } |
| 263 | 262 | } |
| 264 | return ide_controller16_0_r(IDE_STD_OFFSET + offset/2, 0x00ff) >> 8; | |
| 263 | return ide_controller16_0_r(machine, IDE_STD_OFFSET + offset/2, 0x00ff) >> 8; | |
| 265 | 264 | } else { |
| 266 | return ide_controller16_0_r(IDE_STD_OFFSET + offset/2, 0x0000); | |
| 265 | return ide_controller16_0_r(machine, IDE_STD_OFFSET + offset/2, 0x0000); | |
| 267 | 266 | } |
| 268 | 267 | } |
| 269 | 268 | |
| r1877 | r1878 | |
| 676 | 675 | /* basic machine hardware */ |
| 677 | 676 | MDRV_CPU_ADD(M68000, 32000000/2) /* 16.000 MHz */ |
| 678 | 677 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 679 | MDRV_CPU_VBLANK_INT(qdrmfgp_interrupt, 2) | |
| 678 | MDRV_CPU_VBLANK_INT_HACK(qdrmfgp_interrupt, 2) | |
| 680 | 679 | |
| 681 | 680 | MDRV_MACHINE_START(qdrmfgp) |
| 682 | 681 | MDRV_MACHINE_RESET(qdrmfgp) |
| r1877 | r1878 | |
| 709 | 708 | /* basic machine hardware */ |
| 710 | 709 | MDRV_CPU_ADD(M68000, 32000000/2) /* 16.000 MHz */ |
| 711 | 710 | MDRV_CPU_PROGRAM_MAP(gp2_readmem,gp2_writemem) |
| 712 | MDRV_CPU_VBLANK_INT(qdrmfgp2_interrupt | |
| 711 | MDRV_CPU_VBLANK_INT("main", qdrmfgp2_interrupt | |
| 713 | 712 | |
| 714 | 713 | MDRV_MACHINE_START(qdrmfgp) |
| 715 | 714 | MDRV_MACHINE_RESET(qdrmfgp2) |
| r1877 | r1878 | |
|---|---|---|
| 250 | 250 | static WRITE16_HANDLER( cps1_sound_command_w ) |
| 251 | 251 | { |
| 252 | 252 | if (ACCESSING_LSB) |
| 253 | soundlatch_w(0,data & 0xff); | |
| 253 | soundlatch_w(machine,0,data & 0xff); | |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | WRITE16_HANDLER( cps1_coinctrl_w ) |
| r1877 | r1878 | |
| 3466 | 3466 | /* basic machine hardware */ |
| 3467 | 3467 | MDRV_CPU_ADD_TAG("main", M68000, 10000000) |
| 3468 | 3468 | MDRV_CPU_PROGRAM_MAP(cps1_readmem,cps1_writemem) |
| 3469 | MDRV_CPU_VBLANK_INT(cps1_interrupt | |
| 3469 | MDRV_CPU_VBLANK_INT("main", cps1_interrupt | |
| 3470 | 3470 | |
| 3471 | 3471 | MDRV_CPU_ADD_TAG("sound", Z80, 3579545) |
| 3472 | 3472 | /* audio CPU */ |
| r1877 | r1878 | |
| 3520 | 3520 | /* basic machine hardware */ |
| 3521 | 3521 | MDRV_IMPORT_FROM(cps1) |
| 3522 | 3522 | MDRV_CPU_REPLACE("main", M68000, 12000000) |
| 3523 | MDRV_CPU_VBLANK_INT(cps1_qsound_interrupt | |
| 3523 | MDRV_CPU_VBLANK_INT("main", cps1_qsound_interrupt | |
| 3524 | 3524 | |
| 3525 | 3525 | MDRV_CPU_REPLACE("sound", Z80, 8000000) |
| 3526 | 3526 | MDRV_CPU_PROGRAM_MAP(qsound_readmem,qsound_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 118 | 118 | ******************************************************************************/ |
| 119 | 119 | |
| 120 | 120 | #include "driver.h" |
| 121 | #include "deprecat.h" | |
| 121 | 122 | #include "sound/ay8910.h" |
| 122 | 123 | #include "nova2001.h" |
| 123 | 124 | |
| r1877 | r1878 | |
| 689 | 690 | /* basic machine hardware */ |
| 690 | 691 | MDRV_CPU_ADD(Z80, MAIN_CLOCK/4) // 3 MHz verified on schematics |
| 691 | 692 | MDRV_CPU_PROGRAM_MAP(nova2001_map,0) |
| 692 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 693 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 693 | 694 | |
| 694 | 695 | /* video hardware */ |
| 695 | 696 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 722 | 723 | /* basic machine hardware */ |
| 723 | 724 | MDRV_CPU_ADD(Z80, MAIN_CLOCK/4) // 3 MHz |
| 724 | 725 | MDRV_CPU_PROGRAM_MAP(ninjakun_cpu1_map,0) |
| 725 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 726 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 726 | 727 | |
| 727 | 728 | MDRV_CPU_ADD(Z80, MAIN_CLOCK/4) // 3 MHz |
| 728 | 729 | MDRV_CPU_PROGRAM_MAP(ninjakun_cpu2_map,0) |
| 729 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) /* ? */ | |
| 730 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* ? */ | |
| 730 | 731 | |
| 731 | 732 | MDRV_INTERLEAVE(100) /* 100 CPU slices per frame */ |
| 732 | 733 | |
| r1877 | r1878 | |
| 764 | 765 | MDRV_CPU_ADD(Z80, MAIN_CLOCK/4) // 3 MHz |
| 765 | 766 | MDRV_CPU_PROGRAM_MAP(pkunwar_map,0) |
| 766 | 767 | MDRV_CPU_IO_MAP(pkunwar_io,0) |
| 767 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 768 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 768 | 769 | |
| 769 | 770 | /* video hardware */ |
| 770 | 771 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 798 | 799 | MDRV_CPU_ADD(Z80, MAIN_CLOCK/4) // 3 MHz |
| 799 | 800 | MDRV_CPU_PROGRAM_MAP(raiders5_cpu1_map,0) |
| 800 | 801 | MDRV_CPU_IO_MAP(raiders5_io,0) |
| 801 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 802 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 802 | 803 | |
| 803 | 804 | MDRV_CPU_ADD(Z80, MAIN_CLOCK/4) // 3 MHz |
| 804 | 805 | MDRV_CPU_PROGRAM_MAP(raiders5_cpu2_map,0) |
| 805 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) /* ? */ | |
| 806 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* ? */ | |
| 806 | 807 | |
| 807 | 808 | MDRV_INTERLEAVE(400) |
| 808 | 809 |
| r1877 | r1878 | |
|---|---|---|
| 173 | 173 | MDRV_CPU_ADD(8080,9750000/9) /* 8224 chip is a divide by 9 */ |
| 174 | 174 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 175 | 175 | MDRV_CPU_IO_MAP(readport,writeport) |
| 176 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 176 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 177 | 177 | |
| 178 | 178 | /* video hardware */ |
| 179 | 179 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | static ADDRESS_MAP_START( yunsun16_readmem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 127 | AM_RANGE(0x000000, 0x07ffff) AM_READ(MRA16_ROM ) // ROM | |
| 128 | AM_RANGE(0xff0000, 0xffffff) AM_READ(MRA16_RAM ) // RAM | |
| 129 | AM_RANGE(0x800000, 0x800001) AM_READ(input_port_0_word_r ) // P1 + P2 | |
| 130 | AM_RANGE(0x800018, 0x800019) AM_READ(input_port_1_word_r ) // Coins | |
| 131 | AM_RANGE(0x80001a, 0x80001b) AM_READ(input_port_2_word_r ) // DSW1 | |
| 132 | AM_RANGE(0x80001c, 0x80001d) AM_READ(input_port_3_word_r ) // DSW2 | |
| 133 | AM_RANGE(0x800188, 0x800189) AM_READ(OKIM6295_status_0_lsb_r ) // Sound | |
| 134 | AM_RANGE(0x900000, 0x903fff) AM_READ(MRA16_RAM ) // Palette | |
| 135 | AM_RANGE(0x908000, 0x90bfff) AM_READ(MRA16_RAM ) // Layer 1 | |
| 136 | AM_RANGE(0x90c000, 0x90ffff) AM_READ(MRA16_RAM ) // Layer 0 | |
| 137 | AM_RANGE(0x910000, 0x910fff) AM_READ(MRA16_RAM ) // Sprites | |
| 138 | ADDRESS_MAP_END | |
| 139 | ||
| 140 | static ADDRESS_MAP_START( yunsun16_writemem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 141 | AM_RANGE(0x000000, 0x07ffff) AM_WRITE(MWA16_ROM ) // ROM | |
| 142 | AM_RANGE(0xff0000, 0xffffff) AM_WRITE(MWA16_RAM ) // RAM | |
| 143 | AM_RANGE(0x800030, 0x800031) AM_WRITE(MWA16_NOP ) // ? (value: don't care) | |
| 144 | AM_RANGE(0x800100, 0x800101) AM_WRITE(MWA16_NOP ) // ? $9100 | |
| 145 | AM_RANGE(0x800102, 0x800103) AM_WRITE(MWA16_NOP ) // ? $9080 | |
| 146 | AM_RANGE(0x800104, 0x800105) AM_WRITE(MWA16_NOP ) // ? $90c0 | |
| 147 | AM_RANGE(0x80010a, 0x80010b) AM_WRITE(MWA16_NOP ) // ? $9000 | |
| 126 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 127 | AM_RANGE(0x000000, 0x07ffff) AM_ROM | |
| 128 | AM_RANGE(0x800000, 0x800001) AM_READ(input_port_0_word_r ) // P1 + P2 | |
| 129 | AM_RANGE(0x800018, 0x800019) AM_READ(input_port_1_word_r ) // Coins | |
| 130 | AM_RANGE(0x80001a, 0x80001b) AM_READ(input_port_2_word_r ) // DSW1 | |
| 131 | AM_RANGE(0x80001c, 0x80001d) AM_READ(input_port_3_word_r ) // DSW2 | |
| 132 | AM_RANGE(0x800030, 0x800031) AM_WRITE(MWA16_NOP ) // ? (value: don't care) | |
| 133 | AM_RANGE(0x800100, 0x800101) AM_WRITE(MWA16_NOP ) // ? $9100 | |
| 134 | AM_RANGE(0x800102, 0x800103) AM_WRITE(MWA16_NOP ) // ? $9080 | |
| 135 | AM_RANGE(0x800104, 0x800105) AM_WRITE(MWA16_NOP ) // ? $90c0 | |
| 136 | AM_RANGE(0x80010a, 0x80010b) AM_WRITE(MWA16_NOP ) // ? $9000 | |
| 148 | 137 | AM_RANGE(0x80010c, 0x80010f) AM_WRITE(MWA16_RAM) AM_BASE(&yunsun16_scroll_1 ) // Scrolling |
| 149 | AM_RANGE(0x800114, 0x800117) AM_WRITE(MWA16_RAM) AM_BASE(&yunsun16_scroll_0 ) // | |
| 138 | AM_RANGE(0x800114, 0x800117) AM_WRITE(MWA16_RAM) AM_BASE(&yunsun16_scroll_0 ) // Scrolling | |
| 150 | 139 | AM_RANGE(0x800154, 0x800155) AM_WRITE(MWA16_RAM) AM_BASE(&yunsun16_priority ) // Priority |
| 151 | AM_RANGE(0x800180, 0x800181) AM_WRITE(yunsun16_sound_bank_w ) // Sound | |
| 152 | AM_RANGE(0x800188, 0x800189) AM_WRITE(OKIM6295_data_0_lsb_w ) // | |
| 153 | AM_RANGE(0x8001fe, 0x8001ff) AM_WRITE(MWA16_NOP ) // ? 0 (during int) | |
| 154 | AM_RANGE(0x900000, 0x903fff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16 ) // Palette | |
| 155 | AM_RANGE(0x908000, 0x90bfff) AM_WRITE(yunsun16_vram_1_w) AM_BASE(&yunsun16_vram_1 ) // Layer 1 | |
| 156 | AM_RANGE(0x90c000, 0x90ffff) AM_WRITE(yunsun16_vram_0_w) AM_BASE(&yunsun16_vram_0 ) // Layer 0 | |
| 157 | AM_RANGE(0x910000, 0x910fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size ) // Sprites | |
| 140 | AM_RANGE(0x800180, 0x800181) AM_WRITE(yunsun16_sound_bank_w ) // Sound | |
| 141 | AM_RANGE(0x800188, 0x800189) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w ) // Sound | |
| 142 | AM_RANGE(0x8001fe, 0x8001ff) AM_WRITE(MWA16_NOP ) // ? 0 (during int) | |
| 143 | AM_RANGE(0x900000, 0x903fff) AM_READWRITE(MRA16_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16) // Palette | |
| 144 | AM_RANGE(0x908000, 0x90bfff) AM_READWRITE(MRA16_RAM, yunsun16_vram_1_w) AM_BASE(&yunsun16_vram_1 ) // Layer 1 | |
| 145 | AM_RANGE(0x90c000, 0x90ffff) AM_READWRITE(MRA16_RAM, yunsun16_vram_0_w) AM_BASE(&yunsun16_vram_0 ) // Layer 0 | |
| 146 | AM_RANGE(0x910000, 0x910fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size ) // Sprites | |
| 147 | AM_RANGE(0xff0000, 0xffffff) AM_RAM | |
| 158 | 148 | ADDRESS_MAP_END |
| 159 | 149 | |
| 160 | 150 | |
| r1877 | r1878 | |
| 168 | 158 | */ |
| 169 | 159 | if ((data&0xff)!=0x3a) |
| 170 | 160 | { |
| 171 | soundlatch_w(0,data & 0xff); | |
| 172 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 161 | soundlatch_w(machine,0,data & 0xff); | |
| 162 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 173 | 163 | } |
| 174 | 164 | } |
| 175 | 165 | } |
| r1877 | r1878 | |
| 188 | 178 | |
| 189 | 179 | ***************************************************************************/ |
| 190 | 180 | |
| 191 | static ADDRESS_MAP_START( yunsun16_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 192 | AM_RANGE(0x0000, 0xdfff) AM_READ(MRA8_ROM ) // ROM | |
| 193 | AM_RANGE(0xe000, 0xe7ff) AM_READ(MRA8_RAM ) // RAM | |
| 181 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 182 | AM_RANGE(0x0000, 0xdfff) AM_ROM | |
| 183 | AM_RANGE(0xe000, 0xe7ff) AM_RAM | |
| 194 | 184 | ADDRESS_MAP_END |
| 195 | 185 | |
| 196 | static ADDRESS_MAP_START( yunsun16_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 197 | AM_RANGE(0x0000, 0xdfff) AM_WRITE(MWA8_ROM ) // ROM | |
| 198 | AM_RANGE(0xe000, 0xe7ff) AM_WRITE(MWA8_RAM ) // RAM | |
| 199 | ADDRESS_MAP_END | |
| 200 | ||
| 201 | static ADDRESS_MAP_START( yunsun16_sound_readport, ADDRESS_SPACE_IO, 8 ) | |
| 186 | static ADDRESS_MAP_START( sound_port_map, ADDRESS_SPACE_IO, 8 ) | |
| 202 | 187 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 203 | AM_RANGE(0x10, 0x10) AM_READ(YM3812_status_port_0_r ) // YM3812 | |
| 204 | AM_RANGE(0x18, 0x18) AM_READ(soundlatch_r ) // From Main CPU | |
| 205 | AM_RANGE(0x1c, 0x1c) AM_READ(OKIM6295_status_0_r ) // M6295 | |
| 188 | AM_RANGE(0x10, 0x10) AM_READWRITE(YM3812_status_port_0_r, YM3812_control_port_0_w ) // YM3812 | |
| 189 | AM_RANGE(0x11, 0x11) AM_WRITE(YM3812_write_port_0_w ) | |
| 190 | AM_RANGE(0x18, 0x18) AM_READ(soundlatch_r ) // From Main CPU | |
| 191 | AM_RANGE(0x1c, 0x1c) AM_READWRITE(OKIM6295_status_0_r, OKIM6295_data_0_w ) // M6295 | |
| 206 | 192 | ADDRESS_MAP_END |
| 207 | 193 | |
| 208 | static ADDRESS_MAP_START( yunsun16_sound_writeport, ADDRESS_SPACE_IO, 8 ) | |
| 209 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) | |
| 210 | AM_RANGE(0x10, 0x10) AM_WRITE(YM3812_control_port_0_w ) // YM3812 | |
| 211 | AM_RANGE(0x11, 0x11) AM_WRITE(YM3812_write_port_0_w ) | |
| 212 | AM_RANGE(0x1c, 0x1c) AM_WRITE(OKIM6295_data_0_w ) // M6295 | |
| 213 | ADDRESS_MAP_END | |
| 214 | 194 | |
| 215 | ||
| 216 | 195 | /*************************************************************************** |
| 217 | 196 | |
| 218 | 197 | |
| r1877 | r1878 | |
| 529 | 508 | |
| 530 | 509 | /* basic machine hardware */ |
| 531 | 510 | MDRV_CPU_ADD(M68000, 16000000) |
| 532 | MDRV_CPU_PROGRAM_MAP(yunsun16_readmem,yunsun16_writemem) | |
| 533 | MDRV_CPU_VBLANK_INT(irq2_line_hold,1) | |
| 511 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 512 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold) | |
| 534 | 513 | |
| 535 | 514 | MDRV_CPU_ADD(Z80, 3000000) |
| 536 | 515 | /* audio CPU */ /* ? */ |
| 537 | MDRV_CPU_PROGRAM_MAP(yunsun16_sound_readmem,yunsun16_sound_writemem) | |
| 538 | MDRV_CPU_IO_MAP(yunsun16_sound_readport,yunsun16_sound_writeport) | |
| 516 | MDRV_CPU_PROGRAM_MAP(sound_map,0) | |
| 517 | MDRV_CPU_IO_MAP(sound_port_map,0) | |
| 539 | 518 | |
| 540 | 519 | /* video hardware */ |
| 541 | 520 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 574 | 553 | |
| 575 | 554 | /* basic machine hardware */ |
| 576 | 555 | MDRV_CPU_ADD(M68000, 16000000) |
| 577 | MDRV_CPU_PROGRAM_MAP(yunsun16_readmem,yunsun16_writemem) | |
| 578 | MDRV_CPU_VBLANK_INT(irq2_line_hold,1) | |
| 556 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 557 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold) | |
| 579 | 558 | |
| 580 | 559 | /* video hardware */ |
| 581 | 560 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 90 | 90 | |
| 91 | 91 | static READ8_HANDLER(scobra_type2_ppi8255_0_r) |
| 92 | 92 | { |
| 93 | return ppi8255_0_r(offset >> 2); | |
| 93 | return ppi8255_0_r(machine, offset >> 2); | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | static READ8_HANDLER(scobra_type2_ppi8255_1_r) |
| 97 | 97 | { |
| 98 | return ppi8255_1_r(offset >> 2); | |
| 98 | return ppi8255_1_r(machine, offset >> 2); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | static WRITE8_HANDLER(scobra_type2_ppi8255_0_w) |
| 102 | 102 | { |
| 103 | ppi8255_0_w(offset >> 2, data); | |
| 103 | ppi8255_0_w(machine, offset >> 2, data); | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | static WRITE8_HANDLER(scobra_type2_ppi8255_1_w) |
| 107 | 107 | { |
| 108 | ppi8255_1_w(offset >> 2, data); | |
| 108 | ppi8255_1_w(machine, offset >> 2, data); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | static READ8_HANDLER(hustler_ppi8255_0_r) |
| 112 | 112 | { |
| 113 | return ppi8255_0_r(offset >> 3); | |
| 113 | return ppi8255_0_r(machine, offset >> 3); | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | static READ8_HANDLER(hustler_ppi8255_1_r) |
| 117 | 117 | { |
| 118 | return ppi8255_1_r(offset >> 3); | |
| 118 | return ppi8255_1_r(machine, offset >> 3); | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | static WRITE8_HANDLER(hustler_ppi8255_0_w) |
| 122 | 122 | { |
| 123 | ppi8255_0_w(offset >> 3, data); | |
| 123 | ppi8255_0_w(machine, offset >> 3, data); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | static WRITE8_HANDLER(hustler_ppi8255_1_w) |
| 127 | 127 | { |
| 128 | ppi8255_1_w(offset >> 3, data); | |
| 128 | ppi8255_1_w(machine, offset >> 3, data); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | static ADDRESS_MAP_START( type1_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 267 | 267 | |
| 268 | 268 | static READ8_HANDLER( anteatg_ppi8255_0_reg0_r ) |
| 269 | 269 | { |
| 270 | return ppi8255_0_r(0); | |
| 270 | return ppi8255_0_r(machine, 0); | |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | static READ8_HANDLER( anteatg_ppi8255_0_reg1_r ) |
| 274 | 274 | { |
| 275 | return ppi8255_0_r(1); | |
| 275 | return ppi8255_0_r(machine, 1); | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | static READ8_HANDLER( anteatg_ppi8255_0_reg2_r ) |
| 279 | 279 | { |
| 280 | return ppi8255_0_r(2); | |
| 280 | return ppi8255_0_r(machine, 2); | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | static READ8_HANDLER( anteatg_ppi8255_0_reg3_r ) |
| 284 | 284 | { |
| 285 | return ppi8255_0_r(3); | |
| 285 | return ppi8255_0_r(machine, 3); | |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | static WRITE8_HANDLER( anteatg_ppi8255_0_reg0_w ) |
| 289 | 289 | { |
| 290 | ppi8255_0_w(0, data); | |
| 290 | ppi8255_0_w(machine, 0, data); | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | static WRITE8_HANDLER( anteatg_ppi8255_0_reg1_w ) |
| 294 | 294 | { |
| 295 | ppi8255_0_w(1, data); | |
| 295 | ppi8255_0_w(machine, 1, data); | |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | static WRITE8_HANDLER( anteatg_ppi8255_0_reg2_w ) |
| 299 | 299 | { |
| 300 | ppi8255_0_w(2, data); | |
| 300 | ppi8255_0_w(machine, 2, data); | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | static WRITE8_HANDLER( anteatg_ppi8255_0_reg3_w ) |
| 304 | 304 | { |
| 305 | ppi8255_0_w(3, data); | |
| 305 | ppi8255_0_w(machine, 3, data); | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | static WRITE8_HANDLER( anteatg_ppi8255_1_reg0_w ) |
| 309 | 309 | { |
| 310 | ppi8255_1_w(0, data); | |
| 310 | ppi8255_1_w(machine, 0, data); | |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | static WRITE8_HANDLER( anteatg_ppi8255_1_reg1_w ) |
| 314 | 314 | { |
| 315 | ppi8255_1_w(1, data); | |
| 315 | ppi8255_1_w(machine, 1, data); | |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | static WRITE8_HANDLER( anteatg_ppi8255_1_reg3_w ) |
| 319 | 319 | { |
| 320 | ppi8255_1_w(3, data); | |
| 320 | ppi8255_1_w(machine, 3, data); | |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | static ADDRESS_MAP_START( anteatg_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
|---|---|---|
| 158 | 158 | ***************************************************************************/ |
| 159 | 159 | |
| 160 | 160 | #include "driver.h" |
| 161 | #include "deprecat.h" | |
| 161 | 162 | #include "sound/ay8910.h" |
| 162 | 163 | #include "sound/discrete.h" |
| 163 | 164 | |
| r1877 | r1878 | |
| 186 | 187 | static WRITE8_HANDLER( sound_command_w ) |
| 187 | 188 | { |
| 188 | 189 | static int dsc0=1, dsc1=1; |
| 189 | ||
| 190 | 190 | switch (offset) |
| 191 | 191 | { |
| 192 | 192 | // 0x90 triggers a jump to non-existant address(development system?) and must be filtered |
| 193 | 193 | case 0x00: |
| 194 | if (data != 0x90) soundlatch_w(0, data); | |
| 194 | if (data != 0x90) soundlatch_w(machine, 0, data); | |
| 195 | 195 | break; |
| 196 | 196 | |
| 197 | 197 | // explosion sound trigger(analog?) |
| 198 | 198 | case 0x08: |
| 199 | discrete_sound_w(STINGER_BOOM_EN1, dsc1); | |
| 200 | discrete_sound_w(STINGER_BOOM_EN2, dsc1^=1); | |
| 199 | discrete_sound_w(machine, STINGER_BOOM_EN1, dsc1); | |
| 200 | discrete_sound_w(machine, STINGER_BOOM_EN2, dsc1^=1); | |
| 201 | 201 | break; |
| 202 | 202 | |
| 203 | 203 | // player shot sound trigger(analog?) |
| 204 | 204 | case 0x0a: |
| 205 | discrete_sound_w(STINGER_SHOT_EN1, dsc0); | |
| 206 | discrete_sound_w(STINGER_SHOT_EN2, dsc0^=1); | |
| 205 | discrete_sound_w(machine, STINGER_SHOT_EN1, dsc0); | |
| 206 | discrete_sound_w(machine, STINGER_SHOT_EN2, dsc0^=1); | |
| 207 | 207 | break; |
| 208 | 208 | } |
| 209 | 209 | } |
| r1877 | r1878 | |
| 706 | 706 | /* basic machine hardware */ |
| 707 | 707 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz ??? */ |
| 708 | 708 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 709 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 709 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 710 | 710 | |
| 711 | 711 | MDRV_CPU_ADD(Z80, 14318000/8) /* ? */ |
| 712 | 712 | /* audio CPU */ |
| 713 | 713 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 714 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,4) /* ??? */ | |
| 714 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,4) /* ??? */ | |
| 715 | 715 | |
| 716 | 716 | /* video hardware */ |
| 717 | 717 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | static CUSTOM_INPUT( get_motor_not_ready ) |
| 57 | 57 | { |
| 58 | stactics_state *state = | |
| 58 | stactics_state *state = machine->driver_data; | |
| 59 | 59 | |
| 60 | 60 | /* if the motor is self-centering, but not centered yet */ |
| 61 | 61 | return ((*state->motor_on & 0x01) == 0) && |
| r1877 | r1878 | |
| 130 | 130 | static CUSTOM_INPUT( get_rng ) |
| 131 | 131 | { |
| 132 | 132 | /* this is a 555 timer, but cannot read one of the resistor values */ |
| 133 | return mame_rand( | |
| 133 | return mame_rand(machine) & 0x07; | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | |
| r1877 | r1878 | |
| 249 | 249 | |
| 250 | 250 | PORT_START /* IN2 */ |
| 251 | 251 | PORT_BIT (0x07, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_rng, 0) |
| 252 | PORT_BIT (0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stactics_get_ | |
| 252 | PORT_BIT (0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stactics_get_fr | |
| 253 | 253 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 254 | 254 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 255 | 255 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) |
| r1877 | r1878 | |
| 310 | 310 | /* basic machine hardware */ |
| 311 | 311 | MDRV_CPU_ADD(8080, 1933560) |
| 312 | 312 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 313 | MDRV_CPU_VBLANK_INT(stactics_interrupt | |
| 313 | MDRV_CPU_VBLANK_INT("main", stactics_interrupt | |
| 314 | 314 | |
| 315 | 315 | MDRV_MACHINE_START(stactics) |
| 316 | 316 |
| r1877 | r1878 | |
|---|---|---|
| 111 | 111 | |
| 112 | 112 | static WRITE8_HANDLER( mermaid_AY8910_write_port_w ) |
| 113 | 113 | { |
| 114 | if (mermaid_AY8910_enable[0]) AY8910_write_port_0_w(offset, data); | |
| 115 | if (mermaid_AY8910_enable[1]) AY8910_write_port_1_w(offset, data); | |
| 114 | if (mermaid_AY8910_enable[0]) AY8910_write_port_0_w(machine, offset, data); | |
| 115 | if (mermaid_AY8910_enable[1]) AY8910_write_port_1_w(machine, offset, data); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | static WRITE8_HANDLER( mermaid_AY8910_control_port_w ) |
| 119 | 119 | { |
| 120 | if (mermaid_AY8910_enable[0]) AY8910_control_port_0_w(offset, data); | |
| 121 | if (mermaid_AY8910_enable[1]) AY8910_control_port_1_w(offset, data); | |
| 120 | if (mermaid_AY8910_enable[0]) AY8910_control_port_0_w(machine, offset, data); | |
| 121 | if (mermaid_AY8910_enable[1]) AY8910_control_port_1_w(machine, offset, data); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /* Memory Map */ |
| r1877 | r1878 | |
| 255 | 255 | // basic machine hardware |
| 256 | 256 | MDRV_CPU_ADD(Z80, 4000000) // ??? |
| 257 | 257 | MDRV_CPU_PROGRAM_MAP(mermaid_map, 0) |
| 258 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 258 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 259 | 259 | |
| 260 | 260 | // video hardware |
| 261 | 261 |
| r1877 | r1878 | |
|---|---|---|
| 190 | 190 | |
| 191 | 191 | static READ8_HANDLER( calorie_soundlatch_r ) |
| 192 | 192 | { |
| 193 | UINT8 latch = soundlatch_r(0); | |
| 194 | soundlatch_clear_w(0,0); | |
| 193 | UINT8 latch = soundlatch_r(machine,0); | |
| 194 | soundlatch_clear_w(machine,0,0); | |
| 195 | 195 | return latch; |
| 196 | 196 | } |
| 197 | 197 | |
| r1877 | r1878 | |
| 362 | 362 | /* basic machine hardware */ |
| 363 | 363 | MDRV_CPU_ADD(Z80,4000000) /* 4 MHz */ |
| 364 | 364 | MDRV_CPU_PROGRAM_MAP(calorie_map,0) |
| 365 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 365 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 366 | 366 | |
| 367 | 367 | MDRV_CPU_ADD(Z80,3000000) /* 3 MHz */ |
| 368 | 368 | MDRV_CPU_PROGRAM_MAP(calorie_sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 47 | 47 | 3 | xxxxxxxx xxxxxx-- | sprite code |
| 48 | 48 | */ |
| 49 | 49 | |
| 50 | static void draw_sprites(running_machine *machine, | |
| 50 | static void draw_sprites(running_machine *machine, | |
| 51 | 51 | { |
| 52 | 52 | int i, x, y, ex, ey; |
| 53 | 53 | const gfx_element *gfx = machine->gfx[0]; |
| r1877 | r1878 | |
| 252 | 252 | /* basic machine hardware */ |
| 253 | 253 | MDRV_CPU_ADD(M68000,24000000/2) /* ? MHz */ |
| 254 | 254 | MDRV_CPU_PROGRAM_MAP(drtomy_map,0) |
| 255 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 255 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 256 | 256 | |
| 257 | 257 | /* video hardware */ |
| 258 | 258 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | #include "driver.h" |
| 146 | 146 | #include "deprecat.h" |
| 147 | #include "memconv.h" | |
| 147 | 148 | #include "gaelco3d.h" |
| 148 | 149 | #include "cpu/tms32031/tms32031.h" |
| 149 | 150 | #include "cpu/adsp2100/adsp2100.h" |
| r1877 | r1878 | |
| 252 | 253 | { |
| 253 | 254 | cpunum_set_input_line(Machine, 0, 2, CLEAR_LINE); |
| 254 | 255 | } |
| 255 | static WRITE32_HANDLER( irq_ack_020_w ) { if ((mem_mask & 0xffff0000) != 0xffff0000) irq_ack_w(offset, data >> 16, mem_mask >> 16); } | |
| 256 | static WRITE32_HANDLER( irq_ack_020_w ) { if ((mem_mask & 0xffff0000) != 0xffff0000) irq_ack_w(machine, offset, data >> 16, mem_mask >> 16); } | |
| 256 | 257 | |
| 257 | 258 | |
| 258 | 259 | |
| r1877 | r1878 | |
| 270 | 271 | logerror("eeprom_data_r(%02X)\n", result); |
| 271 | 272 | return result; |
| 272 | 273 | } |
| 273 | static READ32_HANDLER( eeprom_data_020_r ) { return eeprom_data_r(offset, mem_mask) << 16; } | |
| 274 | static READ32_HANDLER( eeprom_data_020_r ) { return eeprom_data_r(machine, offset, mem_mask) << 16; } | |
| 274 | 275 | |
| 275 | 276 | |
| 276 | 277 | static WRITE16_HANDLER( eeprom_data_w ) |
| r1877 | r1878 | |
| 278 | 279 | if (!(mem_mask & 0xff)) |
| 279 | 280 | EEPROM_write_bit(data & 0x01); |
| 280 | 281 | } |
| 281 | static WRITE32_HANDLER( eeprom_data_020_w ) { if ((mem_mask & 0xffff) != 0xffff) eeprom_data_w(offset, data, mem_mask); } | |
| 282 | static WRITE32_HANDLER( eeprom_data_020_w ) { if ((mem_mask & 0xffff) != 0xffff) eeprom_data_w(machine, offset, data, mem_mask); } | |
| 282 | 283 | |
| 283 | 284 | |
| 284 | 285 | static WRITE16_HANDLER( eeprom_clock_w ) |
| r1877 | r1878 | |
| 286 | 287 | if (!(mem_mask & 0xff)) |
| 287 | 288 | EEPROM_set_clock_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE); |
| 288 | 289 | } |
| 289 | static WRITE32_HANDLER( eeprom_clock_020_w ) { if ((mem_mask & 0xffff) != 0xffff) eeprom_clock_w(offset, data, mem_mask); } | |
| 290 | static WRITE32_HANDLER( eeprom_clock_020_w ) { if ((mem_mask & 0xffff) != 0xffff) eeprom_clock_w(machine, offset, data, mem_mask); } | |
| 290 | 291 | |
| 291 | 292 | |
| 292 | 293 | static WRITE16_HANDLER( eeprom_cs_w ) |
| r1877 | r1878 | |
| 294 | 295 | if (!(mem_mask & 0xff)) |
| 295 | 296 | EEPROM_set_cs_line((data & 0x01) ? CLEAR_LINE : ASSERT_LINE); |
| 296 | 297 | } |
| 297 | static WRITE32_HANDLER( eeprom_cs_020_w ) { if ((mem_mask & 0xffff) != 0xffff) eeprom_cs_w(offset, data, mem_mask); } | |
| 298 | static WRITE32_HANDLER( eeprom_cs_020_w ) { if ((mem_mask & 0xffff) != 0xffff) eeprom_cs_w(machine, offset, data, mem_mask); } | |
| 298 | 299 | |
| 299 | 300 | |
| 300 | 301 | |
| r1877 | r1878 | |
| 318 | 319 | if (!(mem_mask & 0xff)) |
| 319 | 320 | timer_call_after_resynch(NULL, data & 0xff, delayed_sound_w); |
| 320 | 321 | } |
| 321 | static WRITE32_HANDLER( sound_data_020_w ) { if ((mem_mask & 0xffff0000) != 0xffff0000) sound_data_w(offset, data >> 16, mem_mask >> 16); } | |
| 322 | static WRITE32_HANDLER( sound_data_020_w ) { if ((mem_mask & 0xffff0000) != 0xffff0000) sound_data_w(machine, offset, data >> 16, mem_mask >> 16); } | |
| 322 | 323 | |
| 323 | 324 | |
| 324 | 325 | static READ16_HANDLER( sound_data_r ) |
| r1877 | r1878 | |
| 336 | 337 | return sound_status; |
| 337 | 338 | return 0xffff; |
| 338 | 339 | } |
| 339 | static READ32_HANDLER( sound_status_020_r ) { if ((mem_mask & 0x0000ffff) != 0x0000ffff) return sound_status_r(offset, mem_mask); return ~0; } | |
| 340 | static READ32_HANDLER( sound_status_020_r ) { if ((mem_mask & 0x0000ffff) != 0x0000ffff) return sound_status_r(machine, offset, mem_mask); return ~0; } | |
| 340 | 341 | |
| 341 | 342 | |
| 342 | 343 | static WRITE16_HANDLER( sound_status_w ) |
| r1877 | r1878 | |
| 382 | 383 | else |
| 383 | 384 | logerror("%06X:analog_port_clock_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask); |
| 384 | 385 | } |
| 385 | static WRITE32_HANDLER( analog_port_clock_020_w ) { if ((mem_mask & 0xffff) != 0xffff) analog_port_clock_w(offset, data, mem_mask); } | |
| 386 | static WRITE32_HANDLER( analog_port_clock_020_w ) { if ((mem_mask & 0xffff) != 0xffff) analog_port_clock_w(machine, offset, data, mem_mask); } | |
| 386 | 387 | |
| 387 | 388 | |
| 388 | 389 | static WRITE16_HANDLER( analog_port_latch_w ) |
| r1877 | r1878 | |
| 401 | 402 | else |
| 402 | 403 | logerror("%06X:analog_port_latch_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask); |
| 403 | 404 | } |
| 404 | static WRITE32_HANDLER( analog_port_latch_020_w ) { if ((mem_mask & 0xffff) != 0xffff) analog_port_latch_w(offset, data, mem_mask); } | |
| 405 | static WRITE32_HANDLER( analog_port_latch_020_w ) { if ((mem_mask & 0xffff) != 0xffff) analog_port_latch_w(machine, offset, data, mem_mask); } | |
| 405 | 406 | |
| 406 | 407 | |
| 407 | 408 | |
| r1877 | r1878 | |
| 445 | 446 | logerror("%06X:tms_reset_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask); |
| 446 | 447 | cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data == 0xffff) ? CLEAR_LINE : ASSERT_LINE); |
| 447 | 448 | } |
| 448 | static WRITE32_HANDLER( tms_reset_020_w ) { if ((mem_mask & 0xffff) != 0xffff) tms_reset_w(offset, data, mem_mask); } | |
| 449 | static WRITE32_HANDLER( tms_reset_020_w ) { if ((mem_mask & 0xffff) != 0xffff) tms_reset_w(machine, offset, data, mem_mask); } | |
| 449 | 450 | |
| 450 | 451 | |
| 451 | 452 | static WRITE16_HANDLER( tms_irq_w ) |
| r1877 | r1878 | |
| 456 | 457 | if (!(mem_mask & 0xff)) |
| 457 | 458 | cpunum_set_input_line(Machine, 1, 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); |
| 458 | 459 | } |
| 459 | static WRITE32_HANDLER( tms_irq_020_w ) { if ((mem_mask & 0xffff) != 0xffff) tms_irq_w(offset, data, mem_mask); } | |
| 460 | static WRITE32_HANDLER( tms_irq_020_w ) { if ((mem_mask & 0xffff) != 0xffff) tms_irq_w(machine, offset, data, mem_mask); } | |
| 460 | 461 | |
| 461 | 462 | |
| 462 | 463 | static WRITE16_HANDLER( tms_control3_w ) |
| 463 | 464 | { |
| 464 | 465 | logerror("%06X:tms_control3_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask); |
| 465 | 466 | } |
| 466 | static WRITE32_HANDLER( tms_control3_020_w ) { if ((mem_mask & 0xffff) != 0xffff) tms_control3_w(offset, data, mem_mask); } | |
| 467 | static WRITE32_HANDLER( tms_control3_020_w ) { if ((mem_mask & 0xffff) != 0xffff) tms_control3_w(machine, offset, data, mem_mask); } | |
| 467 | 468 | |
| 468 | 469 | |
| 469 | 470 | static WRITE16_HANDLER( tms_comm_w ) |
| r1877 | r1878 | |
| 471 | 472 | COMBINE_DATA(&tms_comm_base[offset ^ tms_offset_xor]); |
| 472 | 473 | logerror("%06X:tms_comm_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset*2, data, ~mem_mask); |
| 473 | 474 | } |
| 474 | static WRITE32_HANDLER( tms_comm_020_w ) | |
| 475 | { | |
| 476 | if ((mem_mask & 0xffff0000) != 0xffff0000) tms_comm_w(offset * 2 + 0, data >> 16, mem_mask >> 16); | |
| 477 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) tms_comm_w(offset * 2 + 1, data, mem_mask); | |
| 478 | } | |
| 475 | static WRITE32_HANDLER( tms_comm_020_w ) { write32be_with_16be_handler(tms_comm_w, machine, offset, data, mem_mask); } | |
| 479 | 476 | |
| 480 | 477 | |
| 481 | 478 | |
| r1877 | r1878 | |
| 711 | 708 | if (!(mem_mask & 0xff)) |
| 712 | 709 | set_led_status(0, data != 0); |
| 713 | 710 | } |
| 714 | static WRITE32_HANDLER( led_0_020_w ) { if ((mem_mask & 0xffff) != 0xffff) led_0_w(offset, data, mem_mask); } | |
| 711 | static WRITE32_HANDLER( led_0_020_w ) { if ((mem_mask & 0xffff) != 0xffff) led_0_w(machine, offset, data, mem_mask); } | |
| 715 | 712 | |
| 716 | 713 | |
| 717 | 714 | static WRITE16_HANDLER( led_1_w ) |
| r1877 | r1878 | |
| 720 | 717 | if (!(mem_mask & 0xff)) |
| 721 | 718 | set_led_status(1, data != 0); |
| 722 | 719 | } |
| 723 | static WRITE32_HANDLER( led_1_020_w ) { if ((mem_mask & 0xffff) != 0xffff) led_1_w(offset, data, mem_mask); } | |
| 720 | static WRITE32_HANDLER( led_1_020_w ) { if ((mem_mask & 0xffff) != 0xffff) led_1_w(machine, offset, data, mem_mask); } | |
| 724 | 721 | |
| 725 | 722 | |
| 726 | 723 | |
| r1877 | r1878 | |
| 943 | 940 | /* basic machine hardware */ |
| 944 | 941 | MDRV_CPU_ADD_TAG("main", M68000, 15000000) |
| 945 | 942 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 946 | MDRV_CPU_VBLANK_INT(vblank_gen | |
| 943 | MDRV_CPU_VBLANK_INT("main", vblank_gen | |
| 947 | 944 | |
| 948 | 945 | MDRV_CPU_ADD_TAG("tms", TMS32031, 60000000) |
| 949 | 946 | MDRV_CPU_PROGRAM_MAP(tms_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 28 | 28 | ***************************************************************************/ |
| 29 | 29 | |
| 30 | 30 | #include "driver.h" |
| 31 | #include "deprecat.h" | |
| 31 | 32 | #include "sound/discrete.h" |
| 32 | 33 | #include "avalnche.h" |
| 33 | 34 | |
| r1877 | r1878 | |
| 155 | 156 | |
| 156 | 157 | static INPUT_PORTS_START( avalnche ) |
| 157 | 158 | PORT_START_TAG("IN0") |
| 158 | PORT_BIT (0x03, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Spare */ | |
| 159 | PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Coinage ) ) | |
| 159 | PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW:6" ) /* Listed as "Unused" */ | |
| 160 | PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW:5" ) /* Listed as "Unused" */ | |
| 161 | PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:4,3") | |
| 160 | 162 | PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) |
| 161 | 163 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_1C ) ) |
| 162 | 164 | PORT_DIPSETTING( 0x0c, DEF_STR( 1C_2C ) ) |
| 163 | 165 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) |
| 164 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Language ) ) | |
| 166 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Language ) ) PORT_DIPLOCATION("SW:2,1") | |
| 165 | 167 | PORT_DIPSETTING( 0x00, DEF_STR( English ) ) |
| 166 | 168 | PORT_DIPSETTING( 0x30, DEF_STR( German ) ) |
| 167 | 169 | PORT_DIPSETTING( 0x20, DEF_STR( French ) ) |
| r1877 | r1878 | |
| 172 | 174 | PORT_START_TAG("IN1") |
| 173 | 175 | PORT_BIT ( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 174 | 176 | PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 175 | PORT_DIPNAME( 0x04, 0x04, "Allow Extended Play" ) | |
| 177 | PORT_DIPNAME( 0x04, 0x04, "Allow Extended Play" ) PORT_DIPLOCATION("SW:8") | |
| 176 | 178 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 177 | 179 | PORT_DIPSETTING( 0x04, DEF_STR( Yes ) ) |
| 178 | PORT_DIPNAME( 0x08, 0x00, "Lives/Extended Play" ) | |
| 179 | PORT_DIPSETTING( 0x00, "3/450 points" ) | |
| 180 | PORT_DIPSETTING( 0x08, "5/750 points" ) | |
| 181 | PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* SLAM */ | |
| 180 | PORT_DIPNAME( 0x08, 0x00, "Lives/Extended Play" ) PORT_DIPLOCATION("SW:7") | |
| 181 | PORT_DIPSETTING( 0x00, "3/450 Points" ) | |
| 182 | PORT_DIPSETTING( 0x08, "5/750 Points" ) | |
| 183 | PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* SLAM */ | |
| 182 | 184 | PORT_SERVICE( 0x20, IP_ACTIVE_HIGH) |
| 183 | PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* Serve */ | |
| 184 | PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) /* VBLANK */ | |
| 185 | PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* Serve */ | |
| 186 | PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) /* VBLANK */ | |
| 185 | 187 | |
| 186 | 188 | PORT_START_TAG("IN2") |
| 187 | 189 | PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x40,0xb7) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) |
| r1877 | r1878 | |
| 189 | 191 | |
| 190 | 192 | |
| 191 | 193 | static INPUT_PORTS_START( cascade ) |
| 192 | PORT_START_TAG("IN0") | |
| 193 | PORT_BIT (0x03, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Spare */ | |
| 194 | PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Coinage ) ) | |
| 195 | PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) | |
| 196 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_1C ) ) | |
| 197 | PORT_DIPSETTING( 0x0c, DEF_STR( 1C_2C ) ) | |
| 198 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) | |
| 199 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Language ) ) | |
| 194 | PORT_INCLUDE( avalnche ) | |
| 195 | ||
| 196 | PORT_MODIFY("IN0") | |
| 197 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Language ) ) PORT_DIPLOCATION("SW:2,1") | |
| 200 | 198 | PORT_DIPSETTING( 0x00, DEF_STR( English ) ) |
| 201 | 199 | PORT_DIPSETTING( 0x30, DEF_STR( German ) ) |
| 202 | 200 | PORT_DIPSETTING( 0x20, DEF_STR( French ) ) |
| 203 | 201 | PORT_DIPSETTING( 0x10, DEF_STR( Italian ) ) |
| 204 | PORT_BIT (0x40, IP_ACTIVE_HIGH, IPT_START2 ) | |
| 205 | PORT_BIT (0x80, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 206 | 202 | |
| 207 | PORT_START_TAG("IN1") | |
| 208 | PORT_BIT ( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 209 | PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 210 | PORT_DIPNAME( 0x04, 0x04, "Allow Extended Play" ) | |
| 211 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) | |
| 212 | PORT_DIPSETTING( 0x04, DEF_STR( Yes ) ) | |
| 213 | PORT_DIPNAME( 0x08, 0x00, "Extended Play" ) | |
| 214 | PORT_DIPSETTING( 0x00, "1500 points" ) | |
| 215 | PORT_DIPSETTING( 0x08, "2500 points" ) | |
| 216 | PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* SLAM */ | |
| 217 | PORT_SERVICE( 0x20, IP_ACTIVE_HIGH) | |
| 218 | PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* Serve */ | |
| 219 | PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) /* VBLANK */ | |
| 220 | ||
| 221 | PORT_START_TAG("IN2") | |
| 222 | PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x40,0xb7) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) | |
| 203 | PORT_MODIFY("IN1") | |
| 204 | PORT_DIPNAME( 0x08, 0x00, "Extended Play" ) PORT_DIPLOCATION("SW:7") | |
| 205 | PORT_DIPSETTING( 0x00, "1500 Points" ) | |
| 206 | PORT_DIPSETTING( 0x08, "2500 Points" ) | |
| 223 | 207 | INPUT_PORTS_END |
| 224 | 208 | |
| 225 | 209 | |
| r1877 | r1878 | |
| 235 | 219 | /* basic machine hardware */ |
| 236 | 220 | MDRV_CPU_ADD(M6502,12096000/16) /* clock input is the "2H" signal divided by two */ |
| 237 | 221 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 238 | MDRV_CPU_VBLANK_INT(avalnche_interrupt,8) | |
| 222 | MDRV_CPU_VBLANK_INT_HACK(avalnche_interrupt,8) | |
| 239 | 223 | |
| 240 | 224 | /* video hardware */ |
| 241 | 225 | MDRV_VIDEO_UPDATE(avalnche) |
| r1877 | r1878 | |
|---|---|---|
| 264 | 264 | |
| 265 | 265 | ***************************************************************************/ |
| 266 | 266 | |
| 267 | #include <stdarg.h> | |
| 268 | 267 | #include "driver.h" |
| 268 | #include "deprecat.h" | |
| 269 | 269 | #include "cpu/mips/psx.h" |
| 270 | 270 | #include "includes/psx.h" |
| 271 | 271 | #include "machine/at28c16.h" |
| r1877 | r1878 | |
| 765 | 765 | static const struct |
| 766 | 766 | { |
| 767 | 767 | const char *s_name; |
| 768 | read32_ | |
| 768 | read32_machin | |
| 769 | 769 | int n_daughterboard; |
| 770 | 770 | } namcos11_config_table[] = |
| 771 | 771 | { |
| r1877 | r1878 | |
| 877 | 877 | /* basic machine hardware */ |
| 878 | 878 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) |
| 879 | 879 | MDRV_CPU_PROGRAM_MAP( namcos11_map, 0 ) |
| 880 | MDRV_CPU_VBLANK_INT( namcos11_vblank | |
| 880 | MDRV_CPU_VBLANK_INT("main", namcos11_vblank | |
| 881 | 881 | |
| 882 | 882 | MDRV_MACHINE_RESET( namcos11 ) |
| 883 | 883 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| r1877 | r1878 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | static CUSTOM_INPUT( ticket_status ) |
| 66 | 66 | { |
| 67 | return ticket_dispenser_0_r(0) >> 7; | |
| 67 | return ticket_dispenser_0_r(machine, 0) >> 7; | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
| r1877 | r1878 | |
| 85 | 85 | static WRITE16_HANDLER( ripribit_control_w ) |
| 86 | 86 | { |
| 87 | 87 | coin_counter_w(0, data & 1); |
| 88 | ticket_dispenser_0_w(0, ((data >> 1) & 1) << 7); | |
| 88 | ticket_dispenser_0_w(machine, 0, ((data >> 1) & 1) << 7); | |
| 89 | 89 | output_set_lamp_value(0, (data >> 2) & 1); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| 93 | 93 | static WRITE16_HANDLER( cfarm_control_w ) |
| 94 | 94 | { |
| 95 | ticket_dispenser_0_w(0, ((data >> 0) & 1) << 7); | |
| 95 | ticket_dispenser_0_w(machine, 0, ((data >> 0) & 1) << 7); | |
| 96 | 96 | output_set_lamp_value(0, (data >> 2) & 1); |
| 97 | 97 | output_set_lamp_value(1, (data >> 3) & 1); |
| 98 | 98 | output_set_lamp_value(2, (data >> 4) & 1); |
| r1877 | r1878 | |
| 102 | 102 | |
| 103 | 103 | static WRITE16_HANDLER( cclownz_control_w ) |
| 104 | 104 | { |
| 105 | ticket_dispenser_0_w(0, ((data >> 0) & 1) << 7); | |
| 105 | ticket_dispenser_0_w(machine, 0, ((data >> 0) & 1) << 7); | |
| 106 | 106 | output_set_lamp_value(0, (data >> 2) & 1); |
| 107 | 107 | output_set_lamp_value(1, (data >> 4) & 1); |
| 108 | 108 | output_set_lamp_value(2, (data >> 5) & 1); |
| r1877 | r1878 | |
|---|---|---|
| 277 | 277 | /* basic machine hardware */ |
| 278 | 278 | MDRV_CPU_ADD(M68000, 10000000) |
| 279 | 279 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 280 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 280 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 281 | 281 | |
| 282 | 282 | SEIBU_SOUND_SYSTEM_CPU(4000000) /* Perhaps 14318180/4? */ |
| 283 | 283 | |
| r1877 | r1878 | |
| 306 | 306 | /* basic machine hardware */ |
| 307 | 307 | MDRV_CPU_ADD(M68000, 10000000) |
| 308 | 308 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 309 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 309 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 310 | 310 | |
| 311 | 311 | SEIBU2_SOUND_SYSTEM_CPU(14318180/4) |
| 312 | 312 |
| r1877 | r1878 | |
|---|---|---|
| 50 | 50 | Ditto for samples 65, 66, 67 and 68. |
| 51 | 51 | */ |
| 52 | 52 | |
| 53 | #ifdef UNUSED_DEFINITION | |
| 53 | 54 | static const UINT8 kickgoal_cmd_snd[128] = |
| 54 | 55 | { |
| 55 | 56 | /*00*/ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, |
| r1877 | r1878 | |
| 61 | 62 | /*30*/ 0x00, 0x00, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, |
| 62 | 63 | /*38*/ 0x29, 0x2a, 0x2b, 0x00, 0x6b, 0x00, 0x00, 0x00 |
| 63 | 64 | }; |
| 65 | #endif | |
| 64 | 66 | |
| 65 | 67 | /* Sound numbers in the sample ROM |
| 66 | 68 | 01 Melody A Bank 0 |
| r1877 | r1878 | |
| 224 | 226 | case 0xfd: OKIM6295_set_bank_base(0, (2 * 0x40000)); break; |
| 225 | 227 | case 0xfe: OKIM6295_set_bank_base(0, (1 * 0x40000)); break; |
| 226 | 228 | case 0xff: OKIM6295_set_bank_base(0, (3 * 0x40000)); break; |
| 227 | case 0x78: OKIM6295_data_0_w(0,data); | |
| 229 | case 0x78: OKIM6295_data_0_w(machine,0,data); | |
| 228 | 230 | snd_sam[0]=00; snd_sam[1]=00; snd_sam[2]=00; snd_sam[3]=00; |
| 229 | 231 | break; |
| 230 | 232 | default: if (snd_new) /* Play new sample */ |
| r1877 | r1878 | |
| 232 | 234 | if ((data & 0x80) && (snd_sam[3] != snd_new)) |
| 233 | 235 | { |
| 234 | 236 | logerror("About to play sample %02x at vol %02x\n",snd_new,data); |
| 235 | if ((OKIM6295_status_0_r(0) & 0x08) != 0x08) | |
| 237 | if ((OKIM6295_status_0_r(machine,0) & 0x08) != 0x08) | |
| 236 | 238 | { |
| 237 | 239 | logerror("Playing sample %02x at vol %02x\n",snd_new,data); |
| 238 | OKIM6295_data_0_w(0,snd_new); | |
| 239 | OKIM6295_data_0_w(0,data); | |
| 240 | OKIM6295_data_0_w(machine,0,snd_new); | |
| 241 | OKIM6295_data_0_w(machine,0,data); | |
| 240 | 242 | } |
| 241 | 243 | snd_new = 00; |
| 242 | 244 | } |
| 243 | 245 | if ((data & 0x40) && (snd_sam[2] != snd_new)) |
| 244 | 246 | { |
| 245 | 247 | logerror("About to play sample %02x at vol %02x\n",snd_new,data); |
| 246 | if ((OKIM6295_status_0_r(0) & 0x04) != 0x04) | |
| 248 | if ((OKIM6295_status_0_r(machine,0) & 0x04) != 0x04) | |
| 247 | 249 | { |
| 248 | 250 | logerror("Playing sample %02x at vol %02x\n",snd_new,data); |
| 249 | OKIM6295_data_0_w(0,snd_new); | |
| 250 | OKIM6295_data_0_w(0,data); | |
| 251 | OKIM6295_data_0_w(machine,0,snd_new); | |
| 252 | OKIM6295_data_0_w(machine,0,data); | |
| 251 | 253 | } |
| 252 | 254 | snd_new = 00; |
| 253 | 255 | } |
| 254 | 256 | if ((data & 0x20) && (snd_sam[1] != snd_new)) |
| 255 | 257 | { |
| 256 | 258 | logerror("About to play sample %02x at vol %02x\n",snd_new,data); |
| 257 | if ((OKIM6295_status_0_r(0) & 0x02) != 0x02) | |
| 259 | if ((OKIM6295_status_0_r(machine,0) & 0x02) != 0x02) | |
| 258 | 260 | { |
| 259 | 261 | logerror("Playing sample %02x at vol %02x\n",snd_new,data); |
| 260 | OKIM6295_data_0_w(0,snd_new); | |
| 261 | OKIM6295_data_0_w(0,data); | |
| 262 | OKIM6295_data_0_w(machine,0,snd_new); | |
| 263 | OKIM6295_data_0_w(machine,0,data); | |
| 262 | 264 | } |
| 263 | 265 | snd_new = 00; |
| 264 | 266 | } |
| 265 | 267 | if ((data & 0x10) && (snd_sam[0] != snd_new)) |
| 266 | 268 | { |
| 267 | 269 | logerror("About to play sample %02x at vol %02x\n",snd_new,data); |
| 268 | if ((OKIM6295_status_0_r(0) & 0x01) != 0x01) | |
| 270 | if ((OKIM6295_status_0_r(machine,0) & 0x01) != 0x01) | |
| 269 | 271 | { |
| 270 | 272 | logerror("Playing sample %02x at vol %02x\n",snd_new,data); |
| 271 | OKIM6295_data_0_w(0,snd_new); | |
| 272 | OKIM6295_data_0_w(0,data); | |
| 273 | OKIM6295_data_0_w(machine,0,snd_new); | |
| 274 | OKIM6295_data_0_w(machine,0,data); | |
| 273 | 275 | } |
| 274 | 276 | snd_new = 00; |
| 275 | 277 | } |
| r1877 | r1878 | |
| 284 | 286 | else /* Turn a channel off */ |
| 285 | 287 | { |
| 286 | 288 | logerror("Turning channel %02x off\n",data); |
| 287 | OKIM6295_data_0_w(0,data); | |
| 289 | OKIM6295_data_0_w(machine,0,data); | |
| 288 | 290 | if (data & 0x40) snd_sam[3] = 00; |
| 289 | 291 | if (data & 0x20) snd_sam[2] = 00; |
| 290 | 292 | if (data & 0x10) snd_sam[1] = 00; |
| r1877 | r1878 | |
| 303 | 305 | static UINT16 m6295_key_delay; |
| 304 | 306 | static INTERRUPT_GEN( kickgoal_interrupt ) |
| 305 | 307 | { |
| 306 | if ((OKIM6295_status_0_r(0) & 0x08) == 0) | |
| 308 | if ((OKIM6295_status_0_r(machine,0) & 0x08) == 0) | |
| 307 | 309 | { |
| 308 | 310 | switch(kickgoal_melody_loop) |
| 309 | 311 | { |
| r1877 | r1878 | |
| 332 | 334 | if (kickgoal_melody_loop) |
| 333 | 335 | { |
| 334 | 336 | // logerror("Changing to sample %02x\n",kickgoal_melody_loop); |
| 335 | OKIM6295_data_0_w(0,((0x80 | kickgoal_melody_loop) & 0xff)); | |
| 336 | OKIM6295_data_0_w(0,0x81); | |
| 337 | OKIM6295_data_0_w(machine,0,((0x80 | kickgoal_melody_loop) & 0xff)); | |
| 338 | OKIM6295_data_0_w(machine,0,0x81); | |
| 337 | 339 | } |
| 338 | 340 | } |
| 339 | 341 | if ( input_code_pressed_once(KEYCODE_PGUP) ) |
| r1877 | r1878 | |
| 410 | 412 | { |
| 411 | 413 | if (m6295_key_delay >= (0x80 * oki_time_base)) |
| 412 | 414 | { |
| 413 | OKIM6295_data_0_w(0,0x78); | |
| 414 | OKIM6295_data_0_w(0,(0x80 | m6295_comm)); | |
| 415 | OKIM6295_data_0_w(0,0x11); | |
| 415 | OKIM6295_data_0_w(machine,0,0x78); | |
| 416 | OKIM6295_data_0_w(machine,0,(0x80 | m6295_comm)); | |
| 417 | OKIM6295_data_0_w(machine,0,0x11); | |
| 416 | 418 | |
| 417 | 419 | popmessage("Playing sound %02x on Bank %02x",m6295_comm,m6295_bank); |
| 418 | 420 | |
| r1877 | r1878 | |
| 665 | 667 | /* basic machine hardware */ |
| 666 | 668 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 667 | 669 | MDRV_CPU_PROGRAM_MAP(kickgoal_program_map, 0) |
| 668 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 670 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 669 | 671 | MDRV_CPU_PERIODIC_INT(kickgoal_interrupt, 240) |
| 670 | 672 | |
| 671 | 673 | MDRV_CPU_ADD(PIC16C57, 12000000/4) /* 3MHz ? */ |
| r1877 | r1878 | |
| 701 | 703 | /* basic machine hardware */ |
| 702 | 704 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 703 | 705 | MDRV_CPU_PROGRAM_MAP(kickgoal_program_map, 0) |
| 704 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 706 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 705 | 707 | |
| 706 | 708 | MDRV_CPU_ADD(PIC16C57, 12000000/4) /* 3MHz ? */ |
| 707 | 709 | MDRV_CPU_FLAGS(CPU_DISABLE) /* Disables since the internal rom isn't dumped */ |
| r1877 | r1878 | |
| 726 | 728 | |
| 727 | 729 | /* sound hardware */ |
| 728 | 730 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 729 | MDRV_SOUND_ADD(OKIM6295, 12000000/8) | |
| 730 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7low) | |
| 731 | MDRV_SOUND_ADD(OKIM6295, XTAL_12MHz/12) /* verified on pcb */ | |
| 732 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) /* verified on pcb */ | |
| 731 | 733 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 732 | 734 | MACHINE_DRIVER_END |
| 733 | 735 |
| r1877 | r1878 | |
|---|---|---|
| 454 | 454 | |
| 455 | 455 | #include "driver.h" |
| 456 | 456 | #include "deprecat.h" |
| 457 | #include "memconv.h" | |
| 457 | 458 | #include "cpu/m6809/m6809.h" |
| 458 | 459 | #include "machine/6821pia.h" |
| 459 | 460 | #include "machine/6522via.h" |
| r1877 | r1878 | |
| 692 | 693 | memory_set_bankptr(1, &memory_region(REGION_CPU1)[0x4000 + 0xc000 * ((data >> 5) & 1)]); |
| 693 | 694 | |
| 694 | 695 | /* the rest is handled by the video hardware */ |
| 695 | itech8_blitter_w(offset, data); | |
| 696 | itech8_blitter_w(machine, offset, data); | |
| 696 | 697 | } |
| 697 | 698 | |
| 698 | 699 | |
| r1877 | r1878 | |
| 751 | 752 | /* bit 5 controls the coin counter */ |
| 752 | 753 | /* bit 6 controls the diagnostic sound LED */ |
| 753 | 754 | pia_portb_data = data; |
| 754 | ticket_dispenser_w(0, (data & 0x10) << 3); | |
| 755 | ticket_dispenser_w(machine, 0, (data & 0x10) << 3); | |
| 755 | 756 | coin_counter_w(0, (data & 0x20) >> 5); |
| 756 | 757 | } |
| 757 | 758 | |
| r1877 | r1878 | |
| 765 | 766 | /* bit 6 controls the diagnostic sound LED */ |
| 766 | 767 | /* bit 7 controls the ticket dispenser */ |
| 767 | 768 | pia_portb_data = data; |
| 768 | ticket_dispenser_w(0, data & 0x80); | |
| 769 | ticket_dispenser_w(machine, 0, data & 0x80); | |
| 769 | 770 | coin_counter_w(0, (data & 0x20) >> 5); |
| 770 | 771 | } |
| 771 | 772 | |
| r1877 | r1878 | |
| 833 | 834 | |
| 834 | 835 | static READ16_HANDLER( blitter16_r ) |
| 835 | 836 | { |
| 836 | return | |
| 837 | return read16be_wit | |
| 837 | 838 | } |
| 838 | 839 | |
| 839 | 840 | |
| r1877 | r1878 | |
| 844 | 845 | /* bit doesn't matter in XY addressing mode */ |
| 845 | 846 | if ((offset & 0x700) == 0x100) |
| 846 | 847 | { |
| 847 | int result = itech8_tms34061_r(offset * 2); | |
| 848 | int result = itech8_tms34061_r(machine, offset * 2); | |
| 848 | 849 | return (result << 8) | result; |
| 849 | 850 | } |
| 850 | 851 | else |
| 851 | return (itech8_tms34061_r(offset * 2 + 0) << 8) + itech8_tms34061_r(offset * 2 + 1); | |
| 852 | return (itech8_tms34061_r(machine, offset * 2 + 0) << 8) + itech8_tms34061_r(machine, offset * 2 + 1); | |
| 852 | 853 | } |
| 853 | 854 | |
| 854 | 855 | |
| 855 | 856 | static WRITE16_HANDLER( sound_data16_w ) |
| 856 | 857 | { |
| 857 | 858 | if (ACCESSING_MSB) |
| 858 | sound_data_w(0, data >> 8); | |
| 859 | sound_data_w(machine, 0, data >> 8); | |
| 859 | 860 | } |
| 860 | 861 | |
| 861 | 862 | |
| r1877 | r1878 | |
| 869 | 870 | static WRITE16_HANDLER( display_page16_w ) |
| 870 | 871 | { |
| 871 | 872 | if (ACCESSING_MSB) |
| 872 | itech8_page_w(0, ~data >> 8); | |
| 873 | itech8_page_w(machine, 0, ~data >> 8); | |
| 873 | 874 | } |
| 874 | 875 | |
| 875 | 876 | |
| 876 | 877 | static WRITE16_HANDLER( tms34061_latch16_w ) |
| 877 | 878 | { |
| 878 | 879 | if (ACCESSING_MSB) |
| 879 | tms34061_latch_w(0, data >> 8); | |
| 880 | tms34061_latch_w(machine, 0, data >> 8); | |
| 880 | 881 | } |
| 881 | 882 | |
| 882 | 883 | |
| 883 | 884 | static WRITE16_HANDLER( blitter16_w ) |
| 884 | 885 | { |
| 885 | if (ACCESSING_MSB) | |
| 886 | itech8_blitter_w(offset * 2 + 0, data >> 8); | |
| 887 | if (ACCESSING_LSB) | |
| 888 | itech8_blitter_w(offset * 2 + 1, data); | |
| 886 | write16be_with_write8_handler(itech8_blitter_w, machine, offset, data, mem_mask); | |
| 889 | 887 | } |
| 890 | 888 | |
| 891 | 889 | |
| 892 | 890 | static WRITE16_HANDLER( palette16_w ) |
| 893 | 891 | { |
| 894 | 892 | if (ACCESSING_MSB) |
| 895 | itech8_palette_w(offset / 8, data >> 8); | |
| 893 | itech8_palette_w(machine, offset / 8, data >> 8); | |
| 896 | 894 | } |
| 897 | 895 | |
| 898 | 896 | |
| 899 | 897 | static WRITE16_HANDLER( tms34061_16_w ) |
| 900 | 898 | { |
| 901 | if (ACCESSING_MSB) | |
| 902 | itech8_tms34061_w(offset * 2 + 0, data >> 8); | |
| 903 | else if (ACCESSING_LSB) | |
| 904 | itech8_tms34061_w(offset * 2 + 1, data); | |
| 899 | write16be_with_write8_handler(itech8_tms34061_w, machine, offset, data, mem_mask); | |
| 905 | 900 | } |
| 906 | 901 | |
| 907 | 902 | |
| r1877 | r1878 | |
| 1764 | 1759 | /* basic machine hardware */ |
| 1765 | 1760 | MDRV_CPU_ADD_TAG("main", M6809, CLOCK_8MHz/4) |
| 1766 | 1761 | MDRV_CPU_PROGRAM_MAP(tmslo_map,0) |
| 1767 | MDRV_CPU_VBLANK_INT(generate_nmi | |
| 1762 | MDRV_CPU_VBLANK_INT("main", generate_nmi | |
| 1768 | 1763 | |
| 1769 | 1764 | MDRV_MACHINE_START(itech8) |
| 1770 | 1765 | MDRV_MACHINE_RESET(itech8) |
| r1877 | r1878 | |
|---|---|---|
| 390 | 390 | /* Send sound data to the sound cpu and cause an nmi */ |
| 391 | 391 | static WRITE8_HANDLER( checkman_sound_command_w ) |
| 392 | 392 | { |
| 393 | soundlatch_w (0,data); | |
| 394 | cpunum_set_input_line (Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 393 | soundlatch_w (machine,0,data); | |
| 394 | cpunum_set_input_line (machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | static READ8_HANDLER( drivfrcg_port0_r ) |
| r1877 | r1878 | |
| 891 | 891 | |
| 892 | 892 | static WRITE8_HANDLER( zigzag_8910_data_trigger_w ) |
| 893 | 893 | { |
| 894 | AY8910_write_port_0_w(0,latch); | |
| 894 | AY8910_write_port_0_w(machine,0,latch); | |
| 895 | 895 | } |
| 896 | 896 | |
| 897 | 897 | static WRITE8_HANDLER( zigzag_8910_control_trigger_w ) |
| 898 | 898 | { |
| 899 | AY8910_control_port_0_w(0,latch); | |
| 899 | AY8910_control_port_0_w(machine,0,latch); | |
| 900 | 900 | } |
| 901 | 901 | |
| 902 | 902 | static ADDRESS_MAP_START( zigzag_readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 4321 | 4321 | MDRV_IMPORT_FROM(galaxian) |
| 4322 | 4322 | MDRV_CPU_MODIFY("main") |
| 4323 | 4323 | MDRV_CPU_PROGRAM_MAP(gmgalax_readmem,galaxian_writemem) |
| 4324 | MDRV_CPU_VBLANK_INT(gmgalax_vh_interrupt | |
| 4324 | MDRV_CPU_VBLANK_INT("main", gmgalax_vh_interrupt | |
| 4325 | 4325 | |
| 4326 | 4326 | /* video hardware */ |
| 4327 | 4327 | MDRV_GFXDECODE(gmgalax) |
| r1877 | r1878 | |
| 4543 | 4543 | /* audio CPU */ /* 1.62 MHz */ |
| 4544 | 4544 | MDRV_CPU_PROGRAM_MAP(checkman_sound_readmem,checkman_sound_writemem) |
| 4545 | 4545 | MDRV_CPU_IO_MAP(checkman_sound_readport,checkman_sound_writeport) |
| 4546 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 4546 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 4547 | 4547 | |
| 4548 | 4548 | /* video hardware */ |
| 4549 | 4549 | MDRV_PALETTE_LENGTH(32+2+64) /* 32 for the characters, 2 for the bullets, 64 for the stars */ |
| r1877 | r1878 | |
| 4570 | 4570 | MDRV_CPU_ADD(Z80, 1620000) |
| 4571 | 4571 | /* audio CPU */ |
| 4572 | 4572 | MDRV_CPU_PROGRAM_MAP(checkmaj_sound_readmem,checkmaj_sound_writemem) |
| 4573 | MDRV_CPU_VBLANK_INT(irq0_line_hold,32) /* NMIs are triggered by the main CPU */ | |
| 4573 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,32) /* NMIs are triggered by the main CPU */ | |
| 4574 | 4574 | |
| 4575 | 4575 | |
| 4576 | 4576 | /* video hardware */ |
| r1877 | r1878 | |
| 4594 | 4594 | /* audio CPU */ /* 1.62 MHz */ |
| 4595 | 4595 | MDRV_CPU_PROGRAM_MAP(checkman_sound_readmem,checkman_sound_writemem) |
| 4596 | 4596 | MDRV_CPU_IO_MAP(checkman_sound_readport,checkman_sound_writeport) |
| 4597 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 4597 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 4598 | 4598 | |
| 4599 | 4599 | /* video hardware */ |
| 4600 | 4600 | MDRV_PALETTE_LENGTH(32+2+64) /* 32 for the characters, 2 for the bullets, 64 for the stars */ |
| r1877 | r1878 | |
| 4717 | 4717 | MDRV_CPU_MODIFY("main") |
| 4718 | 4718 | MDRV_CPU_PROGRAM_MAP(ozon1_readmem,ozon1_writemem) |
| 4719 | 4719 | MDRV_CPU_IO_MAP(0,ozon1_writeport) |
| 4720 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 4720 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 4721 | 4721 | |
| 4722 | 4722 | MDRV_MACHINE_RESET(NULL) |
| 4723 | 4723 | |
| r1877 | r1878 | |
| 4735 | 4735 | MDRV_CPU_ADD(S2650, 18432000/6) |
| 4736 | 4736 | MDRV_CPU_PROGRAM_MAP(drivfrcg,0) |
| 4737 | 4737 | MDRV_CPU_IO_MAP(drivfrcg_io,0) |
| 4738 | MDRV_CPU_VBLANK_INT(hunchbks_vh_interrupt | |
| 4738 | MDRV_CPU_VBLANK_INT("main", hunchbks_vh_interrupt | |
| 4739 | 4739 | |
| 4740 | 4740 | |
| 4741 | 4741 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 4781 | 4781 | MDRV_CPU_ADD(S2650, PIXEL_CLOCK/2) |
| 4782 | 4782 | MDRV_CPU_PROGRAM_MAP(hunchbkg,0) |
| 4783 | 4783 | MDRV_CPU_IO_MAP(hunchbkg_io,0) |
| 4784 | MDRV_CPU_VBLANK_INT(hunchbks_vh_interrupt | |
| 4784 | MDRV_CPU_VBLANK_INT("main", hunchbks_vh_interrupt | |
| 4785 | 4785 | |
| 4786 | 4786 | MDRV_GFXDECODE(galaxian) |
| 4787 | 4787 | MDRV_PALETTE_LENGTH(32+2+64) /* 32 for the characters, 2 for the bullets, 64 for the stars */ |
| r1877 | r1878 | |
| 4807 | 4807 | MDRV_IMPORT_FROM(galaxian_base) |
| 4808 | 4808 | MDRV_CPU_MODIFY("main") |
| 4809 | 4809 | MDRV_CPU_PROGRAM_MAP(harem_cpu1,0) |
| 4810 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 4810 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 4811 | 4811 | |
| 4812 | 4812 | MDRV_CPU_ADD(Z80, 1620000) |
| 4813 | 4813 | /* audio CPU */ |
| r1877 | r1878 | |
| 4844 | 4844 | MDRV_CPU_ADD(S2650, PIXEL_CLOCK/2) |
| 4845 | 4845 | MDRV_CPU_PROGRAM_MAP(racknrol,0) |
| 4846 | 4846 | MDRV_CPU_IO_MAP(racknrol_io,0) |
| 4847 | MDRV_CPU_VBLANK_INT(hunchbks_vh_interrupt | |
| 4847 | MDRV_CPU_VBLANK_INT("main", hunchbks_vh_interrupt | |
| 4848 | 4848 | |
| 4849 | 4849 | MDRV_GFXDECODE(galaxian) |
| 4850 | 4850 | MDRV_PALETTE_LENGTH(32) |
| r1877 | r1878 | |
| 4902 | 4902 | MDRV_CPU_ADD(S2650, PIXEL_CLOCK/2) |
| 4903 | 4903 | MDRV_CPU_PROGRAM_MAP(racknrol,0) |
| 4904 | 4904 | MDRV_CPU_IO_MAP(hexpoola_io,0) |
| 4905 | MDRV_CPU_VBLANK_INT(hunchbks_vh_interrupt | |
| 4905 | MDRV_CPU_VBLANK_INT("main", hunchbks_vh_interrupt | |
| 4906 | 4906 | |
| 4907 | 4907 | MDRV_GFXDECODE(galaxian) |
| 4908 | 4908 | MDRV_PALETTE_LENGTH(32) |
| r1877 | r1878 | |
|---|---|---|
| 243 | 243 | /* basic machine hardware */ |
| 244 | 244 | MDRV_CPU_ADD(M68000, 16000000) |
| 245 | 245 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 246 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 246 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 247 | 247 | |
| 248 | 248 | /* video hardware */ |
| 249 | 249 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 268 | 268 | |
| 269 | 269 | static WRITE16_HANDLER( sound_cpu_w ) |
| 270 | 270 | { |
| 271 | soundlatch_w(0,data&0xff); | |
| 272 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 271 | soundlatch_w(machine,0,data&0xff); | |
| 272 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | static READ16_HANDLER( mechatt_gun_r ) |
| r1877 | r1878 | |
| 681 | 681 | |
| 682 | 682 | static VIDEO_EOF( bbuster ) |
| 683 | 683 | { |
| 684 | buffer_spriteram16_w(0,0,0); | |
| 685 | buffer_spriteram16_2_w(0,0,0); | |
| 684 | buffer_spriteram16_w(machine,0,0,0); | |
| 685 | buffer_spriteram16_2_w(machine,0,0,0); | |
| 686 | 686 | } |
| 687 | 687 | |
| 688 | 688 | static VIDEO_EOF( mechatt ) |
| 689 | 689 | { |
| 690 | buffer_spriteram16_w(0,0,0); | |
| 690 | buffer_spriteram16_w(machine,0,0,0); | |
| 691 | 691 | } |
| 692 | 692 | |
| 693 | 693 | static MACHINE_DRIVER_START( bbusters ) |
| r1877 | r1878 | |
| 695 | 695 | /* basic machine hardware */ |
| 696 | 696 | MDRV_CPU_ADD(M68000, 12000000) |
| 697 | 697 | MDRV_CPU_PROGRAM_MAP(bbuster_readmem,bbuster_writemem) |
| 698 | MDRV_CPU_VBLANK_INT(bbuster,4) | |
| 698 | MDRV_CPU_VBLANK_INT_HACK(bbuster,4) | |
| 699 | 699 | |
| 700 | 700 | MDRV_CPU_ADD(Z80,4000000) /* Accurate */ |
| 701 | 701 | /* audio CPU */ |
| r1877 | r1878 | |
| 739 | 739 | /* basic machine hardware */ |
| 740 | 740 | MDRV_CPU_ADD(M68000, 12000000) |
| 741 | 741 | MDRV_CPU_PROGRAM_MAP(mechatt_readmem,mechatt_writemem) |
| 742 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 742 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 743 | 743 | |
| 744 | 744 | MDRV_CPU_ADD(Z80,4000000) /* Accurate */ |
| 745 | 745 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 206 | 206 | if (ACCESSING_LSB) |
| 207 | 207 | { |
| 208 | 208 | pending_command = 1; |
| 209 | soundlatch_w(offset,data & 0xff); | |
| 210 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 209 | soundlatch_w(machine,offset,data & 0xff); | |
| 210 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | |
| r1877 | r1878 | |
| 441 | 441 | static MACHINE_DRIVER_START( gstriker ) |
| 442 | 442 | MDRV_CPU_ADD(M68000, 10000000) |
| 443 | 443 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 444 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 444 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 445 | 445 | |
| 446 | 446 | MDRV_CPU_ADD(Z80,8000000/2) |
| 447 | 447 | /* audio CPU */ /* 4 MHz ??? */ |
| r1877 | r1878 | |
|---|---|---|
| 316 | 316 | return value; |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | static int snk_input_port_r( int which ){ | |
| 319 | static int snk_input_port_r( running_machine *machine, int which ){ | |
| 320 | 320 | switch( snk_io[which] ){ |
| 321 | 321 | case SNK_INP0: |
| 322 | 322 | { |
| 323 | int value = input_port_0_r( 0 ); | |
| 323 | int value = input_port_0_r( machine,0 ); | |
| 324 | 324 | if( (snk_sound_register & 0x04) == 0 ) value &= ~snk_sound_busy_bit; |
| 325 | 325 | return value; |
| 326 | 326 | } |
| r1877 | r1878 | |
| 328 | 328 | case SNK_ROT_PLAYER1: return snk_rot( 0 ); |
| 329 | 329 | case SNK_ROT_PLAYER2: return snk_rot( 1 ); |
| 330 | 330 | |
| 331 | case SNK_INP1: return input_port_1_r(0); | |
| 332 | case SNK_INP2: return input_port_2_r(0); | |
| 333 | case SNK_INP3: return input_port_3_r(0); | |
| 334 | case SNK_INP4: return input_port_4_r(0); | |
| 335 | case SNK_INP5: return input_port_5_r(0); | |
| 336 | case SNK_INP6: return input_port_6_r(0); | |
| 337 | case SNK_INP7: return input_port_7_r(0); | |
| 338 | case SNK_INP8: return input_port_8_r(0); | |
| 339 | case SNK_INP9: return input_port_9_r(0); | |
| 340 | case SNK_INP10: return input_port_10_r(0); | |
| 341 | case SNK_INP11: return input_port_11_r(0); | |
| 331 | case SNK_INP1: return input_port_1_r(machine,0); | |
| 332 | case SNK_INP2: return input_port_2_r(machine,0); | |
| 333 | case SNK_INP3: return input_port_3_r(machine,0); | |
| 334 | case SNK_INP4: return input_port_4_r(machine,0); | |
| 335 | case SNK_INP5: return input_port_5_r(machine,0); | |
| 336 | case SNK_INP6: return input_port_6_r(machine,0); | |
| 337 | case SNK_INP7: return input_port_7_r(machine,0); | |
| 338 | case SNK_INP8: return input_port_8_r(machine,0); | |
| 339 | case SNK_INP9: return input_port_9_r(machine,0); | |
| 340 | case SNK_INP10: return input_port_10_r(machine,0); | |
| 341 | case SNK_INP11: return input_port_11_r(machine,0); | |
| 342 | 342 | |
| 343 | 343 | default: |
| 344 | 344 | logerror("read from unmapped input port:%d\n", which ); |
| r1877 | r1878 | |
| 384 | 384 | |
| 385 | 385 | static WRITE8_HANDLER( snk_soundlatch_w ){ |
| 386 | 386 | snk_sound_register |= 0x08 | 0x04; |
| 387 | soundlatch_w( offset, data ); | |
| 387 | soundlatch_w( machine, offset, data ); | |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | static READ8_HANDLER( snk_soundlatch_clear_r ){ /* TNK3 */ |
| 391 | soundlatch_w( 0, 0 ); | |
| 391 | soundlatch_w( machine, 0, 0 ); | |
| 392 | 392 | snk_sound_register = 0; |
| 393 | 393 | return 0x00; |
| 394 | 394 | } |
| r1877 | r1878 | |
| 455 | 455 | |
| 456 | 456 | static READ8_HANDLER( cpuA_io_r ){ |
| 457 | 457 | switch( offset ){ |
| 458 | case 0x000: return snk_input_port_r( 0 ); // coin input, player start | |
| 459 | case 0x100: return snk_input_port_r( 1 ); // joy1 | |
| 460 | case 0x180: return snk_input_port_r( 2 ); // joy2 | |
| 461 | case 0x200: return snk_input_port_r( 3 ); // joy3 | |
| 462 | case 0x280: return snk_input_port_r( 4 ); // joy4 | |
| 463 | case 0x300: return snk_input_port_r( 5 ); // aim1 | |
| 464 | case 0x380: return snk_input_port_r( 6 ); // aim2 | |
| 465 | case 0x400: return snk_input_port_r( 7 ); // aim3 | |
| 466 | case 0x480: return snk_input_port_r( 8 ); // aim4 | |
| 467 | case 0x500: return snk_input_port_r( 9 ); // unused by tdfever | |
| 468 | case 0x580: return snk_input_port_r( 10 ); // dsw | |
| 469 | case 0x600: return snk_input_port_r( 11 ); // dsw | |
| 470 | case 0x080: return snk_input_port_r( 12 ); // player start (types C and D in 'fsoccer') | |
| 458 | case 0x000: return snk_input_port_r( machine,0 ); // coin input, player start | |
| 459 | case 0x100: return snk_input_port_r( machine,1 ); // joy1 | |
| 460 | case 0x180: return snk_input_port_r( machine,2 ); // joy2 | |
| 461 | case 0x200: return snk_input_port_r( machine,3 ); // joy3 | |
| 462 | case 0x280: return snk_input_port_r( machine,4 ); // joy4 | |
| 463 | case 0x300: return snk_input_port_r( machine,5 ); // aim1 | |
| 464 | case 0x380: return snk_input_port_r( machine,6 ); // aim2 | |
| 465 | case 0x400: return snk_input_port_r( machine,7 ); // aim3 | |
| 466 | case 0x480: return snk_input_port_r( machine,8 ); // aim4 | |
| 467 | case 0x500: return snk_input_port_r( machine,9 ); // unused by tdfever | |
| 468 | case 0x580: return snk_input_port_r( machine,10 ); // dsw | |
| 469 | case 0x600: return snk_input_port_r( machine,11 ); // dsw | |
| 470 | case 0x080: return snk_input_port_r( machine,12 ); // player start (types C and D in 'fsoccer') | |
| 471 | 471 | |
| 472 | case 0x700: return(snk_cpuB_nmi_trigger_r(0)); | |
| 472 | case 0x700: return(snk_cpuB_nmi_trigger_r(machine,0)); | |
| 473 | 473 | |
| 474 | 474 | /* "Hard Flags" */ |
| 475 | 475 | case 0xe00: |
| r1877 | r1878 | |
| 490 | 490 | |
| 491 | 491 | case 0x400: /* most games */ |
| 492 | 492 | case 0x500: /* tdfever */ |
| 493 | snk_soundlatch_w( 0, data ); | |
| 493 | snk_soundlatch_w( machine, 0, data ); | |
| 494 | 494 | break; |
| 495 | 495 | |
| 496 | 496 | case 0x700: |
| 497 | snk_cpuA_nmi_ack_w(0, 0); | |
| 497 | snk_cpuA_nmi_ack_w(machine, 0, 0); | |
| 498 | 498 | break; |
| 499 | 499 | |
| 500 | 500 | default: |
| r1877 | r1878 | |
| 506 | 506 | static READ8_HANDLER( cpuB_io_r ){ |
| 507 | 507 | switch( offset ){ |
| 508 | 508 | case 0x000: |
| 509 | case 0x700: return(snk_cpuA_nmi_trigger_r(0)); | |
| 509 | case 0x700: return(snk_cpuA_nmi_trigger_r(machine, 0)); | |
| 510 | 510 | |
| 511 | 511 | /* "Hard Flags" they are needed here, otherwise ikarijp/b doesn't work right */ |
| 512 | 512 | case 0xe00: |
| r1877 | r1878 | |
| 524 | 524 | { |
| 525 | 525 | io_ram[offset] = data; |
| 526 | 526 | |
| 527 | if (offset==0 || offset==0x700) snk_cpuB_nmi_ack_w(0, 0); | |
| 527 | if (offset==0 || offset==0x700) snk_cpuB_nmi_ack_w(machine, 0, 0); | |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | 530 | /********************** Tnk3, Athena, Fighting Golf ********************/ |
| r1877 | r1878 | |
| 817 | 817 | /* basic machine hardware */ |
| 818 | 818 | MDRV_CPU_ADD(Z80, XTAL_13_4MHz/4) /* verified on pcb */ |
| 819 | 819 | MDRV_CPU_PROGRAM_MAP(tnk3_cpuA_map,0) |
| 820 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 820 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 821 | 821 | |
| 822 | 822 | MDRV_CPU_ADD(Z80, XTAL_13_4MHz/4) /* verified on pcb */ |
| 823 | 823 | MDRV_CPU_PROGRAM_MAP(tnk3_cpuB_map,0) |
| 824 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 824 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 825 | 825 | |
| 826 | 826 | MDRV_CPU_ADD(Z80, XTAL_8MHz/2) /* verified on pcb */ |
| 827 | 827 | /* audio CPU */ |
| 828 | 828 | MDRV_CPU_PROGRAM_MAP(YM3526_sound_map,0) |
| 829 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 829 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 830 | 830 | |
| 831 | 831 | MDRV_INTERLEAVE(100) |
| 832 | 832 | |
| r1877 | r1878 | |
| 861 | 861 | /* basic machine hardware */ |
| 862 | 862 | MDRV_CPU_ADD(Z80, 4000000) |
| 863 | 863 | MDRV_CPU_PROGRAM_MAP(tnk3_cpuA_map,0) |
| 864 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 864 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 865 | 865 | |
| 866 | 866 | MDRV_CPU_ADD(Z80, 4000000) |
| 867 | 867 | MDRV_CPU_PROGRAM_MAP(tnk3_cpuB_map,0) |
| 868 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 868 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 869 | 869 | |
| 870 | 870 | MDRV_CPU_ADD(Z80, 4000000) |
| 871 | 871 | /* audio CPU */ |
| 872 | 872 | MDRV_CPU_PROGRAM_MAP(YM3526_YM3526_sound_map,0) |
| 873 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 873 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 874 | 874 | |
| 875 | 875 | MDRV_INTERLEAVE(300) |
| 876 | 876 | |
| r1877 | r1878 | |
| 909 | 909 | /* basic machine hardware */ |
| 910 | 910 | MDRV_CPU_ADD(Z80, XTAL_13_4MHz/4) /* verified on pcb */ |
| 911 | 911 | MDRV_CPU_PROGRAM_MAP(cpuA_map,0) |
| 912 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 912 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 913 | 913 | |
| 914 | 914 | MDRV_CPU_ADD(Z80, XTAL_13_4MHz/4) /* verified on pcb */ |
| 915 | 915 | MDRV_CPU_PROGRAM_MAP(cpuB_map,0) |
| 916 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 916 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 917 | 917 | |
| 918 | 918 | MDRV_CPU_ADD(Z80, XTAL_8MHz/2) /* verified on pcb */ |
| 919 | 919 | /* audio CPU */ |
| 920 | 920 | MDRV_CPU_PROGRAM_MAP(YM3526_YM3526_sound_map,0) |
| 921 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 921 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 922 | 922 | |
| 923 | 923 | MDRV_INTERLEAVE(100) |
| 924 | 924 | |
| r1877 | r1878 | |
| 957 | 957 | /* basic machine hardware */ |
| 958 | 958 | MDRV_CPU_ADD(Z80, XTAL_13_4MHz/4) /* verified on pcb */ |
| 959 | 959 | MDRV_CPU_PROGRAM_MAP(cpuA_map,0) |
| 960 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 960 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 961 | 961 | |
| 962 | 962 | MDRV_CPU_ADD(Z80, XTAL_13_4MHz/4) /* verified on pcb */ |
| 963 | 963 | MDRV_CPU_PROGRAM_MAP(cpuB_map,0) |
| 964 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 964 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 965 | 965 | |
| 966 | 966 | MDRV_CPU_ADD(Z80, XTAL_8MHz/2) /* verified on pcb */ |
| 967 | 967 | /* audio CPU */ |
| 968 | 968 | MDRV_CPU_PROGRAM_MAP(YM3526_Y8950_sound_map,0) |
| 969 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 969 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 970 | 970 | |
| 971 | 971 | MDRV_INTERLEAVE(100) |
| 972 | 972 | |
| r1877 | r1878 | |
| 1005 | 1005 | /* basic machine hardware */ |
| 1006 | 1006 | MDRV_CPU_ADD(Z80, XTAL_8MHz/2) /* verified on pcb */ |
| 1007 | 1007 | MDRV_CPU_PROGRAM_MAP(cpuA_map,0) |
| 1008 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1008 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1009 | 1009 | |
| 1010 | 1010 | MDRV_CPU_ADD(Z80, XTAL_8MHz/2) /* verified on pcb */ |
| 1011 | 1011 | MDRV_CPU_PROGRAM_MAP(cpuB_map,0) |
| 1012 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1012 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1013 | 1013 | |
| 1014 | 1014 | MDRV_CPU_ADD(Z80, XTAL_8MHz/2) /* verified on pcb */ |
| 1015 | 1015 | /* audio CPU */ |
| 1016 | 1016 | MDRV_CPU_PROGRAM_MAP(YM3526_Y8950_sound_map,0) |
| 1017 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1017 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1018 | 1018 | |
| 1019 | 1019 | MDRV_INTERLEAVE(100) |
| 1020 | 1020 | |
| r1877 | r1878 | |
| 1051 | 1051 | /* basic machine hardware */ |
| 1052 | 1052 | MDRV_CPU_ADD(Z80, 4000000) |
| 1053 | 1053 | MDRV_CPU_PROGRAM_MAP(cpuA_map,0) |
| 1054 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1054 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1055 | 1055 | |
| 1056 | 1056 | // 5MHz gives CPUB higher priority or ROM test will fail if the first NMI is triggered too early by CPUA |
| 1057 | 1057 | MDRV_CPU_ADD(Z80, 5000000) |
| 1058 | 1058 | MDRV_CPU_PROGRAM_MAP(cpuB_map,0) |
| 1059 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1059 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1060 | 1060 | |
| 1061 | 1061 | MDRV_CPU_ADD(Z80, 4000000) |
| 1062 | 1062 | /* audio CPU */ |
| 1063 | 1063 | MDRV_CPU_PROGRAM_MAP(YM3526_Y8950_sound_map,0) |
| 1064 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1064 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1065 | 1065 | |
| 1066 | 1066 | MDRV_INTERLEAVE(100) |
| 1067 | 1067 | |
| r1877 | r1878 | |
| 1098 | 1098 | /* basic machine hardware */ |
| 1099 | 1099 | MDRV_CPU_ADD(Z80, 4000000) |
| 1100 | 1100 | MDRV_CPU_PROGRAM_MAP(cpuA_map,0) |
| 1101 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1101 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1102 | 1102 | |
| 1103 | 1103 | MDRV_CPU_ADD(Z80, 4000000) |
| 1104 | 1104 | MDRV_CPU_PROGRAM_MAP(cpuB_map,0) |
| 1105 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1105 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1106 | 1106 | |
| 1107 | 1107 | MDRV_CPU_ADD(Z80, 4000000) |
| 1108 | 1108 | /* audio CPU */ |
| 1109 | 1109 | MDRV_CPU_PROGRAM_MAP(YM3526_Y8950_sound_map,0) |
| 1110 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 1110 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 1111 | 1111 | |
| 1112 | 1112 | MDRV_INTERLEAVE(100) |
| 1113 | 1113 | |
| r1877 | r1878 | |
| 1144 | 1144 | /* basic machine hardware */ |
| 1145 | 1145 | MDRV_CPU_ADD(Z80, 4000000) |
| 1146 | 1146 | MDRV_CPU_PROGRAM_MAP(cpuA_map,0) |
| 1147 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1147 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1148 | 1148 | |
| 1149 | 1149 | MDRV_CPU_ADD(Z80, 4000000) |
| 1150 | 1150 | MDRV_CPU_PROGRAM_MAP(cpuB_map,0) |
| 1151 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1151 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1152 | 1152 | |
| 1153 | 1153 | MDRV_CPU_ADD(Z80, 4000000) |
| 1154 | 1154 | /* audio CPU */ |
| 1155 | 1155 | MDRV_CPU_PROGRAM_MAP(YM3812_Y8950_sound_map,0) |
| 1156 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1156 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1157 | 1157 | |
| 1158 | 1158 | MDRV_INTERLEAVE(100) |
| 1159 | 1159 | |
| r1877 | r1878 | |
| 1190 | 1190 | /* basic machine hardware */ |
| 1191 | 1191 | MDRV_CPU_ADD(Z80, 4000000) |
| 1192 | 1192 | MDRV_CPU_PROGRAM_MAP(cpuA_map,0) |
| 1193 | MDRV_CPU_VBLANK_INT(snk_irq_AB | |
| 1193 | MDRV_CPU_VBLANK_INT("main", snk_irq_AB | |
| 1194 | 1194 | |
| 1195 | 1195 | MDRV_CPU_ADD(Z80, 4000000) |
| 1196 | 1196 | MDRV_CPU_PROGRAM_MAP(cpuB_map,0) |
| 1197 | // MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1197 | // MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1198 | 1198 | |
| 1199 | 1199 | MDRV_CPU_ADD(Z80, 4000000) |
| 1200 | 1200 | /* audio CPU */ |
| 1201 | 1201 | MDRV_CPU_PROGRAM_MAP(YM3526_Y8950_sound_map,0) |
| 1202 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1202 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1203 | 1203 | |
| 1204 | 1204 | MDRV_INTERLEAVE(300) |
| 1205 | 1205 | |
| r1877 | r1878 | |
| 1238 | 1238 | /* basic machine hardware */ |
| 1239 | 1239 | MDRV_CPU_ADD(Z80, 4000000) |
| 1240 | 1240 | MDRV_CPU_PROGRAM_MAP(cpuA_map,0) |
| 1241 | MDRV_CPU_VBLANK_INT(snk_irq_AB | |
| 1241 | MDRV_CPU_VBLANK_INT("main", snk_irq_AB | |
| 1242 | 1242 | |
| 1243 | 1243 | MDRV_CPU_ADD(Z80, 4000000) |
| 1244 | 1244 | MDRV_CPU_PROGRAM_MAP(cpuB_map,0) |
| 1245 | // MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1245 | // MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1246 | 1246 | |
| 1247 | 1247 | MDRV_CPU_ADD(Z80, 4000000) |
| 1248 | 1248 | /* audio CPU */ |
| 1249 | 1249 | MDRV_CPU_PROGRAM_MAP(YM3526_Y8950_sound_map,0) |
| 1250 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1250 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1251 | 1251 | |
| 1252 | 1252 | MDRV_INTERLEAVE(300) |
| 1253 | 1253 | |
| r1877 | r1878 | |
| 1286 | 1286 | /* basic machine hardware */ |
| 1287 | 1287 | MDRV_CPU_ADD(Z80, XTAL_8MHz/2) /* verified on pcb */ |
| 1288 | 1288 | MDRV_CPU_PROGRAM_MAP(cpuA_map,0) |
| 1289 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1289 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1290 | 1290 | |
| 1291 | 1291 | MDRV_CPU_ADD(Z80, XTAL_8MHz/2) /* verified on pcb */ |
| 1292 | 1292 | MDRV_CPU_PROGRAM_MAP(cpuB_map,0) |
| 1293 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1293 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1294 | 1294 | |
| 1295 | 1295 | MDRV_CPU_ADD(Z80, XTAL_8MHz/2) /* verified on pcb */ |
| 1296 | 1296 | /* audio CPU */ |
| 1297 | 1297 | MDRV_CPU_PROGRAM_MAP(Y8950_sound_map, 0) |
| 1298 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 1298 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 1299 | 1299 | |
| 1300 | 1300 | MDRV_INTERLEAVE(100) |
| 1301 | 1301 |
| r1877 | r1878 | |
|---|---|---|
| 299 | 299 | return ROM[offs] ^ 0xff; |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | INLINE void blt_write(const int tmap, const offs_t offs, const UINT16 data, const UINT16 mask) | |
| 302 | INLINE void blt_write(running_machine *machine, const int tmap, const offs_t offs, const UINT16 data, const UINT16 mask) | |
| 303 | 303 | { |
| 304 | 304 | switch( tmap ) |
| 305 | 305 | { |
| 306 | case 1: hyprduel_vram_0_w(offs,data,mask); break; | |
| 307 | case 2: hyprduel_vram_1_w(offs,data,mask); break; | |
| 308 | case 3: hyprduel_vram_2_w(offs,data,mask); break; | |
| 306 | case 1: hyprduel_vram_0_w(machine,offs,data,mask); break; | |
| 307 | case 2: hyprduel_vram_1_w(machine,offs,data,mask); break; | |
| 308 | case 3: hyprduel_vram_2_w(machine,offs,data,mask); break; | |
| 309 | 309 | } |
| 310 | 310 | // logerror("CPU #0 PC %06X : Blitter %X] %04X <- %04X & %04X\n",activecpu_get_pc(),tmap,offs,data,mask); |
| 311 | 311 | } |
| r1877 | r1878 | |
| 380 | 380 | src_offs++; |
| 381 | 381 | |
| 382 | 382 | dst_offs &= 0xffff; |
| 383 | blt_write(tmap,dst_offs,b2,mask); | |
| 383 | blt_write(machine,tmap,dst_offs,b2,mask); | |
| 384 | 384 | dst_offs = ((dst_offs+1) & (0x100-1)) | (dst_offs & (~(0x100-1))); |
| 385 | 385 | } |
| 386 | 386 | break; |
| r1877 | r1878 | |
| 396 | 396 | while (count--) |
| 397 | 397 | { |
| 398 | 398 | dst_offs &= 0xffff; |
| 399 | blt_write(tmap,dst_offs,b2<<shift,mask); | |
| 399 | blt_write(machine,tmap,dst_offs,b2<<shift,mask); | |
| 400 | 400 | dst_offs = ((dst_offs+1) & (0x100-1)) | (dst_offs & (~(0x100-1))); |
| 401 | 401 | b2++; |
| 402 | 402 | } |
| r1877 | r1878 | |
| 413 | 413 | while (count--) |
| 414 | 414 | { |
| 415 | 415 | dst_offs &= 0xffff; |
| 416 | blt_write(tmap,dst_offs,b2,mask); | |
| 416 | blt_write(machine,tmap,dst_offs,b2,mask); | |
| 417 | 417 | dst_offs = ((dst_offs+1) & (0x100-1)) | (dst_offs & (~(0x100-1))); |
| 418 | 418 | } |
| 419 | 419 | break; |
| r1877 | r1878 | |
| 710 | 710 | /* basic machine hardware */ |
| 711 | 711 | MDRV_CPU_ADD(M68000,20000000/2) /* 10MHz */ |
| 712 | 712 | MDRV_CPU_PROGRAM_MAP(hyprduel_readmem,hyprduel_writemem) |
| 713 | MDRV_CPU_VBLANK_INT(hyprduel_interrupt,RASTER_LINES) | |
| 713 | MDRV_CPU_VBLANK_INT_HACK(hyprduel_interrupt,RASTER_LINES) | |
| 714 | 714 | |
| 715 | 715 | MDRV_CPU_ADD(M68000,20000000/2) /* 10MHz */ |
| 716 | 716 | MDRV_CPU_PROGRAM_MAP(hyprduel_readmem2,hyprduel_writemem2) |
| r1877 | r1878 | |
| 751 | 751 | /* basic machine hardware */ |
| 752 | 752 | MDRV_CPU_ADD(M68000,20000000/2) /* 10MHz */ |
| 753 | 753 | MDRV_CPU_PROGRAM_MAP(magerror_readmem,magerror_writemem) |
| 754 | MDRV_CPU_VBLANK_INT(hyprduel_interrupt,RASTER_LINES) | |
| 754 | MDRV_CPU_VBLANK_INT_HACK(hyprduel_interrupt,RASTER_LINES) | |
| 755 | 755 | |
| 756 | 756 | MDRV_CPU_ADD(M68000,20000000/2) /* 10MHz */ |
| 757 | 757 | MDRV_CPU_PROGRAM_MAP(magerror_readmem2,magerror_writemem2) |
| r1877 | r1878 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | static READ16_HANDLER( adpcm_r ) |
| 130 | 130 | { |
| 131 | return (OKIM6295_status_0_r(offset) << 8) | 0x00ff; | |
| 131 | return (OKIM6295_status_0_r(machine, offset) << 8) | 0x00ff; | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | |
| 135 | 135 | static WRITE16_HANDLER( adpcm_w ) |
| 136 | 136 | { |
| 137 | 137 | if (ACCESSING_MSB) |
| 138 | OKIM6295_data_0_w(offset, (data >> 8) & 0xff); | |
| 138 | OKIM6295_data_0_w(machine, offset, (data >> 8) & 0xff); | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | |
| r1877 | r1878 | |
| 347 | 347 | /* basic machine hardware */ |
| 348 | 348 | MDRV_CPU_ADD(M68000, MASTER_CLOCK) |
| 349 | 349 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 350 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 350 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 351 | 351 | |
| 352 | 352 | MDRV_MACHINE_RESET(arcadecl) |
| 353 | 353 | MDRV_NVRAM_HANDLER(atarigen) |
| r1877 | r1878 | |
|---|---|---|
| 753 | 753 | static MACHINE_DRIVER_START( namconb1 ) |
| 754 | 754 | MDRV_CPU_ADD(M68EC020,MASTER_CLOCK_HZ/2) |
| 755 | 755 | MDRV_CPU_PROGRAM_MAP(namconb1_am,0) |
| 756 | MDRV_CPU_VBLANK_INT(namconb1_interrupt | |
| 756 | MDRV_CPU_VBLANK_INT("main", namconb1_interrupt | |
| 757 | 757 | |
| 758 | 758 | NAMCO_C7X_MCU(MASTER_CLOCK_HZ/3) |
| 759 | 759 | |
| r1877 | r1878 | |
| 777 | 777 | static MACHINE_DRIVER_START( namconb2 ) |
| 778 | 778 | MDRV_CPU_ADD(M68EC020,MASTER_CLOCK_HZ/2) |
| 779 | 779 | MDRV_CPU_PROGRAM_MAP(namconb2_am,0) |
| 780 | MDRV_CPU_VBLANK_INT(namconb2_interrupt | |
| 780 | MDRV_CPU_VBLANK_INT("main", namconb2_interrupt | |
| 781 | 781 | |
| 782 | 782 | NAMCO_C7X_MCU(MASTER_CLOCK_HZ/3) |
| 783 | 783 | |
| r1877 | r1878 | |
| 1253 | 1253 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(4) PORT_PLAYER(2) |
| 1254 | 1254 | INPUT_PORTS_END |
| 1255 | 1255 | |
| 1256 | #ifdef UNUSED_DEFINITION | |
| 1256 | 1257 | static INPUT_PORTS_START( machbrkr ) |
| 1257 | 1258 | PORT_START |
| 1258 | 1259 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| r1877 | r1878 | |
| 1304 | 1305 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(4) |
| 1305 | 1306 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START4 ) |
| 1306 | 1307 | INPUT_PORTS_END |
| 1308 | #endif | |
| 1307 | 1309 | |
| 1308 | 1310 | static INPUT_PORTS_START( outfxies ) |
| 1309 | 1311 | PORT_START |
| r1877 | r1878 | |
|---|---|---|
| 89 | 89 | |
| 90 | 90 | static WRITE8_HANDLER( sound_command_w ) |
| 91 | 91 | { |
| 92 | soundlatch_w(0,data); | |
| 92 | soundlatch_w(machine,0,data); | |
| 93 | 93 | timer_call_after_resynch(NULL, data,nmi_callback); |
| 94 | 94 | } |
| 95 | 95 | |
| r1877 | r1878 | |
| 163 | 163 | |
| 164 | 164 | static READ8_HANDLER( victnine_port_5_r ) |
| 165 | 165 | { |
| 166 | return (victnine_mcu_status_r(0) & 3) | (readinputport(5) & ~3); | |
| 166 | return (victnine_mcu_status_r(machine,0) & 3) | (readinputport(5) & ~3); | |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | static ADDRESS_MAP_START( victnine_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 683 | 683 | /* basic machine hardware */ |
| 684 | 684 | MDRV_CPU_ADD(Z80,10733000/2) /* ??? */ |
| 685 | 685 | MDRV_CPU_PROGRAM_MAP(flstory_map,0) |
| 686 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 686 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 687 | 687 | |
| 688 | 688 | MDRV_CPU_ADD(Z80,8000000/2) |
| 689 | 689 | /* audio CPU */ /* 4 MHz */ |
| 690 | 690 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 691 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) /* IRQ generated by ??? */ | |
| 691 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) /* IRQ generated by ??? */ | |
| 692 | 692 | /* NMI generated by the main CPU */ |
| 693 | 693 | |
| 694 | 694 | MDRV_CPU_ADD(M68705,4000000) /* ??? */ |
| r1877 | r1878 | |
| 732 | 732 | /* basic machine hardware */ |
| 733 | 733 | MDRV_CPU_ADD(Z80,10733000/2) /* ??? */ |
| 734 | 734 | MDRV_CPU_PROGRAM_MAP(onna34ro_map,0) |
| 735 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 735 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 736 | 736 | |
| 737 | 737 | MDRV_CPU_ADD(Z80,8000000/2) |
| 738 | 738 | /* audio CPU */ /* 4 MHz */ |
| 739 | 739 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 740 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) /* IRQ generated by ??? */ | |
| 740 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) /* IRQ generated by ??? */ | |
| 741 | 741 | /* NMI generated by the main CPU */ |
| 742 | 742 | // MDRV_CPU_ADD(M68705,4000000) /* ??? */ |
| 743 | 743 | // MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem) |
| r1877 | r1878 | |
| 780 | 780 | /* basic machine hardware */ |
| 781 | 781 | MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz */ |
| 782 | 782 | MDRV_CPU_PROGRAM_MAP(victnine_map,0) |
| 783 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 783 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 784 | 784 | |
| 785 | 785 | MDRV_CPU_ADD(Z80,8000000/2) |
| 786 | 786 | /* audio CPU */ /* 4 MHz */ |
| 787 | 787 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 788 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) /* IRQ generated by ??? */ | |
| 788 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) /* IRQ generated by ??? */ | |
| 789 | 789 | /* NMI generated by the main CPU */ |
| 790 | 790 | // MDRV_CPU_ADD(M68705,4000000) /* ??? */ |
| 791 | 791 | // MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | static void fcrash_render_sprites(running_machine *machine, | |
| 68 | static void fcrash_render_sprites(running_machine *machine, | |
| 69 | 69 | { |
| 70 | 70 | int pos; |
| 71 | 71 | int base=0x50c8/2; // and 10c8/2 for the buffer? |
| r1877 | r1878 | |
| 92 | 92 | |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | static void fcrash_render_layer(running_machine *machine, | |
| 95 | static void fcrash_render_layer(running_machine *machine, | |
| 96 | 96 | { |
| 97 | 97 | switch (layer) |
| 98 | 98 | { |
| r1877 | r1878 | |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | static void fcrash_render_high_layer( | |
| 110 | static void fcrash_render_high_layer( | |
| 111 | 111 | { |
| 112 | 112 | switch (layer) |
| 113 | 113 | { |
| r1877 | r1878 | |
| 324 | 324 | /* basic machine hardware */ |
| 325 | 325 | MDRV_CPU_ADD_TAG("main", M68000, 10000000) |
| 326 | 326 | MDRV_CPU_PROGRAM_MAP(fcrash_readmem,fcrash_writemem) |
| 327 | MDRV_CPU_VBLANK_INT(cps1_interrupt | |
| 327 | MDRV_CPU_VBLANK_INT("main", cps1_interrupt | |
| 328 | 328 | |
| 329 | 329 | // MDRV_CPU_ADD_TAG("sound", Z80, 4000000) /* ???? */ |
| 330 | 330 | // /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 106 | 106 | if (ACCESSING_LSB) |
| 107 | 107 | { |
| 108 | 108 | pending_command = 1; |
| 109 | soundlatch_w(offset,data & 0xff); | |
| 110 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 109 | soundlatch_w(machine,offset,data & 0xff); | |
| 110 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | |
| r1877 | r1878 | |
| 329 | 329 | static MACHINE_DRIVER_START( suprslam ) |
| 330 | 330 | MDRV_CPU_ADD(M68000, 16000000) |
| 331 | 331 | MDRV_CPU_PROGRAM_MAP(suprslam_readmem,suprslam_writemem) |
| 332 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 332 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 333 | 333 | |
| 334 | 334 | MDRV_CPU_ADD(Z80,8000000/2) |
| 335 | 335 | /* audio CPU */ /* 4 MHz ??? */ |
| r1877 | r1878 | |
|---|---|---|
| 16 | 16 | #include "sound/2151intf.h" |
| 17 | 17 | #include "sound/okim6295.h" |
| 18 | 18 | |
| 19 | static UINT32 *vram; | |
| 19 | static UINT32 *mosaicf2_videoram; | |
| 20 | 20 | |
| 21 | 21 | static READ32_HANDLER( oki_32bit_r ) |
| 22 | 22 | { |
| 23 | return OKIM6295_status_0_r(0); | |
| 23 | return OKIM6295_status_0_r(machine, 0); | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | static WRITE32_HANDLER( oki_32bit_w ) |
| 27 | 27 | { |
| 28 | OKIM6295_data_0_w(0, data & 0xff); | |
| 28 | OKIM6295_data_0_w(machine, 0, data & 0xff); | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | static READ32_HANDLER( ym2151_status_32bit_r ) |
| 32 | 32 | { |
| 33 | return YM2151_status_port_0_r(0); | |
| 33 | return YM2151_status_port_0_r(machine, 0); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | static WRITE32_HANDLER( ym2151_data_32bit_w ) |
| 37 | 37 | { |
| 38 | YM2151_data_port_0_w(0, data & 0xff); | |
| 38 | YM2151_data_port_0_w(machine, 0, data & 0xff); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | static WRITE32_HANDLER( ym2151_register_32bit_w ) |
| 42 | 42 | { |
| 43 | YM2151_register_port_0_w(0,data & 0xff); | |
| 43 | YM2151_register_port_0_w(machine,0,data & 0xff); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | static WRITE32_HANDLER( vram_w ) | |
| 47 | { | |
| 48 | int x,y; | |
| 49 | ||
| 50 | COMBINE_DATA(&vram[offset]); | |
| 51 | ||
| 52 | y = offset >> 8; | |
| 53 | x = offset & 0xff; | |
| 54 | ||
| 55 | if(x < 320/2 && y < 224) | |
| 56 | { | |
| 57 | *BITMAP_ADDR16(tmpbitmap, y, x*2+0) = (vram[offset] >> 16) & 0x7fff; | |
| 58 | *BITMAP_ADDR16(tmpbitmap, y, x*2+1) = vram[offset] & 0x7fff; | |
| 59 | } | |
| 60 | } | |
| 61 | ||
| 62 | 46 | static READ32_HANDLER( eeprom_r ) |
| 63 | 47 | { |
| 64 | 48 | return EEPROM_read_bit(); |
| r1877 | r1878 | |
| 80 | 64 | } |
| 81 | 65 | |
| 82 | 66 | |
| 67 | static VIDEO_UPDATE( mosaicf2 ) | |
| 68 | { | |
| 69 | offs_t offs; | |
| 70 | ||
| 71 | for (offs = 0; offs < 0x10000; offs++) | |
| 72 | { | |
| 73 | int y = offs >> 8; | |
| 74 | int x = offs & 0xff; | |
| 75 | ||
| 76 | if ((x < 0xa0) && (y < 0xe0)) | |
| 77 | { | |
| 78 | *BITMAP_ADDR16(bitmap, y, (x * 2) + 0) = (mosaicf2_videoram[offs] >> 16) & 0x7fff; | |
| 79 | *BITMAP_ADDR16(bitmap, y, (x * 2) + 1) = (mosaicf2_videoram[offs] >> 0) & 0x7fff; | |
| 80 | } | |
| 81 | } | |
| 82 | ||
| 83 | return 0; | |
| 84 | } | |
| 85 | ||
| 86 | ||
| 87 | ||
| 83 | 88 | static ADDRESS_MAP_START( common_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 84 | 89 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM |
| 85 | AM_RANGE(0x40000000, 0x4003ffff) AM_ | |
| 90 | AM_RANGE(0x40000000, 0x4003ffff) AM_ | |
| 86 | 91 | AM_RANGE(0x80000000, 0x80ffffff) AM_ROM AM_REGION(REGION_USER2,0) |
| 87 | 92 | AM_RANGE(0xfff00000, 0xffffffff) AM_ROM AM_REGION(REGION_USER1,0) |
| 88 | 93 | ADDRESS_MAP_END |
| r1877 | r1878 | |
| 93 | 98 | if ((activecpu_get_pc() == 0x000379de) || |
| 94 | 99 | (activecpu_get_pc() == 0x000379cc) ) activecpu_adjust_icount(-100); |
| 95 | 100 | //else printf("PC %08x\n", activecpu_get_pc() ); |
| 96 | return input_port_1_dword_r(0, 0); | |
| 101 | return input_port_1_dword_r(machine, 0, 0); | |
| 97 | 102 | } |
| 98 | 103 | |
| 99 | 104 | |
| r1877 | r1878 | |
| 147 | 152 | MDRV_CPU_ADD_TAG("main", E132XN, 20000000*4) /* 4x internal multiplier */ |
| 148 | 153 | MDRV_CPU_PROGRAM_MAP(common_map,0) |
| 149 | 154 | MDRV_CPU_IO_MAP(mosaicf2_io,0) |
| 150 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 155 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 151 | 156 | |
| 152 | 157 | MDRV_NVRAM_HANDLER(93C46) |
| 153 | 158 | |
| r1877 | r1878 | |
| 159 | 164 | MDRV_SCREEN_SIZE(512, 512) |
| 160 | 165 | MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 223) |
| 161 | 166 | |
| 162 | MDRV_VIDEO_START(generic_bitmapped) | |
| 163 | MDRV_VIDEO_UPDATE(generic_bitmapped) | |
| 167 | MDRV_VIDEO_UPDATE(mosaicf2) | |
| 164 | 168 | |
| 165 | 169 | /* sound hardware */ |
| 166 | 170 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| r1877 | r1878 | |
|---|---|---|
| 473 | 473 | TODO: |
| 474 | 474 | |
| 475 | 475 | - Parent/clone relationship. |
| 476 | - System 905 inputs. | |
| 476 | - System 903/905 inputs. | |
| 477 | 477 | - System 905 sound through PIAs. |
| 478 | 478 | - Fix lamps. |
| 479 | 479 | |
| r1877 | r1878 | |
| 491 | 491 | /* from video */ |
| 492 | 492 | WRITE8_HANDLER( calomega_videoram_w ); |
| 493 | 493 | WRITE8_HANDLER( calomega_colorram_w ); |
| 494 | WRITE8_HANDLER( calomega_mc6845_address_w ); | |
| 495 | READ8_HANDLER( calomega_mc6845_register_r ); | |
| 496 | WRITE8_HANDLER( calomega_mc6845_register_w ); | |
| 497 | 494 | PALETTE_INIT( calomega ); |
| 498 | 495 | VIDEO_START( calomega ); |
| 499 | 496 | VIDEO_UPDATE( calomega ); |
| r1877 | r1878 | |
| 507 | 504 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 508 | 505 | AM_RANGE(0x0840, 0x0840) AM_WRITE(AY8910_control_port_0_w) |
| 509 | 506 | AM_RANGE(0x0841, 0x0841) AM_WRITE(AY8910_write_port_0_w) |
| 510 | AM_RANGE(0x0880, 0x0880) AM_WRITE(calomega_mc6845_address_w) | |
| 511 | AM_RANGE(0x0881, 0x0881) AM_READWRITE(calomega_mc6845_register_r, calomega_mc6845_register_w) | |
| 507 | AM_RANGE(0x0880, 0x0880) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 508 | AM_RANGE(0x0881, 0x0881) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 512 | 509 | AM_RANGE(0x08c4, 0x08c7) AM_READWRITE(pia_0_r, pia_0_w) |
| 513 | 510 | AM_RANGE(0x08c8, 0x08cb) AM_READWRITE(pia_1_r, pia_1_w) |
| 514 | 511 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(calomega_videoram_w) AM_BASE(&videoram) |
| r1877 | r1878 | |
| 520 | 517 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 521 | 518 | AM_RANGE(0x0880, 0x0880) AM_WRITE(AY8910_control_port_0_w) |
| 522 | 519 | AM_RANGE(0x0881, 0x0881) AM_WRITE(AY8910_write_port_0_w) |
| 523 | AM_RANGE(0x1080, 0x1080) AM_WRITE(calomega_mc6845_address_w) | |
| 524 | AM_RANGE(0x1081, 0x1081) AM_READWRITE(calomega_mc6845_register_r, calomega_mc6845_register_w) | |
| 520 | AM_RANGE(0x1080, 0x1080) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 521 | AM_RANGE(0x1081, 0x1081) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 525 | 522 | AM_RANGE(0x10c4, 0x10c7) AM_READWRITE(pia_0_r, pia_0_w) |
| 526 | 523 | AM_RANGE(0x10c8, 0x10cb) AM_READWRITE(pia_1_r, pia_1_w) |
| 527 | 524 | AM_RANGE(0x2000, 0x23ff) AM_RAM AM_WRITE(calomega_videoram_w) AM_BASE(&videoram) |
| r1877 | r1878 | |
| 1053 | 1050 | { |
| 1054 | 1051 | switch( mux_data&0xf0 ) /* bits 4-7 */ |
| 1055 | 1052 | { |
| 1056 | case 0x10: return input_port_0_r(0); | |
| 1057 | case 0x20: return input_port_1_r(0); | |
| 1058 | case 0x40: return input_port_2_r(0); | |
| 1059 | case 0x80: return input_port_3_r(0); | |
| 1053 | case 0x10: return input_port_0_r(machine,0); | |
| 1054 | case 0x20: return input_port_1_r(machine,0); | |
| 1055 | case 0x40: return input_port_2_r(machine,0); | |
| 1056 | case 0x80: return input_port_3_r(machine,0); | |
| 1060 | 1057 | } |
| 1061 | 1058 | return 0xff; |
| 1062 | 1059 | } |
| r1877 | r1878 | |
| 1150 | 1147 | // basic machine hardware |
| 1151 | 1148 | MDRV_CPU_ADD_TAG("main", M6502, MASTER_CLOCK/16) /* confirmed */ |
| 1152 | 1149 | MDRV_CPU_PROGRAM_MAP(sys903_map, 0) |
| 1153 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1150 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1154 | 1151 | |
| 1155 | 1152 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 1156 | 1153 | |
| r1877 | r1878 | |
| 2118 | 2115 | GAME( 1982, elgrande, 0, sys903, elgrande, elgrande, ROT0, "Tuni Electro Service / E.T. Marketing", "El Grande - 5 Card Draw (New)", 0 ) |
| 2119 | 2116 | GAME( 1983, jjpoker, 0, sys903, jjpoker, jjpoker, ROT0, "Enter-Tech (ETL)", "Jackpot Joker Poker (set 1)", 0 ) |
| 2120 | 2117 | GAME( 1983, jjpokerb, jjpoker, sys903, jjpoker, jjpoker, ROT0, "Enter-Tech (ETL)", "Jackpot Joker Poker (set 2)", 0 ) |
| 2121 | GAME( 1988, ssipkr24, jjpoker, sys903, ssipkr, jjpoker, ROT0, "SSI", "SSI Poker (v2.4)", 0 ) | |
| 2122 | GAME( 1988, ssipkr30, jjpoker, sys903, ssipkr, jjpoker, ROT0, "SSI", "SSI Poker (v3.0)", 0 ) | |
| 2123 | GAME( 1990, ssipkr40, jjpoker, sys903, ssipkr, jjpoker, ROT0, "SSI", "SSI Poker (v4.0)", 0 ) | |
| 2118 | GAME( 1988, ssipkr24, 0, sys903, ssipkr, jjpoker, ROT0, "SSI", "SSI Poker (v2.4)", 0 ) | |
| 2119 | GAME( 1988, ssipkr30, ssipkr24, sys903, ssipkr, jjpoker, ROT0, "SSI", "SSI Poker (v3.0)", 0 ) | |
| 2120 | GAME( 1990, ssipkr40, ssipkr24, sys903, ssipkr, jjpoker, ROT0, "SSI", "SSI Poker (v4.0)", 0 ) |
| r1877 | r1878 | |
|---|---|---|
| 337 | 337 | /* basic machine hardware */ |
| 338 | 338 | MDRV_CPU_ADD(Z80,8000000/2) /* 4.000MHz */ |
| 339 | 339 | MDRV_CPU_PROGRAM_MAP(strnskil_readmem1,strnskil_writemem1) |
| 340 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 340 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 341 | 341 | |
| 342 | 342 | MDRV_CPU_ADD(Z80,8000000/2) /* 4.000MHz */ |
| 343 | 343 | MDRV_CPU_PROGRAM_MAP(strnskil_readmem2,strnskil_writemem2) |
| 344 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 344 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 345 | 345 | |
| 346 | 346 | MDRV_INTERLEAVE(100) |
| 347 | 347 |
| r1877 | r1878 | |
|---|---|---|
| 82 | 82 | |
| 83 | 83 | MDRV_CPU_ADD(Z80,8000000) // ? |
| 84 | 84 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 85 | // MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 85 | // MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 86 | 86 | |
| 87 | 87 | //MDRV_CPU_ADD(Z80,8000000) // ? |
| 88 | 88 | //MDRV_CPU_PROGRAM_MAP(readmem2,writemem2) |
| 89 | // MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 89 | // MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 90 | 90 | |
| 91 | 91 | MDRV_SCREEN_ADD("main", RASTER) |
| 92 | 92 | MDRV_SCREEN_REFRESH_RATE(60) |
| r1877 | r1878 | |
|---|---|---|
| 245 | 245 | |
| 246 | 246 | static INPUT_PORTS_START( atetris ) |
| 247 | 247 | // These ports are read via the Pokeys |
| 248 | PORT_START | |
| 248 | PORT_START_TAG(" | |
| 249 | 249 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 250 | 250 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 251 | PORT_DIPNAME( 0x04, 0x00, "Freeze" ) | |
| 251 | PORT_DIPNAME( 0x04, 0x00, "Freeze" ) PORT_DIPLOCATION("50H:!4") | |
| 252 | 252 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 253 | 253 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 254 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Freeze Step") PORT_CODE(KEYCODE_F1) | |
| 255 | PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 254 | PORT_DIPNAME( 0x08, 0x00, "Freeze Step" ) PORT_DIPLOCATION("50H:!3") | |
| 255 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 256 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) | |
| 257 | PORT_DIPUNUSED_DIPLOC( 0x10, 0x00, "50H:!2" ) /* Listed As "SPARE2 (Unused)" */ | |
| 258 | PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "50H:!1" ) /* Listed As "SPARE1 (Unused)" */ | |
| 256 | 259 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 257 | 260 | PORT_SERVICE( 0x80, IP_ACTIVE_HIGH ) |
| 258 | 261 | |
| 259 | PORT_START | |
| 262 | PORT_START_TAG(" | |
| 260 | 263 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1) |
| 261 | 264 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1) |
| 262 | 265 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1) |
| r1877 | r1878 | |
| 270 | 273 | |
| 271 | 274 | // Same as the regular one except they added a Flip Controls switch |
| 272 | 275 | static INPUT_PORTS_START( atetcktl ) |
| 273 | // These ports are read via the Pokeys | |
| 274 | PORT_START /* IN0 */ | |
| 275 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 276 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 277 | PORT_DIPNAME( 0x04, 0x00, "Freeze" ) | |
| 276 | PORT_INCLUDE( atetris ) | |
| 277 | ||
| 278 | PORT_MODIFY("IN0") | |
| 279 | PORT_DIPNAME( 0x20, 0x00, "Flip Controls" ) PORT_DIPLOCATION("50H:!1") | |
| 278 | 280 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 279 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) | |
| 280 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Freeze Step") PORT_CODE(KEYCODE_F1) | |
| 281 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 282 | PORT_DIPNAME( 0x20, 0x00, "Flip Controls" ) | |
| 283 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 284 | 281 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 285 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK ) | |
| 286 | PORT_SERVICE( 0x80, IP_ACTIVE_HIGH ) | |
| 287 | ||
| 288 | PORT_START /* IN1 */ | |
| 289 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1) | |
| 290 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) | |
| 291 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) | |
| 292 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) | |
| 293 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(2) | |
| 294 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) | |
| 295 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) | |
| 296 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) | |
| 297 | 282 | INPUT_PORTS_END |
| 298 | 283 | |
| 299 | 284 |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | |
| 55 | 55 | static UINT32 *vram; |
| 56 | 56 | static int vbuffer = 0; |
| 57 | static | |
| 57 | static | |
| 58 | 58 | |
| 59 | 59 | static int flash_roms; |
| 60 | 60 | static UINT32 flash_cmd = 0; |
| r1877 | r1878 | |
| 163 | 163 | switch(mem_mask) |
| 164 | 164 | { |
| 165 | 165 | case 0: |
| 166 | vram_w(offset,data,0x0000ffff); | |
| 167 | vram_w(offset,data,0xffff0000); | |
| 166 | vram_w(machine,offset,data,0x0000ffff); | |
| 167 | vram_w(machine,offset,data,0xffff0000); | |
| 168 | 168 | return; |
| 169 | 169 | |
| 170 | 170 | case 0xffff: |
| r1877 | r1878 | |
| 217 | 217 | { |
| 218 | 218 | /* burn a bunch of cycles because this is polled frequently during busy loops */ |
| 219 | 219 | activecpu_adjust_icount(-100); |
| 220 | return input_port_0_dword_r(offset, 0); | |
| 220 | return input_port_0_dword_r(machine, offset, 0); | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | static ADDRESS_MAP_START( cpu_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| r1877 | r1878 | |
|---|---|---|
| 112 | 112 | |
| 113 | 113 | static WRITE8_HANDLER( panic_sound_output2_w ) |
| 114 | 114 | { |
| 115 | panic_sound_output_w(offset+15, data); | |
| 115 | panic_sound_output_w(machine, offset+15, data); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | static WRITE8_HANDLER( cosmicg_output_w ) |
| r1877 | r1878 | |
| 189 | 189 | /* mostly not noticed since sound is */ |
| 190 | 190 | /* only enabled if game in progress! */ |
| 191 | 191 | |
| 192 | if ((input_port_3_r(0) & 0xc0) != 0xc0) | |
| 193 | panic_sound_output_w(17,1); | |
| 192 | if ((input_port_3_r(machine,0) & 0xc0) != 0xc0) | |
| 193 | panic_sound_output_w(machine,17,1); | |
| 194 | 194 | |
| 195 | 195 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf); /* RST 08h */ |
| 196 | 196 | } |
| r1877 | r1878 | |
| 228 | 228 | static INTERRUPT_GEN( magspot_interrupt ) |
| 229 | 229 | { |
| 230 | 230 | /* Coin 1 causes an IRQ, Coin 2 an NMI */ |
| 231 | if (input_port_4_r(0) & 0x01) | |
| 231 | if (input_port_4_r(machine,0) & 0x01) | |
| 232 | 232 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); |
| 233 | else if (input_port_4_r(0) & 0x02) | |
| 233 | else if (input_port_4_r(machine,0) & 0x02) | |
| 234 | 234 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | static INTERRUPT_GEN( nomnlnd_interrupt ) |
| 238 | 238 | { |
| 239 | 239 | /* Coin causes an NMI */ |
| 240 | if (input_port_4_r(0) & 0x01) | |
| 240 | if (input_port_4_r(machine,0) & 0x01) | |
| 241 | 241 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); |
| 242 | 242 | } |
| 243 | 243 | |
| r1877 | r1878 | |
| 252 | 252 | { |
| 253 | 253 | /* The top four address lines from the CRTC are bits 0-3 */ |
| 254 | 254 | |
| 255 | return (input_port_0_r(0) & 0xf0) | ((video_screen_get_vpos(0) & 0xf0) >> 4); | |
| 255 | return (input_port_0_r(machine,0) & 0xf0) | ((video_screen_get_vpos(0) & 0xf0) >> 4); | |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | static READ8_HANDLER( magspot_coinage_dip_r ) |
| 259 | 259 | { |
| 260 | return (input_port_5_r(0) & (1 << (7 - offset))) ? 0 : 1; | |
| 260 | return (input_port_5_r(machine,0) & (1 << (7 - offset))) ? 0 : 1; | |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | |
| r1877 | r1878 | |
| 266 | 266 | static READ8_HANDLER( nomnlnd_port_0_1_r ) |
| 267 | 267 | { |
| 268 | 268 | int control; |
| 269 | int fire = input_port_3_r(0); | |
| 269 | int fire = input_port_3_r(machine,0); | |
| 270 | 270 | |
| 271 | 271 | if (offset) |
| 272 | control = input_port_1_r(0); | |
| 272 | control = input_port_1_r(machine,0); | |
| 273 | 273 | else |
| 274 | control = input_port_0_r(0); | |
| 274 | control = input_port_0_r(machine,0); | |
| 275 | 275 | |
| 276 | 276 | /* If firing - stop tank */ |
| 277 | 277 | |
| r1877 | r1878 | |
| 1005 | 1005 | MDRV_CPU_MODIFY("main") |
| 1006 | 1006 | |
| 1007 | 1007 | MDRV_CPU_PROGRAM_MAP(panic_readmem,panic_writemem) |
| 1008 | MDRV_CPU_VBLANK_INT(panic_interrupt,2) | |
| 1008 | MDRV_CPU_VBLANK_INT_HACK(panic_interrupt,2) | |
| 1009 | 1009 | |
| 1010 | 1010 | /* video hardware */ |
| 1011 | 1011 | MDRV_GFXDECODE(panic) |
| r1877 | r1878 | |
| 1033 | 1033 | MDRV_CPU_MODIFY("main") |
| 1034 | 1034 | |
| 1035 | 1035 | MDRV_CPU_PROGRAM_MAP(cosmica_readmem,cosmica_writemem) |
| 1036 | MDRV_CPU_VBLANK_INT(cosmica_interrupt,32) | |
| 1036 | MDRV_CPU_VBLANK_INT_HACK(cosmica_interrupt,32) | |
| 1037 | 1037 | |
| 1038 | 1038 | /* video hardware */ |
| 1039 | 1039 | MDRV_GFXDECODE(cosmica) |
| r1877 | r1878 | |
| 1054 | 1054 | 1.5MHz. So, if someone can check this... */ |
| 1055 | 1055 | MDRV_CPU_PROGRAM_MAP(cosmicg_readmem,cosmicg_writemem) |
| 1056 | 1056 | MDRV_CPU_IO_MAP(cosmicg_readport,cosmicg_writeport) |
| 1057 | MDRV_CPU_VBLANK_INT(cosmicg_interrupt | |
| 1057 | MDRV_CPU_VBLANK_INT("main", cosmicg_interrupt | |
| 1058 | 1058 | |
| 1059 | 1059 | /* video hardware */ |
| 1060 | 1060 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 1087 | 1087 | MDRV_CPU_MODIFY("main") |
| 1088 | 1088 | |
| 1089 | 1089 | MDRV_CPU_PROGRAM_MAP(magspot_readmem,magspot_writemem) |
| 1090 | MDRV_CPU_VBLANK_INT(magspot_interrupt | |
| 1090 | MDRV_CPU_VBLANK_INT("main", magspot_interrupt | |
| 1091 | 1091 | |
| 1092 | 1092 | /* video hardware */ |
| 1093 | 1093 | MDRV_GFXDECODE(panic) |
| r1877 | r1878 | |
| 1121 | 1121 | MDRV_CPU_MODIFY("main") |
| 1122 | 1122 | |
| 1123 | 1123 | MDRV_CPU_PROGRAM_MAP(magspot_readmem,magspot_writemem) |
| 1124 | MDRV_CPU_VBLANK_INT(nomnlnd_interrupt | |
| 1124 | MDRV_CPU_VBLANK_INT("main", nomnlnd_interrupt | |
| 1125 | 1125 | |
| 1126 | 1126 | /* video hardware */ |
| 1127 | 1127 | MDRV_GFXDECODE(panic) |
| r1877 | r1878 | |
|---|---|---|
| 235 | 235 | MDRV_CPU_ADD(Z80,8000000) // ? |
| 236 | 236 | MDRV_CPU_PROGRAM_MAP(readmem, 0) |
| 237 | 237 | MDRV_CPU_IO_MAP(readport_pzlestar,writeport_pzlestar) |
| 238 | MDRV_CPU_VBLANK_INT(sangho_interrupt,262) | |
| 238 | MDRV_CPU_VBLANK_INT_HACK(sangho_interrupt,262) | |
| 239 | 239 | |
| 240 | 240 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| 241 | 241 | |
| r1877 | r1878 | |
| 268 | 268 | MDRV_CPU_ADD(Z80,8000000) // ? |
| 269 | 269 | MDRV_CPU_PROGRAM_MAP(readmem, 0) |
| 270 | 270 | MDRV_CPU_IO_MAP(readport_sexyboom,writeport_sexyboom) |
| 271 | MDRV_CPU_VBLANK_INT(sangho_interrupt,262) | |
| 271 | MDRV_CPU_VBLANK_INT_HACK(sangho_interrupt,262) | |
| 272 | 272 | |
| 273 | 273 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| 274 | 274 |
| r1877 | r1878 | |
|---|---|---|
| 220 | 220 | /* basic machine hardware */ |
| 221 | 221 | MDRV_CPU_ADD(M6809, XTAL_18_432MHz/12) /* verified on pcb */ |
| 222 | 222 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 223 | MDRV_CPU_VBLANK_INT(shaolins_interrupt,16) /* 1 IRQ + 8 NMI */ | |
| 223 | MDRV_CPU_VBLANK_INT_HACK(shaolins_interrupt,16) /* 1 IRQ + 8 NMI */ | |
| 224 | 224 | |
| 225 | 225 | /* video hardware */ |
| 226 | 226 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 483 | 483 | |
| 484 | 484 | static READ32_HANDLER(videoctl_r) |
| 485 | 485 | { |
| 486 | return ( | |
| 486 | return (vid | |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | |
| r1877 | r1878 | |
| 944 | 944 | { |
| 945 | 945 | if (((mem_mask & 0xff) == 0) && (offset == 0)) |
| 946 | 946 | { |
| 947 | SCSP_MidiIn(0, data&0xff, 0); | |
| 947 | SCSP_MidiIn(machine, 0, data&0xff, 0); | |
| 948 | 948 | |
| 949 | 949 | // give the 68k time to notice |
| 950 | 950 | cpu_spinuntil_time(ATTOTIME_IN_USEC(40)); |
| r1877 | r1878 | |
| 1578 | 1578 | |
| 1579 | 1579 | static READ16_HANDLER( m1_snd_mpcm0_r ) |
| 1580 | 1580 | { |
| 1581 | return MultiPCM_reg_0_r(0); | |
| 1581 | return MultiPCM_reg_0_r(machine, 0); | |
| 1582 | 1582 | } |
| 1583 | 1583 | |
| 1584 | 1584 | static WRITE16_HANDLER( m1_snd_mpcm0_w ) |
| 1585 | 1585 | { |
| 1586 | MultiPCM_reg_0_w(offset, data); | |
| 1586 | MultiPCM_reg_0_w(machine, offset, data); | |
| 1587 | 1587 | } |
| 1588 | 1588 | |
| 1589 | 1589 | static WRITE16_HANDLER( m1_snd_mpcm0_bnk_w ) |
| r1877 | r1878 | |
| 1593 | 1593 | |
| 1594 | 1594 | static READ16_HANDLER( m1_snd_mpcm1_r ) |
| 1595 | 1595 | { |
| 1596 | return MultiPCM_reg_1_r(0); | |
| 1596 | return MultiPCM_reg_1_r(machine, 0); | |
| 1597 | 1597 | } |
| 1598 | 1598 | |
| 1599 | 1599 | static WRITE16_HANDLER( m1_snd_mpcm1_w ) |
| 1600 | 1600 | { |
| 1601 | MultiPCM_reg_1_w(offset, data); | |
| 1601 | MultiPCM_reg_1_w(machine, offset, data); | |
| 1602 | 1602 | } |
| 1603 | 1603 | |
| 1604 | 1604 | static WRITE16_HANDLER( m1_snd_mpcm1_bnk_w ) |
| r1877 | r1878 | |
| 1608 | 1608 | |
| 1609 | 1609 | static READ16_HANDLER( m1_snd_ym_r ) |
| 1610 | 1610 | { |
| 1611 | return YM3438_status_port_0_A_r(0); | |
| 1611 | return YM3438_status_port_0_A_r(machine, 0); | |
| 1612 | 1612 | } |
| 1613 | 1613 | |
| 1614 | 1614 | static WRITE16_HANDLER( m1_snd_ym_w ) |
| r1877 | r1878 | |
| 1616 | 1616 | switch (offset) |
| 1617 | 1617 | { |
| 1618 | 1618 | case 0: |
| 1619 | YM3438_control_port_0_A_w(0, data); | |
| 1619 | YM3438_control_port_0_A_w(machine, 0, data); | |
| 1620 | 1620 | break; |
| 1621 | 1621 | |
| 1622 | 1622 | case 1: |
| 1623 | YM3438_data_port_0_A_w(0, data); | |
| 1623 | YM3438_data_port_0_A_w(machine, 0, data); | |
| 1624 | 1624 | break; |
| 1625 | 1625 | |
| 1626 | 1626 | case 2: |
| 1627 | YM3438_control_port_0_B_w(0, data); | |
| 1627 | YM3438_control_port_0_B_w(machine, 0, data); | |
| 1628 | 1628 | break; |
| 1629 | 1629 | |
| 1630 | 1630 | case 3: |
| 1631 | YM3438_data_port_0_B_w(0, data); | |
| 1631 | YM3438_data_port_0_B_w(machine, 0, data); | |
| 1632 | 1632 | break; |
| 1633 | 1633 | } |
| 1634 | 1634 | } |
| r1877 | r1878 | |
| 1789 | 1789 | static MACHINE_DRIVER_START( model2o ) |
| 1790 | 1790 | MDRV_CPU_ADD(I960, 25000000) |
| 1791 | 1791 | MDRV_CPU_PROGRAM_MAP(model2_base_mem, model2o_mem) |
| 1792 | MDRV_CPU_VBLANK_INT(model2_interrupt,2) | |
| 1792 | MDRV_CPU_VBLANK_INT_HACK(model2_interrupt,2) | |
| 1793 | 1793 | |
| 1794 | 1794 | MDRV_CPU_ADD(M68000, 10000000) |
| 1795 | 1795 | MDRV_CPU_PROGRAM_MAP(model1_snd, 0) |
| r1877 | r1878 | |
| 1836 | 1836 | static MACHINE_DRIVER_START( model2a ) |
| 1837 | 1837 | MDRV_CPU_ADD(I960, 25000000) |
| 1838 | 1838 | MDRV_CPU_PROGRAM_MAP(model2_base_mem, model2a_crx_mem) |
| 1839 | MDRV_CPU_VBLANK_INT(model2_interrupt,2) | |
| 1839 | MDRV_CPU_VBLANK_INT_HACK(model2_interrupt,2) | |
| 1840 | 1840 | |
| 1841 | 1841 | MDRV_CPU_ADD(M68000, 12000000) |
| 1842 | 1842 | MDRV_CPU_PROGRAM_MAP(model2_snd, 0) |
| r1877 | r1878 | |
| 1880 | 1880 | static MACHINE_DRIVER_START( model2b ) |
| 1881 | 1881 | MDRV_CPU_ADD(I960, 25000000) |
| 1882 | 1882 | MDRV_CPU_PROGRAM_MAP(model2_base_mem, model2b_crx_mem) |
| 1883 | MDRV_CPU_VBLANK_INT(model2_interrupt,2) | |
| 1883 | MDRV_CPU_VBLANK_INT_HACK(model2_interrupt,2) | |
| 1884 | 1884 | |
| 1885 | 1885 | MDRV_CPU_ADD(M68000, 12000000) |
| 1886 | 1886 | MDRV_CPU_PROGRAM_MAP(model2_snd, 0) |
| r1877 | r1878 | |
| 1924 | 1924 | static MACHINE_DRIVER_START( model2c ) |
| 1925 | 1925 | MDRV_CPU_ADD(I960, 25000000) |
| 1926 | 1926 | MDRV_CPU_PROGRAM_MAP(model2_base_mem, model2c_crx_mem) |
| 1927 | MDRV_CPU_VBLANK_INT(model2c_interrupt,3) | |
| 1927 | MDRV_CPU_VBLANK_INT_HACK(model2c_interrupt,3) | |
| 1928 | 1928 | |
| 1929 | 1929 | MDRV_CPU_ADD(M68000, 12000000) |
| 1930 | 1930 | MDRV_CPU_PROGRAM_MAP(model2_snd, 0) |
| r1877 | r1878 | |
|---|---|---|
| 215 | 215 | |
| 216 | 216 | static READ16_HANDLER(via_r) |
| 217 | 217 | { |
| 218 | return via_0_r(offset); | |
| 218 | return via_0_r(machine,offset); | |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | static WRITE16_HANDLER(via_w) |
| 222 | 222 | { |
| 223 | via_0_w(offset,data); | |
| 223 | via_0_w(machine,offset,data); | |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | static READ8_HANDLER(via_b_in) |
| 227 | 227 | { |
| 228 | return input_port_3_r(0); | |
| 228 | return input_port_3_r(machine,0); | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | |
| r1877 | r1878 | |
| 447 | 447 | { |
| 448 | 448 | switch(bmc_input) |
| 449 | 449 | { |
| 450 | case 0x00: return input_port_1_r(0); | |
| 451 | case 0x40: return input_port_2_r(0); | |
| 450 | case 0x00: return input_port_1_r(machine,0); | |
| 451 | case 0x40: return input_port_2_r(machine,0); | |
| 452 | 452 | } |
| 453 | 453 | logerror("unknown input - %X (PC=%X)\n",bmc_input,activecpu_get_previouspc()); |
| 454 | 454 | return 0xff; |
| r1877 | r1878 | |
| 495 | 495 | static MACHINE_DRIVER_START( bmcbowl ) |
| 496 | 496 | MDRV_CPU_ADD_TAG("main", M68000, 21477270/2 ) |
| 497 | 497 | MDRV_CPU_PROGRAM_MAP(bmcbowl_mem,0) |
| 498 | MDRV_CPU_VBLANK_INT(bmc_interrupt,2) | |
| 498 | MDRV_CPU_VBLANK_INT_HACK(bmc_interrupt,2) | |
| 499 | 499 | |
| 500 | 500 | |
| 501 | 501 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 89 | 89 | |
| 90 | 90 | static WRITE16_HANDLER( sshangha_sound_w ) |
| 91 | 91 | { |
| 92 | soundlatch_w(0,data&0xff); | |
| 93 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 92 | soundlatch_w(machine,0,data&0xff); | |
| 93 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /* Protection/IO chip 146 */ |
| r1877 | r1878 | |
| 142 | 142 | orientation when entering the "test mode" |
| 143 | 143 | (check the game code from 0x0006b8 to 0x0006f0). |
| 144 | 144 | I can't tell however if this is accurate or not. */ |
| 145 | sshangha_control_0_w(0, 0x10, 0xff00); | |
| 145 | sshangha_control_0_w(machine, 0, 0x10, 0xff00); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | /******************************************************************************/ |
| r1877 | r1878 | |
| 342 | 342 | /* basic machine hardware */ |
| 343 | 343 | MDRV_CPU_ADD(M68000, 28000000/2) |
| 344 | 344 | MDRV_CPU_PROGRAM_MAP(sshangha_readmem,sshangha_writemem) |
| 345 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 345 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 346 | 346 | |
| 347 | 347 | MDRV_CPU_ADD(Z80, 16000000/4) |
| 348 | 348 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 310 | 310 | /* basic machine hardware */ |
| 311 | 311 | MDRV_CPU_ADD(Z80,18432000/6) /* 3.072 MHz */ |
| 312 | 312 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 313 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 313 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 314 | 314 | |
| 315 | 315 | MDRV_CPU_ADD(Z80,18432000/6) |
| 316 | 316 | /* audio CPU */ /* 3.072 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 40 | 40 | { |
| 41 | 41 | // must start with interrupts and sub CPU disabled |
| 42 | 42 | cpu_interrupt_enable(0, 0); |
| 43 | kyugo_sub_cpu_control_w(0, 0); | |
| 43 | kyugo_sub_cpu_control_w(machine, 0, 0); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| r1877 | r1878 | |
| 496 | 496 | MDRV_CPU_ADD_TAG("main", Z80, 18432000 / 4) /* 18.432 MHz crystal */ |
| 497 | 497 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 498 | 498 | MDRV_CPU_IO_MAP(0,gyrodine_portmap) |
| 499 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 499 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 500 | 500 | |
| 501 | 501 | MDRV_CPU_ADD_TAG("sub", Z80, 18432000 / 4) /* 18.432 MHz crystal */ |
| 502 | 502 | MDRV_CPU_PROGRAM_MAP(gyrodine_sub_map,0) |
| 503 | 503 | MDRV_CPU_IO_MAP(gyrodine_sub_portmap,0) |
| 504 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 504 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 505 | 505 | |
| 506 | 506 | MDRV_INTERLEAVE(100) |
| 507 | 507 |
| r1877 | r1878 | |
|---|---|---|
| 719 | 719 | MDRV_CPU_ADD_TAG("master", Z80, MASTER_CLOCK/2) |
| 720 | 720 | MDRV_CPU_PROGRAM_MAP(master_map_program,0) |
| 721 | 721 | MDRV_CPU_IO_MAP(master_map_io,0) |
| 722 | MDRV_CPU_VBLANK_INT(leland_master_interrupt | |
| 722 | MDRV_CPU_VBLANK_INT("main", leland_master_interrupt | |
| 723 | 723 | |
| 724 | 724 | MDRV_CPU_ADD_TAG("slave", Z80, MASTER_CLOCK/2) |
| 725 | 725 | MDRV_CPU_PROGRAM_MAP(slave_small_map_program,0) |
| r1877 | r1878 | |
|---|---|---|
| 82 | 82 | /* basic machine hardware */ |
| 83 | 83 | MDRV_CPU_ADD(Z80,18432000/4) |
| 84 | 84 | MDRV_CPU_PROGRAM_MAP(readmem1,writemem1) |
| 85 | // MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 85 | // MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 86 | 86 | |
| 87 | 87 | MDRV_CPU_ADD(Z80,18432000/4) |
| 88 | 88 | MDRV_CPU_PROGRAM_MAP(readmem2,writemem2) |
| 89 | // MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 89 | // MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 90 | 90 | |
| 91 | 91 | /* video hardware */ |
| 92 | 92 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 221 | 221 | ***************************************************************************/ |
| 222 | 222 | |
| 223 | 223 | #include "driver.h" |
| 224 | #include "deprecat.h" | |
| 224 | 225 | #include "lazercmd.h" |
| 225 | 226 | #include "cpu/s2650/s2650.h" |
| 226 | 227 | #include "sound/dac.h" |
| r1877 | r1878 | |
| 285 | 286 | static READ8_HANDLER( lazercmd_data_port_r ) |
| 286 | 287 | { |
| 287 | 288 | int data; |
| 288 | data = input_port_2_r(0) & 0x0f; | |
| 289 | data = input_port_2_r(machine,0) & 0x0f; | |
| 289 | 290 | return data; |
| 290 | 291 | } |
| 291 | 292 | |
| r1877 | r1878 | |
| 380 | 381 | switch (offset) |
| 381 | 382 | { |
| 382 | 383 | case 0: /* player 1 joysticks */ |
| 383 | data = input_port_0_r(0); | |
| 384 | data = input_port_0_r(machine,0); | |
| 384 | 385 | break; |
| 385 | 386 | case 1: /* player 2 joysticks */ |
| 386 | data = input_port_1_r(0); | |
| 387 | data = input_port_1_r(machine,0); | |
| 387 | 388 | break; |
| 388 | 389 | case 2: /* player 1 + 2 buttons */ |
| 389 | data = input_port_4_r(0); | |
| 390 | data = input_port_4_r(machine,0); | |
| 390 | 391 | break; |
| 391 | 392 | case 3: /* coin slot + start buttons */ |
| 392 | data = input_port_3_r(0); | |
| 393 | data = input_port_3_r(machine,0); | |
| 393 | 394 | break; |
| 394 | 395 | case 4: /* vertical scan counter */ |
| 395 | 396 | data = ((timer_count&0x10)>>1)|((timer_count&0x20)>>3)|((timer_count&0x40)>>5)|((timer_count&0x80)>>7); |
| r1877 | r1878 | |
| 620 | 621 | thus requiring an extra loading of approx 3-5 */ |
| 621 | 622 | MDRV_CPU_PROGRAM_MAP(lazercmd_map,0) |
| 622 | 623 | MDRV_CPU_IO_MAP(lazercmd_portmap,0) |
| 623 | MDRV_CPU_VBLANK_INT(lazercmd_timer, 128) /* 7680 Hz */ | |
| 624 | MDRV_CPU_VBLANK_INT_HACK(lazercmd_timer, 128) /* 7680 Hz */ | |
| 624 | 625 | |
| 625 | 626 | /* video hardware */ |
| 626 | 627 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 655 | 656 | thus requiring an extra loading of approx 3-5 */ |
| 656 | 657 | MDRV_CPU_PROGRAM_MAP(medlanes_map,0) |
| 657 | 658 | MDRV_CPU_IO_MAP(lazercmd_portmap,0) |
| 658 | MDRV_CPU_VBLANK_INT(lazercmd_timer, 128) /* 7680 Hz */ | |
| 659 | MDRV_CPU_VBLANK_INT_HACK(lazercmd_timer, 128) /* 7680 Hz */ | |
| 659 | 660 | |
| 660 | 661 | /* video hardware */ |
| 661 | 662 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 690 | 691 | thus requiring an extra loading of approx 3-5 */ |
| 691 | 692 | MDRV_CPU_PROGRAM_MAP(bbonk_map,0) |
| 692 | 693 | MDRV_CPU_IO_MAP(lazercmd_portmap,0) |
| 693 | MDRV_CPU_VBLANK_INT(bbonk_timer, 128) /* 7680 Hz */ | |
| 694 | MDRV_CPU_VBLANK_INT_HACK(bbonk_timer, 128) /* 7680 Hz */ | |
| 694 | 695 | |
| 695 | 696 | /* video hardware */ |
| 696 | 697 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 463 | 463 | int res; |
| 464 | 464 | |
| 465 | 465 | |
| 466 | res = input_port_3_r(offset); | |
| 467 | res |= (input_port_4_r(offset) << (7-dswbit)) & 0x80; | |
| 466 | res = input_port_3_r(machine,offset); | |
| 467 | res |= (input_port_4_r(machine,offset) << (7-dswbit)) & 0x80; | |
| 468 | 468 | |
| 469 | 469 | return res; |
| 470 | 470 | } |
| r1877 | r1878 | |
| 484 | 484 | MDRV_CPU_ADD_TAG("main", Z80, 8000000/2) /* 4 MHz */ |
| 485 | 485 | MDRV_CPU_PROGRAM_MAP(skyskipr_readmem,skyskipr_writemem) |
| 486 | 486 | MDRV_CPU_IO_MAP(readport,writeport) |
| 487 | MDRV_CPU_VBLANK_INT(popeye_interrupt | |
| 487 | MDRV_CPU_VBLANK_INT("main", popeye_interrupt | |
| 488 | 488 | |
| 489 | 489 | /* video hardware */ |
| 490 | 490 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 166 | 166 | AM_RANGE(0xFFF80000, 0xFFFFFFFF) AM_ROM AM_REGION(REGION_USER1,0) // boot rom |
| 167 | 167 | ADDRESS_MAP_END |
| 168 | 168 | |
| 169 | static READ32_HANDLER( gstream_oki_0_r ) { return OKIM6295_status_0_r(0); } | |
| 170 | static READ32_HANDLER( gstream_oki_1_r ) { return OKIM6295_status_1_r(0); } | |
| 171 | static WRITE32_HANDLER( gstream_oki_0_w ) { OKIM6295_data_0_w(0, data & 0xff); } | |
| 172 | static WRITE32_HANDLER( gstream_oki_1_w ) { OKIM6295_data_1_w(0, data & 0xff); } | |
| 169 | static READ32_HANDLER( gstream_oki_0_r ) { return OKIM6295_status_0_r(machine, 0); } | |
| 170 | static READ32_HANDLER( gstream_oki_1_r ) { return OKIM6295_status_1_r(machine, 0); } | |
| 171 | static WRITE32_HANDLER( gstream_oki_0_w ) { OKIM6295_data_0_w(machine, 0, data & 0xff); } | |
| 172 | static WRITE32_HANDLER( gstream_oki_1_w ) { OKIM6295_data_1_w(machine, 0, data & 0xff); } | |
| 173 | 173 | |
| 174 | 174 | static WRITE32_HANDLER( gstream_oki_4030_w ) |
| 175 | 175 | { |
| r1877 | r1878 | |
| 389 | 389 | MDRV_CPU_ADD_TAG("main", E132XT, 16000000*4) /* 4x internal multiplier */ |
| 390 | 390 | MDRV_CPU_PROGRAM_MAP(gstream_32bit_map,0) |
| 391 | 391 | MDRV_CPU_IO_MAP(gstream_io,0) |
| 392 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 392 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 393 | 393 | |
| 394 | 394 | /* video hardware */ |
| 395 | 395 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 49 | 49 | ***************************************************************************/ |
| 50 | 50 | |
| 51 | 51 | #include "driver.h" |
| 52 | #include "deprecat.h" | |
| 52 | 53 | #include "cpu/z80/z80.h" |
| 53 | 54 | #include "sound/ay8910.h" |
| 54 | 55 | |
| r1877 | r1878 | |
| 70 | 71 | if ((last & 0x04) == 0x04 && (data & 0x4) == 0x00) |
| 71 | 72 | { |
| 72 | 73 | if (last & 0x01) |
| 73 | AY8910_control_port_0_w(0,soundlatch); | |
| 74 | AY8910_control_port_0_w(machine,0,soundlatch); | |
| 74 | 75 | else |
| 75 | AY8910_write_port_0_w(0,soundlatch); | |
| 76 | AY8910_write_port_0_w(machine,0,soundlatch); | |
| 76 | 77 | } |
| 77 | 78 | last=data; |
| 78 | 79 | } |
| r1877 | r1878 | |
| 161 | 162 | MDRV_CPU_ADD(Z80,8000000/2) |
| 162 | 163 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 163 | 164 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 164 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 165 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 165 | 166 | |
| 166 | 167 | /* video hardware */ |
| 167 | 168 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | |
| 13 | 13 | |
| 14 | static WRITE8_HANDLER( p2a_w ) { taxidrvr_spritectrl_w(0,data); } | |
| 15 | static WRITE8_HANDLER( p2b_w ) { taxidrvr_spritectrl_w(1,data); } | |
| 16 | static WRITE8_HANDLER( p2c_w ) { taxidrvr_spritectrl_w(2,data); } | |
| 17 | static WRITE8_HANDLER( p3a_w ) { taxidrvr_spritectrl_w(3,data); } | |
| 18 | static WRITE8_HANDLER( p3b_w ) { taxidrvr_spritectrl_w(4,data); } | |
| 19 | static WRITE8_HANDLER( p3c_w ) { taxidrvr_spritectrl_w(5,data); } | |
| 20 | static WRITE8_HANDLER( p4a_w ) { taxidrvr_spritectrl_w(6,data); } | |
| 21 | static WRITE8_HANDLER( p4b_w ) { taxidrvr_spritectrl_w(7,data); } | |
| 22 | static WRITE8_HANDLER( p4c_w ) { taxidrvr_spritectrl_w(8,data); } | |
| 14 | static WRITE8_HANDLER( p2a_w ) { taxidrvr_spritectrl_w(machine,0,data); } | |
| 15 | static WRITE8_HANDLER( p2b_w ) { taxidrvr_spritectrl_w(machine,1,data); } | |
| 16 | static WRITE8_HANDLER( p2c_w ) { taxidrvr_spritectrl_w(machine,2,data); } | |
| 17 | static WRITE8_HANDLER( p3a_w ) { taxidrvr_spritectrl_w(machine,3,data); } | |
| 18 | static WRITE8_HANDLER( p3b_w ) { taxidrvr_spritectrl_w(machine,4,data); } | |
| 19 | static WRITE8_HANDLER( p3c_w ) { taxidrvr_spritectrl_w(machine,5,data); } | |
| 20 | static WRITE8_HANDLER( p4a_w ) { taxidrvr_spritectrl_w(machine,6,data); } | |
| 21 | static WRITE8_HANDLER( p4b_w ) { taxidrvr_spritectrl_w(machine,7,data); } | |
| 22 | static WRITE8_HANDLER( p4c_w ) { taxidrvr_spritectrl_w(machine,8,data); } | |
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | |
| r1877 | r1878 | |
| 362 | 362 | /* basic machine hardware */ |
| 363 | 363 | MDRV_CPU_ADD(Z80,4000000) /* 4 MHz ??? */ |
| 364 | 364 | MDRV_CPU_PROGRAM_MAP(readmem1,writemem1) |
| 365 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 365 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 366 | 366 | |
| 367 | 367 | MDRV_CPU_ADD(Z80,4000000) /* 4 MHz ??? */ |
| 368 | 368 | MDRV_CPU_PROGRAM_MAP(readmem2,writemem2) |
| 369 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 369 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 370 | 370 | |
| 371 | 371 | MDRV_CPU_ADD(Z80,4000000) /* 4 MHz ??? */ |
| 372 | 372 | MDRV_CPU_PROGRAM_MAP(readmem3,writemem3) |
| 373 | 373 | MDRV_CPU_IO_MAP(readport3,writeport3) |
| 374 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 374 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 375 | 375 | |
| 376 | 376 | MDRV_INTERLEAVE(100) /* 100 CPU slices per frame - an high value to ensure proper */ |
| 377 | 377 | /* synchronization of the CPUs */ |
| r1877 | r1878 | |
|---|---|---|
| 67 | 67 | { |
| 68 | 68 | cpunum_resume(0, SUSPEND_ANY_REASON); |
| 69 | 69 | |
| 70 | if ((input_port_0_r(0) & 0x80) == 0) | |
| 70 | if ((input_port_0_r(machine,0) & 0x80) == 0) | |
| 71 | 71 | { |
| 72 | 72 | just_been_reset = 1; |
| 73 | 73 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE); |
| r1877 | r1878 | |
| 78 | 78 | { |
| 79 | 79 | /* coin latch is bit 7 */ |
| 80 | 80 | |
| 81 | UINT8 temp = (input_port_0_r(0)&0x7f); | |
| 81 | UINT8 temp = (input_port_0_r(machine,0)&0x7f); | |
| 82 | 82 | return (coin_latch<<7) | (temp); |
| 83 | 83 | } |
| 84 | 84 | |
| r1877 | r1878 | |
| 458 | 458 | MDRV_CPU_ADD(8080, 2079000) |
| 459 | 459 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 460 | 460 | MDRV_CPU_IO_MAP(readport,writeport) |
| 461 | MDRV_CPU_VBLANK_INT(blockade_interrupt | |
| 461 | MDRV_CPU_VBLANK_INT("main", blockade_interrupt | |
| 462 | 462 | |
| 463 | 463 | /* video hardware */ |
| 464 | 464 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 211 | 211 | static MACHINE_DRIVER_START( compgolf ) |
| 212 | 212 | MDRV_CPU_ADD(M6809, 2000000) |
| 213 | 213 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 214 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 214 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 215 | 215 | |
| 216 | 216 | /* video hardware */ |
| 217 | 217 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 1023 | 1023 | INPUT_PORTS_END |
| 1024 | 1024 | |
| 1025 | 1025 | /* 3 players and 2 buttons */ |
| 1026 | #ifdef UNUSED_DEFINITION | |
| 1026 | 1027 | static INPUT_PORTS_START( cps2_3p2b ) |
| 1027 | 1028 | PORT_INCLUDE(cps2_3p3b) |
| 1028 | 1029 | |
| r1877 | r1878 | |
| 1033 | 1034 | PORT_MODIFY("IN1") |
| 1034 | 1035 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) /* BUTTON3 PORT_PLAYER(3) */ |
| 1035 | 1036 | INPUT_PORTS_END |
| 1037 | #endif | |
| 1036 | 1038 | |
| 1037 | 1039 | /* 2 players and 4 buttons */ |
| 1038 | 1040 | static INPUT_PORTS_START( cps2_2p4b ) |
| r1877 | r1878 | |
| 1239 | 1241 | MDRV_CPU_ADD(M68000, 16000000) |
| 1240 | 1242 | MDRV_CPU_CONFIG(cps2_encryption) |
| 1241 | 1243 | MDRV_CPU_PROGRAM_MAP(cps2_readmem,cps2_writemem) |
| 1242 | MDRV_CPU_VBLANK_INT(cps2_interrupt,262) // 262 /* ??? interrupts per frame */ | |
| 1244 | MDRV_CPU_VBLANK_INT_HACK(cps2_interrupt,262) // 262 /* ??? interrupts per frame */ | |
| 1243 | 1245 | |
| 1244 | 1246 | MDRV_CPU_ADD(Z80, 8000000) |
| 1245 | 1247 | MDRV_CPU_PROGRAM_MAP(qsound_readmem,qsound_writemem) |
| r1877 | r1878 | |
| 2239 | 2241 | ROM_LOAD16_WORD_SWAP( "dad.12m", 0x200000, 0x200000, CRC(2f0b5a4e) SHA1(8d1ebbb811aa469b0f0d29d719d2b9af28fb63a2) ) |
| 2240 | 2242 | ROM_END |
| 2241 | 2243 | |
| 2242 | ROM_START( ddtodjr | |
| 2244 | ROM_START( ddtodjr1 ) | |
| 2243 | 2245 | ROM_REGION( CODE_SIZE, REGION_CPU1, 0 ) /* 68000 code */ |
| 2244 | 2246 | ROM_LOAD16_WORD_SWAP( "dadj.03b", 0x000000, 0x80000, CRC(87606b85) SHA1(1311c9ae321207db4632572f6c838b732974b087) ) |
| 2245 | 2247 | ROM_LOAD16_WORD_SWAP( "dadj.04b", 0x080000, 0x80000, CRC(24d49575) SHA1(419d7d2f970c23c39334a7f2e8c5caa237769c5d) ) |
| r1877 | r1878 | |
| 2266 | 2268 | ROM_LOAD16_WORD_SWAP( "dad.12m", 0x200000, 0x200000, CRC(2f0b5a4e) SHA1(8d1ebbb811aa469b0f0d29d719d2b9af28fb63a2) ) |
| 2267 | 2269 | ROM_END |
| 2268 | 2270 | |
| 2269 | ROM_START( ddtodjr | |
| 2271 | ROM_START( ddtodjr2 ) | |
| 2270 | 2272 | ROM_REGION( CODE_SIZE, REGION_CPU1, 0 ) /* 68000 code */ |
| 2271 | 2273 | ROM_LOAD16_WORD_SWAP( "dadj.03a", 0x000000, 0x80000, CRC(711638dc) SHA1(30c1d1a694aa8e51d072b26b47ba55aed6d77b7b) ) |
| 2272 | 2274 | ROM_LOAD16_WORD_SWAP( "dadj.04a", 0x080000, 0x80000, CRC(4869639c) SHA1(1544813e6712a78267c1d27b6b49148d42c11127) ) |
| r1877 | r1878 | |
|---|---|---|
| 152 | 152 | // popmessage("PR: %04x", data); |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | static READ16_HANDLER( lordgun_ppi8255_0_r ) { return ppi8255_0_r(offset); } | |
| 156 | static READ16_HANDLER( lordgun_ppi8255_1_r ) { return ppi8255_1_r(offset); } | |
| 155 | static READ16_HANDLER( lordgun_ppi8255_0_r ) { return ppi8255_0_r(machine, offset); } | |
| 156 | static READ16_HANDLER( lordgun_ppi8255_1_r ) { return ppi8255_1_r(machine, offset); } | |
| 157 | 157 | |
| 158 | static WRITE16_HANDLER( lordgun_ppi8255_0_w ) { ppi8255_0_w(offset, data & 0xff); } | |
| 159 | static WRITE16_HANDLER( lordgun_ppi8255_1_w ) { ppi8255_1_w(offset, data & 0xff); } | |
| 158 | static WRITE16_HANDLER( lordgun_ppi8255_0_w ) { ppi8255_0_w(machine, offset, data & 0xff); } | |
| 159 | static WRITE16_HANDLER( lordgun_ppi8255_1_w ) { ppi8255_1_w(machine, offset, data & 0xff); } | |
| 160 | 160 | |
| 161 | 161 | static READ16_HANDLER( lordgun_gun_0_x_r ) { return lordgun_gun[0].hw_x; } |
| 162 | 162 | static READ16_HANDLER( lordgun_gun_0_y_r ) { return lordgun_gun[0].hw_y; } |
| r1877 | r1878 | |
| 166 | 166 | |
| 167 | 167 | static WRITE16_HANDLER( lordgun_soundlatch_w ) |
| 168 | 168 | { |
| 169 | if (ACCESSING_LSB) soundlatch_w (0, (data >> 0) & 0xff); | |
| 170 | if (ACCESSING_MSB) soundlatch2_w(0, (data >> 8) & 0xff); | |
| 169 | if (ACCESSING_LSB) soundlatch_w (machine, 0, (data >> 0) & 0xff); | |
| 170 | if (ACCESSING_MSB) soundlatch2_w(machine, 0, (data >> 8) & 0xff); | |
| 171 | 171 | |
| 172 | cpunum_set_input_line( | |
| 172 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | static ADDRESS_MAP_START( lordgun_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1877 | r1878 | |
| 438 | 438 | static MACHINE_DRIVER_START( lordgun ) |
| 439 | 439 | MDRV_CPU_ADD_TAG("main", M68000, 10000000) |
| 440 | 440 | MDRV_CPU_PROGRAM_MAP(lordgun_map,0) |
| 441 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 441 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 442 | 442 | |
| 443 | 443 | MDRV_CPU_ADD_TAG("sound", Z80, 5000000) |
| 444 | 444 | MDRV_CPU_PROGRAM_MAP(lordgun_soundmem_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 74 | 74 | |
| 75 | 75 | static WRITE16_HANDLER( lemmings_sound_w ) |
| 76 | 76 | { |
| 77 | soundlatch_w(0,data&0xff); | |
| 78 | cpunum_set_input_line(Machine, 1,1,HOLD_LINE); | |
| 77 | soundlatch_w(machine,0,data&0xff); | |
| 78 | cpunum_set_input_line(machine, 1,1,HOLD_LINE); | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | static WRITE8_HANDLER( lemmings_sound_ack_w ) |
| r1877 | r1878 | |
| 275 | 275 | /* basic machine hardware */ |
| 276 | 276 | MDRV_CPU_ADD(M68000, 14000000) |
| 277 | 277 | MDRV_CPU_PROGRAM_MAP(lemmings_readmem,lemmings_writemem) |
| 278 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 278 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 279 | 279 | |
| 280 | 280 | MDRV_CPU_ADD(M6809,32220000/8) |
| 281 | 281 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 40 | 40 | static WRITE16_HANDLER( pushman_control_w ) |
| 41 | 41 | { |
| 42 | 42 | if (ACCESSING_MSB) |
| 43 | soundlatch_w(0,(data>>8)&0xff); | |
| 43 | soundlatch_w(machine,0,(data>>8)&0xff); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | static READ16_HANDLER( pushman_68705_r ) |
| r1877 | r1878 | |
| 435 | 435 | /* basic machine hardware */ |
| 436 | 436 | MDRV_CPU_ADD(M68000, 8000000) |
| 437 | 437 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 438 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 438 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 439 | 439 | |
| 440 | 440 | MDRV_CPU_ADD(Z80, 4000000) |
| 441 | 441 | /* audio CPU */ |
| r1877 | r1878 | |
| 478 | 478 | /* basic machine hardware */ |
| 479 | 479 | MDRV_CPU_ADD(M68000, 8000000) |
| 480 | 480 | MDRV_CPU_PROGRAM_MAP(bballs_readmem,bballs_writemem) |
| 481 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 481 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 482 | 482 | |
| 483 | 483 | MDRV_CPU_ADD(Z80, 4000000) |
| 484 | 484 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | { |
| 62 | 62 | if (ACCESSING_MSB) |
| 63 | 63 | { |
| 64 | soundlatch_w(offset,data >> 8); | |
| 65 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 64 | soundlatch_w(machine,offset,data >> 8); | |
| 65 | cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff); | |
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 70 | AM_RANGE(0x000000, 0x01ffff) AM_READ(MRA16_ROM) | |
| 69 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 70 | AM_RANGE(0x000000, 0x01ffff) AM_ROM | |
| 71 | 71 | AM_RANGE(0x080000, 0x08000f) AM_READ(zerozone_input_r) |
| 72 | AM_RANGE(0x088000, 0x0881ff) AM_READ(MRA16_RAM) | |
| 73 | AM_RANGE(0x098000, 0x098001) AM_READ(MRA16_RAM) /* watchdog? */ | |
| 74 | AM_RANGE(0x09ce00, 0x09ffff) AM_READ(MRA16_RAM) | |
| 75 | AM_RANGE(0x0c0000, 0x0cffff) AM_READ(MRA16_RAM) | |
| 76 | AM_RANGE(0x0f8000, 0x0f87ff) AM_READ(MRA16_RAM) // never actually used | |
| 77 | ADDRESS_MAP_END | |
| 78 | ||
| 79 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 80 | AM_RANGE(0x000000, 0x01ffff) AM_WRITE(MWA16_ROM) | |
| 81 | 72 | AM_RANGE(0x084000, 0x084001) AM_WRITE(zerozone_sound_w) |
| 82 | AM_RANGE(0x088000, 0x0881ff) AM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16) | |
| 83 | AM_RANGE(0x09ce00, 0x09ddff) AM_WRITE(zerozone_tilemap_w) AM_BASE(&zerozone_videoram) AM_SIZE(&videoram_size) | |
| 73 | AM_RANGE(0x088000, 0x0881ff) AM_READWRITE(MRA16_RAM, paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16) | |
| 74 | AM_RANGE(0x098000, 0x098001) AM_RAM /* Watchdog? */ | |
| 75 | AM_RANGE(0x09ce00, 0x09ffff) AM_READWRITE(MRA16_RAM, zerozone_tilemap_w) AM_BASE(&zerozone_videoram) AM_SIZE(&videoram_size) | |
| 84 | 76 | AM_RANGE(0x0b4000, 0x0b4001) AM_WRITE(zerozone_tilebank_w) |
| 85 | AM_RANGE(0x0c0000, 0x0cffff) AM_WRITE(MWA16_RAM) /* RAM */ | |
| 86 | AM_RANGE(0x0f8000, 0x0f87ff) AM_WRITE(MWA16_RAM) | |
| 77 | AM_RANGE(0x0c0000, 0x0cffff) AM_RAM | |
| 78 | AM_RANGE(0x0f8000, 0x0f87ff) AM_RAM /* Never read from */ | |
| 87 | 79 | ADDRESS_MAP_END |
| 88 | 80 | |
| 89 | ||
| 90 | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 91 | AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM) | |
| 92 | AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM) | |
| 93 | AM_RANGE(0x9800, 0x9800) AM_READ(OKIM6295_status_0_r) | |
| 81 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 82 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 83 | AM_RANGE(0x8000, 0x87ff) AM_RAM | |
| 84 | AM_RANGE(0x9800, 0x9800) AM_READWRITE(OKIM6295_status_0_r, OKIM6295_data_0_w) | |
| 94 | 85 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) |
| 95 | 86 | ADDRESS_MAP_END |
| 96 | 87 | |
| 97 | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 98 | AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM) | |
| 99 | AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM) | |
| 100 | AM_RANGE(0x9800, 0x9800) AM_WRITE(OKIM6295_data_0_w) | |
| 101 | ADDRESS_MAP_END | |
| 102 | 88 | |
| 103 | 89 | static INPUT_PORTS_START( zerozone ) |
| 104 | 90 | PORT_START_TAG("IN0") |
| r1877 | r1878 | |
| 192 | 178 | |
| 193 | 179 | /* basic machine hardware */ |
| 194 | 180 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz */ |
| 195 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 196 | MDRV_CPU_VBLANK_INT(irq1_line_hold,1) | |
| 181 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 182 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold) | |
| 197 | 183 | |
| 198 | 184 | MDRV_CPU_ADD(Z80, 1000000) |
| 199 | 185 | /* audio CPU */ /* 1 MHz ??? */ |
| 200 | MDRV_CPU_PROGRAM_MAP(sound_ | |
| 186 | MDRV_CPU_PROGRAM_MAP(sound_ | |
| 201 | 187 | |
| 202 | 188 | MDRV_INTERLEAVE(10) |
| 203 | 189 |
| r1877 | r1878 | |
|---|---|---|
| 32 | 32 | |
| 33 | 33 | WRITE8_HANDLER( zodiac_master_interrupt_enable_w ) |
| 34 | 34 | { |
| 35 | interrupt_enable_w(offset,~data & 1); | |
| 35 | interrupt_enable_w(machine,offset,~data & 1); | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| r1877 | r1878 | |
| 60 | 60 | |
| 61 | 61 | WRITE8_HANDLER( zodiac_master_soundlatch_w ) |
| 62 | 62 | { |
| 63 | soundlatch_w(offset, data); | |
| 64 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 63 | soundlatch_w(machine, offset, data); | |
| 64 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| r1877 | r1878 | |
| 315 | 315 | /* basic machine hardware */ |
| 316 | 316 | MDRV_CPU_ADD_TAG("main", Z80, 3072000) /* 3.072 MHz */ |
| 317 | 317 | MDRV_CPU_PROGRAM_MAP(espial_readmem,espial_writemem) |
| 318 | MDRV_CPU_VBLANK_INT(zodiac_master_interrupt,2) | |
| 318 | MDRV_CPU_VBLANK_INT_HACK(zodiac_master_interrupt,2) | |
| 319 | 319 | |
| 320 | 320 | MDRV_CPU_ADD(Z80, 3072000) /* 2 MHz?????? */ |
| 321 | 321 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 322 | 322 | MDRV_CPU_IO_MAP(0,sound_writeport) |
| 323 | MDRV_CPU_VBLANK_INT(espial_sound_nmi_gen,4) | |
| 323 | MDRV_CPU_VBLANK_INT_HACK(espial_sound_nmi_gen,4) | |
| 324 | 324 | |
| 325 | 325 | MDRV_MACHINE_RESET(espial) |
| 326 | 326 |
| r1877 | r1878 | |
|---|---|---|
| 462 | 462 | /* basic machine hardware */ |
| 463 | 463 | MDRV_CPU_ADD_TAG("main", M6809, XTAL_18_432MHz/12) /* verified on pcb */ |
| 464 | 464 | MDRV_CPU_PROGRAM_MAP(hyperspt_readmem,writemem) |
| 465 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 465 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 466 | 466 | |
| 467 | 467 | MDRV_CPU_ADD(Z80,XTAL_14_31818MHz/4) /* verified on pcb */ |
| 468 | 468 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 160 | 160 | tiamc1_spriteram_n = video_ram + 0x3020; |
| 161 | 161 | tiamc1_spriteram_a = video_ram + 0x3030; |
| 162 | 162 | |
| 163 | tiamc1_bankswitch_w(0, 0); | |
| 163 | tiamc1_bankswitch_w(machine, 0, 0); | |
| 164 | 164 | |
| 165 | 165 | state_save_register_global_pointer(video_ram, 0x3040); |
| 166 | 166 | } |
| r1877 | r1878 | |
| 279 | 279 | MDRV_CPU_PROGRAM_MAP(tiamc1_readmem,tiamc1_writemem) |
| 280 | 280 | MDRV_CPU_IO_MAP(tiamc1_readport,tiamc1_writeport) |
| 281 | 281 | |
| 282 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 282 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 283 | 283 | |
| 284 | 284 | MDRV_MACHINE_RESET(tiamc1) |
| 285 | 285 |
| r1877 | r1878 | |
|---|---|---|
| 1223 | 1223 | /* basic machine hardware */ |
| 1224 | 1224 | MDRV_CPU_ADD(M68000, 10000000) |
| 1225 | 1225 | MDRV_CPU_PROGRAM_MAP(rallybik_main_map, 0) |
| 1226 | MDRV_CPU_VBLANK_INT(toaplan1_interrupt | |
| 1226 | MDRV_CPU_VBLANK_INT("main", toaplan1_interrupt | |
| 1227 | 1227 | |
| 1228 | 1228 | MDRV_CPU_ADD(Z80,28000000/8) /* 3.5MHz (28MHz Oscillator) */ |
| 1229 | 1229 | MDRV_CPU_PROGRAM_MAP(toaplan1_sound_map, 0) |
| r1877 | r1878 | |
| 1263 | 1263 | /* basic machine hardware */ |
| 1264 | 1264 | MDRV_CPU_ADD(M68000, 10000000) |
| 1265 | 1265 | MDRV_CPU_PROGRAM_MAP(truxton_main_map, 0) |
| 1266 | MDRV_CPU_VBLANK_INT(toaplan1_interrupt | |
| 1266 | MDRV_CPU_VBLANK_INT("main", toaplan1_interrupt | |
| 1267 | 1267 | |
| 1268 | 1268 | MDRV_CPU_ADD(Z80,28000000/8) /* 3.5MHz (28MHz Oscillator) */ |
| 1269 | 1269 | MDRV_CPU_PROGRAM_MAP(toaplan1_sound_map, 0) |
| r1877 | r1878 | |
| 1303 | 1303 | /* basic machine hardware */ |
| 1304 | 1304 | MDRV_CPU_ADD(M68000, 10000000) |
| 1305 | 1305 | MDRV_CPU_PROGRAM_MAP(hellfire_main_map, 0) |
| 1306 | MDRV_CPU_VBLANK_INT(toaplan1_interrupt | |
| 1306 | MDRV_CPU_VBLANK_INT("main", toaplan1_interrupt | |
| 1307 | 1307 | |
| 1308 | 1308 | MDRV_CPU_ADD(Z80,28000000/8) /* 3.5MHz (28MHz Oscillator) */ |
| 1309 | 1309 | MDRV_CPU_PROGRAM_MAP(toaplan1_sound_map, 0) |
| r1877 | r1878 | |
| 1343 | 1343 | /* basic machine hardware */ |
| 1344 | 1344 | MDRV_CPU_ADD(M68000, 10000000) |
| 1345 | 1345 | MDRV_CPU_PROGRAM_MAP(zerowing_main_map, 0) |
| 1346 | MDRV_CPU_VBLANK_INT(toaplan1_interrupt | |
| 1346 | MDRV_CPU_VBLANK_INT("main", toaplan1_interrupt | |
| 1347 | 1347 | |
| 1348 | 1348 | MDRV_CPU_ADD(Z80,28000000/8) /* 3.5MHz (28MHz Oscillator) */ |
| 1349 | 1349 | MDRV_CPU_PROGRAM_MAP(toaplan1_sound_map, 0) |
| r1877 | r1878 | |
| 1383 | 1383 | /* basic machine hardware */ |
| 1384 | 1384 | MDRV_CPU_ADD(M68000, 10000000) |
| 1385 | 1385 | MDRV_CPU_PROGRAM_MAP(demonwld_main_map, 0) |
| 1386 | MDRV_CPU_VBLANK_INT(toaplan1_interrupt | |
| 1386 | MDRV_CPU_VBLANK_INT("main", toaplan1_interrupt | |
| 1387 | 1387 | |
| 1388 | 1388 | MDRV_CPU_ADD(Z80,28000000/8) /* 3.5MHz (28MHz Oscillator) */ |
| 1389 | 1389 | MDRV_CPU_PROGRAM_MAP(toaplan1_sound_map, 0) |
| r1877 | r1878 | |
| 1427 | 1427 | /* basic machine hardware */ |
| 1428 | 1428 | MDRV_CPU_ADD(M68000, 10000000) |
| 1429 | 1429 | MDRV_CPU_PROGRAM_MAP(samesame_main_map, 0) |
| 1430 | MDRV_CPU_VBLANK_INT(toaplan1_interrupt | |
| 1430 | MDRV_CPU_VBLANK_INT("main", toaplan1_interrupt | |
| 1431 | 1431 | |
| 1432 | 1432 | MDRV_MACHINE_RESET(toaplan1) |
| 1433 | 1433 | |
| r1877 | r1878 | |
| 1461 | 1461 | /* basic machine hardware */ |
| 1462 | 1462 | MDRV_CPU_ADD(M68000, 10000000) |
| 1463 | 1463 | MDRV_CPU_PROGRAM_MAP(outzone_main_map, 0) |
| 1464 | MDRV_CPU_VBLANK_INT(toaplan1_interrupt | |
| 1464 | MDRV_CPU_VBLANK_INT("main", toaplan1_interrupt | |
| 1465 | 1465 | |
| 1466 | 1466 | MDRV_CPU_ADD(Z80,28000000/8) /* 3.5MHz (28MHz Oscillator) */ |
| 1467 | 1467 | MDRV_CPU_PROGRAM_MAP(toaplan1_sound_map, 0) |
| r1877 | r1878 | |
| 1501 | 1501 | /* basic machine hardware */ |
| 1502 | 1502 | MDRV_CPU_ADD(M68000, XTAL_10MHz) /* verified on pcb */ |
| 1503 | 1503 | MDRV_CPU_PROGRAM_MAP(vimana_main_map, 0) |
| 1504 | MDRV_CPU_VBLANK_INT(toaplan1_interrupt | |
| 1504 | MDRV_CPU_VBLANK_INT("main", toaplan1_interrupt | |
| 1505 | 1505 | |
| 1506 | 1506 | MDRV_MACHINE_RESET(vimana) |
| 1507 | 1507 |
| r1877 | r1878 | |
|---|---|---|
| 156 | 156 | * |
| 157 | 157 | *************************************/ |
| 158 | 158 | |
| 159 | static | |
| 159 | static INPUT_CHANGED( service_switch | |
| 160 | 160 | { |
| 161 | 161 | /* pressing the service switch sends an NMI */ |
| 162 | 162 | if (newval) |
| 163 | cpunum_set_input_line( | |
| 163 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | |
| 167 | 167 | static MACHINE_START( g80r ) |
| 168 | 168 | { |
| 169 | /* request a callback if the service switch is pressed */ | |
| 170 | input_port_set_changed_callback(port_tag_to_index("SERVICESW"), 0x01, service_switch, NULL); | |
| 171 | ||
| 172 | 169 | /* register for save states */ |
| 173 | 170 | } |
| 174 | 171 | |
| r1877 | r1878 | |
| 204 | 201 | } |
| 205 | 202 | |
| 206 | 203 | static WRITE8_HANDLER( mainram_w ) { mainram[decrypt_offset(offset)] = data; } |
| 207 | static WRITE8_HANDLER( vidram_w ) { segag80r_videoram_w(decrypt_offset(offset), data); } | |
| 208 | static WRITE8_HANDLER( monsterb_vidram_w ) { monsterb_videoram_w(decrypt_offset(offset), data); } | |
| 209 | static WRITE8_HANDLER( pignewt_vidram_w ) { pignewt_videoram_w(decrypt_offset(offset), data); } | |
| 210 | static WRITE8_HANDLER( sindbadm_vidram_w ) { sindbadm_videoram_w(decrypt_offset(offset), data); } | |
| 211 | static WRITE8_HANDLER( usb_ram_w ) { sega_usb_ram_w(decrypt_offset(offset), data); } | |
| 204 | static WRITE8_HANDLER( vidram_w ) { segag80r_videoram_w(machine, decrypt_offset(offset), data); } | |
| 205 | static WRITE8_HANDLER( monsterb_vidram_w ) { monsterb_videoram_w(machine, decrypt_offset(offset), data); } | |
| 206 | static WRITE8_HANDLER( pignewt_vidram_w ) { pignewt_videoram_w(machine, decrypt_offset(offset), data); } | |
| 207 | static WRITE8_HANDLER( sindbadm_vidram_w ) { sindbadm_videoram_w(machine, decrypt_offset(offset), data); } | |
| 208 | static WRITE8_HANDLER( usb_ram_w ) { sega_usb_ram_w(machine, decrypt_offset(offset), data); } | |
| 212 | 209 | |
| 213 | 210 | |
| 214 | 211 | |
| r1877 | r1878 | |
| 305 | 302 | |
| 306 | 303 | static WRITE8_HANDLER( sindbadm_soundport_w ) |
| 307 | 304 | { |
| 308 | soundlatch_w(0,data); | |
| 309 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 305 | soundlatch_w(machine,0,data); | |
| 306 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 310 | 307 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(50)); |
| 311 | 308 | } |
| 312 | 309 | |
| r1877 | r1878 | |
| 321 | 318 | /* the data lines are flipped */ |
| 322 | 319 | static WRITE8_HANDLER( sindbadm_SN76496_0_w ) |
| 323 | 320 | { |
| 324 | SN76496_0_w(offset, BITSWAP8(data, 0,1,2,3,4,5,6,7)); | |
| 321 | SN76496_0_w(machine, offset, BITSWAP8(data, 0,1,2,3,4,5,6,7)); | |
| 325 | 322 | } |
| 326 | 323 | |
| 327 | 324 | |
| 328 | 325 | static WRITE8_HANDLER( sindbadm_SN76496_1_w ) |
| 329 | 326 | { |
| 330 | SN76496_1_w(offset, BITSWAP8(data, 0,1,2,3,4,5,6,7)); | |
| 327 | SN76496_1_w(machine, offset, BITSWAP8(data, 0,1,2,3,4,5,6,7)); | |
| 331 | 328 | } |
| 332 | 329 | |
| 333 | 330 | |
| r1877 | r1878 | |
| 467 | 464 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) /* P1.30 */ |
| 468 | 465 | |
| 469 | 466 | PORT_START_TAG("SERVICESW") |
| 470 | PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_HIGH ) | |
| 467 | PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_HIGH ) PORT_CHANGED(service_switch, 0) | |
| 471 | 468 | INPUT_PORTS_END |
| 472 | 469 | |
| 473 | 470 | |
| r1877 | r1878 | |
| 821 | 818 | MDRV_CPU_ADD_TAG("main", Z80, VIDEO_CLOCK/4) |
| 822 | 819 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 823 | 820 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 824 | MDRV_CPU_VBLANK_INT(segag80r_vblank_start | |
| 821 | MDRV_CPU_VBLANK_INT("main", segag80r_vblank_start | |
| 825 | 822 | |
| 826 | 823 | MDRV_MACHINE_START(g80r) |
| 827 | 824 | |
| r1877 | r1878 | |
| 914 | 911 | MDRV_IMPORT_FROM(g80r_base) |
| 915 | 912 | MDRV_CPU_MODIFY("main") |
| 916 | 913 | MDRV_CPU_IO_MAP(sindbadm_portmap,0) |
| 917 | MDRV_CPU_VBLANK_INT(sindbadm_vblank_start | |
| 914 | MDRV_CPU_VBLANK_INT("main", sindbadm_vblank_start | |
| 918 | 915 | |
| 919 | 916 | /* video hardware */ |
| 920 | 917 | MDRV_GFXDECODE(monsterb) |
| r1877 | r1878 | |
| 924 | 921 | |
| 925 | 922 | MDRV_CPU_ADD(Z80, SINDBADM_SOUND_CLOCK/2) |
| 926 | 923 | MDRV_CPU_PROGRAM_MAP(sindbadm_sound_map,0) |
| 927 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 924 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 928 | 925 | |
| 929 | 926 | /* sound hardware */ |
| 930 | 927 | MDRV_SOUND_ADD(SN76496, SINDBADM_SOUND_CLOCK/4) |
| r1877 | r1878 | |
|---|---|---|
| 346 | 346 | static MACHINE_DRIVER_START( magic10 ) |
| 347 | 347 | MDRV_CPU_ADD_TAG("cpu", M68000, 10000000) // ? |
| 348 | 348 | MDRV_CPU_PROGRAM_MAP(magic10_map,0) |
| 349 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 349 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 350 | 350 | |
| 351 | 351 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 352 | 352 |
| r1877 | r1878 | |
|---|---|---|
| 624 | 624 | MDRV_CPU_ADD_TAG("main", Z80, 20000000/4 ) /* 5 MHz ???? */ |
| 625 | 625 | MDRV_CPU_PROGRAM_MAP(hnayayoi_readmem,hnayayoi_writemem) |
| 626 | 626 | MDRV_CPU_IO_MAP(hnayayoi_readport,hnayayoi_writeport) |
| 627 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 627 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 628 | 628 | MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 8000) |
| 629 | 629 | |
| 630 | 630 | MDRV_MACHINE_RESET(hnayayoi) |
| r1877 | r1878 | |
|---|---|---|
| 986 | 986 | MDRV_CPU_ADD(V30,16000000/2) /* ? */ |
| 987 | 987 | MDRV_CPU_PROGRAM_MAP(shanghai_map,0) |
| 988 | 988 | MDRV_CPU_IO_MAP(shanghai_portmap,0) |
| 989 | MDRV_CPU_VBLANK_INT(shanghai_interrupt | |
| 989 | MDRV_CPU_VBLANK_INT("main", shanghai_interrupt | |
| 990 | 990 | |
| 991 | 991 | /* video hardware */ |
| 992 | 992 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 1019 | 1019 | MDRV_CPU_ADD(V30,16000000/2) /* ? */ |
| 1020 | 1020 | MDRV_CPU_PROGRAM_MAP(shangha2_map,0) |
| 1021 | 1021 | MDRV_CPU_IO_MAP(shangha2_portmap,0) |
| 1022 | MDRV_CPU_VBLANK_INT(shanghai_interrupt | |
| 1022 | MDRV_CPU_VBLANK_INT("main", shanghai_interrupt | |
| 1023 | 1023 | |
| 1024 | 1024 | /* video hardware */ |
| 1025 | 1025 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 1050 | 1050 | /* basic machine hardware */ |
| 1051 | 1051 | MDRV_CPU_ADD(V30,16000000/2) /* ? */ |
| 1052 | 1052 | MDRV_CPU_PROGRAM_MAP(kothello_map, 0) |
| 1053 | MDRV_CPU_VBLANK_INT(shanghai_interrupt | |
| 1053 | MDRV_CPU_VBLANK_INT("main", shanghai_interrupt | |
| 1054 | 1054 | |
| 1055 | 1055 | SEIBU3A_SOUND_SYSTEM_CPU(14318180/4) |
| 1056 | 1056 |
| r1877 | r1878 | |
|---|---|---|
| 119 | 119 | /* some games have the A12 line not connected, so the chip spans */ |
| 120 | 120 | /* twice the memory range, with mirroring */ |
| 121 | 121 | offset = ((offset & 0x3000) >> 1) | (offset & 0x07ff); |
| 122 | return K052109_word_r(offset,mem_mask); | |
| 122 | return K052109_word_r(machine,offset,mem_mask); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | static WRITE16_HANDLER( K052109_word_noA12_w ) |
| r1877 | r1878 | |
| 127 | 127 | /* some games have the A12 line not connected, so the chip spans */ |
| 128 | 128 | /* twice the memory range, with mirroring */ |
| 129 | 129 | offset = ((offset & 0x3000) >> 1) | (offset & 0x07ff); |
| 130 | K052109_word_w(offset,data,mem_mask); | |
| 130 | K052109_word_w(machine,offset,data,mem_mask); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | static WRITE16_HANDLER( punkshot_K052109_word_w ) |
| r1877 | r1878 | |
| 135 | 135 | /* it seems that a word write is supposed to affect only the MSB. The */ |
| 136 | 136 | /* "ROUND 1" text in punkshtj goes lost otherwise. */ |
| 137 | 137 | if (ACCESSING_MSB) |
| 138 | K052109_w(offset,(data >> 8) & 0xff); | |
| 138 | K052109_w(machine,offset,(data >> 8) & 0xff); | |
| 139 | 139 | else if (ACCESSING_LSB) |
| 140 | K052109_w(offset + 0x2000,data & 0xff); | |
| 140 | K052109_w(machine,offset + 0x2000,data & 0xff); | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | static WRITE16_HANDLER( punkshot_K052109_word_noA12_w ) |
| r1877 | r1878 | |
| 145 | 145 | /* some games have the A12 line not connected, so the chip spans */ |
| 146 | 146 | /* twice the memory range, with mirroring */ |
| 147 | 147 | offset = ((offset & 0x3000) >> 1) | (offset & 0x07ff); |
| 148 | punkshot_K052109_word_w(offset,data,mem_mask); | |
| 148 | punkshot_K052109_word_w(machine,offset,data,mem_mask); | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | |
| r1877 | r1878 | |
| 159 | 159 | else |
| 160 | 160 | { |
| 161 | 161 | offset = ((offset & 0x000e) >> 1) | ((offset & 0x1fc0) >> 3); |
| 162 | return K053245_word_r(offset,mem_mask); | |
| 162 | return K053245_word_r(machine,offset,mem_mask); | |
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | |
| r1877 | r1878 | |
| 170 | 170 | if (!(offset & 0x0031)) |
| 171 | 171 | { |
| 172 | 172 | offset = ((offset & 0x000e) >> 1) | ((offset & 0x1fc0) >> 3); |
| 173 | K053245_word_w(offset,data,mem_mask); | |
| 173 | K053245_word_w(machine,offset,data,mem_mask); | |
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
| r1877 | r1878 | |
| 178 | 178 | { |
| 179 | 179 | offset &= ~1; /* handle mirror address */ |
| 180 | 180 | |
| 181 | return K053244_r(offset + 1) | (K053244_r(offset) << 8); | |
| 181 | return K053244_r(machine,offset + 1) | (K053244_r(machine,offset) << 8); | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | static WRITE16_HANDLER( K053244_word_noA1_w ) |
| r1877 | r1878 | |
| 186 | 186 | offset &= ~1; /* handle mirror address */ |
| 187 | 187 | |
| 188 | 188 | if (ACCESSING_MSB) |
| 189 | K053244_w(offset,(data >> 8) & 0xff); | |
| 189 | K053244_w(machine,offset,(data >> 8) & 0xff); | |
| 190 | 190 | if (ACCESSING_LSB) |
| 191 | K053244_w(offset + 1,data & 0xff); | |
| 191 | K053244_w(machine,offset + 1,data & 0xff); | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | static INTERRUPT_GEN(cuebrick_interrupt) |
| r1877 | r1878 | |
| 224 | 224 | static WRITE16_HANDLER( tmnt_sound_command_w ) |
| 225 | 225 | { |
| 226 | 226 | if (ACCESSING_LSB) |
| 227 | soundlatch_w(0,data & 0xff); | |
| 227 | soundlatch_w(machine,0,data & 0xff); | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | static READ16_HANDLER( punkshot_sound_r ) |
| 231 | 231 | { |
| 232 | 232 | /* If the sound CPU is running, read the status, otherwise |
| 233 | 233 | just make it pass the test */ |
| 234 | return K053260_0_r(2 + offset); | |
| 234 | return K053260_0_r(machine,2 + offset); | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | static READ16_HANDLER( blswhstl_sound_r ) |
| 238 | 238 | { |
| 239 | 239 | /* If the sound CPU is running, read the status, otherwise |
| 240 | 240 | just make it pass the test */ |
| 241 | return K053260_0_r(2 + offset); | |
| 241 | return K053260_0_r(machine,2 + offset); | |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | static READ16_HANDLER( glfgreat_sound_r ) |
| 245 | 245 | { |
| 246 | 246 | /* If the sound CPU is running, read the status, otherwise |
| 247 | 247 | just make it pass the test */ |
| 248 | return K053260_0_r(2 + offset) << 8; | |
| 248 | return K053260_0_r(machine,2 + offset) << 8; | |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | static WRITE16_HANDLER( glfgreat_sound_w ) |
| 252 | 252 | { |
| 253 | 253 | if (ACCESSING_MSB) |
| 254 | K053260_0_w(offset, (data >> 8) & 0xff); | |
| 254 | K053260_0_w(machine, offset, (data >> 8) & 0xff); | |
| 255 | 255 | |
| 256 | 256 | if (offset) |
| 257 | cpunum_set_input_line_and_vector( | |
| 257 | cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff); | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | static READ16_HANDLER( prmrsocr_sound_r ) |
| 261 | 261 | { |
| 262 | return soundlatch3_r(0); | |
| 262 | return soundlatch3_r(machine,0); | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | static WRITE16_HANDLER( prmrsocr_sound_cmd_w ) |
| r1877 | r1878 | |
| 267 | 267 | if (ACCESSING_LSB) |
| 268 | 268 | { |
| 269 | 269 | data &= 0xff; |
| 270 | if (offset == 0) soundlatch_w(0,data); | |
| 271 | else soundlatch2_w(0,data); | |
| 270 | if (offset == 0) soundlatch_w(machine,0,data); | |
| 271 | else soundlatch2_w(machine,0,data); | |
| 272 | 272 | } |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | static WRITE16_HANDLER( prmrsocr_sound_irq_w ) |
| 276 | 276 | { |
| 277 | cpunum_set_input_line_and_vector( | |
| 277 | cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff); | |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | static WRITE8_HANDLER( prmrsocr_audio_bankswitch_w ) |
| r1877 | r1878 | |
| 287 | 287 | |
| 288 | 288 | static READ16_HANDLER( tmnt2_sound_r ) |
| 289 | 289 | { |
| 290 | return K053260_0_r(2 + offset); | |
| 290 | return K053260_0_r(machine, 2 + offset); | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | static READ8_HANDLER( tmnt_sres_r ) |
| r1877 | r1878 | |
| 410 | 410 | data = -program_read_word(0x105818); |
| 411 | 411 | data = ((data / 8 - 4) & 0x1f) * 0x40; |
| 412 | 412 | data += ((program_read_word(0x105cb0) + |
| 413 | 256*K052109_r(0x1a01) + K052109_r(0x1a00) - 6) / 8 + 12) & 0x3f; | |
| 413 | 256*K052109_r(machine,0x1a01) + K052109_r(machine,0x1a00) - 6) / 8 + 12) & 0x3f; | |
| 414 | 414 | return data; |
| 415 | 415 | |
| 416 | 416 | default: |
| r1877 | r1878 | |
| 436 | 436 | { |
| 437 | 437 | if ((program_read_word(0x180006 + 128*i) >> 8) == logical_pri) |
| 438 | 438 | { |
| 439 | K053245_word_w(8*i,hardware_pri,0xff00); | |
| 439 | K053245_word_w(machine,8*i,hardware_pri,0xff00); | |
| 440 | 440 | hardware_pri++; |
| 441 | 441 | } |
| 442 | 442 | } |
| r1877 | r1878 | |
| 491 | 491 | |
| 492 | 492 | /* bit 3 is service button */ |
| 493 | 493 | /* bit 6 is ??? VBLANK? OBJMPX? */ |
| 494 | res = input_port_2_word_r(0,0); | |
| 494 | res = input_port_2_word_r(machine,0,0); | |
| 495 | 495 | if (init_eeprom_count) |
| 496 | 496 | { |
| 497 | 497 | init_eeprom_count--; |
| r1877 | r1878 | |
| 507 | 507 | |
| 508 | 508 | /* bit 0 is EEPROM data */ |
| 509 | 509 | /* bit 1 is EEPROM ready */ |
| 510 | res = EEPROM_read_bit() | input_port_3_word_r(0,0); | |
| 510 | res = EEPROM_read_bit() | input_port_3_word_r(machine,0,0); | |
| 511 | 511 | return res; |
| 512 | 512 | } |
| 513 | 513 | |
| r1877 | r1878 | |
| 520 | 520 | /* bit 1 is EEPROM ready */ |
| 521 | 521 | /* bit 2 is VBLANK (???) */ |
| 522 | 522 | /* bit 7 is service button */ |
| 523 | res = EEPROM_read_bit() | input_port_3_word_r(0,0); | |
| 523 | res = EEPROM_read_bit() | input_port_3_word_r(machine,0,0); | |
| 524 | 524 | if (init_eeprom_count) |
| 525 | 525 | { |
| 526 | 526 | init_eeprom_count--; |
| r1877 | r1878 | |
| 539 | 539 | /* bit 1 is EEPROM ready */ |
| 540 | 540 | /* bit 2 is VBLANK (???) */ |
| 541 | 541 | /* bit 3 is service button */ |
| 542 | res = EEPROM_read_bit() | input_port_3_word_r(0,0); | |
| 542 | res = EEPROM_read_bit() | input_port_3_word_r(machine,0,0); | |
| 543 | 543 | if (init_eeprom_count) |
| 544 | 544 | { |
| 545 | 545 | init_eeprom_count--; |
| r1877 | r1878 | |
| 598 | 598 | { |
| 599 | 599 | int res; |
| 600 | 600 | |
| 601 | res = input_port_0_word_r(0,0); | |
| 601 | res = input_port_0_word_r(machine,0,0); | |
| 602 | 602 | if (init_eeprom_count) |
| 603 | 603 | { |
| 604 | 604 | init_eeprom_count--; |
| r1877 | r1878 | |
| 616 | 616 | /* bit 1 is EEPROM ready */ |
| 617 | 617 | /* bit 3 is VBLANK (???) */ |
| 618 | 618 | /* bit 7 is service button */ |
| 619 | res = (EEPROM_read_bit() << 8) | input_port_1_word_r(0,0); | |
| 619 | res = (EEPROM_read_bit() << 8) | input_port_1_word_r(machine,0,0); | |
| 620 | 620 | toggle ^= 0x0800; |
| 621 | 621 | return (res ^ toggle); |
| 622 | 622 | } |
| r1877 | r1878 | |
| 650 | 650 | /* bit 9 is service button */ |
| 651 | 651 | int res; |
| 652 | 652 | |
| 653 | res = input_port_0_word_r(0,0); | |
| 653 | res = input_port_0_word_r(machine,0,0); | |
| 654 | 654 | if (init_eeprom_count) |
| 655 | 655 | { |
| 656 | 656 | init_eeprom_count--; |
| r1877 | r1878 | |
| 663 | 663 | { |
| 664 | 664 | /* bit 8 is EEPROM data */ |
| 665 | 665 | /* bit 9 is EEPROM ready */ |
| 666 | return (EEPROM_read_bit() << 8) | input_port_1_word_r(0,0); | |
| 666 | return (EEPROM_read_bit() << 8) | input_port_1_word_r(machine,0,0); | |
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | static WRITE16_HANDLER( prmrsocr_eeprom_w ) |
| 670 | 670 | { |
| 671 | 671 | if (ACCESSING_LSB) |
| 672 | 672 | { |
| 673 | prmrsocr_122000_w(offset,data,mem_mask); | |
| 673 | prmrsocr_122000_w(machine,offset,data,mem_mask); | |
| 674 | 674 | } |
| 675 | 675 | |
| 676 | 676 | if (ACCESSING_MSB) |
| r1877 | r1878 | |
| 686 | 686 | |
| 687 | 687 | static READ16_HANDLER( cuebrick_snd_r ) |
| 688 | 688 | { |
| 689 | return YM2151_status_port_0_r(0)<<8; | |
| 689 | return YM2151_status_port_0_r(machine,0)<<8; | |
| 690 | 690 | } |
| 691 | 691 | |
| 692 | 692 | static WRITE16_HANDLER( cuebrick_snd_w ) |
| 693 | 693 | { |
| 694 | 694 | if (offset) |
| 695 | 695 | { |
| 696 | YM2151_data_port_0_w(0, data>>8); | |
| 696 | YM2151_data_port_0_w(machine, 0, data>>8); | |
| 697 | 697 | } |
| 698 | 698 | else |
| 699 | 699 | { |
| 700 | YM2151_register_port_0_w(0, data>>8); | |
| 700 | YM2151_register_port_0_w(machine, 0, data>>8); | |
| 701 | 701 | } |
| 702 | 702 | } |
| 703 | 703 | |
| r1877 | r1878 | |
| 906 | 906 | return(0); |
| 907 | 907 | } |
| 908 | 908 | |
| 909 | static void tmnt2_put_word(UINT32 addr, UINT16 data) | |
| 909 | static void tmnt2_put_word(running_machine *machine, UINT32 addr, UINT16 data) | |
| 910 | 910 | { |
| 911 | 911 | UINT32 offs; |
| 912 | 912 | if (addr >= 0x180000/2 && addr <= 0x183fff/2) |
| r1877 | r1878 | |
| 916 | 916 | if (!(offs & 0x0031)) |
| 917 | 917 | { |
| 918 | 918 | offs = ((offs & 0x000e) >> 1) | ((offs & 0x1fc0) >> 3); |
| 919 | K053245_word_w(offs, data, 0); | |
| 919 | K053245_word_w(machine, offs, data, 0); | |
| 920 | 920 | } |
| 921 | 921 | } |
| 922 | 922 | else if (addr >= 0x104000/2 && addr <= 0x107fff/2) sunset_104000[addr-0x104000/2] = data; |
| r1877 | r1878 | |
| 1031 | 1031 | xoffs += xmod; |
| 1032 | 1032 | yoffs += ymod; |
| 1033 | 1033 | |
| 1034 | tmnt2_put_word(dst_addr + 0, attr1); | |
| 1035 | tmnt2_put_word(dst_addr + 2, code); | |
| 1036 | tmnt2_put_word(dst_addr + 4, (UINT32)yoffs); | |
| 1037 | tmnt2_put_word(dst_addr + 6, (UINT32)xoffs); | |
| 1038 | tmnt2_put_word(dst_addr + 12, attr2 | color); | |
| 1034 | tmnt2_put_word(machine, dst_addr + 0, attr1); | |
| 1035 | tmnt2_put_word(machine, dst_addr + 2, code); | |
| 1036 | tmnt2_put_word(machine, dst_addr + 4, (UINT32)yoffs); | |
| 1037 | tmnt2_put_word(machine, dst_addr + 6, (UINT32)xoffs); | |
| 1038 | tmnt2_put_word(machine, dst_addr + 12, attr2 | color); | |
| 1039 | 1039 | } |
| 1040 | 1040 | #else // for reference; do not remove |
| 1041 | 1041 | static WRITE16_HANDLER( tmnt2_1c0800_w ) |
| r1877 | r1878 | |
| 1295 | 1295 | |
| 1296 | 1296 | static READ8_HANDLER( K054539_0_ctrl_r ) |
| 1297 | 1297 | { |
| 1298 | return K054539_0_r(0x200+offset); | |
| 1298 | return K054539_0_r(machine,0x200+offset); | |
| 1299 | 1299 | } |
| 1300 | 1300 | static WRITE8_HANDLER( K054539_0_ctrl_w ) |
| 1301 | 1301 | { |
| 1302 | K054539_0_w(0x200+offset,data); | |
| 1302 | K054539_0_w(machine,0x200+offset,data); | |
| 1303 | 1303 | } |
| 1304 | 1304 | |
| 1305 | 1305 | static ADDRESS_MAP_START( prmrsocr_audio_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 2329 | 2329 | /* basic machine hardware */ |
| 2330 | 2330 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz */ |
| 2331 | 2331 | MDRV_CPU_PROGRAM_MAP(cuebrick_main_map,0) |
| 2332 | MDRV_CPU_VBLANK_INT(cuebrick_interrupt,10) | |
| 2332 | MDRV_CPU_VBLANK_INT_HACK(cuebrick_interrupt,10) | |
| 2333 | 2333 | |
| 2334 | 2334 | /* video hardware */ |
| 2335 | 2335 | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS | VIDEO_UPDATE_AFTER_VBLANK) |
| r1877 | r1878 | |
| 2362 | 2362 | /* basic machine hardware */ |
| 2363 | 2363 | MDRV_CPU_ADD(M68000, XTAL_24MHz/3) |
| 2364 | 2364 | MDRV_CPU_PROGRAM_MAP(mia_main_map,0) |
| 2365 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 2365 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 2366 | 2366 | |
| 2367 | 2367 | MDRV_CPU_ADD(Z80, XTAL_3_579545MHz) |
| 2368 | 2368 | MDRV_CPU_PROGRAM_MAP(mia_audio_map,0) |
| r1877 | r1878 | |
| 2399 | 2399 | static MACHINE_RESET( tmnt ) |
| 2400 | 2400 | { |
| 2401 | 2401 | /* the UPD7759 control flip-flops are cleared: /ST is 1, /RESET is 0 */ |
| 2402 | upd7759_0_start_w(0, 0); | |
| 2403 | upd7759_0_reset_w(0, 1); | |
| 2402 | upd7759_0_start_w(machine, 0, 0); | |
| 2403 | upd7759_0_reset_w(machine, 0, 1); | |
| 2404 | 2404 | } |
| 2405 | 2405 | |
| 2406 | 2406 | static MACHINE_DRIVER_START( tmnt ) |
| r1877 | r1878 | |
| 2408 | 2408 | /* basic machine hardware */ |
| 2409 | 2409 | MDRV_CPU_ADD(M68000, XTAL_24MHz/3) |
| 2410 | 2410 | MDRV_CPU_PROGRAM_MAP(tmnt_main_map,0) |
| 2411 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 2411 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 2412 | 2412 | |
| 2413 | 2413 | MDRV_CPU_ADD(Z80, XTAL_3_579545MHz) |
| 2414 | 2414 | MDRV_CPU_PROGRAM_MAP(tmnt_audio_map,0) |
| r1877 | r1878 | |
| 2457 | 2457 | /* basic machine hardware */ |
| 2458 | 2458 | MDRV_CPU_ADD(M68000, XTAL_24MHz/2) |
| 2459 | 2459 | MDRV_CPU_PROGRAM_MAP(punkshot_main_map,0) |
| 2460 | MDRV_CPU_VBLANK_INT(punkshot_interrupt | |
| 2460 | MDRV_CPU_VBLANK_INT("main", punkshot_interrupt | |
| 2461 | 2461 | |
| 2462 | 2462 | MDRV_CPU_ADD(Z80, XTAL_3_579545MHz) |
| 2463 | 2463 | MDRV_CPU_PROGRAM_MAP(punkshot_audio_map,0) |
| r1877 | r1878 | |
| 2496 | 2496 | /* basic machine hardware */ |
| 2497 | 2497 | MDRV_CPU_ADD(M68000, XTAL_24MHz/2) |
| 2498 | 2498 | MDRV_CPU_PROGRAM_MAP(lgtnfght_main_map,0) |
| 2499 | MDRV_CPU_VBLANK_INT(lgtnfght_interrupt | |
| 2499 | MDRV_CPU_VBLANK_INT("main", lgtnfght_interrupt | |
| 2500 | 2500 | |
| 2501 | 2501 | MDRV_CPU_ADD(Z80, XTAL_3_579545MHz) |
| 2502 | 2502 | MDRV_CPU_PROGRAM_MAP(lgtnfght_audio_map,0) |
| r1877 | r1878 | |
| 2535 | 2535 | /* basic machine hardware */ |
| 2536 | 2536 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 2537 | 2537 | MDRV_CPU_PROGRAM_MAP(blswhstl_main_map,0) |
| 2538 | MDRV_CPU_VBLANK_INT(punkshot_interrupt | |
| 2538 | MDRV_CPU_VBLANK_INT("main", punkshot_interrupt | |
| 2539 | 2539 | |
| 2540 | 2540 | MDRV_CPU_ADD(Z80, XTAL_3_579545MHz) |
| 2541 | 2541 | MDRV_CPU_PROGRAM_MAP(ssriders_audio_map,0) |
| r1877 | r1878 | |
| 2595 | 2595 | /* basic machine hardware */ |
| 2596 | 2596 | MDRV_CPU_ADD(M68000, 12000000) /* ? */ |
| 2597 | 2597 | MDRV_CPU_PROGRAM_MAP(glfgreat_main_map,0) |
| 2598 | MDRV_CPU_VBLANK_INT(lgtnfght_interrupt | |
| 2598 | MDRV_CPU_VBLANK_INT("main", lgtnfght_interrupt | |
| 2599 | 2599 | |
| 2600 | 2600 | MDRV_CPU_ADD(Z80, XTAL_3_579545MHz) |
| 2601 | 2601 | MDRV_CPU_PROGRAM_MAP(glfgreat_audio_map,0) |
| r1877 | r1878 | |
| 2644 | 2644 | /* basic machine hardware */ |
| 2645 | 2645 | MDRV_CPU_ADD(M68000, 12000000) /* ? */ |
| 2646 | 2646 | MDRV_CPU_PROGRAM_MAP(prmrsocr_main_map,0) |
| 2647 | MDRV_CPU_VBLANK_INT(lgtnfght_interrupt | |
| 2647 | MDRV_CPU_VBLANK_INT("main", lgtnfght_interrupt | |
| 2648 | 2648 | |
| 2649 | 2649 | MDRV_CPU_ADD(Z80, 8000000) |
| 2650 | 2650 | /* audio CPU */ /* ? */ |
| r1877 | r1878 | |
| 2684 | 2684 | /* basic machine hardware */ |
| 2685 | 2685 | MDRV_CPU_ADD(M68000, XTAL_32MHz/2) |
| 2686 | 2686 | MDRV_CPU_PROGRAM_MAP(tmnt2_main_map,0) |
| 2687 | MDRV_CPU_VBLANK_INT(punkshot_interrupt | |
| 2687 | MDRV_CPU_VBLANK_INT("main", punkshot_interrupt | |
| 2688 | 2688 | |
| 2689 | 2689 | MDRV_CPU_ADD(Z80, 8000000) |
| 2690 | 2690 | /* audio CPU */ /* 8 MHz; clock is correct, but there's 1 cycle wait for ROM/RAM */ |
| r1877 | r1878 | |
| 2731 | 2731 | /* basic machine hardware */ |
| 2732 | 2732 | MDRV_CPU_ADD(M68000, XTAL_32MHz/2) |
| 2733 | 2733 | MDRV_CPU_PROGRAM_MAP(ssriders_main_map,0) |
| 2734 | MDRV_CPU_VBLANK_INT(punkshot_interrupt | |
| 2734 | MDRV_CPU_VBLANK_INT("main", punkshot_interrupt | |
| 2735 | 2735 | |
| 2736 | 2736 | MDRV_CPU_ADD(Z80, 4000000) |
| 2737 | 2737 | /* audio CPU */ /* ????? makes the ROM test sync */ |
| r1877 | r1878 | |
| 2774 | 2774 | /* basic machine hardware */ |
| 2775 | 2775 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 2776 | 2776 | MDRV_CPU_PROGRAM_MAP(sunsetbl_main_map,0) |
| 2777 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 2777 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 2778 | 2778 | |
| 2779 | 2779 | MDRV_NVRAM_HANDLER(eeprom) |
| 2780 | 2780 | |
| r1877 | r1878 | |
| 2807 | 2807 | /* basic machine hardware */ |
| 2808 | 2808 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 2809 | 2809 | MDRV_CPU_PROGRAM_MAP(thndrx2_main_map,0) |
| 2810 | MDRV_CPU_VBLANK_INT(punkshot_interrupt | |
| 2810 | MDRV_CPU_VBLANK_INT("main", punkshot_interrupt | |
| 2811 | 2811 | |
| 2812 | 2812 | MDRV_CPU_ADD(Z80, XTAL_3_579545MHz) |
| 2813 | 2813 | MDRV_CPU_PROGRAM_MAP(thndrx2_audio_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 1208 | 1208 | static MACHINE_RESET( namcos12 ) |
| 1209 | 1209 | { |
| 1210 | 1210 | psx_machine_init(); |
| 1211 | bankoffset_w(0,0,0); | |
| 1211 | bankoffset_w(machine,0,0,0); | |
| 1212 | 1212 | |
| 1213 | 1213 | if( strcmp( machine->gamedrv->name, "tektagt" ) == 0 || |
| 1214 | 1214 | strcmp( machine->gamedrv->name, "tektagta" ) == 0 || |
| r1877 | r1878 | |
| 1476 | 1476 | /* basic machine hardware */ |
| 1477 | 1477 | MDRV_CPU_ADD( PSXCPU, XTAL_100MHz ) |
| 1478 | 1478 | MDRV_CPU_PROGRAM_MAP( namcos12_map, 0 ) |
| 1479 | MDRV_CPU_VBLANK_INT( psx_vblank | |
| 1479 | MDRV_CPU_VBLANK_INT("main", psx_vblank | |
| 1480 | 1480 | |
| 1481 | 1481 | MDRV_CPU_ADD(H83002, 14745600 ) /* verified 14.7456 MHz */ |
| 1482 | 1482 | MDRV_CPU_PROGRAM_MAP( s12h8rwmap, 0 ) |
| 1483 | 1483 | MDRV_CPU_IO_MAP( s12h8iomap, 0 ) |
| 1484 | MDRV_CPU_VBLANK_INT( irq1_line_pulse | |
| 1484 | MDRV_CPU_VBLANK_INT("main", irq1_line_pulse | |
| 1485 | 1485 | |
| 1486 | 1486 | MDRV_MACHINE_RESET( namcos12 ) |
| 1487 | 1487 | MDRV_NVRAM_HANDLER( at28c16_0 ) |
| r1877 | r1878 | |
|---|---|---|
| 75 | 75 | |
| 76 | 76 | /* SPRITE DRAWING (move to video file) */ |
| 77 | 77 | |
| 78 | static void draw_sprites(running_machine *machine, | |
| 78 | static void draw_sprites(running_machine *machine, | |
| 79 | 79 | { |
| 80 | 80 | const UINT16 *source = spriteram16 + 0x1000/2 - 4; |
| 81 | 81 | const UINT16 *finish = spriteram16; |
| r1877 | r1878 | |
| 1181 | 1181 | /* basic machine hardware */ |
| 1182 | 1182 | MDRV_CPU_ADD(V30,XTAL_32MHz/2) /* verified on pcb */ |
| 1183 | 1183 | MDRV_CPU_PROGRAM_MAP(raiden2_mem, 0) |
| 1184 | MDRV_CPU_VBLANK_INT(raiden2_interrupt | |
| 1184 | MDRV_CPU_VBLANK_INT("main", raiden2_interrupt | |
| 1185 | 1185 | |
| 1186 | 1186 | MDRV_MACHINE_RESET(raiden2) |
| 1187 | 1187 | |
| r1877 | r1878 | |
| 2097 | 2097 | } |
| 2098 | 2098 | static READ16_HANDLER( rdx_v33_oki_r ) |
| 2099 | 2099 | { |
| 2100 | return OKIM6295_status_0_r(0); | |
| 2100 | return OKIM6295_status_0_r(machine,0); | |
| 2101 | 2101 | } |
| 2102 | 2102 | |
| 2103 | 2103 | static WRITE16_HANDLER( rdx_v33_oki_w ) |
| 2104 | 2104 | { |
| 2105 | if (ACCESSING_LSB) OKIM6295_data_0_w(0, data & 0x00ff); | |
| 2105 | if (ACCESSING_LSB) OKIM6295_data_0_w(machine, 0, data & 0x00ff); | |
| 2106 | 2106 | if (ACCESSING_MSB) logerror("rdx_v33_oki_w MSB %04x\n",data); |
| 2107 | 2107 | } |
| 2108 | 2108 | |
| r1877 | r1878 | |
| 2237 | 2237 | /* basic machine hardware */ |
| 2238 | 2238 | MDRV_CPU_ADD(V33, 32000000/2 ) // ? |
| 2239 | 2239 | MDRV_CPU_PROGRAM_MAP(rdx_v33_map, 0) |
| 2240 | MDRV_CPU_VBLANK_INT(rdx_v33_interrupt | |
| 2240 | MDRV_CPU_VBLANK_INT("main", rdx_v33_interrupt | |
| 2241 | 2241 | |
| 2242 | 2242 | MDRV_NVRAM_HANDLER(rdx_v33) |
| 2243 | 2243 |
| r1877 | r1878 | |
|---|---|---|
| 19 | 19 | ***************************************************************************/ |
| 20 | 20 | |
| 21 | 21 | #include "driver.h" |
| 22 | #include "deprecat.h" | |
| 22 | 23 | #include "sound/ay8910.h" |
| 23 | 24 | #include "includes/espial.h" |
| 24 | 25 | |
| r1877 | r1878 | |
| 48 | 49 | /* Bit 2 - ???? */ |
| 49 | 50 | } |
| 50 | 51 | |
| 51 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 52 | AM_RANGE(0x0000, 0x4fff) AM_READ(MRA8_ROM) | |
| 53 | AM_RANGE(0x5800, 0x5fff) AM_READ(MRA8_RAM) | |
| 54 | AM_RANGE(0x6081, 0x6081) AM_READ(input_port_0_r) | |
| 52 | ||
| 53 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 54 | AM_RANGE(0x0000, 0x4fff) AM_ROM | |
| 55 | AM_RANGE(0x5800, 0x5fff) AM_RAM | |
| 56 | AM_RANGE(0x6081, 0x6081) AM_READWRITE(input_port_0_r, zodiack_control_w) | |
| 55 | 57 | AM_RANGE(0x6082, 0x6082) AM_READ(input_port_1_r) |
| 56 | 58 | AM_RANGE(0x6083, 0x6083) AM_READ(input_port_2_r) |
| 57 | 59 | AM_RANGE(0x6084, 0x6084) AM_READ(input_port_3_r) |
| 58 | AM_RANGE(0x6090, 0x6090) AM_READ(soundlatch_r) | |
| 59 | AM_RANGE(0x7000, 0x7000) AM_READ(MRA8_NOP) /* ??? */ | |
| 60 | AM_RANGE(0x9000, 0x93ff) AM_READ(MRA8_RAM) | |
| 61 | AM_RANGE(0xa000, 0xa3ff) AM_READ(MRA8_RAM) | |
| 62 | AM_RANGE(0xb000, 0xb3ff) AM_READ(MRA8_RAM) | |
| 63 | AM_RANGE(0xc000, 0xcfff) AM_READ(MRA8_ROM) | |
| 64 | ADDRESS_MAP_END | |
| 65 | ||
| 66 | ||
| 67 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 68 | AM_RANGE(0x0000, 0x4fff) AM_WRITE(MWA8_ROM) | |
| 69 | AM_RANGE(0x5800, 0x5fff) AM_WRITE(MWA8_RAM) | |
| 70 | AM_RANGE(0x6081, 0x6081) AM_WRITE(zodiack_control_w) | |
| 71 | AM_RANGE(0x6090, 0x6090) AM_WRITE(zodiac_master_soundlatch_w) | |
| 72 | AM_RANGE(0x7000, 0x7000) AM_WRITE(watchdog_reset_w) | |
| 60 | AM_RANGE(0x6090, 0x6090) AM_READWRITE(soundlatch_r, zodiac_master_soundlatch_w) | |
| 61 | AM_RANGE(0x7000, 0x7000) AM_READWRITE(MRA8_NOP,watchdog_reset_w) /* NOP??? */ | |
| 73 | 62 | AM_RANGE(0x7100, 0x7100) AM_WRITE(zodiac_master_interrupt_enable_w) |
| 74 | 63 | AM_RANGE(0x7200, 0x7200) AM_WRITE(zodiack_flipscreen_w) |
| 75 | AM_RANGE(0x9000, 0x903f) AM_WRITE(zodiack_attributes_w) AM_BASE(&zodiack_attributesram) | |
| 76 | AM_RANGE(0x9040, 0x905f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 77 | AM_RANGE(0x9060, 0x907f) AM_WRITE(MWA8_RAM) AM_BASE(&zodiack_bulletsram) AM_SIZE(&zodiack_bulletsram_size) | |
| 78 | AM_RANGE(0x9080, 0x93ff) AM_WRITE(MWA8_RAM) | |
| 79 | AM_RANGE(0xa000, 0xa3ff) AM_WRITE(zodiack_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 80 | AM_RANGE(0xb000, 0xb3ff) AM_WRITE(zodiack_videoram2_w) AM_BASE(&zodiack_videoram2) | |
| 81 | AM_RANGE(0xc000, 0xcfff) AM_WRITE(MWA8_ROM) | |
| 64 | AM_RANGE(0x9000, 0x903f) AM_READWRITE(MRA8_RAM, zodiack_attributes_w) AM_BASE(&zodiack_attributesram) | |
| 65 | AM_RANGE(0x9040, 0x905f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 66 | AM_RANGE(0x9060, 0x907f) AM_RAM AM_BASE(&zodiack_bulletsram) AM_SIZE(&zodiack_bulletsram_size) | |
| 67 | AM_RANGE(0x9080, 0x93ff) AM_RAM | |
| 68 | AM_RANGE(0xa000, 0xa3ff) AM_READWRITE(MRA8_RAM, zodiack_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 69 | AM_RANGE(0xb000, 0xb3ff) AM_READWRITE(MRA8_RAM, zodiack_videoram2_w) AM_BASE(&zodiack_videoram2) | |
| 70 | AM_RANGE(0xc000, 0xcfff) AM_ROM | |
| 82 | 71 | ADDRESS_MAP_END |
| 83 | 72 | |
| 84 | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 85 | AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_ROM) | |
| 86 | AM_RANGE(0x2000, 0x23ff) AM_READ(MRA8_RAM) | |
| 87 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) | |
| 88 | ADDRESS_MAP_END | |
| 89 | ||
| 90 | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 91 | AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_ROM) | |
| 92 | AM_RANGE(0x2000, 0x23ff) AM_WRITE(MWA8_RAM) | |
| 73 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 74 | AM_RANGE(0x0000, 0x1fff) AM_ROM | |
| 75 | AM_RANGE(0x2000, 0x23ff) AM_RAM | |
| 93 | 76 | AM_RANGE(0x4000, 0x4000) AM_WRITE(espial_sound_nmi_enable_w) |
| 94 | AM_RANGE(0x6000, 0x6000) AM_WRITE(soundlatch_w) | |
| 77 | AM_RANGE(0x6000, 0x6000) AM_READWRITE(soundlatch_r, soundlatch_w) | |
| 95 | 78 | ADDRESS_MAP_END |
| 96 | 79 | |
| 97 | static ADDRESS_MAP_START( | |
| 80 | static ADDRESS_MAP_START( io | |
| 98 | 81 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 99 | 82 | AM_RANGE(0x00, 0x00) AM_WRITE(AY8910_control_port_0_w) |
| 100 | 83 | AM_RANGE(0x01, 0x01) AM_WRITE(AY8910_write_port_0_w) |
| r1877 | r1878 | |
| 475 | 458 | |
| 476 | 459 | /* basic machine hardware */ |
| 477 | 460 | MDRV_CPU_ADD(Z80, 4000000) /* 4.00 MHz??? */ |
| 478 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 479 | MDRV_CPU_VBLANK_INT(zodiac_master_interrupt,2) | |
| 461 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 462 | MDRV_CPU_VBLANK_INT_HACK(zodiac_master_interrupt,2) | |
| 480 | 463 | |
| 481 | 464 | MDRV_CPU_ADD(Z80, 14318000/8) /* 1.78975 MHz??? */ |
| 482 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) | |
| 483 | MDRV_CPU_IO_MAP(0,sound_writeport) | |
| 484 | MDRV_CPU_VBLANK_INT(espial_sound_nmi_gen,8) /* IRQs are triggered by the main CPU */ | |
| 465 | MDRV_CPU_PROGRAM_MAP(sound_map,0) | |
| 466 | MDRV_CPU_IO_MAP(io_map,0) | |
| 467 | MDRV_CPU_VBLANK_INT_HACK(espial_sound_nmi_gen,8) /* IRQs are triggered by the main CPU */ | |
| 485 | 468 | |
| 486 | 469 | MDRV_MACHINE_RESET(zodiack) |
| 487 | 470 |
| r1877 | r1878 | |
|---|---|---|
| 212 | 212 | |
| 213 | 213 | static READ8_HANDLER(mars_ppi8255_0_r) |
| 214 | 214 | { |
| 215 | return ppi8255_0_r(((offset >> 2) & 0x02) | ((offset >> 1) & 0x01)); | |
| 215 | return ppi8255_0_r(machine, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01)); | |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | static READ8_HANDLER(mars_ppi8255_1_r) |
| 219 | 219 | { |
| 220 | return ppi8255_1_r(((offset >> 2) & 0x02) | ((offset >> 1) & 0x01)); | |
| 220 | return ppi8255_1_r(machine, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01)); | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | static WRITE8_HANDLER(mars_ppi8255_0_w) |
| 224 | 224 | { |
| 225 | ppi8255_0_w(((offset >> 2) & 0x02) | ((offset >> 1) & 0x01), data); | |
| 225 | ppi8255_0_w(machine, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01), data); | |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | static WRITE8_HANDLER(mars_ppi8255_1_w) |
| 229 | 229 | { |
| 230 | ppi8255_1_w(((offset >> 2) & 0x02) | ((offset >> 1) & 0x01), data); | |
| 230 | ppi8255_1_w(machine, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01), data); | |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | |
| r1877 | r1878 | |
| 505 | 505 | |
| 506 | 506 | static READ8_HANDLER(frogf_ppi8255_0_r) |
| 507 | 507 | { |
| 508 | return ppi8255_0_r(offset >> 3); | |
| 508 | return ppi8255_0_r(machine, offset >> 3); | |
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 | static READ8_HANDLER(frogf_ppi8255_1_r) |
| 512 | 512 | { |
| 513 | return ppi8255_1_r(offset >> 3); | |
| 513 | return ppi8255_1_r(machine, offset >> 3); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | static WRITE8_HANDLER(frogf_ppi8255_0_w) |
| 517 | 517 | { |
| 518 | ppi8255_0_w(offset >> 3, data); | |
| 518 | ppi8255_0_w(machine, offset >> 3, data); | |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | static WRITE8_HANDLER(frogf_ppi8255_1_w) |
| 522 | 522 | { |
| 523 | ppi8255_1_w(offset >> 3, data); | |
| 523 | ppi8255_1_w(machine, offset >> 3, data); | |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | static ADDRESS_MAP_START( frogf_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 2406 | 2406 | MDRV_CPU_REPLACE("main", S2650, 18432000/6) |
| 2407 | 2407 | MDRV_CPU_PROGRAM_MAP(hunchbks_readmem,hunchbks_writemem) |
| 2408 | 2408 | MDRV_CPU_IO_MAP(hunchbks_readport,0) |
| 2409 | MDRV_CPU_VBLANK_INT(hunchbks_vh_interrupt | |
| 2409 | MDRV_CPU_VBLANK_INT("main", hunchbks_vh_interrupt | |
| 2410 | 2410 | |
| 2411 | 2411 | MDRV_SCREEN_MODIFY("main") |
| 2412 | 2412 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) |
| r1877 | r1878 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | static WRITE8_HANDLER(dac_w) |
| 101 | 101 | { |
| 102 | DAC_0_data_w(0, data & 0xf0 ); /* left */ | |
| 103 | DAC_1_data_w(0, (data & 0x0f)<<4 ); /* right */ | |
| 102 | DAC_0_data_w(machine, 0, data & 0xf0 ); /* left */ | |
| 103 | DAC_1_data_w(machine, 0, (data & 0x0f)<<4 ); /* right */ | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
| r1877 | r1878 | |
| 214 | 214 | MDRV_CPU_ADD(Z80,3000000) /* 3 MHz */ |
| 215 | 215 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 216 | 216 | MDRV_CPU_IO_MAP(readport,writeport) |
| 217 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 217 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 218 | 218 | |
| 219 | 219 | MDRV_GFXDECODE(mogura) |
| 220 | 220 |
| r1877 | r1878 | |
|---|---|---|
| 197 | 197 | // basic machine hardware |
| 198 | 198 | MDRV_CPU_ADD(M6502, 4000000) // ??? |
| 199 | 199 | MDRV_CPU_PROGRAM_MAP(mole_map, 0) |
| 200 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 200 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 201 | 201 | |
| 202 | 202 | // video hardware |
| 203 | 203 |
| r1877 | r1878 | |
|---|---|---|
| 75 | 75 | void fd1094_driver_init(void (*set_decrypted)(UINT8 *)); |
| 76 | 76 | |
| 77 | 77 | /* video/segac2.c */ |
| 78 | extern void update_system18_vdp( | |
| 78 | extern void update_system18_vdp( | |
| 79 | 79 | extern void start_system18_vdp(void); |
| 80 | 80 | extern READ16_HANDLER( segac2_vdp_r ); |
| 81 | 81 | extern WRITE16_HANDLER( segac2_vdp_w ); |
| r1877 | r1878 | |
| 195 | 195 | |
| 196 | 196 | static WRITE16_HANDLER( sound_command_irq_w ){ |
| 197 | 197 | if( ACCESSING_LSB ){ |
| 198 | soundlatch_w( 0,data&0xff ); | |
| 199 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE ); | |
| 198 | soundlatch_w( machine,0,data&0xff ); | |
| 199 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE ); | |
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | |
| r1877 | r1878 | |
| 339 | 339 | |
| 340 | 340 | static WRITE16_HANDLER( sound_command_nmi_w ){ |
| 341 | 341 | if( ACCESSING_LSB ){ |
| 342 | soundlatch_w( 0,data&0xff ); | |
| 343 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 342 | soundlatch_w( machine,0,data&0xff ); | |
| 343 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 344 | 344 | } |
| 345 | 345 | } |
| 346 | 346 | |
| r1877 | r1878 | |
| 1119 | 1119 | |
| 1120 | 1120 | /* basic machine hardware */ |
| 1121 | 1121 | MDRV_CPU_ADD_TAG("main", M68000, 10000000) |
| 1122 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 1122 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 1123 | 1123 | |
| 1124 | 1124 | MDRV_CPU_ADD_TAG("sound", Z80, 8000000) |
| 1125 | 1125 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 1081 | 1081 | |
| 1082 | 1082 | /*****************************************************************************/ |
| 1083 | 1083 | |
| 1084 | #ifdef UNUSED_DEFINITION | |
| 1084 | 1085 | static INPUT_PORTS_START( taitojc ) |
| 1085 | 1086 | PORT_START |
| 1086 | 1087 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_COIN4) |
| r1877 | r1878 | |
| 1114 | 1115 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON8) |
| 1115 | 1116 | |
| 1116 | 1117 | INPUT_PORTS_END |
| 1118 | #endif | |
| 1117 | 1119 | |
| 1118 | 1120 | static INPUT_PORTS_START( dendeg ) |
| 1119 | 1121 | PORT_START |
| r1877 | r1878 | |
| 1271 | 1273 | static MACHINE_DRIVER_START( taitojc ) |
| 1272 | 1274 | MDRV_CPU_ADD(M68040, 25000000) |
| 1273 | 1275 | MDRV_CPU_PROGRAM_MAP(taitojc_map, 0) |
| 1274 | MDRV_CPU_VBLANK_INT(taitojc_vblank | |
| 1276 | MDRV_CPU_VBLANK_INT("main", taitojc_vblank | |
| 1275 | 1277 | MDRV_CPU_PERIODIC_INT(taitojc_int6, 1000) |
| 1276 | 1278 | |
| 1277 | 1279 | TAITO_F3_SOUND_SYSTEM_CPU(16000000) |
| r1877 | r1878 | |
|---|---|---|
| 368 | 368 | // basic machine hardware |
| 369 | 369 | MDRV_CPU_ADD(Z80, MAIN_XTAL/4) // 6 MHz |
| 370 | 370 | MDRV_CPU_PROGRAM_MAP(master_map, 0) |
| 371 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 371 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 372 | 372 | |
| 373 | 373 | MDRV_CPU_ADD(Z80, MAIN_XTAL/4) // 6 MHz |
| 374 | 374 | MDRV_CPU_PROGRAM_MAP(slave_map, 0) |
| 375 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 375 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 376 | 376 | |
| 377 | 377 | MDRV_CPU_ADD(Z80, MAIN_XTAL/8) |
| 378 | 378 | /* audio CPU */ // 3 MHz |
| 379 | 379 | MDRV_CPU_PROGRAM_MAP(sound_map, 0) |
| 380 | // MDRV_CPU_VBLANK_INT(irq0_line_hold, 1) | |
| 381 | MDRV_CPU_VBLANK_INT(missb2_interrupt, 1) | |
| 380 | // MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 381 | MDRV_CPU_VBLANK_INT("main", missb2_interrupt) | |
| 382 | 382 | |
| 383 | 383 | MDRV_INTERLEAVE(100) // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs |
| 384 | 384 |
| r1877 | r1878 | |
|---|---|---|
| 286 | 286 | static MACHINE_DRIVER_START( pitnrun ) |
| 287 | 287 | MDRV_CPU_ADD(Z80,8000000/2) /* ? MHz */ |
| 288 | 288 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 289 | MDRV_CPU_VBLANK_INT(pitnrun_nmi_source | |
| 289 | MDRV_CPU_VBLANK_INT("main", pitnrun_nmi_source | |
| 290 | 290 | |
| 291 | 291 | MDRV_CPU_ADD(Z80, 10000000/4) /* 2.5 MHz */ |
| 292 | 292 | |
| 293 | 293 | /* audio CPU */ |
| 294 | 294 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 295 | 295 | MDRV_CPU_IO_MAP(sound_readport,sound_writeport) |
| 296 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 296 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 297 | 297 | |
| 298 | 298 | MDRV_CPU_ADD(M68705,3000000) |
| 299 | 299 | MDRV_CPU_PROGRAM_MAP(mcu_readmem,mcu_writemem) |
| r1877 | r1878 | |
| 319 | 319 | /* sound hardware */ |
| 320 | 320 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 321 | 321 | |
| 322 | MDRV_SOUND_ADD(AY8910, 18432 | |
| 322 | MDRV_SOUND_ADD(AY8910, XTAL_18_432MHz/12) /* verified on pcb */ | |
| 323 | 323 | MDRV_SOUND_CONFIG(ay8910_interface) |
| 324 | 324 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 325 | 325 | |
| 326 | MDRV_SOUND_ADD(AY8910, 18432 | |
| 326 | MDRV_SOUND_ADD(AY8910, XTAL_18_432MHz/12) /* verified on pcb */ | |
| 327 | 327 | MDRV_SOUND_CONFIG(ay8910_interface) |
| 328 | 328 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 329 | 329 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
|---|---|---|
| 189 | 189 | static MACHINE_DRIVER_START( ddealer ) |
| 190 | 190 | MDRV_CPU_ADD_TAG("main" , M68000, 10000000) |
| 191 | 191 | MDRV_CPU_PROGRAM_MAP(ddealer,0) |
| 192 | MDRV_CPU_VBLANK_INT(ddealer_interrupt | |
| 192 | MDRV_CPU_VBLANK_INT("main", ddealer_interrupt | |
| 193 | 193 | MDRV_CPU_PERIODIC_INT(irq1_line_hold, 112) |
| 194 | 194 | |
| 195 | 195 | MDRV_GFXDECODE(jalmah) |
| r1877 | r1878 | |
|---|---|---|
| 134 | 134 | ******************************************************************************************/ |
| 135 | 135 | |
| 136 | 136 | #include "driver.h" |
| 137 | #include "deprecat.h" | |
| 137 | 138 | #include "machine/atari_vg.h" |
| 138 | 139 | #include "sound/pokey.h" |
| 139 | 140 | #include "liberatr.h" |
| r1877 | r1878 | |
| 383 | 384 | /* basic machine hardware */ |
| 384 | 385 | MDRV_CPU_ADD_TAG("main", M6502, MASTER_CLOCK/16) /* 1.25Mhz divided from 20Mhz master clock */ |
| 385 | 386 | MDRV_CPU_PROGRAM_MAP(liberatr_map,0) |
| 386 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 387 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 387 | 388 | |
| 388 | 389 | MDRV_NVRAM_HANDLER(atari_vg) |
| 389 | 390 |
| r1877 | r1878 | |
|---|---|---|
| 521 | 521 | |
| 522 | 522 | /* offset 6 writes to the sfxcontrol latch */ |
| 523 | 523 | case 6: |
| 524 | exidy_sfxctrl_w(data >> 6, data); | |
| 524 | exidy_sfxctrl_w(machine, data >> 6, data); | |
| 525 | 525 | break; |
| 526 | 526 | |
| 527 | 527 | /* everything else writes to the 6840 */ |
| 528 | 528 | default: |
| 529 | exidy_sh6840_w(offset, data); | |
| 529 | exidy_sh6840_w(machine, offset, data); | |
| 530 | 530 | break; |
| 531 | 531 | |
| 532 | 532 | } |
| r1877 | r1878 | |
| 543 | 543 | static SOUND_RESET(berzerk) |
| 544 | 544 | { |
| 545 | 545 | /* clears the flip-flop controlling the volume and freq on the speech chip */ |
| 546 | berzerk_audio_w(4, 0x40); | |
| 546 | berzerk_audio_w(machine, 4, 0x40); | |
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 |
| r1877 | r1878 | |
|---|---|---|
| 165 | 165 | |
| 166 | 166 | static WRITE8_HANDLER( sound_command_w ) |
| 167 | 167 | { |
| 168 | soundlatch_w(offset,data); | |
| 169 | cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 168 | soundlatch_w(machine,offset,data); | |
| 169 | cpunum_set_input_line(machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | static TIMER_CALLBACK( reset_callback ) |
| r1877 | r1878 | |
| 176 | 176 | |
| 177 | 177 | static WRITE8_HANDLER( sound_answer_w ) |
| 178 | 178 | { |
| 179 | soundlatch2_w(0,data); | |
| 179 | soundlatch2_w(machine,0,data); | |
| 180 | 180 | |
| 181 | 181 | /* in Gridiron, the sound CPU goes in a tight loop after the self test, */ |
| 182 | 182 | /* probably waiting to be reset by a watchdog */ |
| r1877 | r1878 | |
| 661 | 661 | /* basic machine hardware */ |
| 662 | 662 | MDRV_CPU_ADD_TAG("main", Z80, 18432000/4) /* 18.432000 / 4 */ |
| 663 | 663 | MDRV_CPU_PROGRAM_MAP(main_mem,0) |
| 664 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 664 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 665 | 665 | |
| 666 | 666 | MDRV_CPU_ADD(Z80, 18432000/4) |
| 667 | 667 | MDRV_CPU_PROGRAM_MAP(sub_mem,0) |
| 668 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 668 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 669 | 669 | |
| 670 | 670 | MDRV_CPU_ADD(Z80, 18432000/4) |
| 671 | 671 | MDRV_CPU_PROGRAM_MAP(sound_mem,0) |
| 672 | 672 | MDRV_CPU_IO_MAP(sound_port,0) |
| 673 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 673 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 674 | 674 | |
| 675 | 675 | MDRV_INTERLEAVE(10) /* 10 CPU slices per frame - seems enough to keep the CPUs in sync */ |
| 676 | 676 |
| r1877 | r1878 | |
|---|---|---|
| 112 | 112 | static WRITE16_HANDLER( hacked_soundcommand_w ) |
| 113 | 113 | { |
| 114 | 114 | COMBINE_DATA(&soundcommand); |
| 115 | soundlatch_w(0,soundcommand & 0xff); | |
| 115 | soundlatch_w(machine,0,soundcommand & 0xff); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | static READ16_HANDLER( hacked_soundcommand_r ) |
| r1877 | r1878 | |
| 347 | 347 | /* basic machine hardware */ |
| 348 | 348 | MDRV_CPU_ADD(M68000, MASTER_CLOCK / 2) /* 12 MHz - verified in schematics */ |
| 349 | 349 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 350 | MDRV_CPU_VBLANK_INT(bionicc_interrupt,8) | |
| 350 | MDRV_CPU_VBLANK_INT_HACK(bionicc_interrupt,8) | |
| 351 | 351 | |
| 352 | 352 | /* audio CPU */ |
| 353 | 353 | MDRV_CPU_ADD(Z80, EXO3_F0_CLK / 4) /* EXO3 C,B=GND, A=5V ==> Divisor 2^2 */ |
| r1877 | r1878 | |
| 356 | 356 | * schematics indicate that nmi_line is set on M680000 access with AB1=1 |
| 357 | 357 | * and IOCS=0 (active low), see pages A-1/10, A-4/10 in schematics |
| 358 | 358 | */ |
| 359 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,4) | |
| 359 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,4) | |
| 360 | 360 | |
| 361 | 361 | /* video hardware */ |
| 362 | 362 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r1877 | r1878 | |
|---|---|---|
| 209 | 209 | /* basic machine hardware */ |
| 210 | 210 | MDRV_CPU_ADD(M6809, 2048000) /* 2.048 MHz ??? */ |
| 211 | 211 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 212 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 212 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 213 | 213 | |
| 214 | 214 | MDRV_CPU_ADD(M6809, 640000) |
| 215 | 215 | /* audio CPU */ /* 0.640 MHz ??? */ |
| 216 | 216 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| 217 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 217 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 218 | 218 | |
| 219 | 219 | /* video hardware */ |
| 220 | 220 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 355 | 355 | MDRV_CPU_ADD(Z80, 10000000/4) /* just a guess */ |
| 356 | 356 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 357 | 357 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 358 | MDRV_CPU_VBLANK_INT(main_nmi_gen | |
| 358 | MDRV_CPU_VBLANK_INT("main", main_nmi_gen | |
| 359 | 359 | |
| 360 | 360 | MDRV_CPU_ADD(Z80, 10000000/4) /* just a guess */ |
| 361 | 361 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 68 | 68 | { |
| 69 | 69 | if (rambank & 1) |
| 70 | 70 | { |
| 71 | paletteram_xBBBBBGGGGGRRRRR_be_w(offset,data); | |
| 71 | paletteram_xBBBBBGGGGGRRRRR_be_w(machine,offset,data); | |
| 72 | 72 | } |
| 73 | 73 | else if (rambank & 2) |
| 74 | 74 | { |
| r1877 | r1878 | |
| 538 | 538 | /* basic machine hardware */ |
| 539 | 539 | MDRV_CPU_ADD(M6809, 3000000) /* ? */ |
| 540 | 540 | MDRV_CPU_PROGRAM_MAP(spy_readmem,spy_writemem) |
| 541 | MDRV_CPU_VBLANK_INT(spy_interrupt | |
| 541 | MDRV_CPU_VBLANK_INT("main", spy_interrupt | |
| 542 | 542 | |
| 543 | 543 | MDRV_CPU_ADD(Z80, 3579545) |
| 544 | 544 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 311 | 311 | switch(offset) |
| 312 | 312 | { |
| 313 | 313 | case 0x0: return (readinputport(0) << 16) | psikyo_readcoinport(1); |
| 314 | case 0x1: return (((readinputport(2) << 16) | readinputport(3)) & 0xffff000f) | s1945_mcu_r(offset-1, mem_mask); | |
| 315 | case 0x2: return s1945_mcu_r(offset-1, mem_mask); | |
| 314 | case 0x1: return (((readinputport(2) << 16) | readinputport(3)) & 0xffff000f) | s1945_mcu_r(machine, offset-1, mem_mask); | |
| 315 | case 0x2: return s1945_mcu_r(machine, offset-1, mem_mask); | |
| 316 | 316 | default: logerror("PC %06X - Read input %02X !\n", activecpu_get_pc(), offset*2); |
| 317 | 317 | return 0; |
| 318 | 318 | } |
| r1877 | r1878 | |
| 331 | 331 | { |
| 332 | 332 | paletteram16 = (UINT16 *)paletteram32; |
| 333 | 333 | if (ACCESSING_MSW32) |
| 334 | paletteram16_xRRRRRGGGGGBBBBB_word_w(offset*2, data >> 16, mem_mask >> 16); | |
| 334 | paletteram16_xRRRRRGGGGGBBBBB_word_w(machine, offset*2, data >> 16, mem_mask >> 16); | |
| 335 | 335 | if (ACCESSING_LSW32) |
| 336 | paletteram16_xRRRRRGGGGGBBBBB_word_w(offset*2+1, data, mem_mask); | |
| 336 | paletteram16_xRRRRRGGGGGBBBBB_word_w(machine, offset*2+1, data, mem_mask); | |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | static ADDRESS_MAP_START( psikyo_readmem, ADDRESS_SPACE_PROGRAM, 32 ) |
| r1877 | r1878 | |
| 1565 | 1565 | /* basic machine hardware */ |
| 1566 | 1566 | MDRV_CPU_ADD(M68EC020, 16000000) |
| 1567 | 1567 | MDRV_CPU_PROGRAM_MAP(psikyo_readmem,psikyo_writemem) |
| 1568 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 1568 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 1569 | 1569 | |
| 1570 | 1570 | MDRV_CPU_ADD(Z80, 4000000) |
| 1571 | 1571 | /* audio CPU */ /* ? */ |
| r1877 | r1878 | |
| 1619 | 1619 | /* basic machine hardware */ |
| 1620 | 1620 | MDRV_CPU_ADD(M68EC020, 16000000) |
| 1621 | 1621 | MDRV_CPU_PROGRAM_MAP(psikyo_readmem,psikyo_writemem) |
| 1622 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 1622 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 1623 | 1623 | |
| 1624 | 1624 | MDRV_CPU_ADD(Z80, 4000000) /* ! LZ8420M (Z80 core) ! */ |
| 1625 | 1625 | /* audio CPU */ |
| r1877 | r1878 | |
| 1681 | 1681 | /* basic machine hardware */ |
| 1682 | 1682 | MDRV_CPU_ADD(M68EC020, 16000000) |
| 1683 | 1683 | MDRV_CPU_PROGRAM_MAP(psikyo_readmem,psikyo_writemem) |
| 1684 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 1684 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 1685 | 1685 | |
| 1686 | 1686 | MDRV_CPU_ADD(Z80, 4000000) /* ! LZ8420M (Z80 core) ! */ |
| 1687 | 1687 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 496 | 496 | /* watchdog sometimes stop to work */ |
| 497 | 497 | if (( (data >> 3) & 0x01) == 0) /* check for refresh value (0x08h) */ |
| 498 | 498 | { |
| 499 | watchdog_reset | |
| 499 | watchdog_reset | |
| 500 | 500 | // fprintf(stdout,"Watchdog\n"); |
| 501 | 501 | } |
| 502 | 502 | } |
| r1877 | r1878 | |
|---|---|---|
| 60 | 60 | D3 - /Reset |
| 61 | 61 | |
| 62 | 62 | */ |
| 63 | if ((data &7)==7) AY8910_control_port_0_w(0,ay_data); | |
| 64 | if ((data &7)==6) AY8910_write_port_0_w(0,ay_data); | |
| 63 | if ((data &7)==7) AY8910_control_port_0_w(machine,0,ay_data); | |
| 64 | if ((data &7)==6) AY8910_write_port_0_w(machine,0,ay_data); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 |
| r1877 | r1878 | |
|---|---|---|
| 137 | 137 | |
| 138 | 138 | bit = EEPROM_read_bit() << 7; |
| 139 | 139 | |
| 140 | return (input_port_0_r(0) & 0x7f) | bit; | |
| 140 | return (input_port_0_r(machine,0) & 0x7f) | bit; | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | static READ16_HANDLER( hotmind_port2_r ) |
| r1877 | r1878 | |
| 146 | 146 | |
| 147 | 147 | bit = EEPROM_read_bit() << 7; |
| 148 | 148 | |
| 149 | return (input_port_2_r(0) & 0x7f) | bit; | |
| 149 | return (input_port_2_r(machine,0) & 0x7f) | bit; | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | static WRITE16_HANDLER( wbeachvl_coin_eeprom_w ) |
| r1877 | r1878 | |
| 202 | 202 | // logerror("PortB reading %02x from the 68K\n",data); |
| 203 | 203 | } |
| 204 | 204 | else if ((playmark_oki_control & 0x38) == 0x28) { |
| 205 | data = (OKIM6295_status_0_r(0) & 0x0f); | |
| 205 | data = (OKIM6295_status_0_r(machine,0) & 0x0f); | |
| 206 | 206 | // logerror("PortB reading %02x from the OKI status port\n",data); |
| 207 | 207 | } |
| 208 | 208 | |
| r1877 | r1878 | |
| 255 | 255 | 1 Not used |
| 256 | 256 | 0 Not used |
| 257 | 257 | */ |
| 258 | ||
| 259 | 258 | playmark_oki_control = data; |
| 260 | 259 | |
| 261 | 260 | if ((data & 0x38) == 0x18) |
| 262 | 261 | { |
| 263 | 262 | // logerror("Writing %02x to OKI1, PortC=%02x, Code=%02x\n",playmark_oki_command,playmark_oki_control,playmark_snd_command); |
| 264 | OKIM6295_data_0_w(0, playmark_oki_command); | |
| 263 | OKIM6295_data_0_w(machine, 0, playmark_oki_command); | |
| 265 | 264 | } |
| 266 | 265 | } |
| 267 | 266 | |
| r1877 | r1878 | |
| 970 | 969 | /* basic machine hardware */ |
| 971 | 970 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 972 | 971 | MDRV_CPU_PROGRAM_MAP(bigtwin_main_map, 0) |
| 973 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 972 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 974 | 973 | |
| 975 | 974 | MDRV_CPU_ADD(PIC16C57, 12000000) /* 3MHz */ |
| 976 | 975 | /* Program and Data Maps are internal to the MCU */ |
| r1877 | r1878 | |
| 1004 | 1003 | /* basic machine hardware */ |
| 1005 | 1004 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 1006 | 1005 | MDRV_CPU_PROGRAM_MAP(wbeachvl_main_map, 0) |
| 1007 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 1006 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 1008 | 1007 | |
| 1009 | 1008 | // MDRV_CPU_ADD(PIC16C57, 12000000) /* 3MHz */ |
| 1010 | 1009 | /* Program and Data Maps are internal to the MCU */ |
| r1877 | r1878 | |
| 1039 | 1038 | /* basic machine hardware */ |
| 1040 | 1039 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 1041 | 1040 | MDRV_CPU_PROGRAM_MAP(excelsr_main_map, 0) |
| 1042 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 1041 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 1043 | 1042 | |
| 1044 | 1043 | MDRV_CPU_ADD(PIC16C57, 12000000) /* 3MHz */ |
| 1045 | 1044 | /* Program and Data Maps are internal to the MCU */ |
| r1877 | r1878 | |
| 1072 | 1071 | /* basic machine hardware */ |
| 1073 | 1072 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 1074 | 1073 | MDRV_CPU_PROGRAM_MAP(hotmind_main_map, 0) |
| 1075 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 1074 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 1076 | 1075 | |
| 1077 | 1076 | MDRV_CPU_ADD(PIC16C57, 12000000) /* 3MHz */ |
| 1078 | 1077 | /* Program and Data Maps are internal to the MCU */ |
| r1877 | r1878 | |
| 1107 | 1106 | /* basic machine hardware */ |
| 1108 | 1107 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 1109 | 1108 | MDRV_CPU_PROGRAM_MAP(hrdtimes_main_map, 0) |
| 1110 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 1109 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 1111 | 1110 | |
| 1112 | 1111 | // MDRV_CPU_ADD(PIC16C57, 12000000) /* 3MHz */ |
| 1113 | 1112 | /* Program and Data Maps are internal to the MCU */ |
| r1877 | r1878 | |
| 1130 | 1129 | /* sound hardware */ |
| 1131 | 1130 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1132 | 1131 | |
| 1133 | MDRV_SOUND_ADD(OKIM6295, 1000000) | |
| 1134 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) | |
| 1132 | MDRV_SOUND_ADD(OKIM6295, XTAL_1MHz) /* verified on pcb */ | |
| 1133 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) /* verified on pcb */ | |
| 1135 | 1134 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1136 | 1135 | MACHINE_DRIVER_END |
| 1137 | 1136 |
| r1877 | r1878 | |
|---|---|---|
| 261 | 261 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | static void draw_sprites(running_machine *machine, | |
| 264 | static void draw_sprites(running_machine *machine, | |
| 265 | 265 | { |
| 266 | 266 | int offs,code,attr,sx,sy,flipx,flipy; |
| 267 | 267 | |
| r1877 | r1878 | |
| 337 | 337 | MDRV_CPU_ADD(Z80, 4000000) /* ? */ |
| 338 | 338 | MDRV_CPU_PROGRAM_MAP(main_map, 0) |
| 339 | 339 | MDRV_CPU_IO_MAP(main_io_map, 0) |
| 340 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 340 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 341 | 341 | |
| 342 | 342 | MDRV_CPU_ADD(Z80, 4000000) /* ? */ |
| 343 | 343 | MDRV_CPU_PROGRAM_MAP(snd_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 70 | 70 | { |
| 71 | 71 | if (ACCESSING_LSB) |
| 72 | 72 | { |
| 73 | soundlatch_w(0,data & 0xff); | |
| 74 | cpunum_set_input_line(Machine, 1,0,ASSERT_LINE); // Generate an IRQ | |
| 73 | soundlatch_w(machine,0,data & 0xff); | |
| 74 | cpunum_set_input_line(machine, 1,0,ASSERT_LINE); // Generate an IRQ | |
| 75 | 75 | cpu_spinuntil_time(ATTOTIME_IN_USEC(50)); // Allow the other CPU to reply |
| 76 | 76 | } |
| 77 | 77 | } |
| r1877 | r1878 | |
| 286 | 286 | static READ8_HANDLER( esd16_sound_command_r ) |
| 287 | 287 | { |
| 288 | 288 | /* Clear IRQ only after reading the command, or some get lost */ |
| 289 | cpunum_set_input_line(Machine, 1,0,CLEAR_LINE); | |
| 290 | return soundlatch_r(0); | |
| 289 | cpunum_set_input_line(machine, 1,0,CLEAR_LINE); | |
| 290 | return soundlatch_r(machine,0); | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | static ADDRESS_MAP_START( multchmp_sound_readport, ADDRESS_SPACE_IO, 8 ) |
| r1877 | r1878 | |
| 528 | 528 | /* basic machine hardware */ |
| 529 | 529 | MDRV_CPU_ADD_TAG("main",M68000, 16000000) |
| 530 | 530 | MDRV_CPU_PROGRAM_MAP(multchmp_readmem,multchmp_writemem) |
| 531 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 531 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 532 | 532 | |
| 533 | 533 | MDRV_CPU_ADD(Z80, 4000000) |
| 534 | 534 | /* audio CPU */ /* ? */ |
| 535 | 535 | MDRV_CPU_PROGRAM_MAP(multchmp_sound_readmem,multchmp_sound_writemem) |
| 536 | 536 | MDRV_CPU_IO_MAP(multchmp_sound_readport,multchmp_sound_writeport) |
| 537 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,32) /* IRQ By Main CPU */ | |
| 537 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,32) /* IRQ By Main CPU */ | |
| 538 | 538 | |
| 539 | 539 | /* video hardware */ |
| 540 | 540 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 1287 | 1287 | { |
| 1288 | 1288 | UINT64 r = 0; |
| 1289 | 1289 | if(!(mem_mask & U64(0xff00000000000000))) { |
| 1290 | r |= (UINT64)rtc72421_r((offset*2)+0, (UINT32)(mem_mask >> 32)) << 32; | |
| 1290 | r |= (UINT64)rtc72421_r(machine, (offset*2)+0, (UINT32)(mem_mask >> 32)) << 32; | |
| 1291 | 1291 | } |
| 1292 | 1292 | if(!(mem_mask & U64(0x00000000ff000000))) { |
| 1293 | r |= (UINT64)rtc72421_r((offset*2)+1, (UINT32)(mem_mask)); | |
| 1293 | r |= (UINT64)rtc72421_r(machine, (offset*2)+1, (UINT32)(mem_mask)); | |
| 1294 | 1294 | } |
| 1295 | 1295 | return r; |
| 1296 | 1296 | } |
| r1877 | r1878 | |
| 1298 | 1298 | static WRITE64_HANDLER( model3_rtc_w ) |
| 1299 | 1299 | { |
| 1300 | 1300 | if(!(mem_mask & U64(0xff00000000000000))) { |
| 1301 | rtc72421_w((offset*2)+0, (UINT32)(data >> 32), (UINT32)(mem_mask >> 32)); | |
| 1301 | rtc72421_w(machine, (offset*2)+0, (UINT32)(data >> 32), (UINT32)(mem_mask >> 32)); | |
| 1302 | 1302 | } |
| 1303 | 1303 | if(!(mem_mask & U64(0x00000000ff000000))) { |
| 1304 | rtc72421_w((offset*2)+1, (UINT32)(data), (UINT32)(mem_mask)); | |
| 1304 | rtc72421_w(machine, (offset*2)+1, (UINT32)(data), (UINT32)(mem_mask)); | |
| 1305 | 1305 | } |
| 1306 | 1306 | } |
| 1307 | 1307 | |
| r1877 | r1878 | |
| 1325 | 1325 | // serial configuration writes |
| 1326 | 1326 | if ((mem_mask == U64(0x00ffffffffffffff)) && (offset == 0)) |
| 1327 | 1327 | { |
| 1328 | SCSP_MidiIn(0, (data>>56)&0xff, 0); | |
| 1328 | SCSP_MidiIn(machine, 0, (data>>56)&0xff, 0); | |
| 1329 | 1329 | |
| 1330 | 1330 | // give the 68k time to notice |
| 1331 | 1331 | cpu_spinuntil_time(ATTOTIME_IN_USEC(40)); |
| r1877 | r1878 | |
| 4083 | 4083 | MDRV_CPU_ADD(PPC603, 66000000) |
| 4084 | 4084 | MDRV_CPU_CONFIG(model3_10) |
| 4085 | 4085 | MDRV_CPU_PROGRAM_MAP(model3_mem, 0) |
| 4086 | MDRV_CPU_VBLANK_INT(model3_interrupt,2) | |
| 4086 | MDRV_CPU_VBLANK_INT_HACK(model3_interrupt,2) | |
| 4087 | 4087 | |
| 4088 | 4088 | MDRV_CPU_ADD(M68000, 12000000) |
| 4089 | 4089 | MDRV_CPU_PROGRAM_MAP(model3_snd, 0) |
| r1877 | r1878 | |
| 4122 | 4122 | MDRV_CPU_ADD(PPC603, 100000000) |
| 4123 | 4123 | MDRV_CPU_CONFIG(model3_15) |
| 4124 | 4124 | MDRV_CPU_PROGRAM_MAP(model3_mem, 0) |
| 4125 | MDRV_CPU_VBLANK_INT(model3_interrupt,2) | |
| 4125 | MDRV_CPU_VBLANK_INT_HACK(model3_interrupt,2) | |
| 4126 | 4126 | |
| 4127 | 4127 | MDRV_CPU_ADD(M68000, 12000000) |
| 4128 | 4128 | MDRV_CPU_PROGRAM_MAP(model3_snd, 0) |
| r1877 | r1878 | |
| 4159 | 4159 | MDRV_CPU_ADD(PPC603, 166000000) |
| 4160 | 4160 | MDRV_CPU_CONFIG(model3_2x) |
| 4161 | 4161 | MDRV_CPU_PROGRAM_MAP(model3_mem, 0) |
| 4162 | MDRV_CPU_VBLANK_INT(model3_interrupt,2) | |
| 4162 | MDRV_CPU_VBLANK_INT_HACK(model3_interrupt,2) | |
| 4163 | 4163 | |
| 4164 | 4164 | MDRV_CPU_ADD(M68000, 12000000) |
| 4165 | 4165 | MDRV_CPU_PROGRAM_MAP(model3_snd, 0) |
| r1877 | r1878 | |
| 4195 | 4195 | MDRV_CPU_ADD(PPC603, 166000000) |
| 4196 | 4196 | MDRV_CPU_CONFIG(model3_2x) |
| 4197 | 4197 | MDRV_CPU_PROGRAM_MAP(model3_mem, 0) |
| 4198 | MDRV_CPU_VBLANK_INT(model3_interrupt,2) | |
| 4198 | MDRV_CPU_VBLANK_INT_HACK(model3_interrupt,2) | |
| 4199 | 4199 | |
| 4200 | 4200 | MDRV_CPU_ADD(M68000, 12000000) |
| 4201 | 4201 | MDRV_CPU_PROGRAM_MAP(model3_snd, 0) |
| r1877 | r1878 | |
|---|---|---|
| 1518 | 1518 | static MACHINE_DRIVER_START( s21base ) |
| 1519 | 1519 | MDRV_CPU_ADD(M68000,12288000) /* Master */ |
| 1520 | 1520 | MDRV_CPU_PROGRAM_MAP(namcos21_68k_master, namcos21_68k_common) |
| 1521 | MDRV_CPU_VBLANK_INT(namcos2_68k_master_vblank | |
| 1521 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_master_vblank | |
| 1522 | 1522 | |
| 1523 | 1523 | MDRV_CPU_ADD(M68000,12288000) /* Slave */ |
| 1524 | 1524 | MDRV_CPU_PROGRAM_MAP(namcos21_68k_slave, namcos21_68k_common) |
| 1525 | MDRV_CPU_VBLANK_INT(namcos2_68k_slave_vblank | |
| 1525 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_slave_vblank | |
| 1526 | 1526 | |
| 1527 | 1527 | MDRV_CPU_ADD(M6809,3072000) /* Sound */ |
| 1528 | 1528 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| 1529 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 1529 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 1530 | 1530 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,120) |
| 1531 | 1531 | |
| 1532 | 1532 | MDRV_CPU_ADD(HD63705,2048000) /* IO */ |
| 1533 | 1533 | MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu) |
| 1534 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1534 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1535 | 1535 | |
| 1536 | 1536 | MDRV_CPU_ADD(TMS32025,24000000) /* 24 MHz? overclocked */ |
| 1537 | 1537 | MDRV_CPU_PROGRAM_MAP(master_dsp_program,0) |
| r1877 | r1878 | |
| 1597 | 1597 | static MACHINE_DRIVER_START( driveyes ) |
| 1598 | 1598 | MDRV_CPU_ADD(M68000,12288000) /* Master */ |
| 1599 | 1599 | MDRV_CPU_PROGRAM_MAP(driveyes_68k_master, driveyes_68k_common) |
| 1600 | MDRV_CPU_VBLANK_INT(namcos2_68k_master_vblank | |
| 1600 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_master_vblank | |
| 1601 | 1601 | |
| 1602 | 1602 | MDRV_CPU_ADD(M68000,12288000) /* Slave */ |
| 1603 | 1603 | MDRV_CPU_PROGRAM_MAP(driveyes_68k_slave, driveyes_68k_common) |
| 1604 | MDRV_CPU_VBLANK_INT(namcos2_68k_slave_vblank | |
| 1604 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_slave_vblank | |
| 1605 | 1605 | |
| 1606 | 1606 | MDRV_CPU_ADD(M6809,3072000) /* Sound */ |
| 1607 | 1607 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| 1608 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 1608 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 1609 | 1609 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,120) |
| 1610 | 1610 | |
| 1611 | 1611 | MDRV_CPU_ADD(HD63705,2048000) /* IO */ |
| 1612 | 1612 | MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu) |
| 1613 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1613 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1614 | 1614 | |
| 1615 | 1615 | MDRV_CPU_ADD(TMS32025,24000000*2) /* 24 MHz? overclocked */ |
| 1616 | 1616 | MDRV_CPU_PROGRAM_MAP(winrun_dsp_program,0) |
| r1877 | r1878 | |
| 1652 | 1652 | static MACHINE_DRIVER_START( winrun_c140_typeB ) |
| 1653 | 1653 | MDRV_CPU_ADD(M68000,12288000) /* Master */ |
| 1654 | 1654 | MDRV_CPU_PROGRAM_MAP(am_master_winrun,0) |
| 1655 | MDRV_CPU_VBLANK_INT(namcos2_68k_master_vblank | |
| 1655 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_master_vblank | |
| 1656 | 1656 | |
| 1657 | 1657 | MDRV_CPU_ADD(M68000,12288000) /* Slave */ |
| 1658 | 1658 | MDRV_CPU_PROGRAM_MAP(am_slave_winrun,0) |
| 1659 | MDRV_CPU_VBLANK_INT(namcos2_68k_slave_vblank | |
| 1659 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_slave_vblank | |
| 1660 | 1660 | |
| 1661 | 1661 | MDRV_CPU_ADD(M6809,3072000) /* Sound */ |
| 1662 | 1662 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| 1663 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 1663 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 1664 | 1664 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,120) |
| 1665 | 1665 | |
| 1666 | 1666 | MDRV_CPU_ADD(HD63705,2048000) /* IO */ |
| 1667 | 1667 | MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu) |
| 1668 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1668 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1669 | 1669 | |
| 1670 | 1670 | MDRV_CPU_ADD(TMS32025,24000000) /* 24 MHz? overclocked */ |
| 1671 | 1671 | MDRV_CPU_PROGRAM_MAP(winrun_dsp_program,0) |
| r1877 | r1878 | |
| 1674 | 1674 | |
| 1675 | 1675 | MDRV_CPU_ADD(M68000,12288000) /* graphics coprocessor */ |
| 1676 | 1676 | MDRV_CPU_PROGRAM_MAP(am_gpu_winrun,0) |
| 1677 | MDRV_CPU_VBLANK_INT(namcos2_68k_gpu_vblank | |
| 1677 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_gpu_vblank | |
| 1678 | 1678 | |
| 1679 | 1679 | MDRV_INTERLEAVE(100) /* 100 CPU slices per frame */ |
| 1680 | 1680 |
| r1877 | r1878 | |
|---|---|---|
| 445 | 445 | { |
| 446 | 446 | if(ACCESSING_LSB) { |
| 447 | 447 | if (PGMLOGERROR) logerror("SL 1 m68.w %02x (%06x) IRQ\n", data & 0xff, activecpu_get_pc()); |
| 448 | soundlatch_w(0, data); | |
| 449 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 448 | soundlatch_w(machine, 0, data); | |
| 449 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 450 | 450 | } |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | static WRITE8_HANDLER( z80_l3_w ) |
| 454 | 454 | { |
| 455 | 455 | if (PGMLOGERROR) logerror("SL 3 z80.w %02x (%04x)\n", data, activecpu_get_pc()); |
| 456 | soundlatch3_w(0, data); | |
| 456 | soundlatch3_w(machine, 0, data); | |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | static void sound_irq(int level) |
| r1877 | r1878 | |
| 1559 | 1559 | /* basic machine hardware */ |
| 1560 | 1560 | MDRV_CPU_ADD_TAG("main", M68000, 20000000) /* 20 mhz! verified on real board */ |
| 1561 | 1561 | MDRV_CPU_PROGRAM_MAP(pgm_mem,0) |
| 1562 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 1562 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 1563 | 1563 | |
| 1564 | 1564 | MDRV_CPU_ADD_TAG("sound", Z80, 8468000) |
| 1565 | 1565 | MDRV_CPU_PROGRAM_MAP(z80_mem, 0) |
| r1877 | r1878 | |
| 1593 | 1593 | MDRV_IMPORT_FROM(pgm) |
| 1594 | 1594 | |
| 1595 | 1595 | MDRV_CPU_MODIFY("main") |
| 1596 | MDRV_CPU_VBLANK_INT(drgw_interrupt,2) // needs an extra IRQ, puzzli2 doesn't want this irq! | |
| 1596 | MDRV_CPU_VBLANK_INT_HACK(drgw_interrupt,2) // needs an extra IRQ, puzzli2 doesn't want this irq! | |
| 1597 | 1597 | MACHINE_DRIVER_END |
| 1598 | 1598 | |
| 1599 | 1599 | static MACHINE_RESET( killbld ); |
| r1877 | r1878 | |
|---|---|---|
| 306 | 306 | MDRV_CPU_ADD(Z80,12000000/2) /* 6 MHz */ |
| 307 | 307 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 308 | 308 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 309 | MDRV_CPU_VBLANK_INT(iqblock_interrupt,16) | |
| 309 | MDRV_CPU_VBLANK_INT_HACK(iqblock_interrupt,16) | |
| 310 | 310 | |
| 311 | 311 | MDRV_MACHINE_RESET(iqblock) |
| 312 | 312 | |
| r1877 | r1878 | |
| 337 | 337 | MDRV_CPU_ADD(Z180,12000000/2) /* 6 MHz , appears to use Z180 instructions */ |
| 338 | 338 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 339 | 339 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 340 | MDRV_CPU_VBLANK_INT(iqblock_interrupt,16) | |
| 340 | MDRV_CPU_VBLANK_INT_HACK(iqblock_interrupt,16) | |
| 341 | 341 | |
| 342 | 342 | MDRV_MACHINE_RESET(iqblock) |
| 343 | 343 | |
| r1877 | r1878 | |
| 368 | 368 | MDRV_CPU_ADD(Z180,12000000/2) /* 6 MHz */ |
| 369 | 369 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 370 | 370 | MDRV_CPU_IO_MAP(pokerigs_portmap,0) |
| 371 | MDRV_CPU_VBLANK_INT(iqblock_interrupt,16) | |
| 371 | MDRV_CPU_VBLANK_INT_HACK(iqblock_interrupt,16) | |
| 372 | 372 | |
| 373 | 373 | MDRV_MACHINE_RESET(iqblock) |
| 374 | 374 |
| r1877 | r1878 | |
|---|---|---|
| 141 | 141 | |
| 142 | 142 | static WRITE8_HANDLER( audio_trigger_w ) |
| 143 | 143 | { |
| 144 | gameplan_state *state = | |
| 144 | gameplan_state *state = machine->driver_data; | |
| 145 | 145 | |
| 146 | 146 | UINT8 cmd = (data << 7) | (state->audio_cmd & 0x7f); |
| 147 | 147 | |
| 148 | soundlatch_w(0, cmd); | |
| 149 | r6532_0_porta_w(0, cmd); | |
| 148 | soundlatch_w(machine, 0, cmd); | |
| 149 | r6532_0_porta_w(machine, 0, cmd); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 |
| r1877 | r1878 | |
|---|---|---|
| 195 | 195 | /* basic machine hardware */ |
| 196 | 196 | MDRV_CPU_ADD(Z80,8000000/2) /* 4.000MHz */ |
| 197 | 197 | MDRV_CPU_PROGRAM_MAP(ikki_cpu1,0) |
| 198 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 198 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 199 | 199 | |
| 200 | 200 | MDRV_CPU_ADD(Z80,8000000/2) /* 4.000MHz */ |
| 201 | 201 | MDRV_CPU_PROGRAM_MAP(ikki_cpu2,0) |
| 202 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 202 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 203 | 203 | |
| 204 | 204 | MDRV_INTERLEAVE(10) |
| 205 | 205 |
| r1877 | r1878 | |
|---|---|---|
| 163 | 163 | |
| 164 | 164 | static READ8_HANDLER( track_0_r ) |
| 165 | 165 | { |
| 166 | return (input_port_0_r(offset) & 0xf0) | ((input_port_2_r(offset) - last_trackball_val[0]) & 0x0f); | |
| 166 | return (input_port_0_r(machine, offset) & 0xf0) | ((input_port_2_r(machine, offset) - last_trackball_val[0]) & 0x0f); | |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | |
| 170 | 170 | static READ8_HANDLER( track_1_r ) |
| 171 | 171 | { |
| 172 | return (input_port_1_r(offset) & 0xf0) | ((input_port_3_r(offset) - last_trackball_val[1]) & 0x0f); | |
| 172 | return (input_port_1_r(machine, offset) & 0xf0) | ((input_port_3_r(machine, offset) - last_trackball_val[1]) & 0x0f); | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | |
| 176 | 176 | static WRITE8_HANDLER( track_reset_w ) |
| 177 | 177 | { |
| 178 | 178 | /* reset the trackball counters */ |
| 179 | last_trackball_val[0] = input_port_2_r(offset); | |
| 180 | last_trackball_val[1] = input_port_3_r(offset); | |
| 179 | last_trackball_val[0] = input_port_2_r(machine, offset); | |
| 180 | last_trackball_val[1] = input_port_3_r(machine, offset); | |
| 181 | 181 | |
| 182 | watchdog_reset_w(offset,data); | |
| 182 | watchdog_reset_w(machine, offset, data); | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
| r1877 | r1878 | |
| 192 | 192 | |
| 193 | 193 | static WRITE8_HANDLER( capbowl_sndcmd_w ) |
| 194 | 194 | { |
| 195 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, HOLD_LINE); | |
| 196 | soundlatch_w(offset, data); | |
| 195 | cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, HOLD_LINE); | |
| 196 | soundlatch_w(machine, offset, data); | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | |
| r1877 | r1878 | |
| 352 | 352 | /* basic machine hardware */ |
| 353 | 353 | MDRV_CPU_ADD_TAG("main", M6809E, MASTER_CLOCK) |
| 354 | 354 | MDRV_CPU_PROGRAM_MAP(capbowl_map,0) |
| 355 | MDRV_CPU_VBLANK_INT(capbowl_interrupt | |
| 355 | MDRV_CPU_VBLANK_INT("main", capbowl_interrupt | |
| 356 | 356 | |
| 357 | 357 | /* audio CPU */ |
| 358 | 358 | MDRV_CPU_ADD(M6809E, MASTER_CLOCK) |
| r1877 | r1878 | |
|---|---|---|
| 173 | 173 | |
| 174 | 174 | static WRITE16_HANDLER( darius_watchdog_w ) |
| 175 | 175 | { |
| 176 | watchdog_reset_w(0,data); | |
| 176 | watchdog_reset_w(machine,0,data); | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | |
| r1877 | r1878 | |
| 186 | 186 | switch (offset) |
| 187 | 187 | { |
| 188 | 188 | case 0x01: |
| 189 | return (taitosound_comm_r(0) & 0xff); /* sound interface read */ | |
| 189 | return (taitosound_comm_r(machine,0) & 0xff); /* sound interface read */ | |
| 190 | 190 | |
| 191 | 191 | case 0x04: |
| 192 | return input_port_0_word_r(0,mem_mask); /* IN0 */ | |
| 192 | return input_port_0_word_r(machine,0,mem_mask); /* IN0 */ | |
| 193 | 193 | |
| 194 | 194 | case 0x05: |
| 195 | return input_port_1_word_r(0,mem_mask); /* IN1 */ | |
| 195 | return input_port_1_word_r(machine,0,mem_mask); /* IN1 */ | |
| 196 | 196 | |
| 197 | 197 | case 0x06: |
| 198 | return input_port_2_word_r(0,mem_mask); /* IN2 */ | |
| 198 | return input_port_2_word_r(machine,0,mem_mask); /* IN2 */ | |
| 199 | 199 | |
| 200 | 200 | case 0x07: |
| 201 | 201 | return coin_word; /* bits 3&4 coin lockouts, must return zero */ |
| 202 | 202 | |
| 203 | 203 | case 0x08: |
| 204 | return input_port_3_word_r(0,mem_mask); /* DSW */ | |
| 204 | return input_port_3_word_r(machine,0,mem_mask); /* DSW */ | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",activecpu_get_pc(),offset); |
| r1877 | r1878 | |
| 215 | 215 | { |
| 216 | 216 | case 0x00: /* sound interface write */ |
| 217 | 217 | |
| 218 | taitosound_port_w (0, data & 0xff); | |
| 218 | taitosound_port_w (machine, 0, data & 0xff); | |
| 219 | 219 | return; |
| 220 | 220 | |
| 221 | 221 | case 0x01: /* sound interface write */ |
| 222 | 222 | |
| 223 | taitosound_comm_w (0, data & 0xff); | |
| 223 | taitosound_comm_w (machine, 0, data & 0xff); | |
| 224 | 224 | return; |
| 225 | 225 | |
| 226 | 226 | case 0x28: /* unknown, written by both cpus - always 0? */ |
| r1877 | r1878 | |
| 833 | 833 | /* basic machine hardware */ |
| 834 | 834 | MDRV_CPU_ADD(M68000,16000000/2) /* 8 MHz ? */ |
| 835 | 835 | MDRV_CPU_PROGRAM_MAP(darius_readmem,darius_writemem) |
| 836 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 836 | MDRV_CPU_VBLANK_INT("left", irq4_line_hold | |
| 837 | 837 | |
| 838 | 838 | MDRV_CPU_ADD(Z80,8000000/2) |
| 839 | 839 | /* audio CPU */ /* 4 MHz ? */ |
| r1877 | r1878 | |
| 841 | 841 | |
| 842 | 842 | MDRV_CPU_ADD(M68000,16000000/2) /* 8 MHz ? */ |
| 843 | 843 | MDRV_CPU_PROGRAM_MAP(darius_cpub_readmem,darius_cpub_writemem) |
| 844 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 844 | MDRV_CPU_VBLANK_INT("left", irq4_line_hold | |
| 845 | 845 | |
| 846 | 846 | MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz ? */ |
| 847 | 847 | /* audio CPU */ /* ADPCM player using MSM5205 */ |
| r1877 | r1878 | |
|---|---|---|
| 47 | 47 | 0x00,0x00,0x00, 0xff,0x00,0xff, 0x80,0x00,0x80, 0x40,0x00,0x40 |
| 48 | 48 | }; |
| 49 | 49 | |
| 50 | static void update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect, | |
| 51 | UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) | |
| 50 | static MC6845_UPDATE_ROW( update_row ) | |
| 52 | 51 | { |
| 53 | 52 | int cx,x; |
| 54 | 53 | UINT32 tile_address; |
| r1877 | r1878 | |
| 92 | 91 | NULL, |
| 93 | 92 | update_row, |
| 94 | 93 | NULL, |
| 94 | NULL, | |
| 95 | NULL, | |
| 95 | 96 | NULL |
| 96 | 97 | }; |
| 97 | 98 | |
| r1877 | r1878 | |
| 105 | 106 | ssingles_colorram[offset]=data; |
| 106 | 107 | } |
| 107 | 108 | |
| 108 | static WRITE8_HANDLER( ssingles_mc6845_address_w ) | |
| 109 | { | |
| 110 | mc6845_address_w(mc6845, data); | |
| 111 | } | |
| 112 | 109 | |
| 113 | ||
| 114 | static WRITE8_HANDLER( ssingles_mc6845_register_w ) | |
| 115 | { | |
| 116 | mc6845_register_w(mc6845, data); | |
| 117 | } | |
| 118 | ||
| 119 | ||
| 120 | 110 | static VIDEO_START(ssingles) |
| 121 | 111 | { |
| 122 | 112 | mc6845 = devtag_get_token(machine, MC6845, "crtc"); |
| r1877 | r1878 | |
| 158 | 148 | static READ8_HANDLER(controls_r) |
| 159 | 149 | { |
| 160 | 150 | int data=7; |
| 161 | switch(input_port_1_r(0)) //multiplexed | |
| 151 | switch(input_port_1_r(machine,0)) //multiplexed | |
| 162 | 152 | { |
| 163 | 153 | case 0x01: data=1; break; |
| 164 | 154 | case 0x02: data=2; break; |
| r1877 | r1878 | |
| 168 | 158 | case 0x20: data=6; break; |
| 169 | 159 | case 0x40: data=0; break; |
| 170 | 160 | } |
| 171 | return (input_port_0_r(0)&(~0x1c))|(data<<2); | |
| 161 | return (input_port_0_r(machine,0)&(~0x1c))|(data<<2); | |
| 172 | 162 | } |
| 173 | 163 | |
| 174 | 164 | static ADDRESS_MAP_START( ssingles_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 192 | 182 | AM_RANGE(0x18, 0x18) AM_READ(input_port_3_r) |
| 193 | 183 | AM_RANGE(0x1c, 0x1c) AM_READ(controls_r) |
| 194 | 184 | AM_RANGE(0x1a, 0x1a) AM_WRITENOP //video/crt related |
| 195 | AM_RANGE(0xfe, 0xfe) AM_WRITE(ssingles_mc6845_address_w) | |
| 196 | AM_RANGE(0xff, 0xff) AM_WRITE(ssingles_mc6845_register_w) | |
| 185 | AM_RANGE(0xfe, 0xfe) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 186 | AM_RANGE(0xff, 0xff) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 197 | 187 | |
| 198 | 188 | ADDRESS_MAP_END |
| 199 | 189 | |
| r1877 | r1878 | |
| 272 | 262 | MDRV_CPU_ADD(Z80,4000000) /* ? MHz */ |
| 273 | 263 | MDRV_CPU_PROGRAM_MAP(ssingles_map,0) |
| 274 | 264 | MDRV_CPU_IO_MAP(ssingles_io_map,0) |
| 275 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 265 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 276 | 266 | |
| 277 | 267 | MDRV_SCREEN_ADD("main", RASTER) |
| 278 | 268 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| r1877 | r1878 | |
|---|---|---|
| 275 | 275 | |
| 276 | 276 | static READ32_HANDLER( ide_controller_r ) |
| 277 | 277 | { |
| 278 | return midway_ide_asic_r(offset / 2, mem_mask); | |
| 278 | return midway_ide_asic_r(machine, offset / 2, mem_mask); | |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | |
| 282 | 282 | static WRITE32_HANDLER( ide_controller_w ) |
| 283 | 283 | { |
| 284 | midway_ide_asic_w(offset / 2, data, mem_mask); | |
| 284 | midway_ide_asic_w(machine, offset / 2, data, mem_mask); | |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | |
| 288 | 288 | static READ32_HANDLER( ide_controller_extra_r ) |
| 289 | 289 | { |
| 290 | return ide_controller32_0_r(0x3f6/4, 0xff00ffff) >> 16; | |
| 290 | return ide_controller32_0_r(machine, 0x3f6/4, 0xff00ffff) >> 16; | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | |
| 294 | 294 | static WRITE32_HANDLER( ide_controller_extra_w ) |
| 295 | 295 | { |
| 296 | ide_controller32_0_w(0x3f6/4, data << 16, 0xff00ffff); | |
| 296 | ide_controller32_0_w(machine, 0x3f6/4, data << 16, 0xff00ffff); | |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | |
| r1877 | r1878 | |
| 657 | 657 | MDRV_CPU_ADD(R4600LE, MASTER_CLOCK*2) |
| 658 | 658 | MDRV_CPU_CONFIG(config) |
| 659 | 659 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 660 | MDRV_CPU_VBLANK_INT(irq0_start | |
| 660 | MDRV_CPU_VBLANK_INT("main", irq0_start | |
| 661 | 661 | |
| 662 | 662 | MDRV_MACHINE_START(kinst) |
| 663 | 663 | MDRV_MACHINE_RESET(kinst) |
| r1877 | r1878 | |
|---|---|---|
| 51 | 51 | static READ8_HANDLER( bankedram_r ) |
| 52 | 52 | { |
| 53 | 53 | if (rambank == 2) |
| 54 | return cbasebal_textram_r(offset); /* VRAM */ | |
| 54 | return cbasebal_textram_r(machine,offset); /* VRAM */ | |
| 55 | 55 | else if (rambank == 1) |
| 56 | 56 | { |
| 57 | 57 | if (offset < 0x800) |
| r1877 | r1878 | |
| 60 | 60 | } |
| 61 | 61 | else |
| 62 | 62 | { |
| 63 | return cbasebal_scrollram_r(offset); /* SCROLL */ | |
| 63 | return cbasebal_scrollram_r(machine,offset); /* SCROLL */ | |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | static WRITE8_HANDLER( bankedram_w ) |
| 68 | 68 | { |
| 69 | 69 | if (rambank == 2) |
| 70 | cbasebal_textram_w(offset,data); | |
| 70 | cbasebal_textram_w(machine,offset,data); | |
| 71 | 71 | else if (rambank == 1) |
| 72 | 72 | { |
| 73 | 73 | if (offset < 0x800) |
| 74 | paletteram_xxxxBBBBRRRRGGGG_le_w(offset,data); | |
| 74 | paletteram_xxxxBBBBRRRRGGGG_le_w(machine,offset,data); | |
| 75 | 75 | } |
| 76 | 76 | else |
| 77 | cbasebal_scrollram_w(offset,data); | |
| 77 | cbasebal_scrollram_w(machine,offset,data); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | static WRITE8_HANDLER( cbasebal_coinctrl_w ) |
| r1877 | r1878 | |
| 122 | 122 | |
| 123 | 123 | bit = EEPROM_read_bit() << 7; |
| 124 | 124 | |
| 125 | return (input_port_2_r(0) & 0x7f) | bit; | |
| 125 | return (input_port_2_r(machine,0) & 0x7f) | bit; | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | static WRITE8_HANDLER( eeprom_cs_w ) |
| r1877 | r1878 | |
| 255 | 255 | MDRV_CPU_ADD(Z80, 6000000) /* ??? */ |
| 256 | 256 | MDRV_CPU_PROGRAM_MAP(cbasebal_map,0) |
| 257 | 257 | MDRV_CPU_IO_MAP(cbasebal_portmap,0) |
| 258 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 258 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 259 | 259 | |
| 260 | 260 | MDRV_NVRAM_HANDLER(cbasebal) |
| 261 | 261 |
| r1877 | r1878 | |
|---|---|---|
| 304 | 304 | |
| 305 | 305 | static READ32_HANDLER( sound_data_r ) |
| 306 | 306 | { |
| 307 | return atarigen_sound_r(offset,0); | |
| 307 | return atarigen_sound_r(machine,offset,0); | |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | |
| 311 | 311 | static WRITE32_HANDLER( sound_data_w ) |
| 312 | 312 | { |
| 313 | 313 | if (ACCESSING_LSB32) |
| 314 | atarigen_sound_w(offset, data, mem_mask); | |
| 314 | atarigen_sound_w(machine,offset, data, mem_mask); | |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | |
| 318 | 318 | static WRITE32_HANDLER( sound_reset_w ) |
| 319 | 319 | { |
| 320 | 320 | logerror("Sound reset = %d\n", !offset); |
| 321 | cpunum_set_input_line( | |
| 321 | cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, offset ? CLEAR_LINE : ASSERT_LINE); | |
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 |
| r1877 | r1878 | |
|---|---|---|
| 44 | 44 | xxxx - input port #2 |
| 45 | 45 | xxxx - dip switches (2x8 bits) (multiplexed) |
| 46 | 46 | */ |
| 47 | int retval=input_port_2_r(0)&0x0f; | |
| 47 | int retval=input_port_2_r(machine,0)&0x0f; | |
| 48 | 48 | switch(mux_port&0x30) |
| 49 | 49 | { |
| 50 | case 0x00: retval|=((input_port_4_r(0)&1)<<4)|((input_port_4_r(0)&0x10)<<1)|((input_port_5_r(0)&1)<<6)|((input_port_5_r(0)&0x10)<<3);break; | |
| 51 | case 0x10: retval|=((input_port_4_r(0)&2)<<3)|((input_port_4_r(0)&0x20) )|((input_port_5_r(0)&2)<<5)|((input_port_5_r(0)&0x20)<<2);break; | |
| 52 | case 0x20: retval|=((input_port_4_r(0)&4)<<2)|((input_port_4_r(0)&0x40)>>1)|((input_port_5_r(0)&4)<<4)|((input_port_5_r(0)&0x40)<<1);break; | |
| 53 | case 0x30: retval|=((input_port_4_r(0)&8)<<1)|((input_port_4_r(0)&0x80)>>2)|((input_port_5_r(0)&8)<<3)|((input_port_5_r(0)&0x80) );break; | |
| 50 | case 0x00: retval|=((input_port_4_r(machine,0)&1)<<4)|((input_port_4_r(machine,0)&0x10)<<1)|((input_port_5_r(machine,0)&1)<<6)|((input_port_5_r(machine,0)&0x10)<<3);break; | |
| 51 | case 0x10: retval|=((input_port_4_r(machine,0)&2)<<3)|((input_port_4_r(machine,0)&0x20) )|((input_port_5_r(machine,0)&2)<<5)|((input_port_5_r(machine,0)&0x20)<<2);break; | |
| 52 | case 0x20: retval|=((input_port_4_r(machine,0)&4)<<2)|((input_port_4_r(machine,0)&0x40)>>1)|((input_port_5_r(machine,0)&4)<<4)|((input_port_5_r(machine,0)&0x40)<<1);break; | |
| 53 | case 0x30: retval|=((input_port_4_r(machine,0)&8)<<1)|((input_port_4_r(machine,0)&0x80)>>2)|((input_port_5_r(machine,0)&8)<<3)|((input_port_5_r(machine,0)&0x80) );break; | |
| 54 | 54 | } |
| 55 | 55 | return retval; |
| 56 | 56 | } |
| r1877 | r1878 | |
| 420 | 420 | MDRV_CPU_PROGRAM_MAP(st0016_mem,0) |
| 421 | 421 | MDRV_CPU_IO_MAP(st0016_io,0) |
| 422 | 422 | |
| 423 | MDRV_CPU_VBLANK_INT(st0016_int,5) /* 4*nmi + int0 */ | |
| 423 | MDRV_CPU_VBLANK_INT_HACK(st0016_int,5) /* 4*nmi + int0 */ | |
| 424 | 424 | |
| 425 | 425 | /* video hardware */ |
| 426 | 426 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 240 | 240 | /* basic machine hardware */ |
| 241 | 241 | MDRV_CPU_ADD(M6809, 1400000) /* 1.400 MHz ??? */ |
| 242 | 242 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 243 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 243 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 244 | 244 | |
| 245 | 245 | MDRV_CPU_ADD(Z80,14318000/4) |
| 246 | 246 | /* audio CPU */ /* 3.5795 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 227 | 227 | MDRV_CPU_ADD(I8088,24000000/2) |
| 228 | 228 | MDRV_CPU_PROGRAM_MAP(smstrv_map,0) |
| 229 | 229 | // MDRV_CPU_IO_MAP(io_map,0) |
| 230 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 230 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 231 | 231 | |
| 232 | 232 | // MDRV_NVRAM_HANDLER(generic_0fill) |
| 233 | 233 | MDRV_MACHINE_RESET(smstrv) |
| r1877 | r1878 | |
|---|---|---|
| 368 | 368 | /* basic machine hardware */ |
| 369 | 369 | MDRV_CPU_ADD(M68000, 14000000) /* 28 MHz crystal */ |
| 370 | 370 | MDRV_CPU_PROGRAM_MAP(funkyjet_readmem,funkyjet_writemem) |
| 371 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 371 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 372 | 372 | |
| 373 | 373 | MDRV_CPU_ADD(H6280,32220000/4) /* Custom chip 45, Audio section crystal is 32.220 MHz */ |
| 374 | 374 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 264 | 264 | MDRV_CPU_ADD(Z80,4000000) |
| 265 | 265 | MDRV_CPU_PROGRAM_MAP(skyarmy_readmem,skyarmy_writemem) |
| 266 | 266 | MDRV_CPU_IO_MAP(readport,writeport) |
| 267 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 267 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 268 | 268 | MDRV_CPU_PERIODIC_INT(skyarmy_nmi_source,650) /* Hz */ |
| 269 | 269 | |
| 270 | 270 | /* video hardware */ |
| r1877 | r1878 | |
|---|---|---|
| 64 | 64 | */ |
| 65 | 65 | |
| 66 | 66 | #include "driver.h" |
| 67 | #include "deprecat.h" | |
| 67 | 68 | #include "sound/ay8910.h" |
| 68 | 69 | #include "sound/dac.h" |
| 69 | 70 | |
| r1877 | r1878 | |
| 90 | 91 | static WRITE8_HANDLER( latch_w ) |
| 91 | 92 | { |
| 92 | 93 | sound_status&=~0x80; |
| 93 | soundlatch_w(0,data|0x80); | |
| 94 | soundlatch_w(machine,0,data|0x80); | |
| 94 | 95 | } |
| 95 | 96 | |
| 96 | 97 | static READ8_HANDLER (sound_status_r) |
| r1877 | r1878 | |
| 240 | 241 | static MACHINE_DRIVER_START( ksayakyu ) |
| 241 | 242 | MDRV_CPU_ADD(Z80,8000000/2) |
| 242 | 243 | MDRV_CPU_PROGRAM_MAP(maincpu_map,0) |
| 243 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 244 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 244 | 245 | |
| 245 | 246 | MDRV_CPU_ADD(Z80, 80000000/2) |
| 246 | 247 | /* audio CPU */ |
| 247 | 248 | MDRV_CPU_PROGRAM_MAP(soundcpu_map,0) |
| 248 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 249 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 249 | 250 | |
| 250 | 251 | MDRV_INTERLEAVE(1000) |
| 251 | 252 |
| r1877 | r1878 | |
|---|---|---|
| 547 | 547 | /* basic machine hardware */ |
| 548 | 548 | MDRV_CPU_ADD_TAG("main", M6809, MAIN_CLOCK_OSC/4/4) /* 1.25 MHz */ |
| 549 | 549 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 550 | MDRV_CPU_VBLANK_INT(qix_vblank_start | |
| 550 | MDRV_CPU_VBLANK_INT("main", qix_vblank_start | |
| 551 | 551 | |
| 552 | 552 | /* high interleave needed to ensure correct text in service mode */ |
| 553 | 553 | /* Zookeeper settings and high score table seem especially sensitive to this */ |
| r1877 | r1878 | |
|---|---|---|
| 291 | 291 | MDRV_CPU_ADD(Z80,4000000) |
| 292 | 292 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 293 | 293 | MDRV_CPU_IO_MAP(io_map,0) |
| 294 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 294 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 295 | 295 | |
| 296 | 296 | MDRV_VIDEO_START(suprgolf) |
| 297 | 297 | MDRV_VIDEO_UPDATE(suprgolf) |
| r1877 | r1878 | |
|---|---|---|
| 153 | 153 | UINT16 *src, *dst; |
| 154 | 154 | |
| 155 | 155 | counter = frame; |
| 156 | frame = | |
| 156 | frame = vid | |
| 157 | 157 | if (limiter && counter == frame) return; // make sure we only do DMA transfer once per frame |
| 158 | 158 | |
| 159 | 159 | K053247_export_config(&dst, 0, 0, 0, &counter); |
| r1877 | r1878 | |
| 207 | 207 | /* bit 0 is EEPROM data */ |
| 208 | 208 | /* bit 1 is EEPROM ready */ |
| 209 | 209 | /* bit 3 is service button */ |
| 210 | res = EEPROM_read_bit() | input_port_1_r(0); | |
| 210 | res = EEPROM_read_bit() | input_port_1_r(machine, 0); | |
| 211 | 211 | |
| 212 | 212 | if (init_eeprom_count) |
| 213 | 213 | { |
| r1877 | r1878 | |
| 256 | 256 | { |
| 257 | 257 | // anyone knows why 0x1a keeps lurking the sound queue in the world version??? |
| 258 | 258 | if (xexex_strip0x1a) |
| 259 | if (soundlatch2_r(0)==1 && data==0x1a) return; | |
| 259 | if (soundlatch2_r(machine, 0)==1 && data==0x1a) return; | |
| 260 | 260 | |
| 261 | soundlatch_w(0, data & 0xff); | |
| 261 | soundlatch_w(machine, 0, data & 0xff); | |
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | |
| r1877 | r1878 | |
| 266 | 266 | { |
| 267 | 267 | if (ACCESSING_LSB) |
| 268 | 268 | { |
| 269 | soundlatch2_w(0, data & 0xff); | |
| 269 | soundlatch2_w(machine, 0, data & 0xff); | |
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | static WRITE16_HANDLER( sound_irq_w ) |
| 274 | 274 | { |
| 275 | cpunum_set_input_line( | |
| 275 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | static READ16_HANDLER( sound_status_r ) |
| 279 | 279 | { |
| 280 | return soundlatch3_r(0); | |
| 280 | return soundlatch3_r(machine, 0); | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | static void reset_sound_region(void) |
| r1877 | r1878 | |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | |
| 346 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 347 | AM_RANGE(0x000000, 0x07ffff) AM_READ(MRA16_ROM) | |
| 346 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 347 | AM_RANGE(0x000000, 0x07ffff) AM_ROM | |
| 348 | AM_RANGE(0x080000, 0x08ffff) AM_RAM AM_BASE(&xexex_workram) // work RAM | |
| 349 | ||
| 348 | 350 | #if XE_SKIPIDLE |
| 349 | AM_RANGE(0x080014, 0x080015) AM_READ(xexex_waitskip_r) // helps sound CPU by giving back control as early as possible | |
| 351 | AM_RANGE(0x080014, 0x080015) AM_READ(xexex_waitskip_r) // helps sound CPU by giving back control as early as possible | |
| 350 | 352 | #endif |
| 351 | AM_RANGE(0x080000, 0x08ffff) AM_READ(MRA16_RAM) | |
| 352 | AM_RANGE(0x090000, 0x097fff) AM_READ(MRA16_RAM) // K053247 sprite RAM | |
| 353 | AM_RANGE(0x098000, 0x09ffff) AM_READ(spriteram16_mirror_r) // K053247 sprite RAM mirror read | |
| 354 | AM_RANGE(0x0c4000, 0x0c4001) AM_READ(K053246_word_r) // Passthrough to sprite roms | |
| 355 | AM_RANGE(0x0c6000, 0x0c7fff) AM_READ(K053250_0_ram_r) // K053250 "road" RAM | |
| 356 | AM_RANGE(0x0c8000, 0x0c800f) AM_READ(K053250_0_r) | |
| 353 | ||
| 354 | AM_RANGE(0x090000, 0x097fff) AM_RAM AM_BASE(&spriteram16) // K053247 sprite RAM | |
| 355 | AM_RANGE(0x098000, 0x09ffff) AM_READWRITE(spriteram16_mirror_r, spriteram16_mirror_w) // K053247 sprite RAM mirror read | |
| 356 | AM_RANGE(0x0c0000, 0x0c003f) AM_WRITE(K056832_word_w) // VACSET (K054157) | |
| 357 | AM_RANGE(0x0c2000, 0x0c2007) AM_WRITE(K053246_word_w) // OBJSET1 | |
| 358 | AM_RANGE(0x0c4000, 0x0c4001) AM_READ(K053246_word_r) // Passthrough to sprite roms | |
| 359 | AM_RANGE(0x0c6000, 0x0c7fff) AM_READWRITE(K053250_0_ram_r, K053250_0_ram_w) // K053250 "road" RAM | |
| 360 | AM_RANGE(0x0c8000, 0x0c800f) AM_READWRITE(K053250_0_r, K053250_0_w) | |
| 361 | AM_RANGE(0x0ca000, 0x0ca01f) AM_WRITE(K054338_word_w) // CLTC | |
| 362 | AM_RANGE(0x0cc000, 0x0cc01f) AM_WRITE(K053251_lsb_w) // priority encoder | |
| 363 | AM_RANGE(0x0d0000, 0x0d001f) AM_WRITE(K053252_word_w) // CCU | |
| 364 | AM_RANGE(0x0d4000, 0x0d4001) AM_WRITE(sound_irq_w) | |
| 365 | AM_RANGE(0x0d600c, 0x0d600d) AM_WRITE(sound_cmd1_w) | |
| 366 | AM_RANGE(0x0d600e, 0x0d600f) AM_WRITE(sound_cmd2_w) | |
| 357 | 367 | AM_RANGE(0x0d6014, 0x0d6015) AM_READ(sound_status_r) |
| 358 | AM_RANGE(0x0d6000, 0x0d601f) AM_READ(MRA16_RAM) | |
| 368 | AM_RANGE(0x0d6000, 0x0d601f) AM_RAM // sound regs fall through | |
| 369 | AM_RANGE(0x0d8000, 0x0d8007) AM_WRITE(K056832_b_word_w) // VSCCS regs | |
| 359 | 370 | AM_RANGE(0x0da000, 0x0da001) AM_READ(input_port_2_word_r) |
| 360 | 371 | AM_RANGE(0x0da002, 0x0da003) AM_READ(input_port_3_word_r) |
| 361 | 372 | AM_RANGE(0x0dc000, 0x0dc001) AM_READ(input_port_0_word_r) |
| 362 | 373 | AM_RANGE(0x0dc002, 0x0dc003) AM_READ(control1_r) |
| 363 | AM_RANGE(0x0de000, 0x0de001) AM_READ(control2_r) | |
| 364 | AM_RANGE(0x100000, 0x17ffff) AM_READ(MRA16_ROM) | |
| 365 | AM_RANGE(0x180000, 0x181fff) AM_READ(K056832_ram_word_r) | |
| 366 | AM_RANGE(0x182000, 0x183fff) AM_READ(K056832_ram_word_r) | |
| 367 | AM_RANGE(0x190000, 0x191fff) AM_READ(K056832_rom_word_r) // Passthrough to tile roms | |
| 374 | AM_RANGE(0x0de000, 0x0de001) AM_READWRITE(control2_r, control2_w) | |
| 375 | AM_RANGE(0x100000, 0x17ffff) AM_ROM | |
| 376 | AM_RANGE(0x180000, 0x181fff) AM_READWRITE(K056832_ram_word_r, K056832_ram_word_w) | |
| 377 | AM_RANGE(0x182000, 0x183fff) AM_READWRITE(K056832_ram_word_r, K056832_ram_word_w) | |
| 378 | AM_RANGE(0x190000, 0x191fff) AM_READWRITE(K056832_rom_word_r, MWA16_ROM) // Passthrough to tile roms | |
| 368 | 379 | AM_RANGE(0x1a0000, 0x1a1fff) AM_READ(K053250_0_rom_r) |
| 369 | AM_RANGE(0x1b0000, 0x1b1fff) AM_READ(MRA16_RAM) | |
| 380 | AM_RANGE(0x1b0000, 0x1b1fff) AM_READWRITE(MRA16_RAM, paletteram16_xrgb_word_be_w) AM_BASE(&paletteram16) | |
| 381 | ||
| 370 | 382 | #if XE_DEBUG |
| 371 | 383 | AM_RANGE(0x0c0000, 0x0c003f) AM_READ(K056832_word_r) |
| 372 | 384 | AM_RANGE(0x0c2000, 0x0c2007) AM_READ(K053246_reg_word_r) |
| r1877 | r1878 | |
| 375 | 387 | AM_RANGE(0x0d0000, 0x0d001f) AM_READ(K053252_word_r) |
| 376 | 388 | AM_RANGE(0x0d8000, 0x0d8007) AM_READ(K056832_b_word_r) |
| 377 | 389 | #endif |
| 378 | ADDRESS_MAP_END | |
| 379 | 390 | |
| 380 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 381 | AM_RANGE(0x000000, 0x07ffff) AM_WRITE(MWA16_ROM) // main ROM | |
| 382 | AM_RANGE(0x080000, 0x08ffff) AM_WRITE(MWA16_RAM) AM_BASE(&xexex_workram) // work RAM | |
| 383 | AM_RANGE(0x090000, 0x097fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16) // K053247 sprite RAM | |
| 384 | AM_RANGE(0x098000, 0x09ffff) AM_WRITE(spriteram16_mirror_w) // K053247 sprite RAM mirror write | |
| 385 | AM_RANGE(0x0c0000, 0x0c003f) AM_WRITE(K056832_word_w) // VACSET (K054157) | |
| 386 | AM_RANGE(0x0c2000, 0x0c2007) AM_WRITE(K053246_word_w) // OBJSET1 | |
| 387 | AM_RANGE(0x0c6000, 0x0c7fff) AM_WRITE(K053250_0_ram_w) // K053250 "road" RAM | |
| 388 | AM_RANGE(0x0c8000, 0x0c800f) AM_WRITE(K053250_0_w) // background effects generator | |
| 389 | AM_RANGE(0x0ca000, 0x0ca01f) AM_WRITE(K054338_word_w) // CLTC | |
| 390 | AM_RANGE(0x0cc000, 0x0cc01f) AM_WRITE(K053251_lsb_w) // priority encoder | |
| 391 | AM_RANGE(0x0d0000, 0x0d001f) AM_WRITE(K053252_word_w) // CCU | |
| 392 | AM_RANGE(0x0d4000, 0x0d4001) AM_WRITE(sound_irq_w) | |
| 393 | AM_RANGE(0x0d600c, 0x0d600d) AM_WRITE(sound_cmd1_w) | |
| 394 | AM_RANGE(0x0d600e, 0x0d600f) AM_WRITE(sound_cmd2_w) | |
| 395 | AM_RANGE(0x0d6000, 0x0d601f) AM_WRITE(MWA16_RAM) // sound regs fall through | |
| 396 | AM_RANGE(0x0d8000, 0x0d8007) AM_WRITE(K056832_b_word_w) // VSCCS regs | |
| 397 | AM_RANGE(0x0de000, 0x0de001) AM_WRITE(control2_w) | |
| 398 | AM_RANGE(0x100000, 0x17ffff) AM_WRITE(MWA16_ROM) | |
| 399 | AM_RANGE(0x180000, 0x181fff) AM_WRITE(K056832_ram_word_w) // tilemap RAM | |
| 400 | AM_RANGE(0x182000, 0x183fff) AM_WRITE(K056832_ram_word_w) // tilemap RAM mirror | |
| 401 | AM_RANGE(0x190000, 0x191fff) AM_WRITE(MWA16_ROM) // tile ROM | |
| 402 | AM_RANGE(0x1b0000, 0x1b1fff) AM_WRITE(paletteram16_xrgb_word_be_w) AM_BASE(&paletteram16) | |
| 403 | 391 | ADDRESS_MAP_END |
| 404 | 392 | |
| 405 | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 406 | AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM) | |
| 407 | AM_RANGE(0x8000, 0xbfff) AM_READ(MRA8_BANK2) | |
| 408 | AM_RANGE(0xc000, 0xdfff) AM_READ(MRA8_RAM) | |
| 409 | AM_RANGE(0xe000, 0xe22f) AM_READ(K054539_0_r) | |
| 410 | AM_RANGE(0xec01, 0xec01) AM_READ(YM2151_status_port_0_r) | |
| 411 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_r) | |
| 412 | AM_RANGE(0xf003, 0xf003) AM_READ(soundlatch2_r) | |
| 413 | ADDRESS_MAP_END | |
| 414 | 393 | |
| 415 | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 416 | AM_RANGE(0x0000, 0xbfff) AM_WRITE(MWA8_ROM) | |
| 417 | AM_RANGE(0xc000, 0xdfff) AM_WRITE(MWA8_RAM) | |
| 418 | AM_RANGE(0xe000, 0xe22f) AM_WRITE(K054539_0_w) | |
| 394 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 395 | AM_RANGE(0x8000, 0xbfff) AM_READ(MRA8_BANK2) | |
| 396 | AM_RANGE(0x0000, 0xbfff) AM_ROM | |
| 397 | AM_RANGE(0xc000, 0xdfff) AM_RAM | |
| 398 | AM_RANGE(0xe000, 0xe22f) AM_READWRITE(K054539_0_r, K054539_0_w) | |
| 419 | 399 | AM_RANGE(0xec00, 0xec00) AM_WRITE(YM2151_register_port_0_w) |
| 420 | AM_RANGE(0xec01, 0xec01) AM_WRITE(YM2151_data_port_0_w) | |
| 400 | AM_RANGE(0xec01, 0xec01) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w) | |
| 421 | 401 | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch3_w) |
| 402 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_r) | |
| 403 | AM_RANGE(0xf003, 0xf003) AM_READ(soundlatch2_r) | |
| 422 | 404 | AM_RANGE(0xf800, 0xf800) AM_WRITE(sound_bankswitch_w) |
| 423 | 405 | ADDRESS_MAP_END |
| 424 | 406 | |
| r1877 | r1878 | |
| 474 | 456 | |
| 475 | 457 | /* basic machine hardware */ |
| 476 | 458 | MDRV_CPU_ADD(M68000, 16000000) // 16MHz (32MHz xtal) |
| 477 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 478 | MDRV_CPU_VBLANK_INT(xexex_interrupt,2) | |
| 459 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 460 | MDRV_CPU_VBLANK_INT_HACK(xexex_interrupt,2) | |
| 479 | 461 | |
| 480 | 462 | // 8MHz (PCB shows one 32MHz/18.432MHz xtal, reference: www.system16.com) |
| 481 | 463 | // more likely 32MHz since 18.432MHz yields 4.608MHz(too slow) or 9.216MHz(too fast) with integer divisors |
| 482 | 464 | MDRV_CPU_ADD(Z80, 8000000) |
| 483 | 465 | |
| 484 | 466 | /* audio CPU */ |
| 485 | MDRV_CPU_PROGRAM_MAP(sound_ | |
| 467 | MDRV_CPU_PROGRAM_MAP(sound_ | |
| 486 | 468 | |
| 487 | 469 | MDRV_INTERLEAVE(32) |
| 488 | 470 |
| r1877 | r1878 | |
|---|---|---|
| 278 | 278 | /* basic machine hardware */ |
| 279 | 279 | MDRV_CPU_ADD(Z80, 12288000 / 4) /* 3.072 MHz ? */ |
| 280 | 280 | MDRV_CPU_PROGRAM_MAP(wallc_map,0) |
| 281 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 281 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 282 | 282 | |
| 283 | 283 | /* video hardware */ |
| 284 | 284 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 96 | 96 | |
| 97 | 97 | #include "driver.h" |
| 98 | 98 | |
| 99 | static | |
| 99 | static | |
| 100 | 100 | static tilemap *tx_tilemap; |
| 101 | 101 | |
| 102 | 102 | static UINT8 *tx_tileram; |
| r1877 | r1878 | |
| 278 | 278 | |
| 279 | 279 | //if(data&0xf0) |
| 280 | 280 | // logerror("pf:%02x %d\n",marinedt_pf); |
| 281 | //logerror("pd:%02x %d\n",marinedt_pd, | |
| 281 | //logerror("pd:%02x %d\n",marinedt_pd, vid | |
| 282 | 282 | |
| 283 | 283 | } |
| 284 | 284 | |
| r1877 | r1878 | |
| 587 | 587 | MDRV_CPU_ADD(Z80,10000000/4) |
| 588 | 588 | MDRV_CPU_PROGRAM_MAP(marinedt_readmem,marinedt_writemem) |
| 589 | 589 | MDRV_CPU_IO_MAP(marinedt_readport,marinedt_writeport) |
| 590 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 590 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 591 | 591 | |
| 592 | 592 | /* video hardware */ |
| 593 | 593 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 397 | 397 | /* basic machine hardware */ |
| 398 | 398 | MDRV_CPU_ADD(M6809,18432000/6) /* 3.072 MHz??? mod by Shingo Suzuki 1999/10/15 */ |
| 399 | 399 | MDRV_CPU_PROGRAM_MAP(master_map, 0) |
| 400 | MDRV_CPU_VBLANK_INT(ironhors_interrupt,8) | |
| 400 | MDRV_CPU_VBLANK_INT_HACK(ironhors_interrupt,8) | |
| 401 | 401 | |
| 402 | 402 | MDRV_CPU_ADD_TAG("sound",Z80,18432000/6) |
| 403 | 403 | /* audio CPU */ /* 3.072 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | #include "driver.h" |
| 44 | #include "deprecat.h" | |
| 44 | 45 | #include "sound/ay8910.h" |
| 45 | 46 | |
| 46 | 47 | |
| r1877 | r1878 | |
| 210 | 211 | MDRV_CPU_ADD(Z80,10000000/2 ) /* 10 MHz, divided ? (Z80A CPU) */ |
| 211 | 212 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 212 | 213 | MDRV_CPU_IO_MAP(readport,writeport) |
| 213 | MDRV_CPU_VBLANK_INT(irq0_line_hold,8) /* controls game speed? */ | |
| 214 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,8) /* controls game speed? */ | |
| 214 | 215 | |
| 215 | 216 | /* video hardware */ |
| 216 | 217 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 251 | 251 | /* basic machine hardware */ |
| 252 | 252 | MDRV_CPU_ADD(M68000, ATARI_CLOCK_14MHz/2) |
| 253 | 253 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 254 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 254 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 255 | 255 | |
| 256 | 256 | MDRV_MACHINE_RESET(skullxbo) |
| 257 | 257 | MDRV_NVRAM_HANDLER(atarigen) |
| r1877 | r1878 | |
|---|---|---|
| 89 | 89 | static int tmp_counter; |
| 90 | 90 | static int clr_offset=0; |
| 91 | 91 | |
| 92 | static mame_bitmap *sliver_bitmap_fg; | |
| 93 | static mame_bitmap *sliver_bitmap_bg; | |
| 92 | static bitmap_t *sliver_bitmap_fg; | |
| 93 | static bitmap_t *sliver_bitmap_bg; | |
| 94 | 94 | |
| 95 | 95 | static UINT16 tempbuf[8]; |
| 96 | 96 | |
| r1877 | r1878 | |
| 385 | 385 | |
| 386 | 386 | static WRITE16_HANDLER(sound_w) |
| 387 | 387 | { |
| 388 | soundlatch_w(0,data & 0xff); | |
| 389 | cpunum_set_input_line(Machine, 1, I8051_INT0_LINE, HOLD_LINE); | |
| 388 | soundlatch_w(machine,0,data & 0xff); | |
| 389 | cpunum_set_input_line(machine, 1, I8051_INT0_LINE, HOLD_LINE); | |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | static ADDRESS_MAP_START( sliver_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1877 | r1878 | |
| 533 | 533 | static MACHINE_DRIVER_START( sliver ) |
| 534 | 534 | MDRV_CPU_ADD_TAG("main", M68000, 12000000) |
| 535 | 535 | MDRV_CPU_PROGRAM_MAP(sliver_map,0) |
| 536 | MDRV_CPU_VBLANK_INT(sliver_int,3) | |
| 536 | MDRV_CPU_VBLANK_INT_HACK(sliver_int,3) | |
| 537 | 537 | |
| 538 | 538 | MDRV_CPU_ADD(I8051, 8000000) |
| 539 | 539 | MDRV_CPU_PROGRAM_MAP(soundmem_prg,0) |
| r1877 | r1878 | |
|---|---|---|
| 225 | 225 | data = 0; |
| 226 | 226 | if( ACCESSING_LSB16 ) |
| 227 | 227 | { |
| 228 | data |= K054539_1_r( offset ); | |
| 228 | data |= K054539_1_r( machine, offset ); | |
| 229 | 229 | } |
| 230 | 230 | if( ACCESSING_MSB16 ) |
| 231 | 231 | { |
| 232 | data |= K054539_0_r( offset ) << 8; | |
| 232 | data |= K054539_0_r( machine, offset ) << 8; | |
| 233 | 233 | } |
| 234 | 234 | return data; |
| 235 | 235 | } |
| r1877 | r1878 | |
| 238 | 238 | { |
| 239 | 239 | if( ACCESSING_LSB16 ) |
| 240 | 240 | { |
| 241 | K054539_1_w( offset, data ); | |
| 241 | K054539_1_w( machine, offset, data ); | |
| 242 | 242 | } |
| 243 | 243 | if( ACCESSING_MSB16 ) |
| 244 | 244 | { |
| 245 | K054539_0_w( offset, data >> 8 ); | |
| 245 | K054539_0_w( machine, offset, data >> 8 ); | |
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | 248 | |
| r1877 | r1878 | |
| 376 | 376 | /* basic machine hardware */ |
| 377 | 377 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) |
| 378 | 378 | MDRV_CPU_PROGRAM_MAP( konamigq_map, 0 ) |
| 379 | MDRV_CPU_VBLANK_INT( psx_vblank | |
| 379 | MDRV_CPU_VBLANK_INT("main", psx_vblank | |
| 380 | 380 | |
| 381 | 381 | MDRV_CPU_ADD_TAG( "sound", M68000, 8000000 ) |
| 382 | 382 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 350 | 350 | MDRV_CPU_ADD(Z80, 11000000/4) /* 2.75 MHz (see notes) */ |
| 351 | 351 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 352 | 352 | MDRV_CPU_IO_MAP(readport,writeport) |
| 353 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 353 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 354 | 354 | |
| 355 | 355 | /* video hardware */ |
| 356 | 356 | MDRV_VIDEO_UPDATE(epos) |
| r1877 | r1878 | |
| 374 | 374 | MDRV_CPU_ADD(Z80, 11000000/4) /* 2.75 MHz (see notes) */ |
| 375 | 375 | MDRV_CPU_PROGRAM_MAP(dealer_readmem,dealer_writemem) |
| 376 | 376 | MDRV_CPU_IO_MAP(dealer_readport,dealer_writeport) |
| 377 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 377 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 378 | 378 | |
| 379 | 379 | /* video hardware */ |
| 380 | 380 | MDRV_VIDEO_UPDATE(epos) |
| r1877 | r1878 | |
|---|---|---|
| 238 | 238 | ADDRESS_MAP_END |
| 239 | 239 | |
| 240 | 240 | static WRITE8_HANDLER( mrflea_data0_w ){ |
| 241 | AY8910_control_port_0_w( offset, mrflea_select0 ); | |
| 242 | AY8910_write_port_0_w( offset, data ); | |
| 241 | AY8910_control_port_0_w( machine, offset, mrflea_select0 ); | |
| 242 | AY8910_write_port_0_w( machine, offset, data ); | |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | static WRITE8_HANDLER( mrflea_data1_w ){ |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | static WRITE8_HANDLER( mrflea_data2_w ){ |
| 249 | AY8910_control_port_1_w( offset, mrflea_select2 ); | |
| 250 | AY8910_write_port_1_w( offset, data ); | |
| 249 | AY8910_control_port_1_w( machine, offset, mrflea_select2 ); | |
| 250 | AY8910_write_port_1_w( machine, offset, data ); | |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | static WRITE8_HANDLER( mrflea_data3_w ){ |
| 254 | AY8910_control_port_2_w( offset, mrflea_select3 ); | |
| 255 | AY8910_write_port_2_w( offset, data ); | |
| 254 | AY8910_control_port_2_w( machine, offset, mrflea_select3 ); | |
| 255 | AY8910_write_port_2_w( machine, offset, data ); | |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | static ADDRESS_MAP_START( writeport_io, ADDRESS_SPACE_IO, 8 ) |
| r1877 | r1878 | |
| 278 | 278 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz? */ |
| 279 | 279 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 280 | 280 | MDRV_CPU_IO_MAP(readport,writeport) |
| 281 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 281 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 282 | 282 | |
| 283 | 283 | MDRV_CPU_ADD(Z80, 6000000) |
| 284 | 284 | MDRV_CPU_PROGRAM_MAP(readmem_io,writemem_io) |
| 285 | 285 | MDRV_CPU_IO_MAP(readport_io,writeport_io) |
| 286 | MDRV_CPU_VBLANK_INT(mrflea_io_interrupt,2) | |
| 286 | MDRV_CPU_VBLANK_INT_HACK(mrflea_io_interrupt,2) | |
| 287 | 287 | |
| 288 | 288 | MDRV_INTERLEAVE(100) |
| 289 | 289 |
| r1877 | r1878 | |
|---|---|---|
| 377 | 377 | |
| 378 | 378 | static UINT32* cps3_mame_colours;//[0x20000]; // actual values to write to 32-bit bitmap |
| 379 | 379 | |
| 380 | static | |
| 380 | static | |
| 381 | 381 | static rectangle renderbuffer_clip; |
| 382 | 382 | |
| 383 | 383 | |
| r1877 | r1878 | |
| 386 | 386 | #define CPS3_TRANSPARENCY_PEN_INDEX 2 |
| 387 | 387 | #define CPS3_TRANSPARENCY_PEN_INDEX_BLEND 3 |
| 388 | 388 | |
| 389 | INLINE void cps3_drawgfxzoom( | |
| 389 | INLINE void cps3_drawgfxzoom( | |
| 390 | 390 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 391 | 391 | const rectangle *clip,int transparency,int transparent_color, |
| 392 | int scalex, int scaley, | |
| 392 | int scalex, int scaley, | |
| 393 | 393 | { |
| 394 | 394 | rectangle myclip; |
| 395 | 395 | |
| r1877 | r1878 | |
| 941 | 941 | |
| 942 | 942 | // the 0x400 bit in the tilemap regs is "draw it upside-down" (bios tilemap during flashing, otherwise capcom logo is flipped) |
| 943 | 943 | |
| 944 | static void cps3_draw_tilemapsprite_line(int tmnum, int drawline, | |
| 944 | static void cps3_draw_tilemapsprite_line(int tmnum, int drawline, | |
| 945 | 945 | { |
| 946 | 946 | UINT32* tmapregs[4] = { tilemap20_regs_base, tilemap30_regs_base, tilemap40_regs_base, tilemap50_regs_base }; |
| 947 | 947 | UINT32* regs; |
| r1877 | r1878 | |
| 1241 | 1241 | |
| 1242 | 1242 | if (current_ypos&0x200) current_ypos-=0x400; |
| 1243 | 1243 | |
| 1244 | //if ( (whichbpp) && ( | |
| 1244 | //if ( (whichbpp) && (vid | |
| 1245 | 1245 | |
| 1246 | 1246 | /* use the palette value from the main list or the sublists? */ |
| 1247 | 1247 | if (whichpal) |
| r1877 | r1878 | |
| 1914 | 1914 | |
| 1915 | 1915 | static READ32_HANDLER( cps3_cdrom_r ) |
| 1916 | 1916 | { |
| 1917 | ||
| 1918 | 1917 | UINT32 retval = 0; |
| 1919 | 1918 | |
| 1920 | 1919 | if (ACCESSING_MSB32) |
| 1921 | 1920 | { |
| 1922 | retval |= ((UINT16)wd33c93_r(0))<<16; | |
| 1921 | retval |= ((UINT16)wd33c93_r(machine,0))<<16; | |
| 1923 | 1922 | } |
| 1924 | 1923 | |
| 1925 | 1924 | if (ACCESSING_LSB32) |
| 1926 | 1925 | { |
| 1927 | retval |= (UINT16)wd33c93_r(1); | |
| 1926 | retval |= (UINT16)wd33c93_r(machine,1); | |
| 1928 | 1927 | } |
| 1929 | 1928 | |
| 1930 | 1929 | return retval; |
| r1877 | r1878 | |
| 1934 | 1933 | { |
| 1935 | 1934 | if (ACCESSING_MSB32) |
| 1936 | 1935 | { |
| 1937 | wd33c93_w(0,(data & 0x00ff0000)>>16); | |
| 1936 | wd33c93_w(machine,0,(data & 0x00ff0000)>>16); | |
| 1938 | 1937 | } |
| 1939 | 1938 | |
| 1940 | 1939 | if (ACCESSING_LSB32) |
| 1941 | 1940 | { |
| 1942 | wd33c93_w(1,(data & 0x000000ff)>>0); | |
| 1941 | wd33c93_w(machine,1,(data & 0x000000ff)>>0); | |
| 1943 | 1942 | } |
| 1944 | 1943 | } |
| 1945 | 1944 | |
| r1877 | r1878 | |
| 2726 | 2725 | /* basic machine hardware */ |
| 2727 | 2726 | MDRV_CPU_ADD_TAG("main", SH2, 6250000*4) // external clock is 6.25 Mhz, it sets the intenral multiplier to 4x (this should probably be handled in the core..) |
| 2728 | 2727 | MDRV_CPU_PROGRAM_MAP(cps3_map,0) |
| 2729 | MDRV_CPU_VBLANK_INT(cps3_vbl_interrupt | |
| 2728 | MDRV_CPU_VBLANK_INT("main", cps3_vbl_interrupt | |
| 2730 | 2729 | MDRV_CPU_PERIODIC_INT(cps3_other_interrupt,80) /* ?source? */ |
| 2731 | 2730 | |
| 2732 | 2731 | /* video hardware */ |
| r1877 | r1878 | |
|---|---|---|
| 204 | 204 | /* basic machine hardware */ |
| 205 | 205 | MDRV_CPU_ADD(M68000,24000000/2) /* 12 MHz (M680000 P12) */ |
| 206 | 206 | MDRV_CPU_PROGRAM_MAP(glass_readmem,glass_writemem) |
| 207 | MDRV_CPU_VBLANK_INT(glass_interrupt | |
| 207 | MDRV_CPU_VBLANK_INT("main", glass_interrupt | |
| 208 | 208 | |
| 209 | 209 | MDRV_MACHINE_RESET(glass) |
| 210 | 210 |
| r1877 | r1878 | |
|---|---|---|
| 273 | 273 | /* update the different PIA pins from the input ports */ |
| 274 | 274 | |
| 275 | 275 | /* CA1 - copy of PA1 (COIN1) */ |
| 276 | pia_1_ca1_w(0, input_port_0_r(0) & 0x02); | |
| 276 | pia_1_ca1_w(machine, 0, input_port_0_r(machine, 0) & 0x02); | |
| 277 | 277 | |
| 278 | 278 | /* CA2 - copy of PA0 (SERVICE1) */ |
| 279 | pia_1_ca2_w(0, input_port_0_r(0) & 0x01); | |
| 279 | pia_1_ca2_w(machine, 0, input_port_0_r(machine, 0) & 0x01); | |
| 280 | 280 | |
| 281 | 281 | /* CB1 - (crosshatch) */ |
| 282 | pia_1_cb1_w(0, input_port_5_r(0)); | |
| 282 | pia_1_cb1_w(machine, 0, input_port_5_r(machine, 0)); | |
| 283 | 283 | |
| 284 | 284 | /* CB2 - NOT CONNECTED */ |
| 285 | 285 | } |
| r1877 | r1878 | |
| 345 | 345 | |
| 346 | 346 | static void ic60_74123_output_changed(int output) |
| 347 | 347 | { |
| 348 | pia_2_ca1_w(0, output); | |
| 348 | pia_2_ca1_w(Machine, 0, output); | |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | |
| r1877 | r1878 | |
| 410 | 410 | #define NUM_PENS (8) |
| 411 | 411 | |
| 412 | 412 | |
| 413 | static WRITE8_HANDLER( spiders_mc6845_address_w ) | |
| 414 | { | |
| 415 | mc6845_address_w(mc6845, data); | |
| 416 | } | |
| 417 | ||
| 418 | ||
| 419 | static READ8_HANDLER( spiders_mc6845_register_r ) | |
| 420 | { | |
| 421 | return mc6845_register_r(mc6845); | |
| 422 | } | |
| 423 | ||
| 424 | ||
| 425 | static WRITE8_HANDLER( spiders_mc6845_register_w ) | |
| 426 | { | |
| 427 | mc6845_register_w(mc6845, data); | |
| 428 | } | |
| 429 | ||
| 430 | ||
| 431 | 413 | static WRITE8_HANDLER( flipscreen_w ) |
| 432 | 414 | { |
| 433 | 415 | flipscreen = data; |
| 434 | 416 | } |
| 435 | 417 | |
| 436 | 418 | |
| 437 | static | |
| 419 | static MC6845_BEGIN_UPDATE( | |
| 438 | 420 | { |
| 439 | 421 | /* create the pens */ |
| 440 | 422 | offs_t i; |
| r1877 | r1878 | |
| 449 | 431 | } |
| 450 | 432 | |
| 451 | 433 | |
| 452 | static void update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect, | |
| 453 | UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) | |
| 434 | static MC6845_UPDATE_ROW( update_row ) | |
| 454 | 435 | { |
| 455 | 436 | UINT8 cx; |
| 456 | 437 | |
| r1877 | r1878 | |
| 509 | 490 | } |
| 510 | 491 | |
| 511 | 492 | |
| 512 | static | |
| 493 | static MC6845_ON_DE_CHANGED( display_enable_changed | |
| 513 | 494 | { |
| 514 | 495 | TTL74123_A_w(0, display_enabled); |
| 515 | 496 | } |
| r1877 | r1878 | |
| 523 | 504 | begin_update, /* before pixel update callback */ |
| 524 | 505 | update_row, /* row update callback */ |
| 525 | 506 | 0, /* after pixel update callback */ |
| 526 | display_enable_changed /* call back for display state changes */ | |
| 507 | display_enable_changed, /* callback for display state changes */ | |
| 508 | NULL, /* HSYNC callback */ | |
| 509 | NULL /* VSYNC callback */ | |
| 527 | 510 | }; |
| 528 | 511 | |
| 529 | 512 | |
| r1877 | r1878 | |
| 590 | 573 | |
| 591 | 574 | static ADDRESS_MAP_START( spiders_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 592 | 575 | AM_RANGE(0x0000, 0xbfff) AM_RAM AM_BASE(&spiders_ram) |
| 593 | AM_RANGE(0xc000, 0xc000) AM_WRITE(spiders_mc6845_address_w) | |
| 594 | AM_RANGE(0xc001, 0xc001) AM_READWRITE(spiders_mc6845_register_r, spiders_mc6845_register_w) | |
| 576 | AM_RANGE(0xc000, 0xc000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 577 | AM_RANGE(0xc001, 0xc001) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 595 | 578 | AM_RANGE(0xc020, 0xc027) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 596 | 579 | AM_RANGE(0xc044, 0xc047) AM_READWRITE(pia_1_r, pia_1_w) |
| 597 | 580 | AM_RANGE(0xc048, 0xc04b) AM_READWRITE(pia_2_alt_r, pia_2_alt_w) |
| r1877 | r1878 | |
|---|---|---|
| 161 | 161 | |
| 162 | 162 | static WRITE16_HANDLER( mcat_soundlatch_w ) |
| 163 | 163 | { |
| 164 | soundlatch_w(0, data); | |
| 165 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 164 | soundlatch_w(machine, 0, data); | |
| 165 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | #if 0 // mcat only.. install read handler? |
| r1877 | r1878 | |
| 180 | 180 | |
| 181 | 181 | static READ16_HANDLER( mcat_wd_r ) |
| 182 | 182 | { |
| 183 | watchdog_reset_r(0); | |
| 183 | watchdog_reset_r(machine,0); | |
| 184 | 184 | return 0xc00; |
| 185 | 185 | } |
| 186 | 186 | |
| r1877 | r1878 | |
| 495 | 495 | /* basic machine hardware */ |
| 496 | 496 | MDRV_CPU_ADD(M68000, XTAL_16MHz) /* verified on pcb */ |
| 497 | 497 | MDRV_CPU_PROGRAM_MAP(mcatadv_readmem,mcatadv_writemem) |
| 498 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 498 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 499 | 499 | |
| 500 | 500 | MDRV_CPU_ADD_TAG("sound", Z80, XTAL_16MHz/4) /* verified on pcb */ |
| 501 | 501 | MDRV_CPU_PROGRAM_MAP(mcatadv_sound_readmem,mcatadv_sound_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 39 | 39 | #include "starcas.lh" |
| 40 | 40 | #include "solarq.lh" |
| 41 | 41 | |
| 42 | #define MASTER_CLOCK XTAL_19_923MHz | |
| 42 | 43 | |
| 44 | ||
| 45 | ||
| 43 | 46 | static UINT16 *rambase; |
| 44 | 47 | |
| 45 | 48 | static UINT8 coin_detected; |
| 46 | static UINT8 coin_last_input; | |
| 47 | 49 | static UINT8 coin_last_reset; |
| 48 | 50 | |
| 49 | 51 | static UINT8 mux_select; |
| r1877 | r1878 | |
| 59 | 61 | static MACHINE_START( cinemat ) |
| 60 | 62 | { |
| 61 | 63 | state_save_register_global(coin_detected); |
| 62 | state_save_register_global(coin_last_input); | |
| 63 | 64 | state_save_register_global(coin_last_reset); |
| 64 | 65 | state_save_register_global(mux_select); |
| 65 | 66 | } |
| r1877 | r1878 | |
| 69 | 70 | { |
| 70 | 71 | /* reset the coin states */ |
| 71 | 72 | coin_detected = 0; |
| 72 | coin_last_input = 0x80; | |
| 73 | 73 | coin_last_reset = 0; |
| 74 | 74 | |
| 75 | 75 | /* reset mux select */ |
| r1877 | r1878 | |
| 104 | 104 | * |
| 105 | 105 | *************************************/ |
| 106 | 106 | |
| 107 | static IN | |
| 107 | static IN | |
| 108 | 108 | { |
| 109 | UINT8 new_input = readinputportbytag("SWITCHES") & 0x80; | |
| 110 | ||
| 111 | 109 | /* on the falling edge of a new coin, set the coin_detected flag */ |
| 112 | if ( | |
| 110 | if ( | |
| 113 | 111 | coin_detected = 1; |
| 114 | coin_last_input = new_input; | |
| 115 | 112 | } |
| 116 | 113 | |
| 117 | 114 | |
| r1877 | r1878 | |
| 140 | 137 | static WRITE8_HANDLER( mux_select_w ) |
| 141 | 138 | { |
| 142 | 139 | mux_select = data; |
| 143 | cinemat_sound_control_w(0x07, data); | |
| 140 | cinemat_sound_control_w(machine, 0x07, data); | |
| 144 | 141 | } |
| 145 | 142 | |
| 146 | 143 | |
| r1877 | r1878 | |
| 271 | 268 | |
| 272 | 269 | static READ8_HANDLER( qb3_frame_r ) |
| 273 | 270 | { |
| 271 | attotime next_update = video_screen_get_time_until_update(0); | |
| 272 | attotime frame_period = video_screen_get_frame_period(0); | |
| 273 | int percent = next_update.attoseconds / (frame_period.attoseconds / 100); | |
| 274 | ||
| 274 | 275 | /* note this is just an approximation... */ |
| 275 | return | |
| 276 | return (p | |
| 276 | 277 | } |
| 277 | 278 | |
| 278 | 279 | |
| r1877 | r1878 | |
| 370 | 371 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 371 | 372 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 372 | 373 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 373 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 374 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 374 | 375 | INPUT_PORTS_END |
| 375 | 376 | |
| 376 | 377 | |
| r1877 | r1878 | |
| 415 | 416 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 416 | 417 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 417 | 418 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 418 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 419 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 419 | 420 | INPUT_PORTS_END |
| 420 | 421 | |
| 421 | 422 | |
| r1877 | r1878 | |
| 448 | 449 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 449 | 450 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 450 | 451 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 451 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 452 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 452 | 453 | |
| 453 | 454 | PORT_START_TAG("WHEEL") |
| 454 | 455 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_RESET |
| r1877 | r1878 | |
| 493 | 494 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 494 | 495 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 495 | 496 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 496 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_ | |
| 497 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANG | |
| 497 | 498 | INPUT_PORTS_END |
| 498 | 499 | |
| 499 | 500 | |
| r1877 | r1878 | |
| 537 | 538 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 538 | 539 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 539 | 540 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 540 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 541 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 541 | 542 | |
| 542 | 543 | PORT_START_TAG("PAD1") |
| 543 | 544 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 Pad 1") PORT_CODE(KEYCODE_7_PAD) PORT_PLAYER(1) |
| r1877 | r1878 | |
| 593 | 594 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 594 | 595 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 595 | 596 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 596 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 597 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 597 | 598 | |
| 598 | 599 | PORT_START_TAG("ANALOGX") |
| 599 | 600 | PORT_BIT( 0xfff, 0x800, IPT_AD_STICK_X ) PORT_MINMAX(0x200,0xe00) PORT_SENSITIVITY(100) PORT_KEYDELTA(50) |
| r1877 | r1878 | |
| 638 | 639 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 639 | 640 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 640 | 641 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 641 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 642 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 642 | 643 | INPUT_PORTS_END |
| 643 | 644 | |
| 644 | 645 | |
| r1877 | r1878 | |
| 674 | 675 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 675 | 676 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 676 | 677 | PORT_SERVICE( 0x40, IP_ACTIVE_HIGH ) |
| 677 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 678 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 678 | 679 | INPUT_PORTS_END |
| 679 | 680 | |
| 680 | 681 | |
| r1877 | r1878 | |
| 710 | 711 | PORT_DIPSETTING( 0x00, "Individual" ) |
| 711 | 712 | PORT_DIPSETTING( 0x20, "Combined" ) |
| 712 | 713 | PORT_SERVICE( 0x40, IP_ACTIVE_LOW ) |
| 713 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 714 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 714 | 715 | INPUT_PORTS_END |
| 715 | 716 | |
| 716 | 717 | |
| r1877 | r1878 | |
| 747 | 748 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 748 | 749 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 749 | 750 | PORT_SERVICE( 0x40, IP_ACTIVE_HIGH ) |
| 750 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 751 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 751 | 752 | INPUT_PORTS_END |
| 752 | 753 | |
| 753 | 754 | |
| r1877 | r1878 | |
| 781 | 782 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 782 | 783 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 783 | 784 | PORT_SERVICE( 0x40, IP_ACTIVE_HIGH ) |
| 784 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 785 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 785 | 786 | INPUT_PORTS_END |
| 786 | 787 | |
| 787 | 788 | |
| r1877 | r1878 | |
| 817 | 818 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 818 | 819 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 819 | 820 | PORT_SERVICE( 0x40, IP_ACTIVE_LOW ) |
| 820 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 821 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 821 | 822 | |
| 822 | 823 | PORT_START_TAG("DIAL") |
| 823 | 824 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_REVERSE PORT_SENSITIVITY(100) PORT_KEYDELTA(5) |
| r1877 | r1878 | |
| 859 | 860 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 860 | 861 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 861 | 862 | PORT_SERVICE( 0x40, IP_ACTIVE_LOW ) |
| 862 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 863 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 863 | 864 | INPUT_PORTS_END |
| 864 | 865 | |
| 865 | 866 | |
| r1877 | r1878 | |
| 901 | 902 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) |
| 902 | 903 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 903 | 904 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 904 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 905 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 905 | 906 | INPUT_PORTS_END |
| 906 | 907 | |
| 907 | 908 | |
| r1877 | r1878 | |
| 947 | 948 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 948 | 949 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 949 | 950 | PORT_SERVICE( 0x40, IP_ACTIVE_LOW ) |
| 950 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 951 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 951 | 952 | INPUT_PORTS_END |
| 952 | 953 | |
| 953 | 954 | |
| r1877 | r1878 | |
| 983 | 984 | static MACHINE_DRIVER_START( cinemat_nojmi_4k ) |
| 984 | 985 | |
| 985 | 986 | /* basic machine hardware */ |
| 986 | MDRV_CPU_ADD_TAG("main", CCPU, | |
| 987 | MDRV_CPU_ADD_TAG("main", CCPU, MASTER_CLOCK/4) | |
| 987 | 988 | MDRV_CPU_CONFIG(config_nojmi) |
| 988 | 989 | MDRV_CPU_PROGRAM_MAP(program_map_4k,0) |
| 989 | 990 | MDRV_CPU_DATA_MAP(data_map,0) |
| 990 | 991 | MDRV_CPU_IO_MAP(io_map,0) |
| 991 | MDRV_CPU_VBLANK_INT(check_coins,1) | |
| 992 | 992 | |
| 993 | 993 | MDRV_MACHINE_START(cinemat) |
| 994 | 994 | MDRV_MACHINE_RESET(cinemat) |
| 995 | 995 | |
| 996 | 996 | /* video hardware */ |
| 997 | MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) | |
| 998 | ||
| 997 | 999 | MDRV_SCREEN_ADD("main", VECTOR) |
| 998 | MDRV_SCREEN_REFRESH_RATE(38) | |
| 999 | MDRV_SCREEN_SIZE(400, 300) | |
| 1000 | MDRV_SCREEN_REFRESH_RATE(MASTER_CLOCK/4/16/16/16/16/2) | |
| 1001 | MDRV_SCREEN_SIZE(1024, 768) | |
| 1000 | 1002 | MDRV_SCREEN_VISIBLE_AREA(0, 1023, 0, 767) |
| 1001 | 1003 | |
| 1002 | 1004 | MDRV_VIDEO_START(cinemat_bilevel) |
| 1003 | MDRV_VIDEO_EOF(cinemat) | |
| 1004 | MDRV_VIDEO_UPDATE(vector) | |
| 1005 | MDRV_VIDEO_UPDATE(cinemat) | |
| 1005 | 1006 | MACHINE_DRIVER_END |
| 1006 | 1007 | |
| 1007 | 1008 |
| r1877 | r1878 | |
|---|---|---|
| 376 | 376 | |
| 377 | 377 | |
| 378 | 378 | /***************** Sound stuff *****************/ |
| 379 | void dogyuun_okisnd_w(int data); | |
| 380 | void kbash_okisnd_w(int data); | |
| 381 | void fixeight_okisnd_w(int data); | |
| 382 | void batsugun_okisnd_w(int data); | |
| 379 | void dogyuun_okisnd_w(running_machine *machine, int data); | |
| 380 | void kbash_okisnd_w(running_machine *machine, int data); | |
| 381 | void fixeight_okisnd_w(running_machine *machine, int data); | |
| 382 | void batsugun_okisnd_w(running_machine *machine, int data); | |
| 383 | 383 | |
| 384 | 384 | |
| 385 | 385 | /*************************************************************************** |
| r1877 | r1878 | |
| 655 | 655 | { |
| 656 | 656 | if (ACCESSING_LSB) |
| 657 | 657 | { |
| 658 | toaplan2_coin_w(offset, data & 0xff); | |
| 658 | toaplan2_coin_w(machine, offset, data & 0xff); | |
| 659 | 659 | } |
| 660 | 660 | if (ACCESSING_MSB && (data & 0xff00) ) |
| 661 | 661 | { |
| r1877 | r1878 | |
| 667 | 667 | { |
| 668 | 668 | if (ACCESSING_LSB) |
| 669 | 669 | { |
| 670 | toaplan2_coin_w(offset, data & 0xff); | |
| 670 | toaplan2_coin_w(machine, offset, data & 0xff); | |
| 671 | 671 | OKIM6295_set_bank_base(0, (((data & 0x10) >> 4) * 0x40000)); |
| 672 | 672 | } |
| 673 | 673 | if (ACCESSING_MSB && (data & 0xff00) ) |
| r1877 | r1878 | |
| 721 | 721 | } |
| 722 | 722 | if (mcu_data == 0xff) mcu_data = 0x10; |
| 723 | 723 | else mcu_data = 0x00; |
| 724 | return ( mcu_data | input_port_6_r(0) ); | |
| 724 | return ( mcu_data | input_port_6_r(machine,0) ); | |
| 725 | 725 | } |
| 726 | 726 | |
| 727 | 727 | static READ16_HANDLER( pipibibi_z80_status_r ) |
| r1877 | r1878 | |
| 741 | 741 | { |
| 742 | 742 | INT8 value, new_value; |
| 743 | 743 | |
| 744 | new_value = input_port_7_r(0); | |
| 744 | new_value = input_port_7_r(machine,0); | |
| 745 | 745 | if (new_value == old_p1_paddle_h) return 0; |
| 746 | 746 | value = new_value - old_p1_paddle_h; |
| 747 | 747 | old_p1_paddle_h = new_value; |
| r1877 | r1878 | |
| 752 | 752 | { |
| 753 | 753 | INT8 value, new_value; |
| 754 | 754 | |
| 755 | new_value = input_port_8_r(0); | |
| 755 | new_value = input_port_8_r(machine,0); | |
| 756 | 756 | if (new_value == old_p2_paddle_h) return 0; |
| 757 | 757 | value = new_value - old_p2_paddle_h; |
| 758 | 758 | old_p2_paddle_h = new_value; |
| r1877 | r1878 | |
| 886 | 886 | if (ACCESSING_LSB) |
| 887 | 887 | { |
| 888 | 888 | mcu_data = data; |
| 889 | dogyuun_okisnd_w(data); | |
| 889 | dogyuun_okisnd_w(machine, data); | |
| 890 | 890 | } |
| 891 | 891 | logerror("PC:%06x Writing command (%04x) to the NEC V25+ secondary CPU port\n",activecpu_get_previouspc(),mcu_data); |
| 892 | 892 | } |
| r1877 | r1878 | |
| 905 | 905 | { |
| 906 | 906 | if (ACCESSING_LSB) |
| 907 | 907 | { |
| 908 | kbash_okisnd_w(data); | |
| 908 | kbash_okisnd_w(machine, data); | |
| 909 | 909 | } |
| 910 | 910 | logerror("PC:%06x Writing Sound command (%04x) to the NEC V25+ secondary CPU\n",activecpu_get_previouspc(),data); |
| 911 | 911 | } |
| r1877 | r1878 | |
| 942 | 942 | if (mcu_data & 0xff00) |
| 943 | 943 | { |
| 944 | 944 | mcu_data = (mcu_data & 0xff00) | (data & 0xff); |
| 945 | fixeight_okisnd_w(data); | |
| 945 | fixeight_okisnd_w(machine, data); | |
| 946 | 946 | } |
| 947 | 947 | else if (mcu_data == 0xff00) |
| 948 | 948 | { |
| r1877 | r1878 | |
| 986 | 986 | if (ACCESSING_LSB) |
| 987 | 987 | { |
| 988 | 988 | mcu_data = data; |
| 989 | batsugun_okisnd_w(data); | |
| 989 | batsugun_okisnd_w(machine, data); | |
| 990 | 990 | } |
| 991 | 991 | logerror("PC:%06x Writing command (%04x) to the NEC V25+ secondary CPU port %02x\n",activecpu_get_previouspc(),mcu_data,(offset*2)); |
| 992 | 992 | } |
| r1877 | r1878 | |
| 1050 | 1050 | { |
| 1051 | 1051 | if (ACCESSING_LSB) |
| 1052 | 1052 | { |
| 1053 | soundlatch_w(offset, data & 0xff); | |
| 1054 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 1053 | soundlatch_w(machine, offset, data & 0xff); | |
| 1054 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 1055 | 1055 | } |
| 1056 | 1056 | } |
| 1057 | 1057 | |
| r1877 | r1878 | |
| 1097 | 1097 | |
| 1098 | 1098 | static WRITE8_HANDLER( raizing_okim6295_bankselect_0 ) |
| 1099 | 1099 | { |
| 1100 | NMK112_okibank_w(0, data & 0x0f); // chip 0 bank 0 | |
| 1101 | NMK112_okibank_w(1, (data >> 4) & 0x0f); // chip 0 bank 1 | |
| 1100 | NMK112_okibank_w(machine, 0, data & 0x0f); // chip 0 bank 0 | |
| 1101 | NMK112_okibank_w(machine, 1, (data >> 4) & 0x0f); // chip 0 bank 1 | |
| 1102 | 1102 | } |
| 1103 | 1103 | |
| 1104 | 1104 | static WRITE8_HANDLER( raizing_okim6295_bankselect_1 ) |
| 1105 | 1105 | { |
| 1106 | NMK112_okibank_w(2, data & 0x0f); // chip 0 bank 2 | |
| 1107 | NMK112_okibank_w(3, (data >> 4) & 0x0f); // chip 0 bank 3 | |
| 1106 | NMK112_okibank_w(machine, 2, data & 0x0f); // chip 0 bank 2 | |
| 1107 | NMK112_okibank_w(machine, 3, (data >> 4) & 0x0f); // chip 0 bank 3 | |
| 1108 | 1108 | } |
| 1109 | 1109 | |
| 1110 | 1110 | static WRITE8_HANDLER( raizing_okim6295_bankselect_2 ) |
| 1111 | 1111 | { |
| 1112 | NMK112_okibank_w(4, data & 0x0f); // chip 1 bank 0 | |
| 1113 | NMK112_okibank_w(5, (data >> 4) & 0x0f); // chip 1 bank 1 | |
| 1112 | NMK112_okibank_w(machine, 4, data & 0x0f); // chip 1 bank 0 | |
| 1113 | NMK112_okibank_w(machine, 5, (data >> 4) & 0x0f); // chip 1 bank 1 | |
| 1114 | 1114 | } |
| 1115 | 1115 | |
| 1116 | 1116 | static WRITE8_HANDLER( raizing_okim6295_bankselect_3 ) |
| 1117 | 1117 | { |
| 1118 | NMK112_okibank_w(6, data & 0x0f); // chip 1 bank 2 | |
| 1119 | NMK112_okibank_w(7, (data >> 4) & 0x0f); // chip 1 bank 3 | |
| 1118 | NMK112_okibank_w(machine, 6, data & 0x0f); // chip 1 bank 2 | |
| 1119 | NMK112_okibank_w(machine, 7, (data >> 4) & 0x0f); // chip 1 bank 3 | |
| 1120 | 1120 | } |
| 1121 | 1121 | |
| 1122 | 1122 | |
| r1877 | r1878 | |
| 1178 | 1178 | { |
| 1179 | 1179 | if (ACCESSING_LSB) |
| 1180 | 1180 | { |
| 1181 | soundlatch_w(offset, data & 0xff); | |
| 1182 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 1181 | soundlatch_w(machine, offset, data & 0xff); | |
| 1182 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 1183 | 1183 | } |
| 1184 | 1184 | } |
| 1185 | 1185 | |
| r1877 | r1878 | |
| 1188 | 1188 | { |
| 1189 | 1189 | if (ACCESSING_LSB) |
| 1190 | 1190 | { |
| 1191 | soundlatch2_w(offset, data & 0xff); | |
| 1192 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 1191 | soundlatch2_w(machine, offset, data & 0xff); | |
| 1192 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); | |
| 1193 | 1193 | } |
| 1194 | 1194 | } |
| 1195 | 1195 | |
| r1877 | r1878 | |
| 3297 | 3297 | /* basic machine hardware */ |
| 3298 | 3298 | MDRV_CPU_ADD(M68000, 10000000) /* 10MHz Oscillator */ |
| 3299 | 3299 | MDRV_CPU_PROGRAM_MAP(tekipaki_68k_mem, 0) |
| 3300 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4 | |
| 3300 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4 | |
| 3301 | 3301 | |
| 3302 | 3302 | #if HD64x180 |
| 3303 | 3303 | MDRV_CPU_ADD(Z180, 10000000) /* HD647180 CPU actually */ |
| r1877 | r1878 | |
| 3336 | 3336 | /* basic machine hardware */ |
| 3337 | 3337 | MDRV_CPU_ADD(M68000, XTAL_10MHz) /* verified on pcb */ |
| 3338 | 3338 | MDRV_CPU_PROGRAM_MAP(ghox_68k_mem, 0) |
| 3339 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4 | |
| 3339 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4 | |
| 3340 | 3340 | |
| 3341 | 3341 | #if HD64x180 |
| 3342 | 3342 | MDRV_CPU_ADD(Z180, XTAL_10MHz) /* HD647180 CPU actually */ |
| r1877 | r1878 | |
| 3374 | 3374 | /* basic machine hardware */ |
| 3375 | 3375 | MDRV_CPU_ADD(M68000, XTAL_25MHz/2) /* verified on pcb */ |
| 3376 | 3376 | MDRV_CPU_PROGRAM_MAP(dogyuun_68k_mem, 0) |
| 3377 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4 | |
| 3377 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4 | |
| 3378 | 3378 | |
| 3379 | 3379 | #if V25 |
| 3380 | 3380 | MDRV_CPU_ADD(Z180, XTAL_25MHz/2) /* NEC V25+ type Toaplan marked CPU ??? */ |
| r1877 | r1878 | |
| 3417 | 3417 | /* basic machine hardware */ |
| 3418 | 3418 | MDRV_CPU_ADD(M68000, 16000000) /* 16MHz Oscillator */ |
| 3419 | 3419 | MDRV_CPU_PROGRAM_MAP(kbash_68k_mem, 0) |
| 3420 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4 | |
| 3420 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4 | |
| 3421 | 3421 | |
| 3422 | 3422 | #if V25 |
| 3423 | 3423 | MDRV_CPU_ADD(Z180, 16000000) /* NEC V25+ type Toaplan marked CPU ??? */ |
| r1877 | r1878 | |
| 3459 | 3459 | /* basic machine hardware */ |
| 3460 | 3460 | MDRV_CPU_ADD(M68000, 16000000) /* 16MHz Oscillator */ |
| 3461 | 3461 | MDRV_CPU_PROGRAM_MAP(kbash2_68k_mem, 0) |
| 3462 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4 | |
| 3462 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4 | |
| 3463 | 3463 | |
| 3464 | 3464 | MDRV_MACHINE_RESET(toaplan2) |
| 3465 | 3465 | |
| r1877 | r1878 | |
| 3497 | 3497 | /* basic machine hardware */ |
| 3498 | 3498 | MDRV_CPU_ADD(M68000, XTAL_16MHz) /* verified on pcb */ |
| 3499 | 3499 | MDRV_CPU_PROGRAM_MAP(truxton2_68k_mem, 0) |
| 3500 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq2 | |
| 3500 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq2 | |
| 3501 | 3501 | |
| 3502 | 3502 | MDRV_MACHINE_RESET(toaplan2) |
| 3503 | 3503 | |
| r1877 | r1878 | |
| 3534 | 3534 | /* basic machine hardware */ |
| 3535 | 3535 | MDRV_CPU_ADD(M68000, XTAL_10MHz) /* verified on pcb */ |
| 3536 | 3536 | MDRV_CPU_PROGRAM_MAP(pipibibs_68k_mem, 0) |
| 3537 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4 | |
| 3537 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4 | |
| 3538 | 3538 | |
| 3539 | 3539 | MDRV_CPU_ADD(Z80,XTAL_27MHz/8) /* verified on pcb */ |
| 3540 | 3540 | MDRV_CPU_PROGRAM_MAP(sound_z80_mem, 0) |
| r1877 | r1878 | |
| 3573 | 3573 | /* basic machine hardware */ |
| 3574 | 3574 | MDRV_CPU_ADD(M68000, 10000000) /* 10MHz Oscillator */ |
| 3575 | 3575 | MDRV_CPU_PROGRAM_MAP(tekipaki_68k_mem, 0) |
| 3576 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4 | |
| 3576 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4 | |
| 3577 | 3577 | |
| 3578 | 3578 | MDRV_CPU_ADD(Z80, 27000000/8) /* This should be a HD647180 */ |
| 3579 | 3579 | /* Change this to 10MHz when HD647180 gets dumped. 10MHz Oscillator */ |
| r1877 | r1878 | |
| 3613 | 3613 | /* basic machine hardware */ |
| 3614 | 3614 | MDRV_CPU_ADD(M68000, 10000000) /* 10MHz Oscillator */ |
| 3615 | 3615 | MDRV_CPU_PROGRAM_MAP(pipibibi_68k_mem, 0) |
| 3616 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4 | |
| 3616 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4 | |
| 3617 | 3617 | |
| 3618 | 3618 | MDRV_CPU_ADD(Z80,27000000/8) /* ??? 3.37MHz */ |
| 3619 | 3619 | MDRV_CPU_PROGRAM_MAP(sound_z80_mem, 0) |
| r1877 | r1878 | |
| 3652 | 3652 | /* basic machine hardware */ |
| 3653 | 3653 | MDRV_CPU_ADD(M68000, XTAL_16MHz) /* verified on pcb */ |
| 3654 | 3654 | MDRV_CPU_PROGRAM_MAP(fixeight_68k_mem, 0) |
| 3655 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4 | |
| 3655 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4 | |
| 3656 | 3656 | |
| 3657 | 3657 | #if V25 |
| 3658 | 3658 | MDRV_CPU_ADD(Z180, XTAL_16MHz) /* NEC V25+ type Toaplan marked CPU ??? */ |
| r1877 | r1878 | |
| 3695 | 3695 | /* basic machine hardware */ |
| 3696 | 3696 | MDRV_CPU_ADD(M68000, 10000000) /* 10MHz Oscillator */ |
| 3697 | 3697 | MDRV_CPU_PROGRAM_MAP(fixeighb_68k_mem, 0) |
| 3698 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq2 | |
| 3698 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq2 | |
| 3699 | 3699 | |
| 3700 | 3700 | MDRV_MACHINE_RESET(toaplan2) |
| 3701 | 3701 | |
| r1877 | r1878 | |
| 3729 | 3729 | /* basic machine hardware */ |
| 3730 | 3730 | MDRV_CPU_ADD(M68000, 10000000) /* 10MHz Oscillator */ |
| 3731 | 3731 | MDRV_CPU_PROGRAM_MAP(vfive_68k_mem, 0) |
| 3732 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4 | |
| 3732 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4 | |
| 3733 | 3733 | |
| 3734 | 3734 | #if V25 |
| 3735 | 3735 | MDRV_CPU_ADD(Z180, 10000000) /* NEC V25+ type Toaplan marked CPU ??? */ |
| r1877 | r1878 | |
| 3768 | 3768 | /* basic machine hardware */ |
| 3769 | 3769 | MDRV_CPU_ADD(M68000,32000000/2) /* 16MHz , 32MHz Oscillator */ |
| 3770 | 3770 | MDRV_CPU_PROGRAM_MAP(batsugun_68k_mem, 0) |
| 3771 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4 | |
| 3771 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4 | |
| 3772 | 3772 | |
| 3773 | 3773 | #if V25 |
| 3774 | 3774 | MDRV_CPU_ADD(Z180, 32000000/2) /* NEC V25+ type Toaplan marked CPU ??? */ |
| r1877 | r1878 | |
| 3811 | 3811 | /* basic machine hardware */ |
| 3812 | 3812 | MDRV_CPU_ADD(M68000, 16000000) |
| 3813 | 3813 | MDRV_CPU_PROGRAM_MAP(snowbro2_68k_mem, 0) |
| 3814 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4 | |
| 3814 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4 | |
| 3815 | 3815 | |
| 3816 | 3816 | MDRV_MACHINE_RESET(toaplan2) |
| 3817 | 3817 | |
| r1877 | r1878 | |
| 3848 | 3848 | /* basic machine hardware */ |
| 3849 | 3849 | MDRV_CPU_ADD(M68000,32000000/2) /* 16MHz , 32MHz Oscillator */ |
| 3850 | 3850 | MDRV_CPU_PROGRAM_MAP(mahoudai_68k_mem, 0) |
| 3851 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4 | |
| 3851 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4 | |
| 3852 | 3852 | |
| 3853 | 3853 | MDRV_CPU_ADD(Z80,32000000/8) /* 4MHz , 32MHz Oscillator */ |
| 3854 | 3854 | MDRV_CPU_PROGRAM_MAP(raizing_sound_z80_mem, 0) |
| r1877 | r1878 | |
| 3890 | 3890 | /* basic machine hardware */ |
| 3891 | 3891 | MDRV_CPU_ADD(M68000,32000000/2) /* 16MHz , 32MHz Oscillator */ |
| 3892 | 3892 | MDRV_CPU_PROGRAM_MAP(shippumd_68k_mem, 0) |
| 3893 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4 | |
| 3893 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4 | |
| 3894 | 3894 | |
| 3895 | 3895 | MDRV_CPU_ADD(Z80,32000000/8) /* 4MHz , 32MHz Oscillator */ |
| 3896 | 3896 | MDRV_CPU_PROGRAM_MAP(raizing_sound_z80_mem, 0) |
| r1877 | r1878 | |
| 3932 | 3932 | /* basic machine hardware */ |
| 3933 | 3933 | MDRV_CPU_ADD(M68000,32000000/2) /* 16MHz , 32MHz Oscillator */ |
| 3934 | 3934 | MDRV_CPU_PROGRAM_MAP(bgaregga_68k_mem, 0) |
| 3935 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4 | |
| 3935 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq4 | |
| 3936 | 3936 | |
| 3937 | 3937 | MDRV_CPU_ADD(Z80,32000000/8) /* 4MHz , 32MHz Oscillator */ |
| 3938 | 3938 | MDRV_CPU_PROGRAM_MAP(bgaregga_sound_z80_mem, 0) |
| r1877 | r1878 | |
| 3974 | 3974 | /* basic machine hardware */ |
| 3975 | 3975 | MDRV_CPU_ADD(M68000,32000000/2) /* 16MHz , 32MHz Oscillator */ |
| 3976 | 3976 | MDRV_CPU_PROGRAM_MAP(batrider_68k_mem, 0) |
| 3977 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq2 | |
| 3977 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq2 | |
| 3978 | 3978 | |
| 3979 | 3979 | MDRV_CPU_ADD(Z80,32000000/8) /* 4MHz , 32MHz Oscillator */ |
| 3980 | 3980 | MDRV_CPU_PROGRAM_MAP(batrider_sound_z80_mem, 0) |
| r1877 | r1878 | |
| 4019 | 4019 | /* basic machine hardware */ |
| 4020 | 4020 | MDRV_CPU_ADD(M68000,32000000/2) |
| 4021 | 4021 | MDRV_CPU_PROGRAM_MAP(bbakraid_68k_mem, 0) |
| 4022 | MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq | |
| 4022 | MDRV_CPU_VBLANK_INT("main", toaplan2_vblank_irq | |
| 4023 | 4023 | |
| 4024 | 4024 | MDRV_CPU_ADD(Z80,32000000/4) |
| 4025 | 4025 | MDRV_CPU_PROGRAM_MAP(bbakraid_sound_z80_mem, 0) |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | static MACHINE_DRIVER_START( ddz ) |
| 55 | 55 | MDRV_CPU_ADD(SE3208, 43000000) |
| 56 | 56 | MDRV_CPU_PROGRAM_MAP(ddz_mem,0) |
| 57 | MDRV_CPU_VBLANK_INT(ddz_interrupt | |
| 57 | MDRV_CPU_VBLANK_INT("main", ddz_interrupt | |
| 58 | 58 | |
| 59 | 59 | //MDRV_MACHINE_RESET(ddz) |
| 60 | 60 |
| r1877 | r1878 | |
|---|---|---|
| 356 | 356 | MDRV_CPU_ADD(Z80,10000000/2) /* 5 MHz ??? */ |
| 357 | 357 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 358 | 358 | MDRV_CPU_IO_MAP(readport,writeport) |
| 359 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 359 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 360 | 360 | |
| 361 | 361 | MDRV_NVRAM_HANDLER(mjkjidai) |
| 362 | 362 |
| r1877 | r1878 | |
|---|---|---|
| 417 | 417 | skns_spc_regs = auto_malloc (0x40); |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | extern void skns_draw_sprites(running_machine *machine, | |
| 420 | extern void skns_draw_sprites(running_machine *machine, | |
| 421 | 421 | |
| 422 | 422 | |
| 423 | 423 | static VIDEO_UPDATE(jchan) |
| r1877 | r1878 | |
| 749 | 749 | |
| 750 | 750 | MDRV_CPU_ADD(M68000, 16000000) |
| 751 | 751 | MDRV_CPU_PROGRAM_MAP(jchan_main,0) |
| 752 | MDRV_CPU_VBLANK_INT(jchan_vblank, 2) | |
| 752 | MDRV_CPU_VBLANK_INT_HACK(jchan_vblank, 2) | |
| 753 | 753 | |
| 754 | 754 | MDRV_CPU_ADD(M68000, 16000000) |
| 755 | 755 | MDRV_CPU_PROGRAM_MAP(jchan_sub,0) |
| r1877 | r1878 | |
|---|---|---|
| 243 | 243 | /* basic machine hardware */ |
| 244 | 244 | MDRV_CPU_ADD(M6809, MASTER_CLOCK/12) |
| 245 | 245 | MDRV_CPU_PROGRAM_MAP(jailbrek_map, 0) |
| 246 | MDRV_CPU_VBLANK_INT(jb_interrupt | |
| 246 | MDRV_CPU_VBLANK_INT("main", jb_interrupt | |
| 247 | 247 | MDRV_CPU_PERIODIC_INT(jb_interrupt_nmi, 500) /* ? */ |
| 248 | 248 | |
| 249 | 249 | MDRV_MACHINE_START(jailbrek) |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | ---- ---- xxxx xxxx tile number |
| 55 | 55 | */ |
| 56 | 56 | |
| 57 | static WRITE8_HANDLER( couple_mc6845_address_w ) | |
| 58 | { | |
| 59 | mc6845_address_w(mc6845, data); | |
| 60 | } | |
| 61 | ||
| 62 | static WRITE8_HANDLER( couple_mc6845_register_w ) | |
| 63 | { | |
| 64 | mc6845_register_w(mc6845, data); | |
| 65 | } | |
| 66 | ||
| 67 | 57 | static TILE_GET_INFO( get_tile_info ) |
| 68 | 58 | { |
| 69 | 59 | UINT16 vram_data = (((vram_hi[tile_index] & 0xff) << 8) | (vram_lo[tile_index] & 0xff)); |
| r1877 | r1878 | |
| 158 | 148 | // AM_RANGE( 0xc000, 0xc00f ) AM_READ(dummy_inputs_r) |
| 159 | 149 | // AM_RANGE( 0xc008, 0xc008 ) AM_READ(input_port_0_r) |
| 160 | 150 | // AM_RANGE( 0xc00a, 0xc00a ) AM_READ(input_port_1_r) |
| 161 | AM_RANGE( 0xe000, 0xe000 ) AM_WRITE(couple_mc6845_address_w) | |
| 162 | AM_RANGE( 0xe001, 0xe001 ) AM_WRITE(couple_mc6845_register_w) | |
| 151 | AM_RANGE( 0xe000, 0xe000 ) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 152 | AM_RANGE( 0xe001, 0xe001 ) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 163 | 153 | AM_RANGE( 0xe800, 0xefff ) AM_READWRITE(MRA8_RAM, couple_vram_hi_w) AM_BASE(&vram_hi) |
| 164 | 154 | AM_RANGE( 0xf000, 0xf7ff ) AM_READWRITE(MRA8_RAM, couple_vram_lo_w) AM_BASE(&vram_lo) |
| 165 | 155 | AM_RANGE( 0xf800, 0xfbff ) AM_RAM /*extra VRAM?*/ |
| r1877 | r1878 | |
| 445 | 435 | MDRV_CPU_ADD(Z80,18432000/6) /* ?? */ |
| 446 | 436 | MDRV_CPU_PROGRAM_MAP(merit_mem,0) |
| 447 | 437 | MDRV_CPU_IO_MAP(merit_io,0) |
| 448 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 438 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 449 | 439 | |
| 450 | 440 | MDRV_MACHINE_RESET(couple) |
| 451 | 441 |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | static WRITE8_HANDLER( sgladiat_soundlatch_w ) |
| 62 | 62 | { |
| 63 | 63 | snk_sound_busy_bit = 0x20; |
| 64 | soundlatch_w( offset, data ); | |
| 64 | soundlatch_w( machine, offset, data ); | |
| 65 | 65 | |
| 66 | 66 | /* trigger NMI on sound CPU */ |
| 67 | cpunum_set_input_line( | |
| 67 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE); // safer because NMI can be lost in rare occations | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | static READ8_HANDLER( sgladiat_soundlatch_r ) |
| 71 | 71 | { |
| 72 | 72 | snk_sound_busy_bit = 0; |
| 73 | return(soundlatch_r(0)); | |
| 73 | return(soundlatch_r(machine,0)); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | static READ8_HANDLER( sgladiat_sound_nmi_ack_r ) |
| r1877 | r1878 | |
| 147 | 147 | /* basic machine hardware */ |
| 148 | 148 | MDRV_CPU_ADD(Z80, 4000000) |
| 149 | 149 | MDRV_CPU_PROGRAM_MAP(sgladiat_cpuA_map,0) |
| 150 | // MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 150 | // MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 151 | 151 | |
| 152 | 152 | MDRV_CPU_ADD(Z80, 5000000) |
| 153 | 153 | MDRV_CPU_PROGRAM_MAP(sgladiat_cpuB_map,0) |
| 154 | MDRV_CPU_VBLANK_INT(snk_irq_BA | |
| 154 | MDRV_CPU_VBLANK_INT("main", snk_irq_BA | |
| 155 | 155 | |
| 156 | 156 | MDRV_CPU_ADD(Z80, 4000000) |
| 157 | 157 | MDRV_CPU_PROGRAM_MAP(sgladiat_sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 13 | 13 | static UINT16 * ml_tileram; |
| 14 | 14 | static UINT16 * ml_spriteram; |
| 15 | 15 | static UINT16 * ml_unk; |
| 16 | static | |
| 16 | static | |
| 17 | 17 | #define ML_CHARS 0x2000 |
| 18 | 18 | static UINT8 dirtychar[ML_CHARS]; |
| 19 | 19 | static int status_bit; |
| r1877 | r1878 | |
| 363 | 363 | /* basic machine hardware */ |
| 364 | 364 | MDRV_CPU_ADD(M68000, 12000000 ) /* 12 MHz ??? (guess) */ |
| 365 | 365 | MDRV_CPU_PROGRAM_MAP(mlanding_mem, 0) |
| 366 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 366 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 367 | 367 | |
| 368 | 368 | MDRV_CPU_ADD(Z80, 4000000 ) /* 4 MHz ??? (guess) */ |
| 369 | 369 | MDRV_CPU_PROGRAM_MAP(mlanding_z80_mem,0) |
| 370 | 370 | |
| 371 | 371 | MDRV_CPU_ADD(M68000, 12000000 ) /* 12 MHz ??? (guess) */ |
| 372 | 372 | MDRV_CPU_PROGRAM_MAP(mlanding_sub_mem,0) |
| 373 | MDRV_CPU_VBLANK_INT(irq6_line_hold,7) | |
| 373 | MDRV_CPU_VBLANK_INT_HACK(irq6_line_hold,7) | |
| 374 | 374 | |
| 375 | 375 | MDRV_CPU_ADD(Z80, 4000000 ) /* 4 MHz ??? (guess) */ |
| 376 | 376 | MDRV_CPU_PROGRAM_MAP(mlanding_z80_sub_mem,0) |
| 377 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 377 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 378 | 378 | |
| 379 | 379 | /* video hardware */ |
| 380 | 380 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 77 | 77 | static WRITE16_HANDLER( bigkarnk_sound_command_w ) |
| 78 | 78 | { |
| 79 | 79 | if (ACCESSING_LSB){ |
| 80 | soundlatch_w(0,data & 0xff); | |
| 81 | cpunum_set_input_line(Machine, 1,M6809_FIRQ_LINE,HOLD_LINE); | |
| 80 | soundlatch_w(machine,0,data & 0xff); | |
| 81 | cpunum_set_input_line(machine, 1,M6809_FIRQ_LINE,HOLD_LINE); | |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
| r1877 | r1878 | |
| 211 | 211 | TILELAYOUT8(0x100000); |
| 212 | 212 | TILELAYOUT16(0x100000); |
| 213 | 213 | |
| 214 | GFXDECODEINFO(0x100000,64) | |
| 214 | GFXDECODEINFO(0x100000,64) | |
| 215 | 215 | |
| 216 | 216 | |
| 217 | 217 | static MACHINE_DRIVER_START( bigkarnk ) |
| r1877 | r1878 | |
| 219 | 219 | /* basic machine hardware */ |
| 220 | 220 | MDRV_CPU_ADD(M68000, 10000000) /* MC68000P10, 10 MHz */ |
| 221 | 221 | MDRV_CPU_PROGRAM_MAP(bigkarnk_readmem,bigkarnk_writemem) |
| 222 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 222 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 223 | 223 | |
| 224 | 224 | MDRV_CPU_ADD(M6809, 8867000/4) /* 68B09, 2.21675 MHz? */ |
| 225 | 225 | /* audio CPU */ |
| r1877 | r1878 | |
| 474 | 474 | /* basic machine hardware */ |
| 475 | 475 | MDRV_CPU_ADD(M68000,24000000/2) /* 12 MHz */ |
| 476 | 476 | MDRV_CPU_PROGRAM_MAP(maniacsq_readmem,maniacsq_writemem) |
| 477 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 477 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 478 | 478 | |
| 479 | 479 | /* video hardware */ |
| 480 | 480 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 1110 | 1110 | /* basic machine hardware */ |
| 1111 | 1111 | MDRV_CPU_ADD(M68000, 12000000) /* MC68000P12, 12 MHz */ |
| 1112 | 1112 | MDRV_CPU_PROGRAM_MAP(squash_readmem,squash_writemem) |
| 1113 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 1113 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 1114 | 1114 | |
| 1115 | 1115 | MDRV_INTERLEAVE(10) |
| 1116 | 1116 | |
| r1877 | r1878 | |
| 1278 | 1278 | /* basic machine hardware */ |
| 1279 | 1279 | MDRV_CPU_ADD(M68000, 12000000) /* MC68000P12, 12 MHz */ |
| 1280 | 1280 | MDRV_CPU_PROGRAM_MAP(squash_readmem,thoop_writemem) |
| 1281 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 1281 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 1282 | 1282 | |
| 1283 | 1283 | MDRV_INTERLEAVE(10) |
| 1284 | 1284 |
| r1877 | r1878 | |
|---|---|---|
| 275 | 275 | MDRV_CPU_ADD(Z80, BANKP_CPU_CLOCK) |
| 276 | 276 | MDRV_CPU_PROGRAM_MAP(bankp_map, 0) |
| 277 | 277 | MDRV_CPU_IO_MAP(bankp_io_map, 0) |
| 278 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 278 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 279 | 279 | |
| 280 | 280 | /* video hardware */ |
| 281 | 281 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 91 | 91 | switch (offset) |
| 92 | 92 | { |
| 93 | 93 | case 0: /* 0xe000 interrupt enable */ |
| 94 | interrupt_enable_w(0,data); | |
| 94 | interrupt_enable_w(machine,0,data); | |
| 95 | 95 | break; |
| 96 | 96 | |
| 97 | 97 | case 1: /* 0xe001 (value 0 then 1) written right after the soundlatch_w */ |
| r1877 | r1878 | |
| 369 | 369 | /* basic machine hardware */ |
| 370 | 370 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz ? */ |
| 371 | 371 | MDRV_CPU_PROGRAM_MAP( readmem, writemem ) |
| 372 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 372 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 373 | 373 | |
| 374 | 374 | MDRV_CPU_ADD(Z80, 4000000) /* 3.072 MHz ? */ |
| 375 | 375 | MDRV_CPU_PROGRAM_MAP( readmem2, writemem2 ) |
| r1877 | r1878 | |
|---|---|---|
| 408 | 408 | { |
| 409 | 409 | switch ( (wecleman_selected_ip >> 5) & 3 ) |
| 410 | 410 | { // From WEC Le Mans Schems: |
| 411 | case 0: return input_port_4_r(offset); // Accel - Schems: Accelevr | |
| 411 | case 0: return input_port_4_r(machine, offset); // Accel - Schems: Accelevr | |
| 412 | 412 | case 1: return ~0; // ????? - Schems: Not Used |
| 413 | case 2: return input_port_5_r(offset); // Wheel - Schems: Handlevr | |
| 413 | case 2: return input_port_5_r(machine, offset); // Wheel - Schems: Handlevr | |
| 414 | 414 | case 3: return ~0; // Table - Schems: Turnvr |
| 415 | 415 | |
| 416 | 416 | default: return ~0; |
| r1877 | r1878 | |
| 563 | 563 | |
| 564 | 564 | static READ16_HANDLER( hotchase_K051316_0_r ) |
| 565 | 565 | { |
| 566 | return K051316_0_r(offset) & 0xff; | |
| 566 | return K051316_0_r(machine, offset) & 0xff; | |
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | static READ16_HANDLER( hotchase_K051316_1_r ) |
| 570 | 570 | { |
| 571 | return K051316_1_r(offset) & 0xff; | |
| 571 | return K051316_1_r(machine, offset) & 0xff; | |
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | static WRITE16_HANDLER( hotchase_K051316_0_w ) |
| 575 | 575 | { |
| 576 | if (ACCESSING_LSB) K051316_0_w(offset, data & 0xff); | |
| 576 | if (ACCESSING_LSB) K051316_0_w(machine, offset, data & 0xff); | |
| 577 | 577 | } |
| 578 | 578 | |
| 579 | 579 | static WRITE16_HANDLER( hotchase_K051316_1_w ) |
| 580 | 580 | { |
| 581 | if (ACCESSING_LSB) K051316_1_w(offset, data & 0xff); | |
| 581 | if (ACCESSING_LSB) K051316_1_w(machine, offset, data & 0xff); | |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 | static WRITE16_HANDLER( hotchase_K051316_ctrl_0_w ) |
| 585 | 585 | { |
| 586 | if (ACCESSING_LSB) K051316_ctrl_0_w(offset, data & 0xff); | |
| 586 | if (ACCESSING_LSB) K051316_ctrl_0_w(machine, offset, data & 0xff); | |
| 587 | 587 | } |
| 588 | 588 | |
| 589 | 589 | static WRITE16_HANDLER( hotchase_K051316_ctrl_1_w ) |
| 590 | 590 | { |
| 591 | if (ACCESSING_LSB) K051316_ctrl_1_w(offset, data & 0xff); | |
| 591 | if (ACCESSING_LSB) K051316_ctrl_1_w(machine, offset, data & 0xff); | |
| 592 | 592 | } |
| 593 | 593 | |
| 594 | 594 | static WRITE16_HANDLER( hotchase_soundlatch_w ); |
| r1877 | r1878 | |
| 651 | 651 | { |
| 652 | 652 | if (ACCESSING_LSB) |
| 653 | 653 | { |
| 654 | soundlatch_w(0,data & 0xFF); | |
| 655 | cpunum_set_input_line(Machine, 2,0, HOLD_LINE); | |
| 654 | soundlatch_w(machine,0,data & 0xFF); | |
| 655 | cpunum_set_input_line(machine, 2,0, HOLD_LINE); | |
| 656 | 656 | } |
| 657 | 657 | } |
| 658 | 658 | |
| r1877 | r1878 | |
| 719 | 719 | { |
| 720 | 720 | if (ACCESSING_LSB) |
| 721 | 721 | { |
| 722 | soundlatch_w(0,data & 0xFF); | |
| 723 | cpunum_set_input_line(Machine, 2,M6809_IRQ_LINE, HOLD_LINE); | |
| 722 | soundlatch_w(machine,0,data & 0xFF); | |
| 723 | cpunum_set_input_line(machine, 2,M6809_IRQ_LINE, HOLD_LINE); | |
| 724 | 724 | } |
| 725 | 725 | } |
| 726 | 726 | |
| r1877 | r1878 | |
| 791 | 791 | #define HOTCHASE_K007232_RW(_chip_) \ |
| 792 | 792 | static READ8_HANDLER( hotchase_K007232_##_chip_##_r ) \ |
| 793 | 793 | { \ |
| 794 | return K007232_read_port_##_chip_##_r(offset ^ 1); \ | |
| 794 | return K007232_read_port_##_chip_##_r(machine, offset ^ 1); \ | |
| 795 | 795 | } \ |
| 796 | 796 | static WRITE8_HANDLER( hotchase_K007232_##_chip_##_w ) \ |
| 797 | 797 | { \ |
| 798 | K007232_write_port_##_chip_##_w(offset ^ 1, data); \ | |
| 798 | K007232_write_port_##_chip_##_w(machine, offset ^ 1, data); \ | |
| 799 | 799 | } \ |
| 800 | 800 | |
| 801 | 801 | /* 3 x K007232 */ |
| r1877 | r1878 | |
| 1115 | 1115 | /* basic machine hardware */ |
| 1116 | 1116 | MDRV_CPU_ADD(M68000, 10000000) /* Schems show 10MHz */ |
| 1117 | 1117 | MDRV_CPU_PROGRAM_MAP(wecleman_map,0) |
| 1118 | MDRV_CPU_VBLANK_INT(wecleman_interrupt,5 + 1) /* in order to read the inputs once per frame */ | |
| 1118 | MDRV_CPU_VBLANK_INT_HACK(wecleman_interrupt,5 + 1) /* in order to read the inputs once per frame */ | |
| 1119 | 1119 | |
| 1120 | 1120 | MDRV_CPU_ADD(M68000, 10000000) /* Schems show 10MHz */ |
| 1121 | 1121 | MDRV_CPU_PROGRAM_MAP(wecleman_sub_map,0) |
| r1877 | r1878 | |
| 1172 | 1172 | /* basic machine hardware */ |
| 1173 | 1173 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz - PCB is drawn in one set's readme */ |
| 1174 | 1174 | MDRV_CPU_PROGRAM_MAP(hotchase_map,0) |
| 1175 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 1175 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 1176 | 1176 | |
| 1177 | 1177 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz - PCB is drawn in one set's readme */ |
| 1178 | 1178 | MDRV_CPU_PROGRAM_MAP(hotchase_sub_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 166 | 166 | sound_global_enable((data & 0x02) ? TRUE : FALSE); |
| 167 | 167 | |
| 168 | 168 | /* D2 - unlabeled - music enable */ |
| 169 | crbaloon_audio_set_music_enable((data & 0x04) ? TRUE : FALSE); | |
| 169 | crbaloon_audio_set_music_enable(machine, (data & 0x04) ? TRUE : FALSE); | |
| 170 | 170 | |
| 171 | 171 | /* D3 - EXPLOSION */ |
| 172 | 172 | crbaloon_audio_set_explosion_enable((data & 0x08) ? TRUE : FALSE); |
| r1877 | r1878 | |
| 178 | 178 | crbaloon_audio_set_appear_enable((data & 0x20) ? TRUE : FALSE); |
| 179 | 179 | |
| 180 | 180 | /* D6 - unlabeled - laugh enable */ |
| 181 | crbaloon_audio_set_laugh_enable((data & 0x40) ? TRUE : FALSE); | |
| 181 | crbaloon_audio_set_laugh_enable(machine, (data & 0x40) ? TRUE : FALSE); | |
| 182 | 182 | |
| 183 | 183 | /* D7 - unlabeled - goes to PC3259 pin 16 */ |
| 184 | 184 | |
| r1877 | r1878 | |
| 188 | 188 | |
| 189 | 189 | static WRITE8_HANDLER( port_music_w ) |
| 190 | 190 | { |
| 191 | crbaloon_audio_set_music_freq(data); | |
| 191 | crbaloon_audio_set_music_freq(machine, data); | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | |
| r1877 | r1878 | |
| 220 | 220 | ADDRESS_MAP_FLAGS( AMEF_ABITS(4) ) |
| 221 | 221 | AM_RANGE(0x00, 0x00) AM_MIRROR(0x0c) AM_READ(port_tag_to_handler8("DSW0")) |
| 222 | 222 | AM_RANGE(0x01, 0x01) AM_MIRROR(0x0c) AM_READ(port_tag_to_handler8("IN0")) |
| 223 | /* AM_SPACE(0x02, 0x03) AM_READ(pc3259_r) crashes if not at the end */ | |
| 223 | AM_RANGE(0x02, 0x02) AM_MIRROR(0x0c) AM_MASK(0x0c) AM_READ(pc3259_r) | |
| 224 | // AM_SPACE(0x02, 0x03) AM_READ(pc3259_r) crashes if not at the end | |
| 224 | 225 | AM_RANGE(0x03, 0x03) AM_MIRROR(0x0c) AM_READ(port_tag_to_handler8("IN1")) |
| 225 | 226 | |
| 226 | 227 | AM_RANGE(0x00, 0x00) AM_WRITE(MWA8_NOP) /* not connected */ |
| r1877 | r1878 | |
| 232 | 233 | AM_RANGE(0x0c, 0x0c) AM_WRITE(MWA8_NOP) /* MSK - to PC3259 */ |
| 233 | 234 | AM_RANGE(0x0d, 0x0d) AM_WRITE(MWA8_NOP) /* schematics has it in a box marked "NOT USE" */ |
| 234 | 235 | AM_RANGE(0x0e, 0x0f) AM_WRITE(MWA8_NOP) |
| 235 | ||
| 236 | AM_SPACE(0x02, 0x03) AM_READ(pc3259_r) | |
| 237 | 236 | ADDRESS_MAP_END |
| 238 | 237 | |
| 239 | 238 | |
| r1877 | r1878 | |
| 347 | 346 | static MACHINE_RESET( crballoon ) |
| 348 | 347 | { |
| 349 | 348 | pc3092_reset(); |
| 350 | port_sound_w(0, 0); | |
| 351 | port_music_w(0, 0); | |
| 349 | port_sound_w(machine, 0, 0); | |
| 350 | port_music_w(machine, 0, 0); | |
| 352 | 351 | } |
| 353 | 352 | |
| 354 | 353 | |
| r1877 | r1878 | |
| 365 | 364 | MDRV_CPU_ADD(Z80, CRBALOON_MASTER_XTAL / 3) |
| 366 | 365 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 367 | 366 | MDRV_CPU_IO_MAP(main_io_map,0) |
| 368 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 367 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 369 | 368 | |
| 370 | 369 | MDRV_MACHINE_RESET(crballoon) |
| 371 | 370 |
| r1877 | r1878 | |
|---|---|---|
| 178 | 178 | /* basic machine hardware */ |
| 179 | 179 | MDRV_CPU_ADD(Z80,8000000) /* ? MHz */ |
| 180 | 180 | MDRV_CPU_PROGRAM_MAP(memmap,0) |
| 181 | MDRV_CPU_VBLANK_INT(dderby_interrupt | |
| 181 | MDRV_CPU_VBLANK_INT("main", dderby_interrupt | |
| 182 | 182 | |
| 183 | 183 | /* video hardware */ |
| 184 | 184 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 204 | 204 | MDRV_CPU_ADD(Z80, 19968000/8) /* 2.496 MHz ? */ |
| 205 | 205 | MDRV_CPU_PROGRAM_MAP(readmem_pastelg, writemem_pastelg) |
| 206 | 206 | MDRV_CPU_IO_MAP(readport_pastelg, writeport_pastelg) |
| 207 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt,96) // nmiclock not written, chip is 1411M1 instead of 1413M3 | |
| 208 | MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 1) | |
| 207 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt,96) // nmiclock not written, chip is 1411M1 instead of 1413M3 | |
| 208 | MDRV_CPU_VBLANK_INT("main", nb1413m3_interrupt) | |
| 209 | 209 | |
| 210 | 210 | MDRV_MACHINE_RESET(nb1413m3) |
| 211 | 211 | MDRV_NVRAM_HANDLER(nb1413m3) |
| r1877 | r1878 | |
|---|---|---|
| 469 | 469 | static void update_vblank_irq(void); |
| 470 | 470 | static void galileo_reset(void); |
| 471 | 471 | static TIMER_CALLBACK( galileo_timer_callback ); |
| 472 | static void galileo_perform_dma(int which); | |
| 472 | static void galileo_perform_dma(running_machine *machine, int which); | |
| 473 | 473 | static void voodoo_stall(int stall); |
| 474 | 474 | static void widget_reset(void); |
| 475 | 475 | static void update_widget_irq(void); |
| r1877 | r1878 | |
| 652 | 652 | |
| 653 | 653 | static READ32_HANDLER( interrupt_state2_r ) |
| 654 | 654 | { |
| 655 | UINT32 result = interrupt_state_r(offset, mem_mask); | |
| 655 | UINT32 result = interrupt_state_r(machine, offset, mem_mask); | |
| 656 | 656 | result |= vblank_state << 8; |
| 657 | 657 | return result; |
| 658 | 658 | } |
| r1877 | r1878 | |
| 973 | 973 | } |
| 974 | 974 | |
| 975 | 975 | |
| 976 | static void galileo_perform_dma(int which) | |
| 976 | static void galileo_perform_dma(running_machine *machine, int which) | |
| 977 | 977 | { |
| 978 | 978 | do |
| 979 | 979 | { |
| r1877 | r1878 | |
| 1024 | 1024 | } |
| 1025 | 1025 | |
| 1026 | 1026 | /* write the data and advance */ |
| 1027 | voodoo_0_w((dstaddr & 0xffffff) / 4, program_read_dword(srcaddr), 0); | |
| 1027 | voodoo_0_w(machine, (dstaddr & 0xffffff) / 4, program_read_dword(srcaddr), 0); | |
| 1028 | 1028 | srcaddr += srcinc; |
| 1029 | 1029 | dstaddr += dstinc; |
| 1030 | 1030 | bytesleft -= 4; |
| r1877 | r1878 | |
| 1188 | 1188 | |
| 1189 | 1189 | /* if enabling, start the DMA */ |
| 1190 | 1190 | if (!(oldata & 0x1000) && (data & 0x1000)) |
| 1191 | galileo_perform_dma(which); | |
| 1191 | galileo_perform_dma(machine, which); | |
| 1192 | 1192 | break; |
| 1193 | 1193 | } |
| 1194 | 1194 | |
| r1877 | r1878 | |
| 1306 | 1306 | /* if we're not stalled, just write and get out */ |
| 1307 | 1307 | if (!voodoo_stalled) |
| 1308 | 1308 | { |
| 1309 | voodoo_0_w(offset, data, mem_mask); | |
| 1309 | voodoo_0_w(machine, offset, data, mem_mask); | |
| 1310 | 1310 | return; |
| 1311 | 1311 | } |
| 1312 | 1312 | |
| r1877 | r1878 | |
| 1362 | 1362 | |
| 1363 | 1363 | /* resume execution */ |
| 1364 | 1364 | cpuintrf_push_context(0); |
| 1365 | galileo_perform_dma(which); | |
| 1365 | galileo_perform_dma(Machine, which); | |
| 1366 | 1366 | cpuintrf_pop_context(); |
| 1367 | 1367 | break; |
| 1368 | 1368 | } |
| r1877 | r1878 | |
| 1372 | 1372 | { |
| 1373 | 1373 | /* if the CPU had a pending write, do it now */ |
| 1374 | 1374 | if (cpu_stalled_on_voodoo) |
| 1375 | voodoo_0_w(cpu_stalled_offset, cpu_stalled_data, cpu_stalled_mem_mask); | |
| 1375 | voodoo_0_w(Machine, cpu_stalled_offset, cpu_stalled_data, cpu_stalled_mem_mask); | |
| 1376 | 1376 | cpu_stalled_on_voodoo = FALSE; |
| 1377 | 1377 | |
| 1378 | 1378 | /* resume CPU execution */ |
| r1877 | r1878 | |
| 1473 | 1473 | static READ32_HANDLER( ethernet_r ) |
| 1474 | 1474 | { |
| 1475 | 1475 | if (!(offset & 8)) |
| 1476 | return smc91c94_r(offset & 7, mem_mask | 0x0000); | |
| 1476 | return smc91c94_r(machine, offset & 7, mem_mask | 0x0000); | |
| 1477 | 1477 | else |
| 1478 | return smc91c94_r(offset & 7, mem_mask | 0xff00); | |
| 1478 | return smc91c94_r(machine, offset & 7, mem_mask | 0xff00); | |
| 1479 | 1479 | } |
| 1480 | 1480 | |
| 1481 | 1481 | |
| 1482 | 1482 | static WRITE32_HANDLER( ethernet_w ) |
| 1483 | 1483 | { |
| 1484 | 1484 | if (!(offset & 8)) |
| 1485 | smc91c94_w(offset & 7, data & 0xffff, mem_mask | 0x0000); | |
| 1485 | smc91c94_w(machine, offset & 7, data & 0xffff, mem_mask | 0x0000); | |
| 1486 | 1486 | else |
| 1487 | smc91c94_w(offset & 7, data & 0x00ff, mem_mask | 0xff00); | |
| 1487 | smc91c94_w(machine, offset & 7, data & 0x00ff, mem_mask | 0xff00); | |
| 1488 | 1488 | } |
| 1489 | 1489 | |
| 1490 | 1490 | |
| r1877 | r1878 | |
| 1532 | 1532 | break; |
| 1533 | 1533 | |
| 1534 | 1534 | case WREG_ANALOG: |
| 1535 | result = analog_port_r(0, mem_mask); | |
| 1535 | result = analog_port_r(machine, 0, mem_mask); | |
| 1536 | 1536 | break; |
| 1537 | 1537 | |
| 1538 | 1538 | case WREG_ETHER_DATA: |
| 1539 | result = smc91c94_r(widget.ethernet_addr & 7, mem_mask & 0xffff); | |
| 1539 | result = smc91c94_r(machine, widget.ethernet_addr & 7, mem_mask & 0xffff); | |
| 1540 | 1540 | break; |
| 1541 | 1541 | } |
| 1542 | 1542 | |
| r1877 | r1878 | |
| 1563 | 1563 | break; |
| 1564 | 1564 | |
| 1565 | 1565 | case WREG_ANALOG: |
| 1566 | analog_port_w(0, data, mem_mask); | |
| 1566 | analog_port_w(machine, 0, data, mem_mask); | |
| 1567 | 1567 | break; |
| 1568 | 1568 | |
| 1569 | 1569 | case WREG_ETHER_DATA: |
| 1570 | smc91c94_w(widget.ethernet_addr & 7, data & 0xffff, mem_mask & 0xffff); | |
| 1570 | smc91c94_w(machine, widget.ethernet_addr & 7, data & 0xffff, mem_mask & 0xffff); | |
| 1571 | 1571 | break; |
| 1572 | 1572 | } |
| 1573 | 1573 | } |
| r1877 | r1878 | |
|---|---|---|
| 250 | 250 | static MACHINE_DRIVER_START( portrait ) |
| 251 | 251 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz ? */ |
| 252 | 252 | MDRV_CPU_PROGRAM_MAP(portrait_map,0) |
| 253 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 253 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 254 | 254 | |
| 255 | 255 | MDRV_CPU_ADD(I8039, 3120000) /* ? */ |
| 256 | 256 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 58 | 58 | |
| 59 | 59 | static WRITE8_HANDLER( mnchmobl_soundlatch_w ) |
| 60 | 60 | { |
| 61 | soundlatch_w( offset, data ); | |
| 62 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE ); | |
| 61 | soundlatch_w( machine, offset, data ); | |
| 62 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE ); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | static WRITE8_HANDLER( sound_nmi_ack_w ) |
| r1877 | r1878 | |
| 283 | 283 | /* basic machine hardware */ |
| 284 | 284 | MDRV_CPU_ADD(Z80, 3750000) /* ? */ |
| 285 | 285 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 286 | MDRV_CPU_VBLANK_INT(mnchmobl_interrupt,2) | |
| 286 | MDRV_CPU_VBLANK_INT_HACK(mnchmobl_interrupt,2) | |
| 287 | 287 | |
| 288 | 288 | MDRV_CPU_ADD(Z80, 3750000) /* ? */ |
| 289 | 289 | /* audio CPU */ |
| 290 | 290 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| 291 | MDRV_CPU_VBLANK_INT(nmi_line_assert | |
| 291 | MDRV_CPU_VBLANK_INT("main", nmi_line_assert | |
| 292 | 292 | |
| 293 | 293 | /* video hardware */ |
| 294 | 294 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 93 | 93 | |
| 94 | 94 | static READ8_HANDLER( funkybee_input_port_0_r ) |
| 95 | 95 | { |
| 96 | watchdog_reset_r(0); | |
| 97 | return input_port_0_r(offset); | |
| 96 | watchdog_reset_r(machine,0); | |
| 97 | return input_port_0_r(machine,offset); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | static WRITE8_HANDLER( funkybee_coin_counter_w ) |
| r1877 | r1878 | |
| 187 | 187 | PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) ) |
| 188 | 188 | INPUT_PORTS_END |
| 189 | 189 | |
| 190 | #ifdef UNUSED_DEFINITION | |
| 190 | 191 | static INPUT_PORTS_START( funkbeeb ) |
| 191 | 192 | PORT_INCLUDE(funkybee) |
| 192 | 193 | |
| r1877 | r1878 | |
| 197 | 198 | PORT_DIPSETTING( 0x10, "3" ) |
| 198 | 199 | PORT_DIPSETTING( 0x00, "4" ) |
| 199 | 200 | INPUT_PORTS_END |
| 201 | #endif | |
| 200 | 202 | |
| 201 | 203 | static INPUT_PORTS_START( skylancr ) |
| 202 | 204 | PORT_START_TAG("IN0") |
| r1877 | r1878 | |
| 306 | 308 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz */ |
| 307 | 309 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 308 | 310 | MDRV_CPU_IO_MAP(readport,writeport) |
| 309 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 311 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 310 | 312 | |
| 311 | 313 | /* video hardware */ |
| 312 | 314 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 172 | 172 | { |
| 173 | 173 | UINT16 reg = offset >> 8; |
| 174 | 174 | UINT16 val = ((offset & 0xff) << 8) | data; |
| 175 | BSMT2000_data_0_w(reg, val, 0); | |
| 175 | BSMT2000_data_0_w(machine, reg, val, 0); | |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 |
| r1877 | r1878 | |
|---|---|---|
| 143 | 143 | |
| 144 | 144 | static READ16_HANDLER( tetrisp2_sound_r ) |
| 145 | 145 | { |
| 146 | return YMZ280B_status_0_r(offset); | |
| 146 | return YMZ280B_status_0_r(machine,offset); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | static WRITE16_HANDLER( tetrisp2_sound_w ) |
| 150 | 150 | { |
| 151 | 151 | if (ACCESSING_LSB) |
| 152 | 152 | { |
| 153 | if (offset) YMZ280B_data_0_w (offset, data & 0xff); | |
| 154 | else YMZ280B_register_0_w (offset, data & 0xff); | |
| 153 | if (offset) YMZ280B_data_0_w (machine, offset, data & 0xff); | |
| 154 | else YMZ280B_register_0_w (machine, offset, data & 0xff); | |
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | |
| r1877 | r1878 | |
| 1037 | 1037 | /* basic machine hardware */ |
| 1038 | 1038 | MDRV_CPU_ADD(M68000, 12000000) |
| 1039 | 1039 | MDRV_CPU_PROGRAM_MAP(tetrisp2_readmem,tetrisp2_writemem) |
| 1040 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 1040 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 1041 | 1041 | |
| 1042 | 1042 | MDRV_NVRAM_HANDLER(tetrisp2) |
| 1043 | 1043 | |
| r1877 | r1878 | |
| 1069 | 1069 | /* basic machine hardware */ |
| 1070 | 1070 | MDRV_CPU_ADD(M68000, 12000000) |
| 1071 | 1071 | MDRV_CPU_PROGRAM_MAP(rockn1_readmem,rockn1_writemem) |
| 1072 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 1072 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 1073 | 1073 | |
| 1074 | 1074 | MDRV_NVRAM_HANDLER(tetrisp2) |
| 1075 | 1075 | |
| r1877 | r1878 | |
| 1103 | 1103 | /* basic machine hardware */ |
| 1104 | 1104 | MDRV_CPU_ADD(M68000, 12000000) |
| 1105 | 1105 | MDRV_CPU_PROGRAM_MAP(rockn2_readmem,rockn2_writemem) |
| 1106 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 1106 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 1107 | 1107 | |
| 1108 | 1108 | MDRV_NVRAM_HANDLER(tetrisp2) |
| 1109 | 1109 | |
| r1877 | r1878 | |
| 1136 | 1136 | /* basic machine hardware */ |
| 1137 | 1137 | MDRV_CPU_ADD(M68000, 12000000) |
| 1138 | 1138 | MDRV_CPU_PROGRAM_MAP(rocknms_main_readmem,rocknms_main_writemem) |
| 1139 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 1139 | MDRV_CPU_VBLANK_INT("left", irq2_line_hold | |
| 1140 | 1140 | |
| 1141 | 1141 | MDRV_CPU_ADD(M68000, 12000000) |
| 1142 | 1142 | MDRV_CPU_PROGRAM_MAP(rocknms_sub_readmem,rocknms_sub_writemem) |
| 1143 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 1143 | MDRV_CPU_VBLANK_INT("left", irq2_line_hold | |
| 1144 | 1144 | |
| 1145 | 1145 | MDRV_NVRAM_HANDLER(tetrisp2) |
| 1146 | 1146 |
| r1877 | r1878 | |
|---|---|---|
| 40 | 40 | static WRITE16_HANDLER( lastduel_sound_w ) |
| 41 | 41 | { |
| 42 | 42 | if (ACCESSING_LSB) |
| 43 | soundlatch_w(0,data & 0xff); | |
| 43 | soundlatch_w(machine,0,data & 0xff); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /******************************************************************************/ |
| r1877 | r1878 | |
| 261 | 261 | /* basic machine hardware */ |
| 262 | 262 | MDRV_CPU_ADD(M68000, 10000000) /* Could be 8 MHz */ |
| 263 | 263 | MDRV_CPU_PROGRAM_MAP(lastduel_readmem,lastduel_writemem) |
| 264 | MDRV_CPU_VBLANK_INT(lastduel_interrupt,3) /* 1 for vbl, 2 for control reads?? */ | |
| 264 | MDRV_CPU_VBLANK_INT_HACK(lastduel_interrupt,3) /* 1 for vbl, 2 for control reads?? */ | |
| 265 | 265 | |
| 266 | 266 | MDRV_CPU_ADD(Z80, 3579545) |
| 267 | 267 | /* audio CPU */ /* Accurate */ |
| r1877 | r1878 | |
| 301 | 301 | /* basic machine hardware */ |
| 302 | 302 | MDRV_CPU_ADD(M68000, 10000000) /* Accurate */ |
| 303 | 303 | MDRV_CPU_PROGRAM_MAP(madgear_readmem,madgear_writemem) |
| 304 | MDRV_CPU_VBLANK_INT(madgear_interrupt,3) /* 1 for vbl, 2 for control reads?? */ | |
| 304 | MDRV_CPU_VBLANK_INT_HACK(madgear_interrupt,3) /* 1 for vbl, 2 for control reads?? */ | |
| 305 | 305 | |
| 306 | 306 | MDRV_CPU_ADD(Z80, XTAL_3_579545MHz) /* verified on pcb */ |
| 307 | 307 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 323 | 323 | static WRITE16_HANDLER( kyros_sound_w ) |
| 324 | 324 | { |
| 325 | 325 | if(ACCESSING_MSB) |
| 326 | soundlatch_w(0, (data>>8)&0xff); | |
| 326 | soundlatch_w(machine, 0, (data>>8)&0xff); | |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | static WRITE16_HANDLER( alpha68k_II_sound_w ) |
| 330 | 330 | { |
| 331 | 331 | if(ACCESSING_LSB) |
| 332 | soundlatch_w(0, data&0xff); | |
| 332 | soundlatch_w(machine, 0, data&0xff); | |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | static WRITE16_HANDLER( alpha68k_V_sound_w ) |
| 336 | 336 | { |
| 337 | 337 | /* Sound & fix bank select are in the same word */ |
| 338 | 338 | if(ACCESSING_LSB) |
| 339 | soundlatch_w(0,data&0xff); | |
| 339 | soundlatch_w(machine,0,data&0xff); | |
| 340 | 340 | if(ACCESSING_MSB) |
| 341 | 341 | alpha68k_V_video_bank_w((data>>8)&0xff); |
| 342 | 342 | } |
| r1877 | r1878 | |
| 345 | 345 | { |
| 346 | 346 | if (ACCESSING_LSB) |
| 347 | 347 | { |
| 348 | soundlatch_w(0, data); | |
| 348 | soundlatch_w(machine, 0, data); | |
| 349 | 349 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); |
| 350 | 350 | } |
| 351 | 351 | } |
| r1877 | r1878 | |
| 354 | 354 | { |
| 355 | 355 | if (ACCESSING_LSB) |
| 356 | 356 | { |
| 357 | soundlatch_w(0, data); | |
| 357 | soundlatch_w(machine, 0, data); | |
| 358 | 358 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); |
| 359 | 359 | } |
| 360 | 360 | } |
| r1877 | r1878 | |
| 1986 | 1986 | /* basic machine hardware */ |
| 1987 | 1987 | MDRV_CPU_ADD(M68000, 6000000) /* 24MHz/4? */ |
| 1988 | 1988 | MDRV_CPU_PROGRAM_MAP(kyros_map,0) |
| 1989 | MDRV_CPU_VBLANK_INT(alpha68k_interrupt,2) | |
| 1989 | MDRV_CPU_VBLANK_INT_HACK(alpha68k_interrupt,2) | |
| 1990 | 1990 | |
| 1991 | 1991 | MDRV_CPU_ADD(Z80, 3579545) |
| 1992 | 1992 | /* audio CPU */ /* ? */ |
| 1993 | 1993 | MDRV_CPU_PROGRAM_MAP(sstingry_sound_map,0) |
| 1994 | 1994 | MDRV_CPU_IO_MAP(kyros_sound_portmap,0) |
| 1995 | 1995 | //AT |
| 1996 | MDRV_CPU_VBLANK_INT(irq0_line_hold, 2) | |
| 1996 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 2) | |
| 1997 | 1997 | MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 4000) |
| 1998 | 1998 | //ZT |
| 1999 | 1999 | |
| r1877 | r1878 | |
| 2036 | 2036 | /* basic machine hardware */ |
| 2037 | 2037 | MDRV_CPU_ADD(M68000, 6000000) /* 24MHz/4? */ |
| 2038 | 2038 | MDRV_CPU_PROGRAM_MAP(kyros_map,0) |
| 2039 | MDRV_CPU_VBLANK_INT(alpha68k_interrupt,2) | |
| 2039 | MDRV_CPU_VBLANK_INT_HACK(alpha68k_interrupt,2) | |
| 2040 | 2040 | |
| 2041 | 2041 | MDRV_CPU_ADD(Z80, 3579545) |
| 2042 | 2042 | /* audio CPU */ /* ? */ |
| 2043 | 2043 | MDRV_CPU_PROGRAM_MAP(kyros_sound_map,0) |
| 2044 | 2044 | MDRV_CPU_IO_MAP(kyros_sound_portmap,0) |
| 2045 | 2045 | //AT |
| 2046 | MDRV_CPU_VBLANK_INT(irq0_line_hold, 2) | |
| 2046 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 2) | |
| 2047 | 2047 | MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 4000) |
| 2048 | 2048 | //ZT |
| 2049 | 2049 | |
| r1877 | r1878 | |
| 2085 | 2085 | /* basic machine hardware */ |
| 2086 | 2086 | MDRV_CPU_ADD(M68000, 8000000) |
| 2087 | 2087 | MDRV_CPU_PROGRAM_MAP(kyros_map,0) |
| 2088 | MDRV_CPU_VBLANK_INT(alpha68k_interrupt,17) // must be at least 4 for the controls to be smooth | |
| 2088 | MDRV_CPU_VBLANK_INT_HACK(alpha68k_interrupt,17) // must be at least 4 for the controls to be smooth | |
| 2089 | 2089 | |
| 2090 | 2090 | MDRV_CPU_ADD(Z80, 4000000) |
| 2091 | 2091 | MDRV_CPU_PROGRAM_MAP(jongbou_sound_map,0) |
| 2092 | 2092 | MDRV_CPU_IO_MAP(jongbou_sound_portmap,0) |
| 2093 | MDRV_CPU_VBLANK_INT(irq0_line_hold, 160) // guess, controls sound speed | |
| 2093 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 160) // guess, controls sound speed | |
| 2094 | 2094 | |
| 2095 | 2095 | MDRV_MACHINE_RESET(common) |
| 2096 | 2096 | |
| r1877 | r1878 | |
| 2120 | 2120 | /* basic machine hardware */ |
| 2121 | 2121 | MDRV_CPU_ADD(M68000, 6000000) /* 24MHz/4? */ |
| 2122 | 2122 | MDRV_CPU_PROGRAM_MAP(alpha68k_I_map,0) |
| 2123 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 2123 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 2124 | 2124 | |
| 2125 | 2125 | MDRV_CPU_ADD(Z80, 4000000) // 4Mhz seems to yield the correct tone |
| 2126 | 2126 | MDRV_CPU_PROGRAM_MAP(alpha68k_I_s_map,0) |
| r1877 | r1878 | |
| 2152 | 2152 | /* basic machine hardware */ |
| 2153 | 2153 | MDRV_CPU_ADD_TAG("main", M68000, 8000000) /* Correct */ |
| 2154 | 2154 | MDRV_CPU_PROGRAM_MAP(alpha68k_II_map,0) |
| 2155 | MDRV_CPU_VBLANK_INT(irq3_line_hold | |
| 2155 | MDRV_CPU_VBLANK_INT("main", irq3_line_hold | |
| 2156 | 2156 | |
| 2157 | 2157 | MDRV_CPU_ADD(Z80, /*3579545*/3579545*2) /* Unlikely but needed to stop nested NMI's */ |
| 2158 | 2158 | /* audio CPU */ /* Correct?? */ |
| r1877 | r1878 | |
| 2192 | 2192 | static MACHINE_DRIVER_START( btlfildb ) |
| 2193 | 2193 | MDRV_IMPORT_FROM(alpha68k_II) |
| 2194 | 2194 | MDRV_CPU_MODIFY("main") |
| 2195 | MDRV_CPU_VBLANK_INT(alpha68k_interrupt,2) | |
| 2195 | MDRV_CPU_VBLANK_INT_HACK(alpha68k_interrupt,2) | |
| 2196 | 2196 | MACHINE_DRIVER_END |
| 2197 | 2197 | |
| 2198 | 2198 | //AT |
| r1877 | r1878 | |
| 2201 | 2201 | /* basic machine hardware */ |
| 2202 | 2202 | MDRV_CPU_ADD(M68000, 8000000) |
| 2203 | 2203 | MDRV_CPU_PROGRAM_MAP(alpha68k_II_map, 0) |
| 2204 | MDRV_CPU_VBLANK_INT(alpha68k_interrupt, 4) | |
| 2204 | MDRV_CPU_VBLANK_INT_HACK(alpha68k_interrupt, 4) | |
| 2205 | 2205 | |
| 2206 | 2206 | MDRV_CPU_ADD(Z80, 4000000*2) |
| 2207 | 2207 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
| 2243 | 2243 | /* basic machine hardware */ |
| 2244 | 2244 | MDRV_CPU_ADD(M68000, 10000000) /* ? */ |
| 2245 | 2245 | MDRV_CPU_PROGRAM_MAP(alpha68k_V_map,0) |
| 2246 | MDRV_CPU_VBLANK_INT(irq3_line_hold | |
| 2246 | MDRV_CPU_VBLANK_INT("main", irq3_line_hold | |
| 2247 | 2247 | |
| 2248 | 2248 | MDRV_CPU_ADD(Z80, /*3579545*/3579545*2) /* Unlikely but needed to stop nested NMI's */ |
| 2249 | 2249 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
| 2284 | 2284 | /* basic machine hardware */ |
| 2285 | 2285 | MDRV_CPU_ADD(M68000, 10000000) /* ? */ |
| 2286 | 2286 | MDRV_CPU_PROGRAM_MAP(alpha68k_V_map,0) |
| 2287 | MDRV_CPU_VBLANK_INT(irq3_line_hold | |
| 2287 | MDRV_CPU_VBLANK_INT("main", irq3_line_hold | |
| 2288 | 2288 | |
| 2289 | 2289 | MDRV_CPU_ADD(Z80, /*3579545*/3579545*2) /* Unlikely but needed to stop nested NMI's */ |
| 2290 | 2290 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
| 2325 | 2325 | /* basic machine hardware */ |
| 2326 | 2326 | MDRV_CPU_ADD(M68000, 9000000) /* Confirmed 18 MHz/2 */ |
| 2327 | 2327 | MDRV_CPU_PROGRAM_MAP(tnexspce_map,0) |
| 2328 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 2328 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 2329 | 2329 | |
| 2330 | 2330 | MDRV_CPU_ADD(Z80, 4000000) |
| 2331 | 2331 | MDRV_CPU_PROGRAM_MAP(tnexspce_sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 70 | 70 | |
| 71 | 71 | switch (drgnmst_oki_control & 0x1f) |
| 72 | 72 | { |
| 73 | case 0x12: data = (OKIM6295_status_1_r(0) & 0x0f); break; | |
| 74 | case 0x16: data = (OKIM6295_status_0_r(0) & 0x0f); break; | |
| 73 | case 0x12: data = (OKIM6295_status_1_r(machine, 0) & 0x0f); break; | |
| 74 | case 0x16: data = (OKIM6295_status_0_r(machine, 0) & 0x0f); break; | |
| 75 | 75 | case 0x0b: |
| 76 | 76 | case 0x0f: data = drgnmst_snd_command; break; |
| 77 | 77 | default: break; |
| r1877 | r1878 | |
| 151 | 151 | case 0x11: |
| 152 | 152 | // logerror("Writing %02x to OKI1",drgnmst_oki_command); |
| 153 | 153 | // logerror(", PortC=%02x, Code=%02x, Bank0=%01x, Bank1=%01x\n",drgnmst_oki_control,drgnmst_snd_command,drgnmst_oki0_bank,drgnmst_oki1_bank); |
| 154 | OKIM6295_data_1_w(0, drgnmst_oki_command); | |
| 154 | OKIM6295_data_1_w(machine, 0, drgnmst_oki_command); | |
| 155 | 155 | break; |
| 156 | 156 | case 0x15: |
| 157 | 157 | // logerror("Writing %02x to OKI0",drgnmst_oki_command); |
| 158 | 158 | // logerror(", PortC=%02x, Code=%02x, Bank0=%01x, Bank1=%01x\n",drgnmst_oki_control,drgnmst_snd_command,drgnmst_oki0_bank,drgnmst_oki1_bank); |
| 159 | OKIM6295_data_0_w(0, drgnmst_oki_command); | |
| 159 | OKIM6295_data_0_w(machine, 0, drgnmst_oki_command); | |
| 160 | 160 | break; |
| 161 | 161 | default: break; |
| 162 | 162 | } |
| r1877 | r1878 | |
| 360 | 360 | static MACHINE_DRIVER_START( drgnmst ) |
| 361 | 361 | MDRV_CPU_ADD(M68000, 12000000) /* Confirmed */ |
| 362 | 362 | MDRV_CPU_PROGRAM_MAP(drgnmst_main_map, 0) |
| 363 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 363 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 364 | 364 | |
| 365 | 365 | MDRV_CPU_ADD(PIC16C55, 32000000/8) /* Confirmed */ |
| 366 | 366 | /* Program and Data Maps are internal to the MCU */ |
| r1877 | r1878 | |
|---|---|---|
| 356 | 356 | // basic machine hardware |
| 357 | 357 | MDRV_CPU_ADD(Z80, 12000000/4) // ??? Runs far too fast |
| 358 | 358 | MDRV_CPU_PROGRAM_MAP(lucky8_map, 0) |
| 359 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 359 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 360 | 360 | |
| 361 | 361 | // video hardware |
| 362 | 362 |
| r1877 | r1878 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | static UINT8 fireone_select; |
| 53 | static read8_ | |
| 53 | static read8_machin | |
| 54 | 54 | |
| 55 | 55 | |
| 56 | 56 | |
| r1877 | r1878 | |
| 67 | 67 | { |
| 68 | 68 | switch (offset & 7) |
| 69 | 69 | { |
| 70 | case 0: starfire_vidctrl_w(0, data); break; | |
| 71 | case 1: starfire_vidctrl1_w(0, data); break; | |
| 70 | case 0: starfire_vidctrl_w(machine, 0, data); break; | |
| 71 | case 1: starfire_vidctrl1_w(machine, 0, data); break; | |
| 72 | 72 | case 2: |
| 73 | 73 | /* Sounds */ |
| 74 | 74 | fireone_select = (data & 0x8) ? 0 : 1; |
| r1877 | r1878 | |
| 86 | 86 | { |
| 87 | 87 | /* A11 selects input ports */ |
| 88 | 88 | if (offset & 0x800) |
| 89 | return (*input_read)(offset); | |
| 89 | return (*input_read)(machine, offset); | |
| 90 | 90 | |
| 91 | 91 | /* convert to a videoram offset */ |
| 92 | 92 | offset = (offset & 0x31f) | ((offset & 0xe0) << 5); |
| r1877 | r1878 | |
| 105 | 105 | { |
| 106 | 106 | switch (offset & 15) |
| 107 | 107 | { |
| 108 | case 0: return input_port_0_r(0); | |
| 109 | case 1: return input_port_1_r(0); /* Note: need to loopback sounds lengths on that one */ | |
| 110 | case 5: return input_port_4_r(0); | |
| 111 | case 6: return input_port_2_r(0); | |
| 112 | case 7: return input_port_3_r(0); | |
| 108 | case 0: return input_port_0_r(machine,0); | |
| 109 | case 1: return input_port_1_r(machine,0); /* Note: need to loopback sounds lengths on that one */ | |
| 110 | case 5: return input_port_4_r(machine,0); | |
| 111 | case 6: return input_port_2_r(machine,0); | |
| 112 | case 7: return input_port_3_r(machine,0); | |
| 113 | 113 | default: return 0xff; |
| 114 | 114 | } |
| 115 | 115 | } |
| r1877 | r1878 | |
| 132 | 132 | |
| 133 | 133 | switch (offset & 15) |
| 134 | 134 | { |
| 135 | case 0: return input_port_0_r(0); | |
| 136 | case 1: return input_port_1_r(0); | |
| 135 | case 0: return input_port_0_r(machine,0); | |
| 136 | case 1: return input_port_1_r(machine,0); | |
| 137 | 137 | case 2: |
| 138 | temp = fireone_select ? input_port_2_r(0) : input_port_3_r(0); | |
| 138 | temp = fireone_select ? input_port_2_r(machine,0) : input_port_3_r(machine,0); | |
| 139 | 139 | temp = (temp & 0xc0) | fireone_paddle_map[temp & 0x3f]; |
| 140 | 140 | return temp; |
| 141 | 141 | default: return 0xff; |
| r1877 | r1878 | |
| 265 | 265 | /* basic machine hardware */ |
| 266 | 266 | MDRV_CPU_ADD(Z80, STARFIRE_CPU_CLOCK) |
| 267 | 267 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 268 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 268 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 269 | 269 | |
| 270 | 270 | /* video hardware */ |
| 271 | 271 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 170 | 170 | |
| 171 | 171 | ***************************************************************************/ |
| 172 | 172 | |
| 173 | static | |
| 173 | static | |
| 174 | 174 | static UINT16 *tmaster_regs; |
| 175 | 175 | static UINT16 tmaster_color; |
| 176 | 176 | static UINT16 tmaster_addr; |
| r1877 | r1878 | |
| 253 | 253 | |
| 254 | 254 | UINT16 data; |
| 255 | 255 | |
| 256 | | |
| 256 | | |
| 257 | 257 | |
| 258 | 258 | buffer = (tmaster_regs[0x02/2] >> 8) & 3; // 1 bit per layer, selects the currently displayed buffer |
| 259 | 259 | sw = tmaster_regs[0x04/2]; |
| r1877 | r1878 | |
| 681 | 681 | static MACHINE_DRIVER_START( tm3k ) |
| 682 | 682 | MDRV_CPU_ADD_TAG("main", M68000, 12000000) |
| 683 | 683 | MDRV_CPU_PROGRAM_MAP(tmaster_map,0) |
| 684 | MDRV_CPU_VBLANK_INT(tm3k_interrupt,2+5+20) // ?? | |
| 684 | MDRV_CPU_VBLANK_INT_HACK(tm3k_interrupt,2+5+20) // ?? | |
| 685 | 685 | |
| 686 | 686 | MDRV_MACHINE_RESET(tmaster) |
| 687 | 687 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r1877 | r1878 | |
| 721 | 721 | static MACHINE_DRIVER_START( tm ) |
| 722 | 722 | MDRV_IMPORT_FROM(tm3k) |
| 723 | 723 | MDRV_CPU_MODIFY("main") |
| 724 | MDRV_CPU_VBLANK_INT(tm_interrupt,3+20) // ?? | |
| 724 | MDRV_CPU_VBLANK_INT_HACK(tm_interrupt,3+20) // ?? | |
| 725 | 725 | |
| 726 | 726 | MDRV_SOUND_REPLACE("OKI",OKIM6295, 1122000) |
| 727 | 727 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified |
| r1877 | r1878 | |
| 751 | 751 | static MACHINE_DRIVER_START( galgames ) |
| 752 | 752 | MDRV_CPU_ADD_TAG("main", M68000, XTAL_24MHz / 2) |
| 753 | 753 | MDRV_CPU_PROGRAM_MAP(galgames_map,0) |
| 754 | MDRV_CPU_VBLANK_INT(galgames_interrupt, 1+20) // ?? | |
| 754 | MDRV_CPU_VBLANK_INT_HACK(galgames_interrupt, 1+20) // ?? | |
| 755 | 755 | |
| 756 | 756 | MDRV_NVRAM_HANDLER( galgames ) |
| 757 | 757 | MDRV_MACHINE_RESET( galgames ) |
| r1877 | r1878 | |
|---|---|---|
| 662 | 662 | MDRV_CPU_ADD_TAG("main",Z80, 18432000/6) //confirmed |
| 663 | 663 | MDRV_CPU_PROGRAM_MAP(pbillrd_readmem,pbillrd_writemem) |
| 664 | 664 | MDRV_CPU_PERIODIC_INT(irq0_line_hold, 50*3) //?? |
| 665 | MDRV_CPU_VBLANK_INT(freekick_irqgen | |
| 665 | MDRV_CPU_VBLANK_INT("main", freekick_irqgen | |
| 666 | 666 | |
| 667 | 667 | MDRV_GFXDECODE(freekick) |
| 668 | 668 |
| r1877 | r1878 | |
|---|---|---|
| 1735 | 1735 | } |
| 1736 | 1736 | |
| 1737 | 1737 | |
| 1738 | /* CPU # 2 & 3 */ | |
| 1739 | #define CISCHEAT_SUB_INTERRUPT_NUM 1 | |
| 1740 | ||
| 1741 | 1738 | /* CPU # 4 */ |
| 1742 | 1739 | #define CISCHEAT_SOUND_INTERRUPT_NUM 16 |
| 1743 | 1740 | |
| r1877 | r1878 | |
| 1752 | 1749 | /* basic machine hardware */ |
| 1753 | 1750 | MDRV_CPU_ADD_TAG("cpu1", M68000, 10000000) |
| 1754 | 1751 | MDRV_CPU_PROGRAM_MAP(bigrun_readmem,bigrun_writemem) |
| 1755 | MDRV_CPU_VBLANK_INT(cischeat_interrupt,CISCHEAT_INTERRUPT_NUM) | |
| 1752 | MDRV_CPU_VBLANK_INT_HACK(cischeat_interrupt,CISCHEAT_INTERRUPT_NUM) | |
| 1756 | 1753 | |
| 1757 | 1754 | MDRV_CPU_ADD_TAG("cpu2", M68000, 10000000) |
| 1758 | 1755 | MDRV_CPU_PROGRAM_MAP(bigrun_readmem2,bigrun_writemem2) |
| 1759 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 1756 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 1760 | 1757 | |
| 1761 | 1758 | MDRV_CPU_ADD_TAG("cpu3", M68000, 10000000) |
| 1762 | 1759 | MDRV_CPU_PROGRAM_MAP(bigrun_readmem3,bigrun_writemem3) |
| 1763 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 1760 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 1764 | 1761 | |
| 1765 | 1762 | MDRV_CPU_ADD_TAG("sound", M68000, 6000000) |
| 1766 | 1763 | /* audio CPU */ |
| 1767 | 1764 | MDRV_CPU_PROGRAM_MAP(bigrun_sound_readmem,bigrun_sound_writemem) |
| 1768 | MDRV_CPU_VBLANK_INT(irq4_line_hold,CISCHEAT_SOUND_INTERRUPT_NUM) | |
| 1765 | MDRV_CPU_VBLANK_INT_HACK(irq4_line_hold,CISCHEAT_SOUND_INTERRUPT_NUM) | |
| 1769 | 1766 | |
| 1770 | 1767 | MDRV_INTERLEAVE(20) |
| 1771 | 1768 | |
| r1877 | r1878 | |
| 1898 | 1895 | /* basic machine hardware */ |
| 1899 | 1896 | MDRV_CPU_ADD_TAG("main",M68000, 12000000) |
| 1900 | 1897 | MDRV_CPU_PROGRAM_MAP(readmem_scudhamm,writemem_scudhamm) |
| 1901 | MDRV_CPU_VBLANK_INT(interrupt_scudhamm,INTERRUPT_NUM_SCUDHAMM) | |
| 1898 | MDRV_CPU_VBLANK_INT_HACK(interrupt_scudhamm,INTERRUPT_NUM_SCUDHAMM) | |
| 1902 | 1899 | |
| 1903 | 1900 | /* video hardware */ |
| 1904 | 1901 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK | VIDEO_HAS_SHADOWS) |
| r1877 | r1878 | |
| 1950 | 1947 | MDRV_IMPORT_FROM(scudhamm) |
| 1951 | 1948 | MDRV_CPU_MODIFY("main") |
| 1952 | 1949 | MDRV_CPU_PROGRAM_MAP(readmem_armchmp2,writemem_armchmp2) |
| 1953 | MDRV_CPU_VBLANK_INT(interrupt_armchmp2,INTERRUPT_NUM_SCUDHAMM) | |
| 1950 | MDRV_CPU_VBLANK_INT_HACK(interrupt_armchmp2,INTERRUPT_NUM_SCUDHAMM) | |
| 1954 | 1951 | |
| 1955 | 1952 | MACHINE_DRIVER_END |
| 1956 | 1953 |
| r1877 | r1878 | |
|---|---|---|
| 1807 | 1807 | static MACHINE_DRIVER_START( namcos22s ) |
| 1808 | 1808 | MDRV_CPU_ADD_TAG("main", M68EC020,SS22_MASTER_CLOCK/2) |
| 1809 | 1809 | MDRV_CPU_PROGRAM_MAP(namcos22s_am,0) |
| 1810 | MDRV_CPU_VBLANK_INT(namcos22s_interrupt,2) | |
| 1810 | MDRV_CPU_VBLANK_INT_HACK(namcos22s_interrupt,2) | |
| 1811 | 1811 | |
| 1812 | 1812 | MDRV_CPU_ADD(TMS32025,SS22_MASTER_CLOCK) |
| 1813 | 1813 | MDRV_CPU_PROGRAM_MAP(master_dsp_program,0) |
| 1814 | 1814 | MDRV_CPU_DATA_MAP(master_dsp_data,0) |
| 1815 | 1815 | MDRV_CPU_IO_MAP(master_dsp_io,0) |
| 1816 | MDRV_CPU_VBLANK_INT(dsp_serial_pulse1,SERIAL_IO_PERIOD) | |
| 1816 | MDRV_CPU_VBLANK_INT_HACK(dsp_serial_pulse1,SERIAL_IO_PERIOD) | |
| 1817 | 1817 | |
| 1818 | 1818 | MDRV_CPU_ADD(TMS32025,SS22_MASTER_CLOCK) |
| 1819 | 1819 | MDRV_CPU_PROGRAM_MAP(slave_dsp_program,0) |
| r1877 | r1878 | |
| 1823 | 1823 | MDRV_CPU_ADD(M37710, SS22_MASTER_CLOCK/3) |
| 1824 | 1824 | MDRV_CPU_PROGRAM_MAP(mcu_program, 0) |
| 1825 | 1825 | MDRV_CPU_IO_MAP( mcu_io, 0 ) |
| 1826 | MDRV_CPU_VBLANK_INT(mcu_interrupt, 3) | |
| 1826 | MDRV_CPU_VBLANK_INT_HACK(mcu_interrupt, 3) | |
| 1827 | 1827 | |
| 1828 | 1828 | MDRV_NVRAM_HANDLER(namcos22) |
| 1829 | 1829 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 2222 | 2222 | static MACHINE_DRIVER_START( namcos22 ) |
| 2223 | 2223 | MDRV_CPU_ADD(M68020,SS22_MASTER_CLOCK/2) /* 25 MHz? */ |
| 2224 | 2224 | MDRV_CPU_PROGRAM_MAP(namcos22_am,0) |
| 2225 | MDRV_CPU_VBLANK_INT(namcos22_interrupt,2) | |
| 2225 | MDRV_CPU_VBLANK_INT_HACK(namcos22_interrupt,2) | |
| 2226 | 2226 | |
| 2227 | 2227 | MDRV_CPU_ADD(TMS32025,SS22_MASTER_CLOCK) /* ? */ |
| 2228 | 2228 | MDRV_CPU_PROGRAM_MAP(master_dsp_program,0) |
| 2229 | 2229 | MDRV_CPU_DATA_MAP(master_dsp_data,0) |
| 2230 | 2230 | MDRV_CPU_IO_MAP(master_dsp_io,0) |
| 2231 | MDRV_CPU_VBLANK_INT(dsp_serial_pulse1,SERIAL_IO_PERIOD) | |
| 2231 | MDRV_CPU_VBLANK_INT_HACK(dsp_serial_pulse1,SERIAL_IO_PERIOD) | |
| 2232 | 2232 | |
| 2233 | 2233 | MDRV_CPU_ADD(TMS32025,SS22_MASTER_CLOCK) /* ? */ |
| 2234 | 2234 | MDRV_CPU_PROGRAM_MAP(slave_dsp_program,0) |
| r1877 | r1878 | |
|---|---|---|
| 261 | 261 | /* basic machine hardware */ |
| 262 | 262 | MDRV_CPU_ADD(M6502, 12096000 / 16) |
| 263 | 263 | MDRV_CPU_PROGRAM_MAP(flyball_map, 0) |
| 264 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 264 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 265 | 265 | |
| 266 | 266 | MDRV_MACHINE_RESET(flyball) |
| 267 | 267 |
| r1877 | r1878 | |
|---|---|---|
| 351 | 351 | /* basic machine hardware */ |
| 352 | 352 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 353 | 353 | MDRV_CPU_PROGRAM_MAP(zero_readmem,zero_writemem) |
| 354 | MDRV_CPU_VBLANK_INT(redclash_interrupt | |
| 354 | MDRV_CPU_VBLANK_INT("main", redclash_interrupt | |
| 355 | 355 | |
| 356 | 356 | /* video hardware */ |
| 357 | 357 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 378 | 378 | /* basic machine hardware */ |
| 379 | 379 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 380 | 380 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 381 | MDRV_CPU_VBLANK_INT(redclash_interrupt | |
| 381 | MDRV_CPU_VBLANK_INT("main", redclash_interrupt | |
| 382 | 382 | |
| 383 | 383 | /* video hardware */ |
| 384 | 384 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 93 | 93 | coin_counter_w(0, 1); |
| 94 | 94 | coin_counter_w(0, 0); |
| 95 | 95 | |
| 96 | cpunum_set_input_line( | |
| 96 | cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE); | |
| 97 | 97 | |
| 98 | 98 | /* simulate the coin switch being closed for a while */ |
| 99 | 99 | timer_set(double_to_attotime(4 * attotime_to_double(video_screen_get_frame_period(0))), NULL, 0, clear_coin_status); |
| r1877 | r1878 | |
| 136 | 136 | /* the vertical synch counter gets incremented at the end of HSYNC, |
| 137 | 137 | compensate for this */ |
| 138 | 138 | if (video_screen_get_hpos(0) >= VICDUAL_HSEND) |
| 139 | { | |
| 140 | 139 | vcounter = (vcounter + 1) % VICDUAL_VTOTAL; |
| 141 | } | |
| 142 | 140 | |
| 143 | 141 | return vcounter; |
| 144 | 142 | } |
| r1877 | r1878 | |
| 158 | 156 | |
| 159 | 157 | static CUSTOM_INPUT( vicdual_get_composite_blank_comp ) |
| 160 | 158 | { |
| 161 | return (vicdual_get_vblank_comp(0) && !video_screen_get_hblank(0)); | |
| 159 | return (vicdual_get_vblank_comp(machine, 0) && !video_screen_get_hblank(0)); | |
| 162 | 160 | } |
| 163 | 161 | |
| 164 | 162 | |
| r1877 | r1878 | |
| 174 | 172 | if (!timer_started) |
| 175 | 173 | { |
| 176 | 174 | timer_started = 1; |
| 177 | ||
| 178 | 175 | timer_pulse(TIMER_HALF_PERIOD, NULL, 0, vicdual_timer_callback); |
| 179 | 176 | } |
| 180 | 177 | |
| r1877 | r1878 | |
| 193 | 190 | |
| 194 | 191 | int vicdual_is_cabinet_color(void) |
| 195 | 192 | { |
| 196 | UINT32 input = readinputportbytag(COLOR_BW_PORT_TAG); | |
| 197 | ||
| 198 | return (input == 0); | |
| 193 | return (readinputportbytag(COLOR_BW_PORT_TAG) == 0); | |
| 199 | 194 | } |
| 200 | 195 | |
| 201 | 196 | |
| r1877 | r1878 | |
| 220 | 215 | |
| 221 | 216 | static WRITE8_HANDLER( vicdual_videoram_w ) |
| 222 | 217 | { |
| 223 | video_screen_update_partial(0, video_screen_get_vpos(0)); | |
| 224 | ||
| 218 | video_screen_update_now(0); | |
| 225 | 219 | vicdual_videoram[offset] = data; |
| 226 | 220 | } |
| 227 | 221 | |
| r1877 | r1878 | |
| 234 | 228 | |
| 235 | 229 | static WRITE8_HANDLER( vicdual_characterram_w ) |
| 236 | 230 | { |
| 237 | video_screen_update_ | |
| 231 | video_screen_update_ | |
| 238 | 232 | |
| 239 | 233 | vicdual_characterram[offset] = data; |
| 240 | 234 | } |
| r1877 | r1878 | |
| 277 | 271 | { |
| 278 | 272 | UINT8 ret = 0; |
| 279 | 273 | |
| 280 | if (offset & 0x01) ret = input_port_0_r(0); | |
| 274 | if (offset & 0x01) ret = input_port_0_r(machine, 0); | |
| 275 | if (offset & 0x08) ret = input_port_1_r(machine, 0); | |
| 281 | 276 | |
| 282 | if (offset & 0x08) ret = input_port_1_r(0); | |
| 283 | ||
| 284 | 277 | return ret; |
| 285 | 278 | } |
| 286 | 279 | |
| r1877 | r1878 | |
| 288 | 281 | static WRITE8_HANDLER( depthch_io_w ) |
| 289 | 282 | { |
| 290 | 283 | if (offset & 0x01) assert_coin_status(); |
| 291 | ||
| 292 | if (offset & 0x04) depthch_audio_w(0, data); | |
| 284 | if (offset & 0x04) depthch_audio_w(machine, 0, data); | |
| 293 | 285 | } |
| 294 | 286 | |
| 295 | 287 | |
| r1877 | r1878 | |
| 361 | 353 | { |
| 362 | 354 | UINT8 ret = 0; |
| 363 | 355 | |
| 364 | if (offset & 0x01) ret = input_port_0_r(0); | |
| 356 | if (offset & 0x01) ret = input_port_0_r(machine,0); | |
| 357 | if (offset & 0x08) ret = input_port_1_r(machine,0); | |
| 365 | 358 | |
| 366 | if (offset & 0x08) ret = input_port_1_r(0); | |
| 367 | ||
| 368 | 359 | return ret; |
| 369 | 360 | } |
| 370 | 361 | |
| r1877 | r1878 | |
| 372 | 363 | static WRITE8_HANDLER( safari_io_w ) |
| 373 | 364 | { |
| 374 | 365 | if (offset & 0x01) assert_coin_status(); |
| 375 | ||
| 376 | 366 | if (offset & 0x02) /* safari_audio_w(0, data) */; |
| 377 | 367 | } |
| 378 | 368 | |
| r1877 | r1878 | |
| 447 | 437 | { |
| 448 | 438 | UINT8 ret = 0; |
| 449 | 439 | |
| 450 | if (offset & 0x01) ret = input_port_0_r(0); | |
| 440 | if (offset & 0x01) ret = input_port_0_r(machine,0); | |
| 441 | if (offset & 0x08) ret = input_port_1_r(machine,0); | |
| 451 | 442 | |
| 452 | if (offset & 0x08) ret = input_port_1_r(0); | |
| 453 | ||
| 454 | 443 | return ret; |
| 455 | 444 | } |
| 456 | 445 | |
| r1877 | r1878 | |
| 458 | 447 | static WRITE8_HANDLER( frogs_io_w ) |
| 459 | 448 | { |
| 460 | 449 | if (offset & 0x01) assert_coin_status(); |
| 461 | ||
| 462 | if (offset & 0x02) frogs_audio_w(0, data); | |
| 450 | if (offset & 0x02) frogs_audio_w(machine, 0, data); | |
| 463 | 451 | } |
| 464 | 452 | |
| 465 | 453 | |
| r1877 | r1878 | |
| 557 | 545 | { |
| 558 | 546 | UINT8 ret = 0; |
| 559 | 547 | |
| 560 | if (offset & 0x01) ret = input_port_0_r(0); | |
| 548 | if (offset & 0x01) ret = input_port_0_r(machine,0); | |
| 549 | if (offset & 0x08) ret = input_port_1_r(machine,0); | |
| 561 | 550 | |
| 562 | if (offset & 0x08) ret = input_port_1_r(0); | |
| 563 | ||
| 564 | 551 | return ret; |
| 565 | 552 | } |
| 566 | 553 | |
| r1877 | r1878 | |
| 569 | 556 | { |
| 570 | 557 | UINT8 ret = 0; |
| 571 | 558 | |
| 572 | if (offset & 0x01) ret = input_port_0_r(0); | |
| 559 | if (offset & 0x01) ret = input_port_0_r(machine, 0); | |
| 560 | if (offset & 0x04) ret = input_port_1_r(machine, 0); | |
| 561 | if (offset & 0x08) ret = input_port_2_r(machine, 0); | |
| 573 | 562 | |
| 574 | if (offset & 0x04) ret = input_port_1_r(0); | |
| 575 | ||
| 576 | if (offset & 0x08) ret = input_port_2_r(0); | |
| 577 | ||
| 578 | 563 | return ret; |
| 579 | 564 | } |
| 580 | 565 | |
| r1877 | r1878 | |
| 582 | 567 | static WRITE8_HANDLER( headon_io_w ) |
| 583 | 568 | { |
| 584 | 569 | if (offset & 0x01) assert_coin_status(); |
| 585 | ||
| 586 | if (offset & 0x02) headon_audio_w(0, data); | |
| 587 | ||
| 570 | if (offset & 0x02) headon_audio_w(machine, 0, data); | |
| 588 | 571 | if (offset & 0x04) /* vicdual_palette_bank_w(0, data) */; /* not written to */ |
| 589 | 572 | } |
| 590 | 573 | |
| r1877 | r1878 | |
| 762 | 745 | { |
| 763 | 746 | UINT8 ret = 0; |
| 764 | 747 | |
| 765 | if (offset & 0x01) ret = input_port_0_r(0); | |
| 766 | ||
| 748 | if (offset & 0x01) ret = input_port_0_r(machine, 0); | |
| 767 | 749 | if (offset & 0x02) /* schematics show this as in input port, but never read from */ |
| 768 | ||
| 769 | if (offset & 0x04) ret = input_port_1_r(0); | |
| 770 | ||
| 771 | if (offset & 0x08) ret = input_port_2_r(0); | |
| 772 | ||
| 750 | if (offset & 0x04) ret = input_port_1_r(machine, 0); | |
| 751 | if (offset & 0x08) ret = input_port_2_r(machine, 0); | |
| 773 | 752 | if (offset & 0x12) logerror("********* Read from port %x\n", offset); |
| 774 | 753 | |
| 775 | 754 | return ret; |
| r1877 | r1878 | |
| 779 | 758 | static WRITE8_HANDLER( headon2_io_w ) |
| 780 | 759 | { |
| 781 | 760 | if (offset & 0x01) assert_coin_status(); |
| 782 | ||
| 783 | if (offset & 0x02) headon_audio_w(0, data); | |
| 784 | ||
| 785 | if (offset & 0x04) vicdual_palette_bank_w(0, data); | |
| 786 | ||
| 761 | if (offset & 0x02) headon_audio_w(machine, 0, data); | |
| 762 | if (offset & 0x04) vicdual_palette_bank_w(machine, 0, data); | |
| 787 | 763 | if (offset & 0x08) ;/* schematics show this as going into a shifer circuit, but never written to */ |
| 788 | ||
| 789 | 764 | if (offset & 0x10) ;/* schematics show this as going to an edge connector, but never written to */ |
| 790 | ||
| 791 | 765 | if (offset & 0x18) logerror("********* Write to port %x\n", offset); |
| 792 | 766 | } |
| 793 | 767 | |
| r1877 | r1878 | |
| 795 | 769 | static WRITE8_HANDLER( digger_io_w ) |
| 796 | 770 | { |
| 797 | 771 | if (offset & 0x01) assert_coin_status(); |
| 798 | ||
| 799 | 772 | if (offset & 0x02) /* digger_audio_1_w(0, data) */; |
| 800 | ||
| 801 | 773 | if (offset & 0x04) |
| 802 | 774 | { |
| 803 | vicdual_palette_bank_w(0, data & 0x03); | |
| 775 | vicdual_palette_bank_w(machine, 0, data & 0x03); | |
| 804 | 776 | /* digger_audio_2_w(0, data & 0xfc) */; |
| 805 | 777 | } |
| 806 | 778 | |
| 807 | 779 | if (offset & 0x08) ;/* schematics show this as going into a shifer circuit, but never written to */ |
| 808 | ||
| 809 | 780 | if (offset & 0x10) ;/* schematics show this as going to an edge connector, but never written to */ |
| 810 | ||
| 811 | 781 | if (offset & 0x18) logerror("********* Write to port %x\n", offset); |
| 812 | 782 | } |
| 813 | 783 | |
| r1877 | r1878 | |
| 993 | 963 | |
| 994 | 964 | static WRITE8_HANDLER( invho2_io_w ) |
| 995 | 965 | { |
| 996 | if (offset & 0x01) invho2_audio_w(0, data); | |
| 997 | ||
| 998 | if (offset & 0x02) invinco_audio_w(0, data); | |
| 999 | ||
| 966 | if (offset & 0x01) invho2_audio_w(machine, 0, data); | |
| 967 | if (offset & 0x02) invinco_audio_w(machine, 0, data); | |
| 1000 | 968 | if (offset & 0x08) assert_coin_status(); |
| 1001 | ||
| 1002 | if (offset & 0x40) vicdual_palette_bank_w(0, data); | |
| 969 | if (offset & 0x40) vicdual_palette_bank_w(machine, 0, data); | |
| 1003 | 970 | } |
| 1004 | 971 | |
| 1005 | 972 | |
| 1006 | 973 | static WRITE8_HANDLER( invds_io_w ) |
| 1007 | 974 | { |
| 1008 | if (offset & 0x01) invinco_audio_w(0, data); | |
| 1009 | ||
| 975 | if (offset & 0x01) invinco_audio_w(machine, 0, data); | |
| 1010 | 976 | if (offset & 0x02) /* deepscan_audio_w(0, data) */; |
| 1011 | ||
| 1012 | 977 | if (offset & 0x08) assert_coin_status(); |
| 1013 | ||
| 1014 | if (offset & 0x40) vicdual_palette_bank_w(0, data); | |
| 978 | if (offset & 0x40) vicdual_palette_bank_w(machine, 0, data); | |
| 1015 | 979 | } |
| 1016 | 980 | |
| 1017 | 981 | |
| 1018 | 982 | static WRITE8_HANDLER( sspacaho_io_w ) |
| 1019 | 983 | { |
| 1020 | if (offset & 0x01) invho2_audio_w(0, data); | |
| 1021 | ||
| 1022 | if (offset & 0x02) /* sspaceatt_audio_w(0, data) */; | |
| 1023 | ||
| 984 | if (offset & 0x01) invho2_audio_w(machine, 0, data); | |
| 985 | if (offset & 0x02) /* sspaceatt_audio_w(machine, 0, data) */; | |
| 1024 | 986 | if (offset & 0x08) assert_coin_status(); |
| 1025 | ||
| 1026 | if (offset & 0x40) vicdual_palette_bank_w(0, data); | |
| 987 | if (offset & 0x40) vicdual_palette_bank_w(machine, 0, data); | |
| 1027 | 988 | } |
| 1028 | 989 | |
| 1029 | 990 | |
| 1030 | 991 | static WRITE8_HANDLER( tranqgun_io_w ) |
| 1031 | 992 | { |
| 1032 | if (offset & 0x01) /* tranqgun_audio_w(0, data) */; | |
| 1033 | ||
| 1034 | if (offset & 0x02) vicdual_palette_bank_w(0, data); | |
| 1035 | ||
| 993 | if (offset & 0x01) /* tranqgun_audio_w(machine, 0, data) */; | |
| 994 | if (offset & 0x02) vicdual_palette_bank_w(machine, 0, data); | |
| 1036 | 995 | if (offset & 0x08) assert_coin_status(); |
| 1037 | 996 | } |
| 1038 | 997 | |
| 1039 | 998 | |
| 1040 | 999 | static WRITE8_HANDLER( spacetrk_io_w ) |
| 1041 | 1000 | { |
| 1042 | if (offset & 0x01) /* spacetrk_audio_w(0, data) */; | |
| 1043 | ||
| 1044 | if (offset & 0x02) /* spacetrk_audio_w(0, data) */; | |
| 1045 | ||
| 1001 | if (offset & 0x01) /* spacetrk_audio_w(machine, 0, data) */; | |
| 1002 | if (offset & 0x02) /* spacetrk_audio_w(machine, 0, data) */; | |
| 1046 | 1003 | if (offset & 0x08) assert_coin_status(); |
| 1047 | ||
| 1048 | if (offset & 0x40) vicdual_palette_bank_w(0, data); | |
| 1004 | if (offset & 0x40) vicdual_palette_bank_w(machine, 0, data); | |
| 1049 | 1005 | } |
| 1050 | 1006 | |
| 1051 | 1007 | |
| 1052 | 1008 | static WRITE8_HANDLER( carnival_io_w ) |
| 1053 | 1009 | { |
| 1054 | if (offset & 0x01) carnival_audio_1_w(0, data); | |
| 1055 | ||
| 1056 | if (offset & 0x02) carnival_audio_2_w(0, data); | |
| 1057 | ||
| 1010 | if (offset & 0x01) carnival_audio_1_w(machine, 0, data); | |
| 1011 | if (offset & 0x02) carnival_audio_2_w(machine, 0, data); | |
| 1058 | 1012 | if (offset & 0x08) assert_coin_status(); |
| 1059 | ||
| 1060 | if (offset & 0x40) vicdual_palette_bank_w(0, data); | |
| 1013 | if (offset & 0x40) vicdual_palette_bank_w(machine, 0, data); | |
| 1061 | 1014 | } |
| 1062 | 1015 | |
| 1063 | 1016 | |
| 1064 | 1017 | static WRITE8_HANDLER( brdrline_io_w ) |
| 1065 | 1018 | { |
| 1066 | if (offset & 0x01) /* brdrline_audio_w(0, data) */; | |
| 1067 | ||
| 1068 | if (offset & 0x02) vicdual_palette_bank_w(0, data); | |
| 1069 | ||
| 1019 | if (offset & 0x01) /* brdrline_audio_w(machine, 0, data) */; | |
| 1020 | if (offset & 0x02) vicdual_palette_bank_w(machine, 0, data); | |
| 1070 | 1021 | if (offset & 0x08) assert_coin_status(); |
| 1071 | 1022 | } |
| 1072 | 1023 | |
| 1073 | 1024 | |
| 1074 | 1025 | static WRITE8_HANDLER( pulsar_io_w ) |
| 1075 | 1026 | { |
| 1076 | if (offset & 0x01) pulsar_audio_1_w(0, data); | |
| 1077 | ||
| 1078 | if (offset & 0x02) pulsar_audio_2_w(0, data); | |
| 1079 | ||
| 1027 | if (offset & 0x01) pulsar_audio_1_w(machine, 0, data); | |
| 1028 | if (offset & 0x02) pulsar_audio_2_w(machine, 0, data); | |
| 1080 | 1029 | if (offset & 0x08) assert_coin_status(); |
| 1081 | ||
| 1082 | if (offset & 0x40) vicdual_palette_bank_w(0, data); | |
| 1030 | if (offset & 0x40) vicdual_palette_bank_w(machine, 0, data); | |
| 1083 | 1031 | } |
| 1084 | 1032 | |
| 1085 | 1033 | |
| r1877 | r1878 | |
| 1089 | 1037 | |
| 1090 | 1038 | if (offset & 0x02) |
| 1091 | 1039 | { |
| 1092 | vicdual_palette_bank_w(0, data & 0x03); | |
| 1040 | vicdual_palette_bank_w(machine, 0, data & 0x03); | |
| 1093 | 1041 | /* heiankyo_audio_2_w(0, data & 0xfc) */; |
| 1094 | 1042 | } |
| 1095 | 1043 | |
| r1877 | r1878 | |
| 1100 | 1048 | static WRITE8_HANDLER( alphaho_io_w ) |
| 1101 | 1049 | { |
| 1102 | 1050 | if (offset & 0x01) /* headon_audio_w(0, data) */; |
| 1103 | ||
| 1104 | 1051 | if (offset & 0x02) /* alphaf_audio_w(0, data) */; |
| 1105 | ||
| 1106 | 1052 | if (offset & 0x08) assert_coin_status(); |
| 1107 | ||
| 1108 | if (offset & 0x40) vicdual_palette_bank_w(0, data); | |
| 1053 | if (offset & 0x40) vicdual_palette_bank_w(machine, 0, data); | |
| 1109 | 1054 | } |
| 1110 | 1055 | |
| 1111 | 1056 | |
| r1877 | r1878 | |
| 2035 | 1980 | UINT32 answer = 0; |
| 2036 | 1981 | |
| 2037 | 1982 | if (samurai_protection_data == 0xab) |
| 2038 | { | |
| 2039 | 1983 | answer = 0x02; |
| 2040 | } | |
| 2041 | 1984 | else if (samurai_protection_data == 0x1d) |
| 2042 | { | |
| 2043 | 1985 | answer = 0x0c; |
| 2044 | } | |
| 2045 | 1986 | |
| 2046 | 1987 | return (answer >> offset) & 0x01; |
| 2047 | 1988 | } |
| r1877 | r1878 | |
| 2050 | 1991 | static WRITE8_HANDLER( samurai_io_w ) |
| 2051 | 1992 | { |
| 2052 | 1993 | if (offset & 0x02) /* samurai_audio_w(0, data) */; |
| 2053 | ||
| 2054 | 1994 | if (offset & 0x08) assert_coin_status(); |
| 2055 | ||
| 2056 | if (offset & 0x40) vicdual_palette_bank_w(0, data); | |
| 1995 | if (offset & 0x40) vicdual_palette_bank_w(machine, 0, data); | |
| 2057 | 1996 | } |
| 2058 | 1997 | |
| 2059 | 1998 | |
| r1877 | r1878 | |
| 2160 | 2099 | { |
| 2161 | 2100 | UINT8 ret = 0; |
| 2162 | 2101 | |
| 2163 | if (offset & 0x01) ret = input_port_0_r(0); | |
| 2102 | if (offset & 0x01) ret = input_port_0_r(machine,0); | |
| 2103 | if (offset & 0x08) ret = input_port_1_r(machine,0); | |
| 2164 | 2104 | |
| 2165 | if (offset & 0x08) ret = input_port_1_r(0); | |
| 2166 | ||
| 2167 | 2105 | return ret; |
| 2168 | 2106 | } |
| 2169 | 2107 | |
| r1877 | r1878 | |
| 2171 | 2109 | static WRITE8_HANDLER( nsub_io_w ) |
| 2172 | 2110 | { |
| 2173 | 2111 | if (offset & 0x01) assert_coin_status(); |
| 2174 | ||
| 2175 | 2112 | if (offset & 0x02) /* nsub_audio_w(0, data) */; |
| 2176 | ||
| 2177 | if (offset & 0x04) vicdual_palette_bank_w(0, data); | |
| 2113 | if (offset & 0x04) vicdual_palette_bank_w(machine, 0, data); | |
| 2178 | 2114 | } |
| 2179 | 2115 | |
| 2180 | 2116 | |
| r1877 | r1878 | |
| 2258 | 2194 | { |
| 2259 | 2195 | UINT8 ret = 0; |
| 2260 | 2196 | |
| 2261 | if (offset & 0x01) ret = input_port_0_r(0); | |
| 2197 | if (offset & 0x01) ret = input_port_0_r(machine,0); | |
| 2198 | if (offset & 0x02) ret = input_port_1_r(machine,0); | |
| 2199 | if (offset & 0x08) ret = input_port_2_r(machine,0); | |
| 2262 | 2200 | |
| 2263 | if (offset & 0x02) ret = input_port_1_r(0); | |
| 2264 | ||
| 2265 | if (offset & 0x08) ret = input_port_2_r(0); | |
| 2266 | ||
| 2267 | 2201 | return ret; |
| 2268 | 2202 | } |
| 2269 | 2203 | |
| r1877 | r1878 | |
| 2271 | 2205 | static WRITE8_HANDLER( invinco_io_w ) |
| 2272 | 2206 | { |
| 2273 | 2207 | if (offset & 0x01) assert_coin_status(); |
| 2274 | ||
| 2275 | if (offset & 0x02) invinco_audio_w(0, data); | |
| 2276 | ||
| 2277 | if (offset & 0x04) vicdual_palette_bank_w(0, data); | |
| 2208 | if (offset & 0x02) invinco_audio_w(machine, 0, data); | |
| 2209 | if (offset & 0x04) vicdual_palette_bank_w(machine, 0, data); | |
| 2278 | 2210 | } |
| 2279 | 2211 | |
| 2280 | 2212 |
| r1877 | r1878 | |
|---|---|---|
| 190 | 190 | /* basic machine hardware */ |
| 191 | 191 | MDRV_CPU_ADD(M68000, ATARI_CLOCK_14MHz/2) |
| 192 | 192 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 193 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 193 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 194 | 194 | |
| 195 | 195 | MDRV_MACHINE_RESET(xybots) |
| 196 | 196 | MDRV_NVRAM_HANDLER(atarigen) |
| r1877 | r1878 | |
|---|---|---|
| 271 | 271 | MDRV_CPU_PROGRAM_MAP(st0016_mem,0) |
| 272 | 272 | MDRV_CPU_IO_MAP(st0016_io,0) |
| 273 | 273 | |
| 274 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 274 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 275 | 275 | |
| 276 | 276 | MDRV_CPU_ADD(R3000LE, 25000000) |
| 277 | 277 | MDRV_CPU_CONFIG(config) |
| 278 | 278 | MDRV_CPU_PROGRAM_MAP(speglsht_mem,0) |
| 279 | MDRV_CPU_VBLANK_INT(irq4_gen | |
| 279 | MDRV_CPU_VBLANK_INT("main", irq4_gen | |
| 280 | 280 | |
| 281 | 281 | MDRV_INTERLEAVE(100) |
| 282 | 282 | MDRV_MACHINE_RESET(speglsht) |
| r1877 | r1878 | |
|---|---|---|
| 289 | 289 | WRITE8_HANDLER( rockola_videoram2_w ); |
| 290 | 290 | WRITE8_HANDLER( rockola_colorram_w ); |
| 291 | 291 | WRITE8_HANDLER( rockola_charram_w ); |
| 292 | WRITE8_HANDLER( rockola_mc6845_address_w ); | |
| 293 | WRITE8_HANDLER( rockola_mc6845_register_w ); | |
| 294 | 292 | WRITE8_HANDLER( rockola_flipscreen_w ); |
| 295 | 293 | WRITE8_HANDLER( rockola_scrollx_w ); |
| 296 | 294 | WRITE8_HANDLER( rockola_scrolly_w ); |
| r1877 | r1878 | |
| 372 | 370 | AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram) |
| 373 | 371 | AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram) |
| 374 | 372 | AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram) |
| 375 | AM_RANGE(0x3000, 0x3000) AM_WRITE(rockola_mc6845_address_w) | |
| 376 | AM_RANGE(0x3001, 0x3001) AM_WRITE(rockola_mc6845_register_w) | |
| 373 | AM_RANGE(0x3000, 0x3000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 374 | AM_RANGE(0x3001, 0x3001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 377 | 375 | AM_RANGE(0x4000, 0x8fff) AM_ROM |
| 378 | 376 | AM_RANGE(0xb000, 0xb001) AM_WRITE(sasuke_sound_w) |
| 379 | 377 | AM_RANGE(0xb002, 0xb002) AM_WRITE(satansat_b002_w) /* flip screen & irq enable */ |
| r1877 | r1878 | |
| 391 | 389 | AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram) |
| 392 | 390 | AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram) |
| 393 | 391 | AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram) |
| 394 | AM_RANGE(0x3000, 0x3000) AM_WRITE(rockola_mc6845_address_w) | |
| 395 | AM_RANGE(0x3001, 0x3001) AM_WRITE(rockola_mc6845_register_w) | |
| 392 | AM_RANGE(0x3000, 0x3000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 393 | AM_RANGE(0x3001, 0x3001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 396 | 394 | AM_RANGE(0x4000, 0x97ff) AM_ROM |
| 397 | 395 | AM_RANGE(0xb000, 0xb001) AM_WRITE(satansat_sound_w) |
| 398 | 396 | AM_RANGE(0xb002, 0xb002) AM_WRITE(satansat_b002_w) /* flip screen & irq enable */ |
| r1877 | r1878 | |
| 410 | 408 | AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram) |
| 411 | 409 | AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram) |
| 412 | 410 | AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram) |
| 413 | AM_RANGE(0x3000, 0x3000) AM_WRITE(rockola_mc6845_address_w) | |
| 414 | AM_RANGE(0x3001, 0x3001) AM_WRITE(rockola_mc6845_register_w) | |
| 411 | AM_RANGE(0x3000, 0x3000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 412 | AM_RANGE(0x3001, 0x3001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 415 | 413 | AM_RANGE(0x3100, 0x3102) AM_WRITE(vanguard_sound_w) |
| 416 | 414 | AM_RANGE(0x3103, 0x3103) AM_WRITE(rockola_flipscreen_w) |
| 417 | 415 | AM_RANGE(0x3104, 0x3104) AM_READ_PORT("IN0") |
| r1877 | r1878 | |
| 431 | 429 | AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram) |
| 432 | 430 | AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram) |
| 433 | 431 | AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram) |
| 434 | AM_RANGE(0x2000, 0x2000) AM_WRITE(rockola_mc6845_address_w) | |
| 435 | AM_RANGE(0x2001, 0x2001) AM_WRITE(rockola_mc6845_register_w) | |
| 432 | AM_RANGE(0x2000, 0x2000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 433 | AM_RANGE(0x2001, 0x2001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 436 | 434 | AM_RANGE(0x2100, 0x2103) AM_WRITE(fantasy_sound_w) |
| 437 | 435 | AM_RANGE(0x2104, 0x2104) AM_READ_PORT("IN0") |
| 438 | 436 | AM_RANGE(0x2105, 0x2105) AM_READ_PORT("IN1") |
| r1877 | r1878 | |
| 452 | 450 | AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram) |
| 453 | 451 | AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram) |
| 454 | 452 | AM_RANGE(0x3000, 0x9fff) AM_ROM |
| 455 | AM_RANGE(0xb000, 0xb000) AM_WRITE(rockola_mc6845_address_w) | |
| 456 | AM_RANGE(0xb001, 0xb001) AM_WRITE(rockola_mc6845_register_w) | |
| 453 | AM_RANGE(0xb000, 0xb000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 454 | AM_RANGE(0xb001, 0xb001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 457 | 455 | AM_RANGE(0xb100, 0xb103) AM_WRITE(fantasy_sound_w) |
| 458 | 456 | AM_RANGE(0xb104, 0xb104) AM_READ_PORT("IN0") |
| 459 | 457 | AM_RANGE(0xb105, 0xb105) AM_READ_PORT("IN1") |
| r1877 | r1878 | |
| 1081 | 1079 | // basic machine hardware |
| 1082 | 1080 | MDRV_CPU_ADD_TAG("main", M6502, 11289000/16) // 700 kHz |
| 1083 | 1081 | MDRV_CPU_PROGRAM_MAP(sasuke_map, 0) |
| 1084 | MDRV_CPU_VBLANK_INT(satansat_interrupt, 2) | |
| 1082 | MDRV_CPU_VBLANK_INT_HACK(satansat_interrupt, 2) | |
| 1085 | 1083 | |
| 1086 | 1084 | MDRV_MACHINE_RESET(sasuke) |
| 1087 | 1085 | |
| r1877 | r1878 | |
| 1156 | 1154 | //MDRV_CPU_ADD_TAG("main", M6502, 11289000/8) // 1.4 MHz |
| 1157 | 1155 | MDRV_CPU_ADD_TAG("main", M6502, 930000) // adjusted |
| 1158 | 1156 | MDRV_CPU_PROGRAM_MAP(vanguard_map, 0) |
| 1159 | MDRV_CPU_VBLANK_INT(rockola_interrupt, 2) | |
| 1157 | MDRV_CPU_VBLANK_INT_HACK(rockola_interrupt, 2) | |
| 1160 | 1158 | |
| 1161 | 1159 | MDRV_MACHINE_RESET(vanguard) |
| 1162 | 1160 |
| r1877 | r1878 | |
|---|---|---|
| 336 | 336 | tilemap_mark_tile_dirty(bg_tilemap, offset); |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | static WRITE8_HANDLER( magicfly_mc6845_address_w ) | |
| 340 | { | |
| 341 | mc6845_address_w(mc6845, data); | |
| 342 | } | |
| 343 | ||
| 344 | static READ8_HANDLER( magicfly_mc6845_register_r ) | |
| 345 | { | |
| 346 | return mc6845_register_r(mc6845); | |
| 347 | } | |
| 348 | ||
| 349 | static WRITE8_HANDLER( magicfly_mc6845_register_w ) | |
| 350 | { | |
| 351 | mc6845_register_w(mc6845, data); | |
| 352 | } | |
| 353 | ||
| 354 | 339 | static TILE_GET_INFO( get_magicfly_tile_info ) |
| 355 | 340 | { |
| 356 | 341 | /* - bits - |
| r1877 | r1878 | |
| 454 | 439 | { |
| 455 | 440 | switch( mux_data & 0x0f ) /* bits 0-3 */ |
| 456 | 441 | { |
| 457 | case 0x01: return input_port_0_r(0); | |
| 458 | case 0x02: return input_port_1_r(0); | |
| 459 | case 0x04: return input_port_2_r(0); | |
| 460 | case 0x08: return input_port_3_r(0); | |
| 461 | case 0x00: return input_port_4_r(0); | |
| 442 | case 0x01: return input_port_0_r(machine,0); | |
| 443 | case 0x02: return input_port_1_r(machine,0); | |
| 444 | case 0x04: return input_port_2_r(machine,0); | |
| 445 | case 0x08: return input_port_3_r(machine,0); | |
| 446 | case 0x00: return input_port_4_r(machine,0); | |
| 462 | 447 | } |
| 463 | 448 | return 0xff; |
| 464 | 449 | } |
| r1877 | r1878 | |
| 475 | 460 | |
| 476 | 461 | static ADDRESS_MAP_START( magicfly_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 477 | 462 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) /* MK48Z02B NVRAM */ |
| 478 | AM_RANGE(0x0800, 0x0800) AM_WRITE(magicfly_mc6845_address_w) | |
| 479 | AM_RANGE(0x0801, 0x0801) AM_READWRITE(magicfly_mc6845_register_r, magicfly_mc6845_register_w) | |
| 463 | AM_RANGE(0x0800, 0x0800) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 464 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 480 | 465 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(magicfly_videoram_w) AM_BASE(&videoram) /* HM6116LP #1 (2K x 8) RAM (only 1st half used) */ |
| 481 | 466 | AM_RANGE(0x1800, 0x1bff) AM_RAM AM_WRITE(magicfly_colorram_w) AM_BASE(&colorram) /* HM6116LP #2 (2K x 8) RAM (only 1st half used) */ |
| 482 | 467 | AM_RANGE(0x2800, 0x2800) AM_READ(mux_port_r) /* multiplexed input port */ |
| r1877 | r1878 | |
| 660 | 645 | /* basic machine hardware */ |
| 661 | 646 | MDRV_CPU_ADD_TAG("main", M6502, MASTER_CLOCK/12) /* guess */ |
| 662 | 647 | MDRV_CPU_PROGRAM_MAP(magicfly_map, 0) |
| 663 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 648 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 664 | 649 | |
| 665 | 650 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 666 | 651 |
| r1877 | r1878 | |
|---|---|---|
| 657 | 657 | |
| 658 | 658 | static WRITE8_HANDLER( caterplr_AY8910_w ) |
| 659 | 659 | { |
| 660 | AY8910_control_port_0_w(0, offset); | |
| 661 | AY8910_write_port_0_w(0, data); | |
| 660 | AY8910_control_port_0_w(machine, 0, offset); | |
| 661 | AY8910_write_port_0_w(machine, 0, data); | |
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | |
| 665 | 665 | static READ8_HANDLER( caterplr_AY8910_r ) |
| 666 | 666 | { |
| 667 | AY8910_control_port_0_w(0, offset); | |
| 668 | return AY8910_read_port_0_r(0); | |
| 667 | AY8910_control_port_0_w(machine, 0, offset); | |
| 668 | return AY8910_read_port_0_r(machine, 0); | |
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 |
| r1877 | r1878 | |
|---|---|---|
| 366 | 366 | |
| 367 | 367 | /* write strobe */ |
| 368 | 368 | if (!(old & 1) && (tms5220_ctl & 1)) |
| 369 | tms5220_data_w(0, tms5220_out_data); | |
| 369 | tms5220_data_w(machine, 0, tms5220_out_data); | |
| 370 | 370 | |
| 371 | 371 | /* read strobe */ |
| 372 | 372 | if (!(old & 2) && (tms5220_ctl & 2)) |
| 373 | tms5220_in_data = tms5220_status_r(0); | |
| 373 | tms5220_in_data = tms5220_status_r(machine, 0); | |
| 374 | 374 | |
| 375 | 375 | /* bit 4 is connected to an up-counter, clocked by SYCLKB */ |
| 376 | 376 | data = 5 | ((data >> 3) & 2); |
| r1877 | r1878 | |
| 417 | 417 | static OPBASE_HANDLER( indytemp_setopbase ) |
| 418 | 418 | { |
| 419 | 419 | int prevpc = activecpu_get_previouspc(); |
| 420 | ||
| 421 | 420 | /* |
| 422 | 421 | * This is a slightly ugly kludge for Indiana Jones & the Temple of Doom because it jumps |
| 423 | 422 | * directly to code in the slapstic. The general order of things is this: |
| r1877 | r1878 | |
| 437 | 436 | */ |
| 438 | 437 | |
| 439 | 438 | if (address & 0x80000) |
| 440 | atarigen_slapstic_r(0,0); | |
| 439 | atarigen_slapstic_r(machine,0,0); | |
| 441 | 440 | else if (prevpc & 0x80000) |
| 442 | atarigen_slapstic_r((prevpc >> 1) & 0x3fff,0); | |
| 441 | atarigen_slapstic_r(machine,(prevpc >> 1) & 0x3fff,0); | |
| 443 | 442 | |
| 444 | 443 | return address; |
| 445 | 444 | } |
| r1877 | r1878 | |
| 740 | 739 | /* basic machine hardware */ |
| 741 | 740 | MDRV_CPU_ADD(M68010, ATARI_CLOCK_14MHz/2) |
| 742 | 741 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 743 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 742 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 744 | 743 | |
| 745 | 744 | MDRV_CPU_ADD(M6502, ATARI_CLOCK_14MHz/8) |
| 746 | 745 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 636 | 636 | static WRITE16_HANDLER( wgp_sound_w ) |
| 637 | 637 | { |
| 638 | 638 | if (offset == 0) |
| 639 | taitosound_port_w (0, data & 0xff); | |
| 639 | taitosound_port_w (machine, 0, data & 0xff); | |
| 640 | 640 | else if (offset == 1) |
| 641 | taitosound_comm_w (0, data & 0xff); | |
| 641 | taitosound_comm_w (machine, 0, data & 0xff); | |
| 642 | 642 | } |
| 643 | 643 | |
| 644 | 644 | static READ16_HANDLER( wgp_sound_r ) |
| 645 | 645 | { |
| 646 | 646 | if (offset == 1) |
| 647 | return ((taitosound_comm_r (0) & 0xff)); | |
| 647 | return ((taitosound_comm_r (machine, 0) & 0xff)); | |
| 648 | 648 | else return 0; |
| 649 | 649 | } |
| 650 | 650 | |
| r1877 | r1878 | |
| 982 | 982 | /* basic machine hardware */ |
| 983 | 983 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 984 | 984 | MDRV_CPU_PROGRAM_MAP(wgp_readmem,wgp_writemem) |
| 985 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 985 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 986 | 986 | |
| 987 | 987 | MDRV_CPU_ADD(Z80, 16000000/4) /* 4 MHz ??? */ |
| 988 | 988 | /* audio CPU */ |
| r1877 | r1878 | |
| 990 | 990 | |
| 991 | 991 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 992 | 992 | MDRV_CPU_PROGRAM_MAP(wgp_cpub_readmem,wgp_cpub_writemem) |
| 993 | MDRV_CPU_VBLANK_INT(wgp_cpub_interrupt | |
| 993 | MDRV_CPU_VBLANK_INT("main", wgp_cpub_interrupt | |
| 994 | 994 | |
| 995 | 995 | MDRV_MACHINE_START(wgp) |
| 996 | 996 | |
| r1877 | r1878 | |
| 1027 | 1027 | /* basic machine hardware */ |
| 1028 | 1028 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 1029 | 1029 | MDRV_CPU_PROGRAM_MAP(wgp_readmem,wgp_writemem) |
| 1030 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 1030 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 1031 | 1031 | |
| 1032 | 1032 | MDRV_CPU_ADD(Z80, 16000000/4) /* 4 MHz ??? */ |
| 1033 | 1033 | /* audio CPU */ |
| r1877 | r1878 | |
| 1035 | 1035 | |
| 1036 | 1036 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 1037 | 1037 | MDRV_CPU_PROGRAM_MAP(wgp_cpub_readmem,wgp_cpub_writemem) |
| 1038 | MDRV_CPU_VBLANK_INT(wgp_cpub_interrupt | |
| 1038 | MDRV_CPU_VBLANK_INT("main", wgp_cpub_interrupt | |
| 1039 | 1039 | |
| 1040 | 1040 | MDRV_MACHINE_START(wgp) |
| 1041 | 1041 |
| r1877 | r1878 | |
|---|---|---|
| 333 | 333 | |
| 334 | 334 | MDRV_CPU_ADD(M6809E,4000000) |
| 335 | 335 | MDRV_CPU_PROGRAM_MAP(game_cpu_map,0) |
| 336 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 336 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 337 | 337 | |
| 338 | 338 | MDRV_CPU_ADD(M6809E,4000000) |
| 339 | 339 | MDRV_CPU_PROGRAM_MAP(frame_cpu_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 347 | 347 | if (ACCESSING_LSB) |
| 348 | 348 | { |
| 349 | 349 | pending_command = 1; |
| 350 | soundlatch_w(0, data & 0xff); | |
| 351 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 350 | soundlatch_w(machine, 0, data & 0xff); | |
| 351 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 352 | 352 | } |
| 353 | 353 | } |
| 354 | 354 | |
| r1877 | r1878 | |
| 752 | 752 | /* basic machine hardware */ |
| 753 | 753 | MDRV_CPU_ADD(M68000,20000000/2) /* 10 MHz */ |
| 754 | 754 | MDRV_CPU_PROGRAM_MAP(welltris_readmem,welltris_writemem) |
| 755 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 755 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 756 | 756 | |
| 757 | 757 | MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz ??? */ |
| 758 | 758 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 75 | 75 | |
| 76 | 76 | */ |
| 77 | 77 | #include "driver.h" |
| 78 | #include "deprecat.h" | |
| 78 | 79 | #include "sound/ay8910.h" |
| 79 | 80 | |
| 80 | 81 | static tilemap *pturn_fgmap,*pturn_bgmap; |
| r1877 | r1878 | |
| 200 | 201 | |
| 201 | 202 | static WRITE8_HANDLER(sound_w) |
| 202 | 203 | { |
| 203 | soundlatch_w(0,data); | |
| 204 | soundlatch_w(machine,0,data); | |
| 204 | 205 | } |
| 205 | 206 | |
| 206 | 207 | |
| r1877 | r1878 | |
| 440 | 441 | |
| 441 | 442 | static MACHINE_RESET( pturn ) |
| 442 | 443 | { |
| 443 | soundlatch_clear_w(0,0); | |
| 444 | soundlatch_clear_w(machine,0,0); | |
| 444 | 445 | } |
| 445 | 446 | |
| 446 | 447 | static MACHINE_DRIVER_START( pturn ) |
| 447 | 448 | MDRV_CPU_ADD(Z80, 12000000/3) |
| 448 | 449 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 449 | MDRV_CPU_VBLANK_INT(pturn_main_intgen | |
| 450 | MDRV_CPU_VBLANK_INT("main", pturn_main_intgen | |
| 450 | 451 | MDRV_MACHINE_RESET(pturn) |
| 451 | 452 | |
| 452 | 453 | MDRV_CPU_ADD(Z80, 12000000/3) |
| 453 | 454 | /* audio CPU */ |
| 454 | 455 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| 455 | MDRV_CPU_VBLANK_INT(pturn_sub_intgen,3) | |
| 456 | MDRV_CPU_VBLANK_INT_HACK(pturn_sub_intgen,3) | |
| 456 | 457 | |
| 457 | 458 | MDRV_GFXDECODE(pturn) |
| 458 | 459 |
| r1877 | r1878 | |
|---|---|---|
| 309 | 309 | static MACHINE_DRIVER_START( gumbo ) |
| 310 | 310 | MDRV_CPU_ADD_TAG("main", M68000, 14318180 /2) // or 10mhz? ? |
| 311 | 311 | MDRV_CPU_PROGRAM_MAP(gumbo_readmem,gumbo_writemem) |
| 312 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 312 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 313 | 313 | |
| 314 | 314 | MDRV_GFXDECODE(gumbo) |
| 315 | 315 |
| r1877 | r1878 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | static READ8_HANDLER( port1_r ) |
| 81 | 81 | { |
| 82 | return input_port_1_r(0) | (ticket_dispenser_0_r(0) >> 5); | |
| 82 | return input_port_1_r(machine, 0) | (ticket_dispenser_0_r(machine, 0) >> 5); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | static WRITE8_HANDLER( lamps_w ) |
| r1877 | r1878 | |
| 105 | 105 | set_led_status(9,data & 0x08); |
| 106 | 106 | |
| 107 | 107 | /* bit 5 - ticket out in trivia games */ |
| 108 | ticket_dispenser_w(0, (data & 0x20)<< 2); | |
| 108 | ticket_dispenser_w(machine,0, (data & 0x20)<< 2); | |
| 109 | 109 | |
| 110 | 110 | /* bit 6 enables NMI */ |
| 111 | interrupt_enable_w(0,data & 0x40); | |
| 111 | interrupt_enable_w(machine,0,data & 0x40); | |
| 112 | 112 | |
| 113 | 113 | /* bit 7 goes directly to the sound amplifier */ |
| 114 | 114 | DAC_data_w(0,((data & 0x80) >> 7) * 255); |
| r1877 | r1878 | |
| 143 | 143 | set_led_status(8,data & 0x10); |
| 144 | 144 | |
| 145 | 145 | /* bit 6 enables NMI */ |
| 146 | interrupt_enable_w(0,data & 0x40); | |
| 146 | interrupt_enable_w(machine,0,data & 0x40); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | static WRITE8_HANDLER( banksel_1_1_w ) |
| r1877 | r1878 | |
| 396 | 396 | static MACHINE_DRIVER_START( getrivia ) |
| 397 | 397 | MDRV_CPU_ADD_TAG("cpu",Z80,4000000) /* 4 MHz */ |
| 398 | 398 | MDRV_CPU_PROGRAM_MAP(getrivia_map,0) |
| 399 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 399 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 400 | 400 | |
| 401 | 401 | /* video hardware */ |
| 402 | 402 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 50 | 50 | ***************************************************************************/ |
| 51 | 51 | |
| 52 | 52 | #include "driver.h" |
| 53 | #include "deprecat.h" | |
| 53 | 54 | #include "sound/ay8910.h" |
| 54 | 55 | |
| 55 | 56 | |
| r1877 | r1878 | |
| 232 | 233 | /* basic machine hardware */ |
| 233 | 234 | MDRV_CPU_ADD(M6502, 1500000) |
| 234 | 235 | MDRV_CPU_PROGRAM_MAP(dommy_readmem,dommy_writemem) |
| 235 | MDRV_CPU_VBLANK_INT(irq0_line_hold,16) | |
| 236 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,16) | |
| 236 | 237 | |
| 237 | 238 | /* video hardware */ |
| 238 | 239 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 265 | 266 | /* basic machine hardware */ |
| 266 | 267 | MDRV_CPU_ADD(M6502, 1500000) |
| 267 | 268 | MDRV_CPU_PROGRAM_MAP(eggs_readmem,eggs_writemem) |
| 268 | MDRV_CPU_VBLANK_INT(irq0_line_hold,16) | |
| 269 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,16) | |
| 269 | 270 | |
| 270 | 271 | /* video hardware */ |
| 271 | 272 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 57 | 57 | switch (offset<<1) |
| 58 | 58 | { |
| 59 | 59 | case 0: /* Playfield & Sprite priority */ |
| 60 | dec0_priority_w(0,data,mem_mask); | |
| 60 | dec0_priority_w(machine,0,data,mem_mask); | |
| 61 | 61 | break; |
| 62 | 62 | |
| 63 | 63 | case 2: /* DMA flag */ |
| 64 | dec0_update_sprites_w(0,0,mem_mask); | |
| 64 | dec0_update_sprites_w(machine,0,0,mem_mask); | |
| 65 | 65 | break; |
| 66 | 66 | |
| 67 | 67 | case 4: /* 6502 sound cpu */ |
| 68 | 68 | if (ACCESSING_LSB) |
| 69 | 69 | { |
| 70 | soundlatch_w(0,data & 0xff); | |
| 71 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 70 | soundlatch_w(machine,0,data & 0xff); | |
| 71 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 72 | 72 | } |
| 73 | 73 | break; |
| 74 | 74 | |
| r1877 | r1878 | |
| 103 | 103 | case 0: |
| 104 | 104 | if (ACCESSING_LSB) |
| 105 | 105 | { |
| 106 | soundlatch_w(0,data & 0xff); | |
| 107 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 106 | soundlatch_w(machine,0,data & 0xff); | |
| 107 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 108 | 108 | } |
| 109 | 109 | break; |
| 110 | 110 | case 2: |
| 111 | dec0_priority_w(0,data,mem_mask); | |
| 111 | dec0_priority_w(machine,0,data,mem_mask); | |
| 112 | 112 | break; |
| 113 | 113 | } |
| 114 | 114 | } |
| r1877 | r1878 | |
| 117 | 117 | { |
| 118 | 118 | if (ACCESSING_LSB) |
| 119 | 119 | { |
| 120 | soundlatch_w(0,data & 0xff); | |
| 121 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 120 | soundlatch_w(machine,0,data & 0xff); | |
| 121 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
| r1877 | r1878 | |
| 295 | 295 | { |
| 296 | 296 | switch (offset) { |
| 297 | 297 | case 0: |
| 298 | YM3812_control_port_0_w(0,data); | |
| 298 | YM3812_control_port_0_w(machine,0,data); | |
| 299 | 299 | break; |
| 300 | 300 | case 1: |
| 301 | YM3812_write_port_0_w(0,data); | |
| 301 | YM3812_write_port_0_w(machine,0,data); | |
| 302 | 302 | break; |
| 303 | 303 | } |
| 304 | 304 | } |
| r1877 | r1878 | |
| 307 | 307 | { |
| 308 | 308 | switch (offset) { |
| 309 | 309 | case 0: |
| 310 | YM2203_control_port_0_w(0,data); | |
| 310 | YM2203_control_port_0_w(machine,0,data); | |
| 311 | 311 | break; |
| 312 | 312 | case 1: |
| 313 | YM2203_write_port_0_w(0,data); | |
| 313 | YM2203_write_port_0_w(machine,0,data); | |
| 314 | 314 | break; |
| 315 | 315 | } |
| 316 | 316 | } |
| r1877 | r1878 | |
| 930 | 930 | /* basic machine hardware */ |
| 931 | 931 | MDRV_CPU_ADD(M68000, 10000000) |
| 932 | 932 | MDRV_CPU_PROGRAM_MAP(dec0_readmem,dec0_writemem) |
| 933 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 933 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 934 | 934 | |
| 935 | 935 | MDRV_CPU_ADD(M6502, 1500000) |
| 936 | 936 | /* audio CPU */ |
| r1877 | r1878 | |
| 973 | 973 | /* basic machine hardware */ |
| 974 | 974 | MDRV_CPU_ADD(M68000, 10000000) |
| 975 | 975 | MDRV_CPU_PROGRAM_MAP(dec0_readmem,dec0_writemem) |
| 976 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 976 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 977 | 977 | |
| 978 | 978 | MDRV_CPU_ADD(M6502, 1500000) |
| 979 | 979 | /* audio CPU */ |
| r1877 | r1878 | |
| 1016 | 1016 | /* basic machine hardware */ |
| 1017 | 1017 | MDRV_CPU_ADD(M68000, 10000000) |
| 1018 | 1018 | MDRV_CPU_PROGRAM_MAP(dec0_readmem,dec0_writemem) |
| 1019 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 1019 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 1020 | 1020 | |
| 1021 | 1021 | MDRV_CPU_ADD(M6502, 1500000) |
| 1022 | 1022 | /* audio CPU */ |
| r1877 | r1878 | |
| 1059 | 1059 | /* basic machine hardware */ |
| 1060 | 1060 | MDRV_CPU_ADD(M68000, 10000000) |
| 1061 | 1061 | MDRV_CPU_PROGRAM_MAP(dec0_readmem,dec0_writemem) |
| 1062 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 1062 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 1063 | 1063 | |
| 1064 | 1064 | MDRV_CPU_ADD(M6502, 1500000) |
| 1065 | 1065 | /* audio CPU */ |
| r1877 | r1878 | |
| 1107 | 1107 | /* basic machine hardware */ |
| 1108 | 1108 | MDRV_CPU_ADD(M68000, 10000000) |
| 1109 | 1109 | MDRV_CPU_PROGRAM_MAP(dec0_readmem,dec0_writemem) |
| 1110 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 1110 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 1111 | 1111 | |
| 1112 | 1112 | MDRV_CPU_ADD(M6502, 1500000) |
| 1113 | 1113 | /* audio CPU */ |
| r1877 | r1878 | |
| 1150 | 1150 | /* basic machine hardware */ |
| 1151 | 1151 | MDRV_CPU_ADD(M68000, 10000000) |
| 1152 | 1152 | MDRV_CPU_PROGRAM_MAP(dec0_readmem,dec0_writemem) |
| 1153 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 1153 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 1154 | 1154 | |
| 1155 | 1155 | MDRV_CPU_ADD(M6502, 1500000) |
| 1156 | 1156 | /* audio CPU */ |
| r1877 | r1878 | |
| 1198 | 1198 | /* basic machine hardware */ |
| 1199 | 1199 | MDRV_CPU_ADD(M68000, XTAL_20MHz/2) /* verified on pcb (20MHZ OSC) 68000P12 running at 10Mhz */ |
| 1200 | 1200 | MDRV_CPU_PROGRAM_MAP(slyspy_readmem,slyspy_writemem) |
| 1201 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 1201 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 1202 | 1202 | |
| 1203 | 1203 | MDRV_CPU_ADD(H6280, XTAL_12MHz/2/3) |
| 1204 | 1204 | /* audio CPU */ /* verified on pcb (6Mhz is XIN on pin 10 of H6280, verified on pcb */ |
| r1877 | r1878 | |
| 1241 | 1241 | /* basic machine hardware */ |
| 1242 | 1242 | MDRV_CPU_ADD(M68000, XTAL_20MHz/2) /* verified on pcb (20MHZ OSC) 68000P12 running at 10Mhz */ |
| 1243 | 1243 | MDRV_CPU_PROGRAM_MAP(midres_readmem,midres_writemem) |
| 1244 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 1244 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 1245 | 1245 | |
| 1246 | 1246 | MDRV_CPU_ADD(H6280, XTAL_24MHz/4/3) |
| 1247 | 1247 | /* audio CPU */ /* verified on pcb (6Mhz is XIN on pin 10 of H6280, verified on pcb */ |
| r1877 | r1878 | |
|---|---|---|
| 2790 | 2790 | |
| 2791 | 2791 | /* basic machine hardware */ |
| 2792 | 2792 | MDRV_CPU_ADD_TAG("main", V60, 16000000) /* Based on STA-0001 & STA-0001B System boards */ |
| 2793 | MDRV_CPU_VBLANK_INT(ssv_interrupt,2) /* Vblank */ | |
| 2793 | MDRV_CPU_VBLANK_INT_HACK(ssv_interrupt,2) /* Vblank */ | |
| 2794 | 2794 | |
| 2795 | 2795 | MDRV_MACHINE_RESET(ssv) |
| 2796 | 2796 | |
| r1877 | r1878 | |
| 2837 | 2837 | MDRV_IMPORT_FROM(ssv) |
| 2838 | 2838 | MDRV_CPU_MODIFY("main") |
| 2839 | 2839 | MDRV_CPU_PROGRAM_MAP(gdfs_readmem, gdfs_writemem) |
| 2840 | MDRV_CPU_VBLANK_INT(gdfs_interrupt,1+4) | |
| 2840 | MDRV_CPU_VBLANK_INT_HACK(gdfs_interrupt,1+4) | |
| 2841 | 2841 | |
| 2842 | 2842 | MDRV_NVRAM_HANDLER(gdfs) |
| 2843 | 2843 |
| r1877 | r1878 | |
|---|---|---|
| 593 | 593 | /* basic machine hardware */ |
| 594 | 594 | MDRV_CPU_ADD(M68000,24000000 / 2) /* 12 MHz ??? */ |
| 595 | 595 | MDRV_CPU_PROGRAM_MAP(airsys_map, 0) |
| 596 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 596 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 597 | 597 | |
| 598 | 598 | MDRV_CPU_ADD(Z80,8000000 / 2) /* 4 MHz ??? */ |
| 599 | 599 | MDRV_CPU_PROGRAM_MAP(sound_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 518 | 518 | /* basic machine hardware */ |
| 519 | 519 | MDRV_CPU_ADD(M68000, ATARI_CLOCK_14MHz) |
| 520 | 520 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 521 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 521 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 522 | 522 | |
| 523 | 523 | /* ASIC65 */ |
| 524 | 524 | MDRV_IMPORT_FROM(asic65) |
| r1877 | r1878 | |
|---|---|---|
| 433 | 433 | /* basic machine hardware */ |
| 434 | 434 | MDRV_CPU_ADD(M6809, 49152000/32) |
| 435 | 435 | MDRV_CPU_PROGRAM_MAP(m6809_map,0) |
| 436 | MDRV_CPU_VBLANK_INT(m6809_vb_interrupt | |
| 436 | MDRV_CPU_VBLANK_INT("2D", m6809_vb_interrupt | |
| 437 | 437 | |
| 438 | 438 | MDRV_CPU_ADD(M65C02, 49152000/24) |
| 439 | 439 | /* audio CPU */ |
| r1877 | r1878 | |
| 445 | 445 | |
| 446 | 446 | MDRV_CPU_ADD(M68000, 49152000/4) |
| 447 | 447 | MDRV_CPU_PROGRAM_MAP(m68k_map,0) |
| 448 | MDRV_CPU_VBLANK_INT(m68k_vb_interrupt | |
| 448 | MDRV_CPU_VBLANK_INT("2D", m68k_vb_interrupt | |
| 449 | 449 | |
| 450 | 450 | MDRV_CPU_ADD(HD63701, 49152000/8) /* or compatible 6808 with extra instructions */ |
| 451 | 451 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 452 | 452 | MDRV_CPU_IO_MAP(mcu_io_map,0) |
| 453 | MDRV_CPU_VBLANK_INT(mcu_vb_interrupt | |
| 453 | MDRV_CPU_VBLANK_INT("2D", mcu_vb_interrupt | |
| 454 | 454 | |
| 455 | 455 | MDRV_INTERLEAVE(100) |
| 456 | 456 |
| r1877 | r1878 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | static WRITE8_HANDLER( cop01_sound_command_w ) |
| 71 | 71 | { |
| 72 | soundlatch_w(offset,data); | |
| 73 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 72 | soundlatch_w(machine,offset,data); | |
| 73 | cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | static READ8_HANDLER( cop01_sound_command_r ) |
| r1877 | r1878 | |
| 80 | 80 | #define TIMER_RATE 12000 /* total guess */ |
| 81 | 81 | |
| 82 | 82 | |
| 83 | res = (soundlatch_r(offset) & 0x7f) << 1; | |
| 83 | res = (soundlatch_r(machine,offset) & 0x7f) << 1; | |
| 84 | 84 | |
| 85 | 85 | /* bit 0 seems to be a timer */ |
| 86 | 86 | if ((activecpu_gettotalcycles() / TIMER_RATE) & 1) |
| r1877 | r1878 | |
| 418 | 418 | MDRV_CPU_ADD(Z80, 4000000) /* ???? */ |
| 419 | 419 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 420 | 420 | MDRV_CPU_IO_MAP(readport,writeport) |
| 421 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 421 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 422 | 422 | |
| 423 | 423 | MDRV_CPU_ADD(Z80, 3000000) |
| 424 | 424 | /* audio CPU */ /* ???? */ |
| r1877 | r1878 | |
| 459 | 459 | MDRV_CPU_ADD(Z80, 4000000) /* ???? */ |
| 460 | 460 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 461 | 461 | MDRV_CPU_IO_MAP(mightguy_readport,writeport) |
| 462 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 462 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 463 | 463 | |
| 464 | 464 | MDRV_CPU_ADD(Z80, 3000000) |
| 465 | 465 | /* audio CPU */ /* ???? */ |
| r1877 | r1878 | |
|---|---|---|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | return (input_port_0_r(0) & 0xf0) | ordinal; | |
| 72 | return (input_port_0_r(machine,0) & 0xf0) | ordinal; | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | static WRITE8_HANDLER( hanaawas_inputs_mux_w ) |
| r1877 | r1878 | |
| 208 | 208 | MDRV_CPU_ADD(Z80,18432000/6) /* 3.072 MHz ??? */ |
| 209 | 209 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 210 | 210 | MDRV_CPU_IO_MAP(readport,writeport) |
| 211 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 211 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 212 | 212 | |
| 213 | 213 | /* video hardware */ |
| 214 | 214 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 1167 | 1167 | static INPUT_PORTS_START( dealem ) |
| 1168 | 1168 | PORT_START_TAG("ORANGE1") |
| 1169 | 1169 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Gamble") |
| 1170 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_ | |
| 1170 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_U | |
| 1171 | 1171 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 1172 | 1172 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 1173 | 1173 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 1174 | 1174 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 1175 | 1175 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 1176 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_ | |
| 1176 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UN | |
| 1177 | 1177 | |
| 1178 | 1178 | PORT_START_TAG("ORANGE2") |
| 1179 | 1179 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN5) PORT_NAME("20p Token")PORT_IMPULSE(3) |
| r1877 | r1878 | |
| 1187 | 1187 | |
| 1188 | 1188 | PORT_START_TAG("BLACK1") |
| 1189 | 1189 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Collect") |
| 1190 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_ | |
| 1190 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_START2 | |
| 1191 | 1191 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 1192 | 1192 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 1193 | 1193 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 1194 | 1194 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Button") PORT_CODE(KEYCODE_W) |
| 1195 | 1195 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE |
| 1196 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME(" | |
| 1196 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Rear | |
| 1197 | 1197 | |
| 1198 | 1198 | PORT_START_TAG("BLACK2") |
| 1199 | 1199 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") |
| r1877 | r1878 | |
| 1495 | 1495 | |
| 1496 | 1496 | static UINT8 *dealem_videoram; |
| 1497 | 1497 | |
| 1498 | static WRITE8_HANDLER( dealem_mc6845_address_w ) | |
| 1499 | { | |
| 1500 | mc6845_address_w(mc6845, data); | |
| 1501 | } | |
| 1502 | ||
| 1503 | static READ8_HANDLER( dealem_mc6845_register_r ) | |
| 1504 | { | |
| 1505 | return mc6845_register_r(mc6845); | |
| 1506 | } | |
| 1507 | ||
| 1508 | static WRITE8_HANDLER( dealem_mc6845_register_w ) | |
| 1509 | { | |
| 1510 | mc6845_register_w(mc6845, data); | |
| 1511 | } | |
| 1512 | ||
| 1513 | 1498 | /*************************************************************************** |
| 1514 | 1499 | |
| 1515 | 1500 | Convert the color PROMs into a more useable format. |
| r1877 | r1878 | |
| 1585 | 1570 | |
| 1586 | 1571 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 1587 | 1572 | |
| 1588 | AM_RANGE(0x0800, 0x0800) AM_WRITE(dealem_mc6845_address_w) | |
| 1589 | AM_RANGE(0x0801, 0x0801) AM_READWRITE(dealem_mc6845_register_r, dealem_mc6845_register_w) | |
| 1573 | AM_RANGE(0x0800, 0x0800) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 1574 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 1590 | 1575 | |
| 1591 | // AM_RANGE(0x0850, 0x0850) AM_WRITE(bankswitch_w) // write bank (rom page select) | |
| 1576 | // AM_RANGE(0x0850, 0x0850) AM_READWRITE(bankswitch_r,bankswitch_w) // write bank (rom page select) | |
| 1592 | 1577 | |
| 1593 | 1578 | // AM_RANGE(0x08E0, 0x08E7) AM_READ( 68681_duart_r) |
| 1594 | 1579 | // AM_RANGE(0x08E0, 0x08E7) AM_WRITE( 68681_duart_w) |
| r1877 | r1878 | |
| 1627 | 1612 | |
| 1628 | 1613 | MDRV_CPU_ADD_TAG("video", M68000, VIDEO_MASTER_CLOCK ) |
| 1629 | 1614 | MDRV_CPU_PROGRAM_MAP(mpu4_68k_map,0) |
| 1630 | MDRV_CPU_VBLANK_INT(mpu4_vid_irq | |
| 1615 | MDRV_CPU_VBLANK_INT("main", mpu4_vid_irq | |
| 1631 | 1616 | |
| 1632 | 1617 | MDRV_NVRAM_HANDLER(generic_0fill) // confirm |
| 1633 | 1618 | |
| r1877 | r1878 | |
| 1676 | 1661 | |
| 1677 | 1662 | MDRV_CPU_PERIODIC_INT(gen_50hz, 100) // generate 50 hz signal |
| 1678 | 1663 | |
| 1679 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 1664 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 1680 | 1665 | |
| 1681 | 1666 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1682 | 1667 | MDRV_SOUND_ADD_TAG("AY8913",AY8913, MPU4_MASTER_CLOCK/4) |
| r1877 | r1878 | |
|---|---|---|
| 87 | 87 | static READ16_HANDLER( aquarium_coins_r ) |
| 88 | 88 | { |
| 89 | 89 | int data; |
| 90 | data = (input_port_2_word_r(0,mem_mask) & 0x7fff); /* IN1 */ | |
| 90 | data = (input_port_2_word_r(machine,0,mem_mask) & 0x7fff); /* IN1 */ | |
| 91 | 91 | data |= aquarium_snd_ack; |
| 92 | 92 | aquarium_snd_ack = 0; |
| 93 | 93 | return data; |
| r1877 | r1878 | |
| 102 | 102 | { |
| 103 | 103 | // popmessage("sound write %04x",data); |
| 104 | 104 | |
| 105 | soundlatch_w(1,data&0xff); | |
| 106 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 105 | soundlatch_w(machine,1,data&0xff); | |
| 106 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | static WRITE8_HANDLER( aquarium_z80_bank_w ) |
| r1877 | r1878 | |
| 132 | 132 | |
| 133 | 133 | static READ8_HANDLER( aquarium_oki_r ) |
| 134 | 134 | { |
| 135 | return (aquarium_snd_bitswap(OKIM6295_status_0_r(0)) ); | |
| 135 | return (aquarium_snd_bitswap(OKIM6295_status_0_r(machine,0)) ); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | static WRITE8_HANDLER( aquarium_oki_w ) |
| 139 | 139 | { |
| 140 | 140 | logerror("Z80-PC:%04x Writing %04x to the OKI M6295\n",activecpu_get_previouspc(),aquarium_snd_bitswap(data)); |
| 141 | OKIM6295_data_0_w( 0, (aquarium_snd_bitswap(data)) ); | |
| 141 | OKIM6295_data_0_w( machine, 0, (aquarium_snd_bitswap(data)) ); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | |
| r1877 | r1878 | |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | /* reset the sound bank */ |
| 346 | aquarium_z80_bank_w(0, 0); | |
| 346 | aquarium_z80_bank_w(machine, 0, 0); | |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | |
| r1877 | r1878 | |
| 370 | 370 | /* basic machine hardware */ |
| 371 | 371 | MDRV_CPU_ADD(M68000, 32000000/2) |
| 372 | 372 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 373 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 373 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 374 | 374 | |
| 375 | 375 | MDRV_CPU_ADD(Z80, 6000000) |
| 376 | 376 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 157 | 157 | { |
| 158 | 158 | /* Get the pending IRQs (only the enabled ones, e.g. where |
| 159 | 159 | irq_enable is *0*) */ |
| 160 | UINT16 irq = metro_irq_cause_r(0,0) & ~*metro_irq_enable; | |
| 160 | UINT16 irq = metro_irq_cause_r(Machine,0,0) & ~*metro_irq_enable; | |
| 161 | 161 | |
| 162 | 162 | if (irq_line == -1) /* mouja, gakusai, gakusai2, dokyusei, dokyusp */ |
| 163 | 163 | { |
| r1877 | r1878 | |
| 344 | 344 | switch ( ioline ) |
| 345 | 345 | { |
| 346 | 346 | case UPD7810_RXD: /* read the RxD line */ |
| 347 | data = soundlatch_r(0); | |
| 347 | data = soundlatch_r(Machine,0); | |
| 348 | 348 | state = data & 1; |
| 349 | soundlatch_w(0, data >> 1); | |
| 349 | soundlatch_w(Machine, 0, data >> 1); | |
| 350 | 350 | break; |
| 351 | 351 | default: |
| 352 | 352 | logerror("upd7810 ioline %d not handled\n", ioline); |
| r1877 | r1878 | |
| 359 | 359 | { |
| 360 | 360 | if (ACCESSING_LSB) |
| 361 | 361 | { |
| 362 | soundlatch_w(0,data & 0xff); | |
| 363 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 362 | soundlatch_w(machine,0,data & 0xff); | |
| 363 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 364 | 364 | cpu_spinuntil_int(); |
| 365 | 365 | busy_sndcpu = 1; |
| 366 | 366 | } |
| r1877 | r1878 | |
| 443 | 443 | { |
| 444 | 444 | /* write */ |
| 445 | 445 | if (BIT(data,1)) |
| 446 | YM2413_data_port_0_w(0,porta); | |
| 446 | YM2413_data_port_0_w(machine,0,porta); | |
| 447 | 447 | else |
| 448 | YM2413_register_port_0_w(0,porta); | |
| 448 | YM2413_register_port_0_w(machine,0,porta); | |
| 449 | 449 | } |
| 450 | 450 | portb = data; |
| 451 | 451 | return; |
| r1877 | r1878 | |
| 455 | 455 | { |
| 456 | 456 | /* write */ |
| 457 | 457 | if (!BIT(data,4)) |
| 458 | OKIM6295_data_0_w(0,porta); | |
| 458 | OKIM6295_data_0_w(machine,0,porta); | |
| 459 | 459 | } |
| 460 | 460 | portb = data; |
| 461 | 461 | } |
| r1877 | r1878 | |
| 487 | 487 | { |
| 488 | 488 | /* write */ |
| 489 | 489 | if (BIT(data,1)) |
| 490 | YM2151_data_port_0_w(0,porta); | |
| 490 | YM2151_data_port_0_w(machine,0,porta); | |
| 491 | 491 | else |
| 492 | YM2151_register_port_0_w(0,porta); | |
| 492 | YM2151_register_port_0_w(machine,0,porta); | |
| 493 | 493 | } |
| 494 | 494 | if (!BIT(data,3)) |
| 495 | 495 | { |
| 496 | 496 | /* read */ |
| 497 | 497 | if (BIT(data,1)) |
| 498 | porta = YM2151_status_port_0_r(0); | |
| 498 | porta = YM2151_status_port_0_r(machine,0); | |
| 499 | 499 | } |
| 500 | 500 | portb = data; |
| 501 | 501 | return; |
| r1877 | r1878 | |
| 505 | 505 | { |
| 506 | 506 | /* write */ |
| 507 | 507 | if (!BIT(data,4)) |
| 508 | OKIM6295_data_0_w(0,porta); | |
| 508 | OKIM6295_data_0_w(machine,0,porta); | |
| 509 | 509 | } |
| 510 | 510 | if (BIT(portb,3) && !BIT(data,3)) /* clock 1->0 */ |
| 511 | 511 | { |
| 512 | 512 | /* read */ |
| 513 | 513 | if (!BIT(data,4)) |
| 514 | porta = OKIM6295_status_0_r(0); | |
| 514 | porta = OKIM6295_status_0_r(machine,0); | |
| 515 | 515 | } |
| 516 | 516 | portb = data; |
| 517 | 517 | } |
| r1877 | r1878 | |
| 529 | 529 | |
| 530 | 530 | static READ16_HANDLER( ymf278b_r ) |
| 531 | 531 | { |
| 532 | return YMF278B_status_port_0_r(0); | |
| 532 | return YMF278B_status_port_0_r(machine, 0); | |
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | static WRITE16_HANDLER( ymf278b_w ) |
| r1877 | r1878 | |
| 538 | 538 | switch(offset) |
| 539 | 539 | { |
| 540 | 540 | case 0: |
| 541 | YMF278B_control_port_0_A_w(0, data); | |
| 541 | YMF278B_control_port_0_A_w(machine, 0, data); | |
| 542 | 542 | break; |
| 543 | 543 | case 1: |
| 544 | YMF278B_data_port_0_A_w(0, data); | |
| 544 | YMF278B_data_port_0_A_w(machine, 0, data); | |
| 545 | 545 | break; |
| 546 | 546 | case 2: |
| 547 | YMF278B_control_port_0_B_w(0, data); | |
| 547 | YMF278B_control_port_0_B_w(machine, 0, data); | |
| 548 | 548 | break; |
| 549 | 549 | case 3: |
| 550 | YMF278B_data_port_0_B_w(0, data); | |
| 550 | YMF278B_data_port_0_B_w(machine, 0, data); | |
| 551 | 551 | break; |
| 552 | 552 | case 4: |
| 553 | YMF278B_control_port_0_C_w(0, data); | |
| 553 | YMF278B_control_port_0_C_w(machine, 0, data); | |
| 554 | 554 | break; |
| 555 | 555 | case 5: |
| 556 | YMF278B_data_port_0_C_w(0, data); | |
| 556 | YMF278B_data_port_0_C_w(machine, 0, data); | |
| 557 | 557 | break; |
| 558 | 558 | } |
| 559 | 559 | } |
| r1877 | r1878 | |
| 689 | 689 | return ROM[offs] ^ 0xff; |
| 690 | 690 | } |
| 691 | 691 | |
| 692 | INLINE void blt_write(const int tmap, const offs_t offs, const UINT16 data, const UINT16 mask) | |
| 692 | INLINE void blt_write(running_machine *machine, const int tmap, const offs_t offs, const UINT16 data, const UINT16 mask) | |
| 693 | 693 | { |
| 694 | 694 | switch( tmap ) |
| 695 | 695 | { |
| 696 | case 1: metro_vram_0_w(offs,data,mask); break; | |
| 697 | case 2: metro_vram_1_w(offs,data,mask); break; | |
| 698 | case 3: metro_vram_2_w(offs,data,mask); break; | |
| 696 | case 1: metro_vram_0_w(machine,offs,data,mask); break; | |
| 697 | case 2: metro_vram_1_w(machine,offs,data,mask); break; | |
| 698 | case 3: metro_vram_2_w(machine,offs,data,mask); break; | |
| 699 | 699 | } |
| 700 | 700 | // logerror("CPU #0 PC %06X : Blitter %X] %04X <- %04X & %04X\n",activecpu_get_pc(),tmap,offs,data,mask); |
| 701 | 701 | } |
| r1877 | r1878 | |
| 770 | 770 | src_offs++; |
| 771 | 771 | |
| 772 | 772 | dst_offs &= 0xffff; |
| 773 | blt_write(tmap,dst_offs,b2,mask); | |
| 773 | blt_write(machine,tmap,dst_offs,b2,mask); | |
| 774 | 774 | dst_offs = ((dst_offs+1) & (0x100-1)) | (dst_offs & (~(0x100-1))); |
| 775 | 775 | } |
| 776 | 776 | break; |
| r1877 | r1878 | |
| 786 | 786 | while (count--) |
| 787 | 787 | { |
| 788 | 788 | dst_offs &= 0xffff; |
| 789 | blt_write(tmap,dst_offs,b2<<shift,mask); | |
| 789 | blt_write(machine,tmap,dst_offs,b2<<shift,mask); | |
| 790 | 790 | dst_offs = ((dst_offs+1) & (0x100-1)) | (dst_offs & (~(0x100-1))); |
| 791 | 791 | b2++; |
| 792 | 792 | } |
| r1877 | r1878 | |
| 803 | 803 | while (count--) |
| 804 | 804 | { |
| 805 | 805 | dst_offs &= 0xffff; |
| 806 | blt_write(tmap,dst_offs,b2,mask); | |
| 806 | blt_write(machine,tmap,dst_offs,b2,mask); | |
| 807 | 807 | dst_offs = ((dst_offs+1) & (0x100-1)) | (dst_offs & (~(0x100-1))); |
| 808 | 808 | } |
| 809 | 809 | break; |
| r1877 | r1878 | |
| 1184 | 1184 | } \ |
| 1185 | 1185 | static WRITE16_HANDLER( karatour_vram_##_n_##_w ) \ |
| 1186 | 1186 | { \ |
| 1187 | metro_vram_##_n_##_w(KARATOUR_OFFS(offset),data,mem_mask); \ | |
| 1187 | metro_vram_##_n_##_w(machine,KARATOUR_OFFS(offset),data,mem_mask); \ | |
| 1188 | 1188 | } |
| 1189 | 1189 | |
| 1190 | 1190 | KARATOUR_VRAM( 0 ) |
| r1877 | r1878 | |
| 1928 | 1928 | |
| 1929 | 1929 | static WRITE16_HANDLER( blzntrnd_sound_w ) |
| 1930 | 1930 | { |
| 1931 | soundlatch_w(offset, data>>8); | |
| 1932 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1931 | soundlatch_w(machine, offset, data>>8); | |
| 1932 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1933 | 1933 | } |
| 1934 | 1934 | |
| 1935 | 1935 | static WRITE8_HANDLER( blzntrnd_sh_bankswitch_w ) |
| r1877 | r1878 | |
| 2151 | 2151 | |
| 2152 | 2152 | static READ8_HANDLER( puzzlet_port7_r ) |
| 2153 | 2153 | { |
| 2154 | return input_port_2_word_r(0,0); | |
| 2154 | return input_port_2_word_r(machine,0,0); | |
| 2155 | 2155 | } |
| 2156 | 2156 | |
| 2157 | 2157 | static READ8_HANDLER( puzzlet_serB_r ) |
| 2158 | 2158 | { |
| 2159 | return input_port_0_word_r(0,0); // coin | |
| 2159 | return input_port_0_word_r(machine,0,0); // coin | |
| 2160 | 2160 | } |
| 2161 | 2161 | |
| 2162 | 2162 | static WRITE8_HANDLER( puzzlet_portb_w ) |
| r1877 | r1878 | |
| 3803 | 3803 | /* basic machine hardware */ |
| 3804 | 3804 | MDRV_CPU_ADD(M68000, 16000000) |
| 3805 | 3805 | MDRV_CPU_PROGRAM_MAP(balcube_readmem,balcube_writemem) |
| 3806 | MDRV_CPU_VBLANK_INT(metro_interrupt,10) /* ? */ | |
| 3806 | MDRV_CPU_VBLANK_INT_HACK(metro_interrupt,10) /* ? */ | |
| 3807 | 3807 | |
| 3808 | 3808 | MDRV_MACHINE_RESET(metro) |
| 3809 | 3809 | |
| r1877 | r1878 | |
| 3836 | 3836 | /* basic machine hardware */ |
| 3837 | 3837 | MDRV_CPU_ADD(M68000, 16000000) |
| 3838 | 3838 | MDRV_CPU_PROGRAM_MAP(bangball_readmem,bangball_writemem) |
| 3839 | MDRV_CPU_VBLANK_INT(bangball_interrupt | |
| 3839 | MDRV_CPU_VBLANK_INT("main", bangball_interrupt | |
| 3840 | 3840 | |
| 3841 | 3841 | MDRV_MACHINE_RESET(metro) |
| 3842 | 3842 | |
| r1877 | r1878 | |
| 3869 | 3869 | /* basic machine hardware */ |
| 3870 | 3870 | MDRV_CPU_ADD(M68000, 16000000) |
| 3871 | 3871 | MDRV_CPU_PROGRAM_MAP(batlbubl_readmem,batlbubl_writemem) |
| 3872 | MDRV_CPU_VBLANK_INT(bangball_interrupt | |
| 3872 | MDRV_CPU_VBLANK_INT("main", bangball_interrupt | |
| 3873 | 3873 | |
| 3874 | 3874 | MDRV_MACHINE_RESET(metro) |
| 3875 | 3875 | |
| r1877 | r1878 | |
| 3901 | 3901 | /* basic machine hardware */ |
| 3902 | 3902 | MDRV_CPU_ADD(M68000, 16000000) |
| 3903 | 3903 | MDRV_CPU_PROGRAM_MAP(daitorid_readmem,daitorid_writemem) |
| 3904 | MDRV_CPU_VBLANK_INT(metro_interrupt,10) /* ? */ | |
| 3904 | MDRV_CPU_VBLANK_INT_HACK(metro_interrupt,10) /* ? */ | |
| 3905 | 3905 | |
| 3906 | 3906 | MDRV_CPU_ADD(UPD7810, 12000000) |
| 3907 | 3907 | /* audio CPU */ |
| r1877 | r1878 | |
| 3945 | 3945 | /* basic machine hardware */ |
| 3946 | 3946 | MDRV_CPU_ADD(M68000, 12000000) |
| 3947 | 3947 | MDRV_CPU_PROGRAM_MAP(dharma_readmem,dharma_writemem) |
| 3948 | MDRV_CPU_VBLANK_INT(metro_interrupt,10) /* ? */ | |
| 3948 | MDRV_CPU_VBLANK_INT_HACK(metro_interrupt,10) /* ? */ | |
| 3949 | 3949 | |
| 3950 | 3950 | MDRV_CPU_ADD(UPD7810, 12000000) |
| 3951 | 3951 | /* audio CPU */ |
| r1877 | r1878 | |
| 3988 | 3988 | /* basic machine hardware */ |
| 3989 | 3989 | MDRV_CPU_ADD(M68000, 12000000) |
| 3990 | 3990 | MDRV_CPU_PROGRAM_MAP(karatour_readmem,karatour_writemem) |
| 3991 | MDRV_CPU_VBLANK_INT(karatour_interrupt,10) /* ? */ | |
| 3991 | MDRV_CPU_VBLANK_INT_HACK(karatour_interrupt,10) /* ? */ | |
| 3992 | 3992 | |
| 3993 | 3993 | MDRV_CPU_ADD(UPD7810, 12000000) |
| 3994 | 3994 | /* audio CPU */ |
| r1877 | r1878 | |
| 4031 | 4031 | /* basic machine hardware */ |
| 4032 | 4032 | MDRV_CPU_ADD(M68000, 12000000) |
| 4033 | 4033 | MDRV_CPU_PROGRAM_MAP(kokushi_readmem,kokushi_writemem) |
| 4034 | MDRV_CPU_VBLANK_INT(karatour_interrupt,10) /* ? */ | |
| 4034 | MDRV_CPU_VBLANK_INT_HACK(karatour_interrupt,10) /* ? */ | |
| 4035 | 4035 | |
| 4036 | 4036 | MDRV_CPU_ADD(UPD7810, 12000000) |
| 4037 | 4037 | /* audio CPU */ |
| r1877 | r1878 | |
| 4074 | 4074 | /* basic machine hardware */ |
| 4075 | 4075 | MDRV_CPU_ADD(M68000, 12000000) |
| 4076 | 4076 | MDRV_CPU_PROGRAM_MAP(lastfort_readmem,lastfort_writemem) |
| 4077 | MDRV_CPU_VBLANK_INT(metro_interrupt,10) /* ? */ | |
| 4077 | MDRV_CPU_VBLANK_INT_HACK(metro_interrupt,10) /* ? */ | |
| 4078 | 4078 | |
| 4079 | 4079 | MDRV_CPU_ADD(UPD7810, 12000000) |
| 4080 | 4080 | /* audio CPU */ |
| r1877 | r1878 | |
| 4116 | 4116 | /* basic machine hardware */ |
| 4117 | 4117 | MDRV_CPU_ADD(M68000, 12000000) |
| 4118 | 4118 | MDRV_CPU_PROGRAM_MAP(lastforg_readmem,lastforg_writemem) |
| 4119 | MDRV_CPU_VBLANK_INT(karatour_interrupt,10) /* ? */ | |
| 4119 | MDRV_CPU_VBLANK_INT_HACK(karatour_interrupt,10) /* ? */ | |
| 4120 | 4120 | |
| 4121 | 4121 | MDRV_CPU_ADD(UPD7810, 12000000) |
| 4122 | 4122 | /* audio CPU */ |
| r1877 | r1878 | |
| 4158 | 4158 | /* basic machine hardware */ |
| 4159 | 4159 | MDRV_CPU_ADD(M68000, 16000000) |
| 4160 | 4160 | MDRV_CPU_PROGRAM_MAP(dokyusei_readmem,dokyusei_writemem) |
| 4161 | MDRV_CPU_VBLANK_INT(dokyusei_interrupt,2) /* ? */ | |
| 4161 | MDRV_CPU_VBLANK_INT_HACK(dokyusei_interrupt,2) /* ? */ | |
| 4162 | 4162 | |
| 4163 | 4163 | MDRV_MACHINE_RESET(metro) |
| 4164 | 4164 | |
| r1877 | r1878 | |
| 4208 | 4208 | /* basic machine hardware */ |
| 4209 | 4209 | MDRV_CPU_ADD(M68000, 16000000) |
| 4210 | 4210 | MDRV_CPU_PROGRAM_MAP(dokyusp_readmem,dokyusp_writemem) |
| 4211 | MDRV_CPU_VBLANK_INT(gakusai_interrupt | |
| 4211 | MDRV_CPU_VBLANK_INT("main", gakusai_interrupt | |
| 4212 | 4212 | |
| 4213 | 4213 | MDRV_MACHINE_RESET(metro) |
| 4214 | 4214 | MDRV_NVRAM_HANDLER(dokyusp) |
| r1877 | r1878 | |
| 4246 | 4246 | /* basic machine hardware */ |
| 4247 | 4247 | MDRV_CPU_ADD(M68000, 16000000) |
| 4248 | 4248 | MDRV_CPU_PROGRAM_MAP(gakusai_readmem,gakusai_writemem) |
| 4249 | MDRV_CPU_VBLANK_INT(gakusai_interrupt | |
| 4249 | MDRV_CPU_VBLANK_INT("main", gakusai_interrupt | |
| 4250 | 4250 | |
| 4251 | 4251 | MDRV_MACHINE_RESET(metro) |
| 4252 | 4252 | MDRV_NVRAM_HANDLER(93C46) |
| r1877 | r1878 | |
| 4284 | 4284 | /* basic machine hardware */ |
| 4285 | 4285 | MDRV_CPU_ADD(M68000, 16000000) |
| 4286 | 4286 | MDRV_CPU_PROGRAM_MAP(gakusai2_readmem,gakusai2_writemem) |
| 4287 | MDRV_CPU_VBLANK_INT(gakusai_interrupt | |
| 4287 | MDRV_CPU_VBLANK_INT("main", gakusai_interrupt | |
| 4288 | 4288 | |
| 4289 | 4289 | MDRV_MACHINE_RESET(metro) |
| 4290 | 4290 | MDRV_NVRAM_HANDLER(93C46) |
| r1877 | r1878 | |
| 4322 | 4322 | /* basic machine hardware */ |
| 4323 | 4323 | MDRV_CPU_ADD(M68000, 12000000) |
| 4324 | 4324 | MDRV_CPU_PROGRAM_MAP(pangpoms_readmem,pangpoms_writemem) |
| 4325 | MDRV_CPU_VBLANK_INT(metro_interrupt,10) /* ? */ | |
| 4325 | MDRV_CPU_VBLANK_INT_HACK(metro_interrupt,10) /* ? */ | |
| 4326 | 4326 | |
| 4327 | 4327 | MDRV_CPU_ADD(UPD7810, 12000000) |
| 4328 | 4328 | /* audio CPU */ |
| r1877 | r1878 | |
| 4365 | 4365 | /* basic machine hardware */ |
| 4366 | 4366 | MDRV_CPU_ADD(M68000, 12000000) |
| 4367 | 4367 | MDRV_CPU_PROGRAM_MAP(poitto_readmem,poitto_writemem) |
| 4368 | MDRV_CPU_VBLANK_INT(metro_interrupt,10) /* ? */ | |
| 4368 | MDRV_CPU_VBLANK_INT_HACK(metro_interrupt,10) /* ? */ | |
| 4369 | 4369 | |
| 4370 | 4370 | MDRV_CPU_ADD(UPD7810, 12000000) |
| 4371 | 4371 | /* audio CPU */ |
| r1877 | r1878 | |
| 4408 | 4408 | /* basic machine hardware */ |
| 4409 | 4409 | MDRV_CPU_ADD(M68000, 12000000) |
| 4410 | 4410 | MDRV_CPU_PROGRAM_MAP(pururun_readmem,pururun_writemem) |
| 4411 | MDRV_CPU_VBLANK_INT(metro_interrupt,10) /* ? */ | |
| 4411 | MDRV_CPU_VBLANK_INT_HACK(metro_interrupt,10) /* ? */ | |
| 4412 | 4412 | |
| 4413 | 4413 | MDRV_CPU_ADD(UPD7810, 12000000) |
| 4414 | 4414 | /* audio CPU */ |
| r1877 | r1878 | |
| 4452 | 4452 | /* basic machine hardware */ |
| 4453 | 4453 | MDRV_CPU_ADD(M68000, 12000000) |
| 4454 | 4454 | MDRV_CPU_PROGRAM_MAP(skyalert_readmem,skyalert_writemem) |
| 4455 | MDRV_CPU_VBLANK_INT(metro_interrupt,10) /* ? */ | |
| 4455 | MDRV_CPU_VBLANK_INT_HACK(metro_interrupt,10) /* ? */ | |
| 4456 | 4456 | |
| 4457 | 4457 | MDRV_CPU_ADD(UPD7810, 12000000) |
| 4458 | 4458 | /* audio CPU */ |
| r1877 | r1878 | |
| 4495 | 4495 | /* basic machine hardware */ |
| 4496 | 4496 | MDRV_CPU_ADD(M68000, 12000000) |
| 4497 | 4497 | MDRV_CPU_PROGRAM_MAP(toride2g_readmem,toride2g_writemem) |
| 4498 | MDRV_CPU_VBLANK_INT(metro_interrupt,10) /* ? */ | |
| 4498 | MDRV_CPU_VBLANK_INT_HACK(metro_interrupt,10) /* ? */ | |
| 4499 | 4499 | |
| 4500 | 4500 | MDRV_CPU_ADD(UPD7810, 12000000) |
| 4501 | 4501 | /* audio CPU */ |
| r1877 | r1878 | |
| 4538 | 4538 | /* basic machine hardware */ |
| 4539 | 4539 | MDRV_CPU_ADD(M68000, 12000000) /* ??? */ |
| 4540 | 4540 | MDRV_CPU_PROGRAM_MAP(mouja_readmem,mouja_writemem) |
| 4541 | MDRV_CPU_VBLANK_INT(mouja_interrupt | |
| 4541 | MDRV_CPU_VBLANK_INT("main", mouja_interrupt | |
| 4542 | 4542 | |
| 4543 | 4543 | MDRV_MACHINE_RESET(metro) |
| 4544 | 4544 | |
| r1877 | r1878 | |
| 4574 | 4574 | /* basic machine hardware */ |
| 4575 | 4575 | MDRV_CPU_ADD(M68000, 16000000) |
| 4576 | 4576 | MDRV_CPU_PROGRAM_MAP(blzntrnd_readmem,blzntrnd_writemem) |
| 4577 | MDRV_CPU_VBLANK_INT(karatour_interrupt,10) /* ? */ | |
| 4577 | MDRV_CPU_VBLANK_INT_HACK(karatour_interrupt,10) /* ? */ | |
| 4578 | 4578 | |
| 4579 | 4579 | MDRV_CPU_ADD(Z80, 8000000) |
| 4580 | 4580 | /* audio CPU */ |
| r1877 | r1878 | |
| 4614 | 4614 | /* basic machine hardware */ |
| 4615 | 4615 | MDRV_CPU_ADD(M68000, 16000000) |
| 4616 | 4616 | MDRV_CPU_PROGRAM_MAP(blzntrnd_readmem,blzntrnd_writemem) |
| 4617 | MDRV_CPU_VBLANK_INT(karatour_interrupt,10) /* ? */ | |
| 4617 | MDRV_CPU_VBLANK_INT_HACK(karatour_interrupt,10) /* ? */ | |
| 4618 | 4618 | |
| 4619 | 4619 | MDRV_CPU_ADD(Z80, 8000000) |
| 4620 | 4620 | /* audio CPU */ |
| r1877 | r1878 | |
| 4686 | 4686 | |
| 4687 | 4687 | MDRV_CPU_PROGRAM_MAP(puzzlet_map,0) |
| 4688 | 4688 | MDRV_CPU_IO_MAP(puzzlet_io_map,0) |
| 4689 | MDRV_CPU_VBLANK_INT(puzzlet_interrupt, 5) | |
| 4689 | MDRV_CPU_VBLANK_INT_HACK(puzzlet_interrupt, 5) | |
| 4690 | 4690 | |
| 4691 | 4691 | MDRV_MACHINE_RESET(metro) |
| 4692 | 4692 | |
| r1877 | r1878 | |
| 4767 | 4767 | porta = 0x00; |
| 4768 | 4768 | portb = 0x00; |
| 4769 | 4769 | busy_sndcpu = 0; |
| 4770 | metro_sound_rombank_w(0, 0x00); | |
| 4770 | metro_sound_rombank_w(machine, 0, 0x00); | |
| 4771 | 4771 | } |
| 4772 | 4772 | |
| 4773 | 4773 | static DRIVER_INIT( karatour ) |
| r1877 | r1878 | |
| 4790 | 4790 | porta = 0x00; |
| 4791 | 4791 | portb = 0x00; |
| 4792 | 4792 | busy_sndcpu = 0; |
| 4793 | daitorid_sound_rombank_w(0, 0x00); | |
| 4793 | daitorid_sound_rombank_w(machine, 0, 0x00); | |
| 4794 | 4794 | } |
| 4795 | 4795 | |
| 4796 | 4796 |
| r1877 | r1878 | |
|---|---|---|
| 596 | 596 | MDRV_CPU_ADD(Z80, 8000000) /* 8MHz? 6 seems too slow? */ |
| 597 | 597 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 598 | 598 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 599 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 599 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 600 | 600 | |
| 601 | 601 | MDRV_CPU_ADD(Z80, 4000000) /* 8 MHz? */ |
| 602 | 602 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 269 | 269 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz */ |
| 270 | 270 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 271 | 271 | MDRV_CPU_IO_MAP(port_map,0) |
| 272 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 272 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 273 | 273 | |
| 274 | 274 | /* video hardware */ |
| 275 | 275 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 134 | 134 | static MACHINE_DRIVER_START( genesis_base ) |
| 135 | 135 | /*basic machine hardware */ |
| 136 | 136 | MDRV_CPU_ADD_TAG("main", M68000, MASTER_CLOCK / 7) |
| 137 | MDRV_CPU_VBLANK_INT(genesis_vblank_interrupt | |
| 137 | MDRV_CPU_VBLANK_INT("main", genesis_vblank_interrupt | |
| 138 | 138 | |
| 139 | 139 | MDRV_CPU_ADD_TAG("sound", Z80, MASTER_CLOCK / 15) |
| 140 | 140 | MDRV_CPU_PROGRAM_MAP(genesis_z80_readmem, genesis_z80_writemem) |
| 141 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 141 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 142 | 142 | |
| 143 | 143 | MDRV_INTERLEAVE(100) |
| 144 | 144 | |
| r1877 | r1878 | |
| 192 | 192 | ROM_LOAD( "pic16c57", 0x00, 0x01, NO_DUMP ) // protected |
| 193 | 193 | ROM_END |
| 194 | 194 | |
| 195 | #ifdef UNUSED_DEFINITION | |
| 195 | 196 | ROM_START( hshavoc2 ) /* Genesis Version, for reference */ |
| 196 | 197 | ROM_REGION( 0x200000, REGION_CPU1, 0 ) |
| 197 | 198 | ROM_LOAD( "hsh.rom", 0x000000, 0x100000, CRC(17be551c) SHA1(0dc1969098716ba332978b89356f62961417682b) ) |
| 198 | 199 | ROM_END |
| 200 | #endif | |
| 199 | 201 | |
| 200 | 202 | static READ16_HANDLER( vdp_fake_r ) |
| 201 | 203 | { |
| r1877 | r1878 | |
|---|---|---|
| 93 | 93 | |
| 94 | 94 | /* CS3 */ |
| 95 | 95 | case 1: |
| 96 | SN76496_0_w(0, sn_latch); | |
| 96 | SN76496_0_w(machine, 0, sn_latch); | |
| 97 | 97 | break; |
| 98 | 98 | |
| 99 | 99 | /* CS4 */ |
| 100 | 100 | case 2: |
| 101 | SN76496_1_w(0, sn_latch); | |
| 101 | SN76496_1_w(machine, 0, sn_latch); | |
| 102 | 102 | break; |
| 103 | 103 | |
| 104 | 104 | /* CS5 */ |
| r1877 | r1878 | |
| 303 | 303 | /* basic machine hardware */ |
| 304 | 304 | MDRV_CPU_ADD(M6809, 2048000) /* 2 MHz */ |
| 305 | 305 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 306 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 306 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 307 | 307 | MDRV_WATCHDOG_VBLANK_INIT(8) |
| 308 | 308 | |
| 309 | 309 | /* audio CPU */ /* Z80 Clock is derived from a 14.31818 MHz crystal */ |
| r1877 | r1878 | |
|---|---|---|
| 131 | 131 | MDRV_CPU_ADD(Z80, 4000000) |
| 132 | 132 | MDRV_CPU_PROGRAM_MAP(laserbas_memory,0) |
| 133 | 133 | MDRV_CPU_IO_MAP(laserbas_io,0) |
| 134 | MDRV_CPU_VBLANK_INT(laserbas_interrupt,2) | |
| 134 | MDRV_CPU_VBLANK_INT_HACK(laserbas_interrupt,2) | |
| 135 | 135 | |
| 136 | 136 | |
| 137 | 137 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 247 | 247 | // basic machine hardware |
| 248 | 248 | MDRV_CPU_ADD(M6809, 1250000) // ??? MC68A09E |
| 249 | 249 | MDRV_CPU_PROGRAM_MAP(mikie_map, 0) |
| 250 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 250 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 251 | 251 | |
| 252 | 252 | MDRV_CPU_ADD(Z80, CLK) // 3.58 MHz |
| 253 | 253 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 219 | 219 | |
| 220 | 220 | /* bit 3 is the watchdog */ |
| 221 | 221 | if ((olddata ^ control_data) & 0x0008) |
| 222 | watchdog_reset_w(0, 0); | |
| 222 | watchdog_reset_w(machine, 0, 0); | |
| 223 | 223 | |
| 224 | 224 | /* bit 1 is the DCS sound reset */ |
| 225 | 225 | dcs_reset_w((~control_data >> 1) & 1); |
| r1877 | r1878 | |
| 240 | 240 | |
| 241 | 241 | /* bit 9 is the watchdog */ |
| 242 | 242 | if ((olddata ^ control_data) & 0x0200) |
| 243 | watchdog_reset_w(0, 0); | |
| 243 | watchdog_reset_w(machine, 0, 0); | |
| 244 | 244 | |
| 245 | 245 | /* bit 8 is the LED */ |
| 246 | 246 | |
| r1877 | r1878 | |
| 386 | 386 | static READ32_HANDLER( offroadc_serial_status_r ) |
| 387 | 387 | { |
| 388 | 388 | int status = midway_serial_pic2_status_r(); |
| 389 | return (port1_r(offset, mem_mask) & 0x7fff7fff) | (status << 31) | (status << 15); | |
| 389 | return (port1_r(machine, offset, mem_mask) & 0x7fff7fff) | (status << 31) | (status << 15); | |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | |
| r1877 | r1878 | |
| 447 | 447 | /* bit 0x10 resets watchdog */ |
| 448 | 448 | if ((olddata ^ midvplus_misc[offset]) & 0x0010) |
| 449 | 449 | { |
| 450 | watchdog_reset_w(0, 0); | |
| 450 | watchdog_reset_w(machine, 0, 0); | |
| 451 | 451 | logit = 0; |
| 452 | 452 | } |
| 453 | 453 | break; |
| r1877 | r1878 | |
|---|---|---|
| 149 | 149 | MDRV_CPU_ADD(Z80, 3579545) |
| 150 | 150 | MDRV_CPU_PROGRAM_MAP(kingpin_program_map,0) |
| 151 | 151 | MDRV_CPU_IO_MAP(kingpin_readport,kingpin_writeport) |
| 152 | MDRV_CPU_VBLANK_INT(kingpin_video_interrupt | |
| 152 | MDRV_CPU_VBLANK_INT("main", kingpin_video_interrupt | |
| 153 | 153 | |
| 154 | 154 | /* SOUND CPU */ |
| 155 | 155 | MDRV_CPU_ADD(Z80, 3579545) |
| r1877 | r1878 | |
|---|---|---|
| 295 | 295 | /* basic machine hardware */ |
| 296 | 296 | MDRV_CPU_ADD(M68000, 12288000) |
| 297 | 297 | MDRV_CPU_PROGRAM_MAP(namcond1_map,0) |
| 298 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 298 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 299 | 299 | MDRV_CPU_PERIODIC_INT(ygv608_timed_interrupt, 1000) |
| 300 | 300 | |
| 301 | 301 | MDRV_CPU_ADD(H83002, 16384000 ) |
| 302 | 302 | MDRV_CPU_PROGRAM_MAP( nd1h8rwmap, 0 ) |
| 303 | 303 | MDRV_CPU_IO_MAP( nd1h8iomap, 0 ) |
| 304 | MDRV_CPU_VBLANK_INT( mcu_interrupt | |
| 304 | MDRV_CPU_VBLANK_INT("main", mcu_interrupt | |
| 305 | 305 | |
| 306 | 306 | MDRV_INTERLEAVE(100) |
| 307 | 307 |
| r1877 | r1878 | |
|---|---|---|
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | 26 | #include "driver.h" |
| 27 | #include "deprecat.h" | |
| 27 | 28 | #include "video/mc6845.h" |
| 28 | 29 | #include "sound/ay8910.h" |
| 29 | 30 | |
| 30 | 31 | /* video */ |
| 31 | 32 | WRITE8_HANDLER( usgames_videoram_w ); |
| 32 | 33 | WRITE8_HANDLER( usgames_charram_w ); |
| 33 | WRITE8_HANDLER( usgames_mc6845_address_w ); | |
| 34 | WRITE8_HANDLER( usgames_mc6845_register_w ); | |
| 35 | 34 | VIDEO_START(usgames); |
| 36 | 35 | PALETTE_INIT(usgames); |
| 37 | 36 | VIDEO_UPDATE(usgames); |
| r1877 | r1878 | |
| 103 | 102 | AM_RANGE(0x2020, 0x2020) AM_WRITE(lamps1_w) |
| 104 | 103 | AM_RANGE(0x2030, 0x2030) AM_WRITE(lamps2_w) |
| 105 | 104 | |
| 106 | AM_RANGE(0x2040, 0x2040) AM_WRITE(usgames_mc6845_address_w) | |
| 107 | AM_RANGE(0x2041, 0x2041) AM_WRITE(usgames_mc6845_register_w) | |
| 105 | AM_RANGE(0x2040, 0x2040) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 106 | AM_RANGE(0x2041, 0x2041) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 108 | 107 | |
| 109 | 108 | AM_RANGE(0x2400, 0x2400) AM_WRITE(AY8910_control_port_0_w) |
| 110 | 109 | AM_RANGE(0x2401, 0x2401) AM_WRITE(AY8910_write_port_0_w) |
| r1877 | r1878 | |
| 123 | 122 | AM_RANGE(0x2420, 0x2420) AM_WRITE(lamps1_w) |
| 124 | 123 | AM_RANGE(0x2430, 0x2430) AM_WRITE(lamps2_w) |
| 125 | 124 | |
| 126 | AM_RANGE(0x2440, 0x2440) AM_WRITE(usgames_mc6845_address_w) | |
| 127 | AM_RANGE(0x2441, 0x2441) AM_WRITE(usgames_mc6845_register_w) | |
| 125 | AM_RANGE(0x2440, 0x2440) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 126 | AM_RANGE(0x2441, 0x2441) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 128 | 127 | |
| 129 | 128 | AM_RANGE(0x2000, 0x2000) AM_WRITE(AY8910_control_port_0_w) |
| 130 | 129 | AM_RANGE(0x2001, 0x2001) AM_WRITE(AY8910_write_port_0_w) |
| r1877 | r1878 | |
| 292 | 291 | /* basic machine hardware */ |
| 293 | 292 | MDRV_CPU_ADD_TAG("main", M6809, 2000000) /* ?? */ |
| 294 | 293 | MDRV_CPU_PROGRAM_MAP(usgames_readmem,usgames_writemem) |
| 295 | MDRV_CPU_VBLANK_INT(irq0_line_hold,5) /* ?? */ | |
| 294 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,5) /* ?? */ | |
| 296 | 295 | |
| 297 | 296 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 298 | 297 |
| r1877 | r1878 | |
|---|---|---|
| 567 | 567 | /* basic machine hardware */ |
| 568 | 568 | MDRV_CPU_ADD(M68000, 12000000 ) /* 12 MHz */ |
| 569 | 569 | MDRV_CPU_PROGRAM_MAP(opwolf_readmem,opwolf_writemem) |
| 570 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 570 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 571 | 571 | |
| 572 | 572 | MDRV_CPU_ADD(Z80, 4000000 ) /* 4 MHz */ |
| 573 | 573 | MDRV_CPU_PROGRAM_MAP(z80_readmem,z80_writemem) |
| r1877 | r1878 | |
| 616 | 616 | /* basic machine hardware */ |
| 617 | 617 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 618 | 618 | MDRV_CPU_PROGRAM_MAP(opwolfb_readmem,opwolfb_writemem) |
| 619 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 619 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 620 | 620 | |
| 621 | 621 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz ??? */ |
| 622 | 622 | MDRV_CPU_PROGRAM_MAP(z80_readmem,z80_writemem) |
| 623 | 623 | |
| 624 | 624 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz ??? */ |
| 625 | 625 | MDRV_CPU_PROGRAM_MAP(sub_z80_readmem,sub_z80_writemem) |
| 626 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 626 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 627 | 627 | |
| 628 | 628 | MDRV_INTERLEAVE(10) /* 10 CPU slices per frame - enough for the sound CPU to read all commands */ |
| 629 | 629 |
| r1877 | r1878 | |
|---|---|---|
| 39 | 39 | return paletteram[offset]; |
| 40 | 40 | } |
| 41 | 41 | else if (videobank & 0x01) |
| 42 | return K053245_r(offset); | |
| 42 | return K053245_r(machine,offset); | |
| 43 | 43 | else |
| 44 | 44 | return ram[offset]; |
| 45 | 45 | } |
| r1877 | r1878 | |
| 49 | 49 | if (videobank & 0x02) |
| 50 | 50 | { |
| 51 | 51 | if (videobank & 0x04) |
| 52 | paletteram_xBBBBBGGGGGRRRRR_be_w(offset + 0x0800,data); | |
| 52 | paletteram_xBBBBBGGGGGRRRRR_be_w(machine,offset + 0x0800,data); | |
| 53 | 53 | else |
| 54 | paletteram_xBBBBBGGGGGRRRRR_be_w(offset,data); | |
| 54 | paletteram_xBBBBBGGGGGRRRRR_be_w(machine,offset,data); | |
| 55 | 55 | } |
| 56 | 56 | else if (videobank & 0x01) |
| 57 | K053245_w(offset,data); | |
| 57 | K053245_w(machine,offset,data); | |
| 58 | 58 | else |
| 59 | 59 | ram[offset] = data; |
| 60 | 60 | } |
| r1877 | r1878 | |
| 239 | 239 | /* basic machine hardware */ |
| 240 | 240 | MDRV_CPU_ADD(KONAMI, 3000000) /* 053248 */ |
| 241 | 241 | MDRV_CPU_PROGRAM_MAP(surpratk_readmem,surpratk_writemem) |
| 242 | MDRV_CPU_VBLANK_INT(surpratk_interrupt | |
| 242 | MDRV_CPU_VBLANK_INT("main", surpratk_interrupt | |
| 243 | 243 | |
| 244 | 244 | MDRV_MACHINE_RESET(surpratk) |
| 245 | 245 |
| r1877 | r1878 | |
|---|---|---|
| 383 | 383 | static mc6845_t *mc6845; |
| 384 | 384 | static tilemap *bg_tilemap; |
| 385 | 385 | |
| 386 | static WRITE8_HANDLER( pmpoker_mc6845_address_w ) | |
| 387 | { | |
| 388 | mc6845_address_w(mc6845, data); | |
| 389 | } | |
| 390 | ||
| 391 | static READ8_HANDLER( pmpoker_mc6845_register_r ) | |
| 392 | { | |
| 393 | return mc6845_register_r(mc6845); | |
| 394 | } | |
| 395 | ||
| 396 | static WRITE8_HANDLER( pmpoker_mc6845_register_w ) | |
| 397 | { | |
| 398 | mc6845_register_w(mc6845, data); | |
| 399 | } | |
| 400 | ||
| 401 | 386 | static WRITE8_HANDLER( pmpoker_videoram_w ) |
| 402 | 387 | { |
| 403 | 388 | videoram[offset] = data; |
| r1877 | r1878 | |
| 484 | 469 | |
| 485 | 470 | static ADDRESS_MAP_START( pmpoker_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 486 | 471 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) /* battery backed RAM */ |
| 487 | AM_RANGE(0x0800, 0x0800) AM_WRITE(pmpoker_mc6845_address_w) | |
| 488 | AM_RANGE(0x0801, 0x0801) AM_READWRITE(pmpoker_mc6845_register_r, pmpoker_mc6845_register_w) | |
| 472 | AM_RANGE(0x0800, 0x0800) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 473 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 489 | 474 | AM_RANGE(0x0844, 0x0847) AM_READWRITE(pia_0_r, pia_0_w) |
| 490 | 475 | AM_RANGE(0x0848, 0x084b) AM_READWRITE(pia_1_r, pia_1_w) |
| 491 | 476 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(pmpoker_videoram_w) AM_BASE(&videoram) |
| r1877 | r1878 | |
| 496 | 481 | |
| 497 | 482 | static ADDRESS_MAP_START( jokerpkr_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 498 | 483 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) /* battery backed RAM */ |
| 499 | AM_RANGE(0x0800, 0x0800) AM_WRITE(pmpoker_mc6845_address_w) | |
| 500 | AM_RANGE(0x0801, 0x0801) AM_READWRITE(pmpoker_mc6845_register_r, pmpoker_mc6845_register_w) | |
| 484 | AM_RANGE(0x0800, 0x0800) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 485 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 501 | 486 | AM_RANGE(0x0844, 0x0847) AM_READWRITE(pia_0_r, pia_0_w) |
| 502 | 487 | AM_RANGE(0x0848, 0x084b) AM_READWRITE(pia_1_r, pia_1_w) |
| 503 | 488 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(pmpoker_videoram_w) AM_BASE(&videoram) |
| r1877 | r1878 | |
| 902 | 887 | { |
| 903 | 888 | switch( mux_data&0xf0 ) /* bits 4-7 */ |
| 904 | 889 | { |
| 905 | case 0x10: return input_port_0_r(0); | |
| 906 | case 0x20: return input_port_1_r(0); | |
| 907 | case 0x40: return input_port_2_r(0); | |
| 908 | case 0x80: return input_port_3_r(0); | |
| 890 | case 0x10: return input_port_0_r(machine,0); | |
| 891 | case 0x20: return input_port_1_r(machine,0); | |
| 892 | case 0x40: return input_port_2_r(machine,0); | |
| 893 | case 0x80: return input_port_3_r(machine,0); | |
| 909 | 894 | } |
| 910 | 895 | return 0xff; |
| 911 | 896 | } |
| r1877 | r1878 | |
| 1003 | 988 | /* basic machine hardware */ |
| 1004 | 989 | MDRV_CPU_ADD_TAG("main", M6502, MASTER_CLOCK/16) /* guess */ |
| 1005 | 990 | MDRV_CPU_PROGRAM_MAP(pmpoker_map, 0) |
| 1006 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 991 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 1007 | 992 | |
| 1008 | 993 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 1009 | 994 |
| r1877 | r1878 | |
|---|---|---|
| 53 | 53 | { |
| 54 | 54 | if (ACCESSING_LSB) |
| 55 | 55 | { |
| 56 | soundlatch_w( 0, data & 0xff ); | |
| 56 | soundlatch_w( machine, 0, data & 0xff ); | |
| 57 | 57 | } |
| 58 | 58 | if (data & ~0xff) logerror("CPU#0 PC %06X - Sound latch unknown bits: %04X\n", activecpu_get_pc(), data); |
| 59 | 59 | } |
| r1877 | r1878 | |
| 848 | 848 | /* basic machine hardware */ |
| 849 | 849 | MDRV_CPU_ADD(M68000, 8000000) /* ? */ |
| 850 | 850 | MDRV_CPU_PROGRAM_MAP(bssoccer_readmem,bssoccer_writemem) |
| 851 | MDRV_CPU_VBLANK_INT(bssoccer_interrupt,2) | |
| 851 | MDRV_CPU_VBLANK_INT_HACK(bssoccer_interrupt,2) | |
| 852 | 852 | |
| 853 | 853 | MDRV_CPU_ADD(Z80, 3579545) /* Z80B */ |
| 854 | 854 | /* audio CPU */ |
| r1877 | r1878 | |
| 911 | 911 | /* basic machine hardware */ |
| 912 | 912 | MDRV_CPU_ADD(M68000, 8000000) |
| 913 | 913 | MDRV_CPU_PROGRAM_MAP(uballoon_readmem,uballoon_writemem) |
| 914 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 914 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 915 | 915 | |
| 916 | 916 | MDRV_CPU_ADD(Z80, 3579545) |
| 917 | 917 | /* audio CPU */ /* ? */ |
| r1877 | r1878 | |
| 962 | 962 | /* basic machine hardware */ |
| 963 | 963 | MDRV_CPU_ADD(M68000, 24000000/4) |
| 964 | 964 | MDRV_CPU_PROGRAM_MAP(sunaq_readmem,sunaq_writemem) |
| 965 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 965 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 966 | 966 | |
| 967 | 967 | MDRV_CPU_ADD(Z80, 14318000/4) |
| 968 | 968 | /* audio CPU */ |
| r1877 | r1878 | |
| 1035 | 1035 | /* basic machine hardware */ |
| 1036 | 1036 | MDRV_CPU_ADD(M68000, 24000000/4) |
| 1037 | 1037 | MDRV_CPU_PROGRAM_MAP(bestbest_map,0) |
| 1038 | MDRV_CPU_VBLANK_INT(bssoccer_interrupt,2) | |
| 1038 | MDRV_CPU_VBLANK_INT_HACK(bssoccer_interrupt,2) | |
| 1039 | 1039 | |
| 1040 | 1040 | MDRV_CPU_ADD(Z80, 24000000/4) |
| 1041 | 1041 | MDRV_CPU_PROGRAM_MAP(bestbest_sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 108 | 108 | static READ8_HANDLER( zaccaria_port0a_r ) |
| 109 | 109 | { |
| 110 | 110 | if (active_8910 == 0) |
| 111 | return AY8910_read_port_0_r(0); | |
| 111 | return AY8910_read_port_0_r(machine,0); | |
| 112 | 112 | else |
| 113 | return AY8910_read_port_1_r(0); | |
| 113 | return AY8910_read_port_1_r(machine,0); | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | static WRITE8_HANDLER( zaccaria_port0a_w ) |
| r1877 | r1878 | |
| 128 | 128 | { |
| 129 | 129 | /* bit 0 goes to the 8910 #0 BC1 pin */ |
| 130 | 130 | if (last & 0x01) |
| 131 | AY8910_control_port_0_w(0,port0a); | |
| 131 | AY8910_control_port_0_w(machine,0,port0a); | |
| 132 | 132 | else |
| 133 | AY8910_write_port_0_w(0,port0a); | |
| 133 | AY8910_write_port_0_w(machine,0,port0a); | |
| 134 | 134 | } |
| 135 | 135 | else if ((last & 0x02) == 0x00 && (data & 0x02) == 0x02) |
| 136 | 136 | { |
| r1877 | r1878 | |
| 143 | 143 | { |
| 144 | 144 | /* bit 2 goes to the 8910 #1 BC1 pin */ |
| 145 | 145 | if (last & 0x04) |
| 146 | AY8910_control_port_1_w(0,port0a); | |
| 146 | AY8910_control_port_1_w(machine,0,port0a); | |
| 147 | 147 | else |
| 148 | AY8910_write_port_1_w(0,port0a); | |
| 148 | AY8910_write_port_1_w(machine,0,port0a); | |
| 149 | 149 | } |
| 150 | 150 | else if ((last & 0x08) == 0x00 && (data & 0x08) == 0x08) |
| 151 | 151 | { |
| r1877 | r1878 | |
| 161 | 161 | { |
| 162 | 162 | static int toggle; |
| 163 | 163 | |
| 164 | pia_0_cb1_w(0,toggle & 1); | |
| 164 | pia_0_cb1_w(machine,0,toggle & 1); | |
| 165 | 165 | toggle ^= 1; |
| 166 | 166 | } |
| 167 | 167 | |
| r1877 | r1878 | |
| 171 | 171 | |
| 172 | 172 | static READ8_HANDLER( zaccaria_port1a_r ) |
| 173 | 173 | { |
| 174 | if (~port1b & 1) return tms5220_status_r(0); | |
| 174 | if (~port1b & 1) return tms5220_status_r(machine,0); | |
| 175 | 175 | else return port1a; |
| 176 | 176 | } |
| 177 | 177 | |
| r1877 | r1878 | |
| 187 | 187 | // bit 0 = /RS |
| 188 | 188 | |
| 189 | 189 | // bit 1 = /WS |
| 190 | if (~data & 2) tms5220_data_w(0,port1a); | |
| 190 | if (~data & 2) tms5220_data_w(machine,0,port1a); | |
| 191 | 191 | |
| 192 | 192 | // bit 3 = "ACS" (goes, inverted, to input port 6 bit 3) |
| 193 | 193 | acs = ~data & 0x08; |
| r1877 | r1878 | |
| 210 | 210 | |
| 211 | 211 | static void tms5220_irq_handler(int state) |
| 212 | 212 | { |
| 213 | pia_1_cb1_w(0,state ? 0 : 1); | |
| 213 | pia_1_cb1_w(Machine,0,state ? 0 : 1); | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | |
| r1877 | r1878 | |
| 257 | 257 | |
| 258 | 258 | static WRITE8_HANDLER( sound_command_w ) |
| 259 | 259 | { |
| 260 | soundlatch_w(0,data); | |
| 261 | cpunum_set_input_line(Machine, 2,0,(data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 260 | soundlatch_w(machine,0,data); | |
| 261 | cpunum_set_input_line(machine, 2,0,(data & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | static WRITE8_HANDLER( sound1_command_w ) |
| 265 | 265 | { |
| 266 | pia_0_ca1_w(0,data & 0x80); | |
| 267 | soundlatch2_w(0,data); | |
| 266 | pia_0_ca1_w(machine,0,data & 0x80); | |
| 267 | soundlatch2_w(machine,0,data); | |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | static WRITE8_HANDLER( mc1408_data_w ) |
| r1877 | r1878 | |
| 300 | 300 | switch (offset) |
| 301 | 301 | { |
| 302 | 302 | case 0: |
| 303 | return (input_port_6_r(0) & 0x07) | (acs & 0x08); /* bits 4 and 5 must be 0 in Jack Rabbit */ | |
| 303 | return (input_port_6_r(machine,0) & 0x07) | (acs & 0x08); /* bits 4 and 5 must be 0 in Jack Rabbit */ | |
| 304 | 304 | |
| 305 | 305 | case 2: |
| 306 | 306 | return 0x10; /* Jack Rabbit */ |
| r1877 | r1878 | |
| 324 | 324 | |
| 325 | 325 | static WRITE8_HANDLER( nmienable_w ) |
| 326 | 326 | { |
| 327 | interrupt_enable_w(0,data & 1); | |
| 327 | interrupt_enable_w(machine,0,data & 1); | |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | |
| r1877 | r1878 | |
| 662 | 662 | /* basic machine hardware */ |
| 663 | 663 | MDRV_CPU_ADD(Z80,XTAL_18_432MHz/6) /* verified on pcb */ |
| 664 | 664 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 665 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 665 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 666 | 666 | |
| 667 | 667 | MDRV_CPU_ADD(M6802,XTAL_3_579545MHz) /* verified on pcb */ |
| 668 | 668 | MDRV_CPU_PROGRAM_MAP(sound_readmem1,sound_writemem1) |
| r1877 | r1878 | |
|---|---|---|
| 212 | 212 | { |
| 213 | 213 | if (ACCESSING_MSB) |
| 214 | 214 | { |
| 215 | soundlatch_w(1,data >> 8); | |
| 216 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 215 | soundlatch_w(machine,1,data >> 8); | |
| 216 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 217 | 217 | } |
| 218 | 218 | else |
| 219 | 219 | { |
| r1877 | r1878 | |
| 221 | 221 | double brt = (data & 0xff) / 255.0; |
| 222 | 222 | |
| 223 | 223 | for (i = 0; i < 0x4000; i++) |
| 224 | palette_set_brightness( | |
| 224 | palette_set_brightness(machine,i,brt); | |
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
| r1877 | r1878 | |
| 553 | 553 | static MACHINE_DRIVER_START( shadfrce ) |
| 554 | 554 | MDRV_CPU_ADD(M68000, 28000000/2) /* ? Guess - CPU is rated for 16MHz */ |
| 555 | 555 | MDRV_CPU_PROGRAM_MAP(shadfrce_readmem,shadfrce_writemem) |
| 556 | MDRV_CPU_VBLANK_INT(shadfrce_interrupt,2) | |
| 556 | MDRV_CPU_VBLANK_INT_HACK(shadfrce_interrupt,2) | |
| 557 | 557 | |
| 558 | 558 | MDRV_CPU_ADD(Z80, 3579545) |
| 559 | 559 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 51 | 51 | ***************************************************************************/ |
| 52 | 52 | |
| 53 | 53 | #include "driver.h" |
| 54 | #include "deprecat.h" | |
| 54 | 55 | #include "sound/3812intf.h" |
| 55 | 56 | |
| 56 | 57 | |
| r1877 | r1878 | |
| 230 | 231 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz ??? */ |
| 231 | 232 | MDRV_CPU_PROGRAM_MAP(main_cpu_map,0) |
| 232 | 233 | MDRV_CPU_IO_MAP(main_cpu_io_map,0) |
| 233 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 234 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 234 | 235 | |
| 235 | 236 | MDRV_CPU_ADD(Z80, 2660000) /* 2.66 MHz ??? Maybe yes */ |
| 236 | 237 | MDRV_CPU_PROGRAM_MAP(sound_cpu_map,0) |
| 237 | 238 | MDRV_CPU_IO_MAP(sound_cpu_io_map,0) |
| 238 | MDRV_CPU_VBLANK_INT(irq0_line_hold,8) | |
| 239 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,8) | |
| 239 | 240 | |
| 240 | 241 | /* video hardware */ |
| 241 | 242 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 166 | 166 | case 0x02: return readinputport(2); |
| 167 | 167 | case 0x04: return readinputport(3); |
| 168 | 168 | case 0x08: return readinputport(4); |
| 169 | case 0x10: return 0xff; return readinputport(5); | |
| 170 | case 0x20: return 0xff; return readinputport(6); | |
| 169 | /* FIXME: Was this a quick hack? */ | |
| 170 | case 0x10: return 0xff; //return readinputport(5); | |
| 171 | case 0x20: return 0xff; //return readinputport(6); | |
| 171 | 172 | } |
| 172 | 173 | return 0xff; |
| 173 | 174 | } |
| r1877 | r1878 | |
| 197 | 198 | |
| 198 | 199 | /***************************************************************************************/ |
| 199 | 200 | |
| 200 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 201 | AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM) | |
| 202 | AM_RANGE(0x8000, 0x9fff) AM_READ(MRA8_BANK1) | |
| 203 | AM_RANGE(0xaf80, 0xafff) AM_READ(custom_ram_r) | |
| 204 | AM_RANGE(0xb000, 0xb0ff) AM_READ(MRA8_RAM) | |
| 205 | AM_RANGE(0xc000, 0xc3ff) AM_READ(MRA8_RAM) | |
| 206 | AM_RANGE(0xd000, 0xd3ff) AM_READ(MRA8_RAM) | |
| 207 | AM_RANGE(0xe000, 0xffff) AM_READ(MRA8_RAM) | |
| 208 | ADDRESS_MAP_END | |
| 209 | ||
| 210 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 211 | AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM) | |
| 212 | AM_RANGE(0x8000, 0x9fff) AM_WRITE(MWA8_ROM) | |
| 201 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 202 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 203 | AM_RANGE(0x8000, 0x9fff) AM_READWRITE(MRA8_BANK1, MWA8_ROM) | |
| 213 | 204 | AM_RANGE(0xa7fc, 0xa7fc) AM_WRITE(prot_lock_w) |
| 214 | 205 | AM_RANGE(0xa7ff, 0xa7ff) AM_WRITE(eeprom_w) |
| 215 | AM_RANGE(0xaf80, 0xafff) AM_WRITE(custom_ram_w) AM_BASE(&cus_ram) //260d - 2626 | |
| 216 | AM_RANGE(0xb000, 0xb0ff) AM_WRITE(MWA8_RAM) AM_WRITE(paletteram_RRRGGGBB_w) AM_BASE(&paletteram)/*Wrong format*/ | |
| 217 | AM_RANGE(0xc000, 0xc3ff) AM_WRITE(yumefuda_vram_w) AM_BASE(&videoram) | |
| 218 | AM_RANGE(0xd000, 0xd3ff) AM_WRITE(yumefuda_cram_w) AM_BASE(&colorram) | |
| 219 | AM_RANGE(0xe000, 0xffff) AM_WRITE(MWA8_RAM) | |
| 206 | AM_RANGE(0xaf80, 0xafff) AM_READWRITE(custom_ram_r, custom_ram_w) AM_BASE(&cus_ram) /*260d - 2626*/ | |
| 207 | AM_RANGE(0xb000, 0xb0ff) AM_READWRITE(MRA8_RAM, paletteram_RRRGGGBB_w) AM_BASE(&paletteram) /*Wrong format*/ | |
| 208 | AM_RANGE(0xc000, 0xc3ff) AM_READWRITE(MRA8_RAM, yumefuda_vram_w) AM_BASE(&videoram) | |
| 209 | AM_RANGE(0xd000, 0xd3ff) AM_READWRITE(MRA8_RAM, yumefuda_cram_w) AM_BASE(&colorram) | |
| 210 | AM_RANGE(0xe000, 0xffff) AM_RAM | |
| 220 | 211 | ADDRESS_MAP_END |
| 221 | 212 | |
| 222 | static ADDRESS_MAP_START( | |
| 213 | static ADDRESS_MAP_START( | |
| 223 | 214 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 224 | AM_RANGE(0x40, 0x40) AM_READ(AY8910_read_port_0_r) | |
| 215 | AM_RANGE(0x40, 0x40) AM_READWRITE(AY8910_read_port_0_r, AY8910_control_port_0_w) | |
| 216 | AM_RANGE(0x41, 0x41) AM_WRITE(AY8910_write_port_0_w) | |
| 217 | AM_RANGE(0x80, 0x80) AM_WRITE(mux_w) | |
| 225 | 218 | AM_RANGE(0x81, 0x81) AM_READ(eeprom_r) |
| 226 | 219 | AM_RANGE(0x82, 0x82) AM_READ(mux_r) |
| 220 | AM_RANGE(0xc0, 0xc0) AM_WRITE(port_c0_w) /*watchdog write?*/ | |
| 227 | 221 | ADDRESS_MAP_END |
| 228 | 222 | |
| 229 | static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 ) | |
| 230 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) | |
| 231 | AM_RANGE(0x40, 0x40) AM_WRITE(AY8910_control_port_0_w) | |
| 232 | AM_RANGE(0x41, 0x41) AM_WRITE(AY8910_write_port_0_w) | |
| 233 | AM_RANGE(0x80, 0x80) AM_WRITE(mux_w) | |
| 234 | AM_RANGE(0xc0, 0xc0) AM_WRITE(port_c0_w) //watchdog write? | |
| 235 | ADDRESS_MAP_END | |
| 236 | ||
| 237 | 223 | static MACHINE_DRIVER_START( yumefuda ) |
| 238 | 224 | |
| 239 | 225 | /* basic machine hardware */ |
| 240 | 226 | MDRV_CPU_ADD(Z80 , 6000000) /*???*/ |
| 241 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 242 | MDRV_CPU_IO_MAP(readport,writeport) | |
| 243 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) | |
| 227 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 228 | MDRV_CPU_IO_MAP(port_map,0) | |
| 229 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 244 | 230 | |
| 245 | 231 | MDRV_NVRAM_HANDLER(93C46) |
| 246 | 232 |
| r1877 | r1878 | |
|---|---|---|
| 108 | 108 | switch (keyboard_select) |
| 109 | 109 | { |
| 110 | 110 | |
| 111 | default: | |
| 112 | printf("keyboard1_r, select %02x\n",keyboard_select); | |
| 113 | return 0xff; | |
| 114 | ||
| 115 | 111 | case 0xef: |
| 116 | 112 | return readinputportbytag("0"); |
| 117 | 113 | |
| r1877 | r1878 | |
| 126 | 122 | |
| 127 | 123 | case 0xfe: |
| 128 | 124 | return readinputportbytag("4"); |
| 125 | ||
| 126 | default: | |
| 127 | printf("keyboard1_r, select %02x\n",keyboard_select); | |
| 128 | /* fall through */ | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | return 0xff; |
| r1877 | r1878 | |
| 136 | 136 | { |
| 137 | 137 | switch (keyboard_select) |
| 138 | 138 | { |
| 139 | ||
| 140 | default: | |
| 141 | printf("keyboard2_r, select %02x\n",keyboard_select); | |
| 142 | return 0xff; | |
| 143 | ||
| 144 | 139 | case 0xef: |
| 145 | 140 | return readinputportbytag("5"); |
| 146 | 141 | |
| r1877 | r1878 | |
| 155 | 150 | |
| 156 | 151 | case 0xfe: |
| 157 | 152 | return readinputportbytag("9"); |
| 153 | ||
| 154 | default: | |
| 155 | printf("keyboard2_r, select %02x\n",keyboard_select); | |
| 156 | /* fall through */ | |
| 158 | 157 | } |
| 159 | 158 | |
| 160 | 159 | return 0xff; |
| r1877 | r1878 | |
| 591 | 590 | MDRV_CPU_ADD(Z80,JONGKYO_CLOCK/4) |
| 592 | 591 | MDRV_CPU_PROGRAM_MAP(jongkyo_memmap,0) |
| 593 | 592 | MDRV_CPU_IO_MAP(jongkyo_portmap,0) |
| 594 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 593 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 595 | 594 | |
| 596 | 595 | /* video hardware */ |
| 597 | 596 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 64 | 64 | { |
| 65 | 65 | switch(offset) |
| 66 | 66 | { |
| 67 | case 0: return input_port_0_r(0); | |
| 68 | case 2: return input_port_1_r(0); | |
| 67 | case 0: return input_port_0_r(machine,0); | |
| 68 | case 2: return input_port_1_r(machine,0); | |
| 69 | 69 | } |
| 70 | 70 | return 0xff; |
| 71 | 71 | } |
| r1877 | r1878 | |
|---|---|---|
| 302 | 302 | } |
| 303 | 303 | #endif |
| 304 | 304 | |
| 305 | static void draw_sprite( | |
| 305 | static void draw_sprite( | |
| 306 | 306 | { |
| 307 | 307 | UINT16* spritegfx = littlerb_region4; |
| 308 | 308 | int x,y; |
| r1877 | r1878 | |
| 362 | 362 | static MACHINE_DRIVER_START( littlerb ) |
| 363 | 363 | MDRV_CPU_ADD(M68000, 12000000) |
| 364 | 364 | MDRV_CPU_PROGRAM_MAP(littlerb_main, 0) |
| 365 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 365 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 366 | 366 | |
| 367 | 367 | |
| 368 | 368 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | |
| 150 | static void gcu_draw_object(int chip, | |
| 150 | static void gcu_draw_object(int chip, | |
| 151 | 151 | { |
| 152 | 152 | // 0x00: xxx----- -------- -------- -------- command type |
| 153 | 153 | // 0x00: -------- xxxxxxxx xxxxxxxx xxxxxxxx object data address in vram |
| r1877 | r1878 | |
| 300 | 300 | } |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | static void gcu_fill_rect( | |
| 303 | static void gcu_fill_rect( | |
| 304 | 304 | { |
| 305 | 305 | int i, j; |
| 306 | 306 | int x1, y1, x2, y2; |
| r1877 | r1878 | |
| 347 | 347 | } |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | static void gcu_draw_character(int chip, | |
| 350 | static void gcu_draw_character(int chip, | |
| 351 | 351 | { |
| 352 | 352 | // 0x00: xxx----- -------- -------- -------- command type |
| 353 | 353 | // 0x00: -------- xxxxxxxx xxxxxxxx xxxxxxxx character data address in vram |
| r1877 | r1878 | |
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | static void gcu_exec_display_list(int chip, | |
| 398 | static void gcu_exec_display_list(int chip, | |
| 399 | 399 | { |
| 400 | 400 | int counter = 0; |
| 401 | 401 | int end = 0; |
| r1877 | r1878 | |
| 1221 | 1221 | |
| 1222 | 1222 | if (!(mem_mask & 0xff000000)) |
| 1223 | 1223 | { |
| 1224 | r |= pc16552d_0_r((offset*4)+0) << 24; | |
| 1224 | r |= pc16552d_0_r(machine, (offset*4)+0) << 24; | |
| 1225 | 1225 | } |
| 1226 | 1226 | if (!(mem_mask & 0x00ff0000)) |
| 1227 | 1227 | { |
| 1228 | r |= pc16552d_0_r((offset*4)+1) << 16; | |
| 1228 | r |= pc16552d_0_r(machine, (offset*4)+1) << 16; | |
| 1229 | 1229 | } |
| 1230 | 1230 | if (!(mem_mask & 0x0000ff00)) |
| 1231 | 1231 | { |
| 1232 | r |= pc16552d_0_r((offset*4)+2) << 8; | |
| 1232 | r |= pc16552d_0_r(machine, (offset*4)+2) << 8; | |
| 1233 | 1233 | } |
| 1234 | 1234 | if (!(mem_mask & 0x000000ff)) |
| 1235 | 1235 | { |
| 1236 | r |= pc16552d_0_r((offset*4)+3) << 0; | |
| 1236 | r |= pc16552d_0_r(machine, (offset*4)+3) << 0; | |
| 1237 | 1237 | } |
| 1238 | 1238 | |
| 1239 | 1239 | return r; |
| r1877 | r1878 | |
| 1243 | 1243 | { |
| 1244 | 1244 | if (!(mem_mask & 0xff000000)) |
| 1245 | 1245 | { |
| 1246 | pc16552d_0_w((offset*4)+0, (data >> 24) & 0xff); | |
| 1246 | pc16552d_0_w(machine, (offset*4)+0, (data >> 24) & 0xff); | |
| 1247 | 1247 | } |
| 1248 | 1248 | if (!(mem_mask & 0x00ff0000)) |
| 1249 | 1249 | { |
| 1250 | pc16552d_0_w((offset*4)+1, (data >> 16) & 0xff); | |
| 1250 | pc16552d_0_w(machine, (offset*4)+1, (data >> 16) & 0xff); | |
| 1251 | 1251 | } |
| 1252 | 1252 | if (!(mem_mask & 0x0000ff00)) |
| 1253 | 1253 | { |
| 1254 | pc16552d_0_w((offset*4)+2, (data >> 8) & 0xff); | |
| 1254 | pc16552d_0_w(machine, (offset*4)+2, (data >> 8) & 0xff); | |
| 1255 | 1255 | } |
| 1256 | 1256 | if (!(mem_mask & 0x000000ff)) |
| 1257 | 1257 | { |
| 1258 | pc16552d_0_w((offset*4)+3, (data >> 0) & 0xff); | |
| 1258 | pc16552d_0_w(machine, (offset*4)+3, (data >> 0) & 0xff); | |
| 1259 | 1259 | } |
| 1260 | 1260 | } |
| 1261 | 1261 | |
| r1877 | r1878 | |
| 1324 | 1324 | |
| 1325 | 1325 | if (!(mem_mask & 0xff000000)) /* External RAM read */ |
| 1326 | 1326 | { |
| 1327 | r |= YMZ280B_data_0_r(offset) << 24; | |
| 1327 | r |= YMZ280B_data_0_r(machine, offset) << 24; | |
| 1328 | 1328 | } |
| 1329 | 1329 | if (!(mem_mask & 0x00ff0000)) |
| 1330 | 1330 | { |
| 1331 | r |= YMZ280B_status_0_r(offset) << 16; | |
| 1331 | r |= YMZ280B_status_0_r(machine, offset) << 16; | |
| 1332 | 1332 | } |
| 1333 | 1333 | |
| 1334 | 1334 | return r; |
| r1877 | r1878 | |
| 1337 | 1337 | static WRITE32_HANDLER( sound_w ) |
| 1338 | 1338 | { |
| 1339 | 1339 | // printf("sound_w: %08X, %08X, %08X\n", offset, data, mem_mask); |
| 1340 | ||
| 1341 | 1340 | if (!(mem_mask & 0xff000000)) |
| 1342 | 1341 | { |
| 1343 | YMZ280B_register_0_w(offset, (data >> 24) & 0xff); | |
| 1342 | YMZ280B_register_0_w(machine, offset, (data >> 24) & 0xff); | |
| 1344 | 1343 | } |
| 1345 | 1344 | if (!(mem_mask & 0x00ff0000)) |
| 1346 | 1345 | { |
| 1347 | YMZ280B_data_0_w(offset, (data >> 16) & 0xff); | |
| 1346 | YMZ280B_data_0_w(machine, offset, (data >> 16) & 0xff); | |
| 1348 | 1347 | } |
| 1349 | 1348 | } |
| 1350 | 1349 | |
| r1877 | r1878 | |
| 1397 | 1396 | |
| 1398 | 1397 | if (!(mem_mask & 0xff000000)) |
| 1399 | 1398 | { |
| 1400 | r |= pc16552d_1_r(offset >> 6) << 24; | |
| 1399 | r |= pc16552d_1_r(machine, offset >> 6) << 24; | |
| 1401 | 1400 | } |
| 1402 | 1401 | |
| 1403 | 1402 | return r; |
| r1877 | r1878 | |
| 1407 | 1406 | { |
| 1408 | 1407 | if (!(mem_mask & 0xff000000)) |
| 1409 | 1408 | { |
| 1410 | pc16552d_1_w(offset >> 6, (data >> 24) & 0xff); | |
| 1409 | pc16552d_1_w(machine, offset >> 6, (data >> 24) & 0xff); | |
| 1411 | 1410 | } |
| 1412 | 1411 | } |
| 1413 | 1412 | |
| r1877 | r1878 | |
| 1558 | 1557 | |
| 1559 | 1558 | static WRITE32_HANDLER( lamp_output_kbm_w ) |
| 1560 | 1559 | { |
| 1561 | lamp_output_w(offset, data, mem_mask); | |
| 1560 | lamp_output_w(machine, offset, data, mem_mask); | |
| 1562 | 1561 | |
| 1563 | 1562 | if (!(mem_mask & 0xff000000)) |
| 1564 | 1563 | { |
| r1877 | r1878 | |
| 1577 | 1576 | |
| 1578 | 1577 | static WRITE32_HANDLER( lamp_output_ppp_w ) |
| 1579 | 1578 | { |
| 1580 | lamp_output_w(offset, data, mem_mask); | |
| 1579 | lamp_output_w(machine, offset, data, mem_mask); | |
| 1581 | 1580 | |
| 1582 | 1581 | // ParaParaParadise lamps (active high) |
| 1583 | 1582 | // 0x00000100 Left |
| r1877 | r1878 | |
| 1624 | 1623 | |
| 1625 | 1624 | static WRITE32_HANDLER( lamp_output2_ppp_w ) |
| 1626 | 1625 | { |
| 1627 | lamp_output2_w(offset, data, mem_mask); | |
| 1626 | lamp_output2_w(machine, offset, data, mem_mask); | |
| 1628 | 1627 | |
| 1629 | 1628 | // ParaParaParadise lamps (active high) |
| 1630 | 1629 | // 0x00010000 Top LED 0 |
| r1877 | r1878 | |
| 1658 | 1657 | |
| 1659 | 1658 | static WRITE32_HANDLER( lamp_output3_ppp_w ) |
| 1660 | 1659 | { |
| 1661 | lamp_output3_w(offset, data, mem_mask); | |
| 1660 | lamp_output3_w(machine, offset, data, mem_mask); | |
| 1662 | 1661 | |
| 1663 | 1662 | // ParaParaParadise lamps (active high) |
| 1664 | 1663 | // 0x00010000 Lamp 0 |
| r1877 | r1878 | |
| 1994 | 1993 | MDRV_CPU_ADD(PPC403, 66000000) |
| 1995 | 1994 | MDRV_CPU_CONFIG(firebeat_ppc_cfg) |
| 1996 | 1995 | MDRV_CPU_PROGRAM_MAP(firebeat_map, 0) |
| 1997 | MDRV_CPU_VBLANK_INT(firebeat_interrupt | |
| 1996 | MDRV_CPU_VBLANK_INT("main", firebeat_interrupt | |
| 1998 | 1997 | |
| 1999 | 1998 | MDRV_MACHINE_RESET(firebeat) |
| 2000 | 1999 | MDRV_NVRAM_HANDLER(firebeat) |
| r1877 | r1878 | |
| 2032 | 2031 | MDRV_CPU_ADD(PPC403, 66000000) |
| 2033 | 2032 | MDRV_CPU_CONFIG(firebeat_ppc_cfg) |
| 2034 | 2033 | MDRV_CPU_PROGRAM_MAP(firebeat_map, 0) |
| 2035 | MDRV_CPU_VBLANK_INT(firebeat_interrupt | |
| 2034 | MDRV_CPU_VBLANK_INT("left", firebeat_interrupt | |
| 2036 | 2035 | |
| 2037 | 2036 | MDRV_MACHINE_RESET(firebeat) |
| 2038 | 2037 | MDRV_NVRAM_HANDLER(firebeat) |
| r1877 | r1878 | |
| 2235 | 2234 | |
| 2236 | 2235 | /*****************************************************************************/ |
| 2237 | 2236 | |
| 2238 | static void init_lights(write32_ | |
| 2237 | static void init_lights(write32_machin | |
| 2239 | 2238 | { |
| 2240 | 2239 | if(!out1) out1 = lamp_output_w; |
| 2241 | 2240 | if(!out2) out1 = lamp_output2_w; |
| r1877 | r1878 | |
| 2410 | 2409 | |
| 2411 | 2410 | /*****************************************************************************/ |
| 2412 | 2411 | |
| 2413 | GAME( 2000, ppp, 0, firebeat, ppp, ppp, ROT0, "Konami", "ParaParaParadise", GAME_NOT_WORKING); | |
| 2414 | GAME( 2000, ppd, 0, firebeat, ppp, ppd, ROT0, "Konami", "ParaParaDancing", GAME_NOT_WORKING); | |
| 2415 | GAME( 2000, ppp11, 0, firebeat, ppp, ppp, ROT0, "Konami", "ParaParaParadise v1.1", GAME_NOT_WORKING); | |
| 2416 | GAMEL(2000, kbm, 0, firebeat2, kbm, kbm, ROT270, "Konami", "Keyboardmania", GAME_NOT_WORKING, layout_firebeat); | |
| 2417 | GAMEL(2000, kbm2nd, 0, firebeat2, kbm, kbm, ROT270, "Konami", "Keyboardmania 2nd Mix", GAME_NOT_WORKING, layout_firebeat); | |
| 2418 | GAMEL(2001, kbm3rd, 0, firebeat2, kbm, kbm, ROT270, "Konami", "Keyboardmania 3rd Mix", GAME_NOT_WORKING, layout_firebeat); | |
| 2419 | GAME( 2001, popn7, 0, firebeat_spu, popn, ppp, ROT0, "Konami", "Pop n' Music 7", GAME_NOT_WORKING); | |
| 2412 | GAME( 2000, ppp, 0, firebeat, ppp, ppp, ROT0, "Konami", "ParaParaParadise", GAME_NOT_WORKING) | |
| 2413 | GAME( 2000, ppd, 0, firebeat, ppp, ppd, ROT0, "Konami", "ParaParaDancing", GAME_NOT_WORKING) | |
| 2414 | GAME( 2000, ppp11, 0, firebeat, ppp, ppp, ROT0, "Konami", "ParaParaParadise v1.1", GAME_NOT_WORKING) | |
| 2415 | GAMEL(2000, kbm, 0, firebeat2, kbm, kbm, ROT270, "Konami", "Keyboardmania", GAME_NOT_WORKING, layout_firebeat) | |
| 2416 | GAMEL(2000, kbm2nd, 0, firebeat2, kbm, kbm, ROT270, "Konami", "Keyboardmania 2nd Mix", GAME_NOT_WORKING, layout_firebeat) | |
| 2417 | GAMEL(2001, kbm3rd, 0, firebeat2, kbm, kbm, ROT270, "Konami", "Keyboardmania 3rd Mix", GAME_NOT_WORKING, layout_firebeat) | |
| 2418 | GAME( 2001, popn7, 0, firebeat_spu, popn, ppp, ROT0, "Konami", "Pop n' Music 7", GAME_NOT_WORKING) |
| r1877 | r1878 | |
|---|---|---|
| 299 | 299 | MDRV_CPU_ADD(Z80,5068000/4) /* 5.068/4 Mhz (divider is a guess) */ |
| 300 | 300 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 301 | 301 | MDRV_CPU_IO_MAP(main_io_map,0) |
| 302 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 302 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 303 | 303 | |
| 304 | 304 | MDRV_MACHINE_START(clayshoo) |
| 305 | 305 |
| r1877 | r1878 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | static WRITE8_HANDLER( sound_command_w ) |
| 48 | 48 | { |
| 49 | soundlatch_w(offset,data); | |
| 50 | cpunum_set_input_line(Machine, 1,M6502_IRQ_LINE,HOLD_LINE); | |
| 49 | soundlatch_w(machine,offset,data); | |
| 50 | cpunum_set_input_line(machine, 1,M6502_IRQ_LINE,HOLD_LINE); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
| r1877 | r1878 | |
| 272 | 272 | /* basic machine hardware */ |
| 273 | 273 | MDRV_CPU_ADD(M6502, 1500000) /* 1.5 MHz ?? */ |
| 274 | 274 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 275 | MDRV_CPU_VBLANK_INT(tagteam_interrupt | |
| 275 | MDRV_CPU_VBLANK_INT("main", tagteam_interrupt | |
| 276 | 276 | |
| 277 | 277 | MDRV_CPU_ADD(M6502, 975000) |
| 278 | 278 | /* audio CPU */ /* 975 kHz ?? */ |
| 279 | 279 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 280 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,16) /* IRQs are triggered by the main CPU */ | |
| 280 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,16) /* IRQs are triggered by the main CPU */ | |
| 281 | 281 | |
| 282 | 282 | /* video hardware */ |
| 283 | 283 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 258 | 258 | static MACHINE_DRIVER_START( eolith45 ) |
| 259 | 259 | MDRV_CPU_ADD_TAG("cpu", E132N, 45000000) /* 45 MHz */ |
| 260 | 260 | MDRV_CPU_PROGRAM_MAP(eolith_map,0) |
| 261 | MDRV_CPU_VBLANK_INT(eolith_speedup,262) | |
| 261 | MDRV_CPU_VBLANK_INT_HACK(eolith_speedup,262) | |
| 262 | 262 | |
| 263 | 263 | /* sound cpu */ |
| 264 | 264 |
| r1877 | r1878 | |
|---|---|---|
| 377 | 377 | |
| 378 | 378 | */ |
| 379 | 379 | bit5 ^= 0x20; |
| 380 | return bigevglf_mcu_status_r(0) | (readinputport(1) & 3) | bit5; /* bit 0 and bit 1 - coin inputs */ | |
| 380 | return bigevglf_mcu_status_r(machine,0) | (readinputport(1) & 3) | bit5; /* bit 0 and bit 1 - coin inputs */ | |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | static ADDRESS_MAP_START( bigevglf_sub_readport, ADDRESS_SPACE_IO, 8 ) |
| r1877 | r1878 | |
| 479 | 479 | MDRV_CPU_ADD(Z80,10000000/2) /* 5 MHz ? */ |
| 480 | 480 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 481 | 481 | MDRV_CPU_IO_MAP(bigevglf_readport,bigevglf_writeport) |
| 482 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 482 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 483 | 483 | |
| 484 | 484 | MDRV_CPU_ADD(Z80,10000000/2) /* 5 MHz ? */ |
| 485 | 485 | MDRV_CPU_PROGRAM_MAP(readmem_sub,writemem_sub) |
| 486 | 486 | MDRV_CPU_IO_MAP(bigevglf_sub_readport,bigevglf_sub_writeport) |
| 487 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 487 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 488 | 488 | |
| 489 | 489 | MDRV_CPU_ADD(Z80,8000000/2) |
| 490 | 490 | /* audio CPU */ /* 4 MHz ? */ |
| 491 | 491 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 492 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) /* IRQ generated by ???; | |
| 492 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) /* IRQ generated by ???; | |
| 493 | 493 | 2 irqs/frame give good music tempo but also SOUND ERROR in test mode, |
| 494 | 494 | 4 irqs/frame give SOUND OK in test mode but music seems to be running too fast */ |
| 495 | 495 |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | Port A of the 8910 is connected to IN0 |
| 55 | 55 | Port B of the 8910 is connected to IN1 |
| 56 | 56 | |
| 57 | DIP locations verified for: | |
| 58 | - bagman (manual) | |
| 59 | ||
| 57 | 60 | ***************************************************************************/ |
| 58 | 61 | |
| 59 | 62 | #include "driver.h" |
| r1877 | r1878 | |
| 83 | 86 | static UINT8 ls259_buf[8] = {0,0,0,0,0,0,0,0}; |
| 84 | 87 | |
| 85 | 88 | |
| 86 | static void start_talking ( | |
| 89 | static void start_talking (running_machine *machine) | |
| 87 | 90 | { |
| 88 | 91 | #if 0 |
| 89 | 92 | logerror("Talk started: selected bit %1i, selected roms QS %i QT %i\n", |
| r1877 | r1878 | |
| 96 | 99 | #endif |
| 97 | 100 | |
| 98 | 101 | speech_rom_address = 0x0; |
| 99 | tms5110_CTL_w(0,TMS5110_CMD_SPEAK); | |
| 100 | tms5110_PDC_w(0,0); | |
| 101 | tms5110_PDC_w(0,1); | |
| 102 | tms5110_PDC_w(0,0); | |
| 102 | tms5110_CTL_w(machine,0,TMS5110_CMD_SPEAK); | |
| 103 | tms5110_PDC_w(machine,0,0); | |
| 104 | tms5110_PDC_w(machine,0,1); | |
| 105 | tms5110_PDC_w(machine,0,0); | |
| 103 | 106 | } |
| 104 | 107 | |
| 105 | static void reset_talking ( | |
| 108 | static void reset_talking (running_machine *machine) | |
| 106 | 109 | { |
| 107 | 110 | /*To be extremely accurate there should be a delays between each of |
| 108 | 111 | the function calls below. In real they happen with the frequency of 160 kHz. |
| 109 | 112 | */ |
| 110 | 113 | |
| 111 | tms5110_CTL_w(0,TMS5110_CMD_RESET); | |
| 112 | tms5110_PDC_w(0,0); | |
| 113 | tms5110_PDC_w(0,1); | |
| 114 | tms5110_PDC_w(0,0); | |
| 114 | tms5110_CTL_w(machine,0,TMS5110_CMD_RESET); | |
| 115 | tms5110_PDC_w(machine,0,0); | |
| 116 | tms5110_PDC_w(machine,0,1); | |
| 117 | tms5110_PDC_w(machine,0,0); | |
| 115 | 118 | |
| 116 | tms5110_PDC_w(0,0); | |
| 117 | tms5110_PDC_w(0,1); | |
| 118 | tms5110_PDC_w(0,0); | |
| 119 | tms5110_PDC_w(machine,0,0); | |
| 120 | tms5110_PDC_w(machine,0,1); | |
| 121 | tms5110_PDC_w(machine,0,0); | |
| 119 | 122 | |
| 120 | tms5110_PDC_w(0,0); | |
| 121 | tms5110_PDC_w(0,1); | |
| 122 | tms5110_PDC_w(0,0); | |
| 123 | tms5110_PDC_w(machine,0,0); | |
| 124 | tms5110_PDC_w(machine,0,1); | |
| 125 | tms5110_PDC_w(machine,0,0); | |
| 123 | 126 | |
| 124 | 127 | speech_rom_address = 0x0; |
| 125 | 128 | } |
| r1877 | r1878 | |
| 164 | 167 | |
| 165 | 168 | static WRITE8_HANDLER( bagman_ls259_w ) |
| 166 | 169 | { |
| 167 | bagman_pal16r6_w(offset,data); /*this is just a simulation*/ | |
| 170 | bagman_pal16r6_w(machine,offset,data); /*this is just a simulation*/ | |
| 168 | 171 | |
| 169 | 172 | if (ls259_buf[offset] != (data&1) ) |
| 170 | 173 | { |
| r1877 | r1878 | |
| 174 | 177 | { |
| 175 | 178 | if (ls259_buf[3] == 0) /* 1->0 transition */ |
| 176 | 179 | { |
| 177 | reset_talking(); | |
| 180 | reset_talking(machine); | |
| 178 | 181 | } |
| 179 | 182 | else |
| 180 | 183 | { |
| 181 | start_talking(); /* 0->1 transition */ | |
| 184 | start_talking(machine); /* 0->1 transition */ | |
| 182 | 185 | } |
| 183 | 186 | } |
| 184 | 187 | } |
| r1877 | r1878 | |
| 268 | 271 | |
| 269 | 272 | |
| 270 | 273 | static INPUT_PORTS_START( bagman ) |
| 271 | PORT_START | |
| 274 | PORT_START_TAG("IN0") | |
| 272 | 275 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 273 | 276 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 274 | 277 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) |
| r1877 | r1878 | |
| 278 | 281 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| 279 | 282 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 280 | 283 | |
| 281 | PORT_START | |
| 284 | PORT_START_TAG("IN1") | |
| 282 | 285 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) |
| 283 | 286 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 ) |
| 284 | 287 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) |
| r1877 | r1878 | |
| 288 | 291 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL |
| 289 | 292 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL |
| 290 | 293 | |
| 291 | PORT_START /* DSW */ | |
| 292 | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") | |
| 294 | PORT_START_TAG("DSW") | |
| 295 | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") | |
| 293 | 296 | PORT_DIPSETTING( 0x03, "2" ) |
| 294 | 297 | PORT_DIPSETTING( 0x02, "3" ) |
| 295 | 298 | PORT_DIPSETTING( 0x01, "4" ) |
| 296 | 299 | PORT_DIPSETTING( 0x00, "5" ) |
| 297 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3") | |
| 300 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3") | |
| 298 | 301 | PORT_DIPSETTING( 0x00, "2C/1C 1C/1C 1C/3C 1C/7C" ) |
| 299 | 302 | PORT_DIPSETTING( 0x04, "1C/1C 1C/2C 1C/6C 1C/14C" ) |
| 300 | PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5") | |
| 303 | PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5") | |
| 301 | 304 | PORT_DIPSETTING( 0x18, DEF_STR( Easy ) ) |
| 302 | 305 | PORT_DIPSETTING( 0x10, DEF_STR( Medium ) ) |
| 303 | 306 | PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) |
| 304 | 307 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 305 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:6") | |
| 308 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:6") | |
| 306 | 309 | PORT_DIPSETTING( 0x20, DEF_STR( English ) ) |
| 307 | 310 | PORT_DIPSETTING( 0x00, DEF_STR( French ) ) |
| 308 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7") | |
| 311 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7") | |
| 309 | 312 | PORT_DIPSETTING( 0x40, "30000" ) |
| 310 | 313 | PORT_DIPSETTING( 0x00, "40000" ) |
| 311 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:8") | |
| 314 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:8") | |
| 312 | 315 | PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) |
| 313 | 316 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) |
| 314 | 317 | INPUT_PORTS_END |
| 315 | 318 | |
| 316 | /* EXACTLY the same as bagman, the only difference is that | |
| 317 | Languade dip is replaced by Demo Sounds */ | |
| 318 | 319 | static INPUT_PORTS_START( bagmans ) |
| 319 | PORT_START /* IN0 */ | |
| 320 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 321 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 322 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) | |
| 323 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY | |
| 324 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY | |
| 325 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY | |
| 326 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY | |
| 327 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 320 | PORT_INCLUDE( bagman ) | |
| 328 | 321 | |
| 329 | PORT_START /* IN1 */ | |
| 330 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) | |
| 331 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 ) | |
| 332 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) | |
| 333 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL | |
| 334 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL | |
| 335 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL | |
| 336 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL | |
| 337 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 338 | ||
| 339 | PORT_START /* DSW */ | |
| 340 | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) | |
| 341 | PORT_DIPSETTING( 0x03, "2" ) | |
| 342 | PORT_DIPSETTING( 0x02, "3" ) | |
| 343 | PORT_DIPSETTING( 0x01, "4" ) | |
| 344 | PORT_DIPSETTING( 0x00, "5" ) | |
| 345 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Coinage ) ) | |
| 346 | PORT_DIPSETTING( 0x00, "2C/1C 1C/1C 1C/3C 1C/7C" ) | |
| 347 | PORT_DIPSETTING( 0x04, "1C/1C 1C/2C 1C/6C 1C/14C" ) | |
| 348 | PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) ) | |
| 349 | PORT_DIPSETTING( 0x18, DEF_STR( Easy ) ) | |
| 350 | PORT_DIPSETTING( 0x10, DEF_STR( Medium ) ) | |
| 351 | PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) | |
| 352 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) | |
| 322 | PORT_MODIFY("DSW") | |
| 353 | 323 | PORT_DIPNAME( 0x20, 0x20, DEF_STR ( Demo_Sounds ) ) |
| 354 | 324 | PORT_DIPSETTING( 0x00, DEF_STR ( Off ) ) |
| 355 | 325 | PORT_DIPSETTING( 0x20, DEF_STR ( On ) ) |
| 356 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Bonus_Life ) ) | |
| 357 | PORT_DIPSETTING( 0x40, "30000" ) | |
| 358 | PORT_DIPSETTING( 0x00, "40000" ) | |
| 359 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) | |
| 360 | PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) | |
| 361 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) | |
| 362 | 326 | INPUT_PORTS_END |
| 363 | 327 | |
| 364 | ||
| 365 | /* EXACTLY the same as bagman, the only difference is that the START1 button */ | |
| 366 | /* also acts as the shoot button. */ | |
| 367 | 328 | static INPUT_PORTS_START( sbagman ) |
| 368 | PORT_START /* IN0 */ | |
| 369 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 370 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 329 | PORT_INCLUDE( bagman ) | |
| 330 | ||
| 331 | PORT_MODIFY("IN0") | |
| 371 | 332 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) |
| 372 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* double-function button, start and shoot */ | |
| 373 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY | |
| 374 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY | |
| 375 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY | |
| 376 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY | |
| 377 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 333 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* double-function button, start and shoot */ | |
| 378 | 334 | |
| 379 | PORT_START /* IN1 */ | |
| 380 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) | |
| 381 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 ) | |
| 335 | PORT_MODIFY("IN1") | |
| 382 | 336 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) |
| 383 | 337 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL /* double-function button, start and shoot */ |
| 384 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL | |
| 385 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL | |
| 386 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL | |
| 387 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL | |
| 388 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 389 | ||
| 390 | PORT_START /* DSW */ | |
| 391 | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) | |
| 392 | PORT_DIPSETTING( 0x03, "2" ) | |
| 393 | PORT_DIPSETTING( 0x02, "3" ) | |
| 394 | PORT_DIPSETTING( 0x01, "4" ) | |
| 395 | PORT_DIPSETTING( 0x00, "5" ) | |
| 396 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Coinage ) ) | |
| 397 | PORT_DIPSETTING( 0x00, "2C/1C 1C/1C 1C/3C 1C/7C" ) | |
| 398 | PORT_DIPSETTING( 0x04, "1C/1C 1C/2C 1C/6C 1C/14C" ) | |
| 399 | PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) ) | |
| 400 | PORT_DIPSETTING( 0x18, DEF_STR( Easy ) ) | |
| 401 | PORT_DIPSETTING( 0x10, DEF_STR( Medium ) ) | |
| 402 | PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) | |
| 403 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) | |
| 404 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Language ) ) | |
| 405 | PORT_DIPSETTING( 0x20, DEF_STR( English ) ) | |
| 406 | PORT_DIPSETTING( 0x00, DEF_STR( French ) ) | |
| 407 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Bonus_Life ) ) | |
| 408 | PORT_DIPSETTING( 0x40, "30000" ) | |
| 409 | PORT_DIPSETTING( 0x00, "40000" ) | |
| 410 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) | |
| 411 | PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) | |
| 412 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) | |
| 413 | 338 | INPUT_PORTS_END |
| 414 | 339 | |
| 415 | 340 | static INPUT_PORTS_START( pickin ) |
| 416 | PORT_START /* IN0 */ | |
| 417 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 418 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 419 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) | |
| 420 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY | |
| 421 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY | |
| 422 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY | |
| 423 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY | |
| 424 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 341 | PORT_INCLUDE( bagman ) | |
| 425 | 342 | |
| 426 | PORT_START /* IN1 */ | |
| 427 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) | |
| 428 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 ) | |
| 429 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) | |
| 430 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL | |
| 431 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL | |
| 432 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL | |
| 433 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL | |
| 434 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 435 | ||
| 436 | PORT_START /* DSW */ | |
| 437 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coinage ) ) | |
| 343 | PORT_MODIFY("DSW") | |
| 344 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1") | |
| 438 | 345 | PORT_DIPSETTING( 0x00, "2C/1C 1C/1C 1C/3C 1C/7C" ) |
| 439 | 346 | PORT_DIPSETTING( 0x01, "1C/1C 1C/2C 1C/6C 1C/14C" ) |
| 440 | PORT_DIPNAME( 0x06, 0x04, DEF_STR( Lives ) ) | |
| 347 | PORT_DIPNAME( 0x06, 0x04, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,3") | |
| 441 | 348 | PORT_DIPSETTING( 0x06, "2" ) |
| 442 | 349 | PORT_DIPSETTING( 0x04, "3" ) |
| 443 | 350 | PORT_DIPSETTING( 0x02, "4" ) |
| 444 | 351 | PORT_DIPSETTING( 0x00, "5" ) |
| 445 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Free_Play ) ) | |
| 352 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:4") | |
| 446 | 353 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 447 | 354 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 448 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 449 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 450 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 451 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 452 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 453 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 454 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Language ) ) | |
| 355 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:5" ) | |
| 356 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" ) | |
| 357 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:7") | |
| 455 | 358 | PORT_DIPSETTING( 0x40, DEF_STR( English ) ) |
| 456 | 359 | PORT_DIPSETTING( 0x00, DEF_STR( French ) ) |
| 457 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) | |
| 458 | PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) | |
| 459 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) | |
| 460 | 360 | INPUT_PORTS_END |
| 461 | 361 | |
| 462 | 362 | static INPUT_PORTS_START( botanic ) |
| 463 | PORT_START /* IN0 */ | |
| 464 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 465 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 466 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) | |
| 467 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY | |
| 468 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY | |
| 469 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY | |
| 470 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY | |
| 471 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 363 | PORT_INCLUDE( bagman ) | |
| 472 | 364 | |
| 473 | PORT_START /* IN1 */ | |
| 474 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) | |
| 475 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 ) | |
| 476 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) | |
| 477 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL | |
| 478 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL | |
| 479 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL | |
| 480 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL | |
| 481 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 482 | ||
| 483 | PORT_START /* DSW */ | |
| 484 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) | |
| 485 | PORT_DIPSETTING( 0x00, "2" ) | |
| 486 | PORT_DIPSETTING( 0x03, "3" ) | |
| 487 | PORT_DIPSETTING( 0x02, "4" ) | |
| 488 | PORT_DIPSETTING( 0x01, "5" ) | |
| 489 | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Coinage ) ) | |
| 490 | PORT_DIPSETTING( 0x04, "2C/1C 1C/1C 1C/3C 1C/7C" ) | |
| 491 | PORT_DIPSETTING( 0x00, "1C/1C 1C/2C 1C/6C 1C/14C" ) | |
| 492 | PORT_DIPNAME( 0x08, 0x08, "Invulnerability Fruits" ) | |
| 365 | PORT_MODIFY("DSW") | |
| 366 | PORT_DIPNAME( 0x08, 0x08, "Invulnerability Fruits" ) PORT_DIPLOCATION("SW1:4") | |
| 493 | 367 | PORT_DIPSETTING( 0x08, "3" ) |
| 494 | 368 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) |
| 495 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 496 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 497 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 498 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 499 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 500 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 501 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 502 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 503 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 504 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) | |
| 505 | PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) | |
| 506 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) | |
| 369 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:5" ) | |
| 370 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" ) | |
| 371 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" ) | |
| 507 | 372 | INPUT_PORTS_END |
| 508 | 373 | |
| 509 | 374 | |
| r1877 | r1878 | |
| 565 | 430 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz (?) */ |
| 566 | 431 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 567 | 432 | MDRV_CPU_IO_MAP(readport,writeport) |
| 568 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 433 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 569 | 434 | |
| 570 | 435 | MDRV_MACHINE_RESET(bagman) |
| 571 | 436 | |
| r1877 | r1878 | |
| 601 | 466 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz (?) */ |
| 602 | 467 | MDRV_CPU_PROGRAM_MAP(pickin_readmem,pickin_writemem) |
| 603 | 468 | MDRV_CPU_IO_MAP(readport,writeport) |
| 604 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 469 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 605 | 470 | |
| 606 | 471 | MDRV_MACHINE_RESET(bagman) |
| 607 | 472 | |
| r1877 | r1878 | |
| 651 | 516 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz (?) */ |
| 652 | 517 | MDRV_CPU_PROGRAM_MAP(pickin_readmem,pickin_writemem) |
| 653 | 518 | MDRV_CPU_IO_MAP(readport,writeport) |
| 654 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 519 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 655 | 520 | |
| 656 | 521 | MDRV_MACHINE_RESET(bagman) |
| 657 | 522 | |
| r1877 | r1878 | |
| 942 | 807 | *bagman_video_enable = 1; |
| 943 | 808 | } |
| 944 | 809 | |
| 945 | GAME( 1982, bagman, 0, | |
| 810 | GAME( 1982, bagman, 0, | |
| 946 | 811 | GAME( 1982, bagnard, bagman, bagman, bagman, 0, ROT270, "Valadon Automation", "Le Bagnard (set 1)", 0 ) |
| 947 | 812 | GAME( 1982, bagnarda, bagman, bagman, bagman, bagnarda, ROT270, "Valadon Automation", "Le Bagnard (set 2)", 0 ) |
| 948 | 813 | GAME( 1982, bagmans, bagman, bagman, bagmans, 0, ROT270, "Valadon Automation (Stern license)", "Bagman (Stern set 1)", 0 ) |
| 949 | 814 | GAME( 1982, bagmans2, bagman, bagman, bagman, 0, ROT270, "Valadon Automation (Stern license)", "Bagman (Stern set 2)", 0 ) |
| 950 | GAME( 1984, sbagman, 0, bagman, sbagman, 0, ROT270, "Valadon Automation", "Super Bagman", 0 ) | |
| 815 | GAME( 1984, sbagman, 0, bagman, sbagman, 0, ROT270, "Valadon Automation", "Super Bagman", 0 ) | |
| 951 | 816 | GAME( 1984, sbagmans, sbagman, bagman, sbagman, 0, ROT270, "Valadon Automation (Stern license)", "Super Bagman (Stern)", 0 ) |
| 952 | GAME( 1983, pickin, 0, | |
| 817 | GAME( 1983, pickin, 0, | |
| 953 | 818 | GAME( 1984, botanic, 0, botanic, botanic, 0, ROT270, "Valadon Automation (Itisa license)", "Botanic", 0 ) |
| 954 | 819 |
| r1877 | r1878 | |
|---|---|---|
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | static void |
| 390 | DrawLine( | |
| 390 | DrawLine( | |
| 391 | 391 | { |
| 392 | 392 | if( x0>=0 && x0<bitmap->width && |
| 393 | 393 | x1>=0 && x1<bitmap->width && |
| r1877 | r1878 | |
| 421 | 421 | } /* DrawLine */ |
| 422 | 422 | |
| 423 | 423 | static void |
| 424 | DrawPoly( | |
| 424 | DrawPoly( | |
| 425 | 425 | { |
| 426 | 426 | UINT32 flags = *pSource++; |
| 427 | 427 | UINT32 unk = *pSource++; |
| r1877 | r1878 | |
| 861 | 861 | MDRV_CPU_ADD(H83002, 14745600 ) |
| 862 | 862 | MDRV_CPU_PROGRAM_MAP( s23h8rwmap, 0 ) |
| 863 | 863 | MDRV_CPU_IO_MAP( s23h8iomap, 0 ) |
| 864 | MDRV_CPU_VBLANK_INT( irq1_line_pulse | |
| 864 | MDRV_CPU_VBLANK_INT("main", irq1_line_pulse | |
| 865 | 865 | |
| 866 | 866 | |
| 867 | 867 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 895 | 895 | MDRV_CPU_ADD(R4650BE, 166000000) |
| 896 | 896 | MDRV_CPU_CONFIG(config) |
| 897 | 897 | MDRV_CPU_PROGRAM_MAP(ss23_map, 0) |
| 898 | MDRV_CPU_VBLANK_INT(namcos23_interrupt | |
| 898 | MDRV_CPU_VBLANK_INT("main", namcos23_interrupt | |
| 899 | 899 | |
| 900 | 900 | MDRV_CPU_ADD(H83002, 14745600 ) |
| 901 | 901 | MDRV_CPU_PROGRAM_MAP( s23h8rwmap, 0 ) |
| 902 | 902 | MDRV_CPU_IO_MAP( s23h8iomap, 0 ) |
| 903 | MDRV_CPU_VBLANK_INT( irq1_line_pulse | |
| 903 | MDRV_CPU_VBLANK_INT("main", irq1_line_pulse | |
| 904 | 904 | |
| 905 | 905 | |
| 906 | 906 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 109 | 109 | if (data == 0x08) return; |
| 110 | 110 | |
| 111 | 111 | pending_command = 1; |
| 112 | soundlatch_w(0, data & 0xff); | |
| 113 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 112 | soundlatch_w(machine, 0, data & 0xff); | |
| 113 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
| r1877 | r1878 | |
| 141 | 141 | static DRIVER_INIT( inufuku ) |
| 142 | 142 | { |
| 143 | 143 | pending_command = 1; |
| 144 | inufuku_soundrombank_w(0, 0); | |
| 144 | inufuku_soundrombank_w(machine, 0, 0); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | |
| r1877 | r1878 | |
| 401 | 401 | /* basic machine hardware */ |
| 402 | 402 | MDRV_CPU_ADD(M68000, 32000000/2) /* 16.00 MHz */ |
| 403 | 403 | MDRV_CPU_PROGRAM_MAP(inufuku_readmem, inufuku_writemem) |
| 404 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 404 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 405 | 405 | |
| 406 | 406 | MDRV_CPU_ADD(Z80, 32000000/4) /* 8.00 MHz */ |
| 407 | 407 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 186 | 186 | /* basic machine hardware */ |
| 187 | 187 | MDRV_CPU_ADD(Z80, 8000000 / 2) /* 4 MHz ? */ |
| 188 | 188 | MDRV_CPU_PROGRAM_MAP(mem, 0) |
| 189 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 189 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 190 | 190 | |
| 191 | 191 | /* video hardware */ |
| 192 | 192 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 43 | 43 | ***************************************************************************/ |
| 44 | 44 | |
| 45 | 45 | #include "driver.h" |
| 46 | #include "deprecat.h" | |
| 46 | 47 | #include "sound/2203intf.h" |
| 47 | 48 | |
| 48 | 49 | extern UINT8 *commando_videoram2, *commando_colorram2; |
| r1877 | r1878 | |
| 240 | 241 | // basic machine hardware |
| 241 | 242 | MDRV_CPU_ADD(Z80, PHI_MAIN) // ??? |
| 242 | 243 | MDRV_CPU_PROGRAM_MAP(commando_map, 0) |
| 243 | MDRV_CPU_VBLANK_INT(commando_interrupt | |
| 244 | MDRV_CPU_VBLANK_INT("main", commando_interrupt | |
| 244 | 245 | |
| 245 | 246 | MDRV_CPU_ADD(Z80, PHI_B) // 3 MHz |
| 246 | 247 | /* audio CPU */ |
| 247 | 248 | MDRV_CPU_PROGRAM_MAP(sound_map, 0) |
| 248 | MDRV_CPU_VBLANK_INT(irq0_line_hold, 4) | |
| 249 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 4) | |
| 249 | 250 | |
| 250 | 251 | // video hardware |
| 251 | 252 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r1877 | r1878 | |
|---|---|---|
| 361 | 361 | |
| 362 | 362 | static void bankselect_postload(void) |
| 363 | 363 | { |
| 364 | bankselect_w(0, bankselect[0], 0); | |
| 365 | bankselect_w(1, bankselect[1], 0); | |
| 364 | bankselect_w(Machine, 0, bankselect[0], 0); | |
| 365 | bankselect_w(Machine, 1, bankselect[1], 0); | |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | |
| r1877 | r1878 | |
| 375 | 375 | |
| 376 | 376 | static READ16_HANDLER( switch_r ) |
| 377 | 377 | { |
| 378 | int result = input_port_1_r(offset) | (input_port_2_r(offset) << 8); | |
| 378 | int result = input_port_1_r(machine, offset) | (input_port_2_r(machine, offset) << 8); | |
| 379 | 379 | |
| 380 | 380 | if (atarigen_cpu_to_sound_ready) result ^= 0x20; |
| 381 | 381 | if (atarigen_sound_to_cpu_ready) result ^= 0x10; |
| r1877 | r1878 | |
| 386 | 386 | |
| 387 | 387 | static READ8_HANDLER( switch_6502_r ) |
| 388 | 388 | { |
| 389 | int result = input_port_0_r(offset); | |
| 389 | int result = input_port_0_r(machine, offset); | |
| 390 | 390 | |
| 391 | 391 | if (atarigen_cpu_to_sound_ready) result ^= 0x01; |
| 392 | 392 | if (atarigen_sound_to_cpu_ready) result ^= 0x02; |
| 393 | 393 | if (!has_tms5220 || tms5220_ready_r()) result ^= 0x04; |
| 394 | if (!(input_port_2_r(offset) & 0x80)) result ^= 0x10; | |
| 394 | if (!(input_port_2_r(machine, offset) & 0x80)) result ^= 0x10; | |
| 395 | 395 | |
| 396 | 396 | return result; |
| 397 | 397 | } |
| r1877 | r1878 | |
| 626 | 626 | /* a large number of signals are reset when this happens */ |
| 627 | 627 | atarigen_sound_io_reset(1); |
| 628 | 628 | sndti_reset(SOUND_YM2151, 0); |
| 629 | mixer_w(0, 0); | |
| 629 | mixer_w(machine, 0, 0); | |
| 630 | 630 | tms5220_data = 0; |
| 631 | 631 | tms5220_data_strobe = 0; |
| 632 | 632 | } |
| r1877 | r1878 | |
| 639 | 639 | atarigen_update_interrupts(); |
| 640 | 640 | |
| 641 | 641 | /* handle it normally otherwise */ |
| 642 | return atarigen_sound_r(offset,0); | |
| 642 | return atarigen_sound_r(machine,offset,0); | |
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | |
| r1877 | r1878 | |
| 650 | 650 | atarigen_update_interrupts(); |
| 651 | 651 | |
| 652 | 652 | /* handle it normally otherwise */ |
| 653 | atarigen_6502_sound_w(offset, data); | |
| 653 | atarigen_6502_sound_w(machine, offset, data); | |
| 654 | 654 | } |
| 655 | 655 | |
| 656 | 656 | |
| r1877 | r1878 | |
| 661 | 661 | atarigen_update_interrupts(); |
| 662 | 662 | |
| 663 | 663 | /* handle it normally otherwise */ |
| 664 | return atarigen_6502_sound_r(offset); | |
| 664 | return atarigen_6502_sound_r(machine, offset); | |
| 665 | 665 | } |
| 666 | 666 | |
| 667 | 667 | |
| r1877 | r1878 | |
| 681 | 681 | static WRITE8_HANDLER( tms5220_strobe_w ) |
| 682 | 682 | { |
| 683 | 683 | if (!(offset & 1) && tms5220_data_strobe && has_tms5220) |
| 684 | tms5220_data_w(0, tms5220_data); | |
| 684 | tms5220_data_w(machine, 0, tms5220_data); | |
| 685 | 685 | tms5220_data_strobe = offset & 1; |
| 686 | 686 | } |
| 687 | 687 | |
| r1877 | r1878 | |
| 774 | 774 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) |
| 775 | 775 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) |
| 776 | 776 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 777 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_S | |
| 777 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_S | |
| 778 | 778 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 ) |
| 779 | 779 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 780 | 780 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) |
| r1877 | r1878 | |
| 820 | 820 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 821 | 821 | |
| 822 | 822 | PORT_START_TAG("DSW0") |
| 823 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) | |
| 823 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("6/7A:!8,!7") | |
| 824 | 824 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 825 | 825 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) |
| 826 | 826 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| 827 | 827 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 828 | PORT_DIPNAME( 0x0c, 0x00, "Right Coin" ) | |
| 828 | PORT_DIPNAME( 0x0c, 0x00, "Right Coin" ) PORT_DIPLOCATION("6/7A:!6,!5") | |
| 829 | 829 | PORT_DIPSETTING( 0x00, "*1" ) |
| 830 | 830 | PORT_DIPSETTING( 0x04, "*4" ) |
| 831 | 831 | PORT_DIPSETTING( 0x08, "*5" ) |
| 832 | 832 | PORT_DIPSETTING( 0x0c, "*6" ) |
| 833 | PORT_DIPNAME( 0x10, 0x00, "Left Coin" ) | |
| 833 | PORT_DIPNAME( 0x10, 0x00, "Left Coin" ) PORT_DIPLOCATION("6/7A:!4") | |
| 834 | 834 | PORT_DIPSETTING( 0x00, "*1" ) |
| 835 | 835 | PORT_DIPSETTING( 0x10, "*2" ) |
| 836 | PORT_DIPNAME( 0xe0, 0x00, "Bonus Coins" ) | |
| 836 | PORT_DIPNAME( 0xe0, 0x00, "Bonus Coins" ) PORT_DIPLOCATION("6/7A:!3,!2,!1") | |
| 837 | 837 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) |
| 838 | PORT_DIPSETTING( 0x80, "1 each 5" ) | |
| 839 | PORT_DIPSETTING( 0x40, "1 each 4" ) | |
| 840 | PORT_DIPSETTING( 0xa0, "1 each 3" ) | |
| 841 | PORT_DIPSETTING( 0x60, "2 each 4" ) | |
| 842 | PORT_DIPSETTING( 0x20, "1 each 2" ) | |
| 843 | PORT_DIPSETTING( 0xc0, "1 each ?" ) | |
| 838 | PORT_DIPSETTING( 0x80, "1 Each 5" ) | |
| 839 | PORT_DIPSETTING( 0x40, "1 Each 4" ) | |
| 840 | PORT_DIPSETTING( 0xa0, "1 Each 3" ) | |
| 841 | PORT_DIPSETTING( 0x60, "2 Each 4" ) | |
| 842 | PORT_DIPSETTING( 0x20, "1 Each 2" ) | |
| 843 | PORT_DIPSETTING( 0xc0, "1 Each ?" ) /* Not Documented */ | |
| 844 | 844 | PORT_DIPSETTING( 0xe0, DEF_STR( Free_Play ) ) |
| 845 | 845 | |
| 846 | 846 | PORT_START_TAG("DSW1") |
| 847 | PORT_DIPNAME( 0x03, 0x0 | |
| 847 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("5/6A:!8,!7") | |
| 848 | 848 | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) |
| 849 | 849 | PORT_DIPSETTING( 0x02, DEF_STR( Medium ) ) |
| 850 | 850 | PORT_DIPSETTING( 0x00, "Med. Hard" ) |
| 851 | 851 | PORT_DIPSETTING( 0x03, DEF_STR( Hard ) ) |
| 852 | PORT_DIPNAME( 0x0c, 0x0 | |
| 852 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("5/6A:!6,!5") | |
| 853 | 853 | PORT_DIPSETTING( 0x08, "10000" ) |
| 854 | 854 | PORT_DIPSETTING( 0x00, "15000" ) |
| 855 | 855 | PORT_DIPSETTING( 0x0c, "20000" ) |
| 856 | 856 | PORT_DIPSETTING( 0x04, DEF_STR( None ) ) |
| 857 | PORT_DIPNAME( 0x30, 0x | |
| 857 | PORT_DIPNAME( 0x30, 0x | |
| 858 | 858 | PORT_DIPSETTING( 0x20, "3" ) |
| 859 | 859 | PORT_DIPSETTING( 0x00, "4" ) |
| 860 | 860 | PORT_DIPSETTING( 0x30, "5" ) |
| 861 | 861 | PORT_DIPSETTING( 0x10, "Infinite (Cheat)") |
| 862 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) | |
| 863 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 864 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 865 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) | |
| 866 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 867 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) | |
| 862 | PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "5/6A:!2" ) /* Listed as "Unused" */ | |
| 863 | PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "5/6A:!1" ) /* Listed as "Unused" */ | |
| 868 | 864 | INPUT_PORTS_END |
| 869 | 865 | |
| 870 | 866 | |
| 871 | 867 | static INPUT_PORTS_START( 720 ) |
| 872 | PORT_START_TAG("1840") /* (sound) */ | |
| 873 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 874 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 875 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) | |
| 876 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 877 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SPECIAL ) | |
| 878 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 ) | |
| 879 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 880 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 868 | PORT_INCLUDE( paperboy ) | |
| 881 | 869 | |
| 882 | PORT_START_TAG("1800") | |
| 883 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 884 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 885 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 886 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 887 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 888 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 889 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 890 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) | |
| 891 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 892 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) | |
| 893 | ||
| 894 | PORT_START_TAG("1801") | |
| 895 | PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 896 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 897 | ||
| 898 | PORT_START_TAG("ADC0") | |
| 870 | PORT_MODIFY("ADC0") | |
| 899 | 871 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 900 | 872 | |
| 901 | PORT_ | |
| 873 | PORT_MODIFY | |
| 902 | 874 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 903 | 875 | |
| 904 | PORT_START_TAG("ADC2") | |
| 905 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 906 | ||
| 907 | PORT_START_TAG("ADC3") | |
| 908 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 909 | ||
| 910 | PORT_START_TAG("LETA0") /* not direct mapped */ | |
| 876 | PORT_MODIFY("LETA0") /* not direct mapped */ | |
| 911 | 877 | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) |
| 912 | 878 | |
| 913 | PORT_ | |
| 879 | PORT_MODIFY | |
| 914 | 880 | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE |
| 915 | 881 | |
| 916 | PORT_START_TAG("LETA2") | |
| 917 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 918 | ||
| 919 | PORT_START_TAG("LETA3") | |
| 920 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 921 | ||
| 922 | PORT_START_TAG("DSW0") | |
| 923 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) | |
| 924 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) | |
| 925 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) | |
| 926 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) | |
| 927 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 928 | PORT_DIPNAME( 0x0c, 0x00, "Right Coin" ) | |
| 929 | PORT_DIPSETTING( 0x00, "*1" ) | |
| 930 | PORT_DIPSETTING( 0x04, "*4" ) | |
| 931 | PORT_DIPSETTING( 0x08, "*5" ) | |
| 932 | PORT_DIPSETTING( 0x0c, "*6" ) | |
| 933 | PORT_DIPNAME( 0x10, 0x00, "Left Coin" ) | |
| 934 | PORT_DIPSETTING( 0x00, "*1" ) | |
| 935 | PORT_DIPSETTING( 0x10, "*2" ) | |
| 936 | PORT_DIPNAME( 0xe0, 0x00, "Bonus Coins" ) | |
| 937 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 938 | /* PORT_DIPSETTING( 0xc0, DEF_STR( None ) )*/ | |
| 939 | PORT_DIPSETTING( 0x80, "1 each 5" ) | |
| 940 | PORT_DIPSETTING( 0x40, "1 each 4" ) | |
| 941 | PORT_DIPSETTING( 0xa0, "1 each 3" ) | |
| 942 | PORT_DIPSETTING( 0x60, "2 each 4" ) | |
| 943 | PORT_DIPSETTING( 0x20, "1 each 2" ) | |
| 944 | PORT_DIPSETTING( 0xe0, DEF_STR( Free_Play ) ) | |
| 945 | ||
| 946 | PORT_START_TAG("DSW1") | |
| 947 | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) ) | |
| 882 | PORT_MODIFY("DSW1") | |
| 883 | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("5/6A:!8,!7") | |
| 948 | 884 | PORT_DIPSETTING( 0x01, "3000" ) |
| 949 | 885 | PORT_DIPSETTING( 0x00, "5000" ) |
| 950 | 886 | PORT_DIPSETTING( 0x02, "8000" ) |
| 951 | 887 | PORT_DIPSETTING( 0x03, "12000" ) |
| 952 | PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Difficulty ) ) | |
| 888 | PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("5/6A:!6,!5") | |
| 953 | 889 | PORT_DIPSETTING( 0x04, DEF_STR( Easy ) ) |
| 954 | 890 | PORT_DIPSETTING( 0x00, DEF_STR( Medium ) ) |
| 955 | 891 | PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) |
| 956 | 892 | PORT_DIPSETTING( 0x0c, DEF_STR( Hardest ) ) |
| 957 | PORT_DIPNAME( 0x30, 0x10, "Maximum Add. A. Coins" ) | |
| 893 | PORT_DIPNAME( 0x30, 0x10, "Maximum Add. A. Coins" ) PORT_DIPLOCATION("5/6A:!4,!3") | |
| 958 | 894 | PORT_DIPSETTING( 0x10, "0" ) |
| 959 | 895 | PORT_DIPSETTING( 0x20, "1" ) |
| 960 | 896 | PORT_DIPSETTING( 0x00, "2" ) |
| 961 | 897 | PORT_DIPSETTING( 0x30, "3" ) |
| 962 | PORT_DIPNAME( 0xc0, 0x40, "Coins Required" ) | |
| 963 | PORT_DIPSETTING( 0x80, "3 to Start, 2 to Continue" ) | |
| 964 | PORT_DIPSETTING( 0xc0, "3 to Start, 1 to Continue" ) | |
| 965 | PORT_DIPSETTING( 0x00, "2 to Start, 1 to Continue" ) | |
| 966 | PORT_DIPSETTING( 0x40, "1 to Start, 1 to Continue" ) | |
| 898 | PORT_DIPNAME( 0xc0, 0x40, "Coins Required" ) PORT_DIPLOCATION("5/6A:!2,!1") | |
| 899 | PORT_DIPSETTING( 0x80, "3 To Start, 2 To Continue" ) | |
| 900 | PORT_DIPSETTING( 0xc0, "3 To Start, 1 To Continue" ) | |
| 901 | PORT_DIPSETTING( 0x00, "2 To Start, 1 To Continue" ) | |
| 902 | PORT_DIPSETTING( 0x40, "1 To Start, 1 To Continue" ) | |
| 967 | 903 | INPUT_PORTS_END |
| 968 | 904 | |
| 969 | 905 | |
| 970 | 906 | static INPUT_PORTS_START( ssprint ) |
| 971 | PORT_START_TAG("1840") | |
| 972 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 973 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 974 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) | |
| 975 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 976 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SPECIAL ) | |
| 977 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 978 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 979 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN3 ) | |
| 907 | PORT_INCLUDE( paperboy ) | |
| 980 | 908 | |
| 981 | PORT_START_TAG("1800") | |
| 982 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 983 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 909 | PORT_MODIFY("1800") | |
| 984 | 910 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 985 | 911 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START3 ) |
| 986 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 987 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 988 | 912 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) |
| 989 | 913 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| 990 | 914 | |
| 991 | PORT_START_TAG("1801") | |
| 992 | PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 993 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 994 | ||
| 995 | PORT_START_TAG("ADC0") | |
| 915 | PORT_MODIFY("ADC0") | |
| 996 | 916 | PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0x3f) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_PLAYER(1) |
| 997 | 917 | |
| 998 | PORT_ | |
| 918 | PORT_MODIFY | |
| 999 | 919 | PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0x3f) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_PLAYER(2) |
| 1000 | 920 | |
| 1001 | PORT_ | |
| 921 | PORT_MODIFY | |
| 1002 | 922 | PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0x3f) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_PLAYER(3) |
| 1003 | 923 | |
| 1004 | PORT_START_TAG("ADC3") | |
| 1005 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1006 | ||
| 1007 | PORT_START_TAG("LETA0") | |
| 924 | PORT_MODIFY("LETA0") | |
| 1008 | 925 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(1) |
| 1009 | 926 | |
| 1010 | PORT_ | |
| 927 | PORT_MODIFY | |
| 1011 | 928 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(2) |
| 1012 | 929 | |
| 1013 | PORT_ | |
| 930 | PORT_MODIFY | |
| 1014 | 931 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(3) |
| 1015 | 932 | |
| 1016 | PORT_START_TAG("LETA3") | |
| 1017 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1018 | ||
| 1019 | PORT_START_TAG("DSW0") | |
| 1020 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) | |
| 1021 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) | |
| 1022 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) | |
| 1023 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) | |
| 1024 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 1025 | PORT_DIPNAME( 0x1c, 0x00, "Coin Multiplier" ) | |
| 933 | PORT_MODIFY("DSW0") | |
| 934 | PORT_DIPNAME( 0x1c, 0x00, "Coin Multiplier" ) PORT_DIPLOCATION("6/7A:!6,!5,!4") | |
| 1026 | 935 | PORT_DIPSETTING( 0x00, "*1" ) |
| 1027 | 936 | PORT_DIPSETTING( 0x04, "*2" ) |
| 1028 | 937 | PORT_DIPSETTING( 0x08, "*3" ) |
| r1877 | r1878 | |
| 1031 | 940 | PORT_DIPSETTING( 0x14, "*6" ) |
| 1032 | 941 | PORT_DIPSETTING( 0x18, "*7" ) |
| 1033 | 942 | PORT_DIPSETTING( 0x1c, "*8" ) |
| 1034 | PORT_DIPNAME( 0xe0, 0x00, "Bonus Coins" ) | |
| 1035 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 1036 | PORT_DIPSETTING( 0x80, "1 each 5" ) | |
| 1037 | PORT_DIPSETTING( 0x40, "1 each 4" ) | |
| 1038 | PORT_DIPSETTING( 0xa0, "1 each 3" ) | |
| 1039 | PORT_DIPSETTING( 0x60, "2 each 4" ) | |
| 1040 | PORT_DIPSETTING( 0x20, "1 each 2" ) | |
| 1041 | PORT_DIPSETTING( 0xc0, "1 each ?" ) | |
| 1042 | PORT_DIPSETTING( 0xe0, DEF_STR( Free_Play ) ) | |
| 1043 | 943 | |
| 1044 | PORT_START_TAG("DSW1") | |
| 1045 | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Difficulty ) ) | |
| 944 | PORT_MODIFY("DSW1") | |
| 945 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("5/6A:!8,!7") | |
| 1046 | 946 | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) |
| 1047 | 947 | PORT_DIPSETTING( 0x00, DEF_STR( Medium ) ) |
| 1048 | 948 | PORT_DIPSETTING( 0x02, "Med. Hard" ) |
| 1049 | 949 | PORT_DIPSETTING( 0x03, DEF_STR( Hard ) ) |
| 1050 | PORT_DIPNAME( 0x0c, 0x0 | |
| 950 | PORT_DIPNAME( 0x0c, 0x00, "Obstacles" ) PORT_DIPLOCATION("5/6A:!6,!5") | |
| 1051 | 951 | PORT_DIPSETTING( 0x04, DEF_STR( Easy ) ) |
| 1052 | 952 | PORT_DIPSETTING( 0x00, DEF_STR( Medium ) ) |
| 1053 | 953 | PORT_DIPSETTING( 0x08, "Med. Hard" ) |
| 1054 | 954 | PORT_DIPSETTING( 0x0c, DEF_STR( Hard ) ) |
| 1055 | PORT_DIPNAME( 0x30, 0x00, "Wrenches" ) | |
| 955 | PORT_DIPNAME( 0x30, 0x00, "Wrenches" ) PORT_DIPLOCATION("5/6A:!4,!3") | |
| 1056 | 956 | PORT_DIPSETTING( 0x10, "2" ) |
| 1057 | 957 | PORT_DIPSETTING( 0x00, "3" ) |
| 1058 | 958 | PORT_DIPSETTING( 0x20, "4" ) |
| 1059 | 959 | PORT_DIPSETTING( 0x30, "5" ) |
| 1060 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) | |
| 1061 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1062 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 1063 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) | |
| 1064 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1065 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) | |
| 1066 | 960 | INPUT_PORTS_END |
| 1067 | 961 | |
| 1068 | 962 | |
| 1069 | 963 | static INPUT_PORTS_START( csprint ) |
| 1070 | PORT_START_TAG("1840") | |
| 1071 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 1072 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 1073 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) | |
| 1074 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 1075 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SPECIAL ) | |
| 964 | PORT_INCLUDE( ssprint ) | |
| 965 | ||
| 966 | PORT_MODIFY("1840") | |
| 1076 | 967 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1077 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 1078 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 1079 | 968 | |
| 1080 | PORT_ | |
| 969 | PORT_MODIFY | |
| 1081 | 970 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1082 | 971 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1083 | 972 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1084 | 973 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1085 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 1086 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 1087 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) | |
| 1088 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) | |
| 1089 | 974 | |
| 1090 | PORT_START_TAG("1801") | |
| 1091 | PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1092 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 1093 | ||
| 1094 | PORT_START_TAG("ADC0") | |
| 1095 | PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0x3f) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_PLAYER(1) | |
| 1096 | ||
| 1097 | PORT_START_TAG("ADC1") | |
| 1098 | PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0x3f) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_PLAYER(2) | |
| 1099 | ||
| 1100 | PORT_START_TAG("ADC2") | |
| 975 | PORT_MODIFY("ADC2") | |
| 1101 | 976 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1102 | 977 | |
| 1103 | PORT_ | |
| 978 | PORT_MODIFY | |
| 1104 | 979 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1105 | 980 | |
| 1106 | PORT_START_TAG("LETA0") | |
| 1107 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(1) | |
| 1108 | ||
| 1109 | PORT_START_TAG("LETA1") | |
| 1110 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(2) | |
| 1111 | ||
| 1112 | PORT_START_TAG("LETA2") | |
| 1113 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1114 | ||
| 1115 | PORT_START_TAG("LETA3") | |
| 1116 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1117 | ||
| 1118 | PORT_START_TAG("DSW0") | |
| 1119 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) | |
| 1120 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) | |
| 1121 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) | |
| 1122 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) | |
| 1123 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 1124 | PORT_DIPNAME( 0x1c, 0x00, "Coin Multiplier" ) | |
| 1125 | PORT_DIPSETTING( 0x00, "*1" ) | |
| 1126 | PORT_DIPSETTING( 0x04, "*2" ) | |
| 1127 | PORT_DIPSETTING( 0x08, "*3" ) | |
| 1128 | PORT_DIPSETTING( 0x0c, "*4" ) | |
| 1129 | PORT_DIPSETTING( 0x10, "*5" ) | |
| 1130 | PORT_DIPSETTING( 0x14, "*6" ) | |
| 1131 | PORT_DIPSETTING( 0x18, "*7" ) | |
| 1132 | PORT_DIPSETTING( 0x1c, "*8" ) | |
| 1133 | PORT_DIPNAME( 0xe0, 0x00, "Bonus Coins" ) | |
| 1134 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) | |
| 1135 | PORT_DIPSETTING( 0x80, "1 each 5" ) | |
| 1136 | PORT_DIPSETTING( 0x40, "1 each 4" ) | |
| 1137 | PORT_DIPSETTING( 0xa0, "1 each 3" ) | |
| 1138 | PORT_DIPSETTING( 0x60, "2 each 4" ) | |
| 1139 | PORT_DIPSETTING( 0x20, "1 each 2" ) | |
| 1140 | PORT_DIPSETTING( 0xc0, "1 each ?" ) | |
| 1141 | PORT_DIPSETTING( 0xe0, DEF_STR( Free_Play ) ) | |
| 1142 | ||
| 1143 | PORT_START_TAG("DSW1") | |
| 1144 | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Difficulty ) ) | |
| 1145 | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) | |
| 1146 | PORT_DIPSETTING( 0x00, DEF_STR( Medium ) ) | |
| 1147 | PORT_DIPSETTING( 0x02, "Med. Hard" ) | |
| 1148 | PORT_DIPSETTING( 0x03, DEF_STR( Hard ) ) | |
| 1149 | PORT_DIPNAME( 0x0c, 0x04, "Obstacles" ) | |
| 1150 | PORT_DIPSETTING( 0x04, DEF_STR( Easy ) ) | |
| 1151 | PORT_DIPSETTING( 0x00, DEF_STR( Medium ) ) | |
| 1152 | PORT_DIPSETTING( 0x08, "Med. Hard" ) | |
| 1153 | PORT_DIPSETTING( 0x0c, DEF_STR( Hard ) ) | |
| 1154 | PORT_DIPNAME( 0x30, 0x00, "Wrenches" ) | |
| 1155 | PORT_DIPSETTING( 0x10, "2" ) | |
| 1156 | PORT_DIPSETTING( 0x00, "3" ) | |
| 1157 | PORT_DIPSETTING( 0x20, "4" ) | |
| 1158 | PORT_DIPSETTING( 0x30, "5" ) | |
| 1159 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) | |
| 1160 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1161 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
| 1162 | PORT_DIPNAME( 0x80, 0x80, "Auto High Score Reset" ) | |
| 981 | PORT_MODIFY("DSW1") | |
| 982 | PORT_DIPNAME( 0x80, 0x00, "Auto High Score Reset" ) PORT_DIPLOCATION("5/6A:!1") /* "After 2000 Plays." */ | |
| 1163 | 983 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 1164 | 984 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1165 | 985 | INPUT_PORTS_END |
| 1166 | 986 | |
| 1167 | 987 | |
| 1168 | 988 | static INPUT_PORTS_START( apb ) |
| 1169 | PORT_START_TAG("1840") | |
| 1170 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 1171 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 1172 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) | |
| 1173 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 1174 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SPECIAL ) | |
| 1175 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 ) | |
| 1176 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 1177 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 989 | PORT_INCLUDE( paperboy ) | |
| 1178 | 990 | |
| 1179 | PORT_START_TAG("1800") | |
| 1180 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 991 | PORT_MODIFY("1800") | |
| 1181 | 992 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 1182 | 993 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1183 | 994 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 1184 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 1185 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 1186 | 995 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1187 | 996 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1188 | 997 | |
| 1189 | PORT_START_TAG("1801") | |
| 1190 | PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1191 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 1192 | ||
| 1193 | PORT_START_TAG("ADC0") | |
| 998 | PORT_MODIFY("ADC0") | |
| 1194 | 999 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1195 | 1000 | |
| 1196 | PORT_ | |
| 1001 | PORT_MODIFY | |
| 1197 | 1002 | PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0x3f) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_PLAYER(1) |
| 1198 | 1003 | |
| 1199 | PORT_START_TAG("ADC2") | |
| 1200 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1201 | ||
| 1202 | PORT_START_TAG("ADC3") | |
| 1203 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1204 | ||
| 1205 | PORT_START_TAG("LETA0") | |
| 1004 | PORT_MODIFY("LETA0") | |
| 1206 | 1005 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(1) |
| 1207 | 1006 | |
| 1208 | PORT_START_TAG("LETA1") | |
| 1209 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1210 | ||
| 1211 | PORT_START_TAG("LETA2") | |
| 1212 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1213 | ||
| 1214 | PORT_START_TAG("LETA3") | |
| 1215 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1216 | ||
| 1217 | PORT_START_TAG("DSW0") | |
| 1218 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) | |
| 1219 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) | |
| 1220 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) | |
| 1221 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) | |
| 1222 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 1223 | PORT_DIPNAME( 0x0c, 0x00, "Right Coin" ) | |
| 1224 | PORT_DIPSETTING( 0x00, "*1" ) | |
| 1225 | PORT_DIPSETTING( 0x04, "*4" ) | |
| 1226 | PORT_DIPSETTING( 0x08, "*5" ) | |
| 1227 | PORT_DIPSETTING( 0x0c, "*6" ) | |
| 1228 | PORT_DIPNAME( 0x10, 0x00, "Left Coin" ) | |
| 1229 | PORT_DIPSETTING( 0x00, "*1" ) | |
| 1230 | PORT_DIPSETTING( 0x10, "*2" ) | |
| 1231 | PORT_DIPNAME( 0xe0, 0x00, "Bonus Coins" ) | |
| 1007 | PORT_MODIFY("DSW0") | |
| 1008 | PORT_DIPNAME( 0xe0, 0x00, "Bonus Coins" ) PORT_DIPLOCATION("6/7A:!3,!2,!1") | |
| 1232 | 1009 | PORT_DIPSETTING( 0x00, DEF_STR( None ) ) |
| 1233 | PORT_DIPSETTING( 0xc0, "1 each 6" ) | |
| 1234 | PORT_DIPSETTING( 0xa0, "1 each 5" ) | |
| 1235 | PORT_DIPSETTING( 0x80, "1 each 4" ) | |
| 1236 | PORT_DIPSETTING( 0x60, "1 each 3" ) | |
| 1237 | PORT_DIPSETTING( 0x40, "1 each 2" ) | |
| 1238 | PORT_DIPSETTING( 0x20, "1 each 1" ) | |
| 1010 | PORT_DIPSETTING( 0xc0, "1 Each 6" ) /* Not documented */ | |
| 1011 | PORT_DIPSETTING( 0xa0, "1 Each 5" ) | |
| 1012 | PORT_DIPSETTING( 0x80, "1 Each 4" ) | |
| 1013 | PORT_DIPSETTING( 0x60, "1 Each 3" ) | |
| 1014 | PORT_DIPSETTING( 0x40, "1 Each 2" ) | |
| 1015 | PORT_DIPSETTING( 0x20, "1 Each 1" ) | |
| 1239 | 1016 | PORT_DIPSETTING( 0xe0, DEF_STR( Free_Play ) ) |
| 1240 | 1017 | |
| 1241 | PORT_START_TAG("DSW1") | |
| 1242 | PORT_DIPNAME( 0x01, 0x01, "Attract Lights" ) | |
| 1018 | PORT_MODIFY("DSW1") | |
| 1019 | PORT_DIPNAME( 0x01, 0x00, "Attract Lights" ) PORT_DIPLOCATION("5/6A:!8") /* Listed As Unused. */ | |
| 1243 | 1020 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1244 | 1021 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1245 | PORT_DIPNAME( 0x06, 0x0 | |
| 1022 | PORT_DIPNAME( 0x06, 0x00, "Max Continues" ) PORT_DIPLOCATION("5/6A:!7,!6") | |
| 1246 | 1023 | PORT_DIPSETTING( 0x02, "3" ) |
| 1247 | 1024 | PORT_DIPSETTING( 0x04, "10" ) |
| 1248 | 1025 | PORT_DIPSETTING( 0x00, "25" ) |
| 1249 | 1026 | PORT_DIPSETTING( 0x06, "199" ) |
| 1250 | PORT_DIPNAME( 0x38, 0x38, DEF_STR( Difficulty ) ) | |
| 1251 | PORT_DIPSETTING( 0x38, "1 (Easy)" ) | |
| 1252 | PORT_DIPSETTING( 0x30, "2" ) | |
| 1253 | PORT_DIPSETTING( 0x28, "3" ) | |
| 1254 | PORT_DIPSETTING( 0x00, "4" ) | |
| 1255 | PORT_DIPSETTING( 0x20, "5" ) | |
| 1256 | PORT_DIPSETTING( 0x10, "6" ) | |
| 1257 | PORT_DIPSETTING( 0x08, "7" ) | |
| 1258 | PORT_DIPSETTING( 0x18, "8 (Hard)" ) | |
| 1259 | PORT_DIPNAME( 0xc0, 0x40, "Coins Required" ) | |
| 1260 | PORT_DIPSETTING( 0x80, "3 to Start, 2 to Continue" ) | |
| 1261 | PORT_DIPSETTING( 0xc0, "3 to Start, 1 to Continue" ) | |
| 1262 | PORT_DIPSETTING( 0x00, "2 to Start, 1 to Continue" ) | |
| 1263 | PORT_DIPSETTING( 0x40, "1 to Start, 1 to Continue" ) | |
| 1027 | PORT_DIPNAME( 0x38, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("5/6A:!5,!4,!3") /* No. Of Demerits Allowed Bonus Inc. Every x Pts Perfect Day Bonus */ | |
| 1028 | PORT_DIPSETTING( 0x38, DEF_STR( Easiest ) ) /* 11 5000 Yes */ | |
| 1029 | PORT_DIPSETTING( 0x30, DEF_STR( Very_Easy ) ) /* 10 6000 Yes */ | |
| 1030 | PORT_DIPSETTING( 0x28, DEF_STR( Easy ) ) /* 9 8000 Yes */ | |
| 1031 | PORT_DIPSETTING( 0x00, "Medium Easy" ) /* 8 10000 Yes */ | |
| 1032 | PORT_DIPSETTING( 0x20, "Medium Hard" ) /* 7 11000 Yes */ | |
| 1033 | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) /* 6 13000 Yes */ | |
| 1034 | PORT_DIPSETTING( 0x08, DEF_STR( Very_Hard ) ) /* 5 15000 No */ | |
| 1035 | PORT_DIPSETTING( 0x18, DEF_STR( Hardest ) ) /* 4 18000 No */ | |
| 1036 | PORT_DIPNAME( 0xc0, 0x00, "Coins Required" ) PORT_DIPLOCATION("5/6A:!2,!1") | |
| 1037 | PORT_DIPSETTING( 0x80, "3 To Start, 2 To Continue" ) | |
| 1038 | PORT_DIPSETTING( 0xc0, "3 To Start, 1 To Continue" ) | |
| 1039 | PORT_DIPSETTING( 0x00, "2 To Start, 1 To Continue" ) | |
| 1040 | PORT_DIPSETTING( 0x40, "1 To Start, 1 To Continue" ) | |
| 1264 | 1041 | INPUT_PORTS_END |
| 1265 | 1042 | |
| 1266 | 1043 | |
| r1877 | r1878 | |
| 1353 | 1130 | MDRV_CPU_ADD_TAG("main", T11, MASTER_CLOCK/2) |
| 1354 | 1131 | MDRV_CPU_CONFIG(t11_data) |
| 1355 | 1132 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 1356 | MDRV_CPU_VBLANK_INT(vblank_int | |
| 1133 | MDRV_CPU_VBLANK_INT("main", vblank_int | |
| 1357 | 1134 | |
| 1358 | 1135 | MDRV_CPU_ADD_TAG("sound", M6502, SOUND_CLOCK/8) |
| 1359 | 1136 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 7 | 7 | *****************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "deprecat.h" | |
| 10 | 11 | #include "sound/dac.h" |
| 11 | 12 | #include "sound/ay8910.h" |
| 12 | 13 | |
| r1877 | r1878 | |
| 308 | 309 | MDRV_CPU_ADD(Z80, MCLK/2) /* 6.000 MHz */ |
| 309 | 310 | MDRV_CPU_PROGRAM_MAP(mjsister_readmem,mjsister_writemem) |
| 310 | 311 | MDRV_CPU_IO_MAP(mjsister_readport,mjsister_writeport) |
| 311 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 312 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 312 | 313 | |
| 313 | 314 | MDRV_MACHINE_RESET(mjsister) |
| 314 | 315 |
| r1877 | r1878 | |
|---|---|---|
| 925 | 925 | /* basic machine hardware */ |
| 926 | 926 | MDRV_CPU_ADD_TAG("main", Z80, MAIN_CLOCK_12/2) /* verified */ |
| 927 | 927 | MDRV_CPU_PROGRAM_MAP(ninjakd2_main_cpu,0) |
| 928 | MDRV_CPU_VBLANK_INT(ninjakd2_interrupt | |
| 928 | MDRV_CPU_VBLANK_INT("main", ninjakd2_interrupt | |
| 929 | 929 | |
| 930 | 930 | MDRV_CPU_ADD_TAG("sound", Z80, MAIN_CLOCK_5) /* verified */ |
| 931 | 931 | MDRV_CPU_PROGRAM_MAP(ninjakd2_sound_cpu,0) |
| r1877 | r1878 | |
|---|---|---|
| 87 | 87 | ***************************************************************************/ |
| 88 | 88 | |
| 89 | 89 | #include "driver.h" |
| 90 | #include "deprecat.h" | |
| 90 | 91 | #include "skydiver.h" |
| 91 | 92 | #include "sound/discrete.h" |
| 92 | 93 | |
| r1877 | r1878 | |
| 144 | 145 | static INTERRUPT_GEN( skydiver_interrupt ) |
| 145 | 146 | { |
| 146 | 147 | /* Convert range data to divide value and write to sound */ |
| 147 | discrete_sound_w(SKYDIVER_RANGE_DATA, (0x01 << (~skydiver_videoram[0x394] & 0x07)) & 0xff); // Range 0-2 | |
| 148 | discrete_sound_w(machine, SKYDIVER_RANGE_DATA, (0x01 << (~skydiver_videoram[0x394] & 0x07)) & 0xff); // Range 0-2 | |
| 148 | 149 | |
| 149 | discrete_sound_w(SKYDIVER_RANGE3_EN, skydiver_videoram[0x394] & 0x08); // Range 3 - note disable | |
| 150 | discrete_sound_w(SKYDIVER_NOTE_DATA, ~skydiver_videoram[0x395] & 0xff); // Note - freq | |
| 151 | discrete_sound_w(SKYDIVER_NOISE_DATA, skydiver_videoram[0x396] & 0x0f); // NAM - Noise Amplitude | |
| 150 | discrete_sound_w(machine, SKYDIVER_RANGE3_EN, skydiver_videoram[0x394] & 0x08); // Range 3 - note disable | |
| 151 | discrete_sound_w(machine, SKYDIVER_NOTE_DATA, ~skydiver_videoram[0x395] & 0xff); // Note - freq | |
| 152 | discrete_sound_w(machine, SKYDIVER_NOISE_DATA, skydiver_videoram[0x396] & 0x0f); // NAM - Noise Amplitude | |
| 152 | 153 | |
| 153 | 154 | if (skydiver_nmion) |
| 154 | 155 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); |
| r1877 | r1878 | |
| 164 | 165 | |
| 165 | 166 | static WRITE8_HANDLER( skydiver_sound_enable_w ) |
| 166 | 167 | { |
| 167 | discrete_sound_w(SKYDIVER_SOUND_EN, offset); | |
| 168 | discrete_sound_w(machine, SKYDIVER_SOUND_EN, offset); | |
| 168 | 169 | } |
| 169 | 170 | |
| 170 | 171 | static WRITE8_HANDLER( skydiver_whistle_w ) |
| 171 | 172 | { |
| 172 | discrete_sound_w(SKYDIVER_WHISTLE1_EN + (offset >> 1), offset & 0x01); | |
| 173 | discrete_sound_w(machine, SKYDIVER_WHISTLE1_EN + (offset >> 1), offset & 0x01); | |
| 173 | 174 | } |
| 174 | 175 | |
| 175 | 176 | |
| r1877 | r1878 | |
| 370 | 371 | /* basic machine hardware */ |
| 371 | 372 | MDRV_CPU_ADD(M6800,3000000/4) /* ???? */ |
| 372 | 373 | MDRV_CPU_PROGRAM_MAP(skydiver_map, 0) |
| 373 | MDRV_CPU_VBLANK_INT(skydiver_interrupt, 5) | |
| 374 | MDRV_CPU_VBLANK_INT_HACK(skydiver_interrupt, 5) | |
| 374 | 375 | MDRV_WATCHDOG_VBLANK_INIT(8) // 128V clocks the same as VBLANK |
| 375 | 376 | |
| 376 | 377 | MDRV_MACHINE_RESET(skydiver) |
| r1877 | r1878 | |
|---|---|---|
| 60 | 60 | |
| 61 | 61 | yunsung8_videoram_0 = RAM + 0x0000; // Ram is banked |
| 62 | 62 | yunsung8_videoram_1 = RAM + 0x2000; |
| 63 | yunsung8_videobank_w(0,0); | |
| 63 | yunsung8_videobank_w(machine,0,0); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| r1877 | r1878 | |
| 77 | 77 | { |
| 78 | 78 | UINT8 *RAM = memory_region(REGION_CPU1); |
| 79 | 79 | |
| 80 | int bank = data & 7; // ROM bank | |
| 80 | int bank = data & 7; // ROM bank | |
| 81 | 81 | yunsung8_layers_ctrl = data & 0x30; // Layers enable |
| 82 | 82 | |
| 83 | 83 | if (data & ~0x37) logerror("CPU #0 - PC %04X: Bank %02X\n",activecpu_get_pc(),data); |
| r1877 | r1878 | |
| 97 | 97 | d000-dfff Tiles "" |
| 98 | 98 | */ |
| 99 | 99 | |
| 100 | static ADDRESS_MAP_START( yunsung8_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 101 | AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM ) // ROM | |
| 100 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 101 | AM_RANGE(0x0001, 0x0001) AM_WRITE(yunsung8_bankswitch_w ) // ROM Bank (again?) | |
| 102 | 102 | AM_RANGE(0x8000, 0xbfff) AM_READ(MRA8_BANK1 ) // Banked ROM |
| 103 | AM_RANGE(0xc000, 0xdfff) AM_READ(yunsung8_videoram_r ) // Video RAM (Banked) | |
| 104 | AM_RANGE(0xe000, 0xffff) AM_READ(MRA8_RAM ) // RAM | |
| 103 | AM_RANGE(0x0000, 0xbfff) AM_ROM | |
| 104 | AM_RANGE(0xc000, 0xdfff) AM_READWRITE(yunsung8_videoram_r, yunsung8_videoram_w ) // Video RAM (Banked) | |
| 105 | AM_RANGE(0xe000, 0xffff) AM_RAM | |
| 105 | 106 | ADDRESS_MAP_END |
| 106 | 107 | |
| 107 | static ADDRESS_MAP_START( yunsung8_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 108 | AM_RANGE(0x0000, 0x0000) AM_WRITE(MWA8_ROM ) // ROM | |
| 109 | AM_RANGE(0x0001, 0x0001) AM_WRITE(yunsung8_bankswitch_w ) // ROM Bank (again?) | |
| 110 | AM_RANGE(0x0002, 0xbfff) AM_WRITE(MWA8_ROM ) // ROM | |
| 111 | AM_RANGE(0xc000, 0xdfff) AM_WRITE(yunsung8_videoram_w ) // Video RAM (Banked) | |
| 112 | AM_RANGE(0xe000, 0xffff) AM_WRITE(MWA8_RAM ) // RAM | |
| 113 | ADDRESS_MAP_END | |
| 114 | 108 | |
| 115 | ||
| 116 | static ADDRESS_MAP_START( yunsung8_readport, ADDRESS_SPACE_IO, 8 ) | |
| 109 | static ADDRESS_MAP_START( port_map, ADDRESS_SPACE_IO, 8 ) | |
| 117 | 110 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 118 | AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r ) // Coins | |
| 119 | AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r ) // P1 | |
| 120 | AM_RANGE(0x02, 0x02) AM_READ(input_port_2_r ) // P2 | |
| 121 | AM_RANGE(0x03, 0x03) AM_READ(input_port_3_r ) // DSW 1 | |
| 122 | AM_RANGE(0x04, 0x04) AM_READ(input_port_4_r ) // DSW 2 | |
| 111 | AM_RANGE(0x00, 0x00) AM_READWRITE(input_port_0_r, yunsung8_videobank_w ) // read = coins . write = video RAM bank | |
| 112 | AM_RANGE(0x01, 0x01) AM_READWRITE(input_port_1_r, yunsung8_bankswitch_w ) // read = P1 . write = ROM Bank + Layers Enable | |
| 113 | AM_RANGE(0x02, 0x02) AM_READWRITE(input_port_2_r, soundlatch_w ) // read = P2 . write = To Sound CPU | |
| 114 | AM_RANGE(0x03, 0x03) AM_READ(input_port_3_r ) // DSW 1 | |
| 115 | AM_RANGE(0x04, 0x04) AM_READ(input_port_4_r ) // DSW 2 | |
| 116 | AM_RANGE(0x06, 0x06) AM_WRITE(yunsung8_flipscreen_w ) // Flip Screen | |
| 117 | AM_RANGE(0x07, 0x07) AM_WRITE(MWA8_NOP ) // ? (end of IRQ, random value) | |
| 123 | 118 | ADDRESS_MAP_END |
| 124 | 119 | |
| 125 | static ADDRESS_MAP_START( yunsung8_writeport, ADDRESS_SPACE_IO, 8 ) | |
| 126 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) | |
| 127 | AM_RANGE(0x00, 0x00) AM_WRITE(yunsung8_videobank_w ) // Video RAM Bank | |
| 128 | AM_RANGE(0x01, 0x01) AM_WRITE(yunsung8_bankswitch_w ) // ROM Bank + Layers Enable | |
| 129 | AM_RANGE(0x02, 0x02) AM_WRITE(soundlatch_w ) // To Sound CPU | |
| 130 | AM_RANGE(0x06, 0x06) AM_WRITE(yunsung8_flipscreen_w ) // Flip Screen | |
| 131 | AM_RANGE(0x07, 0x07) AM_WRITE(MWA8_NOP ) // ? (end of IRQ, random value) | |
| 132 | ADDRESS_MAP_END | |
| 133 | 120 | |
| 134 | 121 | |
| 135 | ||
| 136 | 122 | /*************************************************************************** |
| 137 | 123 | |
| 138 | 124 | |
| r1877 | r1878 | |
| 167 | 153 | |
| 168 | 154 | |
| 169 | 155 | |
| 170 | static ADDRESS_MAP_START( yunsung8_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 171 | AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM ) // ROM | |
| 172 | AM_RANGE(0x8000, 0xbfff) AM_READ(MRA8_BANK2 ) // Banked ROM | |
| 173 | AM_RANGE(0xf000, 0xf7ff) AM_READ(MRA8_RAM ) // RAM | |
| 174 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r ) // From Main CPU | |
| 175 | ADDRESS_MAP_END | |
| 176 | ||
| 177 | static ADDRESS_MAP_START( yunsung8_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 178 | AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM ) // ROM | |
| 179 | AM_RANGE(0x8000, 0xbfff) AM_WRITE(MWA8_ROM ) // Banked ROM | |
| 156 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 157 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 158 | AM_RANGE(0x8000, 0xbfff) AM_READWRITE(MRA8_BANK2,MWA8_ROM ) // Banked ROM | |
| 180 | 159 | AM_RANGE(0xe000, 0xe000) AM_WRITE(yunsung8_sound_bankswitch_w ) // ROM Bank |
| 181 | 160 | AM_RANGE(0xe400, 0xe400) AM_WRITE(yunsung8_adpcm_w ) |
| 182 | 161 | AM_RANGE(0xec00, 0xec00) AM_WRITE(YM3812_control_port_0_w ) // YM3812 |
| 183 | 162 | AM_RANGE(0xec01, 0xec01) AM_WRITE(YM3812_write_port_0_w ) |
| 184 | AM_RANGE(0xf000, 0xf7ff) AM_WRITE(MWA8_RAM ) // RAM | |
| 163 | AM_RANGE(0xf000, 0xf7ff) AM_RAM | |
| 164 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r ) // From Main CPU | |
| 185 | 165 | ADDRESS_MAP_END |
| 186 | 166 | |
| 187 | 167 | |
| r1877 | r1878 | |
| 528 | 508 | |
| 529 | 509 | /* basic machine hardware */ |
| 530 | 510 | MDRV_CPU_ADD(Z80, 8000000) /* Z80B */ |
| 531 | MDRV_CPU_PROGRAM_MAP(yunsung8_readmem,yunsung8_writemem) | |
| 532 | MDRV_CPU_IO_MAP(yunsung8_readport,yunsung8_writeport) | |
| 533 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) /* No nmi routine */ | |
| 511 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 512 | MDRV_CPU_IO_MAP(port_map,0) | |
| 513 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) /* No nmi routine */ | |
| 534 | 514 | |
| 535 | 515 | MDRV_CPU_ADD(Z80, 4000000) /* ? */ |
| 536 | 516 | /* audio CPU */ |
| 537 | MDRV_CPU_PROGRAM_MAP(yunsung8_sound_readmem,yunsung8_sound_writemem) | |
| 538 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) /* NMI caused by the MSM5205? */ | |
| 517 | MDRV_CPU_PROGRAM_MAP(sound_map,0) | |
| 518 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) /* NMI caused by the MSM5205? */ | |
| 539 | 519 | |
| 540 | 520 | MDRV_MACHINE_RESET(yunsung8) |
| 541 | 521 |
| r1877 | r1878 | |
|---|---|---|
| 390 | 390 | MDRV_CPU_ADD_TAG("main", Z80, MASTER_CLOCK/6) |
| 391 | 391 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 392 | 392 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 393 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 393 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 394 | 394 | |
| 395 | 395 | /* video hardware */ |
| 396 | 396 | MDRV_GFXDECODE(m52) |
| r1877 | r1878 | |
|---|---|---|
| 208 | 208 | static MACHINE_RESET( spacefb ) |
| 209 | 209 | { |
| 210 | 210 | /* the 3 output ports are cleared on reset */ |
| 211 | spacefb_port_0_w(0, 0); | |
| 212 | spacefb_port_1_w(0, 0); | |
| 213 | spacefb_port_2_w(0, 0); | |
| 211 | spacefb_port_0_w(machine, 0, 0); | |
| 212 | spacefb_port_1_w(machine, 0, 0); | |
| 213 | spacefb_port_2_w(machine, 0, 0); | |
| 214 | 214 | |
| 215 | 215 | start_interrupt_timer(); |
| 216 | 216 | } |
| r1877 | r1878 | |
|---|---|---|
| 176 | 176 | /* n.c. */ |
| 177 | 177 | break; |
| 178 | 178 | case 3: |
| 179 | geebee_sound_w(0,data); | |
| 179 | geebee_sound_w(machine,0,data); | |
| 180 | 180 | break; |
| 181 | 181 | } |
| 182 | 182 | } |
| r1877 | r1878 | |
| 255 | 255 | warpwarp_ball_v = data; |
| 256 | 256 | break; |
| 257 | 257 | case 2: |
| 258 | warpwarp_sound_w(0,data); | |
| 258 | warpwarp_sound_w(machine,0,data); | |
| 259 | 259 | break; |
| 260 | 260 | case 3: |
| 261 | watchdog_reset_w(0,data); | |
| 261 | watchdog_reset_w(machine,0,data); | |
| 262 | 262 | break; |
| 263 | 263 | } |
| 264 | 264 | } |
| r1877 | r1878 | |
| 837 | 837 | MDRV_CPU_ADD_TAG("main", 8080,XTAL_18_432MHz/9) /* verified on pcb */ |
| 838 | 838 | MDRV_CPU_PROGRAM_MAP(readmem_geebee,writemem_geebee) |
| 839 | 839 | MDRV_CPU_IO_MAP(readport_geebee,writeport_geebee) |
| 840 | MDRV_CPU_VBLANK_INT(irq0_line_pulse | |
| 840 | MDRV_CPU_VBLANK_INT("main", irq0_line_pulse | |
| 841 | 841 | |
| 842 | 842 | /* video hardware */ |
| 843 | 843 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 880 | 880 | /* basic machine hardware */ |
| 881 | 881 | MDRV_CPU_ADD_TAG("main", 8080,18432000/9) /* 18.432 MHz / 9 */ |
| 882 | 882 | MDRV_CPU_PROGRAM_MAP(readmem_bombbee,writemem_bombbee) |
| 883 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 883 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 884 | 884 | |
| 885 | 885 | /* video hardware */ |
| 886 | 886 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 45 | 45 | */ |
| 46 | 46 | |
| 47 | 47 | #include "driver.h" |
| 48 | #include "memconv.h" | |
| 48 | 49 | #include "sound/custom.h" |
| 49 | 50 | #include "includes/amiga.h" |
| 50 | 51 | #include "includes/cubocd32.h" |
| 51 | 52 | |
| 52 | //READWRITE16BETO32BE(amiga_cia32,amiga_cia_r,amiga_cia_w) | |
| 53 | //READWRITE16BETO32BE(amiga_custom32,amiga_custom_r,amiga_custom_w) | |
| 54 | ||
| 55 | 53 | static READ32_HANDLER( amiga_cia32_r ) |
| 56 | 54 | { |
| 57 | UINT32 result = 0; | |
| 58 | if ((mem_mask & 0xffff0000) != 0xffff0000) | |
| 59 | result |= amiga_cia_r(offset * 2 + 0, mem_mask >> 16) << 16; | |
| 60 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) | |
| 61 | result |= amiga_cia_r(offset * 2 + 1, mem_mask) << 0; | |
| 62 | return result; | |
| 55 | return read32be_with_16be_handler(amiga_cia_r, machine, offset, mem_mask); | |
| 63 | 56 | } |
| 64 | 57 | |
| 65 | 58 | static WRITE32_HANDLER( amiga_cia32_w ) |
| 66 | 59 | { |
| 67 | if ((mem_mask & 0xffff0000) != 0xffff0000) | |
| 68 | amiga_cia_w( offset * 2 + 0, data >> 16, mem_mask >> 16); | |
| 69 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) | |
| 70 | amiga_cia_w( offset * 2 + 1, data, mem_mask); | |
| 60 | write32be_with_16be_handler(amiga_cia_w, machine, offset, data, mem_mask); | |
| 71 | 61 | } |
| 72 | 62 | |
| 73 | 63 | static READ32_HANDLER( amiga_custom32_r ) |
| 74 | 64 | { |
| 75 | UINT32 result = 0; | |
| 76 | if ((mem_mask & 0xffff0000) != 0xffff0000) | |
| 77 | result |= amiga_custom_r(offset * 2 + 0, mem_mask >> 16) << 16; | |
| 78 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) | |
| 79 | result |= amiga_custom_r(offset * 2 + 1, mem_mask) << 0; | |
| 80 | return result; | |
| 65 | return read32be_with_16be_handler(amiga_custom_r, machine, offset, mem_mask); | |
| 81 | 66 | } |
| 82 | 67 | |
| 83 | 68 | static WRITE32_HANDLER( amiga_custom32_w ) |
| 84 | 69 | { |
| 85 | if ((mem_mask & 0xffff0000) != 0xffff0000) | |
| 86 | amiga_custom_w( offset * 2 + 0, data >> 16, mem_mask >> 16); | |
| 87 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) | |
| 88 | amiga_custom_w( offset * 2 + 1, data, mem_mask); | |
| 70 | write32be_with_16be_handler(amiga_custom_w, machine, offset, data, mem_mask); | |
| 89 | 71 | } |
| 90 | 72 | |
| 91 | 73 | static WRITE32_HANDLER( aga_overlay_w ) |
| r1877 | r1878 | |
| 267 | 249 | /* basic machine hardware */ |
| 268 | 250 | MDRV_CPU_ADD(M68EC020, AMIGA_68EC020_PAL_CLOCK) /* 14.3 Mhz */ |
| 269 | 251 | MDRV_CPU_PROGRAM_MAP(cd32_map,0) |
| 270 | MDRV_CPU_VBLANK_INT(amiga_scanline_callback, 312) | |
| 271 | 252 | |
| 272 | 253 | MDRV_MACHINE_RESET(amiga) |
| 273 | 254 | MDRV_NVRAM_HANDLER(cd32) |
| r1877 | r1878 | |
| 286 | 267 | MDRV_PALETTE_INIT(amiga) |
| 287 | 268 | |
| 288 | 269 | MDRV_VIDEO_START(amiga) |
| 289 | MDRV_VIDEO_UPDATE( | |
| 270 | MDRV_VIDEO_UPDATE(a | |
| 290 | 271 | |
| 291 | 272 | /* sound hardware */ |
| 292 | 273 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| r1877 | r1878 | |
|---|---|---|
| 75 | 75 | |
| 76 | 76 | static UINT16 *wheelfir_myram; |
| 77 | 77 | static UINT16 wheelfir_blitdata[16]; |
| 78 | static | |
| 78 | static | |
| 79 | 79 | |
| 80 | 80 | /* |
| 81 | 81 | |
| r1877 | r1878 | |
| 150 | 150 | |
| 151 | 151 | /* it draws the background and road with direct writes to port 6... but where does this really go? an extra blit source page? */ |
| 152 | 152 | static int wheelfir_six_pos = 0; |
| 153 | static | |
| 153 | static | |
| 154 | 154 | |
| 155 | 155 | static WRITE16_HANDLER(wheelfir_blit_w) |
| 156 | 156 | { |
| r1877 | r1878 | |
| 631 | 631 | static MACHINE_DRIVER_START( wheelfir ) |
| 632 | 632 | MDRV_CPU_ADD_TAG("main", M68000, 32000000) |
| 633 | 633 | MDRV_CPU_PROGRAM_MAP(wheelfir_main, 0) |
| 634 | MDRV_CPU_VBLANK_INT(wheelfir_irq,256) // 1,3,5 valid | |
| 634 | MDRV_CPU_VBLANK_INT_HACK(wheelfir_irq,256) // 1,3,5 valid | |
| 635 | 635 | |
| 636 | 636 | MDRV_CPU_ADD_TAG("main", M68000, 32000000/2) |
| 637 | 637 | MDRV_CPU_PROGRAM_MAP(wheelfir_sub, 0) |
| 638 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 638 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 639 | 639 | |
| 640 | 640 | MDRV_MACHINE_RESET (wheelfir) |
| 641 | 641 |
| r1877 | r1878 | |
|---|---|---|
| 82 | 82 | static MACHINE_DRIVER_START( steaser ) |
| 83 | 83 | MDRV_CPU_ADD_TAG("main", M68000, 11059200 ) |
| 84 | 84 | MDRV_CPU_PROGRAM_MAP(steaser_map,0) |
| 85 | // MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 85 | // MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 86 | 86 | |
| 87 | 87 | MDRV_GFXDECODE(steaser) |
| 88 | 88 |
| r1877 | r1878 | |
|---|---|---|
| 38 | 38 | { |
| 39 | 39 | switch (offset<<1) { |
| 40 | 40 | case 0: /* DMA flag */ |
| 41 | buffer_spriteram16_w(0,0,0); | |
| 41 | buffer_spriteram16_w(machine,0,0,0); | |
| 42 | 42 | return; |
| 43 | 43 | |
| 44 | 44 | case 6: /* IRQ ack */ |
| 45 | 45 | return; |
| 46 | 46 | |
| 47 | 47 | case 2: /* Sound CPU write */ |
| 48 | soundlatch_w(0,data & 0xff); | |
| 49 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 48 | soundlatch_w(machine,0,data & 0xff); | |
| 49 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 50 | 50 | return; |
| 51 | 51 | |
| 52 | 52 | case 4: /* Protection, maybe this is a PAL on the board? |
| r1877 | r1878 | |
| 158 | 158 | { |
| 159 | 159 | switch (offset) { |
| 160 | 160 | case 0: |
| 161 | YM2151_register_port_0_w(0,data); | |
| 161 | YM2151_register_port_0_w(machine,0,data); | |
| 162 | 162 | break; |
| 163 | 163 | case 1: |
| 164 | YM2151_data_port_0_w(0,data); | |
| 164 | YM2151_data_port_0_w(machine,0,data); | |
| 165 | 165 | break; |
| 166 | 166 | } |
| 167 | 167 | } |
| r1877 | r1878 | |
| 170 | 170 | { |
| 171 | 171 | switch (offset) { |
| 172 | 172 | case 0: |
| 173 | YM2203_control_port_0_w(0,data); | |
| 173 | YM2203_control_port_0_w(machine,0,data); | |
| 174 | 174 | break; |
| 175 | 175 | case 1: |
| 176 | YM2203_write_port_0_w(0,data); | |
| 176 | YM2203_write_port_0_w(machine,0,data); | |
| 177 | 177 | break; |
| 178 | 178 | } |
| 179 | 179 | } |
| r1877 | r1878 | |
| 346 | 346 | /* basic machine hardware */ |
| 347 | 347 | MDRV_CPU_ADD(M68000, 12000000) /* Custom chip 59 */ |
| 348 | 348 | MDRV_CPU_PROGRAM_MAP(twocrude_readmem,twocrude_writemem) |
| 349 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 349 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 350 | 350 | |
| 351 | 351 | MDRV_CPU_ADD(H6280,32220000/4) /* Custom chip 45, Audio section crystal is 32.220 MHz */ |
| 352 | 352 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 484 | 484 | /* basic machine hardware */ |
| 485 | 485 | MDRV_CPU_ADD(ARM7, 24000000) |
| 486 | 486 | MDRV_CPU_PROGRAM_MAP(bballoon_map,0) |
| 487 | MDRV_CPU_VBLANK_INT(bballoon_interrupt | |
| 487 | MDRV_CPU_VBLANK_INT("main", bballoon_interrupt | |
| 488 | 488 | |
| 489 | 489 | |
| 490 | 490 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 346 | 346 | static READ8_HANDLER( dunhuang_service_r ) |
| 347 | 347 | { |
| 348 | 348 | return readinputport(5) |
| 349 | | ((dunhuang_hopper && !( | |
| 349 | | ((dunhuang_hopper && !(vid | |
| 350 | 350 | | 0x80 // bit 7 low -> tiles block transferrer busy |
| 351 | 351 | ; |
| 352 | 352 | } |
| r1877 | r1878 | |
| 676 | 676 | MDRV_CPU_ADD(Z80,12000000/2) |
| 677 | 677 | MDRV_CPU_PROGRAM_MAP(dunhuang_map,0) |
| 678 | 678 | MDRV_CPU_IO_MAP(dunhuang_io_map,0) |
| 679 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 679 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 680 | 680 | |
| 681 | 681 | MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_SEC(5)) |
| 682 | 682 |
| r1877 | r1878 | |
|---|---|---|
| 21 | 21 | ***************************************************************************/ |
| 22 | 22 | |
| 23 | 23 | #include "driver.h" |
| 24 | #include "deprecat.h" | |
| 24 | 25 | #include "cpu/m6809/m6809.h" |
| 25 | 26 | #include "sound/2203intf.h" |
| 26 | 27 | |
| r1877 | r1878 | |
| 341 | 342 | /* basic machine hardware */ |
| 342 | 343 | MDRV_CPU_ADD(M6809, 1500000) /* 1.5 MHz ? */ |
| 343 | 344 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 344 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 345 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 345 | 346 | |
| 346 | 347 | MDRV_CPU_ADD(Z80, 3000000) |
| 347 | 348 | /* audio CPU */ |
| 348 | 349 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 349 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 350 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 350 | 351 | |
| 351 | 352 | MDRV_MACHINE_START(gng) |
| 352 | 353 |
| r1877 | r1878 | |
|---|---|---|
| 68 | 68 | |
| 69 | 69 | static WRITE8_HANDLER( onetwo_coin_counters_w ) |
| 70 | 70 | { |
| 71 | watchdog_reset | |
| 71 | watchdog_reset | |
| 72 | 72 | coin_counter_w(0, data & 0x02); |
| 73 | 73 | coin_counter_w(1, data & 0x04); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | static WRITE8_HANDLER( onetwo_soundlatch_w ) |
| 77 | 77 | { |
| 78 | soundlatch_w(0, data); | |
| 79 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 78 | soundlatch_w(machine, 0, data); | |
| 79 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | static void setColor(int offset) |
| r1877 | r1878 | |
| 137 | 137 | ADDRESS_MAP_END |
| 138 | 138 | |
| 139 | 139 | static INPUT_PORTS_START( onetwo ) |
| 140 | PORT_START | |
| 141 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 142 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 143 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 144 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 145 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 146 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 147 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 148 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 149 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 150 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 151 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 152 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 153 | PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) | |
| 140 | PORT_START_TAG("DSW1") | |
| 141 | PORT_DIPNAME( 0x03, 0x03, "Timer" ) PORT_DIPLOCATION("SW1:1,2") | |
| 142 | PORT_DIPSETTING( 0x03, DEF_STR( Easy ) ) | |
| 143 | PORT_DIPSETTING( 0x02, DEF_STR( Normal ) ) | |
| 144 | PORT_DIPSETTING( 0x01, DEF_STR( Hard ) ) | |
| 145 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) | |
| 146 | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") | |
| 147 | PORT_DIPSETTING( 0x0c, DEF_STR( Easy ) ) | |
| 148 | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) | |
| 149 | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) | |
| 150 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) | |
| 151 | PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2",0x04,PORTCOND_EQUALS,0x04) PORT_DIPLOCATION("SW1:5,6,7,8") | |
| 154 | 152 | PORT_DIPSETTING( 0xa0, DEF_STR( 6C_1C ) ) |
| 155 | 153 | PORT_DIPSETTING( 0xb0, DEF_STR( 5C_1C ) ) |
| 156 | 154 | PORT_DIPSETTING( 0xc0, DEF_STR( 4C_1C ) ) |
| r1877 | r1878 | |
| 167 | 165 | PORT_DIPSETTING( 0x60, DEF_STR( 1C_5C ) ) |
| 168 | 166 | PORT_DIPSETTING( 0x50, DEF_STR( 1C_6C ) ) |
| 169 | 167 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) |
| 168 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2",0x04,PORTCOND_NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:5,6") | |
| 169 | PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) | |
| 170 | PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) | |
| 171 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) | |
| 172 | PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) | |
| 173 | PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2",0x04,PORTCOND_NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:7,8") | |
| 174 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) | |
| 175 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) | |
| 176 | PORT_DIPSETTING( 0x40, DEF_STR( 1C_5C ) ) | |
| 177 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) | |
| 170 | 178 | |
| 171 | PORT_START | |
| 172 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 179 | PORT_START_TAG("DSW2") | |
| 180 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown) ) PORT_DIPLOCATION("SW2:1") /* Flip Sreen? */ | |
| 173 | 181 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 174 | 182 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 175 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 183 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2") | |
| 176 | 184 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 177 | 185 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 178 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 179 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 180 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 181 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 182 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 183 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 184 | PORT_DIPNAME( 0x10, 0x10, "Allow Stage Selection" ) | |
| 186 | PORT_DIPNAME( 0x04, 0x04, "Coin Chute" ) PORT_DIPLOCATION("SW2:3") | |
| 187 | PORT_DIPSETTING( 0x04, "Common" ) | |
| 188 | PORT_DIPSETTING( 0x00, "Separate" ) | |
| 189 | PORT_DIPNAME( 0x08, 0x08, "Nude Pictures" ) PORT_DIPLOCATION("SW2:4") | |
| 190 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 191 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) | |
| 192 | PORT_DIPNAME( 0x10, 0x10, "Women Select" ) PORT_DIPLOCATION("SW2:5") | |
| 185 | 193 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 186 | 194 | PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) |
| 187 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 195 | /* In stop mode, press 2 to stop and 1 to restart */ | |
| 196 | PORT_DIPNAME( 0x20, 0x20, "Stop Mode (Cheat)") PORT_DIPLOCATION("SW2:6") | |
| 188 | 197 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 189 | 198 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 190 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 191 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 192 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 193 | PORT_DIPNAME( 0x80, 0x00, "Freeze" ) | |
| 199 | PORT_DIPNAME( 0x40, 0x40, "Play Mode" ) PORT_DIPLOCATION("SW2:7") | |
| 200 | PORT_DIPSETTING( 0x00, "1 Player" ) | |
| 201 | PORT_DIPSETTING( 0x40, "2 Player" ) | |
| 202 | PORT_DIPNAME( 0x80, 0x00, "Freeze" ) PORT_DIPLOCATION("SW2:8") | |
| 194 | 203 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 195 | 204 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 196 | 205 | |
| 197 | PORT_START | |
| 206 | PORT_START_TAG("IN0") | |
| 198 | 207 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) |
| 199 | 208 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) |
| 200 | 209 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) |
| r1877 | r1878 | |
| 204 | 213 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 205 | 214 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 206 | 215 | |
| 207 | PORT_START | |
| 216 | PORT_START_TAG("IN1") | |
| 208 | 217 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) |
| 209 | 218 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) |
| 210 | 219 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) |
| r1877 | r1878 | |
| 214 | 223 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 215 | 224 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 216 | 225 | |
| 217 | PORT_START | |
| 226 | PORT_START_TAG("COIN") | |
| 218 | 227 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 219 | 228 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 220 | 229 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) |
| r1877 | r1878 | |
| 266 | 275 | MDRV_CPU_ADD(Z80,4000000) /* 4 MHz */ |
| 267 | 276 | MDRV_CPU_PROGRAM_MAP(main_cpu,0) |
| 268 | 277 | MDRV_CPU_IO_MAP(main_cpu_io,0) |
| 269 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 278 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 270 | 279 | |
| 271 | 280 | MDRV_CPU_ADD(Z80,4000000) /* 4 MHz */ |
| 272 | 281 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 55 | 55 | VIDEO_START( ojankoc ); |
| 56 | 56 | WRITE8_HANDLER( ojankoc_palette_w ); |
| 57 | 57 | WRITE8_HANDLER( ojankoc_videoram_w ); |
| 58 | void ojankoc_flipscreen(int data); | |
| 58 | void ojankoc_flipscreen(running_machine *machine, int data); | |
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | static int ojankohs_portselect; |
| r1877 | r1878 | |
| 133 | 133 | |
| 134 | 134 | ojankohs_adpcm_reset = ((data & 0x10) >> 4); |
| 135 | 135 | MSM5205_reset_w(0, (!(data & 0x10) >> 4)); |
| 136 | ojankoc_flipscreen(data); | |
| 136 | ojankoc_flipscreen(machine, data); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | static WRITE8_HANDLER( ojankohs_portselect_w ) |
| r1877 | r1878 | |
| 956 | 956 | MDRV_CPU_ADD(Z80,12000000/2) /* 6.00 MHz ? */ |
| 957 | 957 | MDRV_CPU_PROGRAM_MAP(readmem_ojankohs,writemem_ojankohs) |
| 958 | 958 | MDRV_CPU_IO_MAP(readport_ojankohs,writeport_ojankohs) |
| 959 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 959 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 960 | 960 | |
| 961 | 961 | MDRV_MACHINE_RESET(ojankohs) |
| 962 | 962 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r1877 | r1878 | |
| 993 | 993 | MDRV_CPU_ADD(Z80,12000000/2) /* 6.00 MHz ? */ |
| 994 | 994 | MDRV_CPU_PROGRAM_MAP(readmem_ojankoy,writemem_ojankoy) |
| 995 | 995 | MDRV_CPU_IO_MAP(readport_ojankohs,writeport_ojankoy) |
| 996 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 996 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 997 | 997 | |
| 998 | 998 | MDRV_MACHINE_RESET(ojankohs) |
| 999 | 999 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r1877 | r1878 | |
| 1031 | 1031 | MDRV_CPU_ADD(Z80,12000000/2) /* 6.00 MHz ? */ |
| 1032 | 1032 | MDRV_CPU_PROGRAM_MAP(readmem_ojankoy,writemem_ojankoy) |
| 1033 | 1033 | MDRV_CPU_IO_MAP(readport_ccasino,writeport_ccasino) |
| 1034 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1034 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1035 | 1035 | |
| 1036 | 1036 | MDRV_MACHINE_RESET(ojankohs) |
| 1037 | 1037 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r1877 | r1878 | |
| 1068 | 1068 | MDRV_CPU_ADD(Z80,8000000/2) /* 4.00 MHz */ |
| 1069 | 1069 | MDRV_CPU_PROGRAM_MAP(readmem_ojankoc,writemem_ojankoc) |
| 1070 | 1070 | MDRV_CPU_IO_MAP(readport_ojankoc,writeport_ojankoc) |
| 1071 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1071 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1072 | 1072 | |
| 1073 | 1073 | MDRV_MACHINE_RESET(ojankohs) |
| 1074 | 1074 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r1877 | r1878 | |
|---|---|---|
| 11 | 11 | ***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| 14 | #include "deprecat.h" | |
| 14 | 15 | #include "includes/n8080.h" |
| 15 | 16 | |
| 16 | 17 | static unsigned shift_data; |
| r1877 | r1878 | |
| 78 | 79 | MDRV_CPU_ADD(8080, 20160000 / 10) |
| 79 | 80 | MDRV_CPU_PROGRAM_MAP(main_cpu_map, 0) |
| 80 | 81 | MDRV_CPU_IO_MAP(main_io_map, 0) |
| 81 | MDRV_CPU_VBLANK_INT(interrupt, 2) | |
| 82 | MDRV_CPU_VBLANK_INT_HACK(interrupt, 2) | |
| 82 | 83 | |
| 83 | 84 | /* video hardware */ |
| 84 | 85 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 103 | 104 | MDRV_CPU_ADD(8080, 20160000 / 10) |
| 104 | 105 | MDRV_CPU_PROGRAM_MAP(main_cpu_map, 0) |
| 105 | 106 | MDRV_CPU_IO_MAP(main_io_map, 0) |
| 106 | MDRV_CPU_VBLANK_INT(interrupt, 2) | |
| 107 | MDRV_CPU_VBLANK_INT_HACK(interrupt, 2) | |
| 107 | 108 | |
| 108 | 109 | /* video hardware */ |
| 109 | 110 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 128 | 129 | MDRV_CPU_ADD(8080, 20160000 / 10) |
| 129 | 130 | MDRV_CPU_PROGRAM_MAP(helifire_main_cpu_map, 0) |
| 130 | 131 | MDRV_CPU_IO_MAP(main_io_map, 0) |
| 131 | MDRV_CPU_VBLANK_INT(interrupt, 2) | |
| 132 | MDRV_CPU_VBLANK_INT_HACK(interrupt, 2) | |
| 132 | 133 | |
| 133 | 134 | /* video hardware */ |
| 134 | 135 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 3028 | 3028 | MDRV_CPU_ADD_TAG("main", Z80, 20000000/4) /* 5.00 MHz ? */ |
| 3029 | 3029 | MDRV_CPU_PROGRAM_MAP(readmem_gionbana, writemem_gionbana) |
| 3030 | 3030 | MDRV_CPU_IO_MAP(readport_gionbana, writeport_gionbana) |
| 3031 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 132) // nmiclock = 60 | |
| 3032 | MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 1) | |
| 3031 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 132) // nmiclock = 60 | |
| 3032 | MDRV_CPU_VBLANK_INT("main", nb1413m3_interrupt) | |
| 3033 | 3033 | |
| 3034 | 3034 | MDRV_MACHINE_RESET(nb1413m3) |
| 3035 | 3035 | |
| r1877 | r1878 | |
| 3093 | 3093 | MDRV_IMPORT_FROM(gionbana) |
| 3094 | 3094 | MDRV_CPU_MODIFY("main") |
| 3095 | 3095 | MDRV_CPU_IO_MAP(readport_gionbana, writeport_hanamomo) |
| 3096 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 142) // ? | |
| 3096 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 142) // ? | |
| 3097 | 3097 | |
| 3098 | 3098 | MDRV_NVRAM_HANDLER(nb1413m3) |
| 3099 | 3099 | |
| r1877 | r1878 | |
| 3109 | 3109 | MDRV_IMPORT_FROM(gionbana) |
| 3110 | 3110 | MDRV_CPU_MODIFY("main") |
| 3111 | 3111 | MDRV_CPU_IO_MAP(readport_gionbana, writeport_hanamomo) |
| 3112 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 128) | |
| 3112 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 128) | |
| 3113 | 3113 | |
| 3114 | 3114 | MDRV_NVRAM_HANDLER(nb1413m3) |
| 3115 | 3115 | |
| r1877 | r1878 | |
| 3126 | 3126 | MDRV_CPU_MODIFY("main") |
| 3127 | 3127 | MDRV_CPU_PROGRAM_MAP(readmem_hanamomo, writemem_hanamomo) |
| 3128 | 3128 | MDRV_CPU_IO_MAP(readport_gionbana, writeport_hanamomo) |
| 3129 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 128) | |
| 3129 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 128) | |
| 3130 | 3130 | |
| 3131 | 3131 | /* video hardware */ |
| 3132 | 3132 | MDRV_SCREEN_MODIFY("main") |
| r1877 | r1878 | |
| 3142 | 3142 | MDRV_CPU_MODIFY("main") |
| 3143 | 3143 | MDRV_CPU_PROGRAM_MAP(readmem_gionbana, writemem_gionbana) |
| 3144 | 3144 | MDRV_CPU_IO_MAP(readport_gionbana, writeport_msjiken) |
| 3145 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 142) // nmiclock = 70 | |
| 3145 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 142) // nmiclock = 70 | |
| 3146 | 3146 | MACHINE_DRIVER_END |
| 3147 | 3147 | |
| 3148 | 3148 | |
| r1877 | r1878 | |
| 3153 | 3153 | /* basic machine hardware */ |
| 3154 | 3154 | MDRV_IMPORT_FROM(gionbana) |
| 3155 | 3155 | MDRV_CPU_MODIFY("main") |
| 3156 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 142) // nmiclock = 70 | |
| 3156 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 142) // nmiclock = 70 | |
| 3157 | 3157 | |
| 3158 | 3158 | /* video hardware */ |
| 3159 | 3159 | MDRV_VIDEO_START(nbmj8891_1layer) |
| r1877 | r1878 | |
| 3165 | 3165 | /* basic machine hardware */ |
| 3166 | 3166 | MDRV_IMPORT_FROM(telmahjn) |
| 3167 | 3167 | MDRV_CPU_MODIFY("main") |
| 3168 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 128) | |
| 3168 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 128) | |
| 3169 | 3169 | MACHINE_DRIVER_END |
| 3170 | 3170 | |
| 3171 | 3171 | |
| r1877 | r1878 | |
| 3264 | 3264 | MDRV_CPU_MODIFY("main") |
| 3265 | 3265 | MDRV_CPU_PROGRAM_MAP(readmem_scandalm, writemem_scandalm) |
| 3266 | 3266 | MDRV_CPU_IO_MAP(readport_scandalm, writeport_scandalm) |
| 3267 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 128) | |
| 3267 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 128) | |
| 3268 | 3268 | |
| 3269 | 3269 | MDRV_NVRAM_HANDLER(nb1413m3) |
| 3270 | 3270 | |
| r1877 | r1878 | |
| 3287 | 3287 | MDRV_CPU_MODIFY("main") |
| 3288 | 3288 | MDRV_CPU_PROGRAM_MAP(readmem_taiwanmb, writemem_taiwanmb) |
| 3289 | 3289 | MDRV_CPU_IO_MAP(readport_taiwanmb, writeport_taiwanmb) |
| 3290 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt | |
| 3290 | // MDRV_CPU_VBLANK_INT("main", nb1413m3_interrupt | |
| 3291 | 3291 | |
| 3292 | 3292 | MDRV_NVRAM_HANDLER(nb1413m3) |
| 3293 | 3293 |
| r1877 | r1878 | |
|---|---|---|
| 129 | 129 | |
| 130 | 130 | static WRITE8_HANDLER( wc90b_sound_command_w ) |
| 131 | 131 | { |
| 132 | soundlatch_w(offset,data); | |
| 133 | cpunum_set_input_line(Machine, 2,0,HOLD_LINE); | |
| 132 | soundlatch_w(machine,offset,data); | |
| 133 | cpunum_set_input_line(machine, 2,0,HOLD_LINE); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | static WRITE8_HANDLER( adpcm_control_w ) |
| r1877 | r1878 | |
| 393 | 393 | /* basic machine hardware */ |
| 394 | 394 | MDRV_CPU_ADD(Z80, 6000000) /* 6.0 MHz ??? */ |
| 395 | 395 | MDRV_CPU_PROGRAM_MAP(wc90b_readmem1,wc90b_writemem1) |
| 396 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 396 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 397 | 397 | |
| 398 | 398 | MDRV_CPU_ADD(Z80, 6000000) /* 6.0 MHz ??? */ |
| 399 | 399 | MDRV_CPU_PROGRAM_MAP(wc90b_readmem2,wc90b_writemem2) |
| 400 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 400 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 401 | 401 | |
| 402 | 402 | MDRV_CPU_ADD(Z80, 2510000) // based on goal92 speed measured by guru (although maybe it should be 10mhz / 4 which is close) |
| 403 | 403 | /* audio CPU */ /* 2.51 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 175 | 175 | // MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 176 | 176 | MDRV_CPU_ADD(Z80, 5500000) /* 4 MHz is too low. The game loop never finishes a frame in time. */ |
| 177 | 177 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 178 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 178 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 179 | 179 | |
| 180 | 180 | /* video hardware */ |
| 181 | 181 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) |
| r1877 | r1878 | |
|---|---|---|
| 300 | 300 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz ? */ |
| 301 | 301 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 302 | 302 | MDRV_CPU_IO_MAP(readport,writeport) |
| 303 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 303 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 304 | 304 | |
| 305 | 305 | /* video hardware */ |
| 306 | 306 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 369 | 369 | MDRV_CPU_ADD(Z80, 20000000/4) /* 5 MHz */ |
| 370 | 370 | MDRV_CPU_PROGRAM_MAP(crzrally_readmem,crzrally_writemem) |
| 371 | 371 | MDRV_CPU_IO_MAP(readport,writeport) |
| 372 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 372 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 373 | 373 | |
| 374 | 374 | /* video hardware */ |
| 375 | 375 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 15 | 15 | *******************************************************************************/ |
| 16 | 16 | |
| 17 | 17 | #include "driver.h" |
| 18 | #include "deprecat.h" | |
| 18 | 19 | #include "cpu/m6502/m6502.h" |
| 19 | 20 | #include "sound/ay8910.h" |
| 20 | 21 | |
| r1877 | r1878 | |
| 519 | 520 | MDRV_CPU_ADD_TAG("main",DECO16, 2000000) |
| 520 | 521 | MDRV_CPU_PROGRAM_MAP(liberate_readmem,liberate_writemem) |
| 521 | 522 | MDRV_CPU_IO_MAP(deco16_readport,deco16_writeport) |
| 522 | MDRV_CPU_VBLANK_INT(deco16_interrupt | |
| 523 | MDRV_CPU_VBLANK_INT("main", deco16_interrupt | |
| 523 | 524 | |
| 524 | 525 | MDRV_CPU_ADD_TAG("sound",M6502, 1500000) |
| 525 | 526 | /* audio CPU */ |
| 526 | 527 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 527 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,16) | |
| 528 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,16) | |
| 528 | 529 | |
| 529 | 530 | MDRV_INTERLEAVE(200) |
| 530 | 531 | |
| r1877 | r1878 | |
| 558 | 559 | /* basic machine hardware */ |
| 559 | 560 | MDRV_CPU_ADD(M6502, 2000000) |
| 560 | 561 | MDRV_CPU_PROGRAM_MAP(liberatb_readmem,liberatb_writemem) |
| 561 | MDRV_CPU_VBLANK_INT(deco16_interrupt | |
| 562 | MDRV_CPU_VBLANK_INT("main", deco16_interrupt | |
| 562 | 563 | |
| 563 | 564 | MDRV_IMPORT_FROM(liberate) |
| 564 | 565 | MDRV_CPU_REMOVE("main") |
| r1877 | r1878 | |
| 595 | 596 | MDRV_CPU_ADD(M6502, 1500000) |
| 596 | 597 | /* audio CPU */ |
| 597 | 598 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 598 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,16) | |
| 599 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,16) | |
| 599 | 600 | |
| 600 | 601 | MDRV_INTERLEAVE(200) |
| 601 | 602 |
| r1877 | r1878 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | static WRITE8_HANDLER( sound_command_w ) |
| 48 | 48 | { |
| 49 | soundlatch_w(offset,data); | |
| 50 | cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,HOLD_LINE); | |
| 49 | soundlatch_w(machine,offset,data); | |
| 50 | cpunum_set_input_line(machine, 1,M6809_IRQ_LINE,HOLD_LINE); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | static WRITE8_HANDLER( spd_adpcm_w ) |
| r1877 | r1878 | |
| 435 | 435 | /* basic machine hardware */ |
| 436 | 436 | MDRV_CPU_ADD(M6502,12000000/6) /* 2MHz ? */ |
| 437 | 437 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 438 | MDRV_CPU_VBLANK_INT(spdodgeb_interrupt,33) /* 1 IRQ every 8 visible scanlines, plus NMI for vblank */ | |
| 438 | MDRV_CPU_VBLANK_INT_HACK(spdodgeb_interrupt,33) /* 1 IRQ every 8 visible scanlines, plus NMI for vblank */ | |
| 439 | 439 | |
| 440 | 440 | MDRV_CPU_ADD(M6809,12000000/6) |
| 441 | 441 | /* audio CPU */ /* 2MHz ? */ |
| r1877 | r1878 | |
|---|---|---|
| 67 | 67 | ***************************************************************************/ |
| 68 | 68 | |
| 69 | 69 | #include "driver.h" |
| 70 | #include "deprecat.h" | |
| 70 | 71 | #include "sound/2203intf.h" |
| 71 | 72 | |
| 72 | 73 | extern UINT8 *gunsmoke_scrollx; |
| r1877 | r1878 | |
| 287 | 288 | // basic machine hardware |
| 288 | 289 | MDRV_CPU_ADD(Z80, 4000000) // 4 MHz |
| 289 | 290 | MDRV_CPU_PROGRAM_MAP(gunsmoke_map, 0) |
| 290 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 291 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 291 | 292 | |
| 292 | 293 | MDRV_CPU_ADD(Z80, 3000000) // 3 MHz |
| 293 | 294 | /* audio CPU */ |
| 294 | 295 | MDRV_CPU_PROGRAM_MAP(sound_map, 0) |
| 295 | MDRV_CPU_VBLANK_INT(irq0_line_hold, 4) | |
| 296 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 4) | |
| 296 | 297 | |
| 297 | 298 | // video hardware |
| 298 | 299 |
| r1877 | r1878 | |
|---|---|---|
| 129 | 129 | UINT8 *cvs_s2636_1_ram; |
| 130 | 130 | UINT8 *cvs_s2636_2_ram; |
| 131 | 131 | |
| 132 | static emu_timer *cvs_393hz_timer; | |
| 133 | static UINT8 cvs_393hz_clock; | |
| 132 | 134 | static UINT8 *cvs_4_bit_dac_data; |
| 133 | 135 | static UINT8 *cvs_tms5110_ctl_data; |
| 134 | 136 | |
| r1877 | r1878 | |
| 277 | 279 | /* the lower 4 (or 3?) bits select the port to read */ |
| 278 | 280 | switch (offset & 0x0f) /* might be 0x07 */ |
| 279 | 281 | { |
| 280 | case 0x00: ret = input_port_0_r(0); break; | |
| 281 | case 0x02: ret = input_port_1_r(0); break; | |
| 282 | case 0x03: ret = input_port_2_r(0); break; | |
| 283 | case 0x04: ret = input_port_3_r(0); break; | |
| 284 | case 0x06: ret = input_port_4_r(0); break; | |
| 285 | case 0x07: ret = input_port_5_r(0); break; | |
| 282 | case 0x00: ret = input_port_0_r(machine, 0); break; | |
| 283 | case 0x02: ret = input_port_1_r(machine, 0); break; | |
| 284 | case 0x03: ret = input_port_2_r(machine, 0); break; | |
| 285 | case 0x04: ret = input_port_3_r(machine, 0); break; | |
| 286 | case 0x06: ret = input_port_4_r(machine, 0); break; | |
| 287 | case 0x07: ret = input_port_5_r(machine, 0); break; | |
| 286 | 288 | default: logerror("%04x : CVS: Reading unmapped input port 0x%02x\n", activecpu_get_pc(), offset & 0x0f); break; |
| 287 | 289 | } |
| 288 | 290 | |
| r1877 | r1878 | |
| 299 | 301 | |
| 300 | 302 | static READ8_HANDLER( cvs_393hz_clock_r ) |
| 301 | 303 | { |
| 302 | if(cpu_scalebyfcount(6) & 1) return 0x80; | |
| 303 | else return 0; | |
| 304 | return cvs_393hz_clock ? 0x80 : 0; | |
| 304 | 305 | } |
| 305 | 306 | |
| 306 | 307 | |
| 308 | static TIMER_CALLBACK( cvs_393hz_timer_cb ) | |
| 309 | { | |
| 310 | cvs_393hz_clock = !cvs_393hz_clock; | |
| 311 | } | |
| 307 | 312 | |
| 313 | ||
| 314 | static void start_393hz_timer(void) | |
| 315 | { | |
| 316 | cvs_393hz_timer = timer_alloc(cvs_393hz_timer_cb, NULL); | |
| 317 | timer_adjust_periodic(cvs_393hz_timer, ATTOTIME_IN_HZ(2*393), 0, ATTOTIME_IN_HZ(2*393)); | |
| 318 | } | |
| 319 | ||
| 320 | ||
| 321 | ||
| 308 | 322 | /************************************* |
| 309 | 323 | * |
| 310 | 324 | * 4-bit DAC |
| r1877 | r1878 | |
| 324 | 338 | (cvs_4_bit_dac_data[3] << 3); |
| 325 | 339 | |
| 326 | 340 | /* scale up to a full byte and output */ |
| 327 | DAC_1_data_w(0, (dac_value << 4) | dac_value); | |
| 341 | DAC_1_data_w(machine, 0, (dac_value << 4) | dac_value); | |
| 328 | 342 | } |
| 329 | 343 | |
| 330 | 344 | |
| r1877 | r1878 | |
| 336 | 350 | *************************************/ |
| 337 | 351 | |
| 338 | 352 | /* temporary code begin */ |
| 339 | static void speech_execute_command(UINT8 command) | |
| 353 | static void speech_execute_command(running_machine *machine, UINT8 command) | |
| 340 | 354 | { |
| 341 | 355 | /* reset */ |
| 342 | 356 | if (command == 0x3f) |
| 343 | 357 | { |
| 344 | tms5110_CTL_w(0, TMS5110_CMD_RESET); | |
| 358 | tms5110_CTL_w(machine, 0, TMS5110_CMD_RESET); | |
| 345 | 359 | |
| 346 | tms5110_PDC_w(0,0); | |
| 347 | tms5110_PDC_w(0,1); | |
| 348 | tms5110_PDC_w(0,0); | |
| 360 | tms5110_PDC_w(machine, 0,0); | |
| 361 | tms5110_PDC_w(machine, 0,1); | |
| 362 | tms5110_PDC_w(machine, 0,0); | |
| 349 | 363 | |
| 350 | tms5110_PDC_w(0,0); | |
| 351 | tms5110_PDC_w(0,1); | |
| 352 | tms5110_PDC_w(0,0); | |
| 364 | tms5110_PDC_w(machine, 0,0); | |
| 365 | tms5110_PDC_w(machine, 0,1); | |
| 366 | tms5110_PDC_w(machine, 0,0); | |
| 353 | 367 | |
| 354 | tms5110_PDC_w(0,0); | |
| 355 | tms5110_PDC_w(0,1); | |
| 356 | tms5110_PDC_w(0,0); | |
| 368 | tms5110_PDC_w(machine, 0,0); | |
| 369 | tms5110_PDC_w(machine, 0,1); | |
| 370 | tms5110_PDC_w(machine, 0,0); | |
| 357 | 371 | |
| 358 | 372 | speech_rom_bit_address = 0; |
| 359 | 373 | } |
| 360 | 374 | /* start */ |
| 361 | 375 | else |
| 362 | 376 | { |
| 363 | tms5110_CTL_w(0, TMS5110_CMD_SPEAK); | |
| 377 | tms5110_CTL_w(machine, 0, TMS5110_CMD_SPEAK); | |
| 364 | 378 | |
| 365 | tms5110_PDC_w(0, 0); | |
| 366 | tms5110_PDC_w(0, 1); | |
| 367 | tms5110_PDC_w(0, 0); | |
| 379 | tms5110_PDC_w(machine, 0, 0); | |
| 380 | tms5110_PDC_w(machine, 0, 1); | |
| 381 | tms5110_PDC_w(machine, 0, 0); | |
| 368 | 382 | |
| 369 | 383 | speech_rom_bit_address = command * 0x80 * 8; |
| 370 | 384 | } |
| r1877 | r1878 | |
| 385 | 399 | } |
| 386 | 400 | |
| 387 | 401 | |
| 388 | static void cvs_set_speech_command_w(UINT8 data) | |
| 402 | static void cvs_set_speech_command_w(running_machine *machine, UINT8 data) | |
| 389 | 403 | { |
| 390 | soundlatch2_w(0, data & 0x7f); | |
| 404 | soundlatch2_w(machine, 0, data & 0x7f); | |
| 391 | 405 | if (~data & 0x40) LOG(("%04x : CVS: Speech Command W = %04x\n", activecpu_get_pc(), data & 0x7f)); |
| 392 | 406 | } |
| 393 | 407 | |
| r1877 | r1878 | |
| 395 | 409 | static READ8_HANDLER( cvs_speech_command_r ) |
| 396 | 410 | { |
| 397 | 411 | /* bit 7 is TMS status (active LO) */ |
| 398 | return (~tms5110_status_r(0) << 7) | soundlatch2_r(0); | |
| 412 | return (~tms5110_status_r(machine, 0) << 7) | soundlatch2_r(machine, 0); | |
| 399 | 413 | } |
| 400 | 414 | |
| 401 | 415 | |
| r1877 | r1878 | |
| 456 | 470 | /* cause interrupt on audio CPU if bit 7 set */ |
| 457 | 471 | if (data & 0x80) |
| 458 | 472 | { |
| 459 | soundlatch_w(0, data); | |
| 473 | soundlatch_w(machine, 0, data); | |
| 460 | 474 | cvs_dac_cpu_interrupt(); |
| 461 | 475 | |
| 462 | 476 | LOG(("%04x : CVS: Audio command = %02x\n", activecpu_get_pc(), data)); |
| 463 | 477 | } |
| 464 | 478 | |
| 465 | cvs_set_speech_command_w(data); | |
| 479 | cvs_set_speech_command_w(machine, data); | |
| 466 | 480 | |
| 467 | 481 | /* temporary code begin */ |
| 468 | 482 | if ((data & 0x40) == 0) |
| 469 | speech_execute_command(data & 0x03f); | |
| 483 | speech_execute_command(machine, data & 0x03f); | |
| 470 | 484 | /* temporary code end */ |
| 471 | 485 | } |
| 472 | 486 | |
| r1877 | r1878 | |
| 486 | 500 | cvs_character_ram = auto_malloc(3 * 0x800); /* only half is used, but |
| 487 | 501 | by allocating twice the amount, |
| 488 | 502 | we can use the same gfx_layout */ |
| 503 | start_393hz_timer(); | |
| 504 | ||
| 489 | 505 | /* register state save */ |
| 490 | 506 | state_save_register_global_pointer(cvs_color_ram, 0x400); |
| 491 | 507 | state_save_register_global_pointer(cvs_palette_ram, 0x10); |
| r1877 | r1878 | |
| 493 | 509 | state_save_register_global(character_banking_mode); |
| 494 | 510 | state_save_register_global(character_ram_page_start); |
| 495 | 511 | state_save_register_global(speech_rom_bit_address); |
| 512 | state_save_register_global(cvs_393hz_clock); | |
| 496 | 513 | } |
| 497 | 514 | |
| 498 | 515 | |
| r1877 | r1878 | |
| 998 | 1015 | MDRV_CPU_ADD(S2650, 894886.25) |
| 999 | 1016 | MDRV_CPU_PROGRAM_MAP(cvs_main_cpu_map,0) |
| 1000 | 1017 | MDRV_CPU_IO_MAP(cvs_main_cpu_io_map,0) |
| 1001 | MDRV_CPU_VBLANK_INT(cvs_main_cpu_interrupt | |
| 1018 | MDRV_CPU_VBLANK_INT("main", cvs_main_cpu_interrupt | |
| 1002 | 1019 | |
| 1003 | 1020 | MDRV_CPU_ADD(S2650, 894886.25) |
| 1004 | 1021 | MDRV_CPU_PROGRAM_MAP(cvs_dac_cpu_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 639 | 639 | |
| 640 | 640 | static TIMER_CALLBACK( delayed_ppi8255_w ) |
| 641 | 641 | { |
| 642 | ppi8255_0_w(param >> 8, param & 0xff); | |
| 642 | ppi8255_0_w(machine, param >> 8, param & 0xff); | |
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | |
| r1877 | r1878 | |
| 1001 | 1001 | /* basic machine hardware */ |
| 1002 | 1002 | MDRV_CPU_ADD(Z80, MASTER_CLOCK/4) |
| 1003 | 1003 | MDRV_CPU_PROGRAM_MAP(turbo_map,0) |
| 1004 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1004 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1005 | 1005 | |
| 1006 | 1006 | /* video hardware */ |
| 1007 | 1007 | MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) |
| r1877 | r1878 | |
| 1027 | 1027 | /* basic machine hardware */ |
| 1028 | 1028 | MDRV_CPU_ADD(Z80, MASTER_CLOCK/4) |
| 1029 | 1029 | MDRV_CPU_PROGRAM_MAP(subroc3d_map,0) |
| 1030 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1030 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1031 | 1031 | |
| 1032 | 1032 | /* video hardware */ |
| 1033 | 1033 | MDRV_GFXDECODE(turbo) |
| r1877 | r1878 | |
| 1052 | 1052 | /* basic machine hardware */ |
| 1053 | 1053 | MDRV_CPU_ADD(Z80, MASTER_CLOCK/4) |
| 1054 | 1054 | MDRV_CPU_PROGRAM_MAP(buckrog_map,0) |
| 1055 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1055 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1056 | 1056 | |
| 1057 | 1057 | MDRV_CPU_ADD(Z80, MASTER_CLOCK/4) |
| 1058 | 1058 | MDRV_CPU_PROGRAM_MAP(buckrog_cpu2_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 1491 | 1491 | static WRITE16_HANDLER( sub_ctrl_w ) |
| 1492 | 1492 | { |
| 1493 | 1493 | static int old_data = 0; |
| 1494 | ||
| 1495 | 1494 | switch(offset) |
| 1496 | 1495 | { |
| 1497 | 1496 | case 0/2: // bit 0: reset sub cpu? |
| r1877 | r1878 | |
| 1507 | 1506 | break; |
| 1508 | 1507 | |
| 1509 | 1508 | case 4/2: // not sure |
| 1510 | if (ACCESSING_LSB) soundlatch_w(0, data & 0xff); | |
| 1509 | if (ACCESSING_LSB) soundlatch_w(machine, 0, data & 0xff); | |
| 1511 | 1510 | break; |
| 1512 | 1511 | |
| 1513 | 1512 | case 6/2: // not sure |
| 1514 | if (ACCESSING_LSB) soundlatch2_w(0, data & 0xff); | |
| 1513 | if (ACCESSING_LSB) soundlatch2_w(machine, 0, data & 0xff); | |
| 1515 | 1514 | break; |
| 1516 | 1515 | } |
| 1517 | 1516 | |
| r1877 | r1878 | |
| 1680 | 1679 | { |
| 1681 | 1680 | if (ACCESSING_LSB) |
| 1682 | 1681 | { |
| 1683 | soundlatch_word_w(0,data,mem_mask); | |
| 1684 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1682 | soundlatch_word_w(machine,0,data,mem_mask); | |
| 1683 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 1685 | 1684 | cpu_spinuntil_time(ATTOTIME_IN_USEC(50)); // Allow the other cpu to reply |
| 1686 | 1685 | } |
| 1687 | 1686 | } |
| r1877 | r1878 | |
| 2438 | 2437 | case 1: offset = 2; break; |
| 2439 | 2438 | case 2: offset = 1; break; |
| 2440 | 2439 | } |
| 2441 | seta_vregs_w(offset,data,mem_mask); | |
| 2440 | seta_vregs_w(machine,offset,data,mem_mask); | |
| 2442 | 2441 | } |
| 2443 | 2442 | |
| 2444 | 2443 | /* Mirror RAM is necessary or startup, to clear Work RAM after the test */ |
| r1877 | r1878 | |
| 2595 | 2594 | |
| 2596 | 2595 | static READ16_HANDLER( kiwame_input_r ) |
| 2597 | 2596 | { |
| 2598 | int row_select = kiwame_nvram_r( 0x10a/2,0 ) & 0x1f; | |
| 2597 | int row_select = kiwame_nvram_r( machine,0x10a/2,0 ) & 0x1f; | |
| 2599 | 2598 | int i; |
| 2600 | 2599 | |
| 2601 | 2600 | for(i = 0; i < 5; i++) |
| r1877 | r1878 | |
| 2763 | 2762 | { |
| 2764 | 2763 | if (ACCESSING_LSB) |
| 2765 | 2764 | { |
| 2766 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 2767 | soundlatch_w(0,data & 0xff); | |
| 2765 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 2766 | soundlatch_w(machine,0,data & 0xff); | |
| 2768 | 2767 | } |
| 2769 | 2768 | } |
| 2770 | 2769 | |
| r1877 | r1878 | |
| 2817 | 2816 | |
| 2818 | 2817 | static WRITE8_HANDLER( sub_bankswitch_lockout_w ) |
| 2819 | 2818 | { |
| 2820 | sub_bankswitch_w(offset,data); | |
| 2819 | sub_bankswitch_w(machine,offset,data); | |
| 2821 | 2820 | seta_coin_lockout_w(data); |
| 2822 | 2821 | } |
| 2823 | 2822 | |
| r1877 | r1878 | |
| 2931 | 2930 | |
| 2932 | 2931 | static WRITE8_HANDLER( calibr50_soundlatch2_w ) |
| 2933 | 2932 | { |
| 2934 | soundlatch2_w(0,data); | |
| 2933 | soundlatch2_w(machine,0,data); | |
| 2935 | 2934 | cpu_spinuntil_time(ATTOTIME_IN_USEC(50)); // Allow the other cpu to reply |
| 2936 | 2935 | } |
| 2937 | 2936 | |
| r1877 | r1878 | |
| 3065 | 3064 | Crazy Fight |
| 3066 | 3065 | ***************************************************************************/ |
| 3067 | 3066 | |
| 3068 | static WRITE16_HANDLER( YM3812_control_port_0_lsb_w ) { if (ACCESSING_LSB) YM3812_control_port_0_w(0, data & 0xff); } | |
| 3069 | static WRITE16_HANDLER( YM3812_write_port_0_lsb_w ) { if (ACCESSING_LSB) YM3812_write_port_0_w(0, data & 0xff); } | |
| 3067 | static WRITE16_HANDLER( YM3812_control_port_0_lsb_w ) { if (ACCESSING_LSB) YM3812_control_port_0_w(machine, 0, data & 0xff); } | |
| 3068 | static WRITE16_HANDLER( YM3812_write_port_0_lsb_w ) { if (ACCESSING_LSB) YM3812_write_port_0_w(machine, 0, data & 0xff); } | |
| 3070 | 3069 | |
| 3071 | 3070 | static ADDRESS_MAP_START( crazyfgt_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 3072 | 3071 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| r1877 | r1878 | |
| 6686 | 6685 | /* basic machine hardware */ |
| 6687 | 6686 | MDRV_CPU_ADD(M68000, 16000000/2) /* 8 MHz */ |
| 6688 | 6687 | MDRV_CPU_PROGRAM_MAP(tndrcade_readmem,tndrcade_writemem) |
| 6689 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 6688 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 6690 | 6689 | |
| 6691 | 6690 | MDRV_CPU_ADD(M65C02, 16000000/8) /* 2 MHz */ |
| 6692 | 6691 | MDRV_CPU_PROGRAM_MAP(tndrcade_sub_readmem,tndrcade_sub_writemem) |
| 6693 | MDRV_CPU_VBLANK_INT(tndrcade_sub_interrupt,TNDRCADE_SUB_INTERRUPTS_NUM) | |
| 6692 | MDRV_CPU_VBLANK_INT_HACK(tndrcade_sub_interrupt,TNDRCADE_SUB_INTERRUPTS_NUM) | |
| 6694 | 6693 | |
| 6695 | 6694 | /* video hardware */ |
| 6696 | 6695 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 6736 | 6735 | /* basic machine hardware */ |
| 6737 | 6736 | MDRV_CPU_ADD(M68000, 16000000/2) /* 8 MHz */ |
| 6738 | 6737 | MDRV_CPU_PROGRAM_MAP(downtown_readmem,downtown_writemem) |
| 6739 | MDRV_CPU_VBLANK_INT(irq3_line_hold | |
| 6738 | MDRV_CPU_VBLANK_INT("main", irq3_line_hold | |
| 6740 | 6739 | |
| 6741 | 6740 | MDRV_CPU_ADD(M65C02, 16000000/8) /* 2 MHz */ |
| 6742 | 6741 | MDRV_CPU_PROGRAM_MAP(twineagl_sub_readmem,twineagl_sub_writemem) |
| 6743 | MDRV_CPU_VBLANK_INT(seta_sub_interrupt,SETA_SUB_INTERRUPTS_NUM) | |
| 6742 | MDRV_CPU_VBLANK_INT_HACK(seta_sub_interrupt,SETA_SUB_INTERRUPTS_NUM) | |
| 6744 | 6743 | |
| 6745 | 6744 | /* video hardware */ |
| 6746 | 6745 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 6778 | 6777 | /* basic machine hardware */ |
| 6779 | 6778 | MDRV_CPU_ADD(M68000, XTAL_16MHz/2) /* verified on pcb */ |
| 6780 | 6779 | MDRV_CPU_PROGRAM_MAP(downtown_readmem,downtown_writemem) |
| 6781 | MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 6780 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 6782 | 6781 | |
| 6783 | 6782 | MDRV_CPU_ADD(M65C02, XTAL_16MHz/8) /* verified on pcb */ |
| 6784 | 6783 | MDRV_CPU_PROGRAM_MAP(downtown_sub_readmem,downtown_sub_writemem) |
| 6785 | MDRV_CPU_VBLANK_INT(seta_sub_interrupt,SETA_SUB_INTERRUPTS_NUM) | |
| 6784 | MDRV_CPU_VBLANK_INT_HACK(seta_sub_interrupt,SETA_SUB_INTERRUPTS_NUM) | |
| 6786 | 6785 | |
| 6787 | 6786 | /* video hardware */ |
| 6788 | 6787 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 6838 | 6837 | /* basic machine hardware */ |
| 6839 | 6838 | MDRV_CPU_ADD(M68000, 16000000/2) /* 8 MHz */ |
| 6840 | 6839 | MDRV_CPU_PROGRAM_MAP(usclssic_readmem,usclssic_writemem) |
| 6841 | MDRV_CPU_VBLANK_INT(calibr50_interrupt,calibr50_INTERRUPTS_NUM) | |
| 6840 | MDRV_CPU_VBLANK_INT_HACK(calibr50_interrupt,calibr50_INTERRUPTS_NUM) | |
| 6842 | 6841 | |
| 6843 | 6842 | MDRV_CPU_ADD(M65C02, 16000000/8) /* 2 MHz */ |
| 6844 | 6843 | MDRV_CPU_PROGRAM_MAP(calibr50_sub_readmem,calibr50_sub_writemem) |
| 6845 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 6844 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 6846 | 6845 | |
| 6847 | 6846 | /* video hardware */ |
| 6848 | 6847 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 6883 | 6882 | /* basic machine hardware */ |
| 6884 | 6883 | MDRV_CPU_ADD(M68000, 16000000/2) /* 8 MHz */ |
| 6885 | 6884 | MDRV_CPU_PROGRAM_MAP(calibr50_readmem,calibr50_writemem) |
| 6886 | MDRV_CPU_VBLANK_INT(calibr50_interrupt,calibr50_INTERRUPTS_NUM) | |
| 6885 | MDRV_CPU_VBLANK_INT_HACK(calibr50_interrupt,calibr50_INTERRUPTS_NUM) | |
| 6887 | 6886 | |
| 6888 | 6887 | MDRV_CPU_ADD(M65C02, 16000000/8) /* 2 MHz */ |
| 6889 | 6888 | MDRV_CPU_PROGRAM_MAP(calibr50_sub_readmem,calibr50_sub_writemem) |
| 6890 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) /* IRQ: 4/frame | |
| 6889 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* IRQ: 4/frame | |
| 6891 | 6890 | NMI: when the 68k writes the sound latch */ |
| 6892 | 6891 | |
| 6893 | 6892 | /* video hardware */ |
| r1877 | r1878 | |
| 6925 | 6924 | /* basic machine hardware */ |
| 6926 | 6925 | MDRV_CPU_ADD(M68000, 16000000/2) /* 8 MHz */ |
| 6927 | 6926 | MDRV_CPU_PROGRAM_MAP(downtown_readmem,downtown_writemem) |
| 6928 | MDRV_CPU_VBLANK_INT(irq3_line_hold | |
| 6927 | MDRV_CPU_VBLANK_INT("main", irq3_line_hold | |
| 6929 | 6928 | |
| 6930 | 6929 | MDRV_CPU_ADD(M65C02, 16000000/8) /* 2 MHz */ |
| 6931 | 6930 | MDRV_CPU_PROGRAM_MAP(metafox_sub_readmem,metafox_sub_writemem) |
| 6932 | MDRV_CPU_VBLANK_INT(seta_sub_interrupt,SETA_SUB_INTERRUPTS_NUM) | |
| 6931 | MDRV_CPU_VBLANK_INT_HACK(seta_sub_interrupt,SETA_SUB_INTERRUPTS_NUM) | |
| 6933 | 6932 | |
| 6934 | 6933 | /* video hardware */ |
| 6935 | 6934 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 6968 | 6967 | /* basic machine hardware */ |
| 6969 | 6968 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 6970 | 6969 | MDRV_CPU_PROGRAM_MAP(atehate_readmem,atehate_writemem) |
| 6971 | MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 6970 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 6972 | 6971 | |
| 6973 | 6972 | /* video hardware */ |
| 6974 | 6973 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7010 | 7009 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7011 | 7010 | MDRV_CPU_PROGRAM_MAP(blandia_readmem,blandia_writemem) |
| 7012 | 7011 | |
| 7013 | MDRV_CPU_VBLANK_INT(seta_interrupt_2_and_4,SETA_INTERRUPTS_NUM) | |
| 7012 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_2_and_4,SETA_INTERRUPTS_NUM) | |
| 7014 | 7013 | |
| 7015 | 7014 | /* video hardware */ |
| 7016 | 7015 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7042 | 7041 | /* basic machine hardware */ |
| 7043 | 7042 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7044 | 7043 | MDRV_CPU_PROGRAM_MAP(blandiap_readmem,blandiap_writemem) |
| 7045 | MDRV_CPU_VBLANK_INT(seta_interrupt_2_and_4,SETA_INTERRUPTS_NUM) | |
| 7044 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_2_and_4,SETA_INTERRUPTS_NUM) | |
| 7046 | 7045 | |
| 7047 | 7046 | /* video hardware */ |
| 7048 | 7047 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7079 | 7078 | /* basic machine hardware */ |
| 7080 | 7079 | MDRV_CPU_ADD(M68000, 16000000/2) /* 8 MHz */ |
| 7081 | 7080 | MDRV_CPU_PROGRAM_MAP(blockcar_readmem,blockcar_writemem) |
| 7082 | MDRV_CPU_VBLANK_INT(irq3_line_hold | |
| 7081 | MDRV_CPU_VBLANK_INT("main", irq3_line_hold | |
| 7083 | 7082 | |
| 7084 | 7083 | /* video hardware */ |
| 7085 | 7084 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7114 | 7113 | /* basic machine hardware */ |
| 7115 | 7114 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7116 | 7115 | MDRV_CPU_PROGRAM_MAP(daioh_readmem,daioh_writemem) |
| 7117 | MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7116 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7118 | 7117 | |
| 7119 | 7118 | /* video hardware */ |
| 7120 | 7119 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7154 | 7153 | /* basic machine hardware */ |
| 7155 | 7154 | MDRV_CPU_ADD(M68000, 16000000/2) /* 8 MHz */ |
| 7156 | 7155 | MDRV_CPU_PROGRAM_MAP(drgnunit_readmem,drgnunit_writemem) |
| 7157 | MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7156 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7158 | 7157 | |
| 7159 | 7158 | /* video hardware */ |
| 7160 | 7159 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7188 | 7187 | /* basic machine hardware */ |
| 7189 | 7188 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7190 | 7189 | MDRV_CPU_PROGRAM_MAP(drgnunit_readmem,drgnunit_writemem) |
| 7191 | MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7190 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7192 | 7191 | |
| 7193 | 7192 | /* video hardware */ |
| 7194 | 7193 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7224 | 7223 | /* basic machine hardware */ |
| 7225 | 7224 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7226 | 7225 | MDRV_CPU_PROGRAM_MAP(wrofaero_readmem,wrofaero_writemem) |
| 7227 | MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7226 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7228 | 7227 | |
| 7229 | 7228 | /* video hardware */ |
| 7230 | 7229 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7264 | 7263 | /* basic machine hardware */ |
| 7265 | 7264 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7266 | 7265 | MDRV_CPU_PROGRAM_MAP(extdwnhl_readmem,extdwnhl_writemem) |
| 7267 | MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7266 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7268 | 7267 | |
| 7269 | 7268 | /* video hardware */ |
| 7270 | 7269 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7317 | 7316 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7318 | 7317 | MDRV_CPU_PROGRAM_MAP(wrofaero_readmem,wrofaero_writemem) |
| 7319 | 7318 | #if __uPD71054_TIMER |
| 7320 | // MDRV_CPU_VBLANK_INT( wrofaero_interrupt, 1 ) | |
| 7321 | MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7319 | // MDRV_CPU_VBLANK_INT("main", wrofaero_interrupt) | |
| 7320 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7322 | 7321 | #else |
| 7323 | MDRV_CPU_VBLANK_INT(seta_interrupt_2_and_4,SETA_INTERRUPTS_NUM) | |
| 7322 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_2_and_4,SETA_INTERRUPTS_NUM) | |
| 7324 | 7323 | #endif // __uPD71054_TIMER |
| 7325 | 7324 | |
| 7326 | 7325 | #if __uPD71054_TIMER |
| r1877 | r1878 | |
| 7365 | 7364 | /* basic machine hardware */ |
| 7366 | 7365 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7367 | 7366 | MDRV_CPU_PROGRAM_MAP(wrofaero_readmem,wrofaero_writemem) |
| 7368 | MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7367 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7369 | 7368 | |
| 7370 | 7369 | /* video hardware */ |
| 7371 | 7370 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7401 | 7400 | /* basic machine hardware */ |
| 7402 | 7401 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7403 | 7402 | MDRV_CPU_PROGRAM_MAP(kamenrid_readmem,kamenrid_writemem) |
| 7404 | MDRV_CPU_VBLANK_INT( wrofaero_interrupt | |
| 7403 | MDRV_CPU_VBLANK_INT("main", wrofaero_interrupt | |
| 7405 | 7404 | |
| 7406 | 7405 | #if __uPD71054_TIMER |
| 7407 | 7406 | MDRV_MACHINE_RESET( wrofaero ) |
| r1877 | r1878 | |
| 7441 | 7440 | /* basic machine hardware */ |
| 7442 | 7441 | MDRV_CPU_ADD(M68000, 14318180/2) /* 7.143 MHz */ |
| 7443 | 7442 | MDRV_CPU_PROGRAM_MAP(orbs_readmem,orbs_writemem) |
| 7444 | MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7443 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7445 | 7444 | |
| 7446 | 7445 | /* video hardware */ |
| 7447 | 7446 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7476 | 7475 | /* basic machine hardware */ |
| 7477 | 7476 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7478 | 7477 | MDRV_CPU_PROGRAM_MAP(krzybowl_readmem,krzybowl_writemem) |
| 7479 | MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7478 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7480 | 7479 | |
| 7481 | 7480 | /* video hardware */ |
| 7482 | 7481 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7512 | 7511 | /* basic machine hardware */ |
| 7513 | 7512 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7514 | 7513 | MDRV_CPU_PROGRAM_MAP(madshark_readmem,madshark_writemem) |
| 7515 | MDRV_CPU_VBLANK_INT( wrofaero_interrupt | |
| 7514 | MDRV_CPU_VBLANK_INT("main", wrofaero_interrupt | |
| 7516 | 7515 | |
| 7517 | 7516 | #if __uPD71054_TIMER |
| 7518 | 7517 | MDRV_MACHINE_RESET( wrofaero ) |
| r1877 | r1878 | |
| 7555 | 7554 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7556 | 7555 | MDRV_CPU_PROGRAM_MAP(msgundam_readmem,msgundam_writemem) |
| 7557 | 7556 | #if __uPD71054_TIMER |
| 7558 | MDRV_CPU_VBLANK_INT( wrofaero_interrupt | |
| 7557 | MDRV_CPU_VBLANK_INT("main", wrofaero_interrupt | |
| 7559 | 7558 | #else |
| 7560 | MDRV_CPU_VBLANK_INT(seta_interrupt_2_and_4,SETA_INTERRUPTS_NUM) | |
| 7559 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_2_and_4,SETA_INTERRUPTS_NUM) | |
| 7561 | 7560 | #endif // __uPD71054_TIMER |
| 7562 | 7561 | |
| 7563 | 7562 | #if __uPD71054_TIMER |
| r1877 | r1878 | |
| 7599 | 7598 | /* basic machine hardware */ |
| 7600 | 7599 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7601 | 7600 | MDRV_CPU_PROGRAM_MAP(oisipuzl_readmem,oisipuzl_writemem) |
| 7602 | MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7601 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7603 | 7602 | |
| 7604 | 7603 | /* video hardware */ |
| 7605 | 7604 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7635 | 7634 | /* basic machine hardware */ |
| 7636 | 7635 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7637 | 7636 | MDRV_CPU_PROGRAM_MAP(triplfun_readmem,triplfun_writemem) |
| 7638 | MDRV_CPU_VBLANK_INT(irq3_line_hold | |
| 7637 | MDRV_CPU_VBLANK_INT("main", irq3_line_hold | |
| 7639 | 7638 | |
| 7640 | 7639 | /* video hardware */ |
| 7641 | 7640 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7669 | 7668 | /* basic machine hardware */ |
| 7670 | 7669 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7671 | 7670 | MDRV_CPU_PROGRAM_MAP(kiwame_readmem,kiwame_writemem) |
| 7672 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 7671 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 7673 | 7672 | the interrupt table is written to. */ |
| 7674 | 7673 | |
| 7675 | 7674 | /* video hardware */ |
| r1877 | r1878 | |
| 7708 | 7707 | /* basic machine hardware */ |
| 7709 | 7708 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7710 | 7709 | MDRV_CPU_PROGRAM_MAP(wrofaero_readmem,wrofaero_writemem) |
| 7711 | MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7710 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7712 | 7711 | |
| 7713 | 7712 | /* video hardware */ |
| 7714 | 7713 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7746 | 7745 | /* basic machine hardware */ |
| 7747 | 7746 | MDRV_CPU_ADD(M68000, 16000000/2) /* 8 MHz */ |
| 7748 | 7747 | MDRV_CPU_PROGRAM_MAP(thunderl_readmem,thunderl_writemem) |
| 7749 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 7748 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 7750 | 7749 | |
| 7751 | 7750 | /* video hardware */ |
| 7752 | 7751 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7777 | 7776 | /* basic machine hardware */ |
| 7778 | 7777 | MDRV_CPU_ADD(M68000, 16000000/2) /* 8 MHz */ |
| 7779 | 7778 | MDRV_CPU_PROGRAM_MAP(thunderl_readmem,thunderl_writemem) |
| 7780 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 7779 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 7781 | 7780 | |
| 7782 | 7781 | MDRV_CPU_ADD(Z80, 16000000/4) /* 4 MHz */ |
| 7783 | 7782 | MDRV_CPU_PROGRAM_MAP(wiggie_sound_readmem,wiggie_sound_writemem) |
| r1877 | r1878 | |
| 7810 | 7809 | /* basic machine hardware */ |
| 7811 | 7810 | MDRV_CPU_ADD(M68000, 16000000/2) /* 8 MHz */ |
| 7812 | 7811 | MDRV_CPU_PROGRAM_MAP(thunderl_readmem,thunderl_writemem) |
| 7813 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 7812 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 7814 | 7813 | |
| 7815 | 7814 | /* video hardware */ |
| 7816 | 7815 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7846 | 7845 | /* basic machine hardware */ |
| 7847 | 7846 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7848 | 7847 | MDRV_CPU_PROGRAM_MAP(umanclub_readmem,umanclub_writemem) |
| 7849 | MDRV_CPU_VBLANK_INT(irq3_line_hold | |
| 7848 | MDRV_CPU_VBLANK_INT("main", irq3_line_hold | |
| 7850 | 7849 | |
| 7851 | 7850 | /* video hardware */ |
| 7852 | 7851 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 7881 | 7880 | /* basic machine hardware */ |
| 7882 | 7881 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7883 | 7882 | MDRV_CPU_PROGRAM_MAP(utoukond_readmem,utoukond_writemem) |
| 7884 | MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7883 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7885 | 7884 | |
| 7886 | 7885 | MDRV_CPU_ADD(Z80, 16000000/4) /* 4 MHz */ |
| 7887 | 7886 | /* audio CPU */ |
| r1877 | r1878 | |
| 7927 | 7926 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7928 | 7927 | MDRV_CPU_PROGRAM_MAP(wrofaero_readmem,wrofaero_writemem) |
| 7929 | 7928 | #if __uPD71054_TIMER |
| 7930 | MDRV_CPU_VBLANK_INT( wrofaero_interrupt | |
| 7929 | MDRV_CPU_VBLANK_INT("main", wrofaero_interrupt | |
| 7931 | 7930 | #else |
| 7932 | MDRV_CPU_VBLANK_INT(seta_interrupt_2_and_4,SETA_INTERRUPTS_NUM) | |
| 7931 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_2_and_4,SETA_INTERRUPTS_NUM) | |
| 7933 | 7932 | #endif // __uPD71054_TIMER |
| 7934 | 7933 | |
| 7935 | 7934 | #if __uPD71054_TIMER |
| r1877 | r1878 | |
| 7976 | 7975 | /* basic machine hardware */ |
| 7977 | 7976 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 7978 | 7977 | MDRV_CPU_PROGRAM_MAP(wrofaero_readmem,wrofaero_writemem) |
| 7979 | MDRV_CPU_VBLANK_INT(irq3_line_hold | |
| 7978 | MDRV_CPU_VBLANK_INT("main", irq3_line_hold | |
| 7980 | 7979 | |
| 7981 | 7980 | /* video hardware */ |
| 7982 | 7981 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 8011 | 8010 | /* basic machine hardware */ |
| 8012 | 8011 | MDRV_CPU_ADD(M68000, 16000000/2) /* 8 MHz */ |
| 8013 | 8012 | MDRV_CPU_PROGRAM_MAP(pairlove_readmem,pairlove_writemem) |
| 8014 | MDRV_CPU_VBLANK_INT(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 8013 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 8015 | 8014 | |
| 8016 | 8015 | /* video hardware */ |
| 8017 | 8016 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 8055 | 8054 | /* basic machine hardware */ |
| 8056 | 8055 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 8057 | 8056 | MDRV_CPU_PROGRAM_MAP(crazyfgt_map,0) |
| 8058 | MDRV_CPU_VBLANK_INT(crazyfgt_interrupt,1+5) | |
| 8057 | MDRV_CPU_VBLANK_INT_HACK(crazyfgt_interrupt,1+5) | |
| 8059 | 8058 | |
| 8060 | 8059 | /* video hardware */ |
| 8061 | 8060 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 8114 | 8113 | /* basic machine hardware */ |
| 8115 | 8114 | MDRV_CPU_ADD(M68000, 16000000) |
| 8116 | 8115 | MDRV_CPU_PROGRAM_MAP(inttoote_map,0) |
| 8117 | MDRV_CPU_VBLANK_INT(inttoote_interrupt,8+1+1+1) | |
| 8116 | MDRV_CPU_VBLANK_INT_HACK(inttoote_interrupt,8+1+1+1) | |
| 8118 | 8117 | |
| 8119 | 8118 | /* video hardware */ |
| 8120 | 8119 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 9517 | 9516 | GAME( 1987, tndrcade, 0, tndrcade, tndrcade, 0, ROT270, "[Seta] (Taito license)", "Thundercade / Twin Formation" , 0) // Title/License: DSW |
| 9518 | 9517 | GAME( 1987, tndrcadj, tndrcade, tndrcade, tndrcadj, 0, ROT270, "[Seta] (Taito license)", "Tokusyu Butai U.A.G. (Japan)" , 0) // License: DSW |
| 9519 | 9518 | GAME( 1988, twineagl, 0, twineagl, twineagl, twineagl, ROT270, "Seta (Taito license)", "Twin Eagle - Revenge Joe's Brother" , 0) // Country/License: DSW |
| 9520 | GAME( 1989, downtown, 0, downtown, downtown, downtown, ROT270, "Seta", "DownTown (Set 1)" , 0) // Country/License: DSW | |
| 9521 | GAME( 1989, downtow2, downtown, downtown, downtown, downtown, ROT270, "Seta", "DownTown (Set 2)" , 0) // Country/License: DSW | |
| 9522 | GAME( 1989, downtowp, downtown, downtown, downtown, downtown, ROT270, "Seta", "DownTown (prototype)" , 0) // Country/License: DSW | |
| 9519 | GAME( 1989, downtown, 0, downtown, downtown, downtown, ROT270, "Seta", "DownTown / Mokugeki (Set 1)" , 0) // Country/License: DSW | |
| 9520 | GAME( 1989, downtow2, downtown, downtown, downtown, downtown, ROT270, "Seta", "DownTown / Mokugeki (Set 2)" , 0) // Country/License: DSW | |
| 9521 | GAME( 1989, downtowp, downtown, downtown, downtown, downtown, ROT270, "Seta", "DownTown / Mokugeki (prototype)" , 0) // Country/License: DSW | |
| 9523 | 9522 | GAME( 1989, usclssic, 0, usclssic, usclssic, 0, ROT270, "Seta", "U.S. Classic" , 0) // Country/License: DSW |
| 9524 | 9523 | GAME( 1989, calibr50, 0, calibr50, calibr50, 0, ROT270, "Athena / Seta", "Caliber 50" , 0) // Country/License: DSW |
| 9525 | 9524 | GAME( 1989, arbalest, 0, metafox, arbalest, arbalest, ROT270, "Seta", "Arbalester" , 0) // Country/License: DSW |
| r1877 | r1878 | |
|---|---|---|
| 151 | 151 | MDRV_CPU_ADD(M6809, 750000) /* ?? guess */ |
| 152 | 152 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 153 | 153 | |
| 154 | MDRV_CPU_VBLANK_INT(truco_interrupt | |
| 154 | MDRV_CPU_VBLANK_INT("main", truco_interrupt | |
| 155 | 155 | |
| 156 | 156 | MDRV_MACHINE_RESET(truco) |
| 157 | 157 |
| r1877 | r1878 | |
|---|---|---|
| 516 | 516 | static VIDEO_UPDATE( laserbat ) |
| 517 | 517 | { |
| 518 | 518 | int y; |
| 519 | mame_bitmap *s2636_0_bitmap; | |
| 520 | mame_bitmap *s2636_1_bitmap; | |
| 521 | mame_bitmap *s2636_2_bitmap; | |
| 519 | bitmap_t *s2636_0_bitmap; | |
| 520 | bitmap_t *s2636_1_bitmap; | |
| 521 | bitmap_t *s2636_2_bitmap; | |
| 522 | 522 | |
| 523 | 523 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 524 | 524 | |
| r1877 | r1878 | |
| 599 | 599 | static READ8_HANDLER( zaccaria_port0a_r ) |
| 600 | 600 | { |
| 601 | 601 | if (active_8910 == 0) |
| 602 | return AY8910_read_port_0_r(0); | |
| 602 | return AY8910_read_port_0_r(machine,0); | |
| 603 | 603 | else |
| 604 | return AY8910_read_port_1_r(0); | |
| 604 | return AY8910_read_port_1_r(machine,0); | |
| 605 | 605 | } |
| 606 | 606 | |
| 607 | 607 | static WRITE8_HANDLER( zaccaria_port0a_w ) |
| r1877 | r1878 | |
| 619 | 619 | { |
| 620 | 620 | /* bit 0 goes to the 8910 #0 BC1 pin */ |
| 621 | 621 | if (last & 0x01) |
| 622 | AY8910_control_port_0_w(0,port0a); | |
| 622 | AY8910_control_port_0_w(machine,0,port0a); | |
| 623 | 623 | else |
| 624 | AY8910_write_port_0_w(0,port0a); | |
| 624 | AY8910_write_port_0_w(machine,0,port0a); | |
| 625 | 625 | } |
| 626 | 626 | else if ((last & 0x02) == 0x00 && (data & 0x02) == 0x02) |
| 627 | 627 | { |
| r1877 | r1878 | |
| 634 | 634 | { |
| 635 | 635 | /* bit 2 goes to the 8910 #1 BC1 pin */ |
| 636 | 636 | if (last & 0x04) |
| 637 | AY8910_control_port_1_w(0,port0a); | |
| 637 | AY8910_control_port_1_w(machine,0,port0a); | |
| 638 | 638 | else |
| 639 | AY8910_write_port_1_w(0,port0a); | |
| 639 | AY8910_write_port_1_w(machine,0,port0a); | |
| 640 | 640 | } |
| 641 | 641 | else if ((last & 0x08) == 0x00 && (data & 0x08) == 0x08) |
| 642 | 642 | { |
| r1877 | r1878 | |
| 683 | 683 | { |
| 684 | 684 | static int toggle; |
| 685 | 685 | |
| 686 | pia_0_cb1_w(0,toggle & 1); | |
| 686 | pia_0_cb1_w(machine,0,toggle & 1); | |
| 687 | 687 | toggle ^= 1; |
| 688 | 688 | } |
| 689 | 689 | |
| r1877 | r1878 | |
| 693 | 693 | MDRV_CPU_ADD(S2650, 14318180/4) // ??? |
| 694 | 694 | MDRV_CPU_PROGRAM_MAP(laserbat_map,0) |
| 695 | 695 | MDRV_CPU_IO_MAP(laserbat_io_map,0) |
| 696 | MDRV_CPU_VBLANK_INT(laserbat_interrupt | |
| 696 | MDRV_CPU_VBLANK_INT("main", laserbat_interrupt | |
| 697 | 697 | |
| 698 | 698 | /* video hardware */ |
| 699 | 699 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 727 | 727 | MDRV_CPU_ADD(S2650, 14318000/4) /* ? */ |
| 728 | 728 | MDRV_CPU_PROGRAM_MAP(laserbat_map,0) |
| 729 | 729 | MDRV_CPU_IO_MAP(catnmous_io_map,0) |
| 730 | MDRV_CPU_VBLANK_INT(laserbat_interrupt | |
| 730 | MDRV_CPU_VBLANK_INT("main", laserbat_interrupt | |
| 731 | 731 | |
| 732 | 732 | MDRV_CPU_ADD(M6802,3580000) /* ? */ |
| 733 | 733 | MDRV_CPU_PROGRAM_MAP(catnmous_sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 196 | 196 | |
| 197 | 197 | static INTERRUPT_GEN( trvquest_interrupt ) |
| 198 | 198 | { |
| 199 | via_2_ca1_w(0,1); | |
| 200 | via_2_ca1_w(0,0); | |
| 199 | via_2_ca1_w(machine,0,1); | |
| 200 | via_2_ca1_w(machine,0,0); | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | static MACHINE_DRIVER_START( trvquest ) |
| r1877 | r1878 | |
| 206 | 206 | |
| 207 | 207 | MDRV_CPU_ADD(M6809,6000000) |
| 208 | 208 | MDRV_CPU_PROGRAM_MAP(cpu_map,0) |
| 209 | MDRV_CPU_VBLANK_INT(trvquest_interrupt | |
| 209 | MDRV_CPU_VBLANK_INT("main", trvquest_interrupt | |
| 210 | 210 | |
| 211 | 211 | MDRV_NVRAM_HANDLER(generic_1fill) |
| 212 | 212 | MDRV_MACHINE_START(trvquest) |
| r1877 | r1878 | |
|---|---|---|
| 343 | 343 | { |
| 344 | 344 | // to avoid the write when the sound chip is initialized |
| 345 | 345 | if(data != 0xff) |
| 346 | DAC_0_data_w(0, data | |
| 346 | DAC_0_data_w(machine, 0, data | |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 435 | 435 | |
| 436 | 436 | static WRITE8_HANDLER( tnzsb_sound_command_w ) |
| 437 | 437 | { |
| 438 | soundlatch_w(offset,data); | |
| 439 | cpunum_set_input_line_and_vector(Machine, 2,0,HOLD_LINE,0xff); | |
| 438 | soundlatch_w(machine,offset,data); | |
| 439 | cpunum_set_input_line_and_vector(machine, 2,0,HOLD_LINE,0xff); | |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | static ADDRESS_MAP_START( tnzsb_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 1292 | 1292 | /* basic machine hardware */ |
| 1293 | 1293 | MDRV_CPU_ADD(Z80, XTAL_12MHz/2) /* verified on pcb */ |
| 1294 | 1294 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1295 | MDRV_CPU_VBLANK_INT(arknoid2_interrupt | |
| 1295 | MDRV_CPU_VBLANK_INT("main", arknoid2_interrupt | |
| 1296 | 1296 | |
| 1297 | 1297 | MDRV_CPU_ADD(Z80, XTAL_12MHz/2) /* verified on pcb */ |
| 1298 | 1298 | MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem) |
| 1299 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1299 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1300 | 1300 | |
| 1301 | 1301 | MDRV_INTERLEAVE(100) |
| 1302 | 1302 | |
| r1877 | r1878 | |
| 1331 | 1331 | /* basic machine hardware */ |
| 1332 | 1332 | MDRV_CPU_ADD(Z80,XTAL_12MHz/2) /* 6.0 MHz ??? - Main board Crystal is 12MHz */ |
| 1333 | 1333 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1334 | MDRV_CPU_VBLANK_INT(arknoid2_interrupt | |
| 1334 | MDRV_CPU_VBLANK_INT("main", arknoid2_interrupt | |
| 1335 | 1335 | |
| 1336 | 1336 | MDRV_CPU_ADD(Z80,XTAL_12MHz/2) /* 6.0 MHz ??? - Main board Crystal is 12MHz */ |
| 1337 | 1337 | MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem) |
| 1338 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1338 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1339 | 1339 | |
| 1340 | 1340 | MDRV_INTERLEAVE(100) |
| 1341 | 1341 | |
| r1877 | r1878 | |
| 1370 | 1370 | /* basic machine hardware */ |
| 1371 | 1371 | MDRV_CPU_ADD(Z80,XTAL_12MHz/2) /* 6.0 MHz ??? - Main board Crystal is 12MHz */ |
| 1372 | 1372 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1373 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1373 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1374 | 1374 | |
| 1375 | 1375 | MDRV_CPU_ADD(Z80,XTAL_12MHz/2) /* 6.0 MHz ??? - Main board Crystal is 12MHz */ |
| 1376 | 1376 | MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem) |
| 1377 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1377 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1378 | 1378 | |
| 1379 | 1379 | MDRV_CPU_ADD(I8X41,12000000/2) /* 400KHz ??? - Main board Crystal is 12MHz */ |
| 1380 | 1380 | MDRV_CPU_PROGRAM_MAP(i8742_readmem,i8742_writemem) |
| r1877 | r1878 | |
| 1412 | 1412 | /* basic machine hardware */ |
| 1413 | 1413 | MDRV_CPU_ADD(Z80, XTAL_12MHz/2) /* verified on pcb */ |
| 1414 | 1414 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1415 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1415 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1416 | 1416 | |
| 1417 | 1417 | MDRV_CPU_ADD(Z80, XTAL_12MHz/2) /* verified on pcb */ |
| 1418 | 1418 | MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem) |
| 1419 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1419 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1420 | 1420 | |
| 1421 | 1421 | MDRV_INTERLEAVE(100) |
| 1422 | 1422 | |
| r1877 | r1878 | |
| 1450 | 1450 | /* basic machine hardware */ |
| 1451 | 1451 | MDRV_CPU_ADD(Z80, XTAL_12MHz/2) /* verified on pcb */ |
| 1452 | 1452 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 1453 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1453 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1454 | 1454 | |
| 1455 | 1455 | MDRV_CPU_ADD(Z80, XTAL_12MHz/2) /* verified on pcb */ |
| 1456 | 1456 | MDRV_CPU_PROGRAM_MAP(kageki_sub_readmem,kageki_sub_writemem) |
| 1457 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1457 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1458 | 1458 | |
| 1459 | 1459 | MDRV_INTERLEAVE(100) |
| 1460 | 1460 | |
| r1877 | r1878 | |
| 1495 | 1495 | /* basic machine hardware */ |
| 1496 | 1496 | MDRV_CPU_ADD_TAG("cpu0", Z80, XTAL_12MHz/2) /* verified on pcb */ |
| 1497 | 1497 | MDRV_CPU_PROGRAM_MAP(cpu0_type2,0) |
| 1498 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1498 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1499 | 1499 | |
| 1500 | 1500 | MDRV_CPU_ADD_TAG("cpu1", Z80, XTAL_12MHz/2) /* verified on pcb */ |
| 1501 | 1501 | MDRV_CPU_PROGRAM_MAP(tnzsb_cpu1_map,0) |
| 1502 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1502 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1503 | 1503 | |
| 1504 | 1504 | MDRV_CPU_ADD_TAG("cpu2", Z80, XTAL_12MHz/2) /* verified on pcb */ |
| 1505 | 1505 | MDRV_CPU_PROGRAM_MAP(tnzsb_cpu2_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | driver by Marc Lafontaine |
| 6 | 6 | |
| 7 | TODO: | |
| 8 | - the slave CPU multiplexes sprites. We are cheating now, and reading them | |
| 9 | from somewhere else. | |
| 10 | 7 | |
| 11 | ||
| 12 | The schematics are available on the net. | |
| 13 | ||
| 14 | There is 3 CPU for this game. | |
| 15 | Two 68A09E for the game. | |
| 16 | A Z80A for the sound | |
| 17 | ||
| 18 | As I understand it, the second 6809 is for displaying | |
| 19 | the sprites. If we do not emulate him, all work well, except | |
| 20 | that the player cannot die. | |
| 21 | Address 57ff must read 0 to pass the RAM test if the second CPU | |
| 22 | is not emulated. | |
| 23 | ||
| 24 | ||
| 25 | 8 | ---- Master 6809 ------ |
| 26 | 9 | |
| 27 | 10 | Write |
| r1877 | r1878 | |
| 57 | 40 | |
| 58 | 41 | ------ Slave 6809 -------- |
| 59 | 42 | 0000-1fff SAFR Watch dog ? |
| 60 | 2000 | |
| 43 | 2000 | |
| 61 | 44 | 4000 enable or reset IRQ |
| 62 | 45 | 6000-67ff DRA |
| 63 | 46 | 8000-87ff Ram (Common for the Master and Slave 6809) |
| r1877 | r1878 | |
| 87 | 70 | #include "sound/flt_rc.h" |
| 88 | 71 | |
| 89 | 72 | |
| 90 | extern UINT8 *tp84_videoram2, *tp84_colorram2; | |
| 73 | extern UINT8 *tp84_bg_videoram; | |
| 74 | extern UINT8 *tp84_bg_colorram; | |
| 75 | extern UINT8 *tp84_fg_videoram; | |
| 76 | extern UINT8 *tp84_fg_colorram; | |
| 77 | extern UINT8 *tp84_spriteram; | |
| 78 | extern UINT8 *tp84_scroll_x; | |
| 79 | extern UINT8 *tp84_scroll_y; | |
| 80 | extern UINT8 *tp84_palette_bank; | |
| 81 | extern UINT8 *tp84_flipscreen_x; | |
| 82 | extern UINT8 *tp84_flipscreen_y; | |
| 91 | 83 | |
| 92 | WRITE8_HANDLER( tp84_videoram_w ); | |
| 93 | WRITE8_HANDLER( tp84_colorram_w ); | |
| 94 | WRITE8_HANDLER( tp84_videoram2_w ); | |
| 95 | WRITE8_HANDLER( tp84_colorram2_w ); | |
| 96 | WRITE8_HANDLER( tp84_scroll_x_w ); | |
| 97 | WRITE8_HANDLER( tp84_scroll_y_w ); | |
| 98 | WRITE8_HANDLER( tp84_flipscreen_x_w ); | |
| 99 | WRITE8_HANDLER( tp84_flipscreen_y_w ); | |
| 100 | WRITE8_HANDLER( tp84_col0_w ); | |
| 84 | WRITE8_HANDLER( tp84_spriteram_w ); | |
| 101 | 85 | READ8_HANDLER( tp84_scanline_r ); |
| 102 | 86 | |
| 103 | 87 | PALETTE_INIT( tp84 ); |
| 104 | 88 | VIDEO_START( tp84 ); |
| 105 | 89 | VIDEO_UPDATE( tp84 ); |
| 106 | 90 | |
| 107 | INTERRUPT_GEN( tp84_6809_interrupt ); | |
| 108 | 91 | |
| 109 | 92 | |
| 110 | ||
| 111 | 93 | static READ8_HANDLER( tp84_sh_timer_r ) |
| 112 | 94 | { |
| 113 | 95 | /* main xtal 14.318MHz, divided by 4 to get the CPU clock, further */ |
| r1877 | r1878 | |
| 117 | 99 | return (activecpu_gettotalcycles() / (2048/2)) & 0x0f; |
| 118 | 100 | } |
| 119 | 101 | |
| 102 | ||
| 120 | 103 | static WRITE8_HANDLER( tp84_filter_w ) |
| 121 | 104 | { |
| 122 | 105 | int C; |
| r1877 | r1878 | |
| 151 | 134 | |
| 152 | 135 | |
| 153 | 136 | |
| 154 | /* CPU 1 read addresses */ | |
| 155 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 156 | AM_RANGE(0x2800, 0x2800) AM_READ(input_port_0_r) | |
| 137 | static ADDRESS_MAP_START( tp84_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 138 | AM_RANGE(0x2000, 0x2000) AM_WRITE(watchdog_reset_w) | |
| 139 | AM_RANGE(0x2800, 0x2800) AM_READWRITE(input_port_0_r, MWA8_RAM) AM_BASE(&tp84_palette_bank) | |
| 157 | 140 | AM_RANGE(0x2820, 0x2820) AM_READ(input_port_1_r) |
| 158 | 141 | AM_RANGE(0x2840, 0x2840) AM_READ(input_port_2_r) |
| 159 | 142 | AM_RANGE(0x2860, 0x2860) AM_READ(input_port_3_r) |
| 160 | AM_RANGE(0x3000, 0x3000) AM_READ(input_port_4_r) | |
| 161 | AM_RANGE(0x4000, 0x4fff) AM_READ(MRA8_RAM) | |
| 162 | AM_RANGE(0x5000, 0x57ff) AM_READ(MRA8_RAM) AM_SHARE(1) | |
| 163 | AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM) | |
| 164 | ADDRESS_MAP_END | |
| 165 | ||
| 166 | /* CPU 1 write addresses */ | |
| 167 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 168 | AM_RANGE(0x2000, 0x2000) AM_WRITE(watchdog_reset_w) | |
| 169 | AM_RANGE(0x2800, 0x2800) AM_WRITE(tp84_col0_w) | |
| 170 | AM_RANGE(0x3000, 0x3000) AM_WRITE(MWA8_RAM) | |
| 171 | AM_RANGE(0x3004, 0x3004) AM_WRITE(tp84_flipscreen_x_w) | |
| 172 | AM_RANGE(0x3005, 0x3005) AM_WRITE(tp84_flipscreen_y_w) | |
| 143 | AM_RANGE(0x3000, 0x3000) AM_READWRITE(input_port_4_r, MWA8_RAM) | |
| 144 | AM_RANGE(0x3004, 0x3004) AM_WRITE(MWA8_RAM) AM_BASE(&tp84_flipscreen_x) | |
| 145 | AM_RANGE(0x3005, 0x3005) AM_WRITE(MWA8_RAM) AM_BASE(&tp84_flipscreen_y) | |
| 173 | 146 | AM_RANGE(0x3800, 0x3800) AM_WRITE(tp84_sh_irqtrigger_w) |
| 174 | 147 | AM_RANGE(0x3a00, 0x3a00) AM_WRITE(soundlatch_w) |
| 175 | AM_RANGE(0x3c00, 0x3c00) AM_WRITE(tp84_scroll_x_w) | |
| 176 | AM_RANGE(0x3e00, 0x3e00) AM_WRITE(tp84_scroll_y_w) | |
| 177 | AM_RANGE(0x4000, 0x43ff) AM_WRITE(tp84_videoram_w) AM_BASE(&videoram) | |
| 178 | AM_RANGE(0x4400, 0x47ff) AM_WRITE(tp84_videoram2_w) AM_BASE(&tp84_videoram2) | |
| 179 | AM_RANGE(0x4800, 0x4bff) AM_WRITE(tp84_colorram_w) AM_BASE(&colorram) | |
| 180 | AM_RANGE(0x4c00, 0x4fff) AM_WRITE(tp84_colorram2_w) AM_BASE(&tp84_colorram2) | |
| 181 | AM_RANGE(0x5000, 0x57ff) AM_WRITE(MWA8_RAM) AM_SHARE(1) | |
| 182 | AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 148 | AM_RANGE(0x3c00, 0x3c00) AM_WRITE(MWA8_RAM) AM_BASE(&tp84_scroll_x) | |
| 149 | AM_RANGE(0x3e00, 0x3e00) AM_WRITE(MWA8_RAM) AM_BASE(&tp84_scroll_y) | |
| 150 | AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE(&tp84_bg_videoram) | |
| 151 | AM_RANGE(0x4400, 0x47ff) AM_RAM AM_BASE(&tp84_fg_videoram) | |
| 152 | AM_RANGE(0x4800, 0x4bff) AM_RAM AM_BASE(&tp84_bg_colorram) | |
| 153 | AM_RANGE(0x4c00, 0x4fff) AM_RAM AM_BASE(&tp84_fg_colorram) | |
| 154 | AM_RANGE(0x5000, 0x57ff) AM_RAM AM_SHARE(1) | |
| 155 | AM_RANGE(0x8000, 0xffff) AM_ROM | |
| 183 | 156 | ADDRESS_MAP_END |
| 184 | 157 | |
| 185 | 158 | static ADDRESS_MAP_START( tp84b_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 186 | AM_RANGE(0x0000, 0x03ff) AM_RAM AM_WRITE(tp84_videoram_w) AM_BASE(&videoram) | |
| 187 | AM_RANGE(0x0400, 0x07ff) AM_RAM AM_WRITE(tp84_videoram2_w) AM_BASE(&tp84_videoram2) | |
| 188 | AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(tp84_colorram_w) AM_BASE(&colorram) | |
| 189 | AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(tp84_colorram2_w) AM_BASE(&tp84_colorram2) | |
| 159 | AM_RANGE(0x0000, 0x03ff) AM_RAM AM_BASE(&tp84_bg_videoram) | |
| 160 | AM_RANGE(0x0400, 0x07ff) AM_RAM AM_BASE(&tp84_fg_videoram) | |
| 161 | AM_RANGE(0x0800, 0x0bff) AM_RAM AM_BASE(&tp84_bg_colorram) | |
| 162 | AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_BASE(&tp84_fg_colorram) | |
| 190 | 163 | AM_RANGE(0x1000, 0x17ff) AM_RAM AM_SHARE(1) |
| 191 | 164 | AM_RANGE(0x1800, 0x1800) AM_WRITE(watchdog_reset_w) |
| 192 | AM_RANGE(0x1a00, 0x1a00) AM_READWRITE(input_port_0_r, tp84_ | |
| 165 | AM_RANGE(0x1a00, 0x1a00) AM_READWRITE(input_port_0_r, MWA8_RAM) AM_BASE(&tp84_palette_bank) | |
| 193 | 166 | AM_RANGE(0x1a20, 0x1a20) AM_READ(input_port_1_r) |
| 194 | 167 | AM_RANGE(0x1a40, 0x1a40) AM_READ(input_port_2_r) |
| 195 | 168 | AM_RANGE(0x1a60, 0x1a60) AM_READ(input_port_3_r) |
| 196 | 169 | AM_RANGE(0x1c00, 0x1c00) AM_READWRITE(input_port_4_r, MWA8_NOP) |
| 197 | AM_RANGE(0x1c04, 0x1c04) AM_WRITE(tp84_flipscreen_x_w) | |
| 198 | AM_RANGE(0x1c05, 0x1c05) AM_WRITE(tp84_flipscreen_y_w) | |
| 170 | AM_RANGE(0x1c04, 0x1c04) AM_WRITE(MWA8_RAM) AM_BASE(&tp84_flipscreen_x) | |
| 171 | AM_RANGE(0x1c05, 0x1c05) AM_WRITE(MWA8_RAM) AM_BASE(&tp84_flipscreen_y) | |
| 199 | 172 | AM_RANGE(0x1e00, 0x1e00) AM_WRITE(tp84_sh_irqtrigger_w) |
| 200 | 173 | AM_RANGE(0x1e80, 0x1e80) AM_WRITE(soundlatch_w) |
| 201 | AM_RANGE(0x1f00, 0x1f00) AM_WRITE(tp84_scroll_x_w) | |
| 202 | AM_RANGE(0x1f80, 0x1f80) AM_WRITE(tp84_scroll_y_w) | |
| 174 | AM_RANGE(0x1f00, 0x1f00) AM_WRITE(MWA8_RAM) AM_BASE(&tp84_scroll_x) | |
| 175 | AM_RANGE(0x1f80, 0x1f80) AM_WRITE(MWA8_RAM) AM_BASE(&tp84_scroll_y) | |
| 203 | 176 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 204 | 177 | ADDRESS_MAP_END |
| 205 | 178 | |
| 206 | 179 | |
| 207 | /* CPU 2 read addresses */ | |
| 208 | static ADDRESS_MAP_START( readmem_cpu2, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 209 | // AM_RANGE(0x0000, 0x0000) AM_READ(MRA8_RAM) | |
| 180 | static ADDRESS_MAP_START( cpu2_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 181 | // AM_RANGE(0x0000, 0x0000) AM_RAM /* Watch dog ?*/ | |
| 210 | 182 | AM_RANGE(0x2000, 0x2000) AM_READ(tp84_scanline_r) /* beam position */ |
| 211 | AM_RANGE(0x6000, 0x67ff) AM_READ(MRA8_RAM) | |
| 212 | AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM) AM_SHARE(1) | |
| 213 | AM_RANGE(0xe000, 0xffff) AM_READ(MRA8_ROM) | |
| 183 | AM_RANGE(0x4000, 0x4000) AM_WRITE(interrupt_enable_w) | |
| 184 | AM_RANGE(0x6000, 0x679f) AM_RAM | |
| 185 | AM_RANGE(0x67a0, 0x67ff) AM_READWRITE(MRA8_RAM, tp84_spriteram_w) AM_BASE(&tp84_spriteram) | |
| 186 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE(1) | |
| 187 | AM_RANGE(0xe000, 0xffff) AM_ROM | |
| 214 | 188 | ADDRESS_MAP_END |
| 215 | 189 | |
| 216 | /* CPU 2 write addresses */ | |
| 217 | static ADDRESS_MAP_START( writemem_cpu2, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 218 | // AM_RANGE(0x0000, 0x0000) AM_WRITE(MWA8_RAM) /* Watch dog ?*/ | |
| 219 | AM_RANGE(0x4000, 0x4000) AM_WRITE(interrupt_enable_w) /* IRQ enable */ | |
| 220 | AM_RANGE(0x6000, 0x679f) AM_WRITE(MWA8_RAM) | |
| 221 | AM_RANGE(0x67a0, 0x67ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* REAL (multiplexed) */ | |
| 222 | AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM) AM_SHARE(1) | |
| 223 | AM_RANGE(0xe000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 224 | ADDRESS_MAP_END | |
| 225 | 190 | |
| 226 | ||
| 227 | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 228 | AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_ROM) | |
| 229 | AM_RANGE(0x4000, 0x43ff) AM_READ(MRA8_RAM) | |
| 191 | static ADDRESS_MAP_START( audio_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 192 | AM_RANGE(0x0000, 0x3fff) AM_ROM | |
| 193 | AM_RANGE(0x4000, 0x43ff) AM_RAM | |
| 230 | 194 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) |
| 231 | 195 | AM_RANGE(0x8000, 0x8000) AM_READ(tp84_sh_timer_r) |
| 232 | ADDRESS_MAP_END | |
| 233 | ||
| 234 | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 235 | AM_RANGE(0x0000, 0x3fff) AM_WRITE(MWA8_ROM) | |
| 236 | AM_RANGE(0x4000, 0x43ff) AM_WRITE(MWA8_RAM) | |
| 237 | 196 | AM_RANGE(0xa000, 0xa1ff) AM_WRITE(tp84_filter_w) |
| 238 | 197 | AM_RANGE(0xc000, 0xc000) AM_WRITE(MWA8_NOP) |
| 239 | 198 | AM_RANGE(0xc001, 0xc001) AM_WRITE(SN76496_0_w) |
| r1877 | r1878 | |
| 436 | 395 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, |
| 437 | 396 | 16*8 |
| 438 | 397 | }; |
| 398 | ||
| 439 | 399 | static const gfx_layout spritelayout = |
| 440 | 400 | { |
| 441 | 401 | 16,16, |
| r1877 | r1878 | |
| 460 | 420 | |
| 461 | 421 | /* basic machine hardware */ |
| 462 | 422 | MDRV_CPU_ADD_TAG("cpu1",M6809, XTAL_18_432MHz/12) /* verified on pcb */ |
| 463 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 464 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) | |
| 423 | MDRV_CPU_PROGRAM_MAP(tp84_cpu1_map,0) | |
| 424 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 465 | 425 | |
| 466 | 426 | MDRV_CPU_ADD(M6809, XTAL_18_432MHz/12) /* verified on pcb */ |
| 467 | MDRV_CPU_PROGRAM_MAP(readmem_cpu2,writemem_cpu2) | |
| 468 | MDRV_CPU_VBLANK_INT(tp84_6809_interrupt,256) | |
| 427 | MDRV_CPU_PROGRAM_MAP(cpu2_map,0) | |
| 428 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 469 | 429 | |
| 470 | MDRV_CPU_ADD(Z80,XTAL_14_31818MHz/4) /* verified on pcb */ | |
| 471 | 430 | /* audio CPU */ |
| 472 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) | |
| 431 | MDRV_CPU_ADD(Z80,XTAL_14_31818MHz/4) /* verified on pcb */ | |
| 432 | MDRV_CPU_PROGRAM_MAP(audio_map,0) | |
| 473 | 433 | |
| 474 | 434 | MDRV_INTERLEAVE(100) /* 100 CPU slices per frame - an high value to ensure proper */ |
| 475 | 435 | /* synchronization of the CPUs */ |
| 476 | ||
| 477 | 436 | /* video hardware */ |
| 478 | 437 | MDRV_SCREEN_ADD("main", RASTER) |
| 479 | 438 | MDRV_SCREEN_REFRESH_RATE(60) |
| r1877 | r1878 | |
| 489 | 448 | MDRV_VIDEO_START(tp84) |
| 490 | 449 | MDRV_VIDEO_UPDATE(tp84) |
| 491 | 450 | |
| 492 | /* | |
| 451 | /* a | |
| 493 | 452 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 494 | 453 | |
| 495 | 454 | MDRV_SOUND_ADD(SN76489A, XTAL_14_31818MHz/8) /* verified on pcb */ |
| r1877 | r1878 | |
| 611 | 570 | ROM_END |
| 612 | 571 | |
| 613 | 572 | |
| 614 | GAME( 1984, tp84, 0, tp84, tp84, 0, ROT90, "Konami", "Time Pilot '84 (set 1)", 0 ) | |
| 615 | GAME( 1984, tp84a, tp84, tp84, tp84a,0, ROT90, "Konami", "Time Pilot '84 (set 2)", 0 ) | |
| 616 | GAME( 1984, tp84b, tp84, tp84b, tp84, 0, ROT90, "Konami", "Time Pilot '84 (set 3)", 0 ) | |
| 573 | GAME( 1984, tp84, 0, tp84, tp84, 0, ROT90, "Konami", "Time Pilot '84 (set 1)", GAME_SUPPORTS_SAVE ) | |
| 574 | GAME( 1984, tp84a, tp84, tp84, tp84a,0, ROT90, "Konami", "Time Pilot '84 (set 2)", GAME_SUPPORTS_SAVE ) | |
| 575 | GAME( 1984, tp84b, tp84, tp84b, tp84, 0, ROT90, "Konami", "Time Pilot '84 (set 3)", GAME_SUPPORTS_SAVE ) |
| r1877 | r1878 | |
|---|---|---|
| 817 | 817 | /* basic machine hardware */ |
| 818 | 818 | MDRV_CPU_ADD(M68000, 14000000) |
| 819 | 819 | MDRV_CPU_PROGRAM_MAP(rohga_readmem,rohga_writemem) |
| 820 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 820 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 821 | 821 | |
| 822 | 822 | MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */ |
| 823 | 823 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 862 | 862 | /* basic machine hardware */ |
| 863 | 863 | MDRV_CPU_ADD(M68000, 14000000) |
| 864 | 864 | MDRV_CPU_PROGRAM_MAP(wizdfire_readmem,wizdfire_writemem) |
| 865 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 865 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 866 | 866 | |
| 867 | 867 | MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */ |
| 868 | 868 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 907 | 907 | /* basic machine hardware */ |
| 908 | 908 | MDRV_CPU_ADD(M68000, 14000000) |
| 909 | 909 | MDRV_CPU_PROGRAM_MAP(nitrobal_readmem,nitrobal_writemem) |
| 910 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 910 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 911 | 911 | |
| 912 | 912 | MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */ |
| 913 | 913 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 952 | 952 | /* basic machine hardware */ |
| 953 | 953 | MDRV_CPU_ADD(M68000, 14000000) |
| 954 | 954 | MDRV_CPU_PROGRAM_MAP(schmeisr_readmem,schmeisr_writemem) |
| 955 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 955 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 956 | 956 | |
| 957 | 957 | MDRV_CPU_ADD(H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */ |
| 958 | 958 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 143 | 143 | |
| 144 | 144 | |
| 145 | 145 | static WRITE8_HANDLER( cpu_sound_command_w ) { |
| 146 | soundlatch_w( offset, data ); | |
| 147 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 146 | soundlatch_w( machine, offset, data ); | |
| 147 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | |
| r1877 | r1878 | |
| 402 | 402 | /* basic machine hardware */ |
| 403 | 403 | MDRV_CPU_ADD(M6502, 2000000) /* 2 MHz - measured by guru but it makes the game far far too slow ?! */ |
| 404 | 404 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 405 | MDRV_CPU_VBLANK_INT(vball_interrupt,32) /* ??1 IRQ every 8 visible scanlines, plus NMI for vblank?? */ | |
| 405 | MDRV_CPU_VBLANK_INT_HACK(vball_interrupt,32) /* ??1 IRQ every 8 visible scanlines, plus NMI for vblank?? */ | |
| 406 | 406 | |
| 407 | 407 | MDRV_CPU_ADD(Z80, 3579545) |
| 408 | 408 | /* audio CPU */ /* 3.579545 MHz */ |
| r1877 | r1878 | |
| 441 | 441 | /* basic machine hardware */ |
| 442 | 442 | MDRV_CPU_ADD(M6502, 2000000) /* 2.0 MHz */ |
| 443 | 443 | MDRV_CPU_PROGRAM_MAP(vball2pj_readmem,writemem) |
| 444 | MDRV_CPU_VBLANK_INT(vball_interrupt,32) /* ??1 IRQ every 8 visible scanlines, plus NMI for vblank?? */ | |
| 444 | MDRV_CPU_VBLANK_INT_HACK(vball_interrupt,32) /* ??1 IRQ every 8 visible scanlines, plus NMI for vblank?? */ | |
| 445 | 445 | |
| 446 | 446 | MDRV_CPU_ADD(Z80, 3579545) |
| 447 | 447 | /* audio CPU */ /* 3.579545 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 175 | 175 | /* basic machine hardware */ |
| 176 | 176 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz ? Main xtal is 12MHz */ |
| 177 | 177 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 178 | MDRV_CPU_VBLANK_INT(higemaru_interrupt,2) | |
| 178 | MDRV_CPU_VBLANK_INT_HACK(higemaru_interrupt,2) | |
| 179 | 179 | |
| 180 | 180 | /* video hardware */ |
| 181 | 181 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 110 | 110 | return (readinputport(0)<<24); |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | /* FIXME: code will never execute */ | |
| 114 | #if 0 | |
| 113 | 115 | logerror("unk access to eeprom port (mask %x)\n", mem_mask); |
| 114 | 116 | return 0; |
| 117 | #endif | |
| 115 | 118 | } |
| 116 | 119 | |
| 117 | 120 | |
| r1877 | r1878 | |
| 163 | 166 | |
| 164 | 167 | static READ32_HANDLER( sound_r ) |
| 165 | 168 | { |
| 166 | int latch = soundlatch3_r(0); | |
| 169 | int latch = soundlatch3_r(machine, 0); | |
| 167 | 170 | |
| 168 | 171 | if (latch == 0xe) latch = 0xf; /* hack: until 54539 NMI disable found */ |
| 169 | 172 | |
| r1877 | r1878 | |
| 174 | 177 | { |
| 175 | 178 | if (ACCESSING_MSB) |
| 176 | 179 | { |
| 177 | soundlatch_w(0, (data>>8)&0xff); | |
| 180 | soundlatch_w(machine, 0, (data>>8)&0xff); | |
| 178 | 181 | } |
| 179 | 182 | else |
| 180 | 183 | { |
| 181 | soundlatch2_w(0, data&0xff); | |
| 184 | soundlatch2_w(machine, 0, data&0xff); | |
| 182 | 185 | } |
| 183 | 186 | } |
| 184 | 187 | |
| r1877 | r1878 | |
| 684 | 687 | static MACHINE_DRIVER_START( plygonet ) |
| 685 | 688 | MDRV_CPU_ADD(M68EC020, 16000000) /* 16 MHz (xtal is 32.0 MHz) */ |
| 686 | 689 | MDRV_CPU_PROGRAM_MAP(polygonet_map, 0) |
| 687 | MDRV_CPU_VBLANK_INT(polygonet_interrupt, 2) | |
| 690 | MDRV_CPU_VBLANK_INT_HACK(polygonet_interrupt, 2) | |
| 688 | 691 | |
| 689 | 692 | MDRV_CPU_ADD(DSP56156, 10000000) /* should be 40.0 MHz */ |
| 690 | 693 | MDRV_CPU_FLAGS(CPU_DISABLE) |
| r1877 | r1878 | |
|---|---|---|
| 750 | 750 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 751 | 751 | PORT_START_TAG("IN4") |
| 752 | 752 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 753 | ||
| 753 | 754 | PORT_START_TAG("COINS") |
| 754 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 755 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 755 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(dc_coin_slots_callback, &dc_coin_counts[0]) | |
| 756 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED(dc_coin_slots_callback, &dc_coin_counts[1]) | |
| 756 | 757 | INPUT_PORTS_END |
| 757 | 758 | |
| 758 | 759 | static const struct AICAinterface aica_interface = |
| r1877 | r1878 | |
| 774 | 775 | MDRV_CPU_CONFIG(sh4cpu_config) |
| 775 | 776 | MDRV_CPU_PROGRAM_MAP(naomi_map,0) |
| 776 | 777 | MDRV_CPU_IO_MAP(naomi_port,0) |
| 777 | MDRV_CPU_VBLANK_INT(naomi_vblank | |
| 778 | MDRV_CPU_VBLANK_INT("main", naomi_vblank | |
| 778 | 779 | |
| 779 | 780 | MDRV_CPU_ADD_TAG("sound", ARM7, ((XTAL_33_8688MHz*2)/3)/8) // AICA bus clock is 2/3rds * 33.8688. ARM7 gets 1 bus cycle out of each 8. |
| 780 | 781 | MDRV_CPU_PROGRAM_MAP(dc_audio_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 102 | 102 | static WRITE16_HANDLER( salamand_soundlatch_word_w ) |
| 103 | 103 | { |
| 104 | 104 | if(ACCESSING_LSB) { |
| 105 | soundlatch_w(offset,data & 0xff); | |
| 106 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 105 | soundlatch_w(machine,offset,data & 0xff); | |
| 106 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| r1877 | r1878 | |
| 245 | 245 | { |
| 246 | 246 | switch (hcrash_selected_ip & 0xf) |
| 247 | 247 | { // From WEC Le Mans Schems: |
| 248 | case 0xc: return input_port_8_r(offset); // Accel - Schems: Accelevr | |
| 249 | case 0: return input_port_8_r(offset); | |
| 250 | case 0xd: return input_port_9_r(offset); // Wheel - Schems: Handlevr | |
| 251 | case 1: return input_port_9_r(offset); | |
| 248 | case 0xc: return input_port_8_r(machine,offset); // Accel - Schems: Accelevr | |
| 249 | case 0: return input_port_8_r(machine,offset); | |
| 250 | case 0xd: return input_port_9_r(machine,offset); // Wheel - Schems: Handlevr | |
| 251 | case 1: return input_port_9_r(machine,offset); | |
| 252 | 252 | |
| 253 | 253 | default: return ~0; |
| 254 | 254 | } |
| r1877 | r1878 | |
| 257 | 257 | static WRITE16_HANDLER( nemesis_soundlatch_word_w ) |
| 258 | 258 | { |
| 259 | 259 | if(ACCESSING_LSB) { |
| 260 | soundlatch_w(offset,data & 0xff); | |
| 260 | soundlatch_w(machine,offset,data & 0xff); | |
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | 263 | |
| r1877 | r1878 | |
| 2149 | 2149 | MDRV_CPU_ADD(M68000,18432000/2) /* 9.216 MHz? */ |
| 2150 | 2150 | // 14318180/2, /* From schematics, should be accurate */ |
| 2151 | 2151 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 2152 | MDRV_CPU_VBLANK_INT(nemesis_interrupt | |
| 2152 | MDRV_CPU_VBLANK_INT("main", nemesis_interrupt | |
| 2153 | 2153 | |
| 2154 | 2154 | MDRV_CPU_ADD(Z80,14318180/4) |
| 2155 | 2155 | /* audio CPU */ /* From schematics, should be accurate */ |
| r1877 | r1878 | |
| 2197 | 2197 | /* basic machine hardware */ |
| 2198 | 2198 | MDRV_CPU_ADD(M68000,18432000/2) /* 9.216 MHz? */ |
| 2199 | 2199 | MDRV_CPU_PROGRAM_MAP(konamigt_readmem,konamigt_writemem) |
| 2200 | MDRV_CPU_VBLANK_INT(konamigt_interrupt,2) | |
| 2200 | MDRV_CPU_VBLANK_INT_HACK(konamigt_interrupt,2) | |
| 2201 | 2201 | |
| 2202 | 2202 | MDRV_CPU_ADD(Z80,14318180/4) |
| 2203 | 2203 | /* audio CPU */ /* 3.579545 MHz */ |
| r1877 | r1878 | |
| 2241 | 2241 | /* basic machine hardware */ |
| 2242 | 2242 | MDRV_CPU_ADD(M68000,18432000/2) /* 9.216MHz */ |
| 2243 | 2243 | MDRV_CPU_PROGRAM_MAP(salamand_readmem,salamand_writemem) |
| 2244 | MDRV_CPU_VBLANK_INT(salamand_interrupt | |
| 2244 | MDRV_CPU_VBLANK_INT("main", salamand_interrupt | |
| 2245 | 2245 | |
| 2246 | 2246 | MDRV_CPU_ADD(Z80, 3579545) |
| 2247 | 2247 | /* audio CPU */ /* 3.579545 MHz */ |
| r1877 | r1878 | |
| 2292 | 2292 | /* basic machine hardware */ |
| 2293 | 2293 | MDRV_CPU_ADD(M68000,18432000/2) /* 9.216 MHz? */ |
| 2294 | 2294 | MDRV_CPU_PROGRAM_MAP(blkpnthr_readmem,blkpnthr_writemem) |
| 2295 | MDRV_CPU_VBLANK_INT(blkpnthr_interrupt | |
| 2295 | MDRV_CPU_VBLANK_INT("main", blkpnthr_interrupt | |
| 2296 | 2296 | |
| 2297 | 2297 | MDRV_CPU_ADD(Z80, 3579545) |
| 2298 | 2298 | /* audio CPU */ /* 3.579545 MHz */ |
| r1877 | r1878 | |
| 2338 | 2338 | /* basic machine hardware */ |
| 2339 | 2339 | MDRV_CPU_ADD(M68000,18432000/2) /* 9.216 MHz? */ |
| 2340 | 2340 | MDRV_CPU_PROGRAM_MAP(citybomb_readmem,citybomb_writemem) |
| 2341 | MDRV_CPU_VBLANK_INT(salamand_interrupt | |
| 2341 | MDRV_CPU_VBLANK_INT("main", salamand_interrupt | |
| 2342 | 2342 | |
| 2343 | 2343 | MDRV_CPU_ADD(Z80, 3579545) |
| 2344 | 2344 | /* audio CPU */ /* 3.579545 MHz */ |
| r1877 | r1878 | |
| 2388 | 2388 | /* basic machine hardware */ |
| 2389 | 2389 | MDRV_CPU_ADD(M68000,18432000/2) /* 9.216 MHz? */ |
| 2390 | 2390 | MDRV_CPU_PROGRAM_MAP(nyanpani_readmem,nyanpani_writemem) |
| 2391 | MDRV_CPU_VBLANK_INT(salamand_interrupt | |
| 2391 | MDRV_CPU_VBLANK_INT("main", salamand_interrupt | |
| 2392 | 2392 | |
| 2393 | 2393 | MDRV_CPU_ADD(Z80, 3579545) |
| 2394 | 2394 | /* audio CPU */ /* 3.579545 MHz */ |
| r1877 | r1878 | |
| 2438 | 2438 | /* basic machine hardware */ |
| 2439 | 2439 | MDRV_CPU_ADD(M68000,18432000/2) /* 9.216MHz */ |
| 2440 | 2440 | MDRV_CPU_PROGRAM_MAP(gx400_readmem,gx400_writemem) |
| 2441 | MDRV_CPU_VBLANK_INT(gx400_interrupt,3) | |
| 2441 | MDRV_CPU_VBLANK_INT_HACK(gx400_interrupt,3) | |
| 2442 | 2442 | |
| 2443 | 2443 | MDRV_CPU_ADD(Z80,14318180/4) /* 3.579545 MHz */ |
| 2444 | 2444 | MDRV_CPU_PROGRAM_MAP(gx400_sound_readmem,gx400_sound_writemem) |
| 2445 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 2445 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 2446 | 2446 | |
| 2447 | 2447 | MDRV_MACHINE_RESET(nemesis) |
| 2448 | 2448 | |
| r1877 | r1878 | |
| 2486 | 2486 | /* basic machine hardware */ |
| 2487 | 2487 | MDRV_CPU_ADD(M68000,18432000/2) /* 9.216MHz */ |
| 2488 | 2488 | MDRV_CPU_PROGRAM_MAP(rf2_gx400_readmem,rf2_gx400_writemem) |
| 2489 | MDRV_CPU_VBLANK_INT(gx400_interrupt,3) | |
| 2489 | MDRV_CPU_VBLANK_INT_HACK(gx400_interrupt,3) | |
| 2490 | 2490 | |
| 2491 | 2491 | MDRV_CPU_ADD(Z80,14318180/4) |
| 2492 | 2492 | /* audio CPU */ /* 3.579545 MHz */ |
| 2493 | 2493 | MDRV_CPU_PROGRAM_MAP(gx400_sound_readmem,gx400_sound_writemem) |
| 2494 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 2494 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 2495 | 2495 | |
| 2496 | 2496 | MDRV_MACHINE_RESET(nemesis) |
| 2497 | 2497 | |
| r1877 | r1878 | |
| 2534 | 2534 | /* basic machine hardware */ |
| 2535 | 2535 | MDRV_CPU_ADD(M68000,18432000/3) /* 6.144MHz */ |
| 2536 | 2536 | MDRV_CPU_PROGRAM_MAP(hcrash_map,0) |
| 2537 | MDRV_CPU_VBLANK_INT(konamigt_interrupt,2) | |
| 2537 | MDRV_CPU_VBLANK_INT_HACK(konamigt_interrupt,2) | |
| 2538 | 2538 | |
| 2539 | 2539 | MDRV_CPU_ADD(Z80,14318180/4) |
| 2540 | 2540 | /* audio CPU */ /* 3.579545 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 2 | 2 | Universal Cheeky Mouse Driver |
| 3 | 3 | (c)Lee Taylor May/June 1998, All rights reserved. |
| 4 | 4 | |
| 5 | For use only in offical M | |
| 5 | For use only in offical MAME releases. | |
| 6 | 6 | Not to be distributed as part of any commerical work. |
| 7 | 7 | **************************************************************************/ |
| 8 | 8 | |
| r1877 | r1878 | |
| 10 | 10 | #include "sound/dac.h" |
| 11 | 11 | |
| 12 | 12 | |
| 13 | extern UINT8 *cheekyms_videoram; | |
| 14 | extern UINT8 *cheekyms_spriteram; | |
| 15 | extern UINT8 *cheekyms_port_80; | |
| 13 | 16 | |
| 14 | 17 | PALETTE_INIT( cheekyms ); |
| 18 | VIDEO_START( cheekyms ); | |
| 15 | 19 | VIDEO_UPDATE( cheekyms ); |
| 16 | WRITE8_HANDLER( cheekyms_sprite_w ); | |
| 17 | 20 | WRITE8_HANDLER( cheekyms_port_40_w ); |
| 18 | 21 | WRITE8_HANDLER( cheekyms_port_80_w ); |
| 19 | 22 | |
| 20 | 23 | |
| 21 | static ADDRESS_MAP_START( addressmap, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 24 | ||
| 25 | static INPUT_CHANGED( coin_inserted ) | |
| 26 | { | |
| 27 | /* this starts a 556 one-shot timer (and triggers a sound effect) */ | |
| 28 | if (newval) | |
| 29 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 30 | } | |
| 31 | ||
| 32 | ||
| 33 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 22 | 34 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 23 | 35 | AM_RANGE(0x3000, 0x33ff) AM_RAM |
| 24 | AM_RANGE(0x3800, 0x3bff) AM_RAM AM_BASE(& | |
| 36 | AM_RANGE(0x3800, 0x3bff) AM_RAM AM_BASE(&ch | |
| 25 | 37 | ADDRESS_MAP_END |
| 26 | 38 | |
| 27 | static ADDRESS_MAP_START( | |
| 39 | static ADDRESS_MAP_START( io_ | |
| 28 | 40 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 29 | 41 | AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r) |
| 30 | 42 | AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r) |
| 31 | AM_RANGE(0x20, 0x3f) AM_WRITE(cheekyms_sprite | |
| 43 | AM_RANGE(0x20, 0x3f) AM_WRITE(MWA8_RAM) AM_BASE(&cheekyms_spriteram) | |
| 32 | 44 | AM_RANGE(0x40, 0x40) AM_WRITE(cheekyms_port_40_w) |
| 33 | AM_RANGE(0x80, 0x80) AM_WRITE(cheekyms_port_80_w) | |
| 45 | AM_RANGE(0x80, 0x80) AM_WRITE(cheekyms_port_80_w) AM_BASE(&cheekyms_port_80) | |
| 34 | 46 | ADDRESS_MAP_END |
| 35 | 47 | |
| 36 | 48 | |
| 37 | static INTERRUPT_GEN( cheekyms_interrupt ) | |
| 38 | { | |
| 39 | if (readinputport(2) & 1) /* Coin */ | |
| 40 | nmi_line_pulse(machine, cpunum); | |
| 41 | else | |
| 42 | irq0_line_hold(machine, cpunum); | |
| 43 | } | |
| 44 | ||
| 45 | ||
| 46 | 49 | static INPUT_PORTS_START( cheekyms ) |
| 47 | 50 | PORT_START /* IN0 */ |
| 48 | 51 | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) ) |
| r1877 | r1878 | |
| 54 | 57 | PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) |
| 55 | 58 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_1C ) ) |
| 56 | 59 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) |
| 57 | //PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) ) | |
| 60 | //PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) ) | |
| 58 | 61 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Cabinet ) ) |
| 59 | 62 | PORT_DIPSETTING( 0x10, DEF_STR( Upright ) ) |
| 60 | 63 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) |
| r1877 | r1878 | |
| 78 | 81 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 79 | 82 | |
| 80 | 83 | PORT_START /* FAKE */ |
| 81 | /* The coin slots are not memory mapped. Coin causes a NMI, */ | |
| 82 | /* This fake input port is used by the interrupt */ | |
| 83 | /* handler to be notified of coin insertions. We use IMPULSE to */ | |
| 84 | /* trigger exactly one interrupt, without having to check when the */ | |
| 85 | /* user releases the key. */ | |
| 86 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) | |
| 84 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 87 | 85 | INPUT_PORTS_END |
| 88 | 86 | |
| 89 | 87 | |
| r1877 | r1878 | |
| 123 | 121 | |
| 124 | 122 | /* basic machine hardware */ |
| 125 | 123 | MDRV_CPU_ADD(Z80,5000000/2) /* 2.5 MHz */ |
| 126 | MDRV_CPU_PROGRAM_MAP(addressmap,0) | |
| 127 | MDRV_CPU_IO_MAP(portmap,0) | |
| 128 | MDRV_CPU_VBLANK_INT(cheekyms_interrupt,1) | |
| 124 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 125 | MDRV_CPU_IO_MAP(io_map,0) | |
| 126 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 129 | 127 | |
| 130 | 128 | /* video hardware */ |
| 131 | 129 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 139 | 137 | MDRV_PALETTE_LENGTH(0xc0) |
| 140 | 138 | |
| 141 | 139 | MDRV_PALETTE_INIT(cheekyms) |
| 140 | MDRV_VIDEO_START(cheekyms) | |
| 142 | 141 | MDRV_VIDEO_UPDATE(cheekyms) |
| 143 | 142 | |
| 144 | /* | |
| 143 | /* a | |
| 145 | 144 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 146 | 145 | |
| 147 | 146 | MDRV_SOUND_ADD(DAC, 0) |
| r1877 | r1878 | |
| 180 | 179 | |
| 181 | 180 | |
| 182 | 181 | |
| 183 | GAME( 1980 | |
| 182 | GAME( 1980 |
| r1877 | r1878 | |
|---|---|---|
| 202 | 202 | /* basic machine hardware */ |
| 203 | 203 | MDRV_CPU_ADD(M6502, 2000000) /* ? */ |
| 204 | 204 | MDRV_CPU_PROGRAM_MAP(main_cpu,0) |
| 205 | // MDRV_CPU_VBLANK_INT(progolf_interrupt | |
| 205 | // MDRV_CPU_VBLANK_INT("main", progolf_interrupt | |
| 206 | 206 | |
| 207 | 207 | // MDRV_CPU_ADD(M6502, 500000) |
| 208 | 208 | // MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 209 | // MDRV_CPU_VBLANK_INT(nmi_line_pulse,16) | |
| 209 | // MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,16) | |
| 210 | 210 | |
| 211 | 211 | /* video hardware */ |
| 212 | 212 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 365 | 365 | /* basic machine hardware */ |
| 366 | 366 | MDRV_CPU_ADD(M68000, XTAL_16MHz/2) /* verified on pcb */ |
| 367 | 367 | MDRV_CPU_PROGRAM_MAP(magmax_readmem,magmax_writemem) |
| 368 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 368 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 369 | 369 | |
| 370 | 370 | MDRV_CPU_ADD(Z80,XTAL_20MHz/8) /* verified on pcb */ |
| 371 | 371 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | static READ16_HANDLER( magicstk_port2_r ) |
| 65 | 65 | { |
| 66 | return (input_port_2_r(0) & 0xfe) | EEPROM_read_bit(); | |
| 66 | return (input_port_2_r(machine,0) & 0xfe) | EEPROM_read_bit(); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | static WRITE16_HANDLER( magicstk_coin_eeprom_w ) |
| r1877 | r1878 | |
| 335 | 335 | SET_TILE_INFO(1,code,colr >> 12,0); |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | static void draw_sprites(running_machine *machine, | |
| 338 | static void draw_sprites(running_machine *machine, | |
| 339 | 339 | { |
| 340 | 340 | int offs; |
| 341 | 341 | int height = machine->gfx[0]->height; |
| r1877 | r1878 | |
| 413 | 413 | /* basic machine hardware */ |
| 414 | 414 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 415 | 415 | MDRV_CPU_PROGRAM_MAP(powerbal_main_map, 0) |
| 416 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 416 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 417 | 417 | |
| 418 | 418 | /* video hardware */ |
| 419 | 419 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 441 | 441 | /* basic machine hardware */ |
| 442 | 442 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 443 | 443 | MDRV_CPU_PROGRAM_MAP(magicstk_main_map, 0) |
| 444 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 444 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 445 | 445 | |
| 446 | 446 | MDRV_NVRAM_HANDLER(magicstk) |
| 447 | 447 |
| r1877 | r1878 | |
|---|---|---|
| 2036 | 2036 | static READ32_HANDLER( stv_scsp_regs_r32 ) |
| 2037 | 2037 | { |
| 2038 | 2038 | offset <<= 1; |
| 2039 | return (SCSP_0_r(offset+1, 0xffff) | (SCSP_0_r(offset, 0xffff)<<16)); | |
| 2039 | return (SCSP_0_r(machine, offset+1, 0xffff) | (SCSP_0_r(machine, offset, 0xffff)<<16)); | |
| 2040 | 2040 | } |
| 2041 | 2041 | |
| 2042 | 2042 | static WRITE32_HANDLER( stv_scsp_regs_w32 ) |
| 2043 | 2043 | { |
| 2044 | 2044 | offset <<= 1; |
| 2045 | SCSP_0_w(offset, data>>16, mem_mask >> 16); | |
| 2046 | SCSP_0_w(offset+1, data, mem_mask); | |
| 2045 | SCSP_0_w(machine, offset, data>>16, mem_mask >> 16); | |
| 2046 | SCSP_0_w(machine, offset+1, data, mem_mask); | |
| 2047 | 2047 | } |
| 2048 | 2048 | |
| 2049 | 2049 | /* communication,SLAVE CPU acquires data from the MASTER CPU and triggers an irq. * |
| r1877 | r1878 | |
| 2736 | 2736 | /* basic machine hardware */ |
| 2737 | 2737 | MDRV_CPU_ADD(SH2, MASTER_CLOCK_352/2) // 28.6364 MHz |
| 2738 | 2738 | MDRV_CPU_PROGRAM_MAP(stv_mem, 0) |
| 2739 | MDRV_CPU_VBLANK_INT(stv_interrupt,264)/*264 lines,224 display lines*/ | |
| 2739 | MDRV_CPU_VBLANK_INT_HACK(stv_interrupt,264)/*264 lines,224 display lines*/ | |
| 2740 | 2740 | MDRV_CPU_CONFIG(sh2_conf_master) |
| 2741 | 2741 | |
| 2742 | 2742 | MDRV_CPU_ADD(SH2, MASTER_CLOCK_352/2) // 28.6364 MHz |
| r1877 | r1878 | |
|---|---|---|
| 262 | 262 | MDRV_CPU_ADD(Z80, 5000000) /* 5.000 MHz */ |
| 263 | 263 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 264 | 264 | MDRV_CPU_IO_MAP(readport,0) |
| 265 | MDRV_CPU_VBLANK_INT(timelimt_irq | |
| 265 | MDRV_CPU_VBLANK_INT("main", timelimt_irq | |
| 266 | 266 | |
| 267 | 267 | MDRV_CPU_ADD(Z80,18432000/6) |
| 268 | 268 | /* audio CPU */ /* 3.072 MHz */ |
| 269 | 269 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| 270 | 270 | MDRV_CPU_IO_MAP(readport_sound,writeport_sound) |
| 271 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 271 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 272 | 272 | |
| 273 | 273 | MDRV_INTERLEAVE(50) |
| 274 | 274 |
| r1877 | r1878 | |
|---|---|---|
| 158 | 158 | bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_rows, 8, 8, 32, 32); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | static void draw_sprites(running_machine *machine, | |
| 161 | static void draw_sprites(running_machine *machine, | |
| 162 | 162 | { |
| 163 | 163 | int offs; |
| 164 | 164 | |
| r1877 | r1878 | |
| 237 | 237 | /* basic machine hardware */ |
| 238 | 238 | MDRV_CPU_ADD(Z80, 18432000/6) /* (?) */ |
| 239 | 239 | MDRV_CPU_PROGRAM_MAP(cpu_map, 0) |
| 240 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 240 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 241 | 241 | |
| 242 | 242 | /* MCU */ |
| 243 | 243 | // MDRV_CPU_ADD(ALPHA8201, 18432000/6/8/2) /* (?) */ |
| r1877 | r1878 | |
|---|---|---|
| 181 | 181 | static WRITE16_HANDLER( warriorb_sound_w ) |
| 182 | 182 | { |
| 183 | 183 | if (offset == 0) |
| 184 | taitosound_port_w (0, data & 0xff); | |
| 184 | taitosound_port_w (machine, 0, data & 0xff); | |
| 185 | 185 | else if (offset == 1) |
| 186 | taitosound_comm_w (0, data & 0xff); | |
| 186 | taitosound_comm_w (machine, 0, data & 0xff); | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | static READ16_HANDLER( warriorb_sound_r ) |
| 190 | 190 | { |
| 191 | 191 | if (offset == 1) |
| 192 | return ((taitosound_comm_r (0) & 0xff)); | |
| 192 | return ((taitosound_comm_r (machine,0) & 0xff)); | |
| 193 | 193 | else return 0; |
| 194 | 194 | } |
| 195 | 195 | |
| r1877 | r1878 | |
| 488 | 488 | /* basic machine hardware */ |
| 489 | 489 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? (Might well be 16!) */ |
| 490 | 490 | MDRV_CPU_PROGRAM_MAP(darius2d_readmem,darius2d_writemem) |
| 491 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 491 | MDRV_CPU_VBLANK_INT("left", irq4_line_hold | |
| 492 | 492 | |
| 493 | 493 | MDRV_CPU_ADD(Z80,16000000/4) |
| 494 | 494 | /* audio CPU */ /* 4 MHz ? */ |
| r1877 | r1878 | |
| 547 | 547 | /* basic machine hardware */ |
| 548 | 548 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz ? */ |
| 549 | 549 | MDRV_CPU_PROGRAM_MAP(warriorb_readmem,warriorb_writemem) |
| 550 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 550 | MDRV_CPU_VBLANK_INT("left", irq4_line_hold | |
| 551 | 551 | |
| 552 | 552 | MDRV_CPU_ADD(Z80,16000000/4) |
| 553 | 553 | /* audio CPU */ /* 4 MHz ? */ |
| r1877 | r1878 | |
|---|---|---|
| 1013 | 1013 | static WRITE16_HANDLER( igs_YM3812_control_port_0_w ) |
| 1014 | 1014 | { |
| 1015 | 1015 | if (ACCESSING_LSB) |
| 1016 | YM3812_control_port_0_w(0,data); | |
| 1016 | YM3812_control_port_0_w(machine,0,data); | |
| 1017 | 1017 | } |
| 1018 | 1018 | |
| 1019 | 1019 | static WRITE16_HANDLER( igs_YM3812_write_port_0_w ) |
| 1020 | 1020 | { |
| 1021 | 1021 | if (ACCESSING_LSB) |
| 1022 | YM3812_write_port_0_w(0,data); | |
| 1022 | YM3812_write_port_0_w(machine,0,data); | |
| 1023 | 1023 | } |
| 1024 | 1024 | |
| 1025 | 1025 | static ADDRESS_MAP_START( chindrag_readmem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1877 | r1878 | |
| 1158 | 1158 | { |
| 1159 | 1159 | switch(offset) |
| 1160 | 1160 | { |
| 1161 | case 0: return ics2115_r(0); | |
| 1162 | case 1: return ics2115_r(1); | |
| 1163 | case 2: return (ics2115_r(3) << 8) | ics2115_r(2); | |
| 1161 | case 0: return ics2115_r(machine,0); | |
| 1162 | case 1: return ics2115_r(machine,1); | |
| 1163 | case 2: return (ics2115_r(machine,3) << 8) | ics2115_r(machine,2); | |
| 1164 | 1164 | } |
| 1165 | 1165 | return 0xff; |
| 1166 | 1166 | } |
| r1877 | r1878 | |
| 1170 | 1170 | switch(offset) |
| 1171 | 1171 | { |
| 1172 | 1172 | case 1: |
| 1173 | if (ACCESSING_LSB) ics2115_w(1,data); | |
| 1173 | if (ACCESSING_LSB) ics2115_w(machine,1,data); | |
| 1174 | 1174 | break; |
| 1175 | 1175 | case 2: |
| 1176 | if (ACCESSING_LSB) ics2115_w(2,data); | |
| 1177 | if (ACCESSING_MSB) ics2115_w(3,data>>8); | |
| 1176 | if (ACCESSING_LSB) ics2115_w(machine,2,data); | |
| 1177 | if (ACCESSING_MSB) ics2115_w(machine,3,data>>8); | |
| 1178 | 1178 | break; |
| 1179 | 1179 | } |
| 1180 | 1180 | } |
| r1877 | r1878 | |
| 2399 | 2399 | MDRV_IMPORT_FROM(igs_base) |
| 2400 | 2400 | MDRV_CPU_MODIFY("main") |
| 2401 | 2401 | MDRV_CPU_PROGRAM_MAP(chmplst2_readmem,chmplst2_writemem) |
| 2402 | MDRV_CPU_VBLANK_INT(chmplst2_interrupt,1+4) // lev5 frequency drives the music tempo | |
| 2402 | MDRV_CPU_VBLANK_INT_HACK(chmplst2_interrupt,1+4) // lev5 frequency drives the music tempo | |
| 2403 | 2403 | |
| 2404 | 2404 | // MDRV_GFXDECODE(chmplst2) |
| 2405 | 2405 | |
| r1877 | r1878 | |
| 2412 | 2412 | MDRV_IMPORT_FROM(igs_base) |
| 2413 | 2413 | MDRV_CPU_MODIFY("main") |
| 2414 | 2414 | MDRV_CPU_PROGRAM_MAP(chindrag_readmem,chindrag_writemem) |
| 2415 | MDRV_CPU_VBLANK_INT(chmplst2_interrupt,1+4) // lev5 frequency drives the music tempo | |
| 2415 | MDRV_CPU_VBLANK_INT_HACK(chmplst2_interrupt,1+4) // lev5 frequency drives the music tempo | |
| 2416 | 2416 | |
| 2417 | 2417 | MDRV_SOUND_ADD(YM3812, 3579545) |
| 2418 | 2418 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0) |
| r1877 | r1878 | |
| 2432 | 2432 | MDRV_IMPORT_FROM(igs_base) |
| 2433 | 2433 | MDRV_CPU_MODIFY("main") |
| 2434 | 2434 | MDRV_CPU_PROGRAM_MAP(grtwall_readmem,grtwall_writemem) |
| 2435 | MDRV_CPU_VBLANK_INT(grtwall_interrupt,2) | |
| 2435 | MDRV_CPU_VBLANK_INT_HACK(grtwall_interrupt,2) | |
| 2436 | 2436 | MACHINE_DRIVER_END |
| 2437 | 2437 | |
| 2438 | 2438 | |
| r1877 | r1878 | |
| 2451 | 2451 | MDRV_IMPORT_FROM(igs_base) |
| 2452 | 2452 | MDRV_CPU_MODIFY("main") |
| 2453 | 2453 | MDRV_CPU_PROGRAM_MAP(lhb_readmem,lhb_writemem) |
| 2454 | MDRV_CPU_VBLANK_INT(lhb_interrupt,3) | |
| 2454 | MDRV_CPU_VBLANK_INT_HACK(lhb_interrupt,3) | |
| 2455 | 2455 | MACHINE_DRIVER_END |
| 2456 | 2456 | |
| 2457 | 2457 | |
| r1877 | r1878 | |
| 2482 | 2482 | MDRV_IMPORT_FROM(igs_base) |
| 2483 | 2483 | MDRV_CPU_MODIFY("main") |
| 2484 | 2484 | MDRV_CPU_PROGRAM_MAP(vbowl_readmem,vbowl_writemem) |
| 2485 | MDRV_CPU_VBLANK_INT(vbowl_interrupt,3+4) | |
| 2485 | MDRV_CPU_VBLANK_INT_HACK(vbowl_interrupt,3+4) | |
| 2486 | 2486 | |
| 2487 | 2487 | MDRV_VIDEO_EOF(vbowl) // trackball |
| 2488 | 2488 | // MDRV_GFXDECODE(chmplst2) |
| r1877 | r1878 | |
| 2499 | 2499 | MDRV_IMPORT_FROM(igs_base) |
| 2500 | 2500 | MDRV_CPU_MODIFY("main") |
| 2501 | 2501 | MDRV_CPU_PROGRAM_MAP(xymg_readmem,xymg_writemem) |
| 2502 | MDRV_CPU_VBLANK_INT(grtwall_interrupt,2) | |
| 2502 | MDRV_CPU_VBLANK_INT_HACK(grtwall_interrupt,2) | |
| 2503 | 2503 | MACHINE_DRIVER_END |
| 2504 | 2504 | |
| 2505 | 2505 |
| r1877 | r1878 | |
|---|---|---|
| 31 | 31 | { |
| 32 | 32 | if (ACCESSING_MSB) |
| 33 | 33 | { |
| 34 | soundlatch_w(0, (data >> 8) & 0xff); | |
| 35 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 34 | soundlatch_w(machine, 0, (data >> 8) & 0xff); | |
| 35 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
| r1877 | r1878 | |
| 287 | 287 | 16*16 |
| 288 | 288 | }; |
| 289 | 289 | |
| 290 | #ifdef UNUSED_FUNCTON | |
| 290 | 291 | static const gfx_layout layout_16x16x4_2 = |
| 291 | 292 | { |
| 292 | 293 | 16,16, |
| r1877 | r1878 | |
| 299 | 300 | 256+0*32,256+1*32,256+2*32,256+3*32,256+4*32,256+5*32,256+6*32,256+7*32 }, |
| 300 | 301 | 1024 |
| 301 | 302 | }; |
| 303 | #endif | |
| 302 | 304 | |
| 303 | 305 | static GFXDECODE_START( goal92 ) |
| 304 | 306 | GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x4, 0*16, 8*16 ) // Sprites |
| r1877 | r1878 | |
| 314 | 316 | /* basic machine hardware */ |
| 315 | 317 | MDRV_CPU_ADD(M68000,12000000) |
| 316 | 318 | MDRV_CPU_PROGRAM_MAP(goal92_readmem,goal92_writemem) |
| 317 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 319 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 318 | 320 | |
| 319 | 321 | MDRV_CPU_ADD(Z80, 2500000) |
| 320 | 322 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 333 | 333 | /* basic machine hardware */ |
| 334 | 334 | MDRV_CPU_ADD(Z80, 16000000/4) /* 4MHz */ |
| 335 | 335 | MDRV_CPU_PROGRAM_MAP(champbwl_map,0) |
| 336 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 336 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 337 | 337 | |
| 338 | 338 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 339 | 339 |
| r1877 | r1878 | |
|---|---|---|
| 70 | 70 | |
| 71 | 71 | static READ16_HANDLER( bishi_sound_r ) |
| 72 | 72 | { |
| 73 | return YMZ280B_status_0_r(offset)<<8; | |
| 73 | return YMZ280B_status_0_r(machine, offset)<<8; | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | static WRITE16_HANDLER( bishi_sound_w ) |
| 77 | 77 | { |
| 78 | 78 | if (offset) |
| 79 | 79 | { |
| 80 | YMZ280B_data_0_w(offset, data>>8); | |
| 80 | YMZ280B_data_0_w(machine, offset, data>>8); | |
| 81 | 81 | } |
| 82 | 82 | else |
| 83 | 83 | { |
| 84 | YMZ280B_register_0_w(offset, data>>8); | |
| 84 | YMZ280B_register_0_w(machine, offset, data>>8); | |
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | static READ16_HANDLER( dipsw_r ) // dips |
| 89 | 89 | { |
| 90 | return input_port_1_r(0) | (input_port_5_r(0)<<8); | |
| 90 | return input_port_1_r(machine,0) | (input_port_5_r(machine,0)<<8); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | static READ16_HANDLER( player1_r ) // players 1 and 3 |
| 94 | 94 | { |
| 95 | return 0xff | (input_port_2_r(0)<<8); | |
| 95 | return 0xff | (input_port_2_r(machine,0)<<8); | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | static READ16_HANDLER( player2_r ) // players 2 and 4 |
| 99 | 99 | { |
| 100 | return input_port_3_r(0) | (input_port_4_r(0)<<8); | |
| 100 | return input_port_3_r(machine,0) | (input_port_4_r(machine,0)<<8); | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | static READ16_HANDLER( bishi_K056832_rom_r ) |
| r1877 | r1878 | |
| 115 | 115 | ouroffs += 4; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | return K056832_bishi_rom_word_r(ouroffs, mem_mask); | |
| 118 | return K056832_bishi_rom_word_r(machine, ouroffs, mem_mask); | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1877 | r1878 | |
| 268 | 268 | /* basic machine hardware */ |
| 269 | 269 | MDRV_CPU_ADD_TAG("main", M68000, 16000000) |
| 270 | 270 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 271 | MDRV_CPU_VBLANK_INT(bishi_interrupt, 2) | |
| 271 | MDRV_CPU_VBLANK_INT_HACK(bishi_interrupt, 2) | |
| 272 | 272 | |
| 273 | 273 | MDRV_MACHINE_START(bishi) |
| 274 | 274 | MDRV_MACHINE_RESET(bishi) |
| r1877 | r1878 | |
|---|---|---|
| 48 | 48 | static READ16_HANDLER( oki_r ) |
| 49 | 49 | { |
| 50 | 50 | if(offset) |
| 51 | return OKIM6295_status_0_r(0); | |
| 51 | return OKIM6295_status_0_r(machine, 0); | |
| 52 | 52 | else |
| 53 | 53 | return 0; |
| 54 | 54 | } |
| r1877 | r1878 | |
| 56 | 56 | static WRITE16_HANDLER( oki_w ) |
| 57 | 57 | { |
| 58 | 58 | if(offset) |
| 59 | OKIM6295_data_0_w(0, data); | |
| 59 | OKIM6295_data_0_w(machine, 0, data); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | static READ32_HANDLER( oki32_r ) |
| 63 | 63 | { |
| 64 | return OKIM6295_status_0_r(0) << 8; | |
| 64 | return OKIM6295_status_0_r(machine, 0) << 8; | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | static WRITE32_HANDLER( oki32_w ) |
| 68 | 68 | { |
| 69 | OKIM6295_data_0_w(0, (data >> 8) & 0xff); | |
| 69 | OKIM6295_data_0_w(machine, 0, (data >> 8) & 0xff); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | static READ16_HANDLER( ym2151_status_r ) |
| 73 | 73 | { |
| 74 | 74 | if(offset) |
| 75 | return YM2151_status_port_0_r(0); | |
| 75 | return YM2151_status_port_0_r(machine, 0); | |
| 76 | 76 | else |
| 77 | 77 | return 0; |
| 78 | 78 | } |
| r1877 | r1878 | |
| 80 | 80 | static WRITE16_HANDLER( ym2151_data_w ) |
| 81 | 81 | { |
| 82 | 82 | if(offset) |
| 83 | YM2151_data_port_0_w(0, data); | |
| 83 | YM2151_data_port_0_w(machine, 0, data); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | static WRITE16_HANDLER( ym2151_register_w ) |
| 87 | 87 | { |
| 88 | 88 | if(offset) |
| 89 | YM2151_register_port_0_w(0, data); | |
| 89 | YM2151_register_port_0_w(machine, 0, data); | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | static READ32_HANDLER( ym2151_status32_r ) |
| 93 | 93 | { |
| 94 | return YM2151_status_port_0_r(0) << 8; | |
| 94 | return YM2151_status_port_0_r(machine, 0) << 8; | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | static WRITE32_HANDLER( ym2151_data32_w ) |
| 98 | 98 | { |
| 99 | YM2151_data_port_0_w(0, (data >> 8) & 0xff); | |
| 99 | YM2151_data_port_0_w(machine, 0, (data >> 8) & 0xff); | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | static WRITE32_HANDLER( ym2151_register32_w ) |
| 103 | 103 | { |
| 104 | YM2151_register_port_0_w(0, (data >> 8) & 0xff); | |
| 104 | YM2151_register_port_0_w(machine, 0, (data >> 8) & 0xff); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | static READ16_HANDLER( eeprom_r ) |
| r1877 | r1878 | |
| 352 | 352 | -------x xxxxxxxx X offs |
| 353 | 353 | */ |
| 354 | 354 | |
| 355 | static void draw_sprites(running_machine *machine, | |
| 355 | static void draw_sprites(running_machine *machine, | |
| 356 | 356 | { |
| 357 | 357 | const gfx_element *gfx = machine->gfx[0]; |
| 358 | 358 | UINT32 cnt; |
| r1877 | r1878 | |
| 584 | 584 | static MACHINE_DRIVER_START( common ) |
| 585 | 585 | MDRV_CPU_ADD_TAG("main", E116T, 50000000) /* 50 MHz */ |
| 586 | 586 | MDRV_CPU_PROGRAM_MAP(common_map,0) |
| 587 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 587 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 588 | 588 | |
| 589 | 589 | MDRV_NVRAM_HANDLER(93C46_vamphalf) |
| 590 | 590 |
| r1877 | r1878 | |
|---|---|---|
| 268 | 268 | /* basic machine hardware */ |
| 269 | 269 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz (?) */ |
| 270 | 270 | MDRV_CPU_PROGRAM_MAP(c1942_map, 0) |
| 271 | MDRV_CPU_VBLANK_INT(c1942_interrupt,2) | |
| 271 | MDRV_CPU_VBLANK_INT_HACK(c1942_interrupt,2) | |
| 272 | 272 | |
| 273 | 273 | MDRV_CPU_ADD(Z80, 3000000) /* 3 MHz ??? */ |
| 274 | 274 | MDRV_CPU_PROGRAM_MAP(sound_map, 0) |
| 275 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 275 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 276 | 276 | |
| 277 | 277 | /* video hardware */ |
| 278 | 278 | MDRV_GFXDECODE(1942) |
| r1877 | r1878 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | static MACHINE_RESET( mayumi ) |
| 43 | 43 | { |
| 44 | bank_sel_w(0,0); | |
| 44 | bank_sel_w(machine,0,0); | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | static WRITE8_HANDLER( input_sel_w ) |
| r1877 | r1878 | |
| 273 | 273 | MDRV_CPU_ADD(Z80, MCLK/2) /* 5.000 MHz ? */ |
| 274 | 274 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 275 | 275 | MDRV_CPU_IO_MAP(readport,writeport) |
| 276 | MDRV_CPU_VBLANK_INT(mayumi_interrupt | |
| 276 | MDRV_CPU_VBLANK_INT("main", mayumi_interrupt | |
| 277 | 277 | |
| 278 | 278 | MDRV_MACHINE_RESET( mayumi ) |
| 279 | 279 |
| r1877 | r1878 | |
|---|---|---|
| 65 | 65 | { |
| 66 | 66 | if ((offset & 3) == 3) |
| 67 | 67 | { |
| 68 | watchdog_reset_w(0, 0); | |
| 68 | watchdog_reset_w(machine, 0, 0); | |
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
| r1877 | r1878 | |
| 82 | 82 | |
| 83 | 83 | if ((offset & 3) == 3) |
| 84 | 84 | { |
| 85 | watchdog_reset_r(0); | |
| 85 | watchdog_reset_r(machine, 0); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | return val; |
| r1877 | r1878 | |
| 216 | 216 | /* basic machine hardware */ |
| 217 | 217 | MDRV_CPU_ADD(M6800, 11055000 / 8) /* ? */ |
| 218 | 218 | MDRV_CPU_PROGRAM_MAP(poolshrk_cpu_map, 0) |
| 219 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 219 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 220 | 220 | |
| 221 | 221 | /* video hardware */ |
| 222 | 222 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 528 | 528 | // basic machine hardware |
| 529 | 529 | MDRV_CPU_ADD_TAG("main", M68000, XTAL_20MHz/2) /* verified on pcb */ |
| 530 | 530 | MDRV_CPU_PROGRAM_MAP(bloodbro_map, 0) |
| 531 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 531 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 532 | 532 | |
| 533 | 533 | SEIBU_SOUND_SYSTEM_CPU(XTAL_7_15909MHz/2) /* verified on pcb */ |
| 534 | 534 | |
| r1877 | r1878 | |
| 558 | 558 | |
| 559 | 559 | MDRV_CPU_MODIFY("main") |
| 560 | 560 | MDRV_CPU_PROGRAM_MAP(weststry_map, 0) |
| 561 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 561 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 562 | 562 | |
| 563 | 563 | MDRV_GFXDECODE(weststry) |
| 564 | 564 | MDRV_PALETTE_LENGTH(1024) |
| r1877 | r1878 | |
| 570 | 570 | MDRV_IMPORT_FROM(bloodbro) |
| 571 | 571 | |
| 572 | 572 | MDRV_CPU_MODIFY("main") |
| 573 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 573 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 574 | 574 | |
| 575 | 575 | MDRV_VIDEO_UPDATE(skysmash) |
| 576 | 576 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
|---|---|---|
| 228 | 228 | |
| 229 | 229 | static VIDEO_EOF( raiden ) |
| 230 | 230 | { |
| 231 | buffer_spriteram16_w(0,0,0); /* Could be a memory location instead */ | |
| 231 | buffer_spriteram16_w(machine,0,0,0); /* Could be a memory location instead */ | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | static MACHINE_DRIVER_START( raiden ) |
| r1877 | r1878 | |
| 236 | 236 | /* basic machine hardware */ |
| 237 | 237 | MDRV_CPU_ADD(V30,XTAL_20MHz/2) /* NEC V30 CPU, 20MHz verified on pcb */ |
| 238 | 238 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 239 | MDRV_CPU_VBLANK_INT(raiden_interrupt | |
| 239 | MDRV_CPU_VBLANK_INT("main", raiden_interrupt | |
| 240 | 240 | |
| 241 | 241 | MDRV_CPU_ADD(V30,XTAL_20MHz/2) /* NEC V30 CPU, 20MHz verified on pcb */ |
| 242 | 242 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| 243 | MDRV_CPU_VBLANK_INT(raiden_interrupt | |
| 243 | MDRV_CPU_VBLANK_INT("main", raiden_interrupt | |
| 244 | 244 | |
| 245 | 245 | SEIBU_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4) /* verified on pcb */ |
| 246 | 246 | |
| r1877 | r1878 | |
| 275 | 275 | /* basic machine hardware */ |
| 276 | 276 | MDRV_CPU_ADD(V30,XTAL_20MHz/2) /* NEC V30 CPU, 20MHz verified on pcb */ |
| 277 | 277 | MDRV_CPU_PROGRAM_MAP(alt_map,0) |
| 278 | MDRV_CPU_VBLANK_INT(raiden_interrupt | |
| 278 | MDRV_CPU_VBLANK_INT("main", raiden_interrupt | |
| 279 | 279 | |
| 280 | 280 | MDRV_CPU_ADD(V30,XTAL_20MHz/2) /* NEC V30 CPU, 20MHz verified on pcb */ |
| 281 | 281 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| 282 | MDRV_CPU_VBLANK_INT(raiden_interrupt | |
| 282 | MDRV_CPU_VBLANK_INT("main", raiden_interrupt | |
| 283 | 283 | |
| 284 | 284 | SEIBU_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4) /* verified on pcb */ |
| 285 | 285 |
| r1877 | r1878 | |
|---|---|---|
| 32 | 32 | static UINT8 serial_timer_active; |
| 33 | 33 | static UINT16 input_select; |
| 34 | 34 | |
| 35 | static bitmap_t *amiga_bitmap; | |
| 35 | 36 | static render_texture *video_texture; |
| 36 | 37 | static render_texture *overlay_texture; |
| 37 | 38 | |
| r1877 | r1878 | |
| 76 | 77 | /* configure for cleanup */ |
| 77 | 78 | add_exit_callback(machine, video_cleanup); |
| 78 | 79 | |
| 80 | /* allocate Amiga bitmap */ | |
| 81 | amiga_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); | |
| 82 | ||
| 79 | 83 | /* standard video start */ |
| 80 | 84 | VIDEO_START_CALL(amiga); |
| 81 | 85 | |
| r1877 | r1878 | |
| 103 | 107 | |
| 104 | 108 | static VIDEO_UPDATE( alg ) |
| 105 | 109 | { |
| 106 | /* composite the video */ | |
| 107 | if (!video_skip_this_frame()) | |
| 110 | int y; | |
| 111 | ||
| 112 | /* update the Amiga video */ | |
| 113 | for (y = cliprect->min_y; y <= cliprect->max_y; y++) | |
| 114 | amiga_render_scanline(machine, amiga_bitmap, y); | |
| 115 | ||
| 116 | /* at the end of the frame, composite the video */ | |
| 117 | if (!video_skip_this_frame() && (cliprect->max_y == machine->screen[screen].visarea.max_y)) | |
| 108 | 118 | { |
| 109 | | |
| 119 | | |
| 110 | 120 | rectangle fixedvis = machine->screen[screen].visarea; |
| 111 | 121 | fixedvis.max_x++; |
| 112 | 122 | fixedvis.max_y++; |
| r1877 | r1878 | |
| 120 | 130 | /* then overlay the Amiga video */ |
| 121 | 131 | if (overlay_texture == NULL) |
| 122 | 132 | overlay_texture = render_texture_alloc(NULL, NULL); |
| 123 | render_texture_set_bitmap(overlay_texture, | |
| 133 | render_texture_set_bitmap(overlay_texture, amiga_bitmap, &fixedvis, 0, TEXFORMAT_PALETTEA16); | |
| 124 | 134 | |
| 125 | 135 | /* add both quads to the screen */ |
| 126 | 136 | render_container_empty(render_container_get_screen(screen)); |
| 127 | 137 | render_screen_add_quad(screen, 0.0f, 0.0f, 1.0f, 1.0f, MAKE_ARGB(0xff,0xff,0xff,0xff), video_texture, PRIMFLAG_BLENDMODE(BLENDMODE_NONE) | PRIMFLAG_SCREENTEX(1)); |
| 128 | 138 | render_screen_add_quad(screen, 0.0f, 0.0f, 1.0f, 1.0f, MAKE_ARGB(0xff,0xff,0xff,0xff), overlay_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_SCREENTEX(1)); |
| 139 | ||
| 140 | /* display disc information */ | |
| 141 | if (discinfo != NULL) | |
| 142 | popmessage("%s", laserdisc_describe_state(discinfo)); | |
| 129 | 143 | } |
| 130 | 144 | |
| 131 | /* display disc information */ | |
| 132 | if (discinfo != NULL) | |
| 133 | popmessage("%s", laserdisc_describe_state(discinfo)); | |
| 134 | ||
| 135 | 145 | return 0; |
| 136 | 146 | } |
| 137 | 147 | |
| r1877 | r1878 | |
| 455 | 465 | /* basic machine hardware */ |
| 456 | 466 | MDRV_CPU_ADD_TAG("main", M68000, AMIGA_68000_NTSC_CLOCK) |
| 457 | 467 | MDRV_CPU_PROGRAM_MAP(main_map_r1,0) |
| 458 | MDRV_CPU_VBLANK_INT(amiga_scanline_callback, 262) | |
| 459 | 468 | |
| 460 | 469 | MDRV_MACHINE_START(alg) |
| 461 | 470 | MDRV_MACHINE_RESET(alg) |
| r1877 | r1878 | |
| 507 | 516 | /* adjust for PAL specs */ |
| 508 | 517 | MDRV_CPU_REPLACE("main", M68000, AMIGA_68000_PAL_CLOCK) |
| 509 | 518 | MDRV_CPU_PROGRAM_MAP(main_map_picmatic,0) |
| 510 | MDRV_CPU_VBLANK_INT(amiga_scanline_callback, 312) | |
| 511 | 519 | |
| 512 | 520 | MDRV_SCREEN_MODIFY("main") |
| 513 | 521 | MDRV_SCREEN_REFRESH_RATE(50) |
| r1877 | r1878 | |
|---|---|---|
| 146 | 146 | MDRV_CPU_ADD(S2650,2000000) /* ? MHz */ |
| 147 | 147 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 148 | 148 | MDRV_CPU_IO_MAP(readport,writeport) |
| 149 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) | |
| 150 | // MDRV_CPU_VBLANK_INT(nmi_line_pulse,1) | |
| 149 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 150 | // MDRV_CPU_VBLANK_INT("main", nmi_line_pulse) | |
| 151 | 151 | |
| 152 | 152 | /* video hardware */ |
| 153 | 153 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 26 | 26 | switch(mem_mask) |
| 27 | 27 | { |
| 28 | 28 | case 0: |
| 29 | vega_vram_w(offset,data,0x00ffffff); | |
| 30 | vega_vram_w(offset,data,0xff00ffff); | |
| 31 | vega_vram_w(offset,data,0xffff00ff); | |
| 32 | vega_vram_w(offset,data,0xffffff00); | |
| 29 | vega_vram_w(machine,offset,data,0x00ffffff); | |
| 30 | vega_vram_w(machine,offset,data,0xff00ffff); | |
| 31 | vega_vram_w(machine,offset,data,0xffff00ff); | |
| 32 | vega_vram_w(machine,offset,data,0xffffff00); | |
| 33 | 33 | return; |
| 34 | 34 | |
| 35 | 35 | case 0x0000ffff: |
| 36 | vega_vram_w(offset,data,0x00ffffff); | |
| 37 | vega_vram_w(offset,data,0xff00ffff); | |
| 36 | vega_vram_w(machine,offset,data,0x00ffffff); | |
| 37 | vega_vram_w(machine,offset,data,0xff00ffff); | |
| 38 | 38 | return; |
| 39 | 39 | |
| 40 | 40 | case 0xffff0000: |
| 41 | vega_vram_w(offset,data,0xffff00ff); | |
| 42 | vega_vram_w(offset,data,0xffffff00); | |
| 41 | vega_vram_w(machine,offset,data,0xffff00ff); | |
| 42 | vega_vram_w(machine,offset,data,0xffffff00); | |
| 43 | 43 | return; |
| 44 | 44 | |
| 45 | 45 | default: |
| r1877 | r1878 | |
| 163 | 163 | static MACHINE_DRIVER_START( vega ) |
| 164 | 164 | MDRV_CPU_ADD_TAG("cpu", GMS30C2132, 55000000) /* 55 MHz */ |
| 165 | 165 | MDRV_CPU_PROGRAM_MAP(vega_map,0) |
| 166 | MDRV_CPU_VBLANK_INT(eolith_speedup,262) | |
| 166 | MDRV_CPU_VBLANK_INT_HACK(eolith_speedup,262) | |
| 167 | 167 | |
| 168 | 168 | /* sound cpu */ |
| 169 | 169 |
| r1877 | r1878 | |
|---|---|---|
| 135 | 135 | |
| 136 | 136 | static WRITE16_HANDLER( fromanc2_sndcmd_w ) |
| 137 | 137 | { |
| 138 | soundlatch_w(offset, (data >> 8) & 0xff); // 1P (LEFT) | |
| 139 | soundlatch2_w(offset, data & 0xff); // 2P (RIGHT) | |
| 138 | soundlatch_w(machine, offset, (data >> 8) & 0xff); // 1P (LEFT) | |
| 139 | soundlatch2_w(machine, offset, data & 0xff); // 2P (RIGHT) | |
| 140 | 140 | |
| 141 | cpunum_set_input_line( | |
| 141 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 142 | 142 | fromanc2_sndcpu_nmi_flag = 0; |
| 143 | 143 | } |
| 144 | 144 | |
| r1877 | r1878 | |
| 705 | 705 | /* basic machine hardware */ |
| 706 | 706 | MDRV_CPU_ADD(M68000,32000000/2) /* 16.00 MHz */ |
| 707 | 707 | MDRV_CPU_PROGRAM_MAP(fromanc2_readmem_main,fromanc2_writemem_main) |
| 708 | MDRV_CPU_VBLANK_INT(fromanc2_interrupt | |
| 708 | MDRV_CPU_VBLANK_INT("left", fromanc2_interrupt | |
| 709 | 709 | |
| 710 | 710 | MDRV_CPU_ADD(Z80,32000000/4) |
| 711 | 711 | /* audio CPU */ /* 8.00 MHz */ |
| r1877 | r1878 | |
| 758 | 758 | /* basic machine hardware */ |
| 759 | 759 | MDRV_CPU_ADD(M68000,32000000/2) /* 16.00 MHz */ |
| 760 | 760 | MDRV_CPU_PROGRAM_MAP(fromancr_readmem_main,fromancr_writemem_main) |
| 761 | MDRV_CPU_VBLANK_INT(fromanc2_interrupt | |
| 761 | MDRV_CPU_VBLANK_INT("left", fromanc2_interrupt | |
| 762 | 762 | |
| 763 | 763 | MDRV_CPU_ADD(Z80,32000000/4) |
| 764 | 764 | /* audio CPU */ /* 8.00 MHz */ |
| r1877 | r1878 | |
| 810 | 810 | /* basic machine hardware */ |
| 811 | 811 | MDRV_CPU_ADD(M68000,32000000/2) /* 16.00 MHz */ |
| 812 | 812 | MDRV_CPU_PROGRAM_MAP(fromanc4_readmem_main,fromanc4_writemem_main) |
| 813 | MDRV_CPU_VBLANK_INT(fromanc2_interrupt | |
| 813 | MDRV_CPU_VBLANK_INT("left", fromanc2_interrupt | |
| 814 | 814 | |
| 815 | 815 | MDRV_CPU_ADD(Z80,32000000/4) |
| 816 | 816 | /* audio CPU */ /* 8.00 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 333 | 333 | /* basic machine hardware */ |
| 334 | 334 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 335 | 335 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 336 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 336 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 337 | 337 | |
| 338 | 338 | MDRV_CPU_ADD(Z80, 3072000) |
| 339 | 339 | /* audio CPU */ /* 3.072 MHz????? */ |
| 340 | 340 | MDRV_CPU_PROGRAM_MAP(bombjack_sound_readmem,bombjack_sound_writemem) |
| 341 | 341 | MDRV_CPU_IO_MAP(0,bombjack_sound_writeport) |
| 342 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 342 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 343 | 343 | |
| 344 | 344 | MDRV_MACHINE_START(bombjack) |
| 345 | 345 |
| r1877 | r1878 | |
|---|---|---|
| 228 | 228 | switch (offset) |
| 229 | 229 | { |
| 230 | 230 | case 0x00: /* BANG */ |
| 231 | rallyx_bang_w(0,bit); | |
| 231 | rallyx_bang_w(machine,0,bit); | |
| 232 | 232 | break; |
| 233 | 233 | |
| 234 | 234 | case 0x01: /* INT ON */ |
| r1877 | r1878 | |
| 272 | 272 | switch (offset) |
| 273 | 273 | { |
| 274 | 274 | case 0x00: /* SOUNDON */ |
| 275 | timeplt_sh_irqtrigger_w(0,bit); | |
| 275 | timeplt_sh_irqtrigger_w(machine,0,bit); | |
| 276 | 276 | break; |
| 277 | 277 | |
| 278 | 278 | case 0x01: /* INTST */ |
| r1877 | r1878 | |
| 299 | 299 | break; |
| 300 | 300 | |
| 301 | 301 | case 0x07: /* STARSON */ |
| 302 | tactcian_starson_w(offset,bit); | |
| 302 | tactcian_starson_w(machine,offset,bit); | |
| 303 | 303 | break; |
| 304 | 304 | } |
| 305 | 305 | } |
| r1877 | r1878 | |
| 840 | 840 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz */ |
| 841 | 841 | MDRV_CPU_PROGRAM_MAP(rallyx_map,0) |
| 842 | 842 | MDRV_CPU_IO_MAP(0,writeport) |
| 843 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 843 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 844 | 844 | |
| 845 | 845 | /* video hardware */ |
| 846 | 846 | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS) |
| r1877 | r1878 | |
| 877 | 877 | /* basic machine hardware */ |
| 878 | 878 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz */ |
| 879 | 879 | MDRV_CPU_PROGRAM_MAP(jungler_map,0) |
| 880 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 880 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 881 | 881 | |
| 882 | 882 | /* video hardware */ |
| 883 | 883 | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS) |
| r1877 | r1878 | |
|---|---|---|
| 45 | 45 | |
| 46 | 46 | static WRITE8_HANDLER( irq_enable_w) |
| 47 | 47 | { |
| 48 | interrupt_enable_w( 0, (~data) & 1 ); | |
| 48 | interrupt_enable_w( machine, 0, (~data) & 1 ); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | static int cur_dac_address = -1; |
| r1877 | r1878 | |
| 145 | 145 | /* basic machine hardware */ |
| 146 | 146 | MDRV_CPU_ADD(Z80, 18432000/6) |
| 147 | 147 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 148 | MDRV_CPU_VBLANK_INT(trucocl_interrupt | |
| 148 | MDRV_CPU_VBLANK_INT("main", trucocl_interrupt | |
| 149 | 149 | |
| 150 | 150 | /* video hardware */ |
| 151 | 151 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 41 | 41 | static MACHINE_DRIVER_START( igs_m68 ) |
| 42 | 42 | MDRV_CPU_ADD_TAG("main", M68000, 22000000 /2) // 11mhz |
| 43 | 43 | MDRV_CPU_PROGRAM_MAP(igs_m68_map,0) |
| 44 | //MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 44 | //MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 45 | 45 | |
| 46 | 46 | //MDRV_GFXDECODE(igs_m68) |
| 47 | 47 |
| r1877 | r1878 | |
|---|---|---|
| 181 | 181 | |
| 182 | 182 | /* ROZ Layers */ |
| 183 | 183 | |
| 184 | static void draw_roz( | |
| 184 | static void draw_roz( | |
| 185 | 185 | { |
| 186 | 186 | /* TODO: registers 0x40/4 / 0x44/4 and 0x50/4 / 0x54/4 are used, meaning unknown */ |
| 187 | 187 | |
| r1877 | r1878 | |
| 326 | 326 | static int flipscreen = 0; |
| 327 | 327 | |
| 328 | 328 | /* SPRITES based on tetrisp2 for now, readd priority bits later */ |
| 329 | static void draw_sprites(running_machine *machine, | |
| 329 | static void draw_sprites(running_machine *machine, | |
| 330 | 330 | { |
| 331 | 331 | /*************************************************************************** |
| 332 | 332 | |
| r1877 | r1878 | |
| 1339 | 1339 | /* basic machine hardware */ |
| 1340 | 1340 | MDRV_CPU_ADD(V70, 20000000) // 20MHz |
| 1341 | 1341 | MDRV_CPU_PROGRAM_MAP(bnstars_map,0) |
| 1342 | MDRV_CPU_VBLANK_INT(ms32_interrupt,32) | |
| 1342 | MDRV_CPU_VBLANK_INT_HACK(ms32_interrupt,32) | |
| 1343 | 1343 | |
| 1344 | 1344 | // MDRV_CPU_ADD(Z80, 4000000) /* audio CPU */ |
| 1345 | 1345 | // MDRV_CPU_PROGRAM_MAP(bnstars_z80_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 23 | 23 | ***************************************************************************/ |
| 24 | 24 | |
| 25 | 25 | #include "driver.h" |
| 26 | #include "deprecat.h" | |
| 27 | 26 | #include "machine/eeprom.h" |
| 28 | 27 | #include "unico.h" |
| 29 | 28 | #include "sound/2151intf.h" |
| r1877 | r1878 | |
| 38 | 37 | |
| 39 | 38 | ***************************************************************************/ |
| 40 | 39 | |
| 41 | static READ16_HANDLER ( YM3812_status_port_0_msb_r ) { return YM3812_status_port_0_r(0) << 8; } | |
| 42 | static WRITE16_HANDLER( YM3812_register_port_0_msb_w ) { if (ACCESSING_MSB) YM3812_control_port_0_w(0,data >> 8); } | |
| 43 | static WRITE16_HANDLER( YM3812_data_port_0_msb_w ) { if (ACCESSING_MSB) YM3812_write_port_0_w(0,data >> 8); } | |
| 40 | static READ16_HANDLER ( YM3812_status_port_0_msb_r ) { return YM3812_status_port_0_r(machine,0) << 8; } | |
| 41 | static WRITE16_HANDLER( YM3812_register_port_0_msb_w ) { if (ACCESSING_MSB) YM3812_control_port_0_w(machine,0,data >> 8); } | |
| 42 | static WRITE16_HANDLER( YM3812_data_port_0_msb_w ) { if (ACCESSING_MSB) YM3812_write_port_0_w(machine,0,data >> 8); } | |
| 44 | 43 | |
| 45 | 44 | |
| 46 | 45 | /* |
| r1877 | r1878 | |
| 135 | 134 | if (x<0x160) x=0x30 + (x*0xd0/0x15f); |
| 136 | 135 | else x=((x-0x160) * 0x20)/0x1f; |
| 137 | 136 | |
| 138 | return ((x&0xff) ^ ( | |
| 137 | return ((x&0xff) ^ (vid | |
| 139 | 138 | } |
| 140 | 139 | |
| 141 | 140 | static READ16_HANDLER( unico_guny_0_msb_r ) |
| r1877 | r1878 | |
| 144 | 143 | |
| 145 | 144 | y=0x18+((y*0xe0)/0xff); |
| 146 | 145 | |
| 147 | return ((y&0xff) ^ ( | |
| 146 | return ((y&0xff) ^ (vid | |
| 148 | 147 | } |
| 149 | 148 | |
| 150 | 149 | static READ16_HANDLER( unico_gunx_1_msb_r ) |
| r1877 | r1878 | |
| 155 | 154 | if (x<0x160) x=0x30 + (x*0xd0/0x15f); |
| 156 | 155 | else x=((x-0x160) * 0x20)/0x1f; |
| 157 | 156 | |
| 158 | return ((x&0xff) ^ ( | |
| 157 | return ((x&0xff) ^ (vid | |
| 159 | 158 | } |
| 160 | 159 | |
| 161 | 160 | static READ16_HANDLER( unico_guny_1_msb_r ) |
| r1877 | r1878 | |
| 164 | 163 | |
| 165 | 164 | y=0x18+((y*0xe0)/0xff); |
| 166 | 165 | |
| 167 | return ((y&0xff) ^ ( | |
| 166 | return ((y&0xff) ^ (vid | |
| 168 | 167 | } |
| 169 | 168 | |
| 170 | 169 | static ADDRESS_MAP_START( readmem_zeropnt, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1877 | r1878 | |
| 220 | 219 | static READ32_HANDLER( zeropnt2_dsw2_r ) { return (readinputportbytag("DSW2") << 16) | 0xffff; } |
| 221 | 220 | static READ32_HANDLER( zeropnt2_buttons_r ) { return ((readinputportbytag("IN7") | ((EEPROM_read_bit() & 0x01) << 7)) << 16) | 0xffff; } |
| 222 | 221 | |
| 223 | static READ32_HANDLER( zeropnt2_gunx_0_msb_r ) { return (unico_gunx_0_msb_r(0,0)-0x0800) << 16; } | |
| 224 | static READ32_HANDLER( zeropnt2_guny_0_msb_r ) { return (unico_guny_0_msb_r(0,0)+0x0800) << 16; } | |
| 225 | static READ32_HANDLER( zeropnt2_gunx_1_msb_r ) { return (unico_gunx_1_msb_r(0,0)-0x0800) << 16; } | |
| 226 | static READ32_HANDLER( zeropnt2_guny_1_msb_r ) { return (unico_guny_1_msb_r(0,0)+0x0800) << 16; } | |
| 222 | static READ32_HANDLER( zeropnt2_gunx_0_msb_r ) { return (unico_gunx_0_msb_r(machine,0,0)-0x0800) << 16; } | |
| 223 | static READ32_HANDLER( zeropnt2_guny_0_msb_r ) { return (unico_guny_0_msb_r(machine,0,0)+0x0800) << 16; } | |
| 224 | static READ32_HANDLER( zeropnt2_gunx_1_msb_r ) { return (unico_gunx_1_msb_r(machine,0,0)-0x0800) << 16; } | |
| 225 | static READ32_HANDLER( zeropnt2_guny_1_msb_r ) { return (unico_guny_1_msb_r(machine,0,0)+0x0800) << 16; } | |
| 227 | 226 | |
| 228 | static READ32_HANDLER ( zeropnt2_oki0_r ) { return OKIM6295_status_0_r(0) << 16; } | |
| 229 | static READ32_HANDLER ( zeropnt2_oki1_r ) { return OKIM6295_status_1_r(0) << 16; } | |
| 230 | static WRITE32_HANDLER( zeropnt2_oki0_w ) { if ((mem_mask & 0x00ff0000) == 0) OKIM6295_data_0_w(0,(data >> 16) & 0xff); } | |
| 231 | static WRITE32_HANDLER( zeropnt2_oki1_w ) { if ((mem_mask & 0x00ff0000) == 0) OKIM6295_data_1_w(0,(data >> 16) & 0xff); } | |
| 227 | static READ32_HANDLER ( zeropnt2_oki0_r ) { return OKIM6295_status_0_r(machine,0) << 16; } | |
| 228 | static READ32_HANDLER ( zeropnt2_oki1_r ) { return OKIM6295_status_1_r(machine,0) << 16; } | |
| 229 | static WRITE32_HANDLER( zeropnt2_oki0_w ) { if ((mem_mask & 0x00ff0000) == 0) OKIM6295_data_0_w(machine,0,(data >> 16) & 0xff); } | |
| 230 | static WRITE32_HANDLER( zeropnt2_oki1_w ) { if ((mem_mask & 0x00ff0000) == 0) OKIM6295_data_1_w(machine,0,(data >> 16) & 0xff); } | |
| 232 | 231 | |
| 233 | static READ32_HANDLER( zeropnt2_ym2151_status_r ) { return YM2151_status_port_0_r(0) << 16; } | |
| 234 | static WRITE32_HANDLER( zeropnt2_ym2151_reg_w ) { if ((mem_mask & 0x00ff0000) == 0) YM2151_register_port_0_w(0,(data >> 16) & 0xff); } | |
| 235 | static WRITE32_HANDLER( zeropnt2_ym2151_data_w ) { if ((mem_mask & 0x00ff0000) == 0) YM2151_data_port_0_w(0,(data >> 16) & 0xff); } | |
| 232 | static READ32_HANDLER( zeropnt2_ym2151_status_r ) { return YM2151_status_port_0_r(machine,0) << 16; } | |
| 233 | static WRITE32_HANDLER( zeropnt2_ym2151_reg_w ) { if ((mem_mask & 0x00ff0000) == 0) YM2151_register_port_0_w(machine,0,(data >> 16) & 0xff); } | |
| 234 | static WRITE32_HANDLER( zeropnt2_ym2151_data_w ) { if ((mem_mask & 0x00ff0000) == 0) YM2151_data_port_0_w(machine,0,(data >> 16) & 0xff); } | |
| 236 | 235 | |
| 237 | 236 | static WRITE32_HANDLER( zeropnt2_sound_bank_w ) |
| 238 | 237 | { |
| r1877 | r1878 | |
| 677 | 676 | /* basic machine hardware */ |
| 678 | 677 | MDRV_CPU_ADD(M68000, 16000000) |
| 679 | 678 | MDRV_CPU_PROGRAM_MAP(readmem_burglarx,writemem_burglarx) |
| 680 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 679 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 681 | 680 | |
| 682 | 681 | MDRV_MACHINE_RESET(unico) |
| 683 | 682 | |
| r1877 | r1878 | |
| 724 | 723 | /* basic machine hardware */ |
| 725 | 724 | MDRV_CPU_ADD(M68000, 16000000) |
| 726 | 725 | MDRV_CPU_PROGRAM_MAP(readmem_zeropnt,writemem_zeropnt) |
| 727 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 726 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 728 | 727 | |
| 729 | 728 | MDRV_MACHINE_RESET(zeropt) |
| 730 | 729 | |
| r1877 | r1878 | |
| 766 | 765 | /* basic machine hardware */ |
| 767 | 766 | MDRV_CPU_ADD(M68EC020, 16000000) |
| 768 | 767 | MDRV_CPU_PROGRAM_MAP(readmem_zeropnt2,writemem_zeropnt2) |
| 769 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 768 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 770 | 769 | |
| 771 | 770 | MDRV_MACHINE_RESET(zeropt) |
| 772 | 771 |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | static WRITE8_HANDLER( bankedram_w ) |
| 55 | 55 | { |
| 56 | 56 | if (palette_selected) |
| 57 | paletteram_xBBBBBGGGGGRRRRR_be_w(offset,data); | |
| 57 | paletteram_xBBBBBGGGGGRRRRR_be_w(machine,offset,data); | |
| 58 | 58 | else |
| 59 | 59 | ram[offset] = data; |
| 60 | 60 | } |
| r1877 | r1878 | |
| 222 | 222 | /* basic machine hardware */ |
| 223 | 223 | MDRV_CPU_ADD(KONAMI,3000000) /* Konami custom 052526 */ |
| 224 | 224 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 225 | MDRV_CPU_VBLANK_INT(blockhl_interrupt | |
| 225 | MDRV_CPU_VBLANK_INT("main", blockhl_interrupt | |
| 226 | 226 | |
| 227 | 227 | MDRV_CPU_ADD(Z80, 3579545) |
| 228 | 228 | /* audio CPU */ /* ? */ |
| r1877 | r1878 | |
|---|---|---|
| 81 | 81 | switch (offset) |
| 82 | 82 | { |
| 83 | 83 | case 0x80/2: |
| 84 | return input_port_0_word_r(0,mem_mask); /* DSW */ | |
| 84 | return input_port_0_word_r(machine,0,mem_mask); /* DSW */ | |
| 85 | 85 | |
| 86 | 86 | case 0x84/2: |
| 87 | return input_port_1_word_r(0,mem_mask); /* IN0 */ | |
| 87 | return input_port_1_word_r(machine,0,mem_mask); /* IN0 */ | |
| 88 | 88 | |
| 89 | 89 | case 0x86/2: |
| 90 | return input_port_2_word_r(0,mem_mask); /* IN1 */ | |
| 90 | return input_port_2_word_r(machine,0,mem_mask); /* IN1 */ | |
| 91 | 91 | |
| 92 | 92 | case 0x50: |
| 93 | 93 | case 0x51: |
| 94 | return OKIM6295_status_0_r(0)<<8; | |
| 94 | return OKIM6295_status_0_r(machine,0)<<8; | |
| 95 | 95 | break; |
| 96 | 96 | |
| 97 | 97 | } |
| r1877 | r1878 | |
| 149 | 149 | // OKIM6295 |
| 150 | 150 | case 0x50: |
| 151 | 151 | case 0x51: |
| 152 | OKIM6295_data_0_w(0, data>>8); | |
| 152 | OKIM6295_data_0_w(machine, 0, data>>8); | |
| 153 | 153 | break; |
| 154 | 154 | |
| 155 | 155 | // MSM6585 ADPCM - mini emulation |
| r1877 | r1878 | |
| 381 | 381 | /* basic machine hardware */ |
| 382 | 382 | MDRV_CPU_ADD_TAG("main", M68000, 32000000/2) /* 16 MHz ? */ |
| 383 | 383 | MDRV_CPU_PROGRAM_MAP(gcpinbal_readmem,gcpinbal_writemem) |
| 384 | MDRV_CPU_VBLANK_INT(gcpinbal_interrupt | |
| 384 | MDRV_CPU_VBLANK_INT("main", gcpinbal_interrupt | |
| 385 | 385 | |
| 386 | 386 | /* video hardware */ |
| 387 | 387 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 73 | 73 | { |
| 74 | 74 | case 0x00/2: return 0xffff; |
| 75 | 75 | case 0x02/2: return 0xffff; |
| 76 | case 0x04/2: return input_port_0_word_r(0,0);/*Service buttons*/ | |
| 77 | case 0x06/2: return input_port_1_word_r(0,0);/*DIP 2*/ | |
| 78 | case 0x08/2: return input_port_2_word_r(0,0);/*DIP 1*/ | |
| 79 | case 0x0a/2: return input_port_3_word_r(0,0);/*DIP 1+2 Hi-Bits*/ | |
| 80 | case 0x0c/2: return input_port_4_word_r(0,0);/*Handle 1p*/ | |
| 81 | case 0x0e/2: return input_port_5_word_r(0,0);/*Buttons 1p*/ | |
| 82 | case 0x10/2: return input_port_6_word_r(0,0);/*Handle 2p*/ | |
| 83 | case 0x12/2: return input_port_7_word_r(0,0);/*Buttons 2p*/ | |
| 76 | case 0x04/2: return input_port_0_word_r(machine,0,0);/*Service buttons*/ | |
| 77 | case 0x06/2: return input_port_1_word_r(machine,0,0);/*DIP 2*/ | |
| 78 | case 0x08/2: return input_port_2_word_r(machine,0,0);/*DIP 1*/ | |
| 79 | case 0x0a/2: return input_port_3_word_r(machine,0,0);/*DIP 1+2 Hi-Bits*/ | |
| 80 | case 0x0c/2: return input_port_4_word_r(machine,0,0);/*Handle 1p*/ | |
| 81 | case 0x0e/2: return input_port_5_word_r(machine,0,0);/*Buttons 1p*/ | |
| 82 | case 0x10/2: return input_port_6_word_r(machine,0,0);/*Handle 2p*/ | |
| 83 | case 0x12/2: return input_port_7_word_r(machine,0,0);/*Buttons 2p*/ | |
| 84 | 84 | } |
| 85 | 85 | return 0xffff; |
| 86 | 86 | } |
| r1877 | r1878 | |
| 92 | 92 | switch(offset) |
| 93 | 93 | { |
| 94 | 94 | case 0x00/2: return 0xffff; |
| 95 | case 0x02/2: return input_port_0_word_r(0,0);/*Service buttons*/ | |
| 95 | case 0x02/2: return input_port_0_word_r(machine,0,0);/*Service buttons*/ | |
| 96 | 96 | /*DSW,same handling as realbrk*/ |
| 97 | 97 | case 0x04/2: |
| 98 | if (sel & 0x01) return (input_port_1_word_r(0,0) & 0x00ff) << 8; // DSW1 low bits | |
| 99 | if (sel & 0x02) return (input_port_2_word_r(0,0) & 0x00ff) << 8; // DSW2 low bits | |
| 100 | if (sel & 0x04) return (input_port_3_word_r(0,0) & 0x00ff) << 8; // DSW3 low bits | |
| 101 | if (sel & 0x08) return (input_port_4_word_r(0,0) & 0x00ff) << 8; // DSW4 low bits | |
| 98 | if (sel & 0x01) return (input_port_1_word_r(machine,0,0) & 0x00ff) << 8; // DSW1 low bits | |
| 99 | if (sel & 0x02) return (input_port_2_word_r(machine,0,0) & 0x00ff) << 8; // DSW2 low bits | |
| 100 | if (sel & 0x04) return (input_port_3_word_r(machine,0,0) & 0x00ff) << 8; // DSW3 low bits | |
| 101 | if (sel & 0x08) return (input_port_4_word_r(machine,0,0) & 0x00ff) << 8; // DSW4 low bits | |
| 102 | 102 | |
| 103 | if (sel & 0x10) return ((input_port_1_word_r(0,0) & 0x0300) << 0) | // DSWs high 2 bits | |
| 104 | ((input_port_2_word_r(0,0) & 0x0300) << 2) | | |
| 105 | ((input_port_3_word_r(0,0) & 0x0300) << 4) | | |
| 106 | ((input_port_4_word_r(0,0) & 0x0300) << 6) ; | |
| 103 | if (sel & 0x10) return ((input_port_1_word_r(machine,0,0) & 0x0300) << 0) | // DSWs high 2 bits | |
| 104 | ((input_port_2_word_r(machine,0,0) & 0x0300) << 2) | | |
| 105 | ((input_port_3_word_r(machine,0,0) & 0x0300) << 4) | | |
| 106 | ((input_port_4_word_r(machine,0,0) & 0x0300) << 6) ; | |
| 107 | 107 | |
| 108 | 108 | return 0xffff; |
| 109 | case 0x06/2: return input_port_6_word_r(0,0);/*Buttons+Handle 2p*/ | |
| 110 | case 0x08/2: return input_port_5_word_r(0,0);/*Buttons+Handle 1p*/ | |
| 109 | case 0x06/2: return input_port_6_word_r(machine,0,0);/*Buttons+Handle 2p*/ | |
| 110 | case 0x08/2: return input_port_5_word_r(machine,0,0);/*Buttons+Handle 1p*/ | |
| 111 | 111 | case 0x0a/2: return 0xffff; |
| 112 | 112 | case 0x0c/2: return 0xffff; |
| 113 | 113 | case 0x0e/2: return 0xffff; |
| r1877 | r1878 | |
| 683 | 683 | /* basic machine hardware */ |
| 684 | 684 | MDRV_CPU_ADD_TAG("main",M68000,32000000 / 2) /* !! TMP68301 !! */ |
| 685 | 685 | MDRV_CPU_PROGRAM_MAP(base_mem,realbrk_mem) |
| 686 | MDRV_CPU_VBLANK_INT(realbrk_interrupt | |
| 686 | MDRV_CPU_VBLANK_INT("main", realbrk_interrupt | |
| 687 | 687 | |
| 688 | 688 | MDRV_MACHINE_RESET( tmp68301 ) |
| 689 | 689 |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | { |
| 62 | 62 | if (ACCESSING_LSB) |
| 63 | 63 | { |
| 64 | soundlatch_w(0,data & 0xff); | |
| 65 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 64 | soundlatch_w(machine,0,data & 0xff); | |
| 65 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
| r1877 | r1878 | |
| 195 | 195 | static MACHINE_DRIVER_START( diverboy ) |
| 196 | 196 | MDRV_CPU_ADD(M68000, 12000000) /* guess */ |
| 197 | 197 | MDRV_CPU_PROGRAM_MAP(diverboy_readmem,diverboy_writemem) |
| 198 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 198 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 199 | 199 | |
| 200 | 200 | MDRV_CPU_ADD(Z80, 4000000) |
| 201 | 201 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | /************************************* |
| 80 | 80 | * |
| 81 | * Special port handlers | |
| 82 | * | |
| 83 | *************************************/ | |
| 84 | ||
| 85 | static CUSTOM_INPUT( arcadia_coin_counter_r ) | |
| 86 | { | |
| 87 | /* return coin counter values */ | |
| 88 | return *(UINT8 *)param & 3; | |
| 89 | } | |
| 90 | ||
| 91 | ||
| 92 | ||
| 93 | /************************************* | |
| 94 | * | |
| 95 | 81 | * CIA-A port A access: |
| 96 | 82 | * |
| 97 | 83 | * PA7 = game port 1, pin 6 (fire) |
| r1877 | r1878 | |
| 170 | 156 | * |
| 171 | 157 | *************************************/ |
| 172 | 158 | |
| 173 | static | |
| 159 | static CUSTOM_INPUT( coin_counter_ | |
| 174 | 160 | { |
| 161 | /* return coin counter values */ | |
| 162 | return *(UINT8 *)param & 3; | |
| 163 | } | |
| 164 | ||
| 165 | ||
| 166 | static INPUT_CHANGED( coin_changed_callback ) | |
| 167 | { | |
| 175 | 168 | UINT8 *counter = param; |
| 176 | 169 | |
| 177 | 170 | /* check for a 0 -> 1 transition */ |
| r1877 | r1878 | |
| 230 | 223 | PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) |
| 231 | 224 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) |
| 232 | 225 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| 233 | PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(arcadia_coin_counter_r, &coin_counter[0]) | |
| 234 | PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(arcadia_coin_counter_r, &coin_counter[1]) | |
| 226 | PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(coin_counter_r, &coin_counter[0]) | |
| 227 | PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(coin_counter_r, &coin_counter[1]) | |
| 235 | 228 | |
| 236 | 229 | PORT_START_TAG("JOY0DAT") |
| 237 | 230 | PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(amiga_joystick_convert, "P1JOY") |
| r1877 | r1878 | |
| 261 | 254 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) |
| 262 | 255 | |
| 263 | 256 | PORT_START_TAG("COINS") |
| 264 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 265 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 257 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_changed_callback, &coin_counter[0]) | |
| 258 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED(coin_changed_callback, &coin_counter[1]) | |
| 266 | 259 | INPUT_PORTS_END |
| 267 | 260 | |
| 268 | 261 | |
| r1877 | r1878 | |
| 291 | 284 | /* basic machine hardware */ |
| 292 | 285 | MDRV_CPU_ADD(M68000, AMIGA_68000_NTSC_CLOCK) |
| 293 | 286 | MDRV_CPU_PROGRAM_MAP(amiga_map,0) |
| 294 | MDRV_CPU_VBLANK_INT(amiga_scanline_callback, 262) | |
| 295 | 287 | |
| 296 | 288 | MDRV_MACHINE_RESET(amiga) |
| 297 | 289 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r1877 | r1878 | |
| 309 | 301 | MDRV_PALETTE_INIT(amiga) |
| 310 | 302 | |
| 311 | 303 | MDRV_VIDEO_START(amiga) |
| 312 | MDRV_VIDEO_UPDATE( | |
| 304 | MDRV_VIDEO_UPDATE(a | |
| 313 | 305 | |
| 314 | 306 | /* sound hardware */ |
| 315 | 307 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| r1877 | r1878 | |
| 684 | 676 | biosrom = (UINT16 *)memory_region(REGION_USER2); |
| 685 | 677 | if (biosrom[0] != 0x4afc) |
| 686 | 678 | generic_decode(REGION_USER2, 6, 1, 0, 2, 3, 4, 5, 7); |
| 687 | ||
| 688 | /* request notifications when the coins change */ | |
| 689 | input_port_set_changed_callback(port_tag_to_index("COINS"), 0x01, coin_changed_callback, &coin_counter[0]); | |
| 690 | input_port_set_changed_callback(port_tag_to_index("COINS"), 0x02, coin_changed_callback, &coin_counter[1]); | |
| 691 | 679 | } |
| 692 | 680 | |
| 693 | 681 |
| r1877 | r1878 | |
|---|---|---|
| 133 | 133 | ***************************************************************************/ |
| 134 | 134 | |
| 135 | 135 | #include "driver.h" |
| 136 | #include "deprecat.h" | |
| 137 | 136 | #include "sound/ay8910.h" |
| 138 | 137 | #include "sound/samples.h" |
| 139 | 138 | #include "audio/segasnd.h" |
| r1877 | r1878 | |
| 179 | 178 | * |
| 180 | 179 | *************************************/ |
| 181 | 180 | |
| 182 | static | |
| 181 | static INPUT_CHANGED( service_switch | |
| 183 | 182 | { |
| 184 | 183 | /* pressing the service switch sends an NMI */ |
| 185 | 184 | if (newval) |
| 186 | cpunum_set_input_line( | |
| 185 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 187 | 186 | } |
| 188 | 187 | |
| 189 | 188 | |
| 190 | 189 | static MACHINE_START( g80v ) |
| 191 | 190 | { |
| 192 | /* request a callback if the service switch is pressed */ | |
| 193 | input_port_set_changed_callback(port_tag_to_index("SERVICESW"), 0x01, service_switch, NULL); | |
| 194 | ||
| 195 | 191 | /* register for save states */ |
| 196 | 192 | state_save_register_global_array(mult_data); |
| 197 | 193 | state_save_register_global(mult_result); |
| r1877 | r1878 | |
| 234 | 230 | } |
| 235 | 231 | |
| 236 | 232 | static WRITE8_HANDLER( mainram_w ) { mainram[decrypt_offset(offset)] = data; } |
| 237 | static WRITE8_HANDLER( usb_ram_w ) { sega_usb_ram_w(decrypt_offset(offset), data); } | |
| 233 | static WRITE8_HANDLER( usb_ram_w ) { sega_usb_ram_w(machine, decrypt_offset(offset), data); } | |
| 238 | 234 | static WRITE8_HANDLER( vectorram_w ) { vectorram[decrypt_offset(offset)] = data; } |
| 239 | 235 | |
| 240 | 236 | |
| r1877 | r1878 | |
| 508 | 504 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) /* P1.30 */ |
| 509 | 505 | |
| 510 | 506 | PORT_START_TAG("SERVICESW") |
| 511 | PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_HIGH ) | |
| 507 | PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_HIGH ) PORT_CHANGED(service_switch, 0) | |
| 512 | 508 | INPUT_PORTS_END |
| 513 | 509 | |
| 514 | 510 | |
| r1877 | r1878 | |
| 914 | 910 | MDRV_CPU_ADD(Z80, CPU_CLOCK/2) |
| 915 | 911 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 916 | 912 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 917 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 913 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 918 | 914 | |
| 919 | 915 | MDRV_MACHINE_START(g80v) |
| 920 | 916 | MDRV_MACHINE_RESET(g80v) |
| r1877 | r1878 | |
|---|---|---|
| 186 | 186 | /* basic machine hardware */ |
| 187 | 187 | MDRV_CPU_ADD(Z80,18432000/6) |
| 188 | 188 | MDRV_CPU_PROGRAM_MAP(carjmbre_readmem,carjmbre_writemem) |
| 189 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 189 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 190 | 190 | |
| 191 | 191 | MDRV_CPU_ADD(Z80, 1500000) |
| 192 | 192 | /* audio CPU */ |
| 193 | 193 | MDRV_CPU_PROGRAM_MAP(carjmbre_sound_readmem,carjmbre_sound_writemem) |
| 194 | 194 | MDRV_CPU_IO_MAP(carjmbre_sound_readport,carjmbre_sound_writeport) |
| 195 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 195 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 196 | 196 | |
| 197 | 197 | /* video hardware */ |
| 198 | 198 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 92 | 92 | |
| 93 | 93 | /* video/metro.c */ |
| 94 | 94 | extern UINT16 *metro_videoregs; |
| 95 | void metro_draw_sprites(running_machine *machine, | |
| 95 | void metro_draw_sprites(running_machine *machine, | |
| 96 | 96 | WRITE16_HANDLER( metro_paletteram_w ); |
| 97 | 97 | |
| 98 | 98 | static READ16_HANDLER ( varia_crom_read ) |
| r1877 | r1878 | |
| 208 | 208 | 16 002a 000e 0083 00ee 000f 0069 0069 0e832a-0f69ee |
| 209 | 209 | */ |
| 210 | 210 | |
| 211 | ES8712_data_0_lsb_w(offset, data, mem_mask); | |
| 211 | ES8712_data_0_lsb_w(machine, offset, data, mem_mask); | |
| 212 | 212 | logerror("PC:%06x - Writing %04x to ES8712 offset %02x\n",activecpu_get_previouspc(),data,offset); |
| 213 | 213 | } |
| 214 | 214 | |
| r1877 | r1878 | |
| 427 | 427 | static MACHINE_DRIVER_START( varia ) |
| 428 | 428 | MDRV_CPU_ADD(M68000, 16000000) |
| 429 | 429 | MDRV_CPU_PROGRAM_MAP(varia_program_map, 0) |
| 430 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 430 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 431 | 431 | |
| 432 | 432 | |
| 433 | 433 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 116 | 116 | switch (offset) |
| 117 | 117 | { |
| 118 | 118 | case 0x00: |
| 119 | return (input_port_0_word_r(0,0) << 16) | input_port_1_word_r(0,0) | | |
| 119 | return (input_port_0_word_r(machine,0,0) << 16) | input_port_1_word_r(machine,0,0) | | |
| 120 | 120 | (EEPROM_read_bit() << 7); |
| 121 | 121 | |
| 122 | 122 | case 0x01: |
| r1877 | r1878 | |
| 145 | 145 | { |
| 146 | 146 | if (ACCESSING_MSB32) /* $300000 is watchdog */ |
| 147 | 147 | { |
| 148 | watchdog_reset | |
| 148 | watchdog_reset | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | if (ACCESSING_LSB32) |
| r1877 | r1878 | |
| 177 | 177 | |
| 178 | 178 | static READ32_HANDLER( superchs_stick_r ) |
| 179 | 179 | { |
| 180 | int fake = input_port_6_word_r(0,0); | |
| 180 | int fake = input_port_6_word_r(machine,0,0); | |
| 181 | 181 | int accel; |
| 182 | 182 | |
| 183 | 183 | if (!(fake &0x10)) /* Analogue steer (the real control method) */ |
| 184 | 184 | { |
| 185 | steer = input_port_2_word_r(0,0); | |
| 185 | steer = input_port_2_word_r(machine,0,0); | |
| 186 | 186 | } |
| 187 | 187 | else /* Digital steer, with smoothing - speed depends on how often stick_r is called */ |
| 188 | 188 | { |
| r1877 | r1878 | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | /* Accelerator is an analogue input but the game treats it as digital (on/off) */ |
| 210 | if (input_port_6_word_r(0,0) & 0x1) /* pressing B1 */ | |
| 210 | if (input_port_6_word_r(machine,0,0) & 0x1) /* pressing B1 */ | |
| 211 | 211 | accel = 0x0; |
| 212 | 212 | else |
| 213 | 213 | accel = 0xff; |
| 214 | 214 | |
| 215 | 215 | /* Todo: Verify brake - and figure out other input */ |
| 216 | return (steer << 24) | (accel << 16) | (input_port_4_word_r(0,0) << 8) | input_port_5_word_r(0,0); | |
| 216 | return (steer << 24) | (accel << 16) | (input_port_4_word_r(machine,0,0) << 8) | input_port_5_word_r(machine,0,0); | |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | static WRITE32_HANDLER( superchs_stick_w ) |
| r1877 | r1878 | |
| 417 | 417 | /* basic machine hardware */ |
| 418 | 418 | MDRV_CPU_ADD(M68EC020, 16000000) /* 16 MHz */ |
| 419 | 419 | MDRV_CPU_PROGRAM_MAP(superchs_readmem,superchs_writemem) |
| 420 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 420 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 421 | 421 | |
| 422 | 422 | TAITO_F3_SOUND_SYSTEM_CPU(16000000) |
| 423 | 423 | |
| 424 | 424 | |
| 425 | 425 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 426 | 426 | MDRV_CPU_PROGRAM_MAP(superchs_cpub_readmem,superchs_cpub_writemem) |
| 427 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 427 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 428 | 428 | |
| 429 | 429 | MDRV_INTERLEAVE(8) /* CPU slices - Need to interleave Cpu's 1 & 3 */ |
| 430 | 430 |
| r1877 | r1878 | |
|---|---|---|
| 34 | 34 | static READ8_HANDLER( bottom9_bankedram1_r ) |
| 35 | 35 | { |
| 36 | 36 | if (K052109_selected) |
| 37 | return K052109_051960_r(offset); | |
| 37 | return K052109_051960_r(machine,offset); | |
| 38 | 38 | else |
| 39 | 39 | { |
| 40 | 40 | if (zoomreadroms) |
| 41 | return K051316_rom_0_r(offset); | |
| 41 | return K051316_rom_0_r(machine,offset); | |
| 42 | 42 | else |
| 43 | return K051316_0_r(offset); | |
| 43 | return K051316_0_r(machine,offset); | |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | static WRITE8_HANDLER( bottom9_bankedram1_w ) |
| 48 | 48 | { |
| 49 | if (K052109_selected) K052109_051960_w(offset,data); | |
| 50 | else K051316_0_w(offset,data); | |
| 49 | if (K052109_selected) K052109_051960_w(machine,offset,data); | |
| 50 | else K051316_0_w(machine,offset,data); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | static READ8_HANDLER( bottom9_bankedram2_r ) |
| 54 | 54 | { |
| 55 | if (K052109_selected) return K052109_051960_r(offset + 0x2000); | |
| 55 | if (K052109_selected) return K052109_051960_r(machine,offset + 0x2000); | |
| 56 | 56 | else return paletteram[offset]; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | static WRITE8_HANDLER( bottom9_bankedram2_w ) |
| 60 | 60 | { |
| 61 | if (K052109_selected) K052109_051960_w(offset + 0x2000,data); | |
| 62 | else paletteram_xBBBBBGGGGGRRRRR_be_w(offset,data); | |
| 61 | if (K052109_selected) K052109_051960_w(machine,offset + 0x2000,data); | |
| 62 | else paletteram_xBBBBBGGGGGRRRRR_be_w(machine,offset,data); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | static WRITE8_HANDLER( bankswitch_w ) |
| r1877 | r1878 | |
| 403 | 403 | /* basic machine hardware */ |
| 404 | 404 | MDRV_CPU_ADD(M6809, 2000000) /* ? */ |
| 405 | 405 | MDRV_CPU_PROGRAM_MAP(bottom9_readmem,bottom9_writemem) |
| 406 | MDRV_CPU_VBLANK_INT(bottom9_interrupt | |
| 406 | MDRV_CPU_VBLANK_INT("main", bottom9_interrupt | |
| 407 | 407 | |
| 408 | 408 | MDRV_CPU_ADD(Z80, 3579545) |
| 409 | 409 | /* audio CPU */ |
| 410 | 410 | MDRV_CPU_PROGRAM_MAP(bottom9_sound_readmem,bottom9_sound_writemem) |
| 411 | MDRV_CPU_VBLANK_INT(bottom9_sound_interrupt,8) /* irq is triggered by the main CPU */ | |
| 411 | MDRV_CPU_VBLANK_INT_HACK(bottom9_sound_interrupt,8) /* irq is triggered by the main CPU */ | |
| 412 | 412 | |
| 413 | 413 | /* video hardware */ |
| 414 | 414 | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS) |
| r1877 | r1878 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | static WRITE8_HANDLER( sound_command_w ) |
| 82 | 82 | { |
| 83 | soundlatch_w(0,data); | |
| 83 | soundlatch_w(machine,0,data); | |
| 84 | 84 | if (sn_nmi_enable) |
| 85 | cpunum_set_input_line( | |
| 85 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | static ADDRESS_MAP_START( flower_cpu1, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 235 | 235 | /* basic machine hardware */ |
| 236 | 236 | MDRV_CPU_ADD(Z80,8000000) |
| 237 | 237 | MDRV_CPU_PROGRAM_MAP(flower_cpu1,0) |
| 238 | MDRV_CPU_VBLANK_INT(irq0_line_hold,10) | |
| 239 | // MDRV_CPU_VBLANK_INT(nmi_line_pulse,1) //nmis stuff up the writes to shared ram | |
| 238 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,10) | |
| 239 | // MDRV_CPU_VBLANK_INT("main", nmi_line_pulse) //nmis stuff up the writes to shared ram | |
| 240 | 240 | |
| 241 | 241 | MDRV_CPU_ADD(Z80,8000000) |
| 242 | 242 | MDRV_CPU_PROGRAM_MAP(flower_cpu2,0) |
| 243 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) | |
| 244 | // MDRV_CPU_VBLANK_INT(nmi_line_pulse,1) | |
| 243 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 244 | // MDRV_CPU_VBLANK_INT("main", nmi_line_pulse) | |
| 245 | 245 | |
| 246 | 246 | MDRV_CPU_ADD(Z80,8000000) |
| 247 | 247 | MDRV_CPU_PROGRAM_MAP(flower_sound_cpu,0) |
| r1877 | r1878 | |
|---|---|---|
| 47 | 47 | static WRITE8_HANDLER( battlera_sound_w ) |
| 48 | 48 | { |
| 49 | 49 | if (offset==0) { |
| 50 | soundlatch_w(0,data); | |
| 51 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 50 | soundlatch_w(machine,0,data); | |
| 51 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| r1877 | r1878 | |
| 104 | 104 | static WRITE8_HANDLER( YM2203_w ) |
| 105 | 105 | { |
| 106 | 106 | switch (offset) { |
| 107 | case 0: YM2203_control_port_0_w(0,data); break; | |
| 108 | case 1: YM2203_write_port_0_w(0,data); break; | |
| 107 | case 0: YM2203_control_port_0_w(machine,0,data); break; | |
| 108 | case 1: YM2203_write_port_0_w(machine,0,data); break; | |
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
| r1877 | r1878 | |
| 274 | 274 | MDRV_CPU_ADD(H6280,21477200/3) |
| 275 | 275 | MDRV_CPU_PROGRAM_MAP(battlera_readmem,battlera_writemem) |
| 276 | 276 | MDRV_CPU_IO_MAP(0,battlera_portwrite) |
| 277 | MDRV_CPU_VBLANK_INT(battlera_interrupt,256) /* 8 prelines, 232 lines, 16 vblank? */ | |
| 277 | MDRV_CPU_VBLANK_INT_HACK(battlera_interrupt,256) /* 8 prelines, 232 lines, 16 vblank? */ | |
| 278 | 278 | |
| 279 | 279 | MDRV_CPU_ADD(H6280,21477200/3) |
| 280 | 280 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 51 | 51 | static tilemap *dreamwld_bg_tilemap; |
| 52 | 52 | static tilemap *dreamwld_bg2_tilemap; |
| 53 | 53 | |
| 54 | static void draw_sprites(running_machine *machine, | |
| 54 | static void draw_sprites(running_machine *machine, | |
| 55 | 55 | { |
| 56 | 56 | const gfx_element *gfx = machine->gfx[0]; |
| 57 | 57 | UINT32 *source = spriteram32; |
| r1877 | r1878 | |
| 221 | 221 | |
| 222 | 222 | static READ32_HANDLER(dreamwld_6295_0_r) |
| 223 | 223 | { |
| 224 | return OKIM6295_status_0_r(0)<<24; | |
| 224 | return OKIM6295_status_0_r(machine, 0)<<24; | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | static WRITE32_HANDLER(dreamwld_6295_0_w) |
| 228 | 228 | { |
| 229 | 229 | if (!(mem_mask & 0xff000000)) |
| 230 | 230 | { |
| 231 | OKIM6295_data_0_w(0, (data>>24) & 0xff); | |
| 231 | OKIM6295_data_0_w(machine, 0, (data>>24) & 0xff); | |
| 232 | 232 | } |
| 233 | 233 | else |
| 234 | 234 | { |
| r1877 | r1878 | |
| 260 | 260 | |
| 261 | 261 | static READ32_HANDLER(dreamwld_6295_1_r) |
| 262 | 262 | { |
| 263 | return OKIM6295_status_1_r(0)<<24; | |
| 263 | return OKIM6295_status_1_r(machine, 0)<<24; | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | static WRITE32_HANDLER(dreamwld_6295_1_w) |
| 267 | 267 | { |
| 268 | 268 | if (!(mem_mask & 0xff000000)) |
| 269 | 269 | { |
| 270 | OKIM6295_data_1_w(0, (data>>24) & 0xff); | |
| 270 | OKIM6295_data_1_w(machine, 0, (data>>24) & 0xff); | |
| 271 | 271 | } |
| 272 | 272 | else |
| 273 | 273 | { |
| r1877 | r1878 | |
| 448 | 448 | /* basic machine hardware */ |
| 449 | 449 | MDRV_CPU_ADD(M68EC020, MASTER_CLOCK/2) |
| 450 | 450 | MDRV_CPU_PROGRAM_MAP(dreamwld_map, 0) |
| 451 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 451 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 452 | 452 | |
| 453 | 453 | /* video hardware */ |
| 454 | 454 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 199 | 199 | |
| 200 | 200 | static WRITE8_HANDLER( xain_sound_command_w ) |
| 201 | 201 | { |
| 202 | soundlatch_w(offset,data); | |
| 203 | cpunum_set_input_line(Machine, 2,M6809_IRQ_LINE,HOLD_LINE); | |
| 202 | soundlatch_w(machine,offset,data); | |
| 203 | cpunum_set_input_line(machine, 2,M6809_IRQ_LINE,HOLD_LINE); | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | static WRITE8_HANDLER( xain_main_irq_w ) |
| r1877 | r1878 | |
| 267 | 267 | vblank=0; |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 271 | AM_RANGE(0x0000, 0x1fff) AM_READ(xain_sharedram_r) | |
| 270 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 271 | AM_RANGE(0x0000, 0x1fff) AM_READWRITE(xain_sharedram_r, xain_sharedram_w) AM_BASE(&xain_sharedram) | |
| 272 | 272 | AM_RANGE(0x2000, 0x37ff) AM_READ(MRA8_RAM) |
| 273 | AM_RANGE(0x2000, 0x27ff) AM_WRITE(xain_charram_w) AM_BASE(&xain_charram) | |
| 274 | AM_RANGE(0x2800, 0x2fff) AM_WRITE(xain_bgram1_w) AM_BASE(&xain_bgram1) | |
| 275 | AM_RANGE(0x3000, 0x37ff) AM_WRITE(xain_bgram0_w) AM_BASE(&xain_bgram0) | |
| 276 | AM_RANGE(0x3800, 0x397f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 273 | 277 | AM_RANGE(0x3a00, 0x3a00) AM_READ(input_port_0_r) |
| 278 | AM_RANGE(0x3a00, 0x3a01) AM_WRITE(xain_scrollxP1_w) | |
| 274 | 279 | AM_RANGE(0x3a01, 0x3a01) AM_READ(input_port_1_r) |
| 275 | 280 | AM_RANGE(0x3a02, 0x3a02) AM_READ(input_port_2_r) |
| 281 | AM_RANGE(0x3a02, 0x3a03) AM_WRITE(xain_scrollyP1_w) | |
| 276 | 282 | AM_RANGE(0x3a03, 0x3a03) AM_READ(input_port_3_r) |
| 277 | 283 | AM_RANGE(0x3a04, 0x3a04) AM_READ(xain_68705_r) /* from the 68705 */ |
| 284 | AM_RANGE(0x3a04, 0x3a05) AM_WRITE(xain_scrollxP0_w) | |
| 278 | 285 | AM_RANGE(0x3a05, 0x3a05) AM_READ(xain_input_port_4_r) |
| 279 | 286 | // AM_RANGE(0x3a06, 0x3a06) AM_READ(MRA8_NOP) /* ?? read (and discarded) on startup. Maybe reset the 68705 */ |
| 280 | AM_RANGE(0x4000, 0x7fff) AM_READ(MRA8_BANK1) | |
| 281 | AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM) | |
| 282 | ADDRESS_MAP_END | |
| 283 | ||
| 284 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 285 | AM_RANGE(0x0000, 0x1fff) AM_WRITE(xain_sharedram_w) AM_BASE(&xain_sharedram) | |
| 286 | AM_RANGE(0x2000, 0x27ff) AM_WRITE(xain_charram_w) AM_BASE(&xain_charram) | |
| 287 | AM_RANGE(0x2800, 0x2fff) AM_WRITE(xain_bgram1_w) AM_BASE(&xain_bgram1) | |
| 288 | AM_RANGE(0x3000, 0x37ff) AM_WRITE(xain_bgram0_w) AM_BASE(&xain_bgram0) | |
| 289 | AM_RANGE(0x3800, 0x397f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 290 | AM_RANGE(0x3a00, 0x3a01) AM_WRITE(xain_scrollxP1_w) | |
| 291 | AM_RANGE(0x3a02, 0x3a03) AM_WRITE(xain_scrollyP1_w) | |
| 292 | AM_RANGE(0x3a04, 0x3a05) AM_WRITE(xain_scrollxP0_w) | |
| 293 | 287 | AM_RANGE(0x3a06, 0x3a07) AM_WRITE(xain_scrollyP0_w) |
| 294 | 288 | AM_RANGE(0x3a08, 0x3a08) AM_WRITE(xain_sound_command_w) |
| 295 | 289 | AM_RANGE(0x3a09, 0x3a0c) AM_WRITE(xain_main_irq_w) |
| r1877 | r1878 | |
| 298 | 292 | AM_RANGE(0x3a0f, 0x3a0f) AM_WRITE(xainCPUA_bankswitch_w) |
| 299 | 293 | AM_RANGE(0x3c00, 0x3dff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram) |
| 300 | 294 | AM_RANGE(0x3e00, 0x3fff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2) |
| 301 | AM_RANGE(0x4000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 295 | AM_RANGE(0x4000, 0x7fff) AM_READ(MRA8_BANK1) | |
| 296 | AM_RANGE(0x4000, 0xffff) AM_ROM | |
| 302 | 297 | ADDRESS_MAP_END |
| 303 | 298 | |
| 304 | static ADDRESS_MAP_START( readmemB, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 305 | AM_RANGE(0x0000, 0x1fff) AM_READ(xain_sharedram_r) | |
| 306 | AM_RANGE(0x4000, 0x7fff) AM_READ(MRA8_BANK2) | |
| 307 | AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM) | |
| 308 | ADDRESS_MAP_END | |
| 309 | ||
| 310 | static ADDRESS_MAP_START( writememB, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 311 | AM_RANGE(0x0000, 0x1fff) AM_WRITE(xain_sharedram_w) | |
| 299 | static ADDRESS_MAP_START( cpu_map_B, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 300 | AM_RANGE(0x0000, 0x1fff) AM_READWRITE(xain_sharedram_r, xain_sharedram_w) | |
| 312 | 301 | AM_RANGE(0x2000, 0x2000) AM_WRITE(xain_irqA_assert_w) |
| 313 | 302 | AM_RANGE(0x2800, 0x2800) AM_WRITE(xain_irqB_clear_w) |
| 314 | 303 | AM_RANGE(0x3000, 0x3000) AM_WRITE(xainCPUB_bankswitch_w) |
| 315 | AM_RANGE(0x4000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 304 | AM_RANGE(0x4000, 0x7fff) AM_READ(MRA8_BANK2) | |
| 305 | AM_RANGE(0x4000, 0xffff) AM_ROM | |
| 316 | 306 | ADDRESS_MAP_END |
| 317 | 307 | |
| 318 | 308 | #if 0 |
| 319 | static ADDRESS_MAP_START( mcu_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 320 | AM_RANGE(0x0010, 0x007f) AM_READ(MRA8_RAM) | |
| 321 | AM_RANGE(0x0080, 0x07ff) AM_READ(MRA8_ROM) | |
| 309 | static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 310 | AM_RANGE(0x0010, 0x007f) AM_RAM | |
| 311 | AM_RANGE(0x0080, 0x07ff) AM_ROM | |
| 322 | 312 | ADDRESS_MAP_END |
| 323 | ||
| 324 | static ADDRESS_MAP_START( mcu_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 325 | AM_RANGE(0x0010, 0x007f) AM_WRITE(MWA8_RAM) | |
| 326 | AM_RANGE(0x0080, 0x07ff) AM_WRITE(MWA8_ROM) | |
| 327 | ADDRESS_MAP_END | |
| 328 | 313 | #endif |
| 329 | 314 | |
| 330 | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 331 | AM_RANGE(0x0000, 0x07ff) AM_READ(MRA8_RAM) | |
| 315 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 316 | AM_RANGE(0x0000, 0x07ff) AM_RAM | |
| 332 | 317 | AM_RANGE(0x1000, 0x1000) AM_READ(soundlatch_r) |
| 333 | AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM) | |
| 334 | ADDRESS_MAP_END | |
| 335 | ||
| 336 | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 337 | AM_RANGE(0x0000, 0x07ff) AM_WRITE(MWA8_RAM) | |
| 338 | 318 | AM_RANGE(0x2800, 0x2800) AM_WRITE(YM2203_control_port_0_w) |
| 339 | 319 | AM_RANGE(0x2801, 0x2801) AM_WRITE(YM2203_write_port_0_w) |
| 340 | 320 | AM_RANGE(0x3000, 0x3000) AM_WRITE(YM2203_control_port_1_w) |
| 341 | 321 | AM_RANGE(0x3001, 0x3001) AM_WRITE(YM2203_write_port_1_w) |
| 342 | AM_RANGE(0x4000, 0xffff) AM_ | |
| 322 | AM_RANGE(0x4000, 0xffff) AM_ | |
| 343 | 323 | ADDRESS_MAP_END |
| 344 | 324 | |
| 345 | ||
| 346 | ||
| 347 | 325 | static INPUT_PORTS_START( xsleena ) |
| 348 | 326 | PORT_START_TAG("IN0") |
| 349 | 327 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| r1877 | r1878 | |
| 468 | 446 | static MACHINE_START( xsleena ) |
| 469 | 447 | { |
| 470 | 448 | /* initialize the bank pointers */ |
| 471 | xainCPUA_bankswitch_w(0,0); | |
| 472 | xainCPUB_bankswitch_w(0,0); | |
| 449 | xainCPUA_bankswitch_w(machine,0,0); | |
| 450 | xainCPUB_bankswitch_w(machine,0,0); | |
| 473 | 451 | } |
| 474 | 452 | |
| 475 | 453 | |
| r1877 | r1878 | |
| 477 | 455 | |
| 478 | 456 | /* basic machine hardware */ |
| 479 | 457 | MDRV_CPU_ADD(M6809, 1500000) /* Confirmed 1.5MHz */ |
| 480 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 481 | MDRV_CPU_VBLANK_INT(xain_interrupt,256) | |
| 458 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 459 | MDRV_CPU_VBLANK_INT_HACK(xain_interrupt,256) | |
| 482 | 460 | |
| 483 | 461 | MDRV_CPU_ADD(M6809, 1500000) /* Confirmed 1.5MHz */ |
| 484 | MDRV_CPU_PROGRAM_MAP( | |
| 462 | MDRV_CPU_PROGRAM_MAP(cpu_map_B,0 | |
| 485 | 463 | |
| 486 | 464 | MDRV_CPU_ADD(M6809, 1500000) /* Confirmed 1.5MHz */ |
| 487 | 465 | /* audio CPU */ |
| 488 | MDRV_CPU_PROGRAM_MAP(sound_ | |
| 466 | MDRV_CPU_PROGRAM_MAP(sound_ | |
| 489 | 467 | |
| 490 | 468 | // MDRV_CPU_ADD(M68705, 3000000) /* Confirmed 3MHz */ |
| 491 | // MDRV_CPU_PROGRAM_MAP(mcu_ | |
| 469 | // MDRV_CPU_PROGRAM_MAP(mcu_ | |
| 492 | 470 | |
| 493 | 471 | MDRV_MACHINE_START(xsleena) |
| 494 | 472 |
| r1877 | r1878 | |
|---|---|---|
| 465 | 465 | MDRV_CPU_ADD(Z80, 8000000) /* 8 MHz ??? */ |
| 466 | 466 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 467 | 467 | MDRV_CPU_IO_MAP(main_portmap,0) |
| 468 | MDRV_CPU_VBLANK_INT(yamyam_interrupt,4) /* ? */ | |
| 468 | MDRV_CPU_VBLANK_INT_HACK(yamyam_interrupt,4) /* ? */ | |
| 469 | 469 | |
| 470 | 470 | /* video hardware */ |
| 471 | 471 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 178 | 178 | /* basic machine hardware */ |
| 179 | 179 | MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz */ |
| 180 | 180 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 181 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 181 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 182 | 182 | |
| 183 | 183 | /* video hardware */ |
| 184 | 184 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 998 | 998 | /* basic machine hardware */ |
| 999 | 999 | MDRV_CPU_ADD(M6809,49152000/32) |
| 1000 | 1000 | MDRV_CPU_PROGRAM_MAP(main_map, 0) |
| 1001 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1001 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1002 | 1002 | |
| 1003 | 1003 | MDRV_CPU_ADD(M6809,49152000/32) |
| 1004 | 1004 | MDRV_CPU_PROGRAM_MAP(sub_map, 0) |
| 1005 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1005 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1006 | 1006 | |
| 1007 | 1007 | MDRV_CPU_ADD(M6809,49152000/32) |
| 1008 | 1008 | MDRV_CPU_PROGRAM_MAP(sound_map, 0) |
| 1009 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1009 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1010 | 1010 | |
| 1011 | 1011 | MDRV_CPU_ADD_TAG("MCU",HD63701,49152000/8) |
| 1012 | 1012 | MDRV_CPU_PROGRAM_MAP(mcu_map, 0) |
| 1013 | 1013 | MDRV_CPU_IO_MAP(mcu_port_map, 0) |
| 1014 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1014 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1015 | 1015 | |
| 1016 | 1016 | // heavy sync required to prevent CPUs from fighting for video RAM access and going into deadlocks |
| 1017 | 1017 | MDRV_INTERLEAVE(640) |
| r1877 | r1878 | |
|---|---|---|
| 97 | 97 | upd7759_reset_w(0, data & 2); |
| 98 | 98 | upd7759_start_w(0, data & 1); |
| 99 | 99 | |
| 100 | interrupt_enable_w(0,data & 4); | |
| 100 | interrupt_enable_w(machine,0,data & 4); | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | static WRITE8_HANDLER( devstor_sh_irqcontrol_w ) |
| 104 | 104 | { |
| 105 | interrupt_enable_w(0,data & 4); | |
| 105 | interrupt_enable_w(machine,0,data & 4); | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | static WRITE8_HANDLER( mainevt_sh_bankswitch_w ) |
| r1877 | r1878 | |
| 709 | 709 | /* basic machine hardware */ |
| 710 | 710 | MDRV_CPU_ADD(HD6309, 3000000*4) /* ?? */ |
| 711 | 711 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 712 | MDRV_CPU_VBLANK_INT(mainevt_interrupt | |
| 712 | MDRV_CPU_VBLANK_INT("main", mainevt_interrupt | |
| 713 | 713 | |
| 714 | 714 | MDRV_CPU_ADD(Z80, 3579545) |
| 715 | 715 | /* audio CPU */ /* 3.579545 MHz */ |
| 716 | 716 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 717 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,8) /* ??? */ | |
| 717 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,8) /* ??? */ | |
| 718 | 718 | |
| 719 | 719 | /* video hardware */ |
| 720 | 720 | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS) |
| r1877 | r1878 | |
| 750 | 750 | /* basic machine hardware */ |
| 751 | 751 | MDRV_CPU_ADD(HD6309, 3000000*4) /* ?? */ |
| 752 | 752 | MDRV_CPU_PROGRAM_MAP(dv_readmem,dv_writemem) |
| 753 | MDRV_CPU_VBLANK_INT(dv_interrupt | |
| 753 | MDRV_CPU_VBLANK_INT("main", dv_interrupt | |
| 754 | 754 | |
| 755 | 755 | MDRV_CPU_ADD(Z80, 3579545) |
| 756 | 756 | /* audio CPU */ /* 3.579545 MHz */ |
| 757 | 757 | MDRV_CPU_PROGRAM_MAP(dv_sound_readmem,dv_sound_writemem) |
| 758 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 758 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 759 | 759 | |
| 760 | 760 | /* video hardware */ |
| 761 | 761 | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS) |
| r1877 | r1878 | |
|---|---|---|
| 1308 | 1308 | MDRV_CPU_ADD_TAG("main", Z80, 24000000/6) |
| 1309 | 1309 | MDRV_CPU_PROGRAM_MAP(ldrun_readmem,ldrun_writemem) |
| 1310 | 1310 | MDRV_CPU_IO_MAP(kungfum_readport,kungfum_writeport) |
| 1311 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1311 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1312 | 1312 | |
| 1313 | 1313 | /* video hardware */ |
| 1314 | 1314 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 448 | 448 | |
| 449 | 449 | static void profbank_banksw_restore(void) |
| 450 | 450 | { |
| 451 | profpac_banksw_w(0, profpac_bank); | |
| 451 | profpac_banksw_w(Machine, 0, profpac_bank); | |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | |
| r1877 | r1878 | |
| 524 | 524 | |
| 525 | 525 | static WRITE8_HANDLER( tenpindx_sound_w ) |
| 526 | 526 | { |
| 527 | soundlatch_w(offset, data); | |
| 528 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 527 | soundlatch_w(machine, offset, data); | |
| 528 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | |
| r1877 | r1878 | |
| 1725 | 1725 | memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x77ff, 0xff00, profpac_io_2_r); |
| 1726 | 1726 | |
| 1727 | 1727 | /* reset banking */ |
| 1728 | profpac_banksw_w(0, 0); | |
| 1728 | profpac_banksw_w(machine, 0, 0); | |
| 1729 | 1729 | state_save_register_func_postload(profbank_banksw_restore); |
| 1730 | 1730 | } |
| 1731 | 1731 | |
| r1877 | r1878 | |
| 1739 | 1739 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x97, 0x97, 0x0000, 0xff00, demndrgn_sound_w); |
| 1740 | 1740 | |
| 1741 | 1741 | /* reset banking */ |
| 1742 | profpac_banksw_w(0, 0); | |
| 1742 | profpac_banksw_w(machine, 0, 0); | |
| 1743 | 1743 | state_save_register_func_postload(profbank_banksw_restore); |
| 1744 | 1744 | } |
| 1745 | 1745 | |
| r1877 | r1878 | |
| 1758 | 1758 | memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x97, 0x97, 0x0000, 0xff00, tenpindx_sound_w); |
| 1759 | 1759 | |
| 1760 | 1760 | /* reset banking */ |
| 1761 | profpac_banksw_w(0, 0); | |
| 1761 | profpac_banksw_w(machine, 0, 0); | |
| 1762 | 1762 | state_save_register_func_postload(profbank_banksw_restore); |
| 1763 | 1763 | } |
| 1764 | 1764 |
| r1877 | r1878 | |
|---|---|---|
| 301 | 301 | /* basic machine hardware */ |
| 302 | 302 | MDRV_CPU_ADD(M6809, 18432000/9) /* 2 MHz */ |
| 303 | 303 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 304 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 304 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 305 | 305 | |
| 306 | 306 | MDRV_CPU_ADD(Z80,18432000/6) /* Z80 Clock is derived from the H1 signal */ |
| 307 | 307 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 308 | 308 | MDRV_CPU_IO_MAP(sound_readport,sound_writeport) |
| 309 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 309 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 310 | 310 | |
| 311 | 311 | MDRV_CPU_ADD(I8039,14318000/2) |
| 312 | 312 | /* audio CPU */ /* 1/2 14MHz crystal */ |
| r1877 | r1878 | |
|---|---|---|
| 60 | 60 | |
| 61 | 61 | /* spriteram is really 16-bit.. this can be changed to use 16-bit ram like the tilemaps |
| 62 | 62 | its the same sprite chip Data East used on many, many 16-bit era titles */ |
| 63 | static void draw_sprites(running_machine *machine, | |
| 63 | static void draw_sprites(running_machine *machine, | |
| 64 | 64 | { |
| 65 | 65 | int offs; |
| 66 | 66 | |
| r1877 | r1878 | |
| 74 | 74 | |
| 75 | 75 | y = spriteram32[offs]&0xffff; |
| 76 | 76 | flash=y&0x1000; |
| 77 | if (flash && ( | |
| 77 | if (flash && (vid | |
| 78 | 78 | |
| 79 | 79 | x = spriteram32[offs+2]&0xffff; |
| 80 | 80 | colour = (x >>9) & 0x1f; |
| r1877 | r1878 | |
| 175 | 175 | |
| 176 | 176 | static READ32_HANDLER(hvysmsh_oki_0_r) |
| 177 | 177 | { |
| 178 | return OKIM6295_status_0_r(0); | |
| 178 | return OKIM6295_status_0_r(machine, 0); | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | static WRITE32_HANDLER(hvysmsh_oki_0_w) |
| 182 | 182 | { |
| 183 | 183 | // data & 0xff00 is written sometimes too. game bug or needed data? |
| 184 | OKIM6295_data_0_w(0,data&0xff); | |
| 184 | OKIM6295_data_0_w(machine,0,data&0xff); | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | static READ32_HANDLER(hvysmsh_oki_1_r) |
| 188 | 188 | { |
| 189 | return OKIM6295_status_1_r(0); | |
| 189 | return OKIM6295_status_1_r(machine, 0); | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | static WRITE32_HANDLER(hvysmsh_oki_1_w) |
| 193 | 193 | { |
| 194 | OKIM6295_data_1_w(0,data&0xff); | |
| 194 | OKIM6295_data_1_w(machine,0,data&0xff); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | static READ32_HANDLER(wcvol95_eeprom_r) |
| r1877 | r1878 | |
| 211 | 211 | static WRITE32_HANDLER(wcvol95_nonbuffered_palette_w) |
| 212 | 212 | { |
| 213 | 213 | COMBINE_DATA(&paletteram32[offset]); |
| 214 | palette_set_color_rgb( | |
| 214 | palette_set_color_rgb(machine,offset,pal5bit(paletteram32[offset] >> 0),pal5bit(paletteram32[offset] >> 5),pal5bit(paletteram32[offset] >> 10)); | |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | |
| 218 | 218 | static READ32_HANDLER( deco156_snd_r ) |
| 219 | 219 | { |
| 220 | return YMZ280B_status_0_r(0); | |
| 220 | return YMZ280B_status_0_r(machine, 0); | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | static WRITE32_HANDLER( deco156_snd_w ) |
| 224 | 224 | { |
| 225 | 225 | if (offset) |
| 226 | YMZ280B_data_0_w(0, data); | |
| 226 | YMZ280B_data_0_w(machine, 0, data); | |
| 227 | 227 | else |
| 228 | YMZ280B_register_0_w(0, data); | |
| 228 | YMZ280B_register_0_w(machine, 0, data); | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /***************************************************************************/ |
| r1877 | r1878 | |
| 237 | 237 | static WRITE32_HANDLER( wcvol95_pf12_control_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&deco16_pf12_control[offset]); } |
| 238 | 238 | static READ32_HANDLER( wcvol95_pf1_data_r ) { return deco16_pf1_data[offset]^0xffff0000; } |
| 239 | 239 | static READ32_HANDLER( wcvol95_pf2_data_r ) { return deco16_pf2_data[offset]^0xffff0000; } |
| 240 | static WRITE32_HANDLER( wcvol95_pf1_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf1_data_w(offset,data,mem_mask); } | |
| 241 | static WRITE32_HANDLER( wcvol95_pf2_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf2_data_w(offset,data,mem_mask); } | |
| 240 | static WRITE32_HANDLER( wcvol95_pf1_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf1_data_w(machine,offset,data,mem_mask); } | |
| 241 | static WRITE32_HANDLER( wcvol95_pf2_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf2_data_w(machine,offset,data,mem_mask); } | |
| 242 | 242 | |
| 243 | 243 | |
| 244 | 244 | static ADDRESS_MAP_START( hvysmsh_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| r1877 | r1878 | |
| 426 | 426 | /* basic machine hardware */ |
| 427 | 427 | MDRV_CPU_ADD(ARM, 28000000) /* Unconfirmed */ |
| 428 | 428 | MDRV_CPU_PROGRAM_MAP(hvysmsh_map,0) |
| 429 | MDRV_CPU_VBLANK_INT(deco32_vbl_interrupt | |
| 429 | MDRV_CPU_VBLANK_INT("main", deco32_vbl_interrupt | |
| 430 | 430 | |
| 431 | 431 | MDRV_NVRAM_HANDLER(93C46) |
| 432 | 432 | |
| r1877 | r1878 | |
| 465 | 465 | /* basic machine hardware */ |
| 466 | 466 | MDRV_CPU_ADD(ARM, 28000000) /* Unconfirmed */ |
| 467 | 467 | MDRV_CPU_PROGRAM_MAP(wcvol95_map,0) |
| 468 | MDRV_CPU_VBLANK_INT(deco32_vbl_interrupt | |
| 468 | MDRV_CPU_VBLANK_INT("main", deco32_vbl_interrupt | |
| 469 | 469 | |
| 470 | 470 | MDRV_NVRAM_HANDLER(93C46) |
| 471 | 471 |
| r1877 | r1878 | |
|---|---|---|
| 117 | 117 | |
| 118 | 118 | static WRITE16_HANDLER ( pass_soundwrite ) |
| 119 | 119 | { |
| 120 | soundlatch_w(0,data & 0xff); | |
| 120 | soundlatch_w(machine,0,data & 0xff); | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /* todo: check all memory regions actually readable / read from */ |
| r1877 | r1878 | |
| 273 | 273 | /* basic machine hardware */ |
| 274 | 274 | MDRV_CPU_ADD(M68000, 14318180/2 ) |
| 275 | 275 | MDRV_CPU_PROGRAM_MAP(pass_readmem,pass_writemem) |
| 276 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 276 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 277 | 277 | |
| 278 | 278 | MDRV_CPU_ADD(Z80, 14318180/4 ) |
| 279 | 279 | /* audio CPU */ |
| 280 | 280 | MDRV_CPU_PROGRAM_MAP(pass_sound_readmem,pass_sound_writemem) |
| 281 | 281 | MDRV_CPU_IO_MAP(pass_sound_readport,pass_sound_writeport) |
| 282 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 282 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 283 | 283 | |
| 284 | 284 | /* video hardware */ |
| 285 | 285 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | |
| 62 | 62 | static WRITE16_HANDLER( tokib_soundcommand16_w ) |
| 63 | 63 | { |
| 64 | soundlatch_w(0,data & 0xff); | |
| 65 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 64 | soundlatch_w(machine,0,data & 0xff); | |
| 65 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static READ16_HANDLER( pip16_r ) |
| r1877 | r1878 | |
| 438 | 438 | /* basic machine hardware */ |
| 439 | 439 | MDRV_CPU_ADD(M68000,XTAL_20MHz /2) /* verified on pcb */ |
| 440 | 440 | MDRV_CPU_PROGRAM_MAP(toki_map,0) |
| 441 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 441 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 442 | 442 | |
| 443 | 443 | SEIBU_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4) /* verifed on pcb */ |
| 444 | 444 | |
| r1877 | r1878 | |
| 470 | 470 | /* basic machine hardware */ |
| 471 | 471 | MDRV_CPU_ADD(M68000, 12000000) /* 10MHz causes bad slowdowns with monkey machine rd1 */ |
| 472 | 472 | MDRV_CPU_PROGRAM_MAP(tokib_map,0) |
| 473 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 473 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 474 | 474 | |
| 475 | 475 | MDRV_CPU_ADD(Z80, 4000000) /* verified with PCB */ |
| 476 | 476 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 462 | 462 | { |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | static void drawCrt(running_machine *machine, | |
| 465 | static void drawCrt(running_machine *machine, | |
| 466 | 466 | { |
| 467 | 467 | int x,y; |
| 468 | 468 | for (y=0;y<maxy;y++) |
| r1877 | r1878 | |
| 690 | 690 | MDRV_CPU_PROGRAM_MAP(mem_map, 0) |
| 691 | 691 | MDRV_CPU_IO_MAP(io_map, 0) |
| 692 | 692 | |
| 693 | MDRV_CPU_VBLANK_INT(dwarfd_interrupt,NUM_LINES+4) //16 +vblank + 1 unused | |
| 693 | MDRV_CPU_VBLANK_INT_HACK(dwarfd_interrupt,NUM_LINES+4) //16 +vblank + 1 unused | |
| 694 | 694 | |
| 695 | 695 | /* video hardware */ |
| 696 | 696 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 266 | 266 | |
| 267 | 267 | static WRITE8_HANDLER( sound_command_w ) |
| 268 | 268 | { |
| 269 | soundlatch_w(0,data); | |
| 269 | soundlatch_w(machine,0,data); | |
| 270 | 270 | timer_call_after_resynch(NULL, data,nmi_callback); |
| 271 | 271 | } |
| 272 | 272 | |
| r1877 | r1878 | |
| 297 | 297 | |
| 298 | 298 | static READ8_HANDLER( fortyl_mcu_r ) |
| 299 | 299 | { |
| 300 | return buggychl_mcu_r(offset); | |
| 300 | return buggychl_mcu_r(machine,offset); | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | static READ8_HANDLER( fortyl_mcu_status_r ) |
| 304 | 304 | { |
| 305 | return buggychl_mcu_status_r(offset); | |
| 305 | return buggychl_mcu_status_r(machine,offset); | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | static WRITE8_HANDLER( fortyl_mcu_w ) |
| 309 | 309 | { |
| 310 | buggychl_mcu_w(offset,data); | |
| 310 | buggychl_mcu_w(machine,offset,data); | |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | static WRITE8_HANDLER( bank_select_w ) |
| r1877 | r1878 | |
| 1098 | 1098 | /* basic machine hardware */ |
| 1099 | 1099 | MDRV_CPU_ADD(Z80,8000000/2) /* OK */ |
| 1100 | 1100 | MDRV_CPU_PROGRAM_MAP(40love_map,0) |
| 1101 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1101 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1102 | 1102 | |
| 1103 | 1103 | MDRV_CPU_ADD(Z80,8000000/2) |
| 1104 | 1104 | /* audio CPU */ /* OK */ |
| 1105 | 1105 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 1106 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) /* source/number of IRQs is unknown */ | |
| 1106 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) /* source/number of IRQs is unknown */ | |
| 1107 | 1107 | |
| 1108 | 1108 | MDRV_CPU_ADD(M68705,18432000/6) /* OK */ |
| 1109 | 1109 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| r1877 | r1878 | |
| 1145 | 1145 | /* basic machine hardware */ |
| 1146 | 1146 | MDRV_CPU_ADD(Z80,8000000/2) |
| 1147 | 1147 | MDRV_CPU_PROGRAM_MAP(undoukai_map,0) |
| 1148 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1148 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1149 | 1149 | |
| 1150 | 1150 | MDRV_CPU_ADD(Z80,8000000/2) |
| 1151 | 1151 | /* audio CPU */ |
| 1152 | 1152 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 1153 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) /* source/number of IRQs is unknown */ | |
| 1153 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) /* source/number of IRQs is unknown */ | |
| 1154 | 1154 | |
| 1155 | 1155 | // MDRV_CPU_ADD(M68705,18432000/6) |
| 1156 | 1156 | // MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 168 | 168 | |
| 169 | 169 | static WRITE8_HANDLER( flip_screen_w ) |
| 170 | 170 | { |
| 171 | tutankhm_flip_screen_x_w(0, data); | |
| 172 | tutankhm_flip_screen_y_w(0, data); | |
| 171 | tutankhm_flip_screen_x_w(machine, 0, data); | |
| 172 | tutankhm_flip_screen_y_w(machine, 0, data); | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | |
| r1877 | r1878 | |
| 337 | 337 | /* basic machine hardware */ |
| 338 | 338 | MDRV_CPU_ADD(M6809, 1500000) /* 1.5 MHz ??? */ |
| 339 | 339 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 340 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 340 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 341 | 341 | |
| 342 | 342 | MDRV_CPU_ADD(Z80,14318000/8) |
| 343 | 343 | /* audio CPU */ /* 1.78975 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 200 | 200 | |
| 201 | 201 | static WRITE8_HANDLER( sound_w ) |
| 202 | 202 | { |
| 203 | soundlatch_w(offset, data); | |
| 204 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, HOLD_LINE); | |
| 203 | soundlatch_w(machine, offset, data); | |
| 204 | cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, HOLD_LINE); | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /********************************************************************************************/ |
| r1877 | r1878 | |
| 788 | 788 | /* basic machine hardware */ |
| 789 | 789 | MDRV_CPU_ADD(M6502, 12000000/8) /* 1.5 MHz (measured) */ |
| 790 | 790 | MDRV_CPU_PROGRAM_MAP(main_readmem,main_writemem) |
| 791 | MDRV_CPU_VBLANK_INT(renegade_interrupt,2) | |
| 791 | MDRV_CPU_VBLANK_INT_HACK(renegade_interrupt,2) | |
| 792 | 792 | |
| 793 | 793 | MDRV_CPU_ADD(M6809, 12000000/8) |
| 794 | 794 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 270 | 270 | MDRV_CPU_ADD(Z80, 3579545) /* 3.579545 Mhz */ |
| 271 | 271 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 272 | 272 | MDRV_CPU_IO_MAP(readport,writeport) |
| 273 | MDRV_CPU_VBLANK_INT(sg100a_interrupt | |
| 273 | MDRV_CPU_VBLANK_INT("main", sg100a_interrupt | |
| 274 | 274 | |
| 275 | 275 | /* video hardware */ |
| 276 | 276 | MDRV_IMPORT_FROM(tms9928a) |
| r1877 | r1878 | |
|---|---|---|
| 814 | 814 | |
| 815 | 815 | /* Reset all latches */ |
| 816 | 816 | for (i = 0;i < 8;i++) |
| 817 | bosco_latch_w(i,0); | |
| 817 | bosco_latch_w(machine,i,0); | |
| 818 | 818 | |
| 819 | 819 | namco_06xx_init(0, 0, |
| 820 | 820 | NAMCOIO_51XX, &intf0, |
| r1877 | r1878 | |
| 835 | 835 | |
| 836 | 836 | /* Reset all latches */ |
| 837 | 837 | for (i = 0;i < 8;i++) |
| 838 | bosco_latch_w(i,0); | |
| 838 | bosco_latch_w(machine,i,0); | |
| 839 | 839 | |
| 840 | 840 | namco_06xx_init(0, 0, |
| 841 | 841 | NAMCOIO_51XX, &intf0, |
| r1877 | r1878 | |
| 850 | 850 | |
| 851 | 851 | /* Reset all latches */ |
| 852 | 852 | for (i = 0;i < 8;i++) |
| 853 | bosco_latch_w(i,0); | |
| 853 | bosco_latch_w(machine,i,0); | |
| 854 | 854 | |
| 855 | 855 | namco_06xx_init(0, 0, |
| 856 | 856 | NAMCOIO_51XX, &intf0, |
| r1877 | r1878 | |
| 865 | 865 | |
| 866 | 866 | /* Reset all latches */ |
| 867 | 867 | for (i = 0;i < 8;i++) |
| 868 | bosco_latch_w(i,0); | |
| 868 | bosco_latch_w(machine,i,0); | |
| 869 | 869 | |
| 870 | 870 | battles_customio_init(); |
| 871 | 871 | } |
| r1877 | r1878 | |
| 876 | 876 | |
| 877 | 877 | /* Reset all latches */ |
| 878 | 878 | for (i = 0;i < 8;i++) |
| 879 | bosco_latch_w(i,0); | |
| 879 | bosco_latch_w(machine,i,0); | |
| 880 | 880 | |
| 881 | 881 | namco_06xx_init(0, 0, |
| 882 | 882 | NAMCOIO_51XX, &intf0, |
| r1877 | r1878 | |
| 1621 | 1621 | /* basic machine hardware */ |
| 1622 | 1622 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz */ |
| 1623 | 1623 | MDRV_CPU_PROGRAM_MAP(bosco_map,0) |
| 1624 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1624 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1625 | 1625 | |
| 1626 | 1626 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz */ |
| 1627 | 1627 | MDRV_CPU_PROGRAM_MAP(bosco_map,0) |
| 1628 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1628 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1629 | 1629 | |
| 1630 | 1630 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz */ |
| 1631 | 1631 | MDRV_CPU_PROGRAM_MAP(bosco_map,0) |
| 1632 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,2) /* 64V */ | |
| 1632 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,2) /* 64V */ | |
| 1633 | 1633 | |
| 1634 | 1634 | MDRV_CPU_ADD_TAG(CPUTAG_50XX, MB8842, 18432000/12/6) /* 1.536 MHz, internally divided by 6 */ |
| 1635 | 1635 | MDRV_CPU_PROGRAM_MAP(namco_50xx_map_program,0) |
| r1877 | r1878 | |
| 1690 | 1690 | /* basic machine hardware */ |
| 1691 | 1691 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz */ |
| 1692 | 1692 | MDRV_CPU_PROGRAM_MAP(galaga_map,0) |
| 1693 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1693 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1694 | 1694 | |
| 1695 | 1695 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz */ |
| 1696 | 1696 | MDRV_CPU_PROGRAM_MAP(galaga_map,0) |
| 1697 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1697 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1698 | 1698 | |
| 1699 | 1699 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz */ |
| 1700 | 1700 | MDRV_CPU_PROGRAM_MAP(galaga_map,0) |
| 1701 | MDRV_CPU_VBLANK_INT(galaga_cpu3_nmi,4) /* 64V (see notes at the top of the driver) */ | |
| 1701 | MDRV_CPU_VBLANK_INT_HACK(galaga_cpu3_nmi,4) /* 64V (see notes at the top of the driver) */ | |
| 1702 | 1702 | |
| 1703 | 1703 | MDRV_CPU_ADD_TAG(CPUTAG_54XX, MB8844, 18432000/12/6) /* 1.536 MHz, internally divided by 6 */ |
| 1704 | 1704 | MDRV_CPU_PROGRAM_MAP(namco_54xx_map_program,0) |
| r1877 | r1878 | |
| 1759 | 1759 | /* basic machine hardware */ |
| 1760 | 1760 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz */ |
| 1761 | 1761 | MDRV_CPU_PROGRAM_MAP(xevious_map,0) |
| 1762 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1762 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1763 | 1763 | |
| 1764 | 1764 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz */ |
| 1765 | 1765 | MDRV_CPU_PROGRAM_MAP(xevious_map,0) |
| 1766 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1766 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1767 | 1767 | |
| 1768 | 1768 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz */ |
| 1769 | 1769 | MDRV_CPU_PROGRAM_MAP(xevious_map,0) |
| 1770 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,2) /* 64V */ | |
| 1770 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,2) /* 64V */ | |
| 1771 | 1771 | |
| 1772 | 1772 | MDRV_CPU_ADD_TAG(CPUTAG_50XX, MB8842, 18432000/12/6) /* 1.536 MHz, internally divided by 6 */ |
| 1773 | 1773 | MDRV_CPU_PROGRAM_MAP(namco_50xx_map_program,0) |
| r1877 | r1878 | |
| 1822 | 1822 | |
| 1823 | 1823 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz */ |
| 1824 | 1824 | MDRV_CPU_PROGRAM_MAP(readmem4_battles,writemem4_battles) |
| 1825 | MDRV_CPU_VBLANK_INT(battles_interrupt_4 | |
| 1825 | MDRV_CPU_VBLANK_INT("main", battles_interrupt_4 | |
| 1826 | 1826 | |
| 1827 | 1827 | MDRV_MACHINE_RESET(battles) |
| 1828 | 1828 | |
| r1877 | r1878 | |
| 1843 | 1843 | /* basic machine hardware */ |
| 1844 | 1844 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz */ |
| 1845 | 1845 | MDRV_CPU_PROGRAM_MAP(digdug_map,0) |
| 1846 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1846 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1847 | 1847 | |
| 1848 | 1848 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz */ |
| 1849 | 1849 | MDRV_CPU_PROGRAM_MAP(digdug_map,0) |
| 1850 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1850 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1851 | 1851 | |
| 1852 | 1852 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz */ |
| 1853 | 1853 | MDRV_CPU_PROGRAM_MAP(digdug_map,0) |
| 1854 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,2) /* 64V */ | |
| 1854 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,2) /* 64V */ | |
| 1855 | 1855 | |
| 1856 | 1856 | MDRV_INTERLEAVE(100) /* 100 CPU slices per frame - an high value to ensure proper */ |
| 1857 | 1857 | /* synchronization of the CPUs */ |
| r1877 | r1878 | |
|---|---|---|
| 194 | 194 | colortable_configure_tilemap_groups(machine->colortable, txttilemap, machine->gfx[0], 0); |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | static void draw_sprites(running_machine *machine, | |
| 197 | static void draw_sprites(running_machine *machine, | |
| 198 | 198 | { |
| 199 | 199 | int offs,fx,fy,x,y,color,sprite; |
| 200 | 200 | |
| r1877 | r1878 | |
| 358 | 358 | static MACHINE_DRIVER_START( panicr ) |
| 359 | 359 | MDRV_CPU_ADD(V20,16000000/2) /* Sony 8623h9 CXQ70116D-8 (V20 compatible) */ |
| 360 | 360 | MDRV_CPU_PROGRAM_MAP(panicr_map,0) |
| 361 | MDRV_CPU_VBLANK_INT(panicr_interrupt,2) | |
| 361 | MDRV_CPU_VBLANK_INT_HACK(panicr_interrupt,2) | |
| 362 | 362 | |
| 363 | 363 | MDRV_CPU_ADD_TAG(CPUTAG_T5182,Z80,14318180/4) /* 3.579545 MHz */ |
| 364 | 364 | MDRV_CPU_PROGRAM_MAP(t5182_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 333 | 333 | MDRV_CPU_ADD(Z80, GUESSED_CLOCK) |
| 334 | 334 | MDRV_CPU_PROGRAM_MAP(z80_0_mem,0) |
| 335 | 335 | MDRV_CPU_IO_MAP(z80_0_io,0) |
| 336 | MDRV_CPU_VBLANK_INT(vblank_callback_istellar | |
| 336 | MDRV_CPU_VBLANK_INT("main", vblank_callback_istellar | |
| 337 | 337 | |
| 338 | 338 | /* sound cpu */ |
| 339 | 339 | MDRV_CPU_ADD(Z80, GUESSED_CLOCK) |
| r1877 | r1878 | |
|---|---|---|
| 20 | 20 | hardware. The music ends at the perfect time with this clock speed |
| 21 | 21 | - Lasso: fire button auto-repeats on high score entry screen (real behavior?) |
| 22 | 22 | |
| 23 | *************************************************************************** | |
| 24 | ||
| 25 | DIP locations verified for: | |
| 26 | - lasso | |
| 27 | ||
| 23 | 28 | ***************************************************************************/ |
| 24 | 29 | |
| 25 | 30 | #include "driver.h" |
| r1877 | r1878 | |
| 31 | 36 | #include "sound/ay8910.h" |
| 32 | 37 | |
| 33 | 38 | |
| 34 | /* IRQ = VBlank, NMI = Coin Insertion */ | |
| 35 | ||
| 36 | static UINT8 coins_old; | |
| 37 | ||
| 38 | static INTERRUPT_GEN( lasso_interrupt ) | |
| 39 | static INPUT_CHANGED( coin_inserted ) | |
| 39 | 40 | { |
| 40 | // VBlank | |
| 41 | if (cpu_getiloops() == 0) | |
| 42 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 43 | else | |
| 44 | { | |
| 45 | UINT8 coins_new; | |
| 46 | ||
| 47 | // Coins | |
| 48 | coins_new = ~readinputport(3) & 0x30; | |
| 49 | ||
| 50 | if ( ((coins_new & 0x10) && !(coins_old & 0x10)) || | |
| 51 | ((coins_new & 0x20) && !(coins_old & 0x20)) ) | |
| 52 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 53 | ||
| 54 | coins_old = coins_new; | |
| 55 | } | |
| 41 | /* coin insertion causes an NMI */ | |
| 42 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); | |
| 56 | 43 | } |
| 57 | 44 | |
| 58 | 45 | |
| 59 | ||
| 60 | 46 | /* Write to the sound latch and generate an IRQ on the sound CPU */ |
| 61 | 47 | |
| 62 | 48 | static UINT8 *lasso_chip_data; |
| r1877 | r1878 | |
| 64 | 50 | |
| 65 | 51 | static WRITE8_HANDLER( sound_command_w ) |
| 66 | 52 | { |
| 67 | soundlatch_w(offset,data); | |
| 68 | cpunum_set_input_line(Machine, 1, 0, PULSE_LINE); | |
| 53 | soundlatch_w(machine,offset,data); | |
| 54 | cpunum_set_input_line(machine, 1, 0, PULSE_LINE); | |
| 69 | 55 | } |
| 70 | 56 | |
| 71 | 57 | static WRITE8_HANDLER( pinbo_sound_command_w ) |
| 72 | 58 | { |
| 73 | soundlatch_w(offset,data); | |
| 74 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 59 | soundlatch_w(machine,offset,data); | |
| 60 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 75 | 61 | } |
| 76 | 62 | |
| 77 | 63 | static READ8_HANDLER( sound_status_r ) |
| r1877 | r1878 | |
| 85 | 71 | UINT8 to_write = BITSWAP8(*lasso_chip_data, 0, 1, 2, 3, 4, 5, 6, 7); |
| 86 | 72 | |
| 87 | 73 | if (~data & 0x01) /* chip #0 */ |
| 88 | SN76496_0_w(0, to_write); | |
| 74 | SN76496_0_w(machine, 0, to_write); | |
| 89 | 75 | |
| 90 | 76 | if (~data & 0x02) /* chip #1 */ |
| 91 | SN76496_1_w(0, to_write); | |
| 77 | SN76496_1_w(machine, 0, to_write); | |
| 92 | 78 | } |
| 93 | 79 | |
| 94 | static MACHINE_START( lasso ) | |
| 95 | { | |
| 96 | /* register for saving */ | |
| 97 | state_save_register_global(coins_old); | |
| 98 | } | |
| 99 | 80 | |
| 100 | ||
| 101 | 81 | static ADDRESS_MAP_START( lasso_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 102 | 82 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 103 | 83 | AM_RANGE(0x0400, 0x07ff) AM_READWRITE(MRA8_RAM, lasso_videoram_w) AM_BASE(&lasso_videoram) |
| r1877 | r1878 | |
| 253 | 233 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 254 | 234 | |
| 255 | 235 | PORT_START_TAG("1806") |
| 256 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) | |
| 236 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:!1") | |
| 257 | 237 | PORT_DIPSETTING( 0x01, DEF_STR( Upright ) ) |
| 258 | 238 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) |
| 259 | PORT_DIPNAME( 0x0e, 0x0 | |
| 239 | PORT_DIPNAME( 0x0e, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:!2,!3,!4") | |
| 260 | 240 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) |
| 261 | PORT_DIPSETTING( | |
| 241 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 262 | 242 | PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) |
| 263 | 243 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C ) ) |
| 264 | 244 | PORT_DIPSETTING( 0x0c, DEF_STR( 1C_6C ) ) |
| 265 | // PORT_DIPSETTING( 0x06, DEF_STR( 1C_1C ) ) | |
| 266 | // PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 267 | // PORT_DIPSETTING( 0x0a, DEF_STR( 1C_1C ) ) | |
| 268 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) ) | |
| 269 | PORT_DIPSETTING( 0x30, "3" ) | |
| 245 | // PORT_DIPSETTING( 0x06, DEF_STR( 1C_1C ) ) /* Not documented */ | |
| 246 | // PORT_DIPSETTING( 0x0a, DEF_STR( 1C_1C ) ) /* Not documented */ | |
| 247 | // PORT_DIPSETTING( 0x0e, DEF_STR( 1C_1C ) ) /* Not documented */ | |
| 248 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") | |
| 249 | PORT_DIPSETTING( 0x00, "3" ) | |
| 270 | 250 | PORT_DIPSETTING( 0x10, "4" ) |
| 271 | 251 | PORT_DIPSETTING( 0x20, "5" ) |
| 272 | // PORT_DIPSETTING( 0x00, "3" ) | |
| 273 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coin_B ) ) | |
| 252 | // PORT_DIPSETTING( 0x30, "3" ) /* Not documented */ | |
| 253 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:!1") | |
| 274 | 254 | PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) |
| 275 | 255 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 276 | PORT_DIPNAME( 0x80, 0x80, "Warm-Up Instructions" ) | |
| 256 | PORT_DIPNAME( 0x80, 0x80, "Warm-Up Instructions" ) PORT_DIPLOCATION("SW1:!4") /* Listed as "Unused" */ | |
| 277 | 257 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 278 | 258 | PORT_DIPSETTING( 0x80, DEF_STR( Yes ) ) |
| 279 | 259 | |
| 280 | 260 | PORT_START_TAG("1807") |
| 281 | PORT_DIPNAME( 0x01, 0x00, "Warm-Up" ) | |
| 261 | PORT_DIPNAME( 0x01, 0x00, "Warm-Up" ) PORT_DIPLOCATION("SW1:!3") | |
| 282 | 262 | PORT_DIPSETTING( 0x01, DEF_STR( No ) ) |
| 283 | 263 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 284 | PORT_DIPNAME( 0x02, 0x00, "Warm-Up Language" ) | |
| 264 | PORT_DIPNAME( 0x02, 0x00, "Warm-Up Language" ) PORT_DIPLOCATION("SW1:!2") | |
| 285 | 265 | PORT_DIPSETTING( 0x00, DEF_STR( English ) ) |
| 286 | 266 | PORT_DIPSETTING( 0x02, DEF_STR( German ) ) |
| 287 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) /* used */ | |
| 288 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 289 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 290 | PORT_DIPNAME( 0x08, 0x00, "Invulnerability (Cheat)") | |
| 267 | PORT_DIPUNUSED_DIPLOC( 0x04, 0x00, "SW1:!5" ) /* Listed as "Unused" */ | |
| 268 | PORT_DIPNAME( 0x08, 0x00, "Invulnerability (Cheat)") PORT_DIPLOCATION("SW1:!6") /* Listed as "Test" */ | |
| 291 | 269 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 292 | 270 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 293 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 294 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 271 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 272 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 295 | 273 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 ) |
| 296 | 274 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 ) |
| 297 | 275 | INPUT_PORTS_END |
| 298 | 276 | |
| 299 | 277 | static INPUT_PORTS_START( chameleo ) |
| 300 | PORT_START_TAG("1804") | |
| 301 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY | |
| 302 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY | |
| 303 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY | |
| 304 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY | |
| 305 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) | |
| 278 | PORT_INCLUDE( lasso ) | |
| 279 | ||
| 280 | PORT_MODIFY("1804") | |
| 306 | 281 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 307 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 308 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 309 | 282 | |
| 310 | PORT_START_TAG("1805") | |
| 311 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL | |
| 312 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL | |
| 313 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL | |
| 314 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL | |
| 315 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL | |
| 283 | PORT_MODIFY("1805") | |
| 316 | 284 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 317 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 318 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 319 | 285 | |
| 320 | PORT_START_TAG("1806") | |
| 321 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) | |
| 322 | PORT_DIPSETTING( 0x01, DEF_STR( Upright ) ) | |
| 323 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) | |
| 324 | PORT_DIPNAME( 0x0e, 0x0e, DEF_STR( Coin_A ) ) | |
| 325 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 326 | PORT_DIPSETTING( 0x0e, DEF_STR( 1C_1C ) ) | |
| 327 | PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) | |
| 328 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C ) ) | |
| 329 | PORT_DIPSETTING( 0x0c, DEF_STR( 1C_6C ) ) | |
| 330 | // PORT_DIPSETTING( 0x06, DEF_STR( 1C_1C ) ) | |
| 331 | // PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 332 | // PORT_DIPSETTING( 0x0a, DEF_STR( 1C_1C ) ) | |
| 333 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) ) | |
| 286 | PORT_MODIFY("1806") | |
| 287 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") | |
| 334 | 288 | PORT_DIPSETTING( 0x00, "3" ) |
| 335 | 289 | PORT_DIPSETTING( 0x30, "5" ) |
| 336 | 290 | // PORT_DIPSETTING( 0x10, "5" ) |
| 337 | 291 | PORT_DIPSETTING( 0x20, "Infinite (Cheat)") |
| 338 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coin_B ) ) | |
| 339 | PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) | |
| 340 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 341 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 342 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 343 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 292 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:!4" ) | |
| 344 | 293 | |
| 345 | PORT_START_TAG("1807") | |
| 346 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) /* probably unused */ | |
| 347 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 348 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 349 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) /* probably unused */ | |
| 350 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 351 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 352 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) /* probably unused */ | |
| 353 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 354 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 355 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) ) | |
| 294 | PORT_MODIFY("1807") | |
| 295 | PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "SW1:!3" ) /* Probably unused */ | |
| 296 | PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "SW1:!2" ) /* Probably unused */ | |
| 297 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:!5" ) /* Probably unused */ | |
| 298 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!6") | |
| 356 | 299 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 357 | 300 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 358 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 359 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 360 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 ) | |
| 361 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 362 | 301 | INPUT_PORTS_END |
| 363 | 302 | |
| 364 | 303 | static INPUT_PORTS_START( wwjgtin ) |
| 365 | PORT_START_TAG("1804") | |
| 366 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY | |
| 367 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY | |
| 368 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY | |
| 369 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY | |
| 370 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) | |
| 371 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) | |
| 372 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 373 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 304 | PORT_INCLUDE( lasso ) | |
| 374 | 305 | |
| 375 | PORT_ | |
| 306 | PORT_MODIFY | |
| 376 | 307 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2) |
| 377 | 308 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2) |
| 378 | 309 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2) |
| 379 | 310 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2) |
| 380 | 311 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 381 | 312 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 382 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 383 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 384 | 313 | |
| 385 | PORT_START_TAG("1806") | |
| 386 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) /* used - has to do with the controls */ | |
| 387 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 388 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 389 | PORT_DIPNAME( 0x0e, 0x0e, DEF_STR( Coin_A ) ) | |
| 390 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 391 | PORT_DIPSETTING( 0x0e, DEF_STR( 1C_1C ) ) | |
| 392 | PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) | |
| 393 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C ) ) | |
| 394 | PORT_DIPSETTING( 0x0c, DEF_STR( 1C_6C ) ) | |
| 395 | // PORT_DIPSETTING( 0x06, DEF_STR( 1C_1C ) ) | |
| 396 | // PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 397 | // PORT_DIPSETTING( 0x0a, DEF_STR( 1C_1C ) ) | |
| 398 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) /* probably unused */ | |
| 399 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 400 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 401 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) /* probably unused */ | |
| 402 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 403 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 404 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coin_B ) ) | |
| 405 | PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) | |
| 406 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 407 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) /* probably unused */ | |
| 408 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 409 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 314 | PORT_MODIFY("1806") | |
| 315 | PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "SW2:!1" ) /* used - has to do with the controls */ | |
| 316 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW2:!5" ) /* probably unused */ | |
| 317 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW2:!6" ) /* probably unused */ | |
| 318 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:!4" ) /* probably unused */ | |
| 410 | 319 | |
| 411 | PORT_START_TAG("1807") | |
| 412 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life) ) | |
| 320 | PORT_MODIFY("1807") | |
| 321 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life) ) PORT_DIPLOCATION("SW1:!3") | |
| 413 | 322 | PORT_DIPSETTING( 0x00, "20k" ) |
| 414 | 323 | PORT_DIPSETTING( 0x01, "50k" ) |
| 415 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) ) | |
| 324 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!2") | |
| 416 | 325 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 417 | 326 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 418 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) /* probably unused */ | |
| 419 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 420 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 421 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) /* probably unused */ | |
| 422 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 423 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 424 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 425 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 327 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:!5" ) /* probably unused */ | |
| 328 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:!6" ) /* probably unused */ | |
| 329 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 330 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 426 | 331 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START1 ) |
| 427 | 332 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 ) |
| 428 | 333 | INPUT_PORTS_END |
| 429 | 334 | |
| 430 | 335 | static INPUT_PORTS_START( pinbo ) |
| 431 | PORT_START_TAG("1804") | |
| 336 | PORT_INCLUDE( lasso ) | |
| 337 | ||
| 338 | PORT_MODIFY("1804") | |
| 432 | 339 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 433 | 340 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 434 | 341 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY |
| r1877 | r1878 | |
| 438 | 345 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 439 | 346 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 440 | 347 | |
| 441 | PORT_ | |
| 348 | PORT_MODIFY | |
| 442 | 349 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL |
| 443 | 350 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL |
| 444 | 351 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL |
| r1877 | r1878 | |
| 448 | 355 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 449 | 356 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 450 | 357 | |
| 451 | PORT_START_TAG("1806") | |
| 452 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) | |
| 453 | PORT_DIPSETTING( 0x01, DEF_STR( Upright ) ) | |
| 454 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) | |
| 455 | PORT_DIPNAME( 0x0e, 0x0e, DEF_STR( Coin_A ) ) | |
| 456 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 457 | PORT_DIPSETTING( 0x0e, DEF_STR( 1C_1C ) ) | |
| 458 | PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) | |
| 459 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C ) ) | |
| 460 | PORT_DIPSETTING( 0x0c, DEF_STR( 1C_6C ) ) | |
| 461 | // PORT_DIPSETTING( 0x06, DEF_STR( 1C_1C ) ) | |
| 462 | // PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 463 | // PORT_DIPSETTING( 0x0a, DEF_STR( 1C_1C ) ) | |
| 464 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) ) | |
| 358 | PORT_MODIFY("1806") | |
| 359 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") | |
| 465 | 360 | PORT_DIPSETTING( 0x00, "3" ) |
| 466 | 361 | PORT_DIPSETTING( 0x10, "4" ) |
| 467 | 362 | PORT_DIPSETTING( 0x20, "5" ) |
| 468 | 363 | PORT_DIPSETTING( 0x30, "70 (Cheat)") |
| 469 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coin_B ) ) | |
| 470 | PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) | |
| 471 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 472 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) /* probably unused */ | |
| 473 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 474 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 364 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:!4" ) /* probably unused */ | |
| 475 | 365 | |
| 476 | PORT_START_TAG("1807") | |
| 477 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life) ) | |
| 478 | PORT_DIPSETTING( 0x00, "500000,1000000" ) | |
| 366 | PORT_MODIFY("1807") | |
| 367 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life) ) PORT_DIPLOCATION("SW1:!3") | |
| 368 | PORT_DIPSETTING( 0x00, "500000, 1000000" ) | |
| 479 | 369 | PORT_DIPSETTING( 0x01, DEF_STR( None ) ) |
| 480 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Controls ) ) | |
| 370 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW1:!2") | |
| 481 | 371 | PORT_DIPSETTING( 0x02, DEF_STR( Normal ) ) |
| 482 | 372 | PORT_DIPSETTING( 0x00, "Reversed" ) |
| 483 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) /* probably unused */ | |
| 484 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 485 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 486 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) ) | |
| 373 | PORT_DIPUNUSED_DIPLOC( 0x04, 0x00, "SW1:!5" ) /* probably unused */ | |
| 374 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!6") | |
| 487 | 375 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 488 | 376 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 489 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 490 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 491 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 ) | |
| 492 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 493 | 377 | INPUT_PORTS_END |
| 494 | 378 | |
| 379 | static INPUT_PORTS_START( pinboa ) | |
| 380 | PORT_INCLUDE( pinbo ) | |
| 495 | 381 | |
| 382 | PORT_MODIFY("1806") | |
| 383 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") | |
| 384 | PORT_DIPSETTING( 0x00, "1" ) | |
| 385 | PORT_DIPSETTING( 0x10, "2" ) | |
| 386 | PORT_DIPSETTING( 0x20, "3" ) | |
| 387 | PORT_DIPSETTING( 0x30, "70 (Cheat)") | |
| 388 | INPUT_PORTS_END | |
| 389 | ||
| 390 | ||
| 496 | 391 | static const gfx_layout lasso_charlayout = |
| 497 | 392 | { |
| 498 | 393 | 8,8, |
| r1877 | r1878 | |
| 573 | 468 | /* basic machine hardware */ |
| 574 | 469 | MDRV_CPU_ADD_TAG("main", M6502, 11289000/16) /* guess */ |
| 575 | 470 | MDRV_CPU_PROGRAM_MAP(lasso_main_map,0) |
| 471 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 576 | 472 | |
| 577 | 473 | MDRV_CPU_ADD_TAG("audio", M6502, 600000) |
| 578 | 474 | MDRV_CPU_PROGRAM_MAP(lasso_audio_map, 0) |
| 579 | 475 | |
| 580 | MDRV_CPU_VBLANK_INT(lasso_interrupt,2) /* IRQ = VBlank, NMI = Coin Insertion */ | |
| 581 | 476 | MDRV_INTERLEAVE(100) |
| 582 | 477 | |
| 583 | MDRV_MACHINE_START(lasso) | |
| 584 | ||
| 585 | 478 | /* video hardware */ |
| 586 | 479 | MDRV_SCREEN_ADD("main", RASTER) |
| 587 | 480 | MDRV_SCREEN_REFRESH_RATE(57) /* guess, but avoids glitching of Chameleon's high score table */ |
| r1877 | r1878 | |
| 958 | 851 | GAME( 1984, wwjgtin, 0, wwjgtin, wwjgtin, 0, ROT0, "Jaleco / Casio", "Wai Wai Jockey Gate-In!", GAME_SUPPORTS_SAVE ) |
| 959 | 852 | GAME( 1991, photof, wwjgtin, wwjgtin, wwjgtin, 0, ROT0, "bootleg?", "Photo Finish", GAME_SUPPORTS_SAVE ) |
| 960 | 853 | GAME( 1984, pinbo, 0, pinbo, pinbo, 0, ROT90, "Jaleco", "Pinbo (set 1)", GAME_SUPPORTS_SAVE ) |
| 961 | GAME( 1984, pinboa, pinbo, pinbo, pinbo, 0, ROT90, "Jaleco", "Pinbo (set 2)", GAME_SUPPORTS_SAVE ) | |
| 962 | GAME( 1985, pinbos, pinbo, pinbo, pinbo, 0, ROT90, "bootleg?", "Pinbo (Strike)", GAME_SUPPORTS_SAVE ) | |
| 854 | GAME( 1984, pinboa, pinbo, pinbo, pinboa, 0, ROT90, "Jaleco", "Pinbo (set 2)", GAME_SUPPORTS_SAVE ) | |
| 855 | GAME( 1985, pinbos, pinbo, pinbo, pinboa, 0, ROT90, "bootleg?", "Pinbo (Strike)", GAME_SUPPORTS_SAVE ) |
| r1877 | r1878 | |
|---|---|---|
| 351 | 351 | MDRV_CPU_PROGRAM_MAP(macs_mem,0) |
| 352 | 352 | MDRV_CPU_IO_MAP(macs_io,0) |
| 353 | 353 | |
| 354 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 354 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 355 | 355 | |
| 356 | 356 | MDRV_MACHINE_RESET(macs) |
| 357 | 357 |
| r1877 | r1878 | |
|---|---|---|
| 3138 | 3138 | |
| 3139 | 3139 | /* basic machine hardware */ |
| 3140 | 3140 | MDRV_CPU_ADD_TAG("main", Z80, 5000000) /* 5.00 MHz */ |
| 3141 | MDRV_CPU_VBLANK_INT(nb1413m3_interrupt | |
| 3141 | MDRV_CPU_VBLANK_INT("main", nb1413m3_interrupt | |
| 3142 | 3142 | |
| 3143 | 3143 | MDRV_MACHINE_RESET(nb1413m3) |
| 3144 | 3144 | MDRV_NVRAM_HANDLER(nb1413m3) |
| r1877 | r1878 | |
| 3206 | 3206 | MDRV_CPU_MODIFY("main") |
| 3207 | 3207 | MDRV_CPU_PROGRAM_MAP(readmem_secolove, writemem_secolove) |
| 3208 | 3208 | MDRV_CPU_IO_MAP(readport_secolove, writeport_crystalg) |
| 3209 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 96) // nmiclock = 2f | |
| 3209 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 96) // nmiclock = 2f | |
| 3210 | 3210 | MACHINE_DRIVER_END |
| 3211 | 3211 | |
| 3212 | 3212 | |
| r1877 | r1878 | |
| 3217 | 3217 | MDRV_CPU_MODIFY("main") |
| 3218 | 3218 | MDRV_CPU_PROGRAM_MAP(readmem_secolove, writemem_secolove) |
| 3219 | 3219 | MDRV_CPU_IO_MAP(readport_secolove, writeport_secolove) |
| 3220 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 128) // nmiclock = 60 | |
| 3220 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 128) // nmiclock = 60 | |
| 3221 | 3221 | MACHINE_DRIVER_END |
| 3222 | 3222 | |
| 3223 | 3223 | |
| r1877 | r1878 | |
| 3228 | 3228 | MDRV_CPU_MODIFY("main") |
| 3229 | 3229 | MDRV_CPU_PROGRAM_MAP(readmem_secolove, writemem_secolove) |
| 3230 | 3230 | MDRV_CPU_IO_MAP(readport_secolove, writeport_secolove) |
| 3231 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 128) // nmiclock = 60 | |
| 3231 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 128) // nmiclock = 60 | |
| 3232 | 3232 | |
| 3233 | 3233 | /* video hardware */ |
| 3234 | 3234 | MDRV_VIDEO_START(mbmj8688_hybrid_12bit) |
| r1877 | r1878 | |
| 3242 | 3242 | MDRV_CPU_MODIFY("main") |
| 3243 | 3243 | MDRV_CPU_PROGRAM_MAP(readmem_secolove, writemem_secolove) |
| 3244 | 3244 | MDRV_CPU_IO_MAP(readport_secolove, writeport_secolove) |
| 3245 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 128) // nmiclock = 60/40 | |
| 3245 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 128) // nmiclock = 60/40 | |
| 3246 | 3246 | |
| 3247 | 3247 | /* video hardware */ |
| 3248 | 3248 | MDRV_VIDEO_START(mbmj8688_pure_16bit) |
| r1877 | r1878 | |
| 3253 | 3253 | |
| 3254 | 3254 | /* basic machine hardware */ |
| 3255 | 3255 | MDRV_CPU_ADD_TAG("main", Z80, 5000000) /* 5.00 MHz */ |
| 3256 | MDRV_CPU_VBLANK_INT(nb1413m3_interrupt | |
| 3256 | MDRV_CPU_VBLANK_INT("main", nb1413m3_interrupt | |
| 3257 | 3257 | MDRV_CPU_PROGRAM_MAP(readmem_secolove, writemem_secolove) |
| 3258 | 3258 | MDRV_CPU_IO_MAP(readport_secolove, writeport_p16bit_LCD) |
| 3259 | 3259 | |
| r1877 | r1878 | |
| 3308 | 3308 | MDRV_CPU_MODIFY("main") |
| 3309 | 3309 | MDRV_CPU_PROGRAM_MAP(readmem_secolove, writemem_secolove) |
| 3310 | 3310 | MDRV_CPU_IO_MAP(readport_secolove, writeport_seiha) |
| 3311 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 128) // nmiclock = 60 | |
| 3311 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 128) // nmiclock = 60 | |
| 3312 | 3312 | MACHINE_DRIVER_END |
| 3313 | 3313 | |
| 3314 | 3314 | |
| r1877 | r1878 | |
| 3319 | 3319 | MDRV_CPU_MODIFY("main") |
| 3320 | 3320 | MDRV_CPU_PROGRAM_MAP(readmem_secolove, writemem_secolove) |
| 3321 | 3321 | MDRV_CPU_IO_MAP(readport_secolove, writeport_iemoto) |
| 3322 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 128) // nmiclock = 60 | |
| 3322 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 128) // nmiclock = 60 | |
| 3323 | 3323 | MACHINE_DRIVER_END |
| 3324 | 3324 | |
| 3325 | 3325 | |
| r1877 | r1878 | |
| 3330 | 3330 | MDRV_CPU_MODIFY("main") |
| 3331 | 3331 | MDRV_CPU_PROGRAM_MAP(readmem_ojousan, writemem_ojousan) |
| 3332 | 3332 | MDRV_CPU_IO_MAP(readport_secolove, writeport_iemoto) |
| 3333 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 128) // nmiclock = 60 | |
| 3333 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 128) // nmiclock = 60 | |
| 3334 | 3334 | MACHINE_DRIVER_END |
| 3335 | 3335 | |
| 3336 | 3336 | |
| r1877 | r1878 | |
| 3341 | 3341 | MDRV_CPU_MODIFY("main") |
| 3342 | 3342 | MDRV_CPU_PROGRAM_MAP(readmem_mjsikaku, writemem_mjsikaku) |
| 3343 | 3343 | MDRV_CPU_IO_MAP(readport_kaguya, writeport_kaguya) |
| 3344 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 128) | |
| 3344 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 128) | |
| 3345 | 3345 | MACHINE_DRIVER_END |
| 3346 | 3346 | |
| 3347 | 3347 | |
| r1877 | r1878 | |
| 3352 | 3352 | MDRV_CPU_MODIFY("main") |
| 3353 | 3353 | MDRV_CPU_PROGRAM_MAP(readmem_mjsikaku, writemem_mjsikaku) |
| 3354 | 3354 | MDRV_CPU_IO_MAP(readport_mjsikaku, writeport_mjsikaku) |
| 3355 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 144) // nmiclock = 70 | |
| 3355 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 144) // nmiclock = 70 | |
| 3356 | 3356 | |
| 3357 | 3357 | /* sound hardware */ |
| 3358 | 3358 | MDRV_SOUND_REPLACE("8910", YM3812, 20000000/8) |
| r1877 | r1878 | |
| 3367 | 3367 | MDRV_CPU_MODIFY("main") |
| 3368 | 3368 | MDRV_CPU_PROGRAM_MAP(readmem_secolove, writemem_secolove) |
| 3369 | 3369 | MDRV_CPU_IO_MAP(readport_mmsikaku, writeport_mmsikaku) |
| 3370 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 128) | |
| 3370 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 128) | |
| 3371 | 3371 | MACHINE_DRIVER_END |
| 3372 | 3372 | |
| 3373 | 3373 |
| r1877 | r1878 | |
|---|---|---|
| 38 | 38 | ***********************************************************/ |
| 39 | 39 | |
| 40 | 40 | #include "driver.h" |
| 41 | #include "deprecat.h" | |
| 41 | 42 | #include "cpu/i8039/i8039.h" |
| 42 | 43 | #include "video/resnet.h" |
| 43 | 44 | #include "sound/ay8910.h" |
| r1877 | r1878 | |
| 152 | 153 | { |
| 153 | 154 | int offs; |
| 154 | 155 | for (offs = 0;offs < videoram_size; offs++) |
| 155 | sbw_videoram_w(offs, videoram[offs]); | |
| 156 | sbw_videoram_w(machine, offs, videoram[offs]); | |
| 156 | 157 | } |
| 157 | 158 | sbw_system = data; |
| 158 | 159 | } |
| r1877 | r1878 | |
| 176 | 177 | static READ8_HANDLER (controls_r) |
| 177 | 178 | { |
| 178 | 179 | if(sbw_system&2) |
| 179 | return input_port_2_r(0); | |
| 180 | return input_port_2_r(machine,0); | |
| 180 | 181 | else |
| 181 | return input_port_3_r(0); | |
| 182 | return input_port_3_r(machine,0); | |
| 182 | 183 | } |
| 183 | 184 | |
| 184 | 185 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 330 | 331 | MDRV_CPU_ADD(8080, 19968000/10 ) |
| 331 | 332 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 332 | 333 | MDRV_CPU_IO_MAP(port_map,0) |
| 333 | MDRV_CPU_VBLANK_INT(sbw_interrupt, 2) | |
| 334 | MDRV_CPU_VBLANK_INT_HACK(sbw_interrupt, 2) | |
| 334 | 335 | MDRV_GFXDECODE(sbowling) |
| 335 | 336 | |
| 336 | 337 | /* video hardware */ |
| r1877 | r1878 | |
|---|---|---|
| 550 | 550 | /* basic machine hardware */ |
| 551 | 551 | MDRV_CPU_ADD(Z80, 6000000) |
| 552 | 552 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 553 | MDRV_CPU_VBLANK_INT(psychic5_interrupt,2) | |
| 553 | MDRV_CPU_VBLANK_INT_HACK(psychic5_interrupt,2) | |
| 554 | 554 | |
| 555 | 555 | MDRV_CPU_ADD(Z80, 6000000) |
| 556 | 556 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 200 | 200 | { |
| 201 | 201 | /* Bypass TC0220IOC controller for analog input */ |
| 202 | 202 | |
| 203 | UINT8 port = TC0220IOC_port_r(0); /* read port number */ | |
| 203 | UINT8 port = TC0220IOC_port_r(machine,0); /* read port number */ | |
| 204 | 204 | |
| 205 | 205 | switch( port ) |
| 206 | 206 | { |
| r1877 | r1878 | |
| 241 | 241 | return 0x00; |
| 242 | 242 | |
| 243 | 243 | default: |
| 244 | return TC0220IOC_portreg_r( offset ); | |
| 244 | return TC0220IOC_portreg_r( machine,offset ); | |
| 245 | 245 | } |
| 246 | 246 | } |
| 247 | 247 | |
| r1877 | r1878 | |
| 578 | 578 | /* basic machine hardware */ |
| 579 | 579 | MDRV_CPU_ADD(M68000,24000000 / 2) /* 12 MHz */ |
| 580 | 580 | MDRV_CPU_PROGRAM_MAP(syvalion_readmem,syvalion_writemem) |
| 581 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 581 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 582 | 582 | |
| 583 | 583 | MDRV_CPU_ADD(Z80,8000000 / 2) /* 4 MHz ??? */ |
| 584 | 584 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 617 | 617 | /* basic machine hardware */ |
| 618 | 618 | MDRV_CPU_ADD(M68000,24000000 / 2) /* 12 MHz */ |
| 619 | 619 | MDRV_CPU_PROGRAM_MAP(recordbr_readmem,recordbr_writemem) |
| 620 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 620 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 621 | 621 | |
| 622 | 622 | MDRV_CPU_ADD(Z80,8000000 / 2) /* 4 MHz ??? */ |
| 623 | 623 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 656 | 656 | /* basic machine hardware */ |
| 657 | 657 | MDRV_CPU_ADD(M68000,24000000 / 2) /* 12 MHz */ |
| 658 | 658 | MDRV_CPU_PROGRAM_MAP(dleague_readmem,dleague_writemem) |
| 659 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 659 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 660 | 660 | |
| 661 | 661 | MDRV_CPU_ADD(Z80,8000000 / 2) /* 4 MHz ??? */ |
| 662 | 662 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 273 | 273 | static MACHINE_DRIVER_START( good ) |
| 274 | 274 | MDRV_CPU_ADD_TAG("main", M68000, 16000000 /2) |
| 275 | 275 | MDRV_CPU_PROGRAM_MAP(good_map,0) |
| 276 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 276 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 277 | 277 | |
| 278 | 278 | MDRV_GFXDECODE(good) |
| 279 | 279 |
| r1877 | r1878 | |
|---|---|---|
| 1510 | 1510 | static READ8_HANDLER( sfl_input_r ) |
| 1511 | 1511 | { |
| 1512 | 1512 | sfl_int^=0x80;//vblank flag ? |
| 1513 | return sfl_int|input_port_1_r(0); | |
| 1513 | return sfl_int|input_port_1_r(machine,0); | |
| 1514 | 1514 | } |
| 1515 | 1515 | |
| 1516 | 1516 | static ADDRESS_MAP_START( sflush_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 1535 | 1535 | MDRV_IMPORT_FROM(mw8080bw_root) |
| 1536 | 1536 | MDRV_CPU_REPLACE("main",M6800,2000000) /* ?? */ |
| 1537 | 1537 | MDRV_CPU_PROGRAM_MAP(sflush_map,0) |
| 1538 | MDRV_CPU_VBLANK_INT(irq0_line_pulse,2) | |
| 1538 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_pulse,2) | |
| 1539 | 1539 | |
| 1540 | 1540 | /* video hardware */ |
| 1541 | 1541 | MDRV_VIDEO_UPDATE(sflush) |
| r1877 | r1878 | |
| 1775 | 1775 | MDRV_CPU_PROGRAM_MAP(schaser_map,0) |
| 1776 | 1776 | MDRV_CPU_IO_MAP(polaris_io_map,0) |
| 1777 | 1777 | MDRV_WATCHDOG_VBLANK_INIT(255) |
| 1778 | MDRV_CPU_VBLANK_INT(polaris_interrupt | |
| 1778 | MDRV_CPU_VBLANK_INT("main", polaris_interrupt | |
| 1779 | 1779 | |
| 1780 | 1780 | /* video hardware */ |
| 1781 | 1781 | MDRV_VIDEO_UPDATE(polaris) |
| r1877 | r1878 | |
| 2515 | 2515 | MDRV_CPU_MODIFY("main") |
| 2516 | 2516 | MDRV_CPU_PROGRAM_MAP(darthvdr_map,0) |
| 2517 | 2517 | MDRV_CPU_IO_MAP(darthvdr_io_map,0) |
| 2518 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 2518 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 2519 | 2519 | |
| 2520 | 2520 | MDRV_MACHINE_START(darthvdr) |
| 2521 | 2521 | MDRV_MACHINE_RESET(darthvdr) |
| r1877 | r1878 | |
|---|---|---|
| 385 | 385 | break; |
| 386 | 386 | |
| 387 | 387 | default: |
| 388 | TC0220IOC_w(offset,data & 0xff); | |
| 388 | TC0220IOC_w(machine,offset,data & 0xff); | |
| 389 | 389 | } |
| 390 | 390 | } |
| 391 | 391 | } |
| r1877 | r1878 | |
| 403 | 403 | return eeprom_r(); |
| 404 | 404 | |
| 405 | 405 | default: |
| 406 | return TC0220IOC_r( offset ); | |
| 406 | return TC0220IOC_r( machine, offset ); | |
| 407 | 407 | } |
| 408 | 408 | } |
| 409 | 409 | |
| r1877 | r1878 | |
| 457 | 457 | static WRITE16_HANDLER( othunder_sound_w ) |
| 458 | 458 | { |
| 459 | 459 | if (offset == 0) |
| 460 | taitosound_port_w (0, data & 0xff); | |
| 460 | taitosound_port_w (machine, 0, data & 0xff); | |
| 461 | 461 | else if (offset == 1) |
| 462 | taitosound_comm_w (0, data & 0xff); | |
| 462 | taitosound_comm_w (machine, 0, data & 0xff); | |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | static READ16_HANDLER( othunder_sound_r ) |
| 466 | 466 | { |
| 467 | 467 | if (offset == 1) |
| 468 | return ((taitosound_comm_r (0) & 0xff)); | |
| 468 | return ((taitosound_comm_r (machine, 0) & 0xff)); | |
| 469 | 469 | else return 0; |
| 470 | 470 | } |
| 471 | 471 | |
| r1877 | r1878 | |
| 704 | 704 | // MDRV_CPU_ADD(M68000, 24000000/2 ) /* 12 MHz */ |
| 705 | 705 | MDRV_CPU_ADD(M68000, 13000000 ) /* fixes garbage graphics on startup */ |
| 706 | 706 | MDRV_CPU_PROGRAM_MAP(othunder_map,0) |
| 707 | MDRV_CPU_VBLANK_INT(vblank_interrupt | |
| 707 | MDRV_CPU_VBLANK_INT("main", vblank_interrupt | |
| 708 | 708 | |
| 709 | 709 | MDRV_CPU_ADD(Z80,16000000/4 ) /* 4 MHz */ |
| 710 | 710 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 351 | 351 | /* basic machine hardware */ |
| 352 | 352 | MDRV_CPU_ADD(M68000, 6000000) /* ? */ |
| 353 | 353 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 354 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 354 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 355 | 355 | |
| 356 | 356 | MDRV_CPU_ADD(M6809, 1000000) |
| 357 | 357 | /* audio CPU */ |
| 358 | 358 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 359 | MDRV_CPU_VBLANK_INT(ginganin_sound_interrupt,60) /* Takahiro Nogi. 1999/09/27 (1 -> 60) */ | |
| 359 | MDRV_CPU_VBLANK_INT_HACK(ginganin_sound_interrupt,60) /* Takahiro Nogi. 1999/09/27 (1 -> 60) */ | |
| 360 | 360 | |
| 361 | 361 | /* video hardware */ |
| 362 | 362 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 41 | 41 | { |
| 42 | 42 | if (ACCESSING_LSB) |
| 43 | 43 | { |
| 44 | soundlatch_w(offset,data & 0xff); | |
| 45 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 44 | soundlatch_w(machine,offset,data & 0xff); | |
| 45 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | static READ16_HANDLER( tail2nos_K051316_0_r ) |
| 50 | 50 | { |
| 51 | return K051316_0_r(offset); | |
| 51 | return K051316_0_r(machine,offset); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | static WRITE16_HANDLER( tail2nos_K051316_0_w ) |
| 55 | 55 | { |
| 56 | 56 | if (ACCESSING_LSB) |
| 57 | K051316_0_w(offset,data & 0xff); | |
| 57 | K051316_0_w(machine,offset,data & 0xff); | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | static WRITE16_HANDLER( tail2nos_K051316_ctrl_0_w ) |
| 61 | 61 | { |
| 62 | 62 | if (ACCESSING_LSB) |
| 63 | K051316_ctrl_0_w(offset,data & 0xff); | |
| 63 | K051316_ctrl_0_w(machine,offset,data & 0xff); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | static WRITE8_HANDLER( sound_bankswitch_w ) |
| r1877 | r1878 | |
| 267 | 267 | /* basic machine hardware */ |
| 268 | 268 | MDRV_CPU_ADD(M68000,XTAL_20MHz/2) /* verified on pcb */ |
| 269 | 269 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 270 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 270 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 271 | 271 | |
| 272 | 272 | MDRV_CPU_ADD(Z80,XTAL_20MHz/4) /* verified on pcb */ |
| 273 | 273 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 51 | 51 | */ |
| 52 | 52 | #include "driver.h" |
| 53 | 53 | |
| 54 | WRITE8_HANDLER( ramtek_videoram_w ); | |
| 55 | ||
| 56 | 54 | INTERRUPT_GEN( invaders_interrupt ); |
| 57 | 55 | void ramtek_sh_update(void); |
| 58 | WRITE8_HANDLER( ramtek_mask_w ); | |
| 59 | 56 | |
| 60 | /* | |
| 61 | * since these functions aren't used anywhere else, i've made them | |
| 62 | * static, and included them here | |
| 63 | */ | |
| 57 | ||
| 58 | /*************************************************************************** | |
| 59 | ||
| 60 | video.c | |
| 61 | ||
| 62 | Functions to emulate the video hardware of the machine. | |
| 63 | ||
| 64 | ***************************************************************************/ | |
| 65 | ||
| 66 | #include "driver.h" | |
| 67 | ||
| 68 | ||
| 69 | ||
| 70 | static UINT8 *ramtek_videoram; | |
| 71 | static UINT8 *mask; | |
| 72 | ||
| 73 | ||
| 74 | static WRITE8_HANDLER( ramtek_videoram_w ) | |
| 75 | { | |
| 76 | ramtek_videoram[offset] = data & ~*mask; | |
| 77 | } | |
| 78 | ||
| 79 | static VIDEO_UPDATE( ramtek ) | |
| 80 | { | |
| 81 | offs_t offs; | |
| 82 | ||
| 83 | for (offs = 0; offs < 0x2000; offs++) | |
| 84 | { | |
| 85 | int i; | |
| 86 | ||
| 87 | UINT8 data = ramtek_videoram[offs]; | |
| 88 | int y = offs >> 5; | |
| 89 | int x = (offs & 0x1f) << 3; | |
| 90 | ||
| 91 | for (i = 0; i < 8; i++) | |
| 92 | { | |
| 93 | pen_t pen = (data & 0x80) ? RGB_WHITE : RGB_BLACK; | |
| 94 | *BITMAP_ADDR32(bitmap, y, x) = pen; | |
| 95 | ||
| 96 | x++; | |
| 97 | data <<= 1; | |
| 98 | } | |
| 99 | } | |
| 100 | ||
| 101 | return 0; | |
| 102 | } | |
| 103 | ||
| 104 | ||
| 64 | 105 | static const int ControllerTable[32] = { |
| 65 | 106 | 0 , 1 , 3 , 2 , 6 , 7 , 5 , 4 , |
| 66 | 107 | 12 , 13 , 15 , 14 , 10 , 11 , 9 , 8 , |
| r1877 | r1878 | |
| 70 | 111 | |
| 71 | 112 | static READ8_HANDLER( gray5bit_controller0_r ) |
| 72 | 113 | { |
| 73 | return (input_port_2_r(0) & 0xe0) | (~ControllerTable[input_port_2_r(0) & 0x1f] & 0x1f); | |
| 114 | return (input_port_2_r(machine,0) & 0xe0) | (~ControllerTable[input_port_2_r(machine,0) & 0x1f] & 0x1f); | |
| 74 | 115 | } |
| 75 | 116 | |
| 76 | 117 | static READ8_HANDLER( gray5bit_controller1_r ) |
| 77 | 118 | { |
| 78 | return (input_port_3_r(0) & 0xe0) | (~ControllerTable[input_port_3_r(0) & 0x1f] & 0x1f); | |
| 119 | return (input_port_3_r(machine,0) & 0xe0) | (~ControllerTable[input_port_3_r(machine,0) & 0x1f] & 0x1f); | |
| 79 | 120 | } |
| 80 | 121 | |
| 81 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 82 | AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_ROM) | |
| 83 | AM_RANGE(0x4000, 0x63ff) AM_READ(MRA8_RAM) | |
| 84 | AM_RANGE(0x8000, 0x8000) AM_READ(input_port_0_r) | |
| 85 | AM_RANGE(0x8002, 0x8002) AM_READ(input_port_1_r) | |
| 86 | AM_RANGE(0x8004, 0x8004) AM_READ(gray5bit_controller0_r) | |
| 87 | AM_RANGE(0x8005, 0x8005) AM_READ(gray5bit_controller1_r) | |
| 88 | AM_RANGE(0xC000, 0xC07f) AM_READ(MRA8_RAM) /* ?? */ | |
| 89 | AM_RANGE(0xC200, 0xC27f) AM_READ(MRA8_RAM) /* ?? */ | |
| 90 | ADDRESS_MAP_END | |
| 91 | ||
| 92 | 122 | static WRITE8_HANDLER( sound_w ) |
| 93 | 123 | { |
| 94 | 124 | } |
| 95 | 125 | |
| 96 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 97 | AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_ROM) | |
| 98 | AM_RANGE(0x4000, 0x43ff) AM_WRITE(MWA8_RAM) | |
| 99 | AM_RANGE(0x4400, 0x5fff) AM_WRITE(ramtek_videoram_w) AM_BASE(&videoram) | |
| 100 | AM_RANGE(0x6000, 0x63ff) AM_WRITE(MWA8_RAM) /* ?? */ | |
| 101 | AM_RANGE(0x8001, 0x8001) AM_WRITE(ramtek_mask_w) | |
| 102 | AM_RANGE(0x8000, 0x8000) AM_WRITE(sound_w) /* sound_w listed twice?? */ | |
| 103 | AM_RANGE(0x8002, 0x8003) AM_WRITE(sound_w) /* Manual Shows sound control at 0x8002 */ | |
| 104 | AM_RANGE(0xC000, 0xC07f) AM_WRITE(MWA8_RAM) /* ?? */ | |
| 105 | AM_RANGE(0xC200, 0xC27f) AM_WRITE(MWA8_RAM) /* ?? */ | |
| 126 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 127 | AM_RANGE(0x0000, 0x1fff) AM_ROM | |
| 128 | AM_RANGE(0x4000, 0x5fff) AM_READWRITE(MRA8_RAM, ramtek_videoram_w) AM_BASE(&ramtek_videoram) | |
| 129 | AM_RANGE(0x6000, 0x63ff) AM_RAM /* ?? */ | |
| 130 | AM_RANGE(0x8000, 0x8000) AM_READWRITE(input_port_0_r, sound_w) /* sound_w listed twice?? */ | |
| 131 | AM_RANGE(0x8001, 0x8001) AM_WRITE(MWA8_RAM) AM_BASE(&mask) | |
| 132 | AM_RANGE(0x8002, 0x8002) AM_READWRITE(input_port_1_r, sound_w) | |
| 133 | AM_RANGE(0x8003, 0x8003) AM_WRITE(sound_w) /* Manual Shows sound control at 0x8002 */ | |
| 134 | AM_RANGE(0x8004, 0x8004) AM_READ(gray5bit_controller0_r) | |
| 135 | AM_RANGE(0x8005, 0x8005) AM_READ(gray5bit_controller1_r) | |
| 136 | AM_RANGE(0xc000, 0xc07f) AM_RAM /* ?? */ | |
| 137 | AM_RANGE(0xc200, 0xc27f) AM_RAM /* ?? */ | |
| 106 | 138 | ADDRESS_MAP_END |
| 107 | 139 | |
| 108 | 140 | |
| 141 | ||
| 109 | 142 | static INPUT_PORTS_START( m79amb ) |
| 110 | 143 | PORT_START /* 8000 */ |
| 111 | 144 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dip switch */ |
| r1877 | r1878 | |
| 142 | 175 | INPUT_PORTS_END |
| 143 | 176 | |
| 144 | 177 | |
| 145 | static INTERRUPT_GEN( | |
| 178 | static INTERRUPT_GEN( m79amb_interrupt ) | |
| 146 | 179 | { |
| 147 | 180 | cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf); /* RST 08h */ |
| 148 | 181 | } |
| r1877 | r1878 | |
| 161 | 194 | |
| 162 | 195 | /* basic machine hardware */ |
| 163 | 196 | MDRV_CPU_ADD(8080, 1996800) |
| 164 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 165 | MDRV_CPU_VBLANK_INT(M79_interrupt,1) | |
| 197 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 198 | MDRV_CPU_VBLANK_INT("main", m79amb_interrupt) | |
| 166 | 199 | |
| 167 | 200 | /* video hardware */ |
| 168 | 201 | MDRV_SCREEN_ADD("main", RASTER) |
| 169 | 202 | MDRV_SCREEN_REFRESH_RATE(60) |
| 170 | 203 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| 171 | 204 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 172 | MDRV_SCREEN_SIZE(32*8, 28*8) | |
| 173 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1) | |
| 205 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 206 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 32*8-1) | |
| 174 | 207 | |
| 175 | MDRV_VIDEO_START(generic_bitmapped) | |
| 176 | MDRV_VIDEO_UPDATE(generic_bitmapped) | |
| 208 | MDRV_VIDEO_UPDATE(ramtek) | |
| 177 | 209 | |
| 178 | 210 | /* sound hardware */ |
| 179 | 211 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
| 202 | 234 | |
| 203 | 235 | |
| 204 | 236 | |
| 205 | GAME( 1977, m79amb, 0, m79amb, m79amb, m79amb, ROT0, "Ram | |
| 237 | GAME( 1977, m79amb, 0, m79amb, m79amb, m79amb, ROT0, "Ramtek", "M-79 Ambush", GAME_NO_SOUND ) |
| r1877 | r1878 | |
|---|---|---|
| 75 | 75 | |
| 76 | 76 | static WRITE8_HANDLER( io_0x00_w ) |
| 77 | 77 | { |
| 78 | mrjong_flipscreen_w(0, ((data & 0x04) > 2)); | |
| 78 | mrjong_flipscreen_w(machine, 0, ((data & 0x04) > 2)); | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | static READ8_HANDLER( io_0x03_r ) |
| r1877 | r1878 | |
| 182 | 182 | MDRV_CPU_ADD(Z80,15468000/6) /* 2.578 MHz?? */ |
| 183 | 183 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 184 | 184 | MDRV_CPU_IO_MAP(readport,writeport) |
| 185 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 185 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 186 | 186 | |
| 187 | 187 | /* video hardware */ |
| 188 | 188 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 112 | 112 | { |
| 113 | 113 | UINT8 ans = 0; |
| 114 | 114 | |
| 115 | if (IOpage == 0) ans = input_port_0_r(0); | |
| 116 | if (IOpage == 1) ans = input_port_1_r(0); | |
| 117 | if (IOpage == 2) ans = input_port_2_r(0); | |
| 118 | if (IOpage == 3) ans = input_port_3_r(0); | |
| 115 | if (IOpage == 0) ans = input_port_0_r(machine, 0); | |
| 116 | if (IOpage == 1) ans = input_port_1_r(machine, 0); | |
| 117 | if (IOpage == 2) ans = input_port_2_r(machine, 0); | |
| 118 | if (IOpage == 3) ans = input_port_3_r(machine, 0); | |
| 119 | 119 | |
| 120 | 120 | return ans; |
| 121 | 121 | } |
| r1877 | r1878 | |
| 150 | 150 | // return input_port_5_r(0); |
| 151 | 151 | |
| 152 | 152 | // Add in sound DIP switch |
| 153 | return (Quasar_Command) + (input_port_5_r(0) & 0x30); | |
| 153 | return (Quasar_Command) + (input_port_5_r(machine, 0) & 0x30); | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | static READ8_HANDLER( Quasar_T1_r ) |
| r1877 | r1878 | |
| 160 | 160 | |
| 161 | 161 | static WRITE8_HANDLER( Quasar_DAC_w ) |
| 162 | 162 | { |
| 163 | DAC_0_signed_data_w(0,data); | |
| 163 | DAC_0_signed_data_w(machine,0,data); | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | // memory map taken from the manual |
| r1877 | r1878 | |
| 345 | 345 | MDRV_CPU_ADD_TAG("main", S2650, 14318000/4) /* 14 mhz crystal divide by 4 on board */ |
| 346 | 346 | MDRV_CPU_PROGRAM_MAP(quasar,0) |
| 347 | 347 | MDRV_CPU_IO_MAP(quasar_io,0) |
| 348 | MDRV_CPU_VBLANK_INT(quasar_interrupt | |
| 348 | MDRV_CPU_VBLANK_INT("main", quasar_interrupt | |
| 349 | 349 | |
| 350 | 350 | MDRV_CPU_ADD_TAG("sound",I8035,6000000) /* 6MHz crystal divide by 15 in CPU */ |
| 351 | 351 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 58 | 58 | /* basic machine hardware */ |
| 59 | 59 | MDRV_CPU_ADD(Z80,6000000) |
| 60 | 60 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 61 | // MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 61 | // MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 62 | 62 | |
| 63 | 63 | /* video hardware */ |
| 64 | 64 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 202 | 202 | switch (offset) |
| 203 | 203 | { |
| 204 | 204 | case 0x03: |
| 205 | return ((input_port_3_word_r(0,0) & 0xef) | | |
| 206 | (input_port_5_word_r(0,0) & 0x10)) << 8; /* IN3 + service switch */ | |
| 205 | return ((input_port_3_word_r(machine,0,0) & 0xef) | | |
| 206 | (input_port_5_word_r(machine,0,0) & 0x10)) << 8; /* IN3 + service switch */ | |
| 207 | 207 | |
| 208 | 208 | default: |
| 209 | return TC0640FIO_r(offset) << 8; | |
| 209 | return TC0640FIO_r(machine,offset) << 8; | |
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | |
| r1877 | r1878 | |
| 248 | 248 | static WRITE16_HANDLER( slapshot_msb_sound_w ) |
| 249 | 249 | { |
| 250 | 250 | if (offset == 0) |
| 251 | taitosound_port_w (0,(data >> 8) & 0xff); | |
| 251 | taitosound_port_w (machine,0,(data >> 8) & 0xff); | |
| 252 | 252 | else if (offset == 1) |
| 253 | taitosound_comm_w (0,(data >> 8) & 0xff); | |
| 253 | taitosound_comm_w (machine,0,(data >> 8) & 0xff); | |
| 254 | 254 | |
| 255 | 255 | #ifdef MAME_DEBUG |
| 256 | 256 | if (data & 0xff) |
| r1877 | r1878 | |
| 261 | 261 | static READ16_HANDLER( slapshot_msb_sound_r ) |
| 262 | 262 | { |
| 263 | 263 | if (offset == 1) |
| 264 | return ((taitosound_comm_r (0) & 0xff) << 8); | |
| 264 | return ((taitosound_comm_r (machine, 0) & 0xff) << 8); | |
| 265 | 265 | else return 0; |
| 266 | 266 | } |
| 267 | 267 | |
| r1877 | r1878 | |
| 550 | 550 | /* basic machine hardware */ |
| 551 | 551 | MDRV_CPU_ADD(M68000, 14346000) /* 28.6860 MHz / 2 ??? */ |
| 552 | 552 | MDRV_CPU_PROGRAM_MAP(slapshot_readmem,slapshot_writemem) |
| 553 | MDRV_CPU_VBLANK_INT(slapshot_interrupt | |
| 553 | MDRV_CPU_VBLANK_INT("main", slapshot_interrupt | |
| 554 | 554 | |
| 555 | 555 | MDRV_CPU_ADD(Z80,32000000/8) |
| 556 | 556 | /* audio CPU */ /* 4 MHz */ |
| r1877 | r1878 | |
| 592 | 592 | /* basic machine hardware */ |
| 593 | 593 | MDRV_CPU_ADD(M68000, 14346000) /* 28.6860 MHz / 2 ??? */ |
| 594 | 594 | MDRV_CPU_PROGRAM_MAP(opwolf3_readmem,opwolf3_writemem) |
| 595 | MDRV_CPU_VBLANK_INT(slapshot_interrupt | |
| 595 | MDRV_CPU_VBLANK_INT("main", slapshot_interrupt | |
| 596 | 596 | |
| 597 | 597 | MDRV_CPU_ADD(Z80,32000000/8) |
| 598 | 598 | /* audio CPU */ /* 4 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 31 | 31 | #include "cpu/arm/arm.h" |
| 32 | 32 | |
| 33 | 33 | static UINT32 *ertictac_mainram; |
| 34 | static UINT32 *ram; | |
| 34 | static UINT32 *ertictac_videoram; | |
| 35 | 35 | static UINT32 IRQSTA, IRQMSKA, IRQMSKB, FIQMSK, T1low, T1high; |
| 36 | 36 | static UINT32 vidFIFO[256]; |
| 37 | 37 | |
| 38 | static READ32_HANDLER(ram_r) | |
| 39 | { | |
| 40 | return ram[offset]; | |
| 41 | } | |
| 42 | ||
| 43 | static WRITE32_HANDLER(ram_w) | |
| 44 | { | |
| 45 | COMBINE_DATA(&ram[offset]); | |
| 46 | if(offset>=vidFIFO[0x88]/4 && offset<( (vidFIFO[0x88]/4) + 0x28000/4)) | |
| 47 | { | |
| 48 | int tmp=offset-vidFIFO[0x88]/4; | |
| 49 | int x=(tmp%80)<<2; | |
| 50 | int y=(tmp/80)&0xff; | |
| 51 | ||
| 52 | *BITMAP_ADDR16(tmpbitmap, y, x++) = (ram[offset]>> 0)&0xff; | |
| 53 | *BITMAP_ADDR16(tmpbitmap, y, x++) = (ram[offset]>> 8)&0xff; | |
| 54 | *BITMAP_ADDR16(tmpbitmap, y, x++) = (ram[offset]>>16)&0xff; | |
| 55 | *BITMAP_ADDR16(tmpbitmap, y, x ) = (ram[offset]>>24)&0xff; | |
| 56 | } | |
| 57 | } | |
| 58 | ||
| 59 | 38 | static WRITE32_HANDLER(video_fifo_w) |
| 60 | 39 | { |
| 61 | 40 | vidFIFO[data>>24]=data&0xffffff; |
| r1877 | r1878 | |
| 63 | 42 | |
| 64 | 43 | static READ32_HANDLER(IOCR_r) |
| 65 | 44 | { |
| 66 | return (input_port_5_r(0)&0x80)|0x34; | |
| 45 | return (input_port_5_r(machine,0)&0x80)|0x34; | |
| 67 | 46 | } |
| 68 | 47 | |
| 69 | 48 | static WRITE32_HANDLER(IOCR_w) |
| r1877 | r1878 | |
| 172 | 151 | |
| 173 | 152 | static ADDRESS_MAP_START( ertictac_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 174 | 153 | AM_RANGE(0x00000000, 0x0007ffff) AM_RAM AM_BASE (&ertictac_mainram) |
| 175 | AM_RANGE(0x01f00000, 0x01ffffff) AM_R | |
| 154 | AM_RANGE(0x01f00000, 0x01ffffff) AM_R | |
| 176 | 155 | AM_RANGE(0x03200000, 0x03200003) AM_READWRITE(IOCR_r, IOCR_w) |
| 177 | 156 | AM_RANGE(0x03200010, 0x03200013) AM_READ(IRQSTA_r) |
| 178 | 157 | AM_RANGE(0x03200014, 0x03200017) AM_READWRITE(IRQRQA_r, IRQRQA_w) |
| r1877 | r1878 | |
| 360 | 339 | } |
| 361 | 340 | } |
| 362 | 341 | |
| 363 | static PALETTE_INIT(ertictac) | |
| 342 | ||
| 343 | #define NUM_PENS (0x100) | |
| 344 | ||
| 345 | static void get_pens(pen_t *pens) | |
| 364 | 346 | { |
| 365 | int c; | |
| 347 | int color; | |
| 366 | 348 | |
| 367 | for (c = 0; c < | |
| 349 | for (color = 0; color < NUM_PENS; color++) | |
| 368 | 350 | { |
| 369 | int r,g,b,i; | |
| 351 | UINT8 i = color & 0x03; | |
| 352 | UINT8 r = ((color & 0x04) >> 0) | ((color & 0x10) >> 1) | i; | |
| 353 | UINT8 g = ((color & 0x20) >> 3) | ((color & 0x40) >> 3) | i; | |
| 354 | UINT8 b = ((color & 0x08) >> 1) | ((color & 0x80) >> 4) | i; | |
| 370 | 355 | |
| 371 | i = c & 0x03; | |
| 372 | r = ((c & 0x04) >> 0) | ((c & 0x10) >> 1) | i; | |
| 373 | g = ((c & 0x20) >> 3) | ((c & 0x40) >> 3) | i; | |
| 374 | b = ((c & 0x08) >> 1) | ((c & 0x80) >> 4) | i; | |
| 375 | ||
| 376 | palette_set_color_rgb(machine, c, pal4bit(r), pal4bit(g), pal4bit(b)); | |
| 356 | pens[color] = MAKE_RGB(pal4bit(r), pal4bit(g), pal4bit(b)); | |
| 377 | 357 | } |
| 378 | 358 | } |
| 379 | 359 | |
| 360 | ||
| 361 | static VIDEO_UPDATE( ertictac ) | |
| 362 | { | |
| 363 | int y, x; | |
| 364 | pen_t pens[NUM_PENS]; | |
| 365 | ||
| 366 | get_pens(pens); | |
| 367 | ||
| 368 | for (y = cliprect->min_y; y <= cliprect->max_y; y++) | |
| 369 | for (x = 0; x < 0x140; x += 4) | |
| 370 | { | |
| 371 | offs_t offs = (y * 0x50) + (x >> 2) + (vidFIFO[0x88] >> 2); | |
| 372 | ||
| 373 | *BITMAP_ADDR32(bitmap, y, x + 0) = pens[(ertictac_videoram[offs] >> 0) & 0xff]; | |
| 374 | *BITMAP_ADDR32(bitmap, y, x + 1) = pens[(ertictac_videoram[offs] >> 8) & 0xff]; | |
| 375 | *BITMAP_ADDR32(bitmap, y, x + 2) = pens[(ertictac_videoram[offs] >> 16) & 0xff]; | |
| 376 | *BITMAP_ADDR32(bitmap, y, x + 3) = pens[(ertictac_videoram[offs] >> 24) & 0xff]; | |
| 377 | } | |
| 378 | ||
| 379 | return 0; | |
| 380 | } | |
| 381 | ||
| 382 | ||
| 380 | 383 | static MACHINE_DRIVER_START( ertictac ) |
| 381 | 384 | |
| 382 | 385 | MDRV_CPU_ADD(ARM, 16000000) /* guess */ |
| 383 | 386 | MDRV_CPU_PROGRAM_MAP(ertictac_map,0) |
| 384 | MDRV_CPU_VBLANK_INT(ertictac_interrupt | |
| 387 | MDRV_CPU_VBLANK_INT("main", ertictac_interrupt | |
| 385 | 388 | |
| 386 | 389 | MDRV_MACHINE_RESET(ertictac) |
| 387 | 390 | |
| r1877 | r1878 | |
| 389 | 392 | MDRV_SCREEN_ADD("main", RASTER) |
| 390 | 393 | MDRV_SCREEN_REFRESH_RATE(60) |
| 391 | 394 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| 392 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_ | |
| 395 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32 | |
| 393 | 396 | MDRV_SCREEN_SIZE(320, 256) |
| 394 | 397 | MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 255) |
| 395 | 398 | |
| 396 | MDRV_PALETTE_LENGTH(256) | |
| 397 | MDRV_PALETTE_INIT(ertictac) | |
| 398 | ||
| 399 | MDRV_VIDEO_START(generic_bitmapped) | |
| 400 | MDRV_VIDEO_UPDATE(generic_bitmapped) | |
| 399 | MDRV_VIDEO_UPDATE(ertictac) | |
| 401 | 400 | MACHINE_DRIVER_END |
| 402 | 401 | |
| 403 | 402 | ROM_START( ertictac ) |
| r1877 | r1878 | |
|---|---|---|
| 240 | 240 | |
| 241 | 241 | static READ8_HANDLER( psg_4015_r ) |
| 242 | 242 | { |
| 243 | return NESPSG_0_r(0x15); | |
| 243 | return NESPSG_0_r(machine, 0x15); | |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | static WRITE8_HANDLER( psg_4015_w ) |
| 247 | 247 | { |
| 248 | NESPSG_0_w(0x15, data); | |
| 248 | NESPSG_0_w(machine, 0x15, data); | |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | static WRITE8_HANDLER( psg_4017_w ) |
| 252 | 252 | { |
| 253 | NESPSG_0_w(0x17, data); | |
| 253 | NESPSG_0_w(machine, 0x17, data); | |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | static READ8_HANDLER( psg1_4015_r ) |
| 257 | 257 | { |
| 258 | return NESPSG_1_r(0x15); | |
| 258 | return NESPSG_1_r(machine, 0x15); | |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | static WRITE8_HANDLER( psg1_4015_w ) |
| 262 | 262 | { |
| 263 | NESPSG_1_w(0x15, data); | |
| 263 | NESPSG_1_w(machine, 0x15, data); | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | static WRITE8_HANDLER( psg1_4017_w ) |
| 267 | 267 | { |
| 268 | NESPSG_1_w(0x17, data); | |
| 268 | NESPSG_1_w(machine, 0x17, data); | |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | static ADDRESS_MAP_START( vsnes_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 513 | 513 | PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_COIN4 ) PORT_IMPULSE(1) \ |
| 514 | 514 | PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) /* this bit masks irqs - dont change */ \ |
| 515 | 515 | |
| 516 | #ifdef UNUSED_DEFINITION | |
| 516 | 517 | static INPUT_PORTS_START( vsnes ) |
| 517 | 518 | VS_CONTROLS( IPT_START1, IPT_BUTTON3, IPT_START2, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_PLAYER(2) |
| 518 | 519 | |
| r1877 | r1878 | |
| 542 | 543 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 543 | 544 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 544 | 545 | INPUT_PORTS_END |
| 546 | #endif | |
| 545 | 547 | |
| 546 | 548 | static INPUT_PORTS_START( topgun ) |
| 547 | 549 | VS_CONTROLS( IPT_START1, IPT_UNKNOWN, IPT_START2, IPT_UNKNOWN ) |
| r1877 | r1878 | |
|---|---|---|
| 149 | 149 | |
| 150 | 150 | /* Mem / Port Maps ***********************************************************/ |
| 151 | 151 | |
| 152 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 153 | AM_RANGE(0x0000, 0xbfff) AM_READ(MRA8_ROM) | |
| 154 | AM_RANGE(0xc000, 0xdfff) AM_READ(MRA8_RAM) | |
| 155 | AM_RANGE(0xe000, 0xffff) AM_READ(MRA8_RAM) | |
| 152 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 153 | AM_RANGE(0x0000, 0xbfff) AM_ROM | |
| 154 | AM_RANGE(0xc000, 0xdfff) AM_RAM | |
| 155 | AM_RANGE(0xe000, 0xffff) AM_READWRITE(MRA8_RAM, xyonix_vidram_w) AM_BASE(&xyonix_vidram) | |
| 156 | 156 | ADDRESS_MAP_END |
| 157 | 157 | |
| 158 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 159 | AM_RANGE(0x0000, 0xbfff) AM_WRITE(MWA8_ROM) | |
| 160 | AM_RANGE(0xc000, 0xdfff) AM_WRITE(MWA8_RAM) | |
| 161 | AM_RANGE(0xe000, 0xffff) AM_WRITE(xyonix_vidram_w) AM_BASE(&xyonix_vidram) | |
| 162 | ADDRESS_MAP_END | |
| 163 | ||
| 164 | static ADDRESS_MAP_START( port_readmem, ADDRESS_SPACE_IO, 8 ) | |
| 158 | static ADDRESS_MAP_START( port_map, ADDRESS_SPACE_IO, 8 ) | |
| 165 | 159 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 166 | AM_RANGE(0x20, 0x21) AM_READ(MRA8_NOP) /* SN76496 ready signal */ | |
| 167 | AM_RANGE(0xe0, 0xe0) AM_READ(xyonix_io_r) | |
| 168 | ADDRESS_MAP_END | |
| 169 | ||
| 170 | static ADDRESS_MAP_START( port_writemem, ADDRESS_SPACE_IO, 8 ) | |
| 171 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) | |
| 172 | AM_RANGE(0x20, 0x20) AM_WRITE(SN76496_0_w) | |
| 173 | AM_RANGE(0x21, 0x21) AM_WRITE(SN76496_1_w) | |
| 174 | AM_RANGE(0xe0, 0xe0) AM_WRITE(xyonix_io_w) | |
| 175 | AM_RANGE(0x40, 0x40) AM_WRITE(MWA8_NOP) // NMI ack? | |
| 160 | AM_RANGE(0x20, 0x20) AM_READWRITE(MRA8_NOP, SN76496_0_w) /* SN76496 ready signal */ | |
| 161 | AM_RANGE(0x21, 0x21) AM_READWRITE(MRA8_NOP, SN76496_1_w) | |
| 162 | AM_RANGE(0x40, 0x40) AM_WRITE(MWA8_NOP) /* NMI ack? */ | |
| 176 | 163 | AM_RANGE(0x50, 0x50) AM_WRITE(xyonix_irqack_w) |
| 177 | AM_RANGE(0x60, 0x61) AM_WRITE(MWA8_NOP) // mc6845 | |
| 164 | AM_RANGE(0x60, 0x61) AM_WRITE(MWA8_NOP) /* mc6845 */ | |
| 165 | AM_RANGE(0xe0, 0xe0) AM_READWRITE(xyonix_io_r, xyonix_io_w) | |
| 178 | 166 | ADDRESS_MAP_END |
| 179 | 167 | |
| 180 | 168 | /* Inputs Ports **************************************************************/ |
| r1877 | r1878 | |
| 245 | 233 | |
| 246 | 234 | /* basic machine hardware */ |
| 247 | 235 | MDRV_CPU_ADD(Z80,16000000 / 4) /* 4 MHz ? */ |
| 248 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 249 | MDRV_CPU_IO_MAP(port_readmem,port_writemem) | |
| 250 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,1) | |
| 236 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 237 | MDRV_CPU_IO_MAP(port_map,0) | |
| 238 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse) | |
| 251 | 239 | MDRV_CPU_PERIODIC_INT(irq0_line_assert,4*60) /* ?? controls music tempo */ |
| 252 | 240 | |
| 253 | 241 | /* video hardware */ |
| r1877 | r1878 | |
|---|---|---|
| 212 | 212 | MDRV_CPU_ADD(Z80, VICTORY_MAIN_CPU_CLOCK) |
| 213 | 213 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 214 | 214 | MDRV_CPU_IO_MAP(main_io_map,0) |
| 215 | MDRV_CPU_VBLANK_INT(victory_vblank_interrupt | |
| 215 | MDRV_CPU_VBLANK_INT("main", victory_vblank_interrupt | |
| 216 | 216 | |
| 217 | 217 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 218 | 218 |
| r1877 | r1878 | |
|---|---|---|
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | 23 | #include "driver.h" |
| 24 | #include "deprecat.h" | |
| 24 | 25 | #include "cpu/z80/z80.h" |
| 25 | 26 | #include "sound/2203intf.h" |
| 26 | 27 | |
| r1877 | r1878 | |
| 251 | 252 | // basic machine hardware |
| 252 | 253 | MDRV_CPU_ADD(Z80, 6000000) // 6 MHz |
| 253 | 254 | MDRV_CPU_PROGRAM_MAP(c1943_map, 0) |
| 254 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 255 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 255 | 256 | |
| 256 | 257 | MDRV_CPU_ADD(Z80, 3000000) // 3 MHz |
| 257 | 258 | /* audio CPU */ |
| 258 | 259 | MDRV_CPU_PROGRAM_MAP(sound_map, 0) |
| 259 | MDRV_CPU_VBLANK_INT(irq0_line_hold, 4) | |
| 260 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 4) | |
| 260 | 261 | |
| 261 | 262 | // video hardware |
| 262 | 263 | |
| r1877 | r1878 | |
| 276 | 277 | // sound hardware |
| 277 | 278 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 278 | 279 | |
| 279 | MDRV_SOUND_ADD(YM2203, 1 | |
| 280 | MDRV_SOUND_ADD(YM2203, XTAL_24MHz/16 | |
| 280 | 281 | MDRV_SOUND_ROUTE(0, "mono", 0.15) |
| 281 | 282 | MDRV_SOUND_ROUTE(1, "mono", 0.15) |
| 282 | 283 | MDRV_SOUND_ROUTE(2, "mono", 0.15) |
| 283 | 284 | MDRV_SOUND_ROUTE(3, "mono", 0.10) |
| 284 | 285 | |
| 285 | MDRV_SOUND_ADD(YM2203, 1 | |
| 286 | MDRV_SOUND_ADD(YM2203, XTAL_24MHz/16 | |
| 286 | 287 | MDRV_SOUND_ROUTE(0, "mono", 0.15) |
| 287 | 288 | MDRV_SOUND_ROUTE(1, "mono", 0.15) |
| 288 | 289 | MDRV_SOUND_ROUTE(2, "mono", 0.15) |
| r1877 | r1878 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | static WRITE16_HANDLER( cninja_sound_w ) |
| 61 | 61 | { |
| 62 | soundlatch_w(0,data&0xff); | |
| 63 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 62 | soundlatch_w(machine,0,data&0xff); | |
| 63 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | static WRITE16_HANDLER( stoneage_sound_w ) |
| 67 | 67 | { |
| 68 | soundlatch_w(0,data&0xff); | |
| 69 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 68 | soundlatch_w(machine,0,data&0xff); | |
| 69 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | static TIMER_CALLBACK( interrupt_gen ) |
| r1877 | r1878 | |
| 785 | 785 | /* basic machine hardware */ |
| 786 | 786 | MDRV_CPU_ADD(M68000, 12000000) |
| 787 | 787 | MDRV_CPU_PROGRAM_MAP(cninja_readmem,cninja_writemem) |
| 788 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 788 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 789 | 789 | |
| 790 | 790 | MDRV_CPU_ADD(H6280,32220000/8) |
| 791 | 791 | /* audio CPU */ /* Accurate */ |
| r1877 | r1878 | |
| 834 | 834 | /* basic machine hardware */ |
| 835 | 835 | MDRV_CPU_ADD(M68000, 12000000) |
| 836 | 836 | MDRV_CPU_PROGRAM_MAP(cninja_readmem,cninja_writemem) |
| 837 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 837 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 838 | 838 | |
| 839 | 839 | MDRV_CPU_ADD(Z80, 3579545) |
| 840 | 840 | /* audio CPU */ |
| r1877 | r1878 | |
| 880 | 880 | /* basic machine hardware */ |
| 881 | 881 | MDRV_CPU_ADD(M68000, 12000000) |
| 882 | 882 | MDRV_CPU_PROGRAM_MAP(edrandy_readmem,edrandy_writemem) |
| 883 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 883 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 884 | 884 | |
| 885 | 885 | MDRV_CPU_ADD(H6280,32220000/8) |
| 886 | 886 | /* audio CPU */ /* Accurate */ |
| r1877 | r1878 | |
| 929 | 929 | /* basic machine hardware */ |
| 930 | 930 | MDRV_CPU_ADD(M68000, 14000000) |
| 931 | 931 | MDRV_CPU_PROGRAM_MAP(robocop2_readmem,robocop2_writemem) |
| 932 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 932 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 933 | 933 | |
| 934 | 934 | MDRV_CPU_ADD(H6280,32220000/8) |
| 935 | 935 | /* audio CPU */ /* Accurate */ |
| r1877 | r1878 | |
| 981 | 981 | /* basic machine hardware */ |
| 982 | 982 | MDRV_CPU_ADD(M68000, 14000000) |
| 983 | 983 | MDRV_CPU_PROGRAM_MAP(mutantf_readmem,mutantf_writemem) |
| 984 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 984 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 985 | 985 | |
| 986 | 986 | MDRV_CPU_ADD(H6280,32220000/8) |
| 987 | 987 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 415 | 415 | /* basic machine hardware */ |
| 416 | 416 | MDRV_CPU_ADD(M6809, 49152000/32) /* 1.536 MHz */ |
| 417 | 417 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 418 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 418 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 419 | 419 | |
| 420 | 420 | MDRV_CPU_ADD(HD63701, 49152000/8) /* 1.536 MHz? */ |
| 421 | 421 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 422 | 422 | MDRV_CPU_IO_MAP(mcu_port_map,0) |
| 423 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 423 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 424 | 424 | |
| 425 | 425 | MDRV_INTERLEAVE(100) /* we need heavy synching between the MCU and the CPU */ |
| 426 | 426 |
| r1877 | r1878 | |
|---|---|---|
| 365 | 365 | |
| 366 | 366 | static READ32_HANDLER( psh_ymf_fm_r ) |
| 367 | 367 | { |
| 368 | return YMF278B_status_port_0_r(0)<<24; /* Also, bit 0 being high indicates not ready to send sample data for test */ | |
| 368 | return YMF278B_status_port_0_r(machine, 0)<<24; /* Also, bit 0 being high indicates not ready to send sample data for test */ | |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | static WRITE32_HANDLER( psh_ymf_fm_w ) |
| 372 | 372 | { |
| 373 | 373 | if (!(mem_mask & 0xff000000)) // FM bank 1 address (OPL2/OPL3 compatible) |
| 374 | 374 | { |
| 375 | YMF278B_control_port_0_A_w(0, data>>24); | |
| 375 | YMF278B_control_port_0_A_w(machine, 0, data>>24); | |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | if (!(mem_mask & 0x00ff0000)) // FM bank 1 data |
| 379 | 379 | { |
| 380 | YMF278B_data_port_0_A_w(0, data>>16); | |
| 380 | YMF278B_data_port_0_A_w(machine, 0, data>>16); | |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | if (!(mem_mask & 0x0000ff00)) // FM bank 2 address (OPL3/YMF 262 extended) |
| 384 | 384 | { |
| 385 | YMF278B_control_port_0_B_w(0, data>>8); | |
| 385 | YMF278B_control_port_0_B_w(machine, 0, data>>8); | |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | if (!(mem_mask & 0x000000ff)) // FM bank 2 data |
| 389 | 389 | { |
| 390 | YMF278B_data_port_0_B_w(0, data); | |
| 390 | YMF278B_data_port_0_B_w(machine, 0, data); | |
| 391 | 391 | } |
| 392 | 392 | } |
| 393 | 393 | |
| r1877 | r1878 | |
| 395 | 395 | { |
| 396 | 396 | if (!(mem_mask & 0xff000000)) // PCM address (OPL4/YMF 278B extended) |
| 397 | 397 | { |
| 398 | YMF278B_control_port_0_C_w(0, data>>24); | |
| 398 | YMF278B_control_port_0_C_w(machine, 0, data>>24); | |
| 399 | 399 | |
| 400 | 400 | #if ROMTEST |
| 401 | 401 | if (data>>24 == 0x06) // Reset Sample reading (They always write this code immediately before reading data) |
| r1877 | r1878 | |
| 407 | 407 | |
| 408 | 408 | if (!(mem_mask & 0x00ff0000)) // PCM data |
| 409 | 409 | { |
| 410 | YMF278B_data_port_0_C_w(0, data>>16); | |
| 410 | YMF278B_data_port_0_C_w(machine, 0, data>>16); | |
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | 413 | |
| r1877 | r1878 | |
| 492 | 492 | /* basic machine hardware */ |
| 493 | 493 | MDRV_CPU_ADD_TAG("main", SH2, MASTER_CLOCK/2) |
| 494 | 494 | MDRV_CPU_PROGRAM_MAP(ps4_readmem,ps4_writemem) |
| 495 | MDRV_CPU_VBLANK_INT(psikyosh_interrupt | |
| 495 | MDRV_CPU_VBLANK_INT("left", psikyosh_interrupt | |
| 496 | 496 | |
| 497 | 497 | MDRV_NVRAM_HANDLER(93C56) |
| 498 | 498 |
| r1877 | r1878 | |
|---|---|---|
| 174 | 174 | |
| 175 | 175 | void wardner_restore_bank(void) |
| 176 | 176 | { |
| 177 | wardner_ramrom_bank_sw(0,1); /* Dummy value to ensure restoration */ | |
| 178 | wardner_ramrom_bank_sw(0,wardner_membank); | |
| 177 | wardner_ramrom_bank_sw(Machine,0,1); /* Dummy value to ensure restoration */ | |
| 178 | wardner_ramrom_bank_sw(Machine,0,wardner_membank); | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | |
| r1877 | r1878 | |
| 468 | 468 | MDRV_CPU_ADD(Z80,24000000/4) /* 6MHz ??? - Real board crystal is 24MHz */ |
| 469 | 469 | MDRV_CPU_PROGRAM_MAP(main_program_map, 0) |
| 470 | 470 | MDRV_CPU_IO_MAP(main_io_map, 0) |
| 471 | MDRV_CPU_VBLANK_INT(wardner_interrupt | |
| 471 | MDRV_CPU_VBLANK_INT("main", wardner_interrupt | |
| 472 | 472 | |
| 473 | 473 | MDRV_CPU_ADD(Z80,24000000/7) /* 3.43MHz ??? */ |
| 474 | 474 | MDRV_CPU_PROGRAM_MAP(sound_program_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 55 | 55 | static WRITE8_HANDLER( sound_command_w ) |
| 56 | 56 | { |
| 57 | 57 | sound_cpu_busy = 0x20; |
| 58 | soundlatch_w(0, data); | |
| 59 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 58 | soundlatch_w(machine, 0, data); | |
| 59 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | static READ8_HANDLER( sound_command_r ) |
| 63 | 63 | { |
| 64 | 64 | sound_cpu_busy = 0; |
| 65 | return(soundlatch_r(0)); | |
| 65 | return(soundlatch_r(machine,0)); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static READ8_HANDLER( sound_nmi_ack_r ) |
| r1877 | r1878 | |
| 73 | 73 | |
| 74 | 74 | static READ8_HANDLER( jcross_port_0_r ) |
| 75 | 75 | { |
| 76 | return(input_port_0_r(0) | sound_cpu_busy); | |
| 76 | return(input_port_0_r(machine,0) | sound_cpu_busy); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | static WRITE8_HANDLER(jcross_vregs0_w){jcross_vregs[0]=data;} |
| r1877 | r1878 | |
| 261 | 261 | |
| 262 | 262 | MDRV_CPU_ADD(Z80, 3360000) |
| 263 | 263 | MDRV_CPU_PROGRAM_MAP(cpuA_map,0) |
| 264 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 264 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 265 | 265 | |
| 266 | 266 | MDRV_CPU_ADD(Z80, 3360000) |
| 267 | 267 | MDRV_CPU_PROGRAM_MAP(cpuB_map,0) |
| 268 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 268 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 269 | 269 | |
| 270 | 270 | MDRV_CPU_ADD(Z80, 4000000) |
| 271 | 271 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 310 | 310 | |
| 311 | 311 | static READ8_HANDLER( spc_ram_100_r ) |
| 312 | 312 | { |
| 313 | return spc_ram_r(offset + 0x100); | |
| 313 | return spc_ram_r(machine, offset + 0x100); | |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | static WRITE8_HANDLER( spc_ram_100_w ) |
| 317 | 317 | { |
| 318 | spc_ram_w(offset + 0x100, data); | |
| 318 | spc_ram_w(machine, offset + 0x100, data); | |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | static ADDRESS_MAP_START( spc_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 420 | 420 | MDRV_CPU_ADD_TAG("sound", SPC700, 2048000/2) /* 2.048 Mhz, but internal divider */ |
| 421 | 421 | /* audio CPU */ |
| 422 | 422 | MDRV_CPU_PROGRAM_MAP(spc_mem, 0) |
| 423 | MDRV_CPU_VBLANK_INT(NULL, 0) | |
| 424 | 423 | |
| 425 | 424 | MDRV_INTERLEAVE(400) |
| 426 | 425 |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "deprecat.h" | |
| 8 | 9 | #include "cpu/z80/z80.h" |
| 9 | 10 | #include "sound/ay8910.h" |
| 10 | 11 | |
| r1877 | r1878 | |
| 237 | 238 | /* basic machine hardware */ |
| 238 | 239 | MDRV_CPU_ADD(Z80,XTAL_24MHz/8) /* verified on pcb */ |
| 239 | 240 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 240 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 241 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 241 | 242 | |
| 242 | 243 | MDRV_CPU_ADD(Z80,XTAL_24MHz/16) /* verified on pcb */ |
| 243 | 244 | /* audio CPU */ |
| 244 | 245 | MDRV_CPU_PROGRAM_MAP(readmem_snd,writemem_snd) |
| 245 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,4) | |
| 246 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,4) | |
| 246 | 247 | |
| 247 | 248 | /* video hardware */ |
| 248 | 249 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 39 | 39 | |
| 40 | 40 | #include "deco16ic.h" |
| 41 | 41 | |
| 42 | static void draw_sprites(running_machine *machine, | |
| 42 | static void draw_sprites(running_machine *machine, | |
| 43 | 43 | { |
| 44 | 44 | int offs; |
| 45 | 45 | |
| r1877 | r1878 | |
| 52 | 52 | |
| 53 | 53 | y = spriteram16[offs]; |
| 54 | 54 | flash=y&0x1000; |
| 55 | if (flash && ( | |
| 55 | if (flash && (vid | |
| 56 | 56 | |
| 57 | 57 | x = spriteram16[offs+2]; |
| 58 | 58 | colour = (x >>9) & 0x1f; |
| r1877 | r1878 | |
| 349 | 349 | /* basic machine hardware */ |
| 350 | 350 | MDRV_CPU_ADD(M68000, 28000000/2) |
| 351 | 351 | MDRV_CPU_PROGRAM_MAP(mirage_readmem,mirage_writemem) |
| 352 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 352 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 353 | 353 | |
| 354 | 354 | /* video hardware */ |
| 355 | 355 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 591 | 591 | |
| 592 | 592 | /* POKEY */ |
| 593 | 593 | else if (offset < 0x4800) |
| 594 | pokey1_w(offset & 0x0f, data); | |
| 594 | pokey1_w(machine, offset & 0x0f, data); | |
| 595 | 595 | |
| 596 | 596 | /* OUT0 */ |
| 597 | 597 | else if (offset < 0x4900) |
| r1877 | r1878 | |
| 650 | 650 | |
| 651 | 651 | /* POKEY */ |
| 652 | 652 | else if (offset < 0x4800) |
| 653 | result = pokey1_r(offset & 0x0f); | |
| 653 | result = pokey1_r(machine, offset & 0x0f); | |
| 654 | 654 | |
| 655 | 655 | /* IN0 */ |
| 656 | 656 | else if (offset < 0x4900) |
| r1877 | r1878 | |
|---|---|---|
| 92 | 92 | static READ8_HANDLER( ddrible_vlm5030_busy_r ) |
| 93 | 93 | { |
| 94 | 94 | return mame_rand(Machine); /* patch */ |
| 95 | /* FIXME: remove ? */ | |
| 96 | #if 0 | |
| 95 | 97 | if (VLM5030_BSY()) return 1; |
| 96 | 98 | else return 0; |
| 99 | #endif | |
| 97 | 100 | } |
| 98 | 101 | |
| 99 | 102 | static WRITE8_HANDLER( ddrible_vlm5030_ctrl_w ) |
| r1877 | r1878 | |
| 342 | 345 | /* basic machine hardware */ |
| 343 | 346 | MDRV_CPU_ADD(M6809, XTAL_18_432MHz/12) /* verified on pcb */ |
| 344 | 347 | MDRV_CPU_PROGRAM_MAP(readmem_cpu0,writemem_cpu0) |
| 345 | MDRV_CPU_VBLANK_INT(ddrible_interrupt_0 | |
| 348 | MDRV_CPU_VBLANK_INT("main", ddrible_interrupt_0 | |
| 346 | 349 | |
| 347 | 350 | MDRV_CPU_ADD(M6809, XTAL_18_432MHz/12) /* verified on pcb */ |
| 348 | 351 | MDRV_CPU_PROGRAM_MAP(readmem_cpu1,writemem_cpu1) |
| 349 | MDRV_CPU_VBLANK_INT(ddrible_interrupt_ | |
| 352 | MDRV_CPU_VBLANK_INT("main", ddrible_interrupt_ | |
| 350 | 353 | |
| 351 | 354 | MDRV_CPU_ADD(M6809, XTAL_18_432MHz/12) /* verified on pcb */ |
| 352 | 355 | MDRV_CPU_PROGRAM_MAP(readmem_cpu2,writemem_cpu2) |
| r1877 | r1878 | |
|---|---|---|
| 312 | 312 | /* basic machine hardware */ |
| 313 | 313 | MDRV_CPU_ADD(Z80,18432000/6) |
| 314 | 314 | MDRV_CPU_PROGRAM_MAP(popper_readmem,popper_writemem) |
| 315 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 315 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 316 | 316 | |
| 317 | 317 | MDRV_CPU_ADD(Z80,18432000/12) |
| 318 | 318 | /* audio CPU */ |
| 319 | 319 | MDRV_CPU_PROGRAM_MAP(popper_sound_readmem,popper_sound_writemem) |
| 320 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) //NMIs caused by the main CPU | |
| 320 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) //NMIs caused by the main CPU | |
| 321 | 321 | |
| 322 | 322 | MDRV_INTERLEAVE(30) |
| 323 | 323 |
| r1877 | r1878 | |
|---|---|---|
| 97 | 97 | |
| 98 | 98 | static WRITE8_HANDLER( sound_command_w ) |
| 99 | 99 | { |
| 100 | soundlatch_w(0,data); | |
| 100 | soundlatch_w(machine,0,data); | |
| 101 | 101 | timer_call_after_resynch(NULL, data,nmi_callback); |
| 102 | 102 | } |
| 103 | 103 | |
| r1877 | r1878 | |
| 281 | 281 | static MACHINE_DRIVER_START( ladyfrog ) |
| 282 | 282 | MDRV_CPU_ADD(Z80,8000000/2) |
| 283 | 283 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 284 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 284 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 285 | 285 | |
| 286 | 286 | MDRV_CPU_ADD(Z80,8000000/2) |
| 287 | 287 | /* audio CPU */ |
| 288 | 288 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 289 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 289 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 290 | 290 | |
| 291 | 291 | /* video hardware */ |
| 292 | 292 | MDRV_INTERLEAVE(100) |
| r1877 | r1878 | |
|---|---|---|
| 169 | 169 | static MACHINE_DRIVER_START( go2000 ) |
| 170 | 170 | MDRV_CPU_ADD_TAG("main", M68000, 10000000) |
| 171 | 171 | MDRV_CPU_PROGRAM_MAP(go2000_readmem,go2000_writemem) |
| 172 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 172 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 173 | 173 | |
| 174 | 174 | MDRV_GFXDECODE(go2000) |
| 175 | 175 |
| r1877 | r1878 | |
|---|---|---|
| 403 | 403 | |
| 404 | 404 | logerror( "0x%04x: prot_w(0x%02x)\n", activecpu_get_pc(), data ); |
| 405 | 405 | |
| 406 | watchdog_reset_w(0,0); | |
| 406 | watchdog_reset_w(machine,0,0); | |
| 407 | 407 | |
| 408 | 408 | if( prot_mode == ePROT_WAIT_DSW1_WRITEBACK ) |
| 409 | 409 | { |
| r1877 | r1878 | |
| 715 | 715 | |
| 716 | 716 | static WRITE8_HANDLER( trigger_nmi_on_sound_cpu2 ) |
| 717 | 717 | { |
| 718 | soundlatch_w(0,data); | |
| 719 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 718 | soundlatch_w(machine,0,data); | |
| 719 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 720 | 720 | } /* trigger_nmi_on_sound_cpu2 */ |
| 721 | 721 | |
| 722 | 722 | static WRITE8_HANDLER( cpu2_bankswitch_w ) |
| r1877 | r1878 | |
| 829 | 829 | MDRV_CPU_ADD(Z80,6000000) |
| 830 | 830 | MDRV_CPU_PROGRAM_MAP(cpu0_am,0) |
| 831 | 831 | MDRV_CPU_IO_MAP(cpu0_port_am,0) |
| 832 | MDRV_CPU_VBLANK_INT(djboy_interrupt,2) | |
| 832 | MDRV_CPU_VBLANK_INT_HACK(djboy_interrupt,2) | |
| 833 | 833 | |
| 834 | 834 | MDRV_CPU_ADD(Z80,6000000) |
| 835 | 835 | MDRV_CPU_PROGRAM_MAP(cpu1_am,0) |
| 836 | 836 | MDRV_CPU_IO_MAP(cpu1_port_am,0) |
| 837 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 837 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 838 | 838 | |
| 839 | 839 | MDRV_CPU_ADD(Z80, 6000000) |
| 840 | 840 | MDRV_CPU_PROGRAM_MAP(cpu2_am,0) |
| 841 | 841 | MDRV_CPU_IO_MAP(cpu2_port_am,0) |
| 842 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 842 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 843 | 843 | |
| 844 | 844 | MDRV_INTERLEAVE(100) |
| 845 | 845 |
| r1877 | r1878 | |
|---|---|---|
| 718 | 718 | /* basic machine hardware */ |
| 719 | 719 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz (?) */ |
| 720 | 720 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 721 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 721 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 722 | 722 | |
| 723 | 723 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz (?) */ |
| 724 | 724 | /* audio CPU */ |
| r1877 | r1878 | |
| 764 | 764 | /* basic machine hardware */ |
| 765 | 765 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz (?) */ |
| 766 | 766 | MDRV_CPU_PROGRAM_MAP(turtship_readmem,turtship_writemem) |
| 767 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 767 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 768 | 768 | |
| 769 | 769 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz (?) */ |
| 770 | 770 | /* audio CPU */ |
| r1877 | r1878 | |
| 809 | 809 | /* basic machine hardware */ |
| 810 | 810 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz (?) */ |
| 811 | 811 | MDRV_CPU_PROGRAM_MAP(whizz_readmem,whizz_writemem) |
| 812 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 812 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 813 | 813 | |
| 814 | 814 | MDRV_CPU_ADD(Z80, 4000000) |
| 815 | 815 | /* audio CPU */ |
| 816 | 816 | MDRV_CPU_PROGRAM_MAP(whizz_sound_readmem,whizz_sound_writemem) |
| 817 | 817 | MDRV_CPU_IO_MAP(whizz_readport,whizz_writeport) |
| 818 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 818 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 819 | 819 | |
| 820 | 820 | MDRV_INTERLEAVE(1000) |
| 821 | 821 |
| r1877 | r1878 | |
|---|---|---|
| 1009 | 1009 | /* basic machine hardware */ |
| 1010 | 1010 | MDRV_CPU_ADD(M68000, XTAL_16MHz/2) /* verified on pcb */ |
| 1011 | 1011 | MDRV_CPU_PROGRAM_MAP(superman_readmem,superman_writemem) |
| 1012 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 1012 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 1013 | 1013 | |
| 1014 | 1014 | MDRV_CPU_ADD(Z80, XTAL_16MHz/4) /* verified on pcb */ |
| 1015 | 1015 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
| 1049 | 1049 | /* basic machine hardware */ |
| 1050 | 1050 | MDRV_CPU_ADD(M68000, XTAL_16MHz/2) /* verified on pcb */ |
| 1051 | 1051 | MDRV_CPU_PROGRAM_MAP(daisenpu_readmem,daisenpu_writemem) |
| 1052 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 1052 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 1053 | 1053 | |
| 1054 | 1054 | MDRV_CPU_ADD(Z80, XTAL_16MHz/4) /* verified on pcb */ |
| 1055 | 1055 | MDRV_CPU_PROGRAM_MAP(daisenpu_sound_readmem,daisenpu_sound_writemem) |
| r1877 | r1878 | |
| 1086 | 1086 | /* basic machine hardware */ |
| 1087 | 1087 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz? */ |
| 1088 | 1088 | MDRV_CPU_PROGRAM_MAP(gigandes_readmem,gigandes_writemem) |
| 1089 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 1089 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 1090 | 1090 | |
| 1091 | 1091 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz ??? */ |
| 1092 | 1092 | MDRV_CPU_PROGRAM_MAP(ballbros_sound_readmem,ballbros_sound_writemem) |
| r1877 | r1878 | |
| 1125 | 1125 | /* basic machine hardware */ |
| 1126 | 1126 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz? */ |
| 1127 | 1127 | MDRV_CPU_PROGRAM_MAP(ballbros_readmem,ballbros_writemem) |
| 1128 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 1128 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 1129 | 1129 | |
| 1130 | 1130 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz ??? */ |
| 1131 | 1131 | MDRV_CPU_PROGRAM_MAP(ballbros_sound_readmem,ballbros_sound_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 72 | 72 | |
| 73 | 73 | static WRITE8_HANDLER( jack_sh_command_w ) |
| 74 | 74 | { |
| 75 | soundlatch_w(0,data); | |
| 76 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 75 | soundlatch_w(machine,0,data); | |
| 76 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
| r1877 | r1878 | |
| 875 | 875 | /* basic machine hardware */ |
| 876 | 876 | MDRV_CPU_ADD_TAG("main", Z80, 18000000/6) /* 3 MHz */ |
| 877 | 877 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 878 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 878 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 879 | 879 | |
| 880 | 880 | MDRV_CPU_ADD(Z80,18000000/12) |
| 881 | 881 | /* audio CPU */ /* 1.5 MHz */ |
| r1877 | r1878 | |
| 909 | 909 | /* basic machine hardware */ |
| 910 | 910 | MDRV_IMPORT_FROM(jack) |
| 911 | 911 | MDRV_CPU_MODIFY("main") |
| 912 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) /* tripool needs 2 or the palette is broken */ | |
| 912 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) /* tripool needs 2 or the palette is broken */ | |
| 913 | 913 | MACHINE_DRIVER_END |
| 914 | 914 | |
| 915 | 915 | static INTERRUPT_GEN( joinem_interrupts ) |
| r1877 | r1878 | |
| 929 | 929 | MDRV_IMPORT_FROM(jack) |
| 930 | 930 | MDRV_CPU_MODIFY("main") |
| 931 | 931 | MDRV_CPU_PROGRAM_MAP(joinem_map,0) |
| 932 | MDRV_CPU_VBLANK_INT(joinem_interrupts,3) | |
| 932 | MDRV_CPU_VBLANK_INT_HACK(joinem_interrupts,3) | |
| 933 | 933 | |
| 934 | 934 | MDRV_GFXDECODE(joinem) |
| 935 | 935 | MDRV_PALETTE_LENGTH(0x100) |
| r1877 | r1878 | |
| 949 | 949 | MDRV_IMPORT_FROM(jack) |
| 950 | 950 | MDRV_CPU_MODIFY("main") |
| 951 | 951 | MDRV_CPU_PROGRAM_MAP(joinem_map,0) |
| 952 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 952 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 953 | 953 | |
| 954 | 954 | MDRV_GFXDECODE(joinem) |
| 955 | 955 | MDRV_PALETTE_LENGTH(0x100) |
| r1877 | r1878 | |
|---|---|---|
| 72 | 72 | |
| 73 | 73 | static WRITE16_HANDLER( tumblep_sound_w ) |
| 74 | 74 | { |
| 75 | soundlatch_w(0,data & 0xff); | |
| 76 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 75 | soundlatch_w(machine,0,data & 0xff); | |
| 76 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | #ifdef UNUSED_FUNCTION |
| 80 | 80 | static WRITE16_HANDLER( jumppop_sound_w ) |
| 81 | 81 | { |
| 82 | soundlatch_w(0,data & 0xff); | |
| 83 | cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE ); | |
| 82 | soundlatch_w(machine,0,data & 0xff); | |
| 83 | cpunum_set_input_line(machine, 1, 0, ASSERT_LINE ); | |
| 84 | 84 | } |
| 85 | 85 | #endif |
| 86 | 86 | |
| r1877 | r1878 | |
| 140 | 140 | { |
| 141 | 141 | switch (offset) { |
| 142 | 142 | case 0: |
| 143 | YM2151_register_port_0_w(0,data); | |
| 143 | YM2151_register_port_0_w(machine,0,data); | |
| 144 | 144 | break; |
| 145 | 145 | case 1: |
| 146 | YM2151_data_port_0_w(0,data); | |
| 146 | YM2151_data_port_0_w(machine,0,data); | |
| 147 | 147 | break; |
| 148 | 148 | } |
| 149 | 149 | } |
| r1877 | r1878 | |
| 321 | 321 | /* basic machine hardware */ |
| 322 | 322 | MDRV_CPU_ADD(M68000, 14000000) |
| 323 | 323 | MDRV_CPU_PROGRAM_MAP(tumblepop_readmem,tumblepop_writemem) |
| 324 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 324 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 325 | 325 | |
| 326 | 326 | MDRV_CPU_ADD(H6280, 32220000/8) /* Custom chip 45; Audio section crystal is 32.220 MHz */ |
| 327 | 327 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 57 | 57 | { |
| 58 | 58 | /* bit 4 goes to the 8910 #0 BC1 pin */ |
| 59 | 59 | if (last & 0x10) |
| 60 | AY8910_control_port_0_w(0,soundlatch); | |
| 60 | AY8910_control_port_0_w(machine,0,soundlatch); | |
| 61 | 61 | else |
| 62 | AY8910_write_port_0_w(0,soundlatch); | |
| 62 | AY8910_write_port_0_w(machine,0,soundlatch); | |
| 63 | 63 | } |
| 64 | 64 | /* bit 7 goes to 8910 #1 BDIR pin */ |
| 65 | 65 | if ((last & 0x80) == 0x80 && (data & 0x80) == 0x00) |
| 66 | 66 | { |
| 67 | 67 | /* bit 6 goes to the 8910 #1 BC1 pin */ |
| 68 | 68 | if (last & 0x40) |
| 69 | AY8910_control_port_1_w(0,soundlatch); | |
| 69 | AY8910_control_port_1_w(machine,0,soundlatch); | |
| 70 | 70 | else |
| 71 | AY8910_write_port_1_w(0,soundlatch); | |
| 71 | AY8910_write_port_1_w(machine,0,soundlatch); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | last = data; |
| r1877 | r1878 | |
| 243 | 243 | /* basic machine hardware */ |
| 244 | 244 | MDRV_CPU_ADD(M6502, 1500000) /* 1.5 MHz ???? */ |
| 245 | 245 | MDRV_CPU_PROGRAM_MAP(main_readmem,main_writemem) |
| 246 | MDRV_CPU_VBLANK_INT(irq0_line_hold,16) /* ? controls music tempo */ | |
| 246 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,16) /* ? controls music tempo */ | |
| 247 | 247 | |
| 248 | 248 | MDRV_CPU_ADD(M6502, 1500000) /* 1.5 MHz ???? */ |
| 249 | 249 | MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 43 | 43 | { |
| 44 | 44 | switch (offset) { |
| 45 | 45 | case 0: |
| 46 | YM2151_register_port_0_w(0,data); | |
| 46 | YM2151_register_port_0_w(machine,0,data); | |
| 47 | 47 | break; |
| 48 | 48 | case 1: |
| 49 | YM2151_data_port_0_w(0,data); | |
| 49 | YM2151_data_port_0_w(machine,0,data); | |
| 50 | 50 | break; |
| 51 | 51 | } |
| 52 | 52 | } |
| r1877 | r1878 | |
| 205 | 205 | /* basic machine hardware */ |
| 206 | 206 | MDRV_CPU_ADD(M68000, XTAL_28MHz/2) /* DE102 (verified on pcb) */ |
| 207 | 207 | MDRV_CPU_PROGRAM_MAP(dietgo_map,0) |
| 208 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 208 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 209 | 209 | |
| 210 | 210 | MDRV_CPU_ADD(H6280, XTAL_32_22MHz/4/3) /* Custom chip 45; XIN is 32.220MHZ/4, verified on pcb */ |
| 211 | 211 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 225 | 225 | |
| 226 | 226 | static WRITE8_HANDLER( taitosj_soundcommand_w ) |
| 227 | 227 | { |
| 228 | soundlatch_w(offset,data); | |
| 229 | if (!sndnmi_disable) cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 228 | soundlatch_w(machine,offset,data); | |
| 229 | if (!sndnmi_disable) cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | static UINT8 input_port_4_f0; |
| r1877 | r1878 | |
| 1861 | 1861 | /* basic machine hardware */ |
| 1862 | 1862 | MDRV_CPU_ADD_TAG("main",Z80,8000000/2) /* 4 MHz */ |
| 1863 | 1863 | MDRV_CPU_PROGRAM_MAP(taitosj_main_nomcu_map,0) |
| 1864 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1864 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1865 | 1865 | |
| 1866 | 1866 | /* audio CPU */ /* 3 MHz */ |
| 1867 | 1867 | MDRV_CPU_ADD(Z80,6000000/2) |
| r1877 | r1878 | |
|---|---|---|
| 15 | 15 | ***************************************************************************/ |
| 16 | 16 | |
| 17 | 17 | #include "driver.h" |
| 18 | #include "deprecat.h" | |
| 18 | 19 | #include "audio/m72.h" |
| 19 | 20 | #include "sound/dac.h" |
| 20 | 21 | #include "sound/2203intf.h" |
| r1877 | r1878 | |
| 584 | 585 | MDRV_CPU_ADD(Z80, 3579645) /* 3.579645 MHz */ |
| 585 | 586 | MDRV_CPU_PROGRAM_MAP(vigilant_readmem,vigilant_writemem) |
| 586 | 587 | MDRV_CPU_IO_MAP(vigilant_readport,vigilant_writeport) |
| 587 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 588 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 588 | 589 | |
| 589 | 590 | MDRV_CPU_ADD(Z80, 3579645) |
| 590 | 591 | /* audio CPU */ /* 3.579645 MHz */ |
| 591 | 592 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 592 | 593 | MDRV_CPU_IO_MAP(sound_readport,sound_writeport) |
| 593 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1 */ | |
| 594 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128) /* clocked by V1 */ | |
| 594 | 595 | /* IRQs are generated by main Z80 and YM2151 */ |
| 595 | 596 | MDRV_MACHINE_RESET(m72_sound) |
| 596 | 597 | |
| r1877 | r1878 | |
| 627 | 628 | MDRV_CPU_ADD(Z80, 5688800) /* 5.688800 MHz */ |
| 628 | 629 | MDRV_CPU_PROGRAM_MAP(vigilant_readmem,vigilant_writemem) |
| 629 | 630 | MDRV_CPU_IO_MAP(vigilant_readport,vigilant_writeport) |
| 630 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 631 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 631 | 632 | |
| 632 | 633 | MDRV_CPU_ADD(Z80, 18432000/6) |
| 633 | 634 | /* audio CPU */ /* 3.072000 MHz */ |
| 634 | 635 | MDRV_CPU_PROGRAM_MAP(buccanrs_sound_readmem,buccanrs_sound_writemem) |
| 635 | 636 | MDRV_CPU_IO_MAP(buccanrs_sound_readport,buccanrs_sound_writeport) |
| 636 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1 */ | |
| 637 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128) /* clocked by V1 */ | |
| 637 | 638 | /* IRQs are generated by main Z80 and YM2151 */ |
| 638 | 639 | MDRV_MACHINE_RESET(m72_sound) |
| 639 | 640 | |
| r1877 | r1878 | |
| 686 | 687 | MDRV_CPU_ADD(Z80, 3579645) /* 3.579645 MHz */ |
| 687 | 688 | MDRV_CPU_PROGRAM_MAP(kikcubic_readmem,kikcubic_writemem) |
| 688 | 689 | MDRV_CPU_IO_MAP(kikcubic_readport,kikcubic_writeport) |
| 689 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 690 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 690 | 691 | |
| 691 | 692 | MDRV_CPU_ADD(Z80, 3579645) |
| 692 | 693 | /* audio CPU */ /* 3.579645 MHz */ |
| 693 | 694 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 694 | 695 | MDRV_CPU_IO_MAP(sound_readport,sound_writeport) |
| 695 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1 */ | |
| 696 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128) /* clocked by V1 */ | |
| 696 | 697 | /* IRQs are generated by main Z80 and YM2151 */ |
| 697 | 698 | MDRV_MACHINE_RESET(m72_sound) |
| 698 | 699 |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | static WRITE8_HANDLER( video_interrupt_w ) { |
| 64 | cpunum_set_input_line_and_vector( | |
| 64 | cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0xff ); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | static WRITE8_HANDLER( sprite_interrupt_w ) { |
| 68 | cpunum_set_input_line_and_vector( | |
| 68 | cpunum_set_input_line_and_vector(machine, 2, 0, HOLD_LINE, 0xff ); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | static WRITE8_HANDLER( scroll_interrupt_w ) { |
| 72 | sprite_interrupt_w( offset, data ); | |
| 72 | sprite_interrupt_w( machine, offset, data ); | |
| 73 | 73 | *kingofb_scroll_y = data; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | static WRITE8_HANDLER( sound_command_w ) { |
| 77 | soundlatch_w( 0, data ); | |
| 78 | cpunum_set_input_line_and_vector(Machine, 3, 0, HOLD_LINE, 0xff ); | |
| 77 | soundlatch_w( machine, 0, data ); | |
| 78 | cpunum_set_input_line_and_vector(machine, 3, 0, HOLD_LINE, 0xff ); | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| r1877 | r1878 | |
| 553 | 553 | /* basic machine hardware */ |
| 554 | 554 | MDRV_CPU_ADD(Z80, 4000000) /* 4.0 MHz */ |
| 555 | 555 | MDRV_CPU_PROGRAM_MAP(main_readmem,main_writemem) |
| 556 | MDRV_CPU_VBLANK_INT(kingofb_interrupt | |
| 556 | MDRV_CPU_VBLANK_INT("main", kingofb_interrupt | |
| 557 | 557 | |
| 558 | 558 | MDRV_CPU_ADD(Z80, 4000000) /* 4.0 MHz */ |
| 559 | 559 | MDRV_CPU_PROGRAM_MAP(video_readmem,video_writemem) |
| 560 | MDRV_CPU_VBLANK_INT(kingofb_interrupt | |
| 560 | MDRV_CPU_VBLANK_INT("main", kingofb_interrupt | |
| 561 | 561 | |
| 562 | 562 | MDRV_CPU_ADD(Z80, 4000000) /* 4.0 MHz */ |
| 563 | 563 | MDRV_CPU_PROGRAM_MAP(sprite_readmem,sprite_writemem) |
| 564 | MDRV_CPU_VBLANK_INT(kingofb_interrupt | |
| 564 | MDRV_CPU_VBLANK_INT("main", kingofb_interrupt | |
| 565 | 565 | |
| 566 | 566 | MDRV_CPU_ADD(Z80, 4000000) |
| 567 | 567 | /* audio CPU */ /* 4.0 MHz */ |
| r1877 | r1878 | |
| 604 | 604 | /* basic machine hardware */ |
| 605 | 605 | MDRV_CPU_ADD(Z80, 4000000) /* 4.0 MHz */ |
| 606 | 606 | MDRV_CPU_PROGRAM_MAP(rk_main_readmem,rk_main_writemem) |
| 607 | MDRV_CPU_VBLANK_INT(kingofb_interrupt | |
| 607 | MDRV_CPU_VBLANK_INT("main", kingofb_interrupt | |
| 608 | 608 | |
| 609 | 609 | MDRV_CPU_ADD(Z80, 4000000) /* 4.0 MHz */ |
| 610 | 610 | MDRV_CPU_PROGRAM_MAP(rk_video_readmem,rk_video_writemem) |
| 611 | MDRV_CPU_VBLANK_INT(kingofb_interrupt | |
| 611 | MDRV_CPU_VBLANK_INT("main", kingofb_interrupt | |
| 612 | 612 | |
| 613 | 613 | MDRV_CPU_ADD(Z80, 4000000) /* 4.0 MHz */ |
| 614 | 614 | MDRV_CPU_PROGRAM_MAP(rk_sprite_readmem,rk_sprite_writemem) |
| 615 | MDRV_CPU_VBLANK_INT(kingofb_interrupt | |
| 615 | MDRV_CPU_VBLANK_INT("main", kingofb_interrupt | |
| 616 | 616 | |
| 617 | 617 | MDRV_CPU_ADD(Z80, 4000000) |
| 618 | 618 | /* audio CPU */ /* 4.0 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | static WRITE8_HANDLER( galivan_sound_command_w ) |
| 61 | 61 | { |
| 62 | soundlatch_w(offset,(data << 1) | 1); | |
| 62 | soundlatch_w(machine,offset,(data << 1) | 1); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | static READ8_HANDLER( galivan_sound_command_r ) |
| 66 | 66 | { |
| 67 | 67 | int data; |
| 68 | 68 | |
| 69 | data = soundlatch_r(offset); | |
| 70 | soundlatch_clear_w(0,0); | |
| 69 | data = soundlatch_r(machine,offset); | |
| 70 | soundlatch_clear_w(machine,0,0); | |
| 71 | 71 | return data; |
| 72 | 72 | } |
| 73 | 73 | |
| r1877 | r1878 | |
| 83 | 83 | switch (offset) |
| 84 | 84 | { |
| 85 | 85 | case 0x0b: |
| 86 | ninjemak_scrolly_w(0, data); | |
| 86 | ninjemak_scrolly_w(machine, 0, data); | |
| 87 | 87 | break; |
| 88 | 88 | case 0x0c: |
| 89 | ninjemak_scrolly_w(1, data); | |
| 89 | ninjemak_scrolly_w(machine, 1, data); | |
| 90 | 90 | break; |
| 91 | 91 | case 0x0d: |
| 92 | ninjemak_scrollx_w(0, data); | |
| 92 | ninjemak_scrollx_w(machine, 0, data); | |
| 93 | 93 | break; |
| 94 | 94 | case 0x0e: |
| 95 | ninjemak_scrollx_w(1, data); | |
| 95 | ninjemak_scrollx_w(machine, 1, data); | |
| 96 | 96 | break; |
| 97 | 97 | default: |
| 98 | 98 | break; |
| r1877 | r1878 | |
| 560 | 560 | MDRV_CPU_ADD(Z80,12000000/2) /* 6 MHz? */ |
| 561 | 561 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 562 | 562 | MDRV_CPU_IO_MAP(readport,writeport) |
| 563 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 563 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 564 | 564 | |
| 565 | 565 | MDRV_CPU_ADD(Z80,8000000/2) |
| 566 | 566 | /* audio CPU */ /* 4 MHz? */ |
| r1877 | r1878 | |
| 604 | 604 | MDRV_CPU_ADD(Z80,12000000/2) /* 6 MHz? */ |
| 605 | 605 | MDRV_CPU_PROGRAM_MAP(readmem,ninjemak_writemem) |
| 606 | 606 | MDRV_CPU_IO_MAP(ninjemak_readport,ninjemak_writeport) |
| 607 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 607 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 608 | 608 | |
| 609 | 609 | MDRV_CPU_ADD(Z80,8000000/2) |
| 610 | 610 | /* audio CPU */ /* 4 MHz? */ |
| r1877 | r1878 | |
|---|---|---|
| 29 | 29 | ******************************************************************************/ |
| 30 | 30 | |
| 31 | 31 | #include "driver.h" |
| 32 | #include "deprecat.h" | |
| 32 | 33 | #include "nb1413m3.h" |
| 33 | 34 | #include "sound/ay8910.h" |
| 34 | 35 | #include "sound/3812intf.h" |
| r1877 | r1878 | |
| 59 | 60 | |
| 60 | 61 | static WRITE8_HANDLER( nbmj8991_soundbank_w ) |
| 61 | 62 | { |
| 62 | if (!(data & 0x80)) soundlatch_clear_w(0, 0); | |
| 63 | if (!(data & 0x80)) soundlatch_clear_w(machine, 0, 0); | |
| 63 | 64 | memory_set_bank(1, data & 0x03); |
| 64 | 65 | } |
| 65 | 66 | |
| 66 | 67 | static WRITE8_HANDLER( nbmj8991_sound_w ) |
| 67 | 68 | { |
| 68 | soundlatch_w(0, data); | |
| 69 | soundlatch_w(machine, 0, data); | |
| 69 | 70 | } |
| 70 | 71 | |
| 71 | 72 | static READ8_HANDLER( nbmj8991_sound_r ) |
| 72 | 73 | { |
| 73 | 74 | int data; |
| 74 | 75 | |
| 75 | data = soundlatch_r(0); | |
| 76 | data = soundlatch_r(machine,0); | |
| 76 | 77 | return data; |
| 77 | 78 | } |
| 78 | 79 | |
| r1877 | r1878 | |
| 1759 | 1760 | MDRV_CPU_ADD_TAG("main", Z80, 25000000/5) /* 5.00 MHz ? */ |
| 1760 | 1761 | MDRV_CPU_PROGRAM_MAP(readmem_galkoku, writemem_galkoku) |
| 1761 | 1762 | MDRV_CPU_IO_MAP(readport_galkoku, writeport_galkoku) |
| 1762 | // MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 128) | |
| 1763 | MDRV_CPU_VBLANK_INT(nb1413m3_interrupt, 1) | |
| 1763 | // MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 128) | |
| 1764 | MDRV_CPU_VBLANK_INT("main", nb1413m3_interrupt) | |
| 1764 | 1765 | |
| 1765 | 1766 | MDRV_MACHINE_RESET(nbmj8991) |
| 1766 | 1767 | |
| r1877 | r1878 | |
| 1793 | 1794 | MDRV_CPU_ADD_TAG("main", Z80, 6000000/2) /* 3.00 MHz */ |
| 1794 | 1795 | MDRV_CPU_PROGRAM_MAP(readmem_pstadium, writemem_pstadium) |
| 1795 | 1796 | MDRV_CPU_IO_MAP(readport_pstadium, writeport_pstadium) |
| 1796 | MDRV_CPU_VBLANK_INT(nb1413m3_interrupt | |
| 1797 | MDRV_CPU_VBLANK_INT("main", nb1413m3_interrupt | |
| 1797 | 1798 | |
| 1798 | 1799 | MDRV_CPU_ADD(Z80, 3900000) /* 4.00 MHz */ |
| 1799 | 1800 | /* audio CPU */ |
| 1800 | 1801 | MDRV_CPU_PROGRAM_MAP(sound_readmem_nbmj8991, sound_writemem_nbmj8991) |
| 1801 | 1802 | MDRV_CPU_IO_MAP(sound_readport_nbmj8991, sound_writeport_nbmj8991) |
| 1802 | MDRV_CPU_VBLANK_INT(irq0_line_hold, 128) | |
| 1803 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 128) | |
| 1803 | 1804 | |
| 1804 | 1805 | MDRV_MACHINE_RESET(nbmj8991) |
| 1805 | 1806 |
| r1877 | r1878 | |
|---|---|---|
| 36 | 36 | { |
| 37 | 37 | if (ACCESSING_LSB) |
| 38 | 38 | { |
| 39 | soundlatch_w(offset,data & 0xff); | |
| 40 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 39 | soundlatch_w(machine,offset,data & 0xff); | |
| 40 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
| r1877 | r1878 | |
| 318 | 318 | /* basic machine hardware */ |
| 319 | 319 | MDRV_CPU_ADD(M68000, 10000000) /* MRH - 8.76 makes gfx/adpcm samples sync better -- but 10 is correct speed*/ |
| 320 | 320 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 321 | MDRV_CPU_VBLANK_INT(blockout_interrupt,2) | |
| 321 | MDRV_CPU_VBLANK_INT_HACK(blockout_interrupt,2) | |
| 322 | 322 | |
| 323 | 323 | MDRV_CPU_ADD(Z80, 3579545) |
| 324 | 324 | /* audio CPU */ /* 3.579545 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | static WRITE8_HANDLER( vsgongf_sound_command_w ){ |
| 387 | soundlatch_w( offset, data ); | |
| 388 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 387 | soundlatch_w( machine, offset, data ); | |
| 388 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | static ADDRESS_MAP_START( readmem_vsgongf, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 754 | 754 | MDRV_CPU_ADD(Z80, 4000000) |
| 755 | 755 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 756 | 756 | MDRV_CPU_IO_MAP(z80_readport,z80_writeport) |
| 757 | MDRV_CPU_VBLANK_INT(samurai_interrupt | |
| 757 | MDRV_CPU_VBLANK_INT("main", samurai_interrupt | |
| 758 | 758 | |
| 759 | 759 | MDRV_CPU_ADD(Z80, 2000000) |
| 760 | 760 | /* audio CPU */ |
| r1877 | r1878 | |
| 799 | 799 | MDRV_CPU_ADD(Z80, 4000000) |
| 800 | 800 | MDRV_CPU_PROGRAM_MAP(readmem_m660,writemem_m660) |
| 801 | 801 | MDRV_CPU_IO_MAP(z80_readport,z80_writeport_m660) |
| 802 | MDRV_CPU_VBLANK_INT(samurai_interrupt | |
| 802 | MDRV_CPU_VBLANK_INT("main", samurai_interrupt | |
| 803 | 803 | |
| 804 | 804 | MDRV_CPU_ADD(Z80, 2000000) |
| 805 | 805 | /* audio CPU */ |
| r1877 | r1878 | |
| 813 | 813 | /* audio CPU */ |
| 814 | 814 | MDRV_CPU_PROGRAM_MAP(readmem_sound3_m660,writemem_sound3_m660) |
| 815 | 815 | MDRV_CPU_IO_MAP(readport_sound3_m660,writeport_sound3_m660) |
| 816 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 816 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 817 | 817 | |
| 818 | 818 | /* video hardware */ |
| 819 | 819 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 849 | 849 | /* basic machine hardware */ |
| 850 | 850 | MDRV_CPU_ADD(Z80, 4000000) |
| 851 | 851 | MDRV_CPU_PROGRAM_MAP(readmem_vsgongf,writemem_vsgongf) |
| 852 | MDRV_CPU_VBLANK_INT(samurai_interrupt | |
| 852 | MDRV_CPU_VBLANK_INT("main", samurai_interrupt | |
| 853 | 853 | |
| 854 | 854 | MDRV_CPU_ADD(Z80, 4000000) |
| 855 | 855 | MDRV_CPU_PROGRAM_MAP(readmem_sound_vsgongf,writemem_sound_vsgongf) |
| 856 | 856 | MDRV_CPU_IO_MAP(0,z80_writeport) |
| 857 | MDRV_CPU_VBLANK_INT(vsgongf_sound_interrupt,3) | |
| 857 | MDRV_CPU_VBLANK_INT_HACK(vsgongf_sound_interrupt,3) | |
| 858 | 858 | |
| 859 | 859 | /* video hardware */ |
| 860 | 860 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 368 | 368 | |
| 369 | 369 | MDRV_CPU_PROGRAM_MAP(igs_majhong_map,0) |
| 370 | 370 | |
| 371 | MDRV_CPU_VBLANK_INT(igs_majhong_interrupt | |
| 371 | MDRV_CPU_VBLANK_INT("main", igs_majhong_interrupt | |
| 372 | 372 | //MDRV_NVRAM_HANDLER(generic_0fill) |
| 373 | 373 | |
| 374 | 374 | MDRV_GFXDECODE(igs_m027) |
| r1877 | r1878 | |
|---|---|---|
| 237 | 237 | /* basic machine hardware */ |
| 238 | 238 | MDRV_CPU_ADD(M6502, 12096000 / 16) |
| 239 | 239 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 240 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 240 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 241 | 241 | MDRV_WATCHDOG_VBLANK_INIT(8) |
| 242 | 242 | |
| 243 | 243 | /* video hardware */ |
| r1877 | r1878 | |
|---|---|---|
| 93 | 93 | /* special case to return the value written to 0xb000 */ |
| 94 | 94 | /* does it reset the chips too ? */ |
| 95 | 95 | case 0: break; |
| 96 | case 0xc4: b000_ret = AY8910_read_port_0_r(0); break; | |
| 97 | case 0x94: b000_ret = AY8910_read_port_1_r(0); break; | |
| 98 | case 0x86: b000_ret = AY8910_read_port_2_r(0); break; | |
| 96 | case 0xc4: b000_ret = AY8910_read_port_0_r(machine,0); break; | |
| 97 | case 0x94: b000_ret = AY8910_read_port_1_r(machine,0); break; | |
| 98 | case 0x86: b000_ret = AY8910_read_port_2_r(machine,0); break; | |
| 99 | 99 | |
| 100 | 100 | case 0x80: |
| 101 | 101 | switch(b800_prev) |
| 102 | 102 | { |
| 103 | case 0xe0: AY8910_control_port_0_w(0,b000_val); break; | |
| 104 | case 0x98: AY8910_control_port_1_w(0,b000_val); break; | |
| 105 | case 0x83: AY8910_control_port_2_w(0,b000_val); break; | |
| 103 | case 0xe0: AY8910_control_port_0_w(machine,0,b000_val); break; | |
| 104 | case 0x98: AY8910_control_port_1_w(machine,0,b000_val); break; | |
| 105 | case 0x83: AY8910_control_port_2_w(machine,0,b000_val); break; | |
| 106 | 106 | |
| 107 | case 0xa0: AY8910_write_port_0_w(0,b000_val); break; | |
| 108 | case 0x88: AY8910_write_port_1_w(0,b000_val); break; | |
| 109 | case 0x81: AY8910_write_port_2_w(0,b000_val); break; | |
| 107 | case 0xa0: AY8910_write_port_0_w(machine,0,b000_val); break; | |
| 108 | case 0x88: AY8910_write_port_1_w(machine,0,b000_val); break; | |
| 109 | case 0x81: AY8910_write_port_2_w(machine,0,b000_val); break; | |
| 110 | 110 | |
| 111 | 111 | } |
| 112 | 112 | break; |
| r1877 | r1878 | |
| 230 | 230 | MDRV_CPU_ADD(Z80,12000000/4-48000) //should be ok, it gives the 300 interrupts expected |
| 231 | 231 | MDRV_CPU_PROGRAM_MAP(cpu_map,0) |
| 232 | 232 | MDRV_CPU_IO_MAP(io_map,0) |
| 233 | MDRV_CPU_VBLANK_INT(ettrivia_interrupt | |
| 233 | MDRV_CPU_VBLANK_INT("main", ettrivia_interrupt | |
| 234 | 234 | |
| 235 | 235 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 236 | 236 |
| r1877 | r1878 | |
|---|---|---|
| 69 | 69 | static WRITE16_HANDLER( splash_sh_irqtrigger_w ) |
| 70 | 70 | { |
| 71 | 71 | if (ACCESSING_LSB){ |
| 72 | soundlatch_w(0,data & 0xff); | |
| 73 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 72 | soundlatch_w(machine,0,data & 0xff); | |
| 73 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | static WRITE16_HANDLER( roldf_sh_irqtrigger_w ) |
| 78 | 78 | { |
| 79 | 79 | if (ACCESSING_LSB){ |
| 80 | soundlatch_w(0,data & 0xff); | |
| 81 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 80 | soundlatch_w(machine,0,data & 0xff); | |
| 81 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | // give the z80 time to see it |
| r1877 | r1878 | |
| 435 | 435 | /* basic machine hardware */ |
| 436 | 436 | MDRV_CPU_ADD(M68000,24000000/2) /* 12 MHz (24/2) */ |
| 437 | 437 | MDRV_CPU_PROGRAM_MAP(splash_readmem,splash_writemem) |
| 438 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 438 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 439 | 439 | |
| 440 | 440 | MDRV_CPU_ADD(Z80,30000000/8) |
| 441 | 441 | /* audio CPU */ |
| 442 | 442 | MDRV_CPU_PROGRAM_MAP(splash_readmem_sound,splash_writemem_sound) |
| 443 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,64) /* needed for the msm5205 to play the samples */ | |
| 443 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,64) /* needed for the msm5205 to play the samples */ | |
| 444 | 444 | |
| 445 | 445 | /* video hardware */ |
| 446 | 446 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 482 | 482 | /* basic machine hardware */ |
| 483 | 483 | MDRV_CPU_ADD(M68000,24000000/2) /* 12 MHz - verified */ |
| 484 | 484 | MDRV_CPU_PROGRAM_MAP(roldfrog_readmem,roldfrog_writemem) |
| 485 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 485 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 486 | 486 | |
| 487 | 487 | MDRV_CPU_ADD(Z80,3000000) /* 3 MHz - verified */ |
| 488 | 488 | /* audio CPU */ |
| 489 | 489 | MDRV_CPU_PROGRAM_MAP(roldf_sound_map,0) |
| 490 | 490 | MDRV_CPU_IO_MAP(roldf_sound_io_map,0) |
| 491 | // MDRV_CPU_VBLANK_INT(nmi_line_pulse,64) /* needed for the msm5205 to play the samples */ | |
| 491 | // MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,64) /* needed for the msm5205 to play the samples */ | |
| 492 | 492 | |
| 493 | 493 | /* video hardware */ |
| 494 | 494 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 521 | 521 | /* basic machine hardware */ |
| 522 | 522 | MDRV_CPU_ADD(M68000,24000000/2) /* 12 MHz (24/2) */ |
| 523 | 523 | MDRV_CPU_PROGRAM_MAP(funystrp_readmem,funystrp_writemem) |
| 524 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 524 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 525 | 525 | |
| 526 | 526 | // MDRV_CPU_ADD(Z80,30000000/8) |
| 527 | 527 | // /* audio CPU */ |
| 528 | 528 | // MDRV_CPU_PROGRAM_MAP(splash_readmem_sound,splash_writemem_sound) |
| 529 | // MDRV_CPU_VBLANK_INT(nmi_line_pulse,64) /* needed for the msm5205 to play the samples */ | |
| 529 | // MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,64) /* needed for the msm5205 to play the samples */ | |
| 530 | 530 | |
| 531 | 531 | /* video hardware */ |
| 532 | 532 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | #define MCU_READ(_number_,_bit_,_offset_,_retval_)\ |
| 198 | if((0xffff - input | |
| 198 | if((0xffff - readinput | |
| 199 | 199 | |
| 200 | 200 | /*RAM-based protection handlings*/ |
| 201 | 201 | static void daireika_mcu_run(running_machine *machine) |
| 202 | 202 | { |
| 203 | 203 | static UINT16 prg_prot; |
| 204 | 204 | |
| 205 | if((0xffff - input_port_0_word_r(0,0)) & 0x0008)//service_mode | |
| 205 | if((0xffff - input_port_0_word_r(machine,0,0)) & 0x0008)//service_mode | |
| 206 | 206 | { |
| 207 | jm_regs[0x000/2] = input_port_2_word_r(0,0); | |
| 208 | jm_regs[0x002/2] = input_port_3_word_r(0,0); | |
| 209 | jm_regs[0x004/2] = input_port_4_word_r(0,0); | |
| 210 | jm_regs[0x006/2] = input_port_5_word_r(0,0); | |
| 211 | jm_regs[0x008/2] = input_port_6_word_r(0,0); | |
| 212 | jm_regs[0x00a/2] = input_port_7_word_r(0,0); | |
| 207 | jm_regs[0x000/2] = input_port_2_word_r(machine,0,0); | |
| 208 | jm_regs[0x002/2] = input_port_3_word_r(machine,0,0); | |
| 209 | jm_regs[0x004/2] = input_port_4_word_r(machine,0,0); | |
| 210 | jm_regs[0x006/2] = input_port_5_word_r(machine,0,0); | |
| 211 | jm_regs[0x008/2] = input_port_6_word_r(machine,0,0); | |
| 212 | jm_regs[0x00a/2] = input_port_7_word_r(machine,0,0); | |
| 213 | 213 | } |
| 214 | 214 | else |
| 215 | 215 | { |
| r1877 | r1878 | |
| 247 | 247 | { |
| 248 | 248 | static UINT16 prg_prot; |
| 249 | 249 | |
| 250 | if((0xffff - input_port_0_word_r(0,0)) & 0x0008)//service_mode | |
| 250 | if((0xffff - input_port_0_word_r(machine,0,0)) & 0x0008)//service_mode | |
| 251 | 251 | { |
| 252 | jm_regs[0x300/2] = input_port_2_word_r(0,0); | |
| 253 | jm_regs[0x302/2] = input_port_3_word_r(0,0); | |
| 254 | jm_regs[0x304/2] = input_port_4_word_r(0,0); | |
| 255 | jm_regs[0x306/2] = input_port_5_word_r(0,0); | |
| 256 | jm_regs[0x308/2] = input_port_6_word_r(0,0); | |
| 257 | jm_regs[0x30a/2] = input_port_7_word_r(0,0); | |
| 252 | jm_regs[0x300/2] = input_port_2_word_r(machine,0,0); | |
| 253 | jm_regs[0x302/2] = input_port_3_word_r(machine,0,0); | |
| 254 | jm_regs[0x304/2] = input_port_4_word_r(machine,0,0); | |
| 255 | jm_regs[0x306/2] = input_port_5_word_r(machine,0,0); | |
| 256 | jm_regs[0x308/2] = input_port_6_word_r(machine,0,0); | |
| 257 | jm_regs[0x30a/2] = input_port_7_word_r(machine,0,0); | |
| 258 | 258 | } |
| 259 | 259 | else |
| 260 | 260 | { |
| r1877 | r1878 | |
| 289 | 289 | |
| 290 | 290 | static void second_mcu_run(running_machine *machine) |
| 291 | 291 | { |
| 292 | if((0xffff - input_port_1_word_r(0,0)) & 0x0004)//service_mode | |
| 292 | if((0xffff - input_port_1_word_r(machine,0,0)) & 0x0004)//service_mode | |
| 293 | 293 | { |
| 294 | jm_regs[0x200/2] = input_port_2_word_r(0,0); | |
| 295 | jm_regs[0x202/2] = input_port_3_word_r(0,0); | |
| 296 | jm_regs[0x204/2] = input_port_4_word_r(0,0); | |
| 294 | jm_regs[0x200/2] = input_port_2_word_r(machine,0,0); | |
| 295 | jm_regs[0x202/2] = input_port_3_word_r(machine,0,0); | |
| 296 | jm_regs[0x204/2] = input_port_4_word_r(machine,0,0); | |
| 297 | 297 | } |
| 298 | 298 | else |
| 299 | 299 | { |
| r1877 | r1878 | |
| 1002 | 1002 | static MACHINE_DRIVER_START( jalmah ) |
| 1003 | 1003 | MDRV_CPU_ADD_TAG("main" , M68000, 8000000) /* 68000-8 */ |
| 1004 | 1004 | MDRV_CPU_PROGRAM_MAP(jalmah,0) |
| 1005 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 1005 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 1006 | 1006 | |
| 1007 | 1007 | MDRV_GFXDECODE(jalmah) |
| 1008 | 1008 |
| r1877 | r1878 | |
|---|---|---|
| 72 | 72 | if (ACCESSING_LSB) |
| 73 | 73 | { |
| 74 | 74 | pending_command = 1; |
| 75 | soundlatch_w(offset,data & 0xff); | |
| 76 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 75 | soundlatch_w(machine,offset,data & 0xff); | |
| 76 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | |
| r1877 | r1878 | |
| 568 | 568 | /* basic machine hardware */ |
| 569 | 569 | MDRV_CPU_ADD_TAG("main",M68000,XTAL_20MHz/2) /* verified on pcb */ |
| 570 | 570 | MDRV_CPU_PROGRAM_MAP(f1gp_readmem1,f1gp_writemem1) |
| 571 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 571 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 572 | 572 | |
| 573 | 573 | MDRV_CPU_ADD(M68000,XTAL_20MHz/2) /* verified on pcb */ |
| 574 | 574 | MDRV_CPU_PROGRAM_MAP(readmem2,writemem2) |
| 575 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 575 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 576 | 576 | |
| 577 | 577 | MDRV_CPU_ADD(Z80,XTAL_20MHz/4) /* verified on pcb */ |
| 578 | 578 | /* audio CPU */ |
| r1877 | r1878 | |
| 611 | 611 | /* basic machine hardware */ |
| 612 | 612 | MDRV_CPU_ADD_TAG("main",M68000,10000000) /* 10 MHz ??? */ |
| 613 | 613 | MDRV_CPU_PROGRAM_MAP(f1gpb_cpu1_map,0) |
| 614 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 614 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 615 | 615 | |
| 616 | 616 | MDRV_CPU_ADD(M68000,10000000) /* 10 MHz ??? */ |
| 617 | 617 | MDRV_CPU_PROGRAM_MAP(f1gpb_cpu2_map,0) |
| 618 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 618 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 619 | 619 | |
| 620 | 620 | /* NO sound CPU */ |
| 621 | 621 | MDRV_INTERLEAVE(100) /* 100 CPU slices per frame */ |
| r1877 | r1878 | |
|---|---|---|
| 264 | 264 | static MACHINE_DRIVER_START( supdrapo ) |
| 265 | 265 | MDRV_CPU_ADD(Z80,8000000/2) /* ??? */ |
| 266 | 266 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 267 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 267 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 268 | 268 | |
| 269 | 269 | /* video hardware */ |
| 270 | 270 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 469 | 469 | |
| 470 | 470 | MDRV_CPU_PROGRAM_MAP(lvcards_map, 0) |
| 471 | 471 | MDRV_CPU_IO_MAP(lvcards_io_map, 0) |
| 472 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 472 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 473 | 473 | |
| 474 | 474 | // video hardware |
| 475 | 475 |
| r1877 | r1878 | |
|---|---|---|
| 447 | 447 | ***************************************************************************/ |
| 448 | 448 | |
| 449 | 449 | #include "driver.h" |
| 450 | #include "deprecat.h" | |
| 450 | 451 | #include "namcos2.h" |
| 451 | 452 | #include "cpu/m6809/m6809.h" |
| 452 | 453 | #include "namcoic.h" |
| r1877 | r1878 | |
| 1571 | 1572 | static MACHINE_DRIVER_START( default ) |
| 1572 | 1573 | MDRV_CPU_ADD(M68000, 12288000) |
| 1573 | 1574 | MDRV_CPU_PROGRAM_MAP(master_default_am,common_default_am) |
| 1574 | MDRV_CPU_VBLANK_INT(namcos2_68k_master_vblank | |
| 1575 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_master_vblank | |
| 1575 | 1576 | |
| 1576 | 1577 | MDRV_CPU_ADD(M68000, 12288000) |
| 1577 | 1578 | MDRV_CPU_PROGRAM_MAP(slave_default_am,common_default_am) |
| 1578 | MDRV_CPU_VBLANK_INT(namcos2_68k_slave_vblank | |
| 1579 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_slave_vblank | |
| 1579 | 1580 | |
| 1580 | 1581 | MDRV_CPU_ADD(M6809,3072000) // Sound handling |
| 1581 | 1582 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| 1582 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 1583 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 1583 | 1584 | MDRV_CPU_PERIODIC_INT(irq1_line_hold, 120) |
| 1584 | 1585 | |
| 1585 | 1586 | MDRV_CPU_ADD(HD63705,2048000) // I/O handling |
| 1586 | 1587 | MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu) |
| 1587 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1588 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1588 | 1589 | |
| 1589 | 1590 | MDRV_INTERLEAVE(100) /* CPU slices per frame */ |
| 1590 | 1591 | |
| r1877 | r1878 | |
| 1645 | 1646 | static MACHINE_DRIVER_START( gollygho ) |
| 1646 | 1647 | MDRV_CPU_ADD(M68000, 12288000) |
| 1647 | 1648 | MDRV_CPU_PROGRAM_MAP(master_default_am,common_default_am) |
| 1648 | MDRV_CPU_VBLANK_INT(namcos2_68k_master_vblank | |
| 1649 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_master_vblank | |
| 1649 | 1650 | |
| 1650 | 1651 | MDRV_CPU_ADD(M68000, 12288000) |
| 1651 | 1652 | MDRV_CPU_PROGRAM_MAP(slave_default_am,common_default_am) |
| 1652 | MDRV_CPU_VBLANK_INT(namcos2_68k_slave_vblank | |
| 1653 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_slave_vblank | |
| 1653 | 1654 | |
| 1654 | 1655 | MDRV_CPU_ADD(M6809,3072000) // Sound handling |
| 1655 | 1656 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| 1656 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 1657 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 1657 | 1658 | MDRV_CPU_PERIODIC_INT(irq1_line_hold, 120) |
| 1658 | 1659 | |
| 1659 | 1660 | MDRV_CPU_ADD(HD63705,2048000) // I/O handling |
| 1660 | 1661 | MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu) |
| 1661 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1662 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1662 | 1663 | |
| 1663 | 1664 | MDRV_INTERLEAVE(100) /* CPU slices per frame */ |
| 1664 | 1665 | |
| r1877 | r1878 | |
| 1695 | 1696 | static MACHINE_DRIVER_START( finallap ) |
| 1696 | 1697 | MDRV_CPU_ADD(M68000, 12288000) |
| 1697 | 1698 | MDRV_CPU_PROGRAM_MAP(master_finallap_am,common_finallap_am) |
| 1698 | MDRV_CPU_VBLANK_INT(namcos2_68k_master_vblank | |
| 1699 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_master_vblank | |
| 1699 | 1700 | |
| 1700 | 1701 | MDRV_CPU_ADD(M68000, 12288000) |
| 1701 | 1702 | MDRV_CPU_PROGRAM_MAP(slave_finallap_am,common_finallap_am) |
| 1702 | MDRV_CPU_VBLANK_INT(namcos2_68k_slave_vblank | |
| 1703 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_slave_vblank | |
| 1703 | 1704 | |
| 1704 | 1705 | MDRV_CPU_ADD(M6809,3072000) // Sound handling |
| 1705 | 1706 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| 1706 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 1707 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 1707 | 1708 | MDRV_CPU_PERIODIC_INT(irq1_line_hold, 120) |
| 1708 | 1709 | |
| 1709 | 1710 | MDRV_CPU_ADD(HD63705,2048000) // I/O handling |
| 1710 | 1711 | MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu) |
| 1711 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1712 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1712 | 1713 | |
| 1713 | 1714 | MDRV_INTERLEAVE(100) /* CPU slices per frame */ |
| 1714 | 1715 | |
| r1877 | r1878 | |
| 1745 | 1746 | static MACHINE_DRIVER_START( sgunner ) |
| 1746 | 1747 | MDRV_CPU_ADD(M68000, 12288000) |
| 1747 | 1748 | MDRV_CPU_PROGRAM_MAP(master_sgunner_am,common_sgunner_am) |
| 1748 | MDRV_CPU_VBLANK_INT(namcos2_68k_master_vblank | |
| 1749 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_master_vblank | |
| 1749 | 1750 | |
| 1750 | 1751 | MDRV_CPU_ADD(M68000, 12288000) |
| 1751 | 1752 | MDRV_CPU_PROGRAM_MAP(slave_sgunner_am,common_sgunner_am) |
| 1752 | MDRV_CPU_VBLANK_INT(namcos2_68k_slave_vblank | |
| 1753 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_slave_vblank | |
| 1753 | 1754 | |
| 1754 | 1755 | MDRV_CPU_ADD(M6809,3072000) // Sound handling |
| 1755 | 1756 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| 1756 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 1757 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 1757 | 1758 | MDRV_CPU_PERIODIC_INT(irq1_line_hold, 120) |
| 1758 | 1759 | |
| 1759 | 1760 | MDRV_CPU_ADD(HD63705,2048000) // I/O handling |
| 1760 | 1761 | MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu) |
| 1761 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1762 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1762 | 1763 | |
| 1763 | 1764 | MDRV_INTERLEAVE(100) /* CPU slices per frame */ |
| 1764 | 1765 | |
| r1877 | r1878 | |
| 1795 | 1796 | static MACHINE_DRIVER_START( luckywld ) |
| 1796 | 1797 | MDRV_CPU_ADD(M68000, 12288000) |
| 1797 | 1798 | MDRV_CPU_PROGRAM_MAP(master_luckywld_am,common_luckywld_am) |
| 1798 | MDRV_CPU_VBLANK_INT(namcos2_68k_master_vblank | |
| 1799 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_master_vblank | |
| 1799 | 1800 | |
| 1800 | 1801 | MDRV_CPU_ADD(M68000, 12288000) |
| 1801 | 1802 | MDRV_CPU_PROGRAM_MAP(slave_luckywld_am,common_luckywld_am) |
| 1802 | MDRV_CPU_VBLANK_INT(namcos2_68k_slave_vblank | |
| 1803 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_slave_vblank | |
| 1803 | 1804 | |
| 1804 | 1805 | MDRV_CPU_ADD(M6809,3072000) /* Sound handling */ |
| 1805 | 1806 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| 1806 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 1807 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 1807 | 1808 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,120) |
| 1808 | 1809 | |
| 1809 | 1810 | MDRV_CPU_ADD(HD63705,2048000) /* I/O handling */ |
| 1810 | 1811 | MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu) |
| 1811 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1812 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1812 | 1813 | |
| 1813 | 1814 | MDRV_INTERLEAVE(100) /* CPU slices per frame */ |
| 1814 | 1815 | |
| r1877 | r1878 | |
| 1845 | 1846 | static MACHINE_DRIVER_START( metlhawk ) |
| 1846 | 1847 | MDRV_CPU_ADD(M68000, 12288000) |
| 1847 | 1848 | MDRV_CPU_PROGRAM_MAP(master_metlhawk_am,common_metlhawk_am) |
| 1848 | MDRV_CPU_VBLANK_INT(namcos2_68k_master_vblank | |
| 1849 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_master_vblank | |
| 1849 | 1850 | |
| 1850 | 1851 | MDRV_CPU_ADD(M68000, 12288000) |
| 1851 | 1852 | MDRV_CPU_PROGRAM_MAP(slave_metlhawk_am,common_metlhawk_am) |
| 1852 | MDRV_CPU_VBLANK_INT(namcos2_68k_slave_vblank | |
| 1853 | MDRV_CPU_VBLANK_INT("main", namcos2_68k_slave_vblank | |
| 1853 | 1854 | |
| 1854 | 1855 | MDRV_CPU_ADD(M6809,3072000) /* Sound handling */ |
| 1855 | 1856 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| 1856 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 1857 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 1857 | 1858 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,120) |
| 1858 | 1859 | |
| 1859 | 1860 | MDRV_CPU_ADD(HD63705,2048000) /* I/O handling */ |
| 1860 | 1861 | MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu) |
| 1861 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1862 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1862 | 1863 | |
| 1863 | 1864 | MDRV_INTERLEAVE(100) /* CPU slices per frame */ |
| 1864 | 1865 |
| r1877 | r1878 | |
|---|---|---|
| 68 | 68 | ***************************************************************************/ |
| 69 | 69 | |
| 70 | 70 | #include "driver.h" |
| 71 | #include "deprecat.h" | |
| 71 | 72 | #include "sound/dac.h" |
| 72 | 73 | #include "sound/sn76477.h" |
| 73 | 74 | #include "sound/ay8910.h" |
| r1877 | r1878 | |
| 609 | 610 | MDRV_CPU_ADD_TAG("cpu1", Z80, 2500000) /* 10MHz / 4 = 2.5MHz */ |
| 610 | 611 | MDRV_CPU_PROGRAM_MAP(route16_cpu1_map,0) |
| 611 | 612 | MDRV_CPU_IO_MAP(cpu1_io_map,0) |
| 612 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 613 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 613 | 614 | |
| 614 | 615 | MDRV_CPU_ADD_TAG("cpu2", Z80, 2500000) /* 10MHz / 4 = 2.5MHz */ |
| 615 | 616 | MDRV_CPU_PROGRAM_MAP(route16_cpu2_map,0) |
| r1877 | r1878 | |
| 681 | 682 | /* basic machine hardware */ |
| 682 | 683 | MDRV_IMPORT_FROM(speakres) |
| 683 | 684 | MDRV_CPU_MODIFY("cpu2") |
| 684 | MDRV_CPU_VBLANK_INT(irq0_line_hold,48) | |
| 685 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,48) | |
| 685 | 686 | MACHINE_DRIVER_END |
| 686 | 687 | |
| 687 | 688 |
| r1877 | r1878 | |
|---|---|---|
| 537 | 537 | static MACHINE_DRIVER_START( deroon ) |
| 538 | 538 | MDRV_CPU_ADD(M68000, 16000000/8) /* the /8 divider is here only for OPL3 testing */ |
| 539 | 539 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 540 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 540 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 541 | 541 | |
| 542 | 542 | MDRV_CPU_ADD(Z80, 16000000/2 ) /* 8 MHz ??? */ |
| 543 | 543 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 294 | 294 | MDRV_CPU_PROGRAM_MAP(polyplay_map,0) |
| 295 | 295 | MDRV_CPU_IO_MAP(polyplay_io_map,0) |
| 296 | 296 | MDRV_CPU_PERIODIC_INT(periodic_interrupt,75) |
| 297 | MDRV_CPU_VBLANK_INT(coin_interrupt | |
| 297 | MDRV_CPU_VBLANK_INT("main", coin_interrupt | |
| 298 | 298 | |
| 299 | 299 | MDRV_MACHINE_RESET(polyplay) |
| 300 | 300 |
| r1877 | r1878 | |
|---|---|---|
| 328 | 328 | /* basic machine hardware */ |
| 329 | 329 | MDRV_CPU_ADD(Z80, 6000000) /* 6 MHz ??? */ |
| 330 | 330 | MDRV_CPU_PROGRAM_MAP(cpua_readmem,cpua_writemem) |
| 331 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 331 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 332 | 332 | |
| 333 | 333 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz ??? */ |
| 334 | 334 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 335 | 335 | |
| 336 | 336 | MDRV_CPU_ADD(Z80, 6000000) /* 6 MHz ??? */ |
| 337 | 337 | MDRV_CPU_PROGRAM_MAP(cpub_readmem,cpub_writemem) |
| 338 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 338 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 339 | 339 | |
| 340 | 340 | MDRV_CPU_ADD(Z80, 6000000) /* 6 MHz ??? */ |
| 341 | 341 | MDRV_CPU_PROGRAM_MAP(cpuc_readmem,cpuc_writemem) |
| 342 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 342 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 343 | 343 | |
| 344 | 344 | MDRV_INTERLEAVE(10) /* 10 CPU slices per frame - enough for the sound CPU to read all commands */ |
| 345 | 345 |
| r1877 | r1878 | |
|---|---|---|
| 219 | 219 | #include "exidy440.h" |
| 220 | 220 | |
| 221 | 221 | |
| 222 | /* globals */ | |
| 223 | UINT8 exidy440_topsecret; | |
| 222 | /* constants */ | |
| 223 | #define MAIN_CPU_CLOCK (EXIDY440_MASTER_CLOCK / 8) | |
| 224 | 224 | |
| 225 | 225 | |
| 226 | 226 | /* local variables */ |
| 227 | 227 | static UINT8 exidy440_bank; |
| 228 | static UINT8 port_0_xor; | |
| 229 | static UINT8 port_2_xor; | |
| 230 | static UINT8 port_3_xor; | |
| 231 | static UINT8 mirror_vblank_bit; | |
| 232 | static UINT8 mirror_trigger_bit; | |
| 233 | static UINT8 copy_protection_read; | |
| 234 | static UINT8 last_coins; | |
| 235 | 228 | |
| 236 | 229 | static const UINT8 *showdown_bank_data[2]; |
| 237 | 230 | static INT8 showdown_bank_select; |
| r1877 | r1878 | |
| 264 | 257 | |
| 265 | 258 | /************************************* |
| 266 | 259 | * |
| 267 | * | |
| 260 | * Coin | |
| 268 | 261 | * |
| 269 | 262 | *************************************/ |
| 270 | 263 | |
| 271 | static | |
| 264 | static INPUT | |
| 272 | 265 | { |
| 273 | int coins; | |
| 274 | ||
| 275 | 266 | /* if we got a coin, set the IRQ on the main CPU */ |
| 276 | coins = readinputport(3) & 3; | |
| 277 | if (((coins ^ last_coins) & 0x01) && (coins & 0x01) == 0) | |
| 267 | if (newval == 0) | |
| 278 | 268 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); |
| 279 | if (((coins ^ last_coins) & 0x02) && (coins & 0x02) == 0) | |
| 280 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 281 | last_coins = coins; | |
| 282 | 269 | } |
| 283 | 270 | |
| 284 | 271 | |
| 285 | static INTERRUPT_GEN( main_interrupt ) | |
| 286 | { | |
| 287 | /* generate coin interrupts */ | |
| 288 | handle_coins(machine); | |
| 289 | exidy440_vblank_interrupt(machine, cpunum); | |
| 290 | } | |
| 291 | 272 | |
| 292 | ||
| 293 | static MACHINE_RESET( exidy440 ) | |
| 294 | { | |
| 295 | exidy440_bank = 0xff; | |
| 296 | exidy440_bank_select(0); | |
| 297 | last_coins = input_port_3_r(0) & 3; | |
| 298 | } | |
| 299 | ||
| 300 | ||
| 301 | ||
| 302 | 273 | /************************************* |
| 303 | 274 | * |
| 304 | * Primary input port | |
| 275 | * Primary input port special bits | |
| 305 | 276 | * |
| 306 | 277 | *************************************/ |
| 307 | 278 | |
| 308 | static | |
| 279 | static CUSTOM_I | |
| 309 | 280 | { |
| 310 | int result = input_port_0_r(offset); | |
| 281 | return exidy440_firq_beam; | |
| 282 | } | |
| 311 | 283 | |
| 312 | /* the FIRQ cause is reflected in the upper 2 bits */ | |
| 313 | if (exidy440_firq_vblank) result ^= 0x80; | |
| 314 | if (exidy440_firq_beam) result ^= 0x40; | |
| 315 | 284 | |
| 316 | /* Whodunit needs the VBLANK bit mirrored to bit 0 */ | |
| 317 | if (mirror_vblank_bit && exidy440_firq_vblank) result ^= 0x01; | |
| 285 | static CUSTOM_INPUT( firq_vblank_r ) | |
| 286 | { | |
| 287 | return exidy440_firq_vblank; | |
| 288 | } | |
| 318 | 289 | |
| 319 | /* Hit'N Miss needs the trigger bit mirrored to bit 0 */ | |
| 320 | if (mirror_trigger_bit) result = (result & 0xfe) | ((result >> 1) & 1); | |
| 321 | 290 | |
| 322 | /* return with the appropriate XOR */ | |
| 323 | return result ^ port_0_xor; | |
| 291 | static CUSTOM_INPUT( hitnmiss_button1_r ) | |
| 292 | { | |
| 293 | /* button 1 shows up in two bits */ | |
| 294 | UINT32 button1 = readinputportbytag("HITNMISS_BUTTON1"); | |
| 295 | return (button1 << 1) | button1; | |
| 324 | 296 | } |
| 325 | 297 | |
| 326 | 298 | |
| r1877 | r1878 | |
| 368 | 340 | * |
| 369 | 341 | *************************************/ |
| 370 | 342 | |
| 371 | static READ8_HANDLER( io_r ) | |
| 343 | static READ8_HANDLER( exidy440_input_port_3_r ) | |
| 372 | 344 | { |
| 373 | int result = 0xff; | |
| 345 | /* I/O1 accesses clear the CIRQ flip/flop */ | |
| 346 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 347 | return readinputport(3); | |
| 348 | } | |
| 374 | 349 | |
| 375 | switch (offset & 0xe0) | |
| 376 | { | |
| 377 | case 0x00: /* sound command */ | |
| 378 | result = exidy440_sound_command; | |
| 379 | break; | |
| 380 | 350 | |
| 381 | case 0x20: /* coin bits I/O1 */ | |
| 382 | result = readinputport(3) ^ port_3_xor; | |
| 383 | ||
| 384 | /* I/O1 accesses clear the CIRQ flip/flop */ | |
| 385 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 386 | break; | |
| 387 | ||
| 388 | case 0x40: /* clear coin counters I/O2 */ | |
| 389 | break; | |
| 390 | ||
| 391 | case 0x60: /* dip switches (8) */ | |
| 392 | result = input_port_1_r(offset); | |
| 393 | break; | |
| 394 | ||
| 395 | case 0x80: /* player control bits */ | |
| 396 | result = input_port_2_r(offset) ^ port_2_xor; | |
| 397 | break; | |
| 398 | ||
| 399 | case 0xa0: /* coin bits I/O5 */ | |
| 400 | /* sound command acknowledgements come on bit 3 here */ | |
| 401 | if (exidy440_sound_command_ack) | |
| 402 | result ^= 0x08; | |
| 403 | break; | |
| 404 | ||
| 405 | case 0xc0: | |
| 406 | /* for Clay Pigeon and Top Secret */ | |
| 407 | if (offset < 0xc4) | |
| 408 | return copy_protection_read; | |
| 409 | ||
| 410 | /* for Top Secret only */ | |
| 411 | if (offset == 0xc5) | |
| 412 | return (input_port_5_r(offset) & 1) ? 0x01 : 0x02; | |
| 413 | else if (offset == 0xc6) | |
| 414 | return input_port_4_r(offset); | |
| 415 | else if (offset == 0xc7) | |
| 416 | return input_port_6_r(offset); | |
| 417 | else | |
| 418 | return 0; | |
| 419 | } | |
| 420 | ||
| 421 | return result; | |
| 351 | static READ8_HANDLER( sound_command_ack_r ) | |
| 352 | { | |
| 353 | /* sound command acknowledgements come on bit 3 here */ | |
| 354 | return exidy440_sound_command_ack ? 0xf7 : 0xff; | |
| 422 | 355 | } |
| 423 | 356 | |
| 424 | 357 | |
| r1877 | r1878 | |
| 431 | 364 | |
| 432 | 365 | static TIMER_CALLBACK( delayed_sound_command_w ) |
| 433 | 366 | { |
| 434 | exidy440_sound_command = param; | |
| 367 | *exidy440_sound_command = param; | |
| 435 | 368 | exidy440_sound_command_ack = 0; |
| 436 | 369 | |
| 437 | 370 | /* cause an FIRQ on the sound CPU */ |
| r1877 | r1878 | |
| 439 | 372 | } |
| 440 | 373 | |
| 441 | 374 | |
| 442 | static WRITE8_HANDLER( | |
| 375 | static WRITE8_HANDLER( sound_command_w ) | |
| 443 | 376 | { |
| 444 | logerror("W I/O1[%02X]=%02X\n", offset, data); | |
| 377 | timer_call_after_resynch(NULL, data, delayed_sound_command_w); | |
| 378 | } | |
| 445 | 379 | |
| 446 | /* switch off the upper 4 bits of the offset */ | |
| 447 | switch (offset & 0xe0) | |
| 448 | { | |
| 449 | case 0x00: /* sound command */ | |
| 450 | timer_call_after_resynch(NULL, data, delayed_sound_command_w); | |
| 451 | break; | |
| 452 | 380 | |
| 453 | case 0x20: /* coin bits I/O1 */ | |
| 381 | static WRITE8_HANDLER( exidy440_input_port_3_w ) | |
| 382 | { | |
| 383 | /* I/O1 accesses clear the CIRQ flip/flop */ | |
| 384 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 385 | } | |
| 454 | 386 | |
| 455 | /* accesses here clear the CIRQ flip/flop */ | |
| 456 | cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE); | |
| 457 | break; | |
| 458 | 387 | |
| 459 | case 0x40: /* coin counter I/O2 */ | |
| 460 | coin_counter_w(0, data & 1); | |
| 461 | break; | |
| 462 | ||
| 463 | case 0x60: /* dip switches (8) */ | |
| 464 | break; | |
| 465 | ||
| 466 | case 0x80: /* player control bits */ | |
| 467 | break; | |
| 468 | ||
| 469 | case 0xa0: /* coin bits I/O3 */ | |
| 470 | break; | |
| 471 | ||
| 472 | case 0xc0: | |
| 473 | /* for Top Secret only */ | |
| 474 | if (offset == 0xc1) | |
| 475 | topsecex_yscroll = data; | |
| 476 | break; | |
| 477 | } | |
| 388 | static WRITE8_HANDLER( exidy440_coin_counter_w ) | |
| 389 | { | |
| 390 | coin_counter_w(0, data & 1); | |
| 478 | 391 | } |
| 479 | 392 | |
| 480 | 393 | |
| r1877 | r1878 | |
| 514 | 427 | } |
| 515 | 428 | |
| 516 | 429 | |
| 430 | static READ8_HANDLER( claypign_protection_r ) | |
| 431 | { | |
| 432 | return 0x76; | |
| 433 | } | |
| 517 | 434 | |
| 435 | ||
| 436 | static READ8_HANDLER( topsecex_input_port_5_r ) | |
| 437 | { | |
| 438 | return (input_port_5_r(machine, offset) & 1) ? 0x01 : 0x02; | |
| 439 | } | |
| 440 | ||
| 441 | ||
| 442 | static WRITE8_HANDLER( topsecex_yscroll_w ) | |
| 443 | { | |
| 444 | *topsecex_yscroll = data; | |
| 445 | } | |
| 446 | ||
| 447 | ||
| 448 | ||
| 518 | 449 | /************************************* |
| 519 | 450 | * |
| 451 | * Reset | |
| 452 | * | |
| 453 | *************************************/ | |
| 454 | ||
| 455 | static MACHINE_RESET( exidy440 ) | |
| 456 | { | |
| 457 | exidy440_bank = 0xff; | |
| 458 | exidy440_bank_select(0); | |
| 459 | } | |
| 460 | ||
| 461 | ||
| 462 | ||
| 463 | /************************************* | |
| 464 | * | |
| 520 | 465 | * Main CPU memory handlers |
| 521 | 466 | * |
| 522 | 467 | *************************************/ |
| r1877 | r1878 | |
| 529 | 474 | AM_RANGE(0x2b00, 0x2b00) AM_READ(exidy440_vertical_pos_r) |
| 530 | 475 | AM_RANGE(0x2b01, 0x2b01) AM_READWRITE(exidy440_horizontal_pos_r, exidy440_interrupt_clear_w) |
| 531 | 476 | AM_RANGE(0x2b02, 0x2b02) AM_RAM AM_BASE(&exidy440_scanline) |
| 532 | AM_RANGE(0x2b03, 0x2b03) AM_READWRITE(input_r, exidy440_control_w) | |
| 477 | AM_RANGE(0x2b03, 0x2b03) AM_READWRITE(input_port_0_r, exidy440_control_w) | |
| 533 | 478 | AM_RANGE(0x2c00, 0x2dff) AM_READWRITE(exidy440_paletteram_r, exidy440_paletteram_w) |
| 534 | AM_RANGE(0x2e00, 0x2eff) AM_READWRITE(io_r, io_w) | |
| 479 | AM_RANGE(0x2e00, 0x2e1f) AM_READWRITE(MRA8_RAM, sound_command_w) AM_BASE(&exidy440_sound_command) | |
| 480 | AM_RANGE(0x2e20, 0x2e3f) AM_READWRITE(exidy440_input_port_3_r, exidy440_input_port_3_w) | |
| 481 | AM_RANGE(0x2e40, 0x2e5f) AM_READWRITE(MRA8_NOP, exidy440_coin_counter_w) /* read: clear coin counters I/O2 */ | |
| 482 | AM_RANGE(0x2e60, 0x2e7f) AM_READWRITE(input_port_1_r, MWA8_NOP) | |
| 483 | AM_RANGE(0x2e80, 0x2e9f) AM_READWRITE(input_port_2_r, MWA8_NOP) | |
| 484 | AM_RANGE(0x2ea0, 0x2ebf) AM_READWRITE(sound_command_ack_r, MWA8_NOP) | |
| 485 | AM_RANGE(0x2ec0, 0x2eff) AM_NOP | |
| 535 | 486 | AM_RANGE(0x3000, 0x3fff) AM_RAM |
| 536 | 487 | AM_RANGE(0x4000, 0x7fff) AM_READWRITE(MRA8_BANK1, bankram_w) |
| 537 | 488 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| r1877 | r1878 | |
| 579 | 530 | PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) |
| 580 | 531 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) |
| 581 | 532 | PORT_DIPSETTING( 0x10, DEF_STR( Hardest ) ) |
| 582 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 533 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(firq_beam_r, 0) | |
| 534 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(firq_vblank_r, 0) | |
| 583 | 535 | |
| 584 | 536 | PORT_START /* audio board dips */ |
| 585 | 537 | COINAGE |
| r1877 | r1878 | |
| 593 | 545 | PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 594 | 546 | |
| 595 | 547 | PORT_START /* coin counters */ |
| 596 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 597 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 548 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 549 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 598 | 550 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 599 | 551 | |
| 600 | 552 | PORT_START /* fake analog X */ |
| r1877 | r1878 | |
| 607 | 559 | |
| 608 | 560 | static INPUT_PORTS_START( cheyenne ) |
| 609 | 561 | PORT_START /* player inputs and logic board dips */ |
| 610 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 611 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 612 | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) | |
| 613 | PORT_DIPSETTING( 0x08, "2" ) | |
| 614 | PORT_DIPSETTING( 0x0c, "3" ) | |
| 615 | PORT_DIPSETTING( 0x04, "4" ) | |
| 616 | PORT_DIPSETTING( 0x00, "5" ) | |
| 617 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) | |
| 618 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) | |
| 619 | PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) | |
| 620 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) | |
| 621 | PORT_DIPSETTING( 0x10, DEF_STR( Hardest ) ) | |
| 622 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 562 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 563 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) | |
| 564 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Lives ) ) | |
| 565 | PORT_DIPSETTING( 0x04, "2" ) | |
| 566 | PORT_DIPSETTING( 0x00, "3" ) | |
| 567 | PORT_DIPSETTING( 0x08, "4" ) | |
| 568 | PORT_DIPSETTING( 0x0c, "5" ) | |
| 569 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) ) | |
| 570 | PORT_DIPSETTING( 0x30, DEF_STR( Easy ) ) | |
| 571 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) | |
| 572 | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) | |
| 573 | PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) ) | |
| 574 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_beam_r, 0) | |
| 575 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_vblank_r, 0) | |
| 623 | 576 | |
| 624 | 577 | PORT_START /* audio board dips */ |
| 625 | 578 | COINAGE |
| r1877 | r1878 | |
| 633 | 586 | PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 634 | 587 | |
| 635 | 588 | PORT_START /* coin counters */ |
| 636 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 637 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 589 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 590 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 638 | 591 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 639 | 592 | |
| 640 | 593 | PORT_START /* fake analog X */ |
| r1877 | r1878 | |
| 647 | 600 | |
| 648 | 601 | static INPUT_PORTS_START( combat ) |
| 649 | 602 | PORT_START /* player inputs and logic board dips */ |
| 650 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 651 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 652 | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) | |
| 653 | PORT_DIPSETTING( 0x08, "2" ) | |
| 654 | PORT_DIPSETTING( 0x0c, "3" ) | |
| 655 | PORT_DIPSETTING( 0x04, "4" ) | |
| 656 | PORT_DIPSETTING( 0x00, "5" ) | |
| 657 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) | |
| 658 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) | |
| 659 | PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) | |
| 660 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) | |
| 661 | PORT_DIPSETTING( 0x10, DEF_STR( Hardest ) ) | |
| 662 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 603 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 604 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) | |
| 605 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Lives ) ) | |
| 606 | PORT_DIPSETTING( 0x04, "2" ) | |
| 607 | PORT_DIPSETTING( 0x00, "3" ) | |
| 608 | PORT_DIPSETTING( 0x08, "4" ) | |
| 609 | PORT_DIPSETTING( 0x0c, "5" ) | |
| 610 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) ) | |
| 611 | PORT_DIPSETTING( 0x30, DEF_STR( Easy ) ) | |
| 612 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) | |
| 613 | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) | |
| 614 | PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) ) | |
| 615 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_beam_r, 0) | |
| 616 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_vblank_r, 0) | |
| 663 | 617 | |
| 664 | 618 | PORT_START /* audio board dips */ |
| 665 | 619 | COINAGE |
| r1877 | r1878 | |
| 669 | 623 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 670 | 624 | |
| 671 | 625 | PORT_START /* start button */ |
| 672 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 673 | PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 626 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 627 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 674 | 628 | |
| 675 | 629 | PORT_START /* coin counters */ |
| 676 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 677 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 630 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 631 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 678 | 632 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 679 | 633 | |
| 680 | 634 | PORT_START /* fake analog X */ |
| r1877 | r1878 | |
| 687 | 641 | |
| 688 | 642 | static INPUT_PORTS_START( catch22 ) |
| 689 | 643 | PORT_START /* player inputs and logic board dips */ |
| 690 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 691 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 692 | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) | |
| 693 | PORT_DIPSETTING( 0x08, "4" ) | |
| 694 | PORT_DIPSETTING( 0x0c, "5" ) | |
| 695 | PORT_DIPSETTING( 0x04, "6" ) | |
| 696 | PORT_DIPSETTING( 0x00, "7" ) | |
| 697 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) | |
| 698 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) | |
| 699 | PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) | |
| 700 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) | |
| 701 | PORT_DIPSETTING( 0x10, DEF_STR( Hardest ) ) | |
| 702 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 644 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 645 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) | |
| 646 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Lives ) ) | |
| 647 | PORT_DIPSETTING( 0x04, "4" ) | |
| 648 | PORT_DIPSETTING( 0x00, "5" ) | |
| 649 | PORT_DIPSETTING( 0x08, "6" ) | |
| 650 | PORT_DIPSETTING( 0x0c, "7" ) | |
| 651 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) ) | |
| 652 | PORT_DIPSETTING( 0x30, DEF_STR( Easy ) ) | |
| 653 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) | |
| 654 | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) | |
| 655 | PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) ) | |
| 656 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_beam_r, 0) | |
| 657 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_vblank_r, 0) | |
| 703 | 658 | |
| 704 | 659 | PORT_START /* audio board dips */ |
| 705 | 660 | COINAGE |
| r1877 | r1878 | |
| 709 | 664 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 710 | 665 | |
| 711 | 666 | PORT_START /* start button */ |
| 712 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 713 | PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 667 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 668 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 714 | 669 | |
| 715 | 670 | PORT_START /* coin counters */ |
| 716 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 717 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 718 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 671 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 672 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 673 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 674 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 719 | 675 | |
| 720 | 676 | PORT_START /* fake analog X */ |
| 721 | 677 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) |
| r1877 | r1878 | |
| 727 | 683 | |
| 728 | 684 | static INPUT_PORTS_START( cracksht ) |
| 729 | 685 | PORT_START /* player inputs and logic board dips */ |
| 730 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 731 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 732 | PORT_DIPNAME( 0x0c, 0x0c, "Seconds" ) | |
| 733 | PORT_DIPSETTING( 0x08, "20" ) | |
| 734 | PORT_DIPSETTING( 0x0c, "30" ) | |
| 735 | PORT_DIPSETTING( 0x04, "40" ) | |
| 736 | PORT_DIPSETTING( 0x00, "50" ) | |
| 737 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) | |
| 738 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) | |
| 739 | PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) | |
| 740 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) | |
| 741 | PORT_DIPSETTING( 0x10, DEF_STR( Hardest ) ) | |
| 742 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 686 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 687 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) | |
| 688 | PORT_DIPNAME( 0x0c, 0x00, "Seconds" ) | |
| 689 | PORT_DIPSETTING( 0x04, "20" ) | |
| 690 | PORT_DIPSETTING( 0x00, "30" ) | |
| 691 | PORT_DIPSETTING( 0x08, "40" ) | |
| 692 | PORT_DIPSETTING( 0x0c, "50" ) | |
| 693 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) ) | |
| 694 | PORT_DIPSETTING( 0x30, DEF_STR( Easy ) ) | |
| 695 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) | |
| 696 | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) | |
| 697 | PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) ) | |
| 698 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_beam_r, 0) | |
| 699 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_vblank_r, 0) | |
| 743 | 700 | |
| 744 | 701 | PORT_START /* audio board dips */ |
| 745 | 702 | COINAGE |
| r1877 | r1878 | |
| 749 | 706 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 750 | 707 | |
| 751 | 708 | PORT_START /* start button */ |
| 752 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 753 | PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 709 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 710 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 754 | 711 | |
| 755 | 712 | PORT_START /* coin counters */ |
| 756 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 757 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 758 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 713 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 714 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 715 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 716 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 759 | 717 | |
| 760 | 718 | PORT_START /* fake analog X */ |
| 761 | 719 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) |
| r1877 | r1878 | |
| 767 | 725 | |
| 768 | 726 | static INPUT_PORTS_START( claypign ) |
| 769 | 727 | PORT_START /* player inputs and logic board dips */ |
| 770 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 771 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 772 | PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 773 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) | |
| 774 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) | |
| 775 | PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) | |
| 776 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) | |
| 777 | PORT_DIPSETTING( 0x10, DEF_STR( Hardest ) ) | |
| 778 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 728 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 729 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) | |
| 730 | PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 731 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) ) | |
| 732 | PORT_DIPSETTING( 0x30, DEF_STR( Easy ) ) | |
| 733 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) | |
| 734 | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) | |
| 735 | PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) ) | |
| 736 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_beam_r, 0) | |
| 737 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_vblank_r, 0) | |
| 779 | 738 | |
| 780 | 739 | PORT_START /* audio board dips */ |
| 781 | 740 | COINAGE |
| r1877 | r1878 | |
| 785 | 744 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 786 | 745 | |
| 787 | 746 | PORT_START /* start button */ |
| 788 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 789 | PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 747 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 748 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 790 | 749 | |
| 791 | 750 | PORT_START /* coin counters */ |
| 792 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 793 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 794 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 751 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 752 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 753 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 754 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 795 | 755 | |
| 796 | 756 | PORT_START /* fake analog X */ |
| 797 | 757 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) |
| r1877 | r1878 | |
| 803 | 763 | |
| 804 | 764 | static INPUT_PORTS_START( chiller ) |
| 805 | 765 | PORT_START /* player inputs and logic board dips */ |
| 806 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 807 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 808 | PORT_DIPNAME( 0x0c, 0x0c, "Seconds" ) | |
| 809 | PORT_DIPSETTING( 0x08, "30" ) | |
| 810 | PORT_DIPSETTING( 0x0c, "45" ) | |
| 811 | PORT_DIPSETTING( 0x04, "60" ) | |
| 812 | PORT_DIPSETTING( 0x00, "70" ) | |
| 813 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) | |
| 814 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) | |
| 815 | PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) | |
| 816 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) | |
| 817 | PORT_DIPSETTING( 0x10, DEF_STR( Hardest ) ) | |
| 818 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 766 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 767 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) | |
| 768 | PORT_DIPNAME( 0x0c, 0x00, "Seconds" ) | |
| 769 | PORT_DIPSETTING( 0x04, "30" ) | |
| 770 | PORT_DIPSETTING( 0x00, "45" ) | |
| 771 | PORT_DIPSETTING( 0x08, "60" ) | |
| 772 | PORT_DIPSETTING( 0x0c, "70" ) | |
| 773 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) ) | |
| 774 | PORT_DIPSETTING( 0x30, DEF_STR( Easy ) ) | |
| 775 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) | |
| 776 | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) | |
| 777 | PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) ) | |
| 778 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_beam_r, 0) | |
| 779 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_vblank_r, 0) | |
| 819 | 780 | |
| 820 | 781 | PORT_START /* audio board dips */ |
| 821 | 782 | COINAGE |
| 822 | 783 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 823 | 784 | |
| 824 | 785 | PORT_START /* start button */ |
| 825 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 826 | PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 786 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 787 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 827 | 788 | |
| 828 | 789 | PORT_START /* coin counters */ |
| 829 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 830 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 831 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 790 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 791 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 792 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 793 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 832 | 794 | |
| 833 | 795 | PORT_START /* fake analog X */ |
| 834 | 796 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) |
| r1877 | r1878 | |
| 840 | 802 | |
| 841 | 803 | static INPUT_PORTS_START( topsecex ) |
| 842 | 804 | PORT_START /* player inputs and logic board dips */ |
| 843 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 844 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 845 | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) | |
| 846 | PORT_DIPSETTING( 0x08, "3" ) | |
| 847 | PORT_DIPSETTING( 0x0c, "4" ) | |
| 848 | PORT_DIPSETTING( 0x04, "5" ) | |
| 849 | PORT_DIPSETTING( 0x00, "6" ) | |
| 850 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) | |
| 851 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) | |
| 852 | PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) | |
| 853 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) | |
| 854 | PORT_DIPSETTING( 0x10, DEF_STR( Hardest ) ) | |
| 855 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 805 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 806 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 807 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Lives ) ) | |
| 808 | PORT_DIPSETTING( 0x04, "3" ) | |
| 809 | PORT_DIPSETTING( 0x00, "4" ) | |
| 810 | PORT_DIPSETTING( 0x08, "5" ) | |
| 811 | PORT_DIPSETTING( 0x0c, "6" ) | |
| 812 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) ) | |
| 813 | PORT_DIPSETTING( 0x30, DEF_STR( Easy ) ) | |
| 814 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) | |
| 815 | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) | |
| 816 | PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) ) | |
| 817 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_beam_r, 0) | |
| 818 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_vblank_r, 0) | |
| 856 | 819 | |
| 857 | 820 | PORT_START /* audio board dips */ |
| 858 | 821 | COINAGE |
| 859 | 822 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 860 | 823 | |
| 861 | 824 | PORT_START /* start button */ |
| 862 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) | |
| 863 | PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 825 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) | |
| 826 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 864 | 827 | |
| 865 | 828 | PORT_START /* coin counters */ |
| 866 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 867 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 868 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 829 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 830 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 831 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 832 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 869 | 833 | |
| 870 | 834 | PORT_START /* fake analog X */ |
| 871 | 835 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_REVERSE |
| r1877 | r1878 | |
| 887 | 851 | |
| 888 | 852 | static INPUT_PORTS_START( hitnmiss ) |
| 889 | 853 | PORT_START /* player inputs and logic board dips */ |
| 890 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 891 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 892 | PORT_DIPNAME( 0x0c, 0x0c, "Seconds" ) | |
| 893 | PORT_DIPSETTING( 0x08, "20" ) | |
| 894 | PORT_DIPSETTING( 0x0c, "30" ) | |
| 895 | PORT_DIPSETTING( 0x04, "40" ) | |
| 896 | PORT_DIPSETTING( 0x00, "50" ) | |
| 897 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) | |
| 898 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) | |
| 899 | PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) | |
| 900 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) | |
| 901 | PORT_DIPSETTING( 0x10, DEF_STR( Hardest ) ) | |
| 902 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 854 | PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(hitnmiss_button1_r, 0) | |
| 855 | PORT_DIPNAME( 0x0c, 0x00, "Seconds" ) | |
| 856 | PORT_DIPSETTING( 0x04, "20" ) | |
| 857 | PORT_DIPSETTING( 0x00, "30" ) | |
| 858 | PORT_DIPSETTING( 0x08, "40" ) | |
| 859 | PORT_DIPSETTING( 0x0c, "50" ) | |
| 860 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) ) | |
| 861 | PORT_DIPSETTING( 0x30, DEF_STR( Easy ) ) | |
| 862 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) | |
| 863 | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) | |
| 864 | PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) ) | |
| 865 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_beam_r, 0) | |
| 866 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_vblank_r, 0) | |
| 903 | 867 | |
| 904 | 868 | PORT_START /* audio board dips */ |
| 905 | 869 | COINAGE |
| r1877 | r1878 | |
| 909 | 873 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 910 | 874 | |
| 911 | 875 | PORT_START /* start button */ |
| 912 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 913 | PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 876 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 877 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 914 | 878 | |
| 915 | 879 | PORT_START /* coin counters */ |
| 916 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 917 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 918 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 880 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 881 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 882 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 883 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 919 | 884 | |
| 920 | 885 | PORT_START /* fake analog X */ |
| 921 | 886 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) |
| 922 | 887 | |
| 923 | 888 | PORT_START /* fake analog Y */ |
| 924 | 889 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) |
| 890 | ||
| 891 | PORT_START_TAG("HITNMISS_BUTTON1") | |
| 892 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) | |
| 925 | 893 | INPUT_PORTS_END |
| 926 | 894 | |
| 927 | 895 | |
| 928 | 896 | static INPUT_PORTS_START( whodunit ) |
| 929 | 897 | PORT_START /* player inputs and logic board dips */ |
| 930 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 931 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 932 | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) | |
| 933 | PORT_DIPSETTING( 0x08, "2" ) | |
| 934 | PORT_DIPSETTING( 0x0c, "3" ) | |
| 935 | PORT_DIPSETTING( 0x04, "4" ) | |
| 936 | PORT_DIPSETTING( 0x00, "5" ) | |
| 937 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) | |
| 938 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) | |
| 939 | PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) | |
| 940 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) | |
| 941 | PORT_DIPSETTING( 0x10, DEF_STR( Hardest ) ) | |
| 942 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 898 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_vblank_r, 0) | |
| 899 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) | |
| 900 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Lives ) ) | |
| 901 | PORT_DIPSETTING( 0x04, "2" ) | |
| 902 | PORT_DIPSETTING( 0x00, "3" ) | |
| 903 | PORT_DIPSETTING( 0x08, "4" ) | |
| 904 | PORT_DIPSETTING( 0x0c, "5" ) | |
| 905 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) ) | |
| 906 | PORT_DIPSETTING( 0x30, DEF_STR( Easy ) ) | |
| 907 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) | |
| 908 | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) | |
| 909 | PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) ) | |
| 910 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_beam_r, 0) | |
| 911 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_vblank_r, 0) | |
| 943 | 912 | |
| 944 | 913 | PORT_START /* audio board dips */ |
| 945 | 914 | COINAGE |
| 946 | 915 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 947 | 916 | |
| 948 | 917 | PORT_START /* start button */ |
| 949 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) | |
| 950 | PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 918 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 919 | PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 951 | 920 | |
| 952 | 921 | PORT_START /* coin counters */ |
| 953 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 954 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 955 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 922 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 923 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 924 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 925 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 956 | 926 | |
| 957 | 927 | PORT_START /* fake analog X */ |
| 958 | 928 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) |
| r1877 | r1878 | |
| 964 | 934 | |
| 965 | 935 | static INPUT_PORTS_START( showdown ) |
| 966 | 936 | PORT_START /* player inputs and logic board dips */ |
| 967 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 968 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) | |
| 969 | PORT_DIPNAME( 0x0c, 0x0c, "Hands" ) | |
| 970 | PORT_DIPSETTING( 0x08, "1" ) | |
| 971 | PORT_DIPSETTING( 0x0c, "2" ) | |
| 972 | PORT_DIPSETTING( 0x04, "3" ) | |
| 973 | PORT_DIPSETTING( 0x00, "4" ) | |
| 974 | PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) | |
| 975 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) | |
| 976 | PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) | |
| 977 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) | |
| 978 | PORT_DIPSETTING( 0x10, DEF_STR( Hardest ) ) | |
| 979 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 937 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 938 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) | |
| 939 | PORT_DIPNAME( 0x0c, 0x00, "Hands" ) | |
| 940 | PORT_DIPSETTING( 0x04, "1" ) | |
| 941 | PORT_DIPSETTING( 0x00, "2" ) | |
| 942 | PORT_DIPSETTING( 0x08, "3" ) | |
| 943 | PORT_DIPSETTING( 0x0c, "4" ) | |
| 944 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) ) | |
| 945 | PORT_DIPSETTING( 0x30, DEF_STR( Easy ) ) | |
| 946 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) | |
| 947 | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) | |
| 948 | PORT_DIPSETTING( 0x20, DEF_STR( Hardest ) ) | |
| 949 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_beam_r, 0) | |
| 950 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(firq_vblank_r, 0) | |
| 980 | 951 | |
| 981 | 952 | PORT_START /* audio board dips */ |
| 982 | 953 | COINAGE |
| r1877 | r1878 | |
| 994 | 965 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 995 | 966 | |
| 996 | 967 | PORT_START /* start button */ |
| 997 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Action") | |
| 998 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Bet-All") | |
| 999 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Gold") | |
| 1000 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Blue") | |
| 1001 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Red") | |
| 1002 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("White") | |
| 1003 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1004 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 968 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Action") | |
| 969 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Bet-All") | |
| 970 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Gold") | |
| 971 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Blue") | |
| 972 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Red") | |
| 973 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("White") | |
| 974 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 975 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 1005 | 976 | |
| 1006 | 977 | PORT_START /* coin counters */ |
| 1007 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 1008 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 1009 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 978 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 979 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 980 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 981 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1010 | 982 | |
| 1011 | 983 | PORT_START /* fake analog X */ |
| 1012 | 984 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) |
| r1877 | r1878 | |
| 1026 | 998 | static MACHINE_DRIVER_START( exidy440 ) |
| 1027 | 999 | |
| 1028 | 1000 | /* basic machine hardware */ |
| 1029 | MDRV_CPU_ADD(M6809, | |
| 1001 | MDRV_CPU_ADD(M6809, | |
| 1030 | 1002 | MDRV_CPU_PROGRAM_MAP(exidy440_map,0) |
| 1031 | MDRV_CPU_VBLANK_INT(main_interrupt | |
| 1003 | MDRV_CPU_VBLANK_INT("main", exidy440_vblank_interrupt | |
| 1032 | 1004 | |
| 1033 | 1005 | MDRV_MACHINE_RESET(exidy440) |
| 1034 | 1006 | MDRV_NVRAM_HANDLER(exidy440) |
| 1035 | 1007 | |
| 1036 | 1008 | /* video hardware */ |
| 1037 | MDRV_SCREEN_ADD("main", RASTER) | |
| 1038 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1039 | MDRV_SCREEN_RAW_PARAMS(EXIDY440_PIXEL_CLOCK, EXIDY440_HTOTAL, EXIDY440_HBEND, EXIDY440_HBSTART, EXIDY440_VTOTAL, EXIDY440_VBEND, EXIDY440_VBSTART) | |
| 1009 | MDRV_IMPORT_FROM(exidy440_video) | |
| 1040 | 1010 | |
| 1041 | MDRV_PALETTE_LENGTH(256) | |
| 1042 | ||
| 1043 | MDRV_VIDEO_START(exidy440) | |
| 1044 | MDRV_VIDEO_EOF(exidy440) | |
| 1045 | MDRV_VIDEO_UPDATE(exidy440) | |
| 1046 | ||
| 1047 | 1011 | /* audio hardware */ |
| 1048 | 1012 | MDRV_IMPORT_FROM(exidy440_audio) |
| 1049 | 1013 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
| 1055 | 1019 | MDRV_IMPORT_FROM(exidy440) |
| 1056 | 1020 | |
| 1057 | 1021 | /* video hardware */ |
| 1058 | MDRV_SCREEN_MODIFY("main") | |
| 1059 | MDRV_SCREEN_RAW_PARAMS(EXIDY440_PIXEL_CLOCK, EXIDY440_HTOTAL, EXIDY440_HBEND, EXIDY440_HBSTART, EXIDY440_VTOTAL, EXIDY440_VBEND, TOPSECEX_VBSTART) | |
| 1060 | ||
| 1022 | MDRV_IMPORT_FROM(topsecex_video) | |
| 1061 | 1023 | MACHINE_DRIVER_END |
| 1062 | 1024 | |
| 1063 | 1025 | |
| r1877 | r1878 | |
| 1963 | 1925 | * |
| 1964 | 1926 | *************************************/ |
| 1965 | 1927 | |
| 1966 | #define SET_PARAMS(top,p0,p2,p3,mv,mt,cpr) \ | |
| 1967 | showdown_bank_data[0] = showdown_bank_data[1] = NULL;\ | |
| 1968 | exidy440_topsecret = top;\ | |
| 1969 | port_0_xor = p0;\ | |
| 1970 | port_2_xor = p2;\ | |
| 1971 | port_3_xor = p3;\ | |
| 1972 | mirror_vblank_bit = mv;\ | |
| 1973 | mirror_trigger_bit = mt;\ | |
| 1974 | copy_protection_read = cpr | |
| 1928 | static DRIVER_INIT( exidy440 ) | |
| 1929 | { | |
| 1930 | showdown_bank_data[0] = showdown_bank_data[1] = NULL; | |
| 1931 | } | |
| 1975 | 1932 | |
| 1976 | static DRIVER_INIT( crossbow ) { SET_PARAMS(0, 0x00, 0x00, 0x00, 0, 0, 0x00); } | |
| 1977 | static DRIVER_INIT( cheyenne ) { SET_PARAMS(0, 0xff, 0x00, 0x00, 0, 0, 0x00); } | |
| 1978 | static DRIVER_INIT( combat ) { SET_PARAMS(0, 0xff, 0xff, 0x00, 0, 0, 0x00); } | |
| 1979 | static DRIVER_INIT( cracksht ) { SET_PARAMS(0, 0xff, 0xff, 0x04, 0, 0, 0x00); } | |
| 1980 | static DRIVER_INIT( claypign ) { SET_PARAMS(0, 0xff, 0xff, 0x04, 0, 0, 0x76); } | |
| 1981 | static DRIVER_INIT( chiller ) { SET_PARAMS(0, 0xff, 0xff, 0x04, 0, 0, 0x00); } | |
| 1982 | static DRIVER_INIT( topsecex ) { SET_PARAMS(1, 0xff, 0xff, 0x04, 0, 0, 0x00); } | |
| 1983 | static DRIVER_INIT( hitnmiss ) { SET_PARAMS(0, 0xff, 0xff, 0x04, 0, 1, 0x00); } | |
| 1984 | static DRIVER_INIT( whodunit ) { SET_PARAMS(0, 0xff, 0xff, 0x04, 1, 0, 0x00); } | |
| 1985 | 1933 | |
| 1934 | static DRIVER_INIT( claypign ) | |
| 1935 | { | |
| 1936 | DRIVER_INIT_CALL(exidy440); | |
| 1937 | ||
| 1938 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ec0, 0x2ec3, 0, 0, claypign_protection_r); | |
| 1939 | } | |
| 1940 | ||
| 1941 | ||
| 1942 | static DRIVER_INIT( topsecex ) | |
| 1943 | { | |
| 1944 | DRIVER_INIT_CALL(exidy440); | |
| 1945 | ||
| 1946 | /* extra input ports and scrolling */ | |
| 1947 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ec5, 0x2ec5, 0, 0, topsecex_input_port_5_r); | |
| 1948 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ec6, 0x2ec6, 0, 0, input_port_4_r); | |
| 1949 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ec7, 0x2ec7, 0, 0, input_port_6_r); | |
| 1950 | ||
| 1951 | topsecex_yscroll = memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ec1, 0x2ec1, 0, 0, topsecex_yscroll_w); | |
| 1952 | } | |
| 1953 | ||
| 1954 | ||
| 1986 | 1955 | static DRIVER_INIT( showdown ) |
| 1987 | 1956 | { |
| 1988 | 1957 | static const UINT8 bankdata0[0x18] = |
| r1877 | r1878 | |
| 1997 | 1966 | 0x46,0xd2,0x98,0x59,0x91,0x08,0xc8,0x41, |
| 1998 | 1967 | 0xc5,0x8c,0x4e,0x86,0x1a,0xda,0x50,0xd1 |
| 1999 | 1968 | }; |
| 2000 | SET_PARAMS(0, 0xff, 0xff, 0x04, 0, 0, 0x00); | |
| 2001 | 1969 | |
| 1970 | DRIVER_INIT_CALL(exidy440); | |
| 1971 | ||
| 2002 | 1972 | /* set up the fake PLD */ |
| 2003 | 1973 | showdown_bank_data[0] = bankdata0; |
| 2004 | 1974 | showdown_bank_data[1] = bankdata1; |
| 2005 | 1975 | } |
| 2006 | 1976 | |
| 1977 | ||
| 2007 | 1978 | static DRIVER_INIT( yukon ) |
| 2008 | 1979 | { |
| 2009 | 1980 | static const UINT8 bankdata0[0x18] = |
| r1877 | r1878 | |
| 2018 | 1989 | 0x52,0xe2,0xa4,0x65,0xa1,0x04,0xc4,0x41, |
| 2019 | 1990 | 0xd1,0x94,0x56,0x92,0x26,0xe6,0x60,0xe1 |
| 2020 | 1991 | }; |
| 2021 | SET_PARAMS(0, 0xff, 0xff, 0x04, 0, 0, 0x00); | |
| 2022 | 1992 | |
| 1993 | DRIVER_INIT_CALL(exidy440); | |
| 1994 | ||
| 2023 | 1995 | /* set up the fake PLD */ |
| 2024 | 1996 | showdown_bank_data[0] = bankdata0; |
| 2025 | 1997 | showdown_bank_data[1] = bankdata1; |
| r1877 | r1878 | |
| 2033 | 2005 | * |
| 2034 | 2006 | *************************************/ |
| 2035 | 2007 | |
| 2036 | GAME( 1983, crossbow, 0, exidy440, crossbow, crossbow, ROT0, "Exidy", "Crossbow (version 2.0)", 0 ) | |
| 2037 | GAME( 1984, cheyenne, 0, exidy440, cheyenne, cheyenne, ROT0, "Exidy", "Cheyenne (version 1.0)", 0 ) | |
| 2038 | GAME( 1985, combat, 0, exidy440, combat, combat, ROT0, "Exidy", "Combat (version 3.0)", 0 ) | |
| 2039 | GAME( 1985, catch22, combat, exidy440, catch22, combat, ROT0, "Exidy", "Catch-22 (version 8.0)", 0 ) | |
| 2040 | GAME( 1985, cracksht, 0, exidy440, cracksht, cracksht, ROT0, "Exidy", "Crackshot (version 2.0)", 0 ) | |
| 2008 | GAME( 1983, crossbow, 0, exidy440, crossbow, exidy440, ROT0, "Exidy", "Crossbow (version 2.0)", 0 ) | |
| 2009 | GAME( 1984, cheyenne, 0, exidy440, cheyenne, exidy440, ROT0, "Exidy", "Cheyenne (version 1.0)", 0 ) | |
| 2010 | GAME( 1985, combat, 0, exidy440, combat, exidy440, ROT0, "Exidy", "Combat (version 3.0)", 0 ) | |
| 2011 | GAME( 1985, catch22, combat, exidy440, catch22, exidy440, ROT0, "Exidy", "Catch-22 (version 8.0)", 0 ) | |
| 2012 | GAME( 1985, cracksht, 0, exidy440, cracksht, exidy440, ROT0, "Exidy", "Crackshot (version 2.0)", 0 ) | |
| 2041 | 2013 | GAME( 1986, claypign, 0, exidy440, claypign, claypign, ROT0, "Exidy", "Clay Pigeon (version 2.0)", 0 ) |
| 2042 | GAME( 1986, chiller, 0, exidy440, chiller, | |
| 2014 | GAME( 1986, chiller, 0, exidy440, chiller, | |
| 2043 | 2015 | GAME( 1986, topsecex, 0, topsecex, topsecex, topsecex, ROT0, "Exidy", "Top Secret (Exidy) (version 1.0)", 0 ) |
| 2044 | GAME( 1987, hitnmiss, 0, exidy440, hitnmiss, hitnmiss, ROT0, "Exidy", "Hit 'n Miss (version 3.0)", 0 ) | |
| 2045 | GAME( 1987, hitnmis2, hitnmiss, exidy440, hitnmiss, hitnmiss, ROT0, "Exidy", "Hit 'n Miss (version 2.0)", 0 ) | |
| 2046 | GAME( 1988, whodunit, 0, exidy440, whodunit, whodunit, ROT0, "Exidy", "Who Dunit (version 8.0)", 0 ) | |
| 2016 | GAME( 1987, hitnmiss, 0, exidy440, hitnmiss, exidy440, ROT0, "Exidy", "Hit 'n Miss (version 3.0)", 0 ) | |
| 2017 | GAME( 1987, hitnmis2, hitnmiss, exidy440, hitnmiss, exidy440, ROT0, "Exidy", "Hit 'n Miss (version 2.0)", 0 ) | |
| 2018 | GAME( 1988, whodunit, 0, exidy440, whodunit, exidy440, ROT0, "Exidy", "Who Dunit (version 8.0)", 0 ) | |
| 2047 | 2019 | GAME( 1988, showdown, 0, exidy440, showdown, showdown, ROT0, "Exidy", "Showdown (version 5.0)", 0 ) |
| 2048 | 2020 | GAME( 1989, yukon, 0, exidy440, showdown, yukon, ROT0, "Exidy", "Yukon (version 2.0)", 0 ) |
| 2049 | 2021 | GAME( 1989, yukon1, yukon, exidy440, showdown, yukon, ROT0, "Exidy", "Yukon (version 1.0)", 0 ) |
| r1877 | r1878 | |
|---|---|---|
| 459 | 459 | MDRV_CPU_ADD(Z80, SCHEMATIC_CLOCK) |
| 460 | 460 | MDRV_CPU_PROGRAM_MAP(mainmem,0) |
| 461 | 461 | MDRV_CPU_IO_MAP(mainio,0) |
| 462 | MDRV_CPU_VBLANK_INT(vblank_callback_thayers | |
| 462 | MDRV_CPU_VBLANK_INT("main", vblank_callback_thayers | |
| 463 | 463 | |
| 464 | 464 | MDRV_MACHINE_START(thayers) |
| 465 | 465 |
| r1877 | r1878 | |
|---|---|---|
| 239 | 239 | static MACHINE_DRIVER_START( genesis_base ) |
| 240 | 240 | /*basic machine hardware */ |
| 241 | 241 | MDRV_CPU_ADD_TAG("main", M68000, MASTER_CLOCK / 7) |
| 242 | MDRV_CPU_VBLANK_INT(genesis_vblank_interrupt | |
| 242 | MDRV_CPU_VBLANK_INT("main", genesis_vblank_interrupt | |
| 243 | 243 | |
| 244 | 244 | MDRV_CPU_ADD_TAG("sound", Z80, MASTER_CLOCK / 15) |
| 245 | 245 | MDRV_CPU_PROGRAM_MAP(genesis_z80_readmem, genesis_z80_writemem) |
| 246 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 246 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 247 | 247 | |
| 248 | 248 | MDRV_INTERLEAVE(100) |
| 249 | 249 |
| r1877 | r1878 | |
|---|---|---|
| 797 | 797 | MDRV_CPU_ADD_TAG("main",Z80,2500000) /* ?? */ |
| 798 | 798 | MDRV_CPU_PROGRAM_MAP(pitboss_map,0) |
| 799 | 799 | MDRV_CPU_IO_MAP(trvwhiz_io_map,0) |
| 800 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 800 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 801 | 801 | |
| 802 | 802 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 803 | 803 | MDRV_MACHINE_RESET(merit) |
| r1877 | r1878 | |
|---|---|---|
| 170 | 170 | |
| 171 | 171 | static WRITE16_HANDLER( dassault_sound_w ) |
| 172 | 172 | { |
| 173 | soundlatch_w(0,data&0xff); | |
| 174 | cpunum_set_input_line(Machine, 2,0,HOLD_LINE); /* IRQ1 */ | |
| 173 | soundlatch_w(machine,0,data&0xff); | |
| 174 | cpunum_set_input_line(machine, 2,0,HOLD_LINE); /* IRQ1 */ | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /* The CPU-CPU irq controller is overlaid onto the end of the shared memory */ |
| r1877 | r1878 | |
| 556 | 556 | /* basic machine hardware */ |
| 557 | 557 | MDRV_CPU_ADD(M68000, 14000000) /* Accurate */ |
| 558 | 558 | MDRV_CPU_PROGRAM_MAP(dassault_readmem,dassault_writemem) |
| 559 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 559 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 560 | 560 | |
| 561 | 561 | MDRV_CPU_ADD(M68000, 14000000) /* Accurate */ |
| 562 | 562 | MDRV_CPU_PROGRAM_MAP(dassault_sub_readmem,dassault_sub_writemem) |
| 563 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 563 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 564 | 564 | |
| 565 | 565 | MDRV_CPU_ADD(H6280,32220000/8) |
| 566 | 566 | /* audio CPU */ /* Accurate */ |
| r1877 | r1878 | |
|---|---|---|
| 27 | 27 | { |
| 28 | 28 | if (data != noise_data) { |
| 29 | 29 | noise_data = data; |
| 30 | galaxian_noise_enable_w(offset, data); | |
| 31 | }; | |
| 30 | galaxian_noise_enable_w(machine, offset, data); | |
| 31 | } | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 |
| r1877 | r1878 | |
|---|---|---|
| 457 | 457 | /* basic machine hardware */ |
| 458 | 458 | MDRV_CPU_ADD_TAG("cpu",Z80,18432000/6) /* 3.072 MHz (probably) */ |
| 459 | 459 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 460 | MDRV_CPU_VBLANK_INT(pingpong_interrupt,16) /* 1 IRQ + 8 NMI */ | |
| 460 | MDRV_CPU_VBLANK_INT_HACK(pingpong_interrupt,16) /* 1 IRQ + 8 NMI */ | |
| 461 | 461 | |
| 462 | 462 | /* video hardware */ |
| 463 | 463 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 486 | 486 | MDRV_IMPORT_FROM( pingpong ) |
| 487 | 487 | MDRV_CPU_MODIFY("cpu") |
| 488 | 488 | MDRV_CPU_PROGRAM_MAP(merlinmm_map,0) |
| 489 | MDRV_CPU_VBLANK_INT(pingpong_interrupt,2) | |
| 489 | MDRV_CPU_VBLANK_INT_HACK(pingpong_interrupt,2) | |
| 490 | 490 | |
| 491 | 491 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 492 | 492 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
|---|---|---|
| 56 | 56 | |
| 57 | 57 | static READ8_HANDLER(ssrj_wheel_r) |
| 58 | 58 | { |
| 59 | int port= input_port_1_r(0) -0x80; | |
| 59 | int port= input_port_1_r(machine,0) -0x80; | |
| 60 | 60 | int retval=port-oldport; |
| 61 | 61 | oldport=port; |
| 62 | 62 | return retval; |
| r1877 | r1878 | |
| 173 | 173 | /* basic machine hardware */ |
| 174 | 174 | MDRV_CPU_ADD(Z80,8000000/2) |
| 175 | 175 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 176 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 176 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 177 | 177 | |
| 178 | 178 | /* video hardware */ |
| 179 | 179 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 197 | 197 | /* basic machine hardware */ |
| 198 | 198 | MDRV_CPU_ADD(M68000, ATARI_CLOCK_14MHz/2) |
| 199 | 199 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 200 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 200 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 201 | 201 | |
| 202 | 202 | MDRV_MACHINE_RESET(blstroid) |
| 203 | 203 | MDRV_NVRAM_HANDLER(atarigen) |
| r1877 | r1878 | |
|---|---|---|
| 200 | 200 | /* basic machine hardware */ |
| 201 | 201 | MDRV_CPU_ADD(Z80,18432000/6) /* 3.072 MHz ??? */ |
| 202 | 202 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 203 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 203 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 204 | 204 | |
| 205 | 205 | /* video hardware */ |
| 206 | 206 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 58 | 58 | MDRV_CPU_ADD(Z80,4000000) /* ? MHz */ |
| 59 | 59 | MDRV_CPU_PROGRAM_MAP(gtipoker_memmap,0) |
| 60 | 60 | MDRV_CPU_IO_MAP(gtipoker_iomap,0) |
| 61 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 61 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 62 | 62 | |
| 63 | 63 | /* video hardware */ |
| 64 | 64 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 60 | 60 | |
| 61 | 61 | static READ16_HANDLER( joystick_r ) |
| 62 | 62 | { |
| 63 | return (((input_port_0_r (offset) - 0xf) << 8) | | |
| 64 | ((input_port_1_r (offset) - 0xf) & 0xff)); | |
| 63 | return (((input_port_0_r (machine,offset) - 0xf) << 8) | | |
| 64 | ((input_port_1_r (machine,offset) - 0xf) & 0xff)); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| r1877 | r1878 | |
| 150 | 150 | /* basic machine hardware */ |
| 151 | 151 | MDRV_CPU_ADD(M68000, 8000000) |
| 152 | 152 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 153 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 153 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 154 | 154 | |
| 155 | 155 | MDRV_CPU_ADD(Z80, 2000000) |
| 156 | 156 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 170 | 170 | |
| 171 | 171 | static WRITE16_HANDLER(cyclwarr_sound_w) |
| 172 | 172 | { |
| 173 | soundlatch_w(0, data >> 8); | |
| 174 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 173 | soundlatch_w(machine, 0, data >> 8); | |
| 174 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /***************************************************************************/ |
| r1877 | r1878 | |
| 826 | 826 | /* basic machine hardware */ |
| 827 | 827 | MDRV_CPU_ADD(V30,20000000 / 2) /* NEC V30 CPU, 20MHz / 2 */ |
| 828 | 828 | MDRV_CPU_PROGRAM_MAP(apache3_v30_map,0) |
| 829 | MDRV_CPU_VBLANK_INT(roundup5_interrupt | |
| 829 | MDRV_CPU_VBLANK_INT("main", roundup5_interrupt | |
| 830 | 830 | |
| 831 | 831 | MDRV_CPU_ADD(M68000,20000000 / 2) /* 68000 CPU, 20MHz / 2 */ |
| 832 | 832 | MDRV_CPU_PROGRAM_MAP(apache3_68000_map,0) |
| r1877 | r1878 | |
| 872 | 872 | /* basic machine hardware */ |
| 873 | 873 | MDRV_CPU_ADD(V30,20000000 / 2) /* NEC V30 CPU, 20MHz / 2 */ |
| 874 | 874 | MDRV_CPU_PROGRAM_MAP(roundup5_v30_map,0) |
| 875 | MDRV_CPU_VBLANK_INT(roundup5_interrupt | |
| 875 | MDRV_CPU_VBLANK_INT("main", roundup5_interrupt | |
| 876 | 876 | |
| 877 | 877 | MDRV_CPU_ADD(M68000,20000000 / 2) /* 68000 CPU, 20MHz / 2 */ |
| 878 | 878 | MDRV_CPU_PROGRAM_MAP(roundup5_68000_map,0) |
| r1877 | r1878 | |
| 915 | 915 | /* basic machine hardware */ |
| 916 | 916 | MDRV_CPU_ADD(M68000, 50000000 / 4) /* Confirmed */ |
| 917 | 917 | MDRV_CPU_PROGRAM_MAP(cyclwarr_68000a_map,0) |
| 918 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 918 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 919 | 919 | |
| 920 | 920 | MDRV_CPU_ADD(M68000, 50000000 / 4) /* Confirmed */ |
| 921 | 921 | MDRV_CPU_PROGRAM_MAP(cyclwarr_68000b_map,0) |
| 922 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 922 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 923 | 923 | |
| 924 | 924 | MDRV_CPU_ADD(Z80, 16000000 / 4) /* Confirmed */ |
| 925 | 925 | MDRV_CPU_PROGRAM_MAP(cyclwarr_z80_map,0) |
| r1877 | r1878 | |
| 959 | 959 | /* basic machine hardware */ |
| 960 | 960 | MDRV_CPU_ADD(M68000, 50000000 / 4) /* Confirmed */ |
| 961 | 961 | MDRV_CPU_PROGRAM_MAP(bigfight_68000a_map,0) |
| 962 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 962 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 963 | 963 | |
| 964 | 964 | MDRV_CPU_ADD(M68000, 50000000 / 4) /* Confirmed */ |
| 965 | 965 | MDRV_CPU_PROGRAM_MAP(bigfight_68000b_map,0) |
| 966 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 966 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 967 | 967 | |
| 968 | 968 | MDRV_CPU_ADD(Z80, 16000000 / 4) /* Confirmed */ |
| 969 | 969 | MDRV_CPU_PROGRAM_MAP(cyclwarr_z80_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | static WRITE16_HANDLER( sound_w ) |
| 55 | 55 | { |
| 56 | soundlatch_w(0,data & 0xff); | |
| 57 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 56 | soundlatch_w(machine,0,data & 0xff); | |
| 57 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /******************************************************************************/ |
| r1877 | r1878 | |
| 121 | 121 | { |
| 122 | 122 | switch (offset) { |
| 123 | 123 | case 0: |
| 124 | YM2151_register_port_0_w(0,data); | |
| 124 | YM2151_register_port_0_w(machine,0,data); | |
| 125 | 125 | break; |
| 126 | 126 | case 1: |
| 127 | YM2151_data_port_0_w(0,data); | |
| 127 | YM2151_data_port_0_w(machine,0,data); | |
| 128 | 128 | break; |
| 129 | 129 | } |
| 130 | 130 | } |
| r1877 | r1878 | |
| 376 | 376 | /* basic machine hardware */ |
| 377 | 377 | MDRV_CPU_ADD(M68000, 14000000) |
| 378 | 378 | MDRV_CPU_PROGRAM_MAP(supbtime_readmem,supbtime_writemem) |
| 379 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 379 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 380 | 380 | |
| 381 | 381 | MDRV_CPU_ADD(H6280, 32220000/8) /* Custom chip 45, audio section crystal is 32.220 MHz */ |
| 382 | 382 | /* audio CPU */ |
| r1877 | r1878 | |
| 417 | 417 | /* basic machine hardware */ |
| 418 | 418 | MDRV_CPU_ADD(M68000, 14000000) |
| 419 | 419 | MDRV_CPU_PROGRAM_MAP(chinatwn_readmem,chinatwn_writemem) |
| 420 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 420 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 421 | 421 | |
| 422 | 422 | MDRV_CPU_ADD(H6280, 32220000/8) /* Custom chip 45, audio section crystal is 32.220 MHz */ |
| 423 | 423 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 386 | 386 | /* basic machine hardware */ |
| 387 | 387 | MDRV_CPU_ADD(M68000, 10000000) /* ? */ |
| 388 | 388 | MDRV_CPU_PROGRAM_MAP(blmbycar_readmem,blmbycar_writemem) |
| 389 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 389 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 390 | 390 | |
| 391 | 391 | /* video hardware */ |
| 392 | 392 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 416 | 416 | /* basic machine hardware */ |
| 417 | 417 | MDRV_CPU_ADD(M68000, 10000000) /* ? */ |
| 418 | 418 | MDRV_CPU_PROGRAM_MAP(watrball_readmem,watrball_writemem) |
| 419 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 419 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 420 | 420 | |
| 421 | 421 | /* video hardware */ |
| 422 | 422 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 140 | 140 | if (timer & 0x100) popmessage("watchdog!"); |
| 141 | 141 | |
| 142 | 142 | |
| 143 | if (last != (input_port_0_r(0) & 0x0f)) | |
| 143 | if (last != (input_port_0_r(machine, 0) & 0x0f)) | |
| 144 | 144 | { |
| 145 | last = input_port_0_r(0) & 0x0f; | |
| 145 | last = input_port_0_r(machine, 0) & 0x0f; | |
| 146 | 146 | cpunum_set_input_line(machine, 0, 0, PULSE_LINE); |
| 147 | 147 | } |
| 148 | pia_set_input_a(0, input_port_0_r(0) & 0x0f, 0); | |
| 148 | pia_set_input_a(0, input_port_0_r(machine, 0) & 0x0f, 0); | |
| 149 | 149 | |
| 150 | pia_set_input_ca1(0, input_port_0_r(0) & 0x10); | |
| 150 | pia_set_input_ca1(0, input_port_0_r(machine, 0) & 0x10); | |
| 151 | 151 | |
| 152 | pia_set_input_ca2(0, input_port_0_r(0) & 0x20); | |
| 152 | pia_set_input_ca2(0, input_port_0_r(machine, 0) & 0x20); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | static READ8_HANDLER( timer_r ) |
| r1877 | r1878 | |
|---|---|---|
| 93 | 93 | |
| 94 | 94 | static WRITE8_HANDLER( soundcommand_w ) |
| 95 | 95 | { |
| 96 | soundlatch_w(0, data); | |
| 97 | cpunum_set_input_line(Machine, 2, 0, HOLD_LINE); | |
| 96 | soundlatch_w(machine, 0, data); | |
| 97 | cpunum_set_input_line(machine, 2, 0, HOLD_LINE); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | static WRITE8_HANDLER( irq0_ack_w ) |
| r1877 | r1878 | |
| 367 | 367 | /* basic machine hardware */ |
| 368 | 368 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz? */ |
| 369 | 369 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 370 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 370 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 371 | 371 | |
| 372 | 372 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz? */ |
| 373 | 373 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| 374 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 374 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 375 | 375 | |
| 376 | 376 | MDRV_CPU_ADD(Z80, 18432000/6) /* 3.072 MHz? */ |
| 377 | 377 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 378 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,2) | |
| 378 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,2) | |
| 379 | 379 | |
| 380 | 380 | MDRV_CPU_ADD_TAG("68705", M68705,18432000/6) /* 3.072 MHz? */ |
| 381 | 381 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 44 | 44 | static WRITE8_HANDLER( bankedram_w ) |
| 45 | 45 | { |
| 46 | 46 | if (palette_selected) |
| 47 | paletteram_xBBBBBGGGGGRRRRR_be_w(offset,data); | |
| 47 | paletteram_xBBBBBGGGGGRRRRR_be_w(machine,offset,data); | |
| 48 | 48 | else |
| 49 | 49 | ram[offset] = data; |
| 50 | 50 | } |
| r1877 | r1878 | |
| 299 | 299 | /* basic machine hardware */ |
| 300 | 300 | MDRV_CPU_ADD(KONAMI, 3000000) /* Konami custom 052526 */ |
| 301 | 301 | MDRV_CPU_PROGRAM_MAP(gbusters_readmem,gbusters_writemem) |
| 302 | MDRV_CPU_VBLANK_INT(gbusters_interrupt | |
| 302 | MDRV_CPU_VBLANK_INT("main", gbusters_interrupt | |
| 303 | 303 | |
| 304 | 304 | MDRV_CPU_ADD(Z80, 3579545) |
| 305 | 305 | /* audio CPU */ /* ? */ |
| r1877 | r1878 | |
|---|---|---|
| 240 | 240 | // PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 7") PORT_CODE(KEYCODE_K) |
| 241 | 241 | INPUT_PORTS_END |
| 242 | 242 | |
| 243 | #ifdef UNUSED_DEFINITION | |
| 243 | 244 | static INPUT_PORTS_START ( mp_col3 ) |
| 244 | 245 | GENESIS_PORTS |
| 245 | 246 | MEGAPLAY_TEST |
| r1877 | r1878 | |
| 266 | 267 | // PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 6") PORT_CODE(KEYCODE_J) |
| 267 | 268 | // PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 7") PORT_CODE(KEYCODE_K) |
| 268 | 269 | INPUT_PORTS_END |
| 270 | #endif | |
| 269 | 271 | |
| 270 | 272 | static INPUT_PORTS_START ( mp_twc ) |
| 271 | 273 | GENESIS_PORTS |
| r1877 | r1878 | |
| 438 | 440 | UINT8* game = memory_region(REGION_CPU1); |
| 439 | 441 | |
| 440 | 442 | if(game_banksel == 0x142) // Genesis I/O |
| 441 | return megaplay_genesis_io_r((offset & 0x1f) / 2, 0xffff); | |
| 443 | return megaplay_genesis_io_r(machine, (offset & 0x1f) / 2, 0xffff); | |
| 442 | 444 | |
| 443 | 445 | if(bios_mode & MP_ROM) |
| 444 | 446 | { |
| r1877 | r1878 | |
| 471 | 473 | static WRITE8_HANDLER ( bank_w ) |
| 472 | 474 | { |
| 473 | 475 | if(game_banksel == 0x142) // Genesis I/O |
| 474 | genesis_io_w((offset & 0x1f) / 2, data, 0xffff); | |
| 476 | genesis_io_w(machine, (offset & 0x1f) / 2, data, 0xffff); | |
| 475 | 477 | |
| 476 | 478 | if(offset <= 0x1fff && (bios_width & 0x08)) |
| 477 | 479 | ic37_ram[(0x2000 * (bios_bank & 0x03)) + offset] = data; |
| r1877 | r1878 | |
| 674 | 676 | MDRV_CPU_ADD_TAG("megaplay_bios", Z80, MASTER_CLOCK / 15) /* ?? */ |
| 675 | 677 | MDRV_CPU_PROGRAM_MAP(megaplay_bios_readmem, megaplay_bios_writemem) |
| 676 | 678 | MDRV_CPU_IO_MAP(megaplay_bios_readport,megaplay_bios_writeport) |
| 677 | MDRV_CPU_VBLANK_INT(megaplay_bios_irq, 262) | |
| 679 | MDRV_CPU_VBLANK_INT_HACK(megaplay_bios_irq, 262) | |
| 678 | 680 | |
| 679 | 681 | MDRV_INTERLEAVE(100) |
| 680 | 682 |
| r1877 | r1878 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | Games supported: |
| 8 | 8 | * Dead Eye |
| 9 | * 3-D Bowling | |
| 9 | 10 | * Gypsy Juggler |
| 10 | 11 | * Inferno |
| 11 | 12 | |
| r1877 | r1878 | |
| 87 | 88 | |
| 88 | 89 | 0c00..0c03 H/W input ports |
| 89 | 90 | ----------------------------------------------- |
| 90 | 0 R | |
| 91 | 0 R a | |
| 91 | 92 | D0-D7 8 different sounds ??? |
| 92 | 93 | |
| 93 | 94 | 1 R ??? |
| r1877 | r1878 | |
| 99 | 100 | D4-D7 volume bits 0 .. 3 (bit 4 is CPU #1 flag output) |
| 100 | 101 | 2 W D0-D7 preset for counter, clk is 5 MHz / 32 |
| 101 | 102 | 3 W D0 divide c02 counter by 0: 2, 1: 4 |
| 102 | D1 sound enable for c02 tone generator | |
| 103 | D2 sound enable for DAC | |
| 104 | D3 sound enable for c01 tone generator | |
| 103 | D1 audio enable for c02 tone generator | |
| 104 | D2 audio enable for DAC | |
| 105 | D3 audio enable for c01 tone generator | |
| 105 | 106 | |
| 106 | 107 | 0e00-0eff RAM |
| 107 | 108 | |
| r1877 | r1878 | |
| 132 | 133 | * |
| 133 | 134 | *************************************/ |
| 134 | 135 | |
| 135 | static UINT64 cycles_at_vsync; | |
| 136 | 136 | static UINT8 main_sense_state; |
| 137 | static UINT8 sound_sense_state; | |
| 138 | static UINT8 coin1_state; | |
| 139 | static UINT8 minferno_sense; | |
| 137 | static UINT8 audio_sense_state; | |
| 140 | 138 | |
| 141 | 139 | |
| 142 | 140 | |
| r1877 | r1878 | |
| 148 | 146 | |
| 149 | 147 | static READ8_HANDLER( hsync_chain_r ) |
| 150 | 148 | { |
| 151 | /* horizontal sync divider chain */ | |
| 152 | UINT8 val = (activecpu_gettotalcycles() - cycles_at_vsync) & 0xff; | |
| 149 | UINT8 val = video_screen_get_hpos(0); | |
| 153 | 150 | return BITSWAP8(val,0,1,2,3,4,5,6,7); |
| 154 | 151 | } |
| 155 | 152 | |
| 156 | 153 | |
| 157 | 154 | static READ8_HANDLER( vsync_chain_hi_r ) |
| 158 | 155 | { |
| 159 | /* vertical sync divider chain */ | |
| 160 | 156 | UINT8 val = video_screen_get_vpos(0); |
| 161 | 157 | return ((val >> 1) & 0x08) | ((val >> 3) & 0x04) | ((val >> 5) & 0x02) | (val >> 7); |
| 162 | 158 | } |
| r1877 | r1878 | |
| 164 | 160 | |
| 165 | 161 | static READ8_HANDLER( vsync_chain_lo_r ) |
| 166 | 162 | { |
| 167 | /* vertical sync divider chain */ | |
| 168 | 163 | UINT8 val = video_screen_get_vpos(0); |
| 169 | 164 | return val & 0x0f; |
| 170 | 165 | } |
| r1877 | r1878 | |
| 173 | 168 | |
| 174 | 169 | /************************************* |
| 175 | 170 | * |
| 176 | * | |
| 171 | * A | |
| 177 | 172 | * |
| 178 | 173 | *************************************/ |
| 179 | 174 | |
| 180 | static WRITE8_HANDLER( meadows_ | |
| 175 | static WRITE8_HANDLER( meadows_a | |
| 181 | 176 | { |
| 182 | 177 | switch (offset) |
| 183 | 178 | { |
| 184 | 179 | case 0: |
| 185 | 180 | if (meadows_0c00 == data) |
| 186 | 181 | break; |
| 187 | logerror("meadows_ | |
| 182 | logerror("meadows_a | |
| 188 | 183 | meadows_0c00 = data; |
| 189 | 184 | break; |
| 190 | 185 | |
| 191 | 186 | case 1: |
| 192 | logerror("meadows_ | |
| 187 | logerror("meadows_a | |
| 193 | 188 | break; |
| 194 | 189 | |
| 195 | 190 | case 2: |
| 196 | logerror("meadows_ | |
| 191 | logerror("meadows_a | |
| 197 | 192 | break; |
| 198 | 193 | |
| 199 | 194 | case 3: |
| r1877 | r1878 | |
| 206 | 201 | |
| 207 | 202 | /************************************* |
| 208 | 203 | * |
| 204 | * Coin handling | |
| 205 | * | |
| 206 | *************************************/ | |
| 207 | ||
| 208 | static INPUT_CHANGED( coin_inserted ) | |
| 209 | { | |
| 210 | cpunum_set_input_line_and_vector(machine, 0, 0, (newval ? ASSERT_LINE : CLEAR_LINE), 0x82); | |
| 211 | } | |
| 212 | ||
| 213 | ||
| 214 | ||
| 215 | /************************************* | |
| 216 | * | |
| 209 | 217 | * Main CPU interrupt |
| 210 | 218 | * |
| 211 | 219 | *************************************/ |
| 212 | 220 | |
| 213 | 221 | static INTERRUPT_GEN( meadows_interrupt ) |
| 214 | 222 | { |
| 215 | /* preserve the actual cycle count */ | |
| 216 | cycles_at_vsync = cpunum_gettotalcycles(0); | |
| 217 | ||
| 218 | 223 | /* fake something toggling the sense input line of the S2650 */ |
| 219 | 224 | main_sense_state ^= 1; |
| 220 | 225 | cpunum_set_input_line(machine, 0, 1, main_sense_state ? ASSERT_LINE : CLEAR_LINE); |
| 221 | ||
| 222 | /* check the fake coin input */ | |
| 223 | if (readinputport(3) & 0x01) | |
| 224 | { | |
| 225 | if (!coin1_state) | |
| 226 | { | |
| 227 | coin1_state = 1; | |
| 228 | cpunum_set_input_line_and_vector(machine, 0, 0, PULSE_LINE, 0x82); | |
| 229 | } | |
| 230 | } | |
| 231 | else | |
| 232 | coin1_state = 0; | |
| 233 | 226 | } |
| 234 | 227 | |
| 235 | 228 | |
| r1877 | r1878 | |
| 242 | 235 | |
| 243 | 236 | static INTERRUPT_GEN( minferno_interrupt ) |
| 244 | 237 | { |
| 245 | /* preserve the actual cycle count */ | |
| 246 | cycles_at_vsync = cpunum_gettotalcycles(0); | |
| 247 | minferno_sense++; | |
| 248 | cpunum_set_input_line(machine, 0, 1, (minferno_sense & 0x40) ? ASSERT_LINE : CLEAR_LINE ); | |
| 238 | main_sense_state++; | |
| 239 | cpunum_set_input_line(machine, 0, 1, (main_sense_state & 0x40) ? ASSERT_LINE : CLEAR_LINE ); | |
| 249 | 240 | } |
| 250 | 241 | |
| 251 | 242 | |
| 252 | 243 | |
| 253 | 244 | /************************************* |
| 254 | 245 | * |
| 255 | * | |
| 246 | * A | |
| 256 | 247 | * |
| 257 | 248 | *************************************/ |
| 258 | 249 | |
| 259 | static WRITE8_HANDLER( | |
| 250 | static WRITE8_HANDLER( a | |
| 260 | 251 | { |
| 261 | 252 | switch (offset & 3) |
| 262 | 253 | { |
| r1877 | r1878 | |
| 267 | 258 | case 1: /* counter clk 5 MHz / 256 */ |
| 268 | 259 | if (data == meadows_0c01) |
| 269 | 260 | break; |
| 270 | logerror(" | |
| 261 | logerror("a | |
| 271 | 262 | meadows_0c01 = data; |
| 272 | 263 | meadows_sh_update(); |
| 273 | 264 | break; |
| r1877 | r1878 | |
| 275 | 266 | case 2: /* counter clk 5 MHz / 32 (/ 2 or / 4) */ |
| 276 | 267 | if (data == meadows_0c02) |
| 277 | 268 | break; |
| 278 | logerror(" | |
| 269 | logerror("a | |
| 279 | 270 | meadows_0c02 = data; |
| 280 | 271 | meadows_sh_update(); |
| 281 | 272 | break; |
| 282 | 273 | |
| 283 | case 3: /* | |
| 274 | case 3: /* a | |
| 284 | 275 | if (data == meadows_0c03) |
| 285 | 276 | break; |
| 286 | logerror(" | |
| 277 | logerror("a | |
| 287 | 278 | meadows_0c03 = data; |
| 288 | 279 | meadows_sh_update(); |
| 289 | 280 | break; |
| r1877 | r1878 | |
| 294 | 285 | |
| 295 | 286 | /************************************* |
| 296 | 287 | * |
| 297 | * | |
| 288 | * A | |
| 298 | 289 | * |
| 299 | 290 | *************************************/ |
| 300 | 291 | |
| 301 | static READ8_HANDLER( | |
| 292 | static READ8_HANDLER( a | |
| 302 | 293 | { |
| 303 | 294 | int data = 0; |
| 304 | 295 | |
| r1877 | r1878 | |
| 319 | 310 | |
| 320 | 311 | /************************************* |
| 321 | 312 | * |
| 322 | * | |
| 313 | * A | |
| 323 | 314 | * |
| 324 | 315 | *************************************/ |
| 325 | 316 | |
| 326 | static INTERRUPT_GEN( | |
| 317 | static INTERRUPT_GEN( a | |
| 327 | 318 | { |
| 328 | 319 | /* fake something toggling the sense input line of the S2650 */ |
| 329 | sound_sense_state ^= 1; | |
| 330 | cpunum_set_input_line(machine, 1, 1, sound_sense_state ? ASSERT_LINE : CLEAR_LINE); | |
| 320 | audio_sense_state ^= 1; | |
| 321 | cpunum_set_input_line(machine, 1, 1, audio_sense_state ? ASSERT_LINE : CLEAR_LINE); | |
| 331 | 322 | } |
| 332 | 323 | |
| 333 | 324 | |
| r1877 | r1878 | |
| 340 | 331 | |
| 341 | 332 | static PALETTE_INIT( meadows ) |
| 342 | 333 | { |
| 343 | palette_set_color(machine,0,MAKE_RGB(0x00,0x00,0x00)); /* BLACK */ | |
| 344 | palette_set_color(machine,1,MAKE_RGB(0xff,0xff,0xff)); /* WHITE */ | |
| 334 | palette_set_color(machine, 0, RGB_BLACK); | |
| 335 | palette_set_color(machine, 1, RGB_WHITE); | |
| 345 | 336 | } |
| 346 | 337 | |
| 347 | 338 | |
| r1877 | r1878 | |
| 352 | 343 | * |
| 353 | 344 | *************************************/ |
| 354 | 345 | |
| 355 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 356 | AM_RANGE(0x0000, 0x0bff) AM_WRITE(MWA8_ROM) | |
| 357 | AM_RANGE(0x0c00, 0x0c03) AM_WRITE(meadows_sound_w) | |
| 358 | AM_RANGE(0x0d00, 0x0d0f) AM_WRITE(meadows_spriteram_w) AM_BASE(&spriteram) | |
| 359 | AM_RANGE(0x0e00, 0x0eff) AM_WRITE(MWA8_RAM) | |
| 360 | AM_RANGE(0x1000, 0x1bff) AM_WRITE(MWA8_ROM) | |
| 361 | AM_RANGE(0x1c00, 0x1fff) AM_WRITE(meadows_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 362 | ADDRESS_MAP_END | |
| 363 | ||
| 364 | ||
| 365 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 366 | AM_RANGE(0x0000, 0x0bff) AM_READ(MRA8_ROM) | |
| 346 | static ADDRESS_MAP_START( meadows_main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 347 | AM_RANGE(0x0000, 0x0bff) AM_ROM | |
| 367 | 348 | AM_RANGE(0x0c00, 0x0c00) AM_READ(input_port_0_r) |
| 368 | 349 | AM_RANGE(0x0c01, 0x0c01) AM_READ(input_port_1_r) |
| 369 | 350 | AM_RANGE(0x0c02, 0x0c02) AM_READ(hsync_chain_r) |
| 370 | 351 | AM_RANGE(0x0c03, 0x0c03) AM_READ(input_port_2_r) |
| 371 | AM_RANGE(0x0e00, 0x0eff) AM_READ(MRA8_RAM) | |
| 372 | AM_RANGE(0x1000, 0x1bff) AM_READ(MRA8_ROM) | |
| 373 | AM_RANGE(0x1c00, 0x1fff) AM_READ(MRA8_RAM) | |
| 352 | AM_RANGE(0x0c00, 0x0c03) AM_WRITE(meadows_audio_w) | |
| 353 | AM_RANGE(0x0d00, 0x0d0f) AM_WRITE(meadows_spriteram_w) AM_BASE(&spriteram) | |
| 354 | AM_RANGE(0x0e00, 0x0eff) AM_RAM | |
| 355 | AM_RANGE(0x1000, 0x1bff) AM_ROM | |
| 356 | AM_RANGE(0x1c00, 0x1fff) AM_READWRITE(MRA8_RAM, meadows_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 374 | 357 | ADDRESS_MAP_END |
| 375 | 358 | |
| 376 | 359 | |
| 377 | static ADDRESS_MAP_START( minferno_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 378 | AM_RANGE(0x0000, 0x0bff) AM_WRITE(MWA8_ROM) | |
| 379 | AM_RANGE(0x1c00, 0x1eff) AM_WRITE(meadows_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 380 | AM_RANGE(0x1f00, 0x1f03) AM_WRITE(meadows_sound_w) | |
| 381 | ADDRESS_MAP_END | |
| 382 | ||
| 383 | ||
| 384 | static ADDRESS_MAP_START( minferno_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 385 | AM_RANGE(0x0000, 0x0bff) AM_READ(MRA8_ROM) | |
| 386 | AM_RANGE(0x1c00, 0x1eff) AM_READ(MRA8_RAM) | |
| 360 | static ADDRESS_MAP_START( minferno_main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 361 | AM_RANGE(0x0000, 0x0bff) AM_ROM | |
| 362 | AM_RANGE(0x1c00, 0x1eff) AM_READWRITE(MRA8_RAM, meadows_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 387 | 363 | AM_RANGE(0x1f00, 0x1f00) AM_READ(input_port_0_r) |
| 388 | 364 | AM_RANGE(0x1f01, 0x1f01) AM_READ(input_port_1_r) |
| 389 | 365 | AM_RANGE(0x1f02, 0x1f02) AM_READ(input_port_2_r) |
| 390 | 366 | AM_RANGE(0x1f03, 0x1f03) AM_READ(input_port_3_r) |
| 367 | AM_RANGE(0x1f00, 0x1f03) AM_WRITE(meadows_audio_w) | |
| 391 | 368 | AM_RANGE(0x1f04, 0x1f04) AM_READ(vsync_chain_hi_r) |
| 392 | 369 | AM_RANGE(0x1f05, 0x1f05) AM_READ(vsync_chain_lo_r) |
| 393 | 370 | ADDRESS_MAP_END |
| 394 | 371 | |
| 395 | 372 | |
| 396 | static ADDRESS_MAP_START( minferno_ | |
| 373 | static ADDRESS_MAP_START( minferno_io_ma | |
| 397 | 374 | AM_RANGE(S2650_DATA_PORT, S2650_DATA_PORT) AM_READ(input_port_4_r) |
| 398 | 375 | ADDRESS_MAP_END |
| 399 | 376 | |
| r1877 | r1878 | |
| 401 | 378 | |
| 402 | 379 | /************************************* |
| 403 | 380 | * |
| 404 | * | |
| 381 | * A | |
| 405 | 382 | * |
| 406 | 383 | *************************************/ |
| 407 | 384 | |
| 408 | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 409 | AM_RANGE(0x0000, 0x0bff) AM_WRITE(MWA8_ROM) | |
| 410 | AM_RANGE(0x0c00, 0x0c03) AM_WRITE(sound_hardware_w) | |
| 411 | AM_RANGE(0x0e00, 0x0eff) AM_WRITE(MWA8_RAM) | |
| 385 | static ADDRESS_MAP_START( audio_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 386 | AM_RANGE(0x0000, 0x0bff) AM_ROM | |
| 387 | AM_RANGE(0x0c00, 0x0c03) AM_READWRITE(audio_hardware_r, audio_hardware_w) | |
| 388 | AM_RANGE(0x0e00, 0x0eff) AM_RAM | |
| 412 | 389 | ADDRESS_MAP_END |
| 413 | 390 | |
| 414 | 391 | |
| 415 | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 416 | AM_RANGE(0x0000, 0x0bff) AM_READ(MRA8_ROM) | |
| 417 | AM_RANGE(0x0c00, 0x0c03) AM_READ(sound_hardware_r) | |
| 418 | AM_RANGE(0x0e00, 0x0eff) AM_READ(MRA8_RAM) | |
| 419 | ADDRESS_MAP_END | |
| 420 | 392 | |
| 421 | 393 | |
| 422 | ||
| 423 | 394 | /************************************* |
| 424 | 395 | * |
| 425 | 396 | * Port definitions |
| r1877 | r1878 | |
| 465 | 436 | PORT_DIPSETTING( 0x00, DEF_STR( None )) |
| 466 | 437 | |
| 467 | 438 | PORT_START /* FAKE coinage */ |
| 468 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 439 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 469 | 440 | PORT_BIT( 0x8e, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 470 | 441 | INPUT_PORTS_END |
| 471 | 442 | |
| r1877 | r1878 | |
| 574 | 545 | |
| 575 | 546 | /************************************* |
| 576 | 547 | * |
| 577 | * | |
| 548 | * A | |
| 578 | 549 | * |
| 579 | 550 | *************************************/ |
| 580 | 551 | |
| 581 | static const struct Samplesinterface meadows_samples_interface = | |
| 582 | { | |
| 583 | 2, | |
| 584 | NULL, | |
| 585 | meadows_sh_start | |
| 586 | }; | |
| 587 | ||
| 588 | 552 | static const char *const bowl3d_sample_names[] = |
| 589 | 553 | { |
| 590 | 554 | "*bowl3d", |
| r1877 | r1878 | |
| 594 | 558 | "footstep.wav", /* "foot sweep" */ |
| 595 | 559 | "crash.wav", /* "crash" */ |
| 596 | 560 | "cheering.wav", /* "cheering" */ |
| 597 | 0 | |
| 561 | 0 | |
| 598 | 562 | }; |
| 599 | 563 | |
| 564 | ||
| 565 | static const struct Samplesinterface meadows_samples_interface = | |
| 566 | { | |
| 567 | 2, | |
| 568 | NULL, | |
| 569 | meadows_sh_start | |
| 570 | }; | |
| 571 | ||
| 572 | ||
| 600 | 573 | static const struct Samplesinterface bowl3d_samples_interface = |
| 601 | 574 | { |
| 602 | 1, | |
| 575 | 1, | |
| 603 | 576 | bowl3d_sample_names |
| 604 | 577 | }; |
| 605 | 578 | |
| 579 | ||
| 580 | ||
| 606 | 581 | /************************************* |
| 607 | 582 | * |
| 608 | 583 | * Machine drivers |
| r1877 | r1878 | |
| 613 | 588 | |
| 614 | 589 | /* basic machine hardware */ |
| 615 | 590 | MDRV_CPU_ADD(S2650, 5000000/8) /* 5MHz / 8 = 625 kHz */ |
| 616 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 617 | MDRV_CPU_VBLANK_INT(meadows_interrupt,1) /* one interrupt per frame!? */ | |
| 591 | MDRV_CPU_PROGRAM_MAP(meadows_main_map,0) | |
| 592 | MDRV_CPU_VBLANK_INT("main", meadows_interrupt) /* one interrupt per frame!? */ | |
| 618 | 593 | |
| 619 | 594 | MDRV_CPU_ADD(S2650, 5000000/8) |
| 620 | 595 | /* audio CPU */ /* 5MHz / 8 = 625 kHz */ |
| 621 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) | |
| 622 | MDRV_CPU_PERIODIC_INT(sound_interrupt, (double)5000000/131072) | |
| 596 | MDRV_CPU_PROGRAM_MAP(audio_map,0) | |
| 597 | MDRV_CPU_PERIODIC_INT(audio_interrupt, (double)5000000/131072) | |
| 623 | 598 | |
| 624 | 599 | MDRV_INTERLEAVE(10) |
| 625 | 600 | |
| r1877 | r1878 | |
| 637 | 612 | MDRV_VIDEO_START(meadows) |
| 638 | 613 | MDRV_VIDEO_UPDATE(meadows) |
| 639 | 614 | |
| 640 | /* | |
| 615 | /* a | |
| 641 | 616 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 642 | 617 | |
| 643 | 618 | MDRV_SOUND_ADD(DAC, 0) |
| r1877 | r1878 | |
| 653 | 628 | |
| 654 | 629 | /* basic machine hardware */ |
| 655 | 630 | MDRV_CPU_ADD(S2650, 5000000/8/3) /* 5MHz / 8 = 625 kHz */ |
| 656 | MDRV_CPU_PROGRAM_MAP(minferno_readmem,minferno_writemem) | |
| 657 | MDRV_CPU_IO_MAP(minferno_readport,0) | |
| 658 | MDRV_CPU_VBLANK_INT(minferno_interrupt,1) | |
| 631 | MDRV_CPU_PROGRAM_MAP(minferno_main_map,0) | |
| 632 | MDRV_CPU_IO_MAP(minferno_io_map,0) | |
| 633 | MDRV_CPU_VBLANK_INT("main", minferno_interrupt) | |
| 659 | 634 | |
| 660 | 635 | /* video hardware */ |
| 661 | 636 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 671 | 646 | MDRV_VIDEO_START(meadows) |
| 672 | 647 | MDRV_VIDEO_UPDATE(meadows) |
| 673 | 648 | |
| 674 | /* | |
| 649 | /* a | |
| 675 | 650 | MACHINE_DRIVER_END |
| 676 | 651 | |
| 677 | 652 | |
| r1877 | r1878 | |
| 679 | 654 | /* basic machine hardware */ |
| 680 | 655 | MDRV_IMPORT_FROM(meadows) |
| 681 | 656 | |
| 682 | /* | |
| 657 | /* audio hardware */ | |
| 683 | 658 | MDRV_SOUND_ADD(SAMPLES, 0) |
| 684 | 659 | MDRV_SOUND_CONFIG(bowl3d_samples_interface) |
| 685 | 660 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 686 | 661 | MACHINE_DRIVER_END |
| 687 | 662 | |
| 688 | 663 | |
| 664 | ||
| 689 | 665 | /************************************* |
| 690 | 666 | * |
| 691 | 667 | * ROM definitions |
| r1877 | r1878 | |
| 715 | 691 | ROM_REGION( 0x0400, REGION_GFX5, ROMREGION_DISPOSE ) |
| 716 | 692 | /* empty */ |
| 717 | 693 | |
| 718 | ROM_REGION( 0x08000, REGION_CPU2, 0 ) | |
| 694 | ROM_REGION( 0x08000, REGION_CPU2, 0 ) | |
| 719 | 695 | ROM_LOAD( "de_snd", 0x0000, 0x0400, CRC(c10a1b1a) SHA1(779ea261d23360634081295a164cacbd819d8719) ) |
| 720 | 696 | ROM_END |
| 721 | 697 | |
| 698 | ||
| 722 | 699 | ROM_START( bowl3d ) |
| 723 | 700 | ROM_REGION( 0x08000, REGION_CPU1, 0 ) |
| 724 | 701 | ROM_LOAD( "b3d.h8", 0x0000, 0x0400, CRC(be38feeb) SHA1(feab3c61ce1e351c02f6ffa7f7f2ac90e62e7719) ) |
| r1877 | r1878 | |
| 770 | 747 | /* empty (copied from 2) */ |
| 771 | 748 | |
| 772 | 749 | ROM_REGION( 0x0400, REGION_GFX4, ROMREGION_DISPOSE ) |
| 773 | | |
| 750 | ROM_LOAD( "gj.x", | |
| 774 | 751 | |
| 775 | 752 | ROM_REGION( 0x0400, REGION_GFX5, ROMREGION_DISPOSE ) |
| 776 | | |
| 753 | ROM_LOAD( "gj.y", | |
| 777 | 754 | |
| 778 | ROM_REGION( 0x08000, REGION_CPU2, 0 ) | |
| 755 | ROM_REGION( 0x08000, REGION_CPU2, 0 ) | |
| 779 | 756 | ROM_LOAD( "gj.a4s", 0x0000, 0x0400, CRC(17a116bc) SHA1(797ba0b292afa3ba7eec985b533014acc00ed47d) ) |
| 780 | 757 | ROM_LOAD( "gj.a5s", 0x0400, 0x0400, CRC(fc23ae09) SHA1(42be34a9ef8c4c8ef9f94c85ca031076f84faa96) ) |
| 781 | 758 | ROM_LOAD( "gj.a6s", 0x0800, 0x0400, CRC(9e7bd71e) SHA1(e00801820c1a39cbfed124a29470da03cf8b40b4) ) |
| r1877 | r1878 | |
| 831 | 808 | int i, length; |
| 832 | 809 | UINT8 *mem; |
| 833 | 810 | |
| 834 | /* | |
| 811 | /* create an inverted copy of the graphics data */ | |
| 835 | 812 | mem = memory_region(REGION_GFX1); |
| 836 | 813 | length = memory_region_length(REGION_GFX1); |
| 837 | 814 | for (i = 0; i < length/2; i++) |
| r1877 | r1878 | |
| 847 | 824 | *************************************/ |
| 848 | 825 | |
| 849 | 826 | GAMEL( 1978, deadeye, 0, meadows, meadows, 0, ROT0, "Meadows", "Dead Eye", 0, layout_deadeye ) |
| 850 | GAME( 1978, bowl3d, 0, bowl3d, meadows, 0, ROT90, "Meadows", "Bowling 3D", GAME_NOT_WORKING ) | |
| 851 | GAMEL( 1978, gypsyjug, 0, meadows, meadows, gypsyjug, ROT0, "Meadows", "Gypsy Juggler", 0, layout_gypsyjug ) | |
| 852 | GAME ( 1978, minferno, 0, minferno, minferno, minferno, ROT0, "Meadows", "Inferno (S2650)", GAME_NO_SOUND ) | |
| 827 | GAME ( 1978, bowl3d, 0, bowl3d, meadows, 0, ROT90, "Meadows", "3-D Bowling", GAME_NOT_WORKING ) | |
| 828 | GAMEL( 1978, gypsyjug, 0, meadows, meadows, gypsyjug, ROT0, "Meadows", "Gypsy Juggler", GAME_IMPERFECT_GRAPHICS, layout_gypsyjug ) | |
| 829 | GAME ( 1978, minferno, 0, minferno, minferno, minferno, ROT0, "Meadows", "Inferno (Meadows)", GAME_NO_SOUND ) |
| r1877 | r1878 | |
|---|---|---|
| 68 | 68 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 69 | 69 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 70 | 70 | MDRV_CPU_IO_MAP(readport,writeport) |
| 71 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 71 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 72 | 72 | |
| 73 | 73 | /* video hardware */ |
| 74 | 74 | MDRV_VIDEO_UPDATE(dotrikun) |
| r1877 | r1878 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "deprecat.h" | |
| 12 | 13 | #include "cpu/m6502/m6502.h" |
| 13 | 14 | #include "sound/ay8910.h" |
| 14 | 15 | extern UINT8 *bogeyman_videoram2, *bogeyman_colorram2; |
| r1877 | r1878 | |
| 46 | 47 | { |
| 47 | 48 | // bit 4 goes to the 8910 #0 BC1 pin |
| 48 | 49 | if (last & 0x10) |
| 49 | AY8910_control_port_0_w(0,psg_latch); | |
| 50 | AY8910_control_port_0_w(machine,0,psg_latch); | |
| 50 | 51 | else |
| 51 | AY8910_write_port_0_w(0,psg_latch); | |
| 52 | AY8910_write_port_0_w(machine,0,psg_latch); | |
| 52 | 53 | } |
| 53 | 54 | |
| 54 | 55 | // bit 7 goes to 8910 #1 BDIR pin |
| r1877 | r1878 | |
| 56 | 57 | { |
| 57 | 58 | // bit 6 goes to the 8910 #1 BC1 pin |
| 58 | 59 | if (last & 0x40) |
| 59 | AY8910_control_port_1_w(0,psg_latch); | |
| 60 | AY8910_control_port_1_w(machine,0,psg_latch); | |
| 60 | 61 | else |
| 61 | AY8910_write_port_1_w(0,psg_latch); | |
| 62 | AY8910_write_port_1_w(machine,0,psg_latch); | |
| 62 | 63 | } |
| 63 | 64 | |
| 64 | 65 | last = data; |
| r1877 | r1878 | |
| 227 | 228 | // basic machine hardware |
| 228 | 229 | MDRV_CPU_ADD(M6502, 2000000) // 12 MHz clock on board |
| 229 | 230 | MDRV_CPU_PROGRAM_MAP(bogeyman_map, 0) |
| 230 | MDRV_CPU_VBLANK_INT(irq0_line_hold, 16) // Controls sound | |
| 231 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 16) // Controls sound | |
| 231 | 232 | |
| 232 | 233 | // video hardware |
| 233 | 234 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| r1877 | r1878 | |
|---|---|---|
| 963 | 963 | /* basic machine hardware */ |
| 964 | 964 | MDRV_CPU_ADD_TAG("main", M68010, 32000000/4) |
| 965 | 965 | MDRV_CPU_PROGRAM_MAP(driver_68k_map,0) |
| 966 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 966 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 967 | 967 | MDRV_CPU_PERIODIC_INT(hd68k_irq_gen, (double)32000000/16/16/16/16/2) |
| 968 | 968 | |
| 969 | 969 | MDRV_CPU_ADD_TAG("gsp", TMS34010, 48000000) |
| r1877 | r1878 | |
|---|---|---|
| 1076 | 1076 | /* basic machine hardware */ |
| 1077 | 1077 | MDRV_CPU_ADD(M68000,16000000/2) /* 8.00 MHz */ |
| 1078 | 1078 | MDRV_CPU_PROGRAM_MAP(srmp2_readmem,srmp2_writemem) |
| 1079 | MDRV_CPU_VBLANK_INT(srmp2_interrupt,16) /* Interrupt times is not understood */ | |
| 1079 | MDRV_CPU_VBLANK_INT_HACK(srmp2_interrupt,16) /* Interrupt times is not understood */ | |
| 1080 | 1080 | |
| 1081 | 1081 | MDRV_MACHINE_RESET(srmp2) |
| 1082 | 1082 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r1877 | r1878 | |
| 1116 | 1116 | // 4000000, /* 4.00 MHz ? */ |
| 1117 | 1117 | MDRV_CPU_PROGRAM_MAP(srmp3_readmem,srmp3_writemem) |
| 1118 | 1118 | MDRV_CPU_IO_MAP(srmp3_readport,srmp3_writeport) |
| 1119 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1119 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1120 | 1120 | |
| 1121 | 1121 | MDRV_MACHINE_RESET(srmp3) |
| 1122 | 1122 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r1877 | r1878 | |
| 1153 | 1153 | /* basic machine hardware */ |
| 1154 | 1154 | MDRV_CPU_ADD(M68000,16000000/2) /* 8.00 MHz */ |
| 1155 | 1155 | MDRV_CPU_PROGRAM_MAP(mjyuugi_readmem,mjyuugi_writemem) |
| 1156 | MDRV_CPU_VBLANK_INT(srmp2_interrupt,16) /* Interrupt times is not understood */ | |
| 1156 | MDRV_CPU_VBLANK_INT_HACK(srmp2_interrupt,16) /* Interrupt times is not understood */ | |
| 1157 | 1157 | |
| 1158 | 1158 | MDRV_MACHINE_RESET(srmp2) |
| 1159 | 1159 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r1877 | r1878 | |
|---|---|---|
| 71 | 71 | ***************************************************************************/ |
| 72 | 72 | |
| 73 | 73 | #include "driver.h" |
| 74 | #include "deprecat.h" | |
| 74 | 75 | #include "machine/irem_cpu.h" |
| 75 | 76 | #include "audio/m72.h" |
| 76 | 77 | #include "sound/dac.h" |
| r1877 | r1878 | |
| 185 | 186 | |
| 186 | 187 | static INTERRUPT_GEN(fake_nmi) |
| 187 | 188 | { |
| 188 | int sample = m72_sample_r(0); | |
| 189 | int sample = m72_sample_r(machine,0); | |
| 189 | 190 | if (sample) |
| 190 | m72_sample_w(0,sample); | |
| 191 | m72_sample_w(machine,0,sample); | |
| 191 | 192 | } |
| 192 | 193 | |
| 193 | 194 | |
| r1877 | r1878 | |
| 1993 | 1994 | MDRV_CPU_ADD_TAG("sound",Z80, SOUND_CLOCK) |
| 1994 | 1995 | MDRV_CPU_PROGRAM_MAP(sound_ram_map,0) |
| 1995 | 1996 | MDRV_CPU_IO_MAP(sound_portmap,0) |
| 1996 | MDRV_CPU_VBLANK_INT(fake_nmi,128) /* clocked by V1? (Vigilante) */ | |
| 1997 | MDRV_CPU_VBLANK_INT_HACK(fake_nmi,128) /* clocked by V1? (Vigilante) */ | |
| 1997 | 1998 | /* IRQs are generated by main Z80 and YM2151 */ |
| 1998 | 1999 | |
| 1999 | 2000 | MDRV_MACHINE_START(m72) |
| r1877 | r1878 | |
| 2029 | 2030 | MDRV_CPU_ADD_TAG("mcu",I8751, 8000000) |
| 2030 | 2031 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 2031 | 2032 | MDRV_CPU_DATA_MAP(mcu_data_map,0) |
| 2032 | MDRV_CPU_VBLANK_INT(irq0_line_pulse | |
| 2033 | MDRV_CPU_VBLANK_INT("main", irq0_line_pulse | |
| 2033 | 2034 | MACHINE_DRIVER_END |
| 2034 | 2035 | |
| 2035 | 2036 | |
| r1877 | r1878 | |
| 2043 | 2044 | MDRV_CPU_ADD_TAG("sound",Z80, SOUND_CLOCK) |
| 2044 | 2045 | MDRV_CPU_PROGRAM_MAP(sound_ram_map,0) |
| 2045 | 2046 | MDRV_CPU_IO_MAP(sound_portmap,0) |
| 2046 | MDRV_CPU_VBLANK_INT(fake_nmi,128) /* clocked by V1? (Vigilante) */ | |
| 2047 | MDRV_CPU_VBLANK_INT_HACK(fake_nmi,128) /* clocked by V1? (Vigilante) */ | |
| 2047 | 2048 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2048 | 2049 | |
| 2049 | 2050 | MDRV_MACHINE_START(m72) |
| r1877 | r1878 | |
| 2084 | 2085 | MDRV_CPU_ADD_TAG("sound",Z80, SOUND_CLOCK) |
| 2085 | 2086 | MDRV_CPU_PROGRAM_MAP(sound_ram_map,0) |
| 2086 | 2087 | MDRV_CPU_IO_MAP(sound_portmap,0) |
| 2087 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 2088 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 2088 | 2089 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2089 | 2090 | |
| 2090 | 2091 | MDRV_MACHINE_START(m72) |
| r1877 | r1878 | |
| 2125 | 2126 | MDRV_CPU_ADD_TAG("sound",Z80, SOUND_CLOCK) |
| 2126 | 2127 | MDRV_CPU_PROGRAM_MAP(sound_rom_map,0) |
| 2127 | 2128 | MDRV_CPU_IO_MAP(rtype2_sound_portmap,0) |
| 2128 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 2129 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 2129 | 2130 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2130 | 2131 | |
| 2131 | 2132 | MDRV_MACHINE_START(m72) |
| r1877 | r1878 | |
| 2165 | 2166 | MDRV_CPU_ADD_TAG("sound", Z80, SOUND_CLOCK) |
| 2166 | 2167 | MDRV_CPU_PROGRAM_MAP(sound_ram_map,0) |
| 2167 | 2168 | MDRV_CPU_IO_MAP(sound_portmap,0) |
| 2168 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 2169 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 2169 | 2170 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2170 | 2171 | |
| 2171 | 2172 | MDRV_MACHINE_START(m72) |
| r1877 | r1878 | |
| 2206 | 2207 | MDRV_CPU_ADD_TAG("sound", Z80, SOUND_CLOCK) |
| 2207 | 2208 | MDRV_CPU_PROGRAM_MAP(sound_rom_map,0) |
| 2208 | 2209 | MDRV_CPU_IO_MAP(rtype2_sound_portmap,0) |
| 2209 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 2210 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 2210 | 2211 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2211 | 2212 | |
| 2212 | 2213 | MDRV_MACHINE_START(m72) |
| r1877 | r1878 | |
| 2246 | 2247 | MDRV_CPU_ADD_TAG("sound", Z80, SOUND_CLOCK) |
| 2247 | 2248 | MDRV_CPU_PROGRAM_MAP(sound_rom_map,0) |
| 2248 | 2249 | MDRV_CPU_IO_MAP(rtype2_sound_portmap,0) |
| 2249 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 2250 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 2250 | 2251 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2251 | 2252 | |
| 2252 | 2253 | MDRV_MACHINE_START(m72) |
| r1877 | r1878 | |
| 2286 | 2287 | MDRV_CPU_ADD_TAG("sound", Z80, SOUND_CLOCK) |
| 2287 | 2288 | MDRV_CPU_PROGRAM_MAP(sound_rom_map,0) |
| 2288 | 2289 | MDRV_CPU_IO_MAP(rtype2_sound_portmap,0) |
| 2289 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 2290 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 2290 | 2291 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2291 | 2292 | |
| 2292 | 2293 | MDRV_MACHINE_START(m72) |
| r1877 | r1878 | |
| 2327 | 2328 | MDRV_CPU_ADD_TAG("sound", Z80, SOUND_CLOCK) |
| 2328 | 2329 | MDRV_CPU_PROGRAM_MAP(sound_rom_map,0) |
| 2329 | 2330 | MDRV_CPU_IO_MAP(rtype2_sound_portmap,0) |
| 2330 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 2331 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 2331 | 2332 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2332 | 2333 | |
| 2333 | 2334 | MDRV_MACHINE_START(m72) |
| r1877 | r1878 | |
| 2368 | 2369 | MDRV_CPU_ADD_TAG("sound", Z80, SOUND_CLOCK) |
| 2369 | 2370 | MDRV_CPU_PROGRAM_MAP(sound_rom_map,0) |
| 2370 | 2371 | MDRV_CPU_IO_MAP(poundfor_sound_portmap,0) |
| 2371 | MDRV_CPU_VBLANK_INT(fake_nmi,128) /* clocked by V1? (Vigilante) */ | |
| 2372 | MDRV_CPU_VBLANK_INT_HACK(fake_nmi,128) /* clocked by V1? (Vigilante) */ | |
| 2372 | 2373 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2373 | 2374 | |
| 2374 | 2375 | MDRV_MACHINE_START(m72) |
| r1877 | r1878 | |
| 2408 | 2409 | MDRV_CPU_ADD_TAG("sound", Z80, SOUND_CLOCK) |
| 2409 | 2410 | MDRV_CPU_PROGRAM_MAP(sound_rom_map,0) |
| 2410 | 2411 | MDRV_CPU_IO_MAP(rtype2_sound_portmap,0) |
| 2411 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 2412 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 2412 | 2413 | /* IRQs are generated by main Z80 and YM2151 */ |
| 2413 | 2414 | |
| 2414 | 2415 | MDRV_MACHINE_START(m72) |
| r1877 | r1878 | |
|---|---|---|
| 91 | 91 | |
| 92 | 92 | static READ8_HANDLER( audio_command_r ) |
| 93 | 93 | { |
| 94 | UINT8 ret = soundlatch_r(0); | |
| 94 | UINT8 ret = soundlatch_r(machine, 0); | |
| 95 | 95 | |
| 96 | 96 | if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Command Read: %x\n", safe_activecpu_get_pc(), ret); |
| 97 | 97 | |
| r1877 | r1878 | |
| 101 | 101 | |
| 102 | 102 | static WRITE8_HANDLER( audio_command_w ) |
| 103 | 103 | { |
| 104 | soundlatch_w(0, ~data); | |
| 105 | cpunum_set_input_line(Machine, 1, M6802_IRQ_LINE, HOLD_LINE); | |
| 104 | soundlatch_w(machine, 0, ~data); | |
| 105 | cpunum_set_input_line(machine, 1, M6802_IRQ_LINE, HOLD_LINE); | |
| 106 | 106 | |
| 107 | 107 | if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Command Write: %x\n", safe_activecpu_get_pc(), data^0xff); |
| 108 | 108 | } |
| r1877 | r1878 | |
| 110 | 110 | |
| 111 | 111 | static READ8_HANDLER( audio_answer_r ) |
| 112 | 112 | { |
| 113 | UINT8 ret = soundlatch2_r(0); | |
| 113 | UINT8 ret = soundlatch2_r(machine, 0); | |
| 114 | 114 | if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Answer Read: %x\n", safe_activecpu_get_pc(), ret); |
| 115 | 115 | |
| 116 | 116 | return ret; |
| r1877 | r1878 | |
| 123 | 123 | if (safe_activecpu_get_pc() == 0xfb12) |
| 124 | 124 | data = 0x00; |
| 125 | 125 | |
| 126 | soundlatch2_w(0, data); | |
| 127 | cpunum_set_input_line(Machine, 0, M6809_IRQ_LINE, HOLD_LINE); | |
| 126 | soundlatch2_w(machine, 0, data); | |
| 127 | cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, HOLD_LINE); | |
| 128 | 128 | |
| 129 | 129 | if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Answer Write: %x\n", safe_activecpu_get_pc(), data); |
| 130 | 130 | } |
| r1877 | r1878 | |
| 151 | 151 | |
| 152 | 152 | if (AY8910_selected & 0x08) |
| 153 | 153 | { |
| 154 | ret = AY8910_read_port_0_r(offset); | |
| 154 | ret = AY8910_read_port_0_r(machine, offset); | |
| 155 | 155 | if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #0 Port Read: %x\n", safe_activecpu_get_pc(), ret);} |
| 156 | 156 | |
| 157 | 157 | if (AY8910_selected & 0x10) |
| 158 | 158 | { |
| 159 | ret = AY8910_read_port_1_r(offset); | |
| 159 | ret = AY8910_read_port_1_r(machine, offset); | |
| 160 | 160 | if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #1 Port Read: %x\n", safe_activecpu_get_pc(), ret);} |
| 161 | 161 | |
| 162 | 162 | return ret; |
| r1877 | r1878 | |
| 169 | 169 | { |
| 170 | 170 | if (AY8910_selected & 0x08) |
| 171 | 171 | {if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #0 Control Write: %x\n", safe_activecpu_get_pc(), data); |
| 172 | AY8910_control_port_0_w(offset, data); | |
| 172 | AY8910_control_port_0_w(machine, offset, data); | |
| 173 | 173 | } |
| 174 | 174 | if (AY8910_selected & 0x10) |
| 175 | 175 | {if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #1 Control Write: %x\n", safe_activecpu_get_pc(), data); |
| 176 | AY8910_control_port_1_w(offset, data); | |
| 176 | AY8910_control_port_1_w(machine, offset, data); | |
| 177 | 177 | } |
| 178 | 178 | } |
| 179 | 179 | else |
| 180 | 180 | { |
| 181 | 181 | if (AY8910_selected & 0x08) |
| 182 | 182 | {if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #0 Port Write: %x\n", safe_activecpu_get_pc(), data); |
| 183 | AY8910_write_port_0_w(offset, data); | |
| 183 | AY8910_write_port_0_w(machine, offset, data); | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | if (AY8910_selected & 0x10) |
| 187 | 187 | {if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #1 Port Write: %x\n", safe_activecpu_get_pc(), data); |
| 188 | AY8910_write_port_1_w(offset, data); | |
| 188 | AY8910_write_port_1_w(machine, offset, data); | |
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | } |
| r1877 | r1878 | |
| 220 | 220 | |
| 221 | 221 | static void ttl74123_output_changed(int output) |
| 222 | 222 | { |
| 223 | pia_0_ca1_w(0, output); | |
| 223 | pia_0_ca1_w(Machine, 0, output); | |
| 224 | 224 | ttl74123_output = output; |
| 225 | 225 | } |
| 226 | 226 | |
| r1877 | r1878 | |
| 304 | 304 | #define NUM_PENS (8) |
| 305 | 305 | |
| 306 | 306 | |
| 307 | static WRITE8_HANDLER( r2dtank_mc6845_address_w ) | |
| 308 | { | |
| 309 | mc6845_address_w(mc6845, data); | |
| 310 | } | |
| 311 | ||
| 312 | ||
| 313 | static WRITE8_HANDLER( r2dtank_mc6845_register_w ) | |
| 314 | { | |
| 315 | mc6845_register_w(mc6845, data); | |
| 316 | } | |
| 317 | ||
| 318 | ||
| 319 | 307 | static WRITE8_HANDLER( flipscreen_w ) |
| 320 | 308 | { |
| 321 | 309 | flipscreen = !data; |
| 322 | 310 | } |
| 323 | 311 | |
| 324 | 312 | |
| 325 | static | |
| 313 | static MC6845_BEGIN_UPDATE( | |
| 326 | 314 | { |
| 327 | 315 | /* create the pens */ |
| 328 | 316 | offs_t i; |
| r1877 | r1878 | |
| 337 | 325 | } |
| 338 | 326 | |
| 339 | 327 | |
| 340 | static void update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect, | |
| 341 | UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) | |
| 328 | static MC6845_UPDATE_ROW( update_row ) | |
| 342 | 329 | { |
| 343 | 330 | UINT8 cx; |
| 344 | 331 | |
| r1877 | r1878 | |
| 387 | 374 | } |
| 388 | 375 | |
| 389 | 376 | |
| 390 | static | |
| 377 | static MC6845_ON_DE_CHANGED( display_enable_changed | |
| 391 | 378 | { |
| 392 | 379 | TTL74123_A_w(0, display_enabled); |
| 393 | 380 | } |
| r1877 | r1878 | |
| 401 | 388 | begin_update, /* before pixel update callback */ |
| 402 | 389 | update_row, /* row update callback */ |
| 403 | 390 | 0, /* after pixel update callback */ |
| 404 | display_enable_changed /* call back for display state changes */ | |
| 391 | display_enable_changed, /* callback for display state changes */ | |
| 392 | NULL, /* HSYNC callback */ | |
| 393 | NULL /* VSYNC callback */ | |
| 405 | 394 | }; |
| 406 | 395 | |
| 407 | 396 | |
| r1877 | r1878 | |
| 428 | 417 | |
| 429 | 418 | static WRITE8_HANDLER( pia_comp_0_w ) |
| 430 | 419 | { |
| 431 | pia_0_w(offset, ~data); | |
| 420 | pia_0_w(machine, offset, ~data); | |
| 432 | 421 | } |
| 433 | 422 | |
| 434 | 423 | |
| r1877 | r1878 | |
| 439 | 428 | AM_RANGE(0x6000, 0x7fff) AM_RAM |
| 440 | 429 | AM_RANGE(0x8000, 0x8003) AM_READWRITE(pia_0_r, pia_comp_0_w) |
| 441 | 430 | AM_RANGE(0x8004, 0x8004) AM_READWRITE(audio_answer_r, audio_command_w) |
| 442 | AM_RANGE(0xb000, 0xb000) AM_WRITE(r2dtank_mc6845_address_w) | |
| 443 | AM_RANGE(0xb001, 0xb001) AM_WRITE(r2dtank_mc6845_register_w) | |
| 431 | AM_RANGE(0xb000, 0xb000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 432 | AM_RANGE(0xb001, 0xb001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 444 | 433 | AM_RANGE(0xc000, 0xc007) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 445 | 434 | AM_RANGE(0xc800, 0xffff) AM_ROM |
| 446 | 435 | ADDRESS_MAP_END |
| r1877 | r1878 | |
|---|---|---|
| 332 | 332 | /* basic machine hardware */ |
| 333 | 333 | MDRV_CPU_ADD(M68000, 12000000) |
| 334 | 334 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 335 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 335 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 336 | 336 | |
| 337 | 337 | MDRV_MACHINE_RESET(ohmygod) |
| 338 | 338 | MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_SEC(3)) /* a guess, and certainly wrong */ |
| r1877 | r1878 | |
|---|---|---|
| 94 | 94 | |
| 95 | 95 | static WRITE8_HANDLER( pokechmp_sound_w ) |
| 96 | 96 | { |
| 97 | soundlatch_w(0,data); | |
| 98 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 97 | soundlatch_w(machine,0,data); | |
| 98 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
| r1877 | r1878 | |
| 249 | 249 | /* basic machine hardware */ |
| 250 | 250 | MDRV_CPU_ADD(M6502, 4000000) |
| 251 | 251 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 252 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 252 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 253 | 253 | |
| 254 | 254 | MDRV_CPU_ADD(M6502, 4000000) |
| 255 | 255 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 256 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 256 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 257 | 257 | |
| 258 | 258 | /* video hardware */ |
| 259 | 259 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 127 | 127 | |
| 128 | 128 | static WRITE16_HANDLER( sound_w ) |
| 129 | 129 | { |
| 130 | soundlatch_w(0,(data>>8)&0xff); | |
| 131 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 130 | soundlatch_w(machine,0,(data>>8)&0xff); | |
| 131 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | /*******************************************************************************/ |
| r1877 | r1878 | |
| 700 | 700 | /* basic machine hardware */ |
| 701 | 701 | MDRV_CPU_ADD(M68000, 10000000) /* Accurate */ |
| 702 | 702 | MDRV_CPU_PROGRAM_MAP(searchar_readmem,searchar_writemem) |
| 703 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 703 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 704 | 704 | |
| 705 | 705 | MDRV_CPU_ADD(Z80, 4000000) |
| 706 | 706 | /* audio CPU */ /* Accurate */ |
| r1877 | r1878 | |
| 739 | 739 | /* basic machine hardware */ |
| 740 | 740 | MDRV_CPU_ADD(M68000, 10000000) /* Accurate */ |
| 741 | 741 | MDRV_CPU_PROGRAM_MAP(pow_readmem,pow_writemem) |
| 742 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 742 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 743 | 743 | |
| 744 | 744 | MDRV_CPU_ADD(Z80, 4000000) |
| 745 | 745 | /* audio CPU */ /* Accurate */ |
| r1877 | r1878 | |
| 778 | 778 | /* basic machine hardware */ |
| 779 | 779 | MDRV_CPU_ADD(M68000, XTAL_18MHz/2) /* verified on pcb */ |
| 780 | 780 | MDRV_CPU_PROGRAM_MAP(searchar_readmem,searchar_writemem) |
| 781 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 781 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 782 | 782 | |
| 783 | 783 | MDRV_CPU_ADD(Z80, XTAL_8MHz/2) /* verified on pcb */ |
| 784 | 784 | /* audio CPU */ |
| r1877 | r1878 | |
| 817 | 817 | /* basic machine hardware */ |
| 818 | 818 | MDRV_CPU_ADD(M68000, 10000000) /* Accurate */ |
| 819 | 819 | MDRV_CPU_PROGRAM_MAP(pow_readmem,pow_writemem) |
| 820 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 820 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 821 | 821 | |
| 822 | 822 | MDRV_CPU_ADD(Z80, 4000000) |
| 823 | 823 | /* audio CPU */ /* Accurate */ |
| r1877 | r1878 | |
|---|---|---|
| 9 | 9 | #include "driver.h" |
| 10 | 10 | #include "deprecat.h" |
| 11 | 11 | #include "sound/ay8910.h" |
| 12 | #include "video/mc6845.h" | |
| 12 | 13 | #include "madalien.h" |
| 13 | 14 | |
| 14 | 15 | |
| r1877 | r1878 | |
| 19 | 20 | static UINT8 *shift_lo; |
| 20 | 21 | |
| 21 | 22 | |
| 22 | static IN | |
| 23 | static IN | |
| 23 | 24 | { |
| 24 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, | |
| 25 | (readinputportbytag("PLAYER2") & 0x80) ? CLEAR_LINE : ASSERT_LINE); | |
| 25 | /* coin insertion causes an NMI */ | |
| 26 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); | |
| 26 | 27 | } |
| 27 | 28 | |
| 28 | 29 | |
| r1877 | r1878 | |
| 57 | 58 | |
| 58 | 59 | static WRITE8_HANDLER( madalien_sound_command_w ) |
| 59 | 60 | { |
| 60 | cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE); | |
| 61 | ||
| 62 | soundlatch_w(offset, data); | |
| 61 | cpunum_set_input_line(machine, 1, 0, ASSERT_LINE); | |
| 62 | soundlatch_w(machine, offset, data); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
| 66 | 66 | static READ8_HANDLER(madalien_sound_command_r ) |
| 67 | 67 | { |
| 68 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 69 | ||
| 70 | return soundlatch_r(offset); | |
| 68 | cpunum_set_input_line(machine, 1, 0, CLEAR_LINE); | |
| 69 | return soundlatch_r(machine, offset); | |
| 71 | 70 | } |
| 72 | 71 | |
| 73 | 72 | |
| r1877 | r1878 | |
| 88 | 87 | AM_RANGE(0x6400, 0x67ff) AM_RAM |
| 89 | 88 | AM_RANGE(0x6800, 0x7fff) AM_RAM AM_BASE(&madalien_charram) |
| 90 | 89 | |
| 91 | AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0ff0) AM_WRITE(madalien_mc6845_address_w) | |
| 92 | AM_RANGE(0x8001, 0x8001) AM_MIRROR(0x0ff0) AM_READWRITE(madalien_mc6845_register_r, madalien_mc6845_register_w) | |
| 90 | AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0ff0) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 91 | AM_RANGE(0x8001, 0x8001) AM_MIRROR(0x0ff0) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 93 | 92 | AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x0ff0) AM_WRITE(MWA8_RAM) AM_BASE(&madalien_video_control) |
| 94 | 93 | AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x0ff0) AM_WRITE(madalien_output_w) |
| 95 | 94 | AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x0ff0) AM_READWRITE(soundlatch2_r, madalien_sound_command_w) |
| r1877 | r1878 | |
| 109 | 108 | ADDRESS_MAP_END |
| 110 | 109 | |
| 111 | 110 | |
| 112 | static ADDRESS_MAP_START( | |
| 111 | static ADDRESS_MAP_START( a | |
| 113 | 112 | AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM |
| 114 | 113 | AM_RANGE(0x6000, 0x6003) AM_MIRROR(0x1ffc) AM_RAM /* unknown device in an epoxy block, might be tilt detection */ |
| 115 | 114 | AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x1ffc) AM_READ(madalien_sound_command_r) |
| r1877 | r1878 | |
| 159 | 158 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 160 | 159 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 161 | 160 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 162 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 161 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_insert | |
| 163 | 162 | INPUT_PORTS_END |
| 164 | 163 | |
| 165 | 164 | |
| r1877 | r1878 | |
| 177 | 176 | /* main CPU */ |
| 178 | 177 | MDRV_CPU_ADD(M6502, MADALIEN_MAIN_CLOCK / 8) /* 1324kHz */ |
| 179 | 178 | MDRV_CPU_PROGRAM_MAP(main_map, 0) |
| 180 | MDRV_CPU_VBLANK_INT(madalien_interrupt, 1) | |
| 181 | 179 | |
| 182 | 180 | /* audio CPU */ |
| 183 | 181 | MDRV_CPU_ADD(M6502, SOUND_CLOCK / 8) /* 512kHz */ |
| 184 | MDRV_CPU_PROGRAM_MAP( | |
| 182 | MDRV_CPU_PROGRAM_MAP(a | |
| 185 | 183 | MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 800) /* unknown due to incomplete schematics */ |
| 186 | 184 | |
| 187 | 185 | /* video hardware */ |
| r1877 | r1878 | |
|---|---|---|
| 129 | 129 | MDRV_CPU_ADD(Z180,16000000) /* 16 MHz? */ |
| 130 | 130 | MDRV_CPU_PROGRAM_MAP(igs_180_map,0) |
| 131 | 131 | MDRV_CPU_IO_MAP(igs_180_portmap,0) |
| 132 | MDRV_CPU_VBLANK_INT(igs_180_interrupt,2) | |
| 133 | //MDRV_CPU_VBLANK_INT(irq0_line_hold,1) | |
| 132 | MDRV_CPU_VBLANK_INT_HACK(igs_180_interrupt,2) | |
| 133 | //MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 134 | 134 | |
| 135 | 135 | /* video hardware */ |
| 136 | 136 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 229 | 229 | /* basic machine hardware */ |
| 230 | 230 | MDRV_CPU_ADD(M6809, XTAL_10MHz/8) /* verified on pcb */ |
| 231 | 231 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 232 | MDRV_CPU_VBLANK_INT(aeroboto_interrupt | |
| 232 | MDRV_CPU_VBLANK_INT("main", aeroboto_interrupt | |
| 233 | 233 | |
| 234 | 234 | MDRV_CPU_ADD(M6809, XTAL_10MHz/16) /* verified on pcb */ |
| 235 | 235 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 236 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 236 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 237 | 237 | |
| 238 | 238 | /* video hardware */ |
| 239 | 239 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 349 | 349 | /* basic machine hardware */ |
| 350 | 350 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) |
| 351 | 351 | MDRV_CPU_PROGRAM_MAP( konamigv_map, 0 ) |
| 352 | MDRV_CPU_VBLANK_INT( psx_vblank | |
| 352 | MDRV_CPU_VBLANK_INT("main", psx_vblank | |
| 353 | 353 | |
| 354 | 354 | MDRV_MACHINE_RESET( konamigv ) |
| 355 | 355 | MDRV_NVRAM_HANDLER(konamigv_93C46) |
| r1877 | r1878 | |
|---|---|---|
| 199 | 199 | |
| 200 | 200 | static WRITE8_HANDLER( firetrap_sound_command_w ) |
| 201 | 201 | { |
| 202 | soundlatch_w(offset,data); | |
| 203 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 202 | soundlatch_w(machine,offset,data); | |
| 203 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | static WRITE8_HANDLER( firetrap_sound_2400_w ) |
| r1877 | r1878 | |
| 576 | 576 | /* basic machine hardware */ |
| 577 | 577 | MDRV_CPU_ADD(Z80, 6000000) /* 6 MHz */ |
| 578 | 578 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 579 | MDRV_CPU_VBLANK_INT(firetrap,2) | |
| 579 | MDRV_CPU_VBLANK_INT_HACK(firetrap,2) | |
| 580 | 580 | |
| 581 | 581 | MDRV_CPU_ADD(M6502,3072000/2) |
| 582 | 582 | /* audio CPU */ /* 1.536 MHz? */ |
| r1877 | r1878 | |
| 616 | 616 | /* basic machine hardware */ |
| 617 | 617 | MDRV_CPU_ADD(Z80, 6000000) /* 6 MHz */ |
| 618 | 618 | MDRV_CPU_PROGRAM_MAP(readmem_bootleg,writemem_bootleg) |
| 619 | MDRV_CPU_VBLANK_INT(bootleg | |
| 619 | MDRV_CPU_VBLANK_INT("main", bootleg | |
| 620 | 620 | |
| 621 | 621 | MDRV_CPU_ADD(M6502,3072000/2) |
| 622 | 622 | /* audio CPU */ /* 1.536 MHz? */ |
| r1877 | r1878 | |
|---|---|---|
| 364 | 364 | /* basic machine hardware */ |
| 365 | 365 | MDRV_CPU_ADD(Z80,MASTER_CLOCK/3/2) |
| 366 | 366 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 367 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 367 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 368 | 368 | |
| 369 | 369 | MDRV_CPU_ADD(Z80,MASTER_CLOCK/3/2) |
| 370 | 370 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 371 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 371 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 372 | 372 | |
| 373 | 373 | MDRV_MACHINE_START(crgolf) |
| 374 | 374 | MDRV_INTERLEAVE(100) |
| r1877 | r1878 | |
|---|---|---|
| 862 | 862 | MDRV_CPU_ADD_TAG("main", Z180, 12000000/2) /* HD647180X0CP6-1M1R */ |
| 863 | 863 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 864 | 864 | MDRV_CPU_IO_MAP(port_readmem,0) |
| 865 | MDRV_CPU_VBLANK_INT(mastboy_interrupt | |
| 865 | MDRV_CPU_VBLANK_INT("main", mastboy_interrupt | |
| 866 | 866 | |
| 867 | 867 | MDRV_NVRAM_HANDLER(generic_1fill) |
| 868 | 868 |
| r1877 | r1878 | |
|---|---|---|
| 44 | 44 | |
| 45 | 45 | static WRITE8_HANDLER( thedeep_sound_w ) |
| 46 | 46 | { |
| 47 | soundlatch_w(0,data); | |
| 48 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 47 | soundlatch_w(machine,0,data); | |
| 48 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | static UINT8 protection_command, protection_data; |
| r1877 | r1878 | |
| 365 | 365 | /* basic machine hardware */ |
| 366 | 366 | MDRV_CPU_ADD(Z80, 6000000) /* 6MHz */ |
| 367 | 367 | MDRV_CPU_PROGRAM_MAP(thedeep_readmem,thedeep_writemem) |
| 368 | MDRV_CPU_VBLANK_INT(thedeep_interrupt,2) /* IRQ by MCU, NMI by vblank (maskable) */ | |
| 368 | MDRV_CPU_VBLANK_INT_HACK(thedeep_interrupt,2) /* IRQ by MCU, NMI by vblank (maskable) */ | |
| 369 | 369 | |
| 370 | 370 | MDRV_CPU_ADD(M65C02, 2000000) /* 2MHz */ |
| 371 | 371 | MDRV_CPU_PROGRAM_MAP(thedeep_sound_readmem,thedeep_sound_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 372 | 372 | /* basic machine hardware */ |
| 373 | 373 | MDRV_CPU_ADD(M68000, 12000000) |
| 374 | 374 | MDRV_CPU_PROGRAM_MAP(oneshot_readmem,oneshot_writemem) |
| 375 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 375 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 376 | 376 | |
| 377 | 377 | MDRV_CPU_ADD(Z80, 5000000) |
| 378 | 378 | MDRV_CPU_PROGRAM_MAP(snd_readmem, snd_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 242 | 242 | /* basic machine hardware */ |
| 243 | 243 | MDRV_CPU_ADD_TAG("cpu", M68000, 15000000) |
| 244 | 244 | MDRV_CPU_PROGRAM_MAP(stlforce_map,0) |
| 245 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 245 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 246 | 246 | |
| 247 | 247 | MDRV_NVRAM_HANDLER(stlforce) |
| 248 | 248 |
| r1877 | r1878 | |
|---|---|---|
| 163 | 163 | |
| 164 | 164 | static MACHINE_RESET( themj ) |
| 165 | 165 | { |
| 166 | themj_rombank_w(0,0); | |
| 166 | themj_rombank_w(machine,0,0); | |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | |
| r1877 | r1878 | |
| 514 | 514 | MDRV_CPU_ADD_TAG("main",Z80,20000000/4) /* 5 MHz ??? */ |
| 515 | 515 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 516 | 516 | MDRV_CPU_IO_MAP(readport,writeport) |
| 517 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 517 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 518 | 518 | |
| 519 | 519 | /* video hardware */ |
| 520 | 520 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 330 | 330 | |
| 331 | 331 | static READ16_HANDLER( topspeed_input_bypass_r ) |
| 332 | 332 | { |
| 333 | UINT8 port = TC0220IOC_port_r(0); /* read port number */ | |
| 333 | UINT8 port = TC0220IOC_port_r(machine,0); /* read port number */ | |
| 334 | 334 | int steer = 0; |
| 335 | 335 | int analogue_steer = readinputportbytag_safe(STEER_PORT_TAG,0x00); |
| 336 | 336 | int fake = readinputportbytag_safe(FAKE_PORT_TAG,0x00); |
| r1877 | r1878 | |
| 367 | 367 | return steer >> 8; |
| 368 | 368 | |
| 369 | 369 | default: |
| 370 | return TC0220IOC_portreg_r(offset); | |
| 370 | return TC0220IOC_portreg_r(machine,offset); | |
| 371 | 371 | } |
| 372 | 372 | } |
| 373 | 373 | |
| r1877 | r1878 | |
| 695 | 695 | /* basic machine hardware */ |
| 696 | 696 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 697 | 697 | MDRV_CPU_PROGRAM_MAP(topspeed_readmem,topspeed_writemem) |
| 698 | MDRV_CPU_VBLANK_INT(topspeed_interrupt | |
| 698 | MDRV_CPU_VBLANK_INT("main", topspeed_interrupt | |
| 699 | 699 | |
| 700 | 700 | MDRV_CPU_ADD(Z80,16000000/4) |
| 701 | 701 | /* audio CPU */ /* 4 MHz ??? */ |
| r1877 | r1878 | |
| 703 | 703 | |
| 704 | 704 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 705 | 705 | MDRV_CPU_PROGRAM_MAP(topspeed_cpub_readmem,topspeed_cpub_writemem) |
| 706 | MDRV_CPU_VBLANK_INT(topspeed_cpub_interrupt | |
| 706 | MDRV_CPU_VBLANK_INT("main", topspeed_cpub_interrupt | |
| 707 | 707 | |
| 708 | 708 | MDRV_MACHINE_START(topspeed) |
| 709 | 709 |
| r1877 | r1878 | |
|---|---|---|
| 70 | 70 | // defined in drivers/nwk-tr.c |
| 71 | 71 | int K001604_vh_start(running_machine *machine, int chip); |
| 72 | 72 | void K001604_tile_update(running_machine *machine, int chip); |
| 73 | void K001604_draw_front_layer(int chip, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 74 | void K001604_draw_back_layer(int chip, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 73 | void K001604_draw_front_layer(int chip, bitmap_t *bitmap, const rectangle *cliprect); | |
| 74 | void K001604_draw_back_layer(int chip, bitmap_t *bitmap, const rectangle *cliprect); | |
| 75 | 75 | READ32_HANDLER(K001604_tile_r); |
| 76 | 76 | READ32_HANDLER(K001604_char_r); |
| 77 | 77 | WRITE32_HANDLER(K001604_tile_w); |
| r1877 | r1878 | |
| 358 | 358 | UINT16 ret = 0; |
| 359 | 359 | |
| 360 | 360 | if (ACCESSING_LSB16) |
| 361 | ret |= K054539_1_r(offset); | |
| 361 | ret |= K054539_1_r(machine, offset); | |
| 362 | 362 | if (ACCESSING_MSB16) |
| 363 | ret |= K054539_0_r(offset)<<8; | |
| 363 | ret |= K054539_0_r(machine, offset)<<8; | |
| 364 | 364 | |
| 365 | 365 | return ret; |
| 366 | 366 | } |
| r1877 | r1878 | |
| 368 | 368 | static WRITE16_HANDLER( dual539_w ) |
| 369 | 369 | { |
| 370 | 370 | if (ACCESSING_LSB16) |
| 371 | K054539_1_w(offset, data); | |
| 371 | K054539_1_w(machine, offset, data); | |
| 372 | 372 | if (ACCESSING_MSB16) |
| 373 | K054539_0_w(offset, data>>8); | |
| 373 | K054539_0_w(machine, offset, data>>8); | |
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | static ADDRESS_MAP_START( sound_memmap, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1877 | r1878 | |
| 573 | 573 | MDRV_CPU_ADD(PPC403, 64000000/2) /* PowerPC 403GA 32MHz */ |
| 574 | 574 | MDRV_CPU_CONFIG(zr107_ppc_cfg) |
| 575 | 575 | MDRV_CPU_PROGRAM_MAP(zr107_map, 0) |
| 576 | MDRV_CPU_VBLANK_INT(zr107_vblank | |
| 576 | MDRV_CPU_VBLANK_INT("main", zr107_vblank | |
| 577 | 577 | |
| 578 | 578 | MDRV_CPU_ADD(M68000, 64000000/8) /* 8MHz */ |
| 579 | 579 | MDRV_CPU_PROGRAM_MAP(sound_memmap, 0) |
| r1877 | r1878 | |
| 618 | 618 | MDRV_CPU_ADD(PPC403, 64000000/2) /* PowerPC 403GA 32MHz */ |
| 619 | 619 | MDRV_CPU_CONFIG(zr107_ppc_cfg) |
| 620 | 620 | MDRV_CPU_PROGRAM_MAP(jetwave_map, 0) |
| 621 | MDRV_CPU_VBLANK_INT(zr107_vblank | |
| 621 | MDRV_CPU_VBLANK_INT("main", zr107_vblank | |
| 622 | 622 | |
| 623 | 623 | MDRV_CPU_ADD(M68000, 64000000/8) /* 8MHz */ |
| 624 | 624 | MDRV_CPU_PROGRAM_MAP(sound_memmap, 0) |
| r1877 | r1878 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | static READ8_HANDLER( amspdwy_sound_r ) |
| 65 | 65 | { |
| 66 | return (YM2151_status_port_0_r(0) & ~ 0x30) | readinputport(4); | |
| 66 | return (YM2151_status_port_0_r(machine,0) & ~ 0x30) | readinputport(4); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | static WRITE8_HANDLER( amspdwy_sound_w ) |
| 70 | 70 | { |
| 71 | soundlatch_w(0,data); | |
| 72 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 71 | soundlatch_w(machine,0,data); | |
| 72 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | static ADDRESS_MAP_START( amspdwy_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 257 | 257 | MDRV_CPU_ADD(Z80,3000000) |
| 258 | 258 | MDRV_CPU_PROGRAM_MAP(amspdwy_map,0) |
| 259 | 259 | MDRV_CPU_IO_MAP(amspdwy_portmap,0) |
| 260 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 260 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 261 | 261 | |
| 262 | 262 | MDRV_CPU_ADD(Z80,3000000) /* Can't be disabled: the YM2151 timers must work */ |
| 263 | 263 | MDRV_CPU_PROGRAM_MAP(amspdwy_sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 627 | 627 | UINT8* vram; |
| 628 | 628 | UINT8* cram; |
| 629 | 629 | UINT8 writemode; |
| 630 | | |
| 630 | | |
| 631 | 631 | UINT8* tile_renderline; |
| 632 | 632 | UINT8* sprite_renderline; |
| 633 | 633 | |
| r1877 | r1878 | |
| 988 | 988 | |
| 989 | 989 | WRITE8_HANDLER( sms_sn76496_w ) |
| 990 | 990 | { |
| 991 | SN76496_0_w(0, data & 0xff); | |
| 991 | SN76496_0_w(machine, 0, data & 0xff); | |
| 992 | 992 | } |
| 993 | 993 | |
| 994 | 994 | static void draw_tile_line(int drawxpos, int tileline, UINT16 tiledata, UINT8* linebuf, struct sms_vdp* chip) |
| r1877 | r1878 | |
| 2153 | 2153 | |
| 2154 | 2154 | static WRITE8_HANDLER( sms_sn76496_2_w ) |
| 2155 | 2155 | { |
| 2156 | SN76496_1_w(0, data & 0xff); | |
| 2156 | SN76496_1_w(machine, 0, data & 0xff); | |
| 2157 | 2157 | } |
| 2158 | 2158 | |
| 2159 | 2159 | static void init_ports_systeme(void) |
| r1877 | r1878 | |
|---|---|---|
| 71 | 71 | static WRITE16_HANDLER( fantland_nmi_enable_16_w ) |
| 72 | 72 | { |
| 73 | 73 | if (ACCESSING_LSB) |
| 74 | fantland_nmi_enable_w(offset*2,data); | |
| 74 | fantland_nmi_enable_w(machine,offset*2,data); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | static WRITE8_HANDLER( fantland_soundlatch_w ) |
| 78 | 78 | { |
| 79 | soundlatch_w(0,data); | |
| 80 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 79 | soundlatch_w(machine,0,data); | |
| 80 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | static WRITE16_HANDLER( fantland_soundlatch_16_w ) |
| 84 | 84 | { |
| 85 | 85 | if (ACCESSING_LSB) |
| 86 | fantland_soundlatch_w(offset*2, data); | |
| 86 | fantland_soundlatch_w(machine, offset*2, data); | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /*************************************************************************** |
| r1877 | r1878 | |
| 190 | 190 | |
| 191 | 191 | x = readinputport(13 + offset * 2); |
| 192 | 192 | y = readinputport(12 + offset * 2); |
| 193 | f = | |
| 193 | f = vid | |
| 194 | 194 | |
| 195 | 195 | ret[offset] = (ret[offset] & 0x14) | (readinputport(2 + offset) & 0xc3); |
| 196 | 196 | |
| r1877 | r1878 | |
| 811 | 811 | /* basic machine hardware */ |
| 812 | 812 | MDRV_CPU_ADD(I8086, 8000000) // ? |
| 813 | 813 | MDRV_CPU_PROGRAM_MAP(fantland_map, 0) |
| 814 | MDRV_CPU_VBLANK_INT(fantland_irq | |
| 814 | MDRV_CPU_VBLANK_INT("main", fantland_irq | |
| 815 | 815 | |
| 816 | 816 | /* audio CPU */ |
| 817 | 817 | MDRV_CPU_ADD(I8088, 8000000) // ? |
| r1877 | r1878 | |
| 863 | 863 | /* basic machine hardware */ |
| 864 | 864 | MDRV_CPU_ADD(I8088, 8000000) // ? |
| 865 | 865 | MDRV_CPU_PROGRAM_MAP(galaxygn_map, 0) |
| 866 | MDRV_CPU_VBLANK_INT(fantland_irq | |
| 866 | MDRV_CPU_VBLANK_INT("main", fantland_irq | |
| 867 | 867 | |
| 868 | 868 | /* audio CPU */ |
| 869 | 869 | MDRV_CPU_ADD(I8088, 8000000) // ? |
| r1877 | r1878 | |
| 917 | 917 | /* basic machine hardware */ |
| 918 | 918 | MDRV_CPU_ADD(V20, 16000000/2) // D701080C-8 - NEC D70108C-8 V20 CPU, running at 8.000MHz [16/2] |
| 919 | 919 | MDRV_CPU_PROGRAM_MAP(borntofi_map, 0) |
| 920 | MDRV_CPU_VBLANK_INT(fantland_irq | |
| 920 | MDRV_CPU_VBLANK_INT("main", fantland_irq | |
| 921 | 921 | |
| 922 | 922 | /* audio CPU */ |
| 923 | 923 | MDRV_CPU_ADD(I8088, 18432000/3) // 8088 - AMD P8088-2 CPU, running at 6.144MHz [18.432/3] |
| r1877 | r1878 | |
| 963 | 963 | /* basic machine hardware */ |
| 964 | 964 | MDRV_CPU_ADD(V20, XTAL_18MHz/2) // D701080C-8 (V20) |
| 965 | 965 | MDRV_CPU_PROGRAM_MAP(wheelrun_map, 0) |
| 966 | MDRV_CPU_VBLANK_INT(fantland_irq | |
| 966 | MDRV_CPU_VBLANK_INT("main", fantland_irq | |
| 967 | 967 | |
| 968 | 968 | /* audio CPU */ |
| 969 | 969 | MDRV_CPU_ADD(Z80, XTAL_18MHz/2) // Z8400BB1 (Z80B) |
| r1877 | r1878 | |
|---|---|---|
| 40 | 40 | |
| 41 | 41 | static UINT8 *bgram; |
| 42 | 42 | |
| 43 | static void draw_sprites(running_machine *machine, | |
| 43 | static void draw_sprites(running_machine *machine, | |
| 44 | 44 | { |
| 45 | 45 | int offs; |
| 46 | 46 | |
| r1877 | r1878 | |
| 124 | 124 | |
| 125 | 125 | static READ8_HANDLER( dominob_input_2_r ) |
| 126 | 126 | { |
| 127 | return input_port_2_r(offset); | |
| 127 | return input_port_2_r(machine, offset); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | |
| r1877 | r1878 | |
| 254 | 254 | MDRV_CPU_ADD(Z80,8000000/2) |
| 255 | 255 | MDRV_CPU_PROGRAM_MAP(memmap, 0) |
| 256 | 256 | MDRV_CPU_IO_MAP(portmap,0) |
| 257 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 257 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 258 | 258 | |
| 259 | 259 | /* video hardware */ |
| 260 | 260 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 1782 | 1782 | } |
| 1783 | 1783 | } |
| 1784 | 1784 | |
| 1785 | static void gx700pwfbf_init( void (*output_callback)( int offset, int data ) ) | |
| 1785 | static void gx700pwfbf_init( void (*output_callback_func)( int offset, int data ) ) | |
| 1786 | 1786 | { |
| 1787 | 1787 | memset( gx700pwbf_output_data, 0, sizeof( gx700pwbf_output_data ) ); |
| 1788 | 1788 | |
| 1789 | gx700pwfbf_output_callback = output_callback; | |
| 1789 | gx700pwfbf_output_callback = output_callback_func; | |
| 1790 | 1790 | |
| 1791 | 1791 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, gx700pwbf_io_r ); |
| 1792 | 1792 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, gx700pwbf_io_w ); |
| r1877 | r1878 | |
| 2317 | 2317 | } |
| 2318 | 2318 | } |
| 2319 | 2319 | |
| 2320 | static void gx894pwbba_init( void (*output_callback)( int offset, int data ) ) | |
| 2320 | static void gx894pwbba_init( void (*output_callback_func)( int offset, int data ) ) | |
| 2321 | 2321 | { |
| 2322 | 2322 | int gx894_ram_size = 24 * 1024 * 1024; |
| 2323 | 2323 | |
| 2324 | gx894pwbba_output_callback = output_callback; | |
| 2324 | gx894pwbba_output_callback = output_callback_func; | |
| 2325 | 2325 | |
| 2326 | 2326 | memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, gx894pwbba_r ); |
| 2327 | 2327 | memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, gx894pwbba_w ); |
| r1877 | r1878 | |
| 2727 | 2727 | /* basic machine hardware */ |
| 2728 | 2728 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) |
| 2729 | 2729 | MDRV_CPU_PROGRAM_MAP( konami573_map, 0 ) |
| 2730 | MDRV_CPU_VBLANK_INT( sys573_vblank | |
| 2730 | MDRV_CPU_VBLANK_INT("main", sys573_vblank | |
| 2731 | 2731 | |
| 2732 | 2732 | MDRV_MACHINE_RESET( konami573 ) |
| 2733 | 2733 | MDRV_NVRAM_HANDLER( konami573 ) |
| r1877 | r1878 | |
|---|---|---|
| 424 | 424 | /* basic machine hardware */ |
| 425 | 425 | MDRV_CPU_ADD(M68000, ATARI_CLOCK_14MHz) |
| 426 | 426 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 427 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 427 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 428 | 428 | |
| 429 | 429 | MDRV_MACHINE_START(atarig1) |
| 430 | 430 | MDRV_MACHINE_RESET(atarig1) |
| r1877 | r1878 | |
|---|---|---|
| 89 | 89 | |
| 90 | 90 | static WRITE8_HANDLER( bladestl_sh_irqtrigger_w ) |
| 91 | 91 | { |
| 92 | soundlatch_w(offset, data); | |
| 93 | cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, HOLD_LINE); | |
| 92 | soundlatch_w(machine, offset, data); | |
| 93 | cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, HOLD_LINE); | |
| 94 | 94 | //logerror("(sound) write %02x\n", data); |
| 95 | 95 | } |
| 96 | 96 | |
| r1877 | r1878 | |
| 434 | 434 | /* basic machine hardware */ |
| 435 | 435 | MDRV_CPU_ADD(HD6309, 24000000/2) /* 24MHz/2 (?) */ |
| 436 | 436 | MDRV_CPU_PROGRAM_MAP(bladestl_readmem,bladestl_writemem) |
| 437 | MDRV_CPU_VBLANK_INT(bladestl_interrupt,2) /* (1 IRQ + 1 NMI) */ | |
| 437 | MDRV_CPU_VBLANK_INT_HACK(bladestl_interrupt,2) /* (1 IRQ + 1 NMI) */ | |
| 438 | 438 | |
| 439 | 439 | MDRV_CPU_ADD(M6809, 2000000) |
| 440 | 440 | /* audio CPU */ /* ? */ |
| r1877 | r1878 | |
|---|---|---|
| 53 | 53 | static MACHINE_RESET( srumbler ) |
| 54 | 54 | { |
| 55 | 55 | /* initialize banked ROM pointers */ |
| 56 | srumbler_bankswitch_w(0,0); | |
| 56 | srumbler_bankswitch_w(machine,0,0); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | static INTERRUPT_GEN( srumbler_interrupt ) |
| r1877 | r1878 | |
| 258 | 258 | /* basic machine hardware */ |
| 259 | 259 | MDRV_CPU_ADD(M6809, 1500000) /* 1.5 MHz (?) */ |
| 260 | 260 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 261 | MDRV_CPU_VBLANK_INT(srumbler_interrupt,2) | |
| 261 | MDRV_CPU_VBLANK_INT_HACK(srumbler_interrupt,2) | |
| 262 | 262 | |
| 263 | 263 | MDRV_CPU_ADD(Z80, 3000000) |
| 264 | 264 | /* audio CPU */ /* 3 MHz ??? */ |
| 265 | 265 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 266 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 266 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 267 | 267 | |
| 268 | 268 | MDRV_MACHINE_RESET(srumbler) |
| 269 | 269 |
| r1877 | r1878 | |
|---|---|---|
| 543 | 543 | /* Non-protection reads */ |
| 544 | 544 | |
| 545 | 545 | case (0x708/2): /* seibu sound: these three around $b10 on */ |
| 546 | return seibu_main_word_r(2,0); | |
| 546 | return seibu_main_word_r(machine,2,0); | |
| 547 | 547 | |
| 548 | 548 | case (0x70c/2): |
| 549 | return seibu_main_word_r(3,0); | |
| 549 | return seibu_main_word_r(machine,3,0); | |
| 550 | 550 | |
| 551 | 551 | case (0x714/2): |
| 552 | return seibu_main_word_r(5,0); | |
| 552 | return seibu_main_word_r(machine,5,0); | |
| 553 | 553 | |
| 554 | 554 | /* Inputs */ |
| 555 | 555 | |
| 556 | 556 | case (0x740/2): /* code at $b00 sticks waiting for bit 6 hi */ |
| 557 | return input_port_1_word_r(0,0); | |
| 557 | return input_port_1_word_r(machine,0,0); | |
| 558 | 558 | |
| 559 | 559 | case (0x744/2): |
| 560 | return input_port_2_word_r(0,0); | |
| 560 | return input_port_2_word_r(machine,0,0); | |
| 561 | 561 | |
| 562 | 562 | case (0x748/2): /* code at $f4a reads this 4 times in _weird_ fashion */ |
| 563 | return input_port_0_word_r(0,0); | |
| 563 | return input_port_0_word_r(machine,0,0); | |
| 564 | 564 | |
| 565 | 565 | case (0x74c/2): |
| 566 | return input_port_3_word_r(0,0); | |
| 566 | return input_port_3_word_r(machine,0,0); | |
| 567 | 567 | |
| 568 | 568 | } |
| 569 | 569 | //logerror("CPU0 PC %06x unknown MCU read offset: %04x\n",activecpu_get_previouspc(),offset); |
| r1877 | r1878 | |
| 699 | 699 | } |
| 700 | 700 | case (0x700/2): /* seibu(0) */ |
| 701 | 701 | { |
| 702 | seibu_main_word_w(0,mcu_ram[offset],0xff00); | |
| 702 | seibu_main_word_w(machine,0,mcu_ram[offset],0xff00); | |
| 703 | 703 | break; |
| 704 | 704 | } |
| 705 | 705 | case (0x704/2): /* seibu(1) */ |
| 706 | 706 | { |
| 707 | seibu_main_word_w(1,mcu_ram[offset],0xff00); | |
| 707 | seibu_main_word_w(machine,1,mcu_ram[offset],0xff00); | |
| 708 | 708 | break; |
| 709 | 709 | } |
| 710 | 710 | case (0x710/2): /* seibu(4) */ |
| 711 | 711 | { |
| 712 | seibu_main_word_w(4,mcu_ram[offset],0xff00); | |
| 712 | seibu_main_word_w(machine,4,mcu_ram[offset],0xff00); | |
| 713 | 713 | break; |
| 714 | 714 | } |
| 715 | 715 | case (0x718/2): /* seibu(6) */ |
| 716 | 716 | { |
| 717 | seibu_main_word_w(6,mcu_ram[offset],0xff00); | |
| 717 | seibu_main_word_w(machine,6,mcu_ram[offset],0xff00); | |
| 718 | 718 | break; |
| 719 | 719 | } |
| 720 | 720 | // default: |
| r1877 | r1878 | |
| 1129 | 1129 | /* Non-protection reads */ |
| 1130 | 1130 | |
| 1131 | 1131 | case (0x7c8/2): /* seibu sound */ |
| 1132 | return seibu_main_word_r(2,0); | |
| 1132 | return seibu_main_word_r(machine,2,0); | |
| 1133 | 1133 | |
| 1134 | 1134 | case (0x7cc/2): |
| 1135 | return seibu_main_word_r(3,0); | |
| 1135 | return seibu_main_word_r(machine,3,0); | |
| 1136 | 1136 | |
| 1137 | 1137 | case (0x7d4/2): |
| 1138 | return seibu_main_word_r(5,0); | |
| 1138 | return seibu_main_word_r(machine,5,0); | |
| 1139 | 1139 | |
| 1140 | 1140 | /* Inputs */ |
| 1141 | 1141 | |
| 1142 | 1142 | case (0x740/2): |
| 1143 | return input_port_1_word_r(0,0); | |
| 1143 | return input_port_1_word_r(machine,0,0); | |
| 1144 | 1144 | |
| 1145 | 1145 | case (0x744/2): |
| 1146 | return input_port_2_word_r(0,0); | |
| 1146 | return input_port_2_word_r(machine,0,0); | |
| 1147 | 1147 | |
| 1148 | 1148 | case (0x748/2): |
| 1149 | return input_port_4_word_r(0,0); | |
| 1149 | return input_port_4_word_r(machine,0,0); | |
| 1150 | 1150 | |
| 1151 | 1151 | case (0x74c/2): |
| 1152 | return input_port_3_word_r(0,0); | |
| 1152 | return input_port_3_word_r(machine,0,0); | |
| 1153 | 1153 | |
| 1154 | 1154 | } |
| 1155 | 1155 | //logerror("CPU0 PC %06x unknown MCU read offset: %04x\n",activecpu_get_previouspc(),offset); |
| r1877 | r1878 | |
| 1359 | 1359 | } |
| 1360 | 1360 | case (0x7c0/2): /* seibu(0) */ |
| 1361 | 1361 | { |
| 1362 | seibu_main_word_w(0,mcu_ram[offset],0xff00); | |
| 1362 | seibu_main_word_w(machine,0,mcu_ram[offset],0xff00); | |
| 1363 | 1363 | break; |
| 1364 | 1364 | } |
| 1365 | 1365 | case (0x7c4/2): /* seibu(1) */ |
| 1366 | 1366 | { |
| 1367 | seibu_main_word_w(1,mcu_ram[offset],0xff00); | |
| 1367 | seibu_main_word_w(machine,1,mcu_ram[offset],0xff00); | |
| 1368 | 1368 | break; |
| 1369 | 1369 | } |
| 1370 | 1370 | case (0x7d0/2): /* seibu(4) */ |
| 1371 | 1371 | { |
| 1372 | seibu_main_word_w(4,mcu_ram[offset],0xff00); | |
| 1372 | seibu_main_word_w(machine,4,mcu_ram[offset],0xff00); | |
| 1373 | 1373 | break; |
| 1374 | 1374 | } |
| 1375 | 1375 | case (0x7d8/2): /* seibu(6) */ |
| 1376 | 1376 | { |
| 1377 | seibu_main_word_w(6,mcu_ram[offset],0xff00); | |
| 1377 | seibu_main_word_w(machine,6,mcu_ram[offset],0xff00); | |
| 1378 | 1378 | break; |
| 1379 | 1379 | } |
| 1380 | 1380 | default: |
| r1877 | r1878 | |
| 1443 | 1443 | |
| 1444 | 1444 | /* Non-protection reads */ |
| 1445 | 1445 | case (0x708/2): /* seibu sound */ |
| 1446 | return seibu_main_word_r(2,0); | |
| 1446 | return seibu_main_word_r(machine,2,0); | |
| 1447 | 1447 | |
| 1448 | 1448 | case (0x70c/2): |
| 1449 | return seibu_main_word_r(3,0); | |
| 1449 | return seibu_main_word_r(machine,3,0); | |
| 1450 | 1450 | |
| 1451 | 1451 | case (0x714/2): |
| 1452 | return seibu_main_word_r(5,0); | |
| 1452 | return seibu_main_word_r(machine,5,0); | |
| 1453 | 1453 | |
| 1454 | 1454 | /* Inputs */ |
| 1455 | 1455 | |
| 1456 | 1456 | case (0x740/2): |
| 1457 | return input_port_1_word_r(0,0); | |
| 1457 | return input_port_1_word_r(machine,0,0); | |
| 1458 | 1458 | |
| 1459 | 1459 | case (0x744/2): |
| 1460 | return input_port_2_word_r(0,0); | |
| 1460 | return input_port_2_word_r(machine,0,0); | |
| 1461 | 1461 | |
| 1462 | 1462 | case (0x748/2): |
| 1463 | return input_port_4_word_r(0,0); | |
| 1463 | return input_port_4_word_r(machine,0,0); | |
| 1464 | 1464 | |
| 1465 | 1465 | case (0x74c/2): |
| 1466 | return input_port_3_word_r(0,0); | |
| 1466 | return input_port_3_word_r(machine,0,0); | |
| 1467 | 1467 | |
| 1468 | 1468 | case (0x75c/2): |
| 1469 | return input_port_5_word_r(0,0); | |
| 1469 | return input_port_5_word_r(machine,0,0); | |
| 1470 | 1470 | } |
| 1471 | 1471 | // return mame_rand(Machine); |
| 1472 | 1472 | if(offset > (0x500/2) && offset < (0x600/2)) |
| r1877 | r1878 | |
| 1822 | 1822 | |
| 1823 | 1823 | case (0x700/2): /* seibu(0) */ |
| 1824 | 1824 | { |
| 1825 | seibu_main_word_w(0,mcu_ram[offset],0xff00); | |
| 1825 | seibu_main_word_w(machine,0,mcu_ram[offset],0xff00); | |
| 1826 | 1826 | break; |
| 1827 | 1827 | } |
| 1828 | 1828 | case (0x704/2): /* seibu(1) */ |
| 1829 | 1829 | { |
| 1830 | seibu_main_word_w(1,mcu_ram[offset],0xff00); | |
| 1830 | seibu_main_word_w(machine,1,mcu_ram[offset],0xff00); | |
| 1831 | 1831 | break; |
| 1832 | 1832 | } |
| 1833 | 1833 | case (0x710/2): /* seibu(4) */ |
| 1834 | 1834 | { |
| 1835 | seibu_main_word_w(4,mcu_ram[offset],0xff00); | |
| 1835 | seibu_main_word_w(machine,4,mcu_ram[offset],0xff00); | |
| 1836 | 1836 | break; |
| 1837 | 1837 | } |
| 1838 | 1838 | case (0x718/2): /* seibu(6) */ |
| 1839 | 1839 | { |
| 1840 | seibu_main_word_w(6,mcu_ram[offset],0xff00); | |
| 1840 | seibu_main_word_w(machine,6,mcu_ram[offset],0xff00); | |
| 1841 | 1841 | break; |
| 1842 | 1842 | } |
| 1843 | 1843 | |
| r1877 | r1878 | |
| 1885 | 1885 | /* Non-protection reads */ |
| 1886 | 1886 | |
| 1887 | 1887 | case (0x708/2): /* seibu sound */ |
| 1888 | return seibu_main_word_r(2,0); | |
| 1888 | return seibu_main_word_r(machine,2,0); | |
| 1889 | 1889 | |
| 1890 | 1890 | case (0x70c/2): |
| 1891 | return seibu_main_word_r(3,0); | |
| 1891 | return seibu_main_word_r(machine,3,0); | |
| 1892 | 1892 | |
| 1893 | 1893 | case (0x714/2): |
| 1894 | return seibu_main_word_r(5,0); | |
| 1894 | return seibu_main_word_r(machine,5,0); | |
| 1895 | 1895 | |
| 1896 | 1896 | /* Inputs */ |
| 1897 | 1897 | |
| 1898 | 1898 | case (0x740/2): |
| 1899 | return input_port_1_word_r(0,0); | |
| 1899 | return input_port_1_word_r(machine,0,0); | |
| 1900 | 1900 | |
| 1901 | 1901 | case (0x744/2): |
| 1902 | return input_port_2_word_r(0,0); | |
| 1902 | return input_port_2_word_r(machine,0,0); | |
| 1903 | 1903 | |
| 1904 | 1904 | case (0x748/2): |
| 1905 | return input_port_4_word_r(0,0); | |
| 1905 | return input_port_4_word_r(machine,0,0); | |
| 1906 | 1906 | |
| 1907 | 1907 | case (0x74c/2): |
| 1908 | return input_port_3_word_r(0,0); | |
| 1908 | return input_port_3_word_r(machine,0,0); | |
| 1909 | 1909 | |
| 1910 | 1910 | } |
| 1911 | 1911 | //logerror("CPU0 PC %06x unknown MCU read offset: %04x\n",activecpu_get_previouspc(),offset); |
| r1877 | r1878 | |
| 1967 | 1967 | } |
| 1968 | 1968 | case (0x700/2): /* seibu(0) */ |
| 1969 | 1969 | { |
| 1970 | seibu_main_word_w(0,mcu_ram[offset],0xff00); | |
| 1970 | seibu_main_word_w(machine,0,mcu_ram[offset],0xff00); | |
| 1971 | 1971 | break; |
| 1972 | 1972 | } |
| 1973 | 1973 | case (0x704/2): /* seibu(1) */ |
| 1974 | 1974 | { |
| 1975 | seibu_main_word_w(1,mcu_ram[offset],0xff00); | |
| 1975 | seibu_main_word_w(machine,1,mcu_ram[offset],0xff00); | |
| 1976 | 1976 | break; |
| 1977 | 1977 | } |
| 1978 | 1978 | case (0x710/2): /* seibu(4) */ |
| 1979 | 1979 | { |
| 1980 | seibu_main_word_w(4,mcu_ram[offset],0xff00); | |
| 1980 | seibu_main_word_w(machine,4,mcu_ram[offset],0xff00); | |
| 1981 | 1981 | break; |
| 1982 | 1982 | } |
| 1983 | 1983 | case (0x718/2): /* seibu(6) */ |
| 1984 | 1984 | { |
| 1985 | seibu_main_word_w(6,mcu_ram[offset],0xff00); | |
| 1985 | seibu_main_word_w(machine,6,mcu_ram[offset],0xff00); | |
| 1986 | 1986 | break; |
| 1987 | 1987 | } |
| 1988 | 1988 | // default: |
| r1877 | r1878 | |
| 2029 | 2029 | /* Non-protection reads */ |
| 2030 | 2030 | |
| 2031 | 2031 | case (0x7c8/2): /* seibu sound */ |
| 2032 | return seibu_main_word_r(2,0); | |
| 2032 | return seibu_main_word_r(machine,2,0); | |
| 2033 | 2033 | |
| 2034 | 2034 | case (0x7cc/2): |
| 2035 | return seibu_main_word_r(3,0); | |
| 2035 | return seibu_main_word_r(machine,3,0); | |
| 2036 | 2036 | |
| 2037 | 2037 | case (0x7d4/2): |
| 2038 | return seibu_main_word_r(5,0); | |
| 2038 | return seibu_main_word_r(machine,5,0); | |
| 2039 | 2039 | |
| 2040 | 2040 | /* Inputs */ |
| 2041 | 2041 | |
| 2042 | 2042 | case (0x740/2): |
| 2043 | return input_port_1_word_r(0,0); | |
| 2043 | return input_port_1_word_r(machine,0,0); | |
| 2044 | 2044 | |
| 2045 | 2045 | case (0x744/2): |
| 2046 | return input_port_2_word_r(0,0); | |
| 2046 | return input_port_2_word_r(machine,0,0); | |
| 2047 | 2047 | |
| 2048 | 2048 | case (0x748/2): |
| 2049 | return input_port_4_word_r(0,0); | |
| 2049 | return input_port_4_word_r(machine,0,0); | |
| 2050 | 2050 | |
| 2051 | 2051 | case (0x74c/2): |
| 2052 | return input_port_3_word_r(0,0); | |
| 2052 | return input_port_3_word_r(machine,0,0); | |
| 2053 | 2053 | |
| 2054 | 2054 | } |
| 2055 | 2055 | // if(offset >= (0x400/2) && offset < (0x600/2) && offset != (0x5a4/2)) |
| r1877 | r1878 | |
| 2129 | 2129 | |
| 2130 | 2130 | case (0x7c0/2): /* seibu(0) */ |
| 2131 | 2131 | { |
| 2132 | seibu_main_word_w(0,mcu_ram[offset],0xff00); | |
| 2132 | seibu_main_word_w(machine,0,mcu_ram[offset],0xff00); | |
| 2133 | 2133 | break; |
| 2134 | 2134 | } |
| 2135 | 2135 | case (0x7c4/2): /* seibu(1) */ |
| 2136 | 2136 | { |
| 2137 | seibu_main_word_w(1,mcu_ram[offset],0xff00); | |
| 2137 | seibu_main_word_w(machine,1,mcu_ram[offset],0xff00); | |
| 2138 | 2138 | break; |
| 2139 | 2139 | } |
| 2140 | 2140 | case (0x7d0/2): /* seibu(4) */ |
| 2141 | 2141 | { |
| 2142 | seibu_main_word_w(4,mcu_ram[offset],0xff00); | |
| 2142 | seibu_main_word_w(machine,4,mcu_ram[offset],0xff00); | |
| 2143 | 2143 | break; |
| 2144 | 2144 | } |
| 2145 | 2145 | case (0x7d8/2): /* seibu(6) */ |
| 2146 | 2146 | { |
| 2147 | seibu_main_word_w(6,mcu_ram[offset],0xff00); | |
| 2147 | seibu_main_word_w(machine,6,mcu_ram[offset],0xff00); | |
| 2148 | 2148 | break; |
| 2149 | 2149 | } |
| 2150 | 2150 | // default: |
| r1877 | r1878 | |
| 2162 | 2162 | // return mcu_ram[offset]; |
| 2163 | 2163 | |
| 2164 | 2164 | case (0x700/2): |
| 2165 | return input_port_1_word_r(0,0); | |
| 2165 | return input_port_1_word_r(machine,0,0); | |
| 2166 | 2166 | |
| 2167 | 2167 | case (0x704/2): |
| 2168 | return input_port_2_word_r(0,0); | |
| 2168 | return input_port_2_word_r(machine,0,0); | |
| 2169 | 2169 | |
| 2170 | 2170 | case (0x708/2): |
| 2171 | return input_port_4_word_r(0,0); | |
| 2171 | return input_port_4_word_r(machine,0,0); | |
| 2172 | 2172 | |
| 2173 | 2173 | case (0x70c/2): |
| 2174 | return input_port_3_word_r(0,0); | |
| 2174 | return input_port_3_word_r(machine,0,0); | |
| 2175 | 2175 | |
| 2176 | 2176 | case (0x71c/2): |
| 2177 | return input_port_5_word_r(0,0); | |
| 2177 | return input_port_5_word_r(machine,0,0); | |
| 2178 | 2178 | |
| 2179 | 2179 | case (0x748/2): /* seibu sound */ |
| 2180 | return seibu_main_word_r(2,0); | |
| 2180 | return seibu_main_word_r(machine,2,0); | |
| 2181 | 2181 | case (0x74c/2): |
| 2182 | return seibu_main_word_r(3,0); | |
| 2182 | return seibu_main_word_r(machine,3,0); | |
| 2183 | 2183 | case (0x754/2): |
| 2184 | return seibu_main_word_r(5,0); | |
| 2184 | return seibu_main_word_r(machine,5,0); | |
| 2185 | 2185 | |
| 2186 | 2186 | } |
| 2187 | 2187 | |
| r1877 | r1878 | |
| 2386 | 2386 | |
| 2387 | 2387 | case (0x740/2): /* seibu(0) */ |
| 2388 | 2388 | { |
| 2389 | seibu_main_word_w(0,mcu_ram[offset],0xff00); | |
| 2389 | seibu_main_word_w(machine,0,mcu_ram[offset],0xff00); | |
| 2390 | 2390 | break; |
| 2391 | 2391 | } |
| 2392 | 2392 | case (0x744/2): /* seibu(1) */ |
| 2393 | 2393 | { |
| 2394 | seibu_main_word_w(1,mcu_ram[offset],0xff00); | |
| 2394 | seibu_main_word_w(machine,1,mcu_ram[offset],0xff00); | |
| 2395 | 2395 | break; |
| 2396 | 2396 | } |
| 2397 | 2397 | case (0x750/2): /* seibu(4) */ |
| 2398 | 2398 | { |
| 2399 | seibu_main_word_w(4,mcu_ram[offset],0xff00); | |
| 2399 | seibu_main_word_w(machine,4,mcu_ram[offset],0xff00); | |
| 2400 | 2400 | break; |
| 2401 | 2401 | } |
| 2402 | 2402 | case (0x758/2): /* seibu(6) */ |
| 2403 | 2403 | { |
| 2404 | seibu_main_word_w(6,mcu_ram[offset],0xff00); | |
| 2404 | seibu_main_word_w(machine,6,mcu_ram[offset],0xff00); | |
| 2405 | 2405 | break; |
| 2406 | 2406 | } |
| 2407 | 2407 | } |
| r1877 | r1878 | |
| 2418 | 2418 | // return mcu_ram[offset]; |
| 2419 | 2419 | |
| 2420 | 2420 | case (0x700/2): |
| 2421 | return input_port_1_word_r(0,0); | |
| 2421 | return input_port_1_word_r(machine,0,0); | |
| 2422 | 2422 | |
| 2423 | 2423 | case (0x704/2): |
| 2424 | return input_port_2_word_r(0,0); | |
| 2424 | return input_port_2_word_r(machine,0,0); | |
| 2425 | 2425 | |
| 2426 | 2426 | case (0x708/2): |
| 2427 | return input_port_4_word_r(0,0); | |
| 2427 | return input_port_4_word_r(machine,0,0); | |
| 2428 | 2428 | |
| 2429 | 2429 | case (0x70c/2): |
| 2430 | return input_port_3_word_r(0,0); | |
| 2430 | return input_port_3_word_r(machine,0,0); | |
| 2431 | 2431 | |
| 2432 | 2432 | case (0x71c/2): |
| 2433 | return input_port_5_word_r(0,0); | |
| 2433 | return input_port_5_word_r(machine,0,0); | |
| 2434 | 2434 | #if 0 |
| 2435 | 2435 | case (0x748/2): /* seibu sound */ |
| 2436 | 2436 | return seibu_main_word_r(2,0); |
| r1877 | r1878 | |
| 2564 | 2564 | /*WRONG*/ |
| 2565 | 2565 | case (0x65c/2): |
| 2566 | 2566 | { |
| 2567 | soundlatch_w(1,data&0xff); | |
| 2568 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 2567 | soundlatch_w(machine,1,data&0xff); | |
| 2568 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 2569 | 2569 | break; |
| 2570 | 2570 | } |
| 2571 | 2571 | /*video regs (not scrollram,something else)*/ |
| r1877 | r1878 | |
| 3465 | 3465 | /* basic machine hardware */ |
| 3466 | 3466 | MDRV_CPU_ADD(M68000,20000000/2) /* ??? */ |
| 3467 | 3467 | MDRV_CPU_PROGRAM_MAP(legionna_readmem,legionna_writemem) |
| 3468 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 3468 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 3469 | 3469 | |
| 3470 | 3470 | SEIBU_SOUND_SYSTEM_CPU(14318180/4) |
| 3471 | 3471 | |
| r1877 | r1878 | |
| 3497 | 3497 | /* basic machine hardware */ |
| 3498 | 3498 | MDRV_CPU_ADD(M68000,20000000/2) /* ??? */ |
| 3499 | 3499 | MDRV_CPU_PROGRAM_MAP(heatbrl_readmem,heatbrl_writemem) |
| 3500 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 3500 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 3501 | 3501 | |
| 3502 | 3502 | SEIBU_SOUND_SYSTEM_CPU(14318180/4) |
| 3503 | 3503 | |
| r1877 | r1878 | |
| 3528 | 3528 | /* basic machine hardware */ |
| 3529 | 3529 | MDRV_CPU_ADD(M68000, 20000000/2) |
| 3530 | 3530 | MDRV_CPU_PROGRAM_MAP(godzilla_readmem,godzilla_writemem) |
| 3531 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 3531 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 3532 | 3532 | |
| 3533 | 3533 | SEIBU2_SOUND_SYSTEM_CPU(14318180/4) |
| 3534 | 3534 | |
| r1877 | r1878 | |
| 3559 | 3559 | /* basic machine hardware */ |
| 3560 | 3560 | MDRV_CPU_ADD(M68000, 20000000/2) |
| 3561 | 3561 | MDRV_CPU_PROGRAM_MAP(denjinmk_readmem,denjinmk_writemem) |
| 3562 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 3562 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 3563 | 3563 | |
| 3564 | 3564 | SEIBU2_SOUND_SYSTEM_CPU(14318180/4) |
| 3565 | 3565 | |
| r1877 | r1878 | |
| 3590 | 3590 | /* basic machine hardware */ |
| 3591 | 3591 | MDRV_CPU_ADD(M68000, 20000000/2) |
| 3592 | 3592 | MDRV_CPU_PROGRAM_MAP(sdgndmrb_readmem,sdgndmrb_writemem) |
| 3593 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 3593 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 3594 | 3594 | |
| 3595 | 3595 | SEIBU2_SOUND_SYSTEM_CPU(14318180/4) |
| 3596 | 3596 | |
| r1877 | r1878 | |
| 3622 | 3622 | /* basic machine hardware */ |
| 3623 | 3623 | MDRV_CPU_ADD(M68000,20000000/2) |
| 3624 | 3624 | MDRV_CPU_PROGRAM_MAP(cupsoc_mem,0) |
| 3625 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 3625 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 3626 | 3626 | |
| 3627 | 3627 | SEIBU_SOUND_SYSTEM_CPU(14318180/4) |
| 3628 | 3628 | |
| r1877 | r1878 | |
| 3654 | 3654 | /* basic machine hardware */ |
| 3655 | 3655 | MDRV_CPU_ADD(M68000,12000000) |
| 3656 | 3656 | MDRV_CPU_PROGRAM_MAP(cupsocbl_mem,0) |
| 3657 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 3657 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 3658 | 3658 | |
| 3659 | 3659 | /*Different Sound hardware*/ |
| 3660 | 3660 | //SEIBU_SOUND_SYSTEM_CPU(14318180/4) |
| 3661 | 3661 | MDRV_CPU_ADD(Z80,14318180/4) |
| 3662 | 3662 | MDRV_CPU_PROGRAM_MAP(cupsocbl_sound_mem,0) |
| 3663 | //MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 3663 | //MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 3664 | 3664 | |
| 3665 | 3665 | //MDRV_MACHINE_INIT(seibu_sound_1) |
| 3666 | 3666 |
| r1877 | r1878 | |
|---|---|---|
| 72 | 72 | tilemap_set_transparent_pen(tmap, 0); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | static void draw_sprites(running_machine *machine, | |
| 75 | static void draw_sprites(running_machine *machine, | |
| 76 | 76 | { |
| 77 | 77 | UINT16 *s = livequiz_gfxram + 0x8000; |
| 78 | 78 | UINT16 *codes = livequiz_gfxram; |
| r1877 | r1878 | |
| 442 | 442 | /* basic machine hardware */ |
| 443 | 443 | MDRV_CPU_ADD(M68000, 24000000 / 2) |
| 444 | 444 | MDRV_CPU_PROGRAM_MAP(mem_map,0) |
| 445 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 445 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 446 | 446 | |
| 447 | 447 | MDRV_NVRAM_HANDLER(93C46) |
| 448 | 448 |
| r1877 | r1878 | |
|---|---|---|
| 92 | 92 | /* make this happen, we must assume that reads from the */ |
| 93 | 93 | /* 6840 take 14 additional cycles */ |
| 94 | 94 | activecpu_adjust_icount(-14); |
| 95 | return mcr68_6840_upper_r(offset,0); | |
| 95 | return mcr68_6840_upper_r(machine,offset,0); | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
| r1877 | r1878 | |
| 107 | 107 | { |
| 108 | 108 | COMBINE_DATA(&control_word); |
| 109 | 109 | /* soundsgood_reset_w(~control_word & 0x0020);*/ |
| 110 | soundsgood_data_w(offset, ((control_word & 0x000f) << 1) | ((control_word & 0x0010) >> 4)); | |
| 110 | soundsgood_data_w(machine, offset, ((control_word & 0x000f) << 1) | ((control_word & 0x0010) >> 4)); | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
| r1877 | r1878 | |
| 122 | 122 | { |
| 123 | 123 | COMBINE_DATA(&control_word); |
| 124 | 124 | /* soundsgood_reset_w(~control_word & 0x0020);*/ |
| 125 | soundsgood_data_w(offset, (control_word >> 8) & 0x1f); | |
| 125 | soundsgood_data_w(machine, offset, (control_word >> 8) & 0x1f); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
| r1877 | r1878 | |
| 138 | 138 | int result = readinputportbytag("IN0"); |
| 139 | 139 | int which = (control_word >> 3) & 3; |
| 140 | 140 | int analog = readinputport(3 + which); |
| 141 | return result | ((soundsgood_status_r(0) & 1) << 5) | (analog << 8); | |
| 141 | return result | ((soundsgood_status_r(machine, 0) & 1) << 5) | (analog << 8); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | |
| 145 | 145 | static READ16_HANDLER( spyhunt2_port_1_r ) |
| 146 | 146 | { |
| 147 | 147 | int result = readinputportbytag("IN1"); |
| 148 | return result | ((turbocs_status_r(0) & 1) << 7); | |
| 148 | return result | ((turbocs_status_r(machine, 0) & 1) << 7); | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | |
| r1877 | r1878 | |
| 154 | 154 | COMBINE_DATA(&control_word); |
| 155 | 155 | |
| 156 | 156 | /* turbocs_reset_w(~control_word & 0x0080);*/ |
| 157 | turbocs_data_w(offset, (control_word >> 8) & 0x001f); | |
| 157 | turbocs_data_w(machine, offset, (control_word >> 8) & 0x001f); | |
| 158 | 158 | |
| 159 | 159 | soundsgood_reset_w(~control_word & 0x2000); |
| 160 | soundsgood_data_w(offset, (control_word >> 8) & 0x001f); | |
| 160 | soundsgood_data_w(machine, offset, (control_word >> 8) & 0x001f); | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | |
| r1877 | r1878 | |
| 880 | 880 | /* basic machine hardware */ |
| 881 | 881 | MDRV_CPU_ADD(M68000, 7652400) /* should be XTAL_16MHz/2 */ |
| 882 | 882 | MDRV_CPU_PROGRAM_MAP(zwackery_map,0) |
| 883 | MDRV_CPU_VBLANK_INT(mcr68_interrupt | |
| 883 | MDRV_CPU_VBLANK_INT("main", mcr68_interrupt | |
| 884 | 884 | |
| 885 | 885 | // MDRV_WATCHDOG_VBLANK_INIT(8) |
| 886 | 886 | MDRV_MACHINE_START(zwackery) |
| r1877 | r1878 | |
| 910 | 910 | /* basic machine hardware */ |
| 911 | 911 | MDRV_CPU_ADD_TAG("main", M68000, 7723800) |
| 912 | 912 | MDRV_CPU_PROGRAM_MAP(mcr68_map,0) |
| 913 | MDRV_CPU_VBLANK_INT(mcr68_interrupt | |
| 913 | MDRV_CPU_VBLANK_INT("main", mcr68_interrupt | |
| 914 | 914 | |
| 915 | 915 | MDRV_WATCHDOG_VBLANK_INIT(8) |
| 916 | 916 | MDRV_MACHINE_START(mcr68) |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | |
| 55 | 55 | static WRITE8_HANDLER( pbaction_sh_command_w ) |
| 56 | 56 | { |
| 57 | soundlatch_w(offset,data); | |
| 58 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0x00); | |
| 57 | soundlatch_w(machine,offset,data); | |
| 58 | cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0x00); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| r1877 | r1878 | |
| 267 | 267 | /* basic machine hardware */ |
| 268 | 268 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz? */ |
| 269 | 269 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 270 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 270 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 271 | 271 | |
| 272 | 272 | MDRV_CPU_ADD(Z80, 3072000) |
| 273 | 273 | /* audio CPU */ |
| 274 | 274 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 275 | 275 | MDRV_CPU_IO_MAP(0,sound_writeport) |
| 276 | MDRV_CPU_VBLANK_INT(pbaction_interrupt,2) /* ??? */ | |
| 276 | MDRV_CPU_VBLANK_INT_HACK(pbaction_interrupt,2) /* ??? */ | |
| 277 | 277 | /* IRQs are caused by the main CPU */ |
| 278 | 278 | |
| 279 | 279 | /* video hardware */ |
| r1877 | r1878 | |
|---|---|---|
| 840 | 840 | /* from video */ |
| 841 | 841 | WRITE8_HANDLER( funworld_videoram_w ); |
| 842 | 842 | WRITE8_HANDLER( funworld_colorram_w ); |
| 843 | WRITE8_HANDLER( funworld_mc6845_address_w ); | |
| 844 | READ8_HANDLER( funworld_mc6845_register_r ); | |
| 845 | WRITE8_HANDLER( funworld_mc6845_register_w ); | |
| 846 | 843 | PALETTE_INIT( funworld ); |
| 847 | 844 | VIDEO_START( funworld ); |
| 848 | 845 | VIDEO_START( magiccrd ); |
| r1877 | r1878 | |
| 885 | 882 | AM_RANGE(0x0a00, 0x0a03) AM_READWRITE(pia_1_r, pia_1_w) |
| 886 | 883 | AM_RANGE(0x0c00, 0x0c00) AM_READWRITE(AY8910_read_port_0_r, AY8910_control_port_0_w) |
| 887 | 884 | AM_RANGE(0x0c01, 0x0c01) AM_WRITE(AY8910_write_port_0_w) |
| 888 | AM_RANGE(0x0e00, 0x0e00) AM_WRITE(funworld_mc6845_address_w) | |
| 889 | AM_RANGE(0x0e01, 0x0e01) AM_READWRITE(funworld_mc6845_register_r, funworld_mc6845_register_w) | |
| 885 | AM_RANGE(0x0e00, 0x0e00) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 886 | AM_RANGE(0x0e01, 0x0e01) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 890 | 887 | AM_RANGE(0x2000, 0x2fff) AM_RAM AM_WRITE(funworld_videoram_w) AM_BASE(&videoram) |
| 891 | 888 | AM_RANGE(0x3000, 0x3fff) AM_RAM AM_WRITE(funworld_colorram_w) AM_BASE(&colorram) |
| 892 | 889 | AM_RANGE(0x4000, 0x4000) AM_READNOP |
| r1877 | r1878 | |
| 900 | 897 | AM_RANGE(0x0a00, 0x0a03) AM_READWRITE(pia_1_r, pia_1_w) |
| 901 | 898 | AM_RANGE(0x0c00, 0x0c00) AM_READWRITE(AY8910_read_port_0_r, AY8910_control_port_0_w) |
| 902 | 899 | AM_RANGE(0x0c01, 0x0c01) AM_WRITE(AY8910_write_port_0_w) |
| 903 | AM_RANGE(0x0e00, 0x0e00) AM_WRITE(funworld_mc6845_address_w) | |
| 904 | AM_RANGE(0x0e01, 0x0e01) AM_READWRITE(funworld_mc6845_register_r, funworld_mc6845_register_w) | |
| 900 | AM_RANGE(0x0e00, 0x0e00) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 901 | AM_RANGE(0x0e01, 0x0e01) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 905 | 902 | AM_RANGE(0x3600, 0x36ff) AM_RAM // some games use $3603-05 range for protection. |
| 906 | 903 | AM_RANGE(0x4000, 0x4fff) AM_RAM AM_WRITE(funworld_videoram_w) AM_BASE(&videoram) |
| 907 | 904 | AM_RANGE(0x5000, 0x5fff) AM_RAM AM_WRITE(funworld_colorram_w) AM_BASE(&colorram) |
| r1877 | r1878 | |
| 914 | 911 | AM_RANGE(0x0a00, 0x0a03) AM_READWRITE(pia_1_r, pia_1_w) |
| 915 | 912 | AM_RANGE(0x0c00, 0x0c00) AM_READWRITE(AY8910_read_port_0_r, AY8910_control_port_0_w) |
| 916 | 913 | AM_RANGE(0x0c01, 0x0c01) AM_WRITE(AY8910_write_port_0_w) |
| 917 | AM_RANGE(0x0e00, 0x0e00) AM_WRITE(funworld_mc6845_address_w) | |
| 918 | AM_RANGE(0x0e01, 0x0e01) AM_READWRITE(funworld_mc6845_register_r, funworld_mc6845_register_w) | |
| 914 | AM_RANGE(0x0e00, 0x0e00) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 915 | AM_RANGE(0x0e01, 0x0e01) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 919 | 916 | AM_RANGE(0x2000, 0x2000) AM_READNOP // some unknown reads |
| 920 | 917 | AM_RANGE(0x3e00, 0x3fff) AM_RAM // some games use $3e03-05 range for protection. |
| 921 | 918 | AM_RANGE(0x6000, 0x6fff) AM_RAM AM_WRITE(funworld_videoram_w) AM_BASE(&videoram) |
| r1877 | r1878 | |
| 929 | 926 | AM_RANGE(0x2a00, 0x2a03) AM_READWRITE(pia_1_r, pia_1_w) |
| 930 | 927 | AM_RANGE(0x2c00, 0x2c00) AM_READWRITE(AY8910_read_port_0_r, AY8910_control_port_0_w) |
| 931 | 928 | AM_RANGE(0x2c01, 0x2c01) AM_WRITE(AY8910_write_port_0_w) |
| 932 | AM_RANGE(0x2e00, 0x2e00) AM_WRITE(funworld_mc6845_address_w) | |
| 933 | AM_RANGE(0x2e01, 0x2e01) AM_READWRITE(funworld_mc6845_register_r, funworld_mc6845_register_w) | |
| 929 | AM_RANGE(0x2e00, 0x2e00) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 930 | AM_RANGE(0x2e01, 0x2e01) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 934 | 931 | AM_RANGE(0x4000, 0x4fff) AM_RAM AM_WRITE(funworld_videoram_w) AM_BASE(&videoram) |
| 935 | 932 | AM_RANGE(0x5000, 0x5fff) AM_RAM AM_WRITE(funworld_colorram_w) AM_BASE(&colorram) |
| 936 | 933 | AM_RANGE(0x6000, 0xffff) AM_ROM |
| r1877 | r1878 | |
| 1547 | 1544 | // basic machine hardware |
| 1548 | 1545 | MDRV_CPU_ADD_TAG("main", M65SC02, MASTER_CLOCK/8) // 2MHz |
| 1549 | 1546 | MDRV_CPU_PROGRAM_MAP(funworld_map, 0) |
| 1550 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 1547 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 1551 | 1548 | |
| 1552 | 1549 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 1553 | 1550 | |
| r1877 | r1878 | |
| 1630 | 1627 | static MACHINE_DRIVER_START( snookr10 ) |
| 1631 | 1628 | MDRV_CPU_ADD_TAG("main", M65SC02, MASTER_CLOCK/8) // 2MHz |
| 1632 | 1629 | MDRV_CPU_PROGRAM_MAP(snookr10_map, 0) |
| 1633 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 1630 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 1634 | 1631 | |
| 1635 | 1632 | // video hardware |
| 1636 | 1633 |
| r1877 | r1878 | |
|---|---|---|
| 35 | 35 | |
| 36 | 36 | static READ16_HANDLER( K051316_0_msb_r ) |
| 37 | 37 | { |
| 38 | return K051316_0_r(offset) << 8; | |
| 38 | return K051316_0_r(machine,offset) << 8; | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | static READ16_HANDLER( K051316_1_msb_r ) |
| 42 | 42 | { |
| 43 | return K051316_1_r(offset) << 8; | |
| 43 | return K051316_1_r(machine,offset) << 8; | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | static READ16_HANDLER( K051316_rom_0_msb_r ) |
| 47 | 47 | { |
| 48 | return K051316_rom_0_r(offset) << 8; | |
| 48 | return K051316_rom_0_r(machine,offset) << 8; | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | static READ16_HANDLER( K051316_rom_1_msb_r ) |
| 52 | 52 | { |
| 53 | return K051316_rom_1_r(offset) << 8; | |
| 53 | return K051316_rom_1_r(machine,offset) << 8; | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | static WRITE16_HANDLER( K051316_0_msb_w ) |
| 57 | 57 | { |
| 58 | 58 | if (ACCESSING_MSB) |
| 59 | K051316_0_w(offset,data >> 8); | |
| 59 | K051316_0_w(machine,offset,data >> 8); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | static WRITE16_HANDLER( K051316_1_msb_w ) |
| 63 | 63 | { |
| 64 | 64 | if (ACCESSING_MSB) |
| 65 | K051316_1_w(offset,data >> 8); | |
| 65 | K051316_1_w(machine,offset,data >> 8); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static WRITE16_HANDLER( K051316_ctrl_0_msb_w ) |
| 69 | 69 | { |
| 70 | 70 | if (ACCESSING_MSB) |
| 71 | K051316_ctrl_0_w(offset,data >> 8); | |
| 71 | K051316_ctrl_0_w(machine,offset,data >> 8); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | static WRITE16_HANDLER( K051316_ctrl_1_msb_w ) |
| 75 | 75 | { |
| 76 | 76 | if (ACCESSING_MSB) |
| 77 | K051316_ctrl_1_w(offset,data >> 8); | |
| 77 | K051316_ctrl_1_w(machine,offset,data >> 8); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
| r1877 | r1878 | |
| 129 | 129 | |
| 130 | 130 | //logerror("%06x eeprom_r\n",activecpu_get_pc()); |
| 131 | 131 | /* bit 6 is EEPROM data */ |
| 132 | res = (EEPROM_read_bit() << 6) | input_port_0_word_r(0,0); | |
| 132 | res = (EEPROM_read_bit() << 6) | input_port_0_word_r(machine,0,0); | |
| 133 | 133 | |
| 134 | 134 | return res; |
| 135 | 135 | } |
| r1877 | r1878 | |
| 227 | 227 | |
| 228 | 228 | static READ16_HANDLER( overdriv_sound_0_r ) |
| 229 | 229 | { |
| 230 | return K053260_0_r(2 + offset); | |
| 230 | return K053260_0_r(machine,2 + offset); | |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | static READ16_HANDLER( overdriv_sound_1_r ) |
| 234 | 234 | { |
| 235 | return K053260_1_r(2 + offset); | |
| 235 | return K053260_1_r(machine,2 + offset); | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | static WRITE16_HANDLER( overdriv_soundirq_w ) |
| r1877 | r1878 | |
| 398 | 398 | /* basic machine hardware */ |
| 399 | 399 | MDRV_CPU_ADD(M68000,24000000/2) /* 12 MHz */ |
| 400 | 400 | MDRV_CPU_PROGRAM_MAP(overdriv_readmem,overdriv_writemem) |
| 401 | MDRV_CPU_VBLANK_INT(cpuA_interrupt,4) /* ??? IRQ 4 is vblank, IRQ 5 of unknown origin */ | |
| 401 | MDRV_CPU_VBLANK_INT_HACK(cpuA_interrupt,4) /* ??? IRQ 4 is vblank, IRQ 5 of unknown origin */ | |
| 402 | 402 | |
| 403 | 403 | MDRV_CPU_ADD(M68000,24000000/2) /* 12 MHz */ |
| 404 | 404 | MDRV_CPU_PROGRAM_MAP(overdriv_readmem2,overdriv_writemem2) |
| 405 | MDRV_CPU_VBLANK_INT(cpuB_interrupt | |
| 405 | MDRV_CPU_VBLANK_INT("main", cpuB_interrupt | |
| 406 | 406 | /* IRQ 5 is used only in test mode, to request the checksums of the gfx ROMs. */ |
| 407 | 407 | MDRV_CPU_ADD(M6809,3579545/2) /* 1.789 MHz?? This might be the right speed, but ROM testing */ |
| 408 | 408 | /* takes a little too much (the counter wraps from 0000 to 9999). */ |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | static WRITE8_HANDLER( scontra_bankedram_w ) |
| 55 | 55 | { |
| 56 | 56 | if (palette_selected) |
| 57 | paletteram_xBBBBBGGGGGRRRRR_be_w(offset,data); | |
| 57 | paletteram_xBBBBBGGGGGRRRRR_be_w(machine,offset,data); | |
| 58 | 58 | else |
| 59 | 59 | ram[offset] = data; |
| 60 | 60 | } |
| r1877 | r1878 | |
| 96 | 96 | logerror("%04x pmc internal ram %04x = %02x\n",activecpu_get_pc(),offset,data); |
| 97 | 97 | } |
| 98 | 98 | else |
| 99 | paletteram_xBBBBBGGGGGRRRRR_be_w(offset,data); | |
| 99 | paletteram_xBBBBBGGGGGRRRRR_be_w(machine,offset,data); | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /* |
| r1877 | r1878 | |
| 699 | 699 | /* basic machine hardware */ |
| 700 | 700 | MDRV_CPU_ADD(KONAMI, 3000000) /* 052001 */ |
| 701 | 701 | MDRV_CPU_PROGRAM_MAP(scontra_readmem,scontra_writemem) |
| 702 | MDRV_CPU_VBLANK_INT(scontra_interrupt | |
| 702 | MDRV_CPU_VBLANK_INT("main", scontra_interrupt | |
| 703 | 703 | |
| 704 | 704 | MDRV_CPU_ADD(Z80, 3579545) |
| 705 | 705 | /* audio CPU */ /* ? */ |
| r1877 | r1878 | |
| 741 | 741 | /* basic machine hardware */ |
| 742 | 742 | MDRV_CPU_ADD(KONAMI, 3000000) /* ? */ |
| 743 | 743 | MDRV_CPU_PROGRAM_MAP(thunderx_readmem,thunderx_writemem) |
| 744 | MDRV_CPU_VBLANK_INT(scontra_interrupt | |
| 744 | MDRV_CPU_VBLANK_INT("main", scontra_interrupt | |
| 745 | 745 | |
| 746 | 746 | MDRV_CPU_ADD(Z80, 3579545) |
| 747 | 747 | /* audio CPU */ /* ? */ |
| r1877 | r1878 | |
|---|---|---|
| 175 | 175 | static MACHINE_DRIVER_START( jackpool ) |
| 176 | 176 | MDRV_CPU_ADD(M68000, 12000000) // ? |
| 177 | 177 | MDRV_CPU_PROGRAM_MAP(jackpool_readmem,jackpool_writemem) |
| 178 | MDRV_CPU_VBLANK_INT(jackpool_interrupt,3) // ? | |
| 178 | MDRV_CPU_VBLANK_INT_HACK(jackpool_interrupt,3) // ? | |
| 179 | 179 | |
| 180 | 180 | MDRV_GFXDECODE(jackpool) |
| 181 | 181 |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | { |
| 62 | 62 | spcforce_SN76496_select = data; |
| 63 | 63 | |
| 64 | if (~data & 0x40) SN76496_0_w(0, spcforce_SN76496_latch); | |
| 65 | if (~data & 0x20) SN76496_1_w(0, spcforce_SN76496_latch); | |
| 66 | if (~data & 0x10) SN76496_2_w(0, spcforce_SN76496_latch); | |
| 64 | if (~data & 0x40) SN76496_0_w(machine, 0, spcforce_SN76496_latch); | |
| 65 | if (~data & 0x20) SN76496_1_w(machine, 0, spcforce_SN76496_latch); | |
| 66 | if (~data & 0x10) SN76496_2_w(machine, 0, spcforce_SN76496_latch); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | static READ8_HANDLER( spcforce_t0_r ) |
| r1877 | r1878 | |
| 261 | 261 | /* FIXME: The 8085A had a max clock of 6MHz, internally divided by 2! */ |
| 262 | 262 | MDRV_CPU_ADD(8085A, 8000000 * 2) /* 4.00 MHz??? */ |
| 263 | 263 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 264 | MDRV_CPU_VBLANK_INT(irq3_line_hold | |
| 264 | MDRV_CPU_VBLANK_INT("main", irq3_line_hold | |
| 265 | 265 | |
| 266 | 266 | MDRV_CPU_ADD(I8035,6144000) |
| 267 | 267 | /* audio CPU */ /* divisor ??? */ |
| r1877 | r1878 | |
|---|---|---|
| 331 | 331 | |
| 332 | 332 | static WRITE8_HANDLER( gsword_AY8910_control_port_0_w ) |
| 333 | 333 | { |
| 334 | AY8910_control_port_0_w(offset,data); | |
| 334 | AY8910_control_port_0_w(machine,offset,data); | |
| 335 | 335 | fake8910_0 = data; |
| 336 | 336 | } |
| 337 | 337 | static WRITE8_HANDLER( gsword_AY8910_control_port_1_w ) |
| 338 | 338 | { |
| 339 | AY8910_control_port_1_w(offset,data); | |
| 339 | AY8910_control_port_1_w(machine,offset,data); | |
| 340 | 340 | fake8910_1 = data; |
| 341 | 341 | } |
| 342 | 342 | |
| r1877 | r1878 | |
| 358 | 358 | |
| 359 | 359 | static WRITE8_HANDLER( adpcm_soundcommand_w ) |
| 360 | 360 | { |
| 361 | soundlatch_w(0,data); | |
| 362 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 361 | soundlatch_w(machine,0,data); | |
| 362 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | static ADDRESS_MAP_START( cpu1_map, 0 , 8 ) |
| r1877 | r1878 | |
| 691 | 691 | MDRV_CPU_ADD(Z80, XTAL_18MHz/6) /* verified on pcb */ |
| 692 | 692 | MDRV_CPU_PROGRAM_MAP(cpu1_map,0) |
| 693 | 693 | MDRV_CPU_IO_MAP(cpu1_io_map,0) |
| 694 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 694 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 695 | 695 | |
| 696 | 696 | MDRV_CPU_ADD(Z80, XTAL_18MHz/6) /* verified on pcb */ |
| 697 | 697 | MDRV_CPU_PROGRAM_MAP(cpu2_map,0) |
| 698 | 698 | MDRV_CPU_IO_MAP(cpu2_io_map,0) |
| 699 | MDRV_CPU_VBLANK_INT(gsword_snd_interrupt,4) | |
| 699 | MDRV_CPU_VBLANK_INT_HACK(gsword_snd_interrupt,4) | |
| 700 | 700 | |
| 701 | 701 | MDRV_CPU_ADD(Z80, XTAL_18MHz/6) /* verified on pcb */ |
| 702 | 702 | /* audio CPU */ |
| r1877 | r1878 | |
| 747 | 747 | MDRV_CPU_ADD(Z80, 18000000/6) /* ? */ |
| 748 | 748 | MDRV_CPU_PROGRAM_MAP(cpu1_map,0) |
| 749 | 749 | MDRV_CPU_IO_MAP(josvolly_cpu1_io_map,0) |
| 750 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 750 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 751 | 751 | |
| 752 | 752 | MDRV_CPU_ADD(Z80, 12000000/4) /* ? */ |
| 753 | 753 | /* audio CPU */ |
| 754 | 754 | MDRV_CPU_PROGRAM_MAP(josvolly_cpu2_map,0) |
| 755 | 755 | MDRV_CPU_IO_MAP(josvolly_cpu2_io_map,0) |
| 756 | // MDRV_CPU_VBLANK_INT(gsword_snd_interrupt,1) | |
| 757 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) | |
| 756 | // MDRV_CPU_VBLANK_INT("main", gsword_snd_interrupt) | |
| 757 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 758 | 758 | |
| 759 | 759 | MDRV_MACHINE_RESET(josvolly) |
| 760 | 760 |
| r1877 | r1878 | |
|---|---|---|
| 245 | 245 | { |
| 246 | 246 | if (ACCESSING_LSB) |
| 247 | 247 | { |
| 248 | soundlatch_w(0,data & 0xff); | |
| 249 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 248 | soundlatch_w(machine,0,data & 0xff); | |
| 249 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 250 | 250 | } |
| 251 | 251 | } |
| 252 | 252 | |
| r1877 | r1878 | |
| 805 | 805 | tilemap_set_transparent_pen(fg_tilemap,0); |
| 806 | 806 | } |
| 807 | 807 | |
| 808 | static void draw_sprites(running_machine *machine, | |
| 808 | static void draw_sprites(running_machine *machine, | |
| 809 | 809 | { |
| 810 | 810 | int offs; |
| 811 | 811 | |
| r1877 | r1878 | |
| 841 | 841 | } |
| 842 | 842 | } |
| 843 | 843 | |
| 844 | static void draw_bitmap( | |
| 844 | static void draw_bitmap( | |
| 845 | 845 | { |
| 846 | 846 | int yyy=256; |
| 847 | 847 | int xxx=512/4; |
| r1877 | r1878 | |
| 985 | 985 | /* basic machine hardware */ |
| 986 | 986 | MDRV_CPU_ADD_TAG("main", M68000, 16000000) /* 16 MHz */ |
| 987 | 987 | MDRV_CPU_PROGRAM_MAP(nmg5_map,0) |
| 988 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 988 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 989 | 989 | |
| 990 | 990 | MDRV_CPU_ADD_TAG("sound", Z80, 4000000) /* 4 MHz */ |
| 991 | 991 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 90 | 90 | ***************************************************************************/ |
| 91 | 91 | |
| 92 | 92 | #include "driver.h" |
| 93 | #include "deprecat.h" | |
| 94 | 93 | #include "machine/z80dma.h" |
| 95 | 94 | |
| 96 | 95 | #include "mario.h" |
| 97 | 96 | |
| 98 | static UINT8 mario_dma_read_byte(offs_t offset); | |
| 99 | static void mario_dma_write_byte(offs_t offset, UINT8 data); | |
| 97 | static Z80DMA_READ(mario_dma_read_byte); | |
| 98 | static Z80DMA_WRITE(mario_dma_write_byte); | |
| 100 | 99 | |
| 101 | 100 | /************************************* |
| 102 | 101 | * |
| r1877 | r1878 | |
| 104 | 103 | * |
| 105 | 104 | *************************************/ |
| 106 | 105 | |
| 107 | static const | |
| 106 | static const | |
| 108 | 107 | { |
| 109 | 108 | 0, |
| 110 | 109 | Z80_CLOCK, |
| r1877 | r1878 | |
| 120 | 119 | * |
| 121 | 120 | *************************************/ |
| 122 | 121 | |
| 123 | static MACHINE_START( mario ) | |
| 124 | { | |
| 125 | z80dma_init(1); | |
| 126 | z80dma_config(0, &mario_dma); | |
| 127 | } | |
| 128 | ||
| 129 | static MACHINE_RESET( mario ) | |
| 130 | { | |
| 131 | z80dma_reset(); | |
| 132 | } | |
| 133 | ||
| 134 | 122 | /************************************* |
| 135 | 123 | * |
| 136 | 124 | * DMA handling |
| 137 | 125 | * |
| 138 | 126 | *************************************/ |
| 139 | 127 | |
| 140 | static | |
| 128 | static Z | |
| 141 | 129 | { |
| 142 | 130 | UINT8 result; |
| 143 | 131 | |
| r1877 | r1878 | |
| 148 | 136 | return result; |
| 149 | 137 | } |
| 150 | 138 | |
| 151 | static | |
| 139 | static Z80DMA_WRITE(mario_dma_write_byte | |
| 152 | 140 | { |
| 153 | 141 | cpuintrf_push_context(0); |
| 154 | 142 | program_write_byte(offset, data); |
| r1877 | r1878 | |
| 361 | 349 | MDRV_CPU_ADD_TAG("main", Z80, Z80_CLOCK) /* verified on pcb */ |
| 362 | 350 | MDRV_CPU_PROGRAM_MAP(mario_map, 0) |
| 363 | 351 | MDRV_CPU_IO_MAP(0,mario_writeport) |
| 364 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 352 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 365 | 353 | |
| 366 | MDRV_MACHINE_START(mario) | |
| 367 | MDRV_MACHINE_RESET(mario) | |
| 354 | /* devices */ | |
| 355 | MDRV_DEVICE_ADD(Z80DMA_DEV_0_TAG, Z80DMA) | |
| 356 | MDRV_DEVICE_CONFIG(mario_dma) | |
| 368 | 357 | |
| 369 | 358 | /* video hardware */ |
| 370 | 359 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 397 | 386 | MDRV_CPU_REPLACE("main", Z80, 4000000) /* 4.000 MHz (?) */ |
| 398 | 387 | MDRV_CPU_PROGRAM_MAP(masao_map, 0) |
| 399 | 388 | MDRV_CPU_IO_MAP(0,mario_writeport) |
| 400 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 389 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 401 | 390 | |
| 402 | 391 | /* sound hardware */ |
| 403 | 392 | MDRV_IMPORT_FROM(masao_audio) |
| r1877 | r1878 | |
|---|---|---|
| 76 | 76 | /* bit 6 is EEPROM data */ |
| 77 | 77 | /* bit 7 is EEPROM ready */ |
| 78 | 78 | /* bit 14 is service button */ |
| 79 | res = (EEPROM_read_bit() << 6) | input_port_2_word_r(0,0); | |
| 79 | res = (EEPROM_read_bit() << 6) | input_port_2_word_r(machine,0,0); | |
| 80 | 80 | if (init_eeprom_count) |
| 81 | 81 | { |
| 82 | 82 | init_eeprom_count--; |
| r1877 | r1878 | |
| 93 | 93 | /* bit 6 is EEPROM data */ |
| 94 | 94 | /* bit 7 is EEPROM ready */ |
| 95 | 95 | /* bit 14 is service button */ |
| 96 | res = (EEPROM_read_bit() << 6) | input_port_2_word_r(0,0); | |
| 96 | res = (EEPROM_read_bit() << 6) | input_port_2_word_r(machine,0,0); | |
| 97 | 97 | if (init_eeprom_count) |
| 98 | 98 | { |
| 99 | 99 | init_eeprom_count--; |
| r1877 | r1878 | |
| 129 | 129 | |
| 130 | 130 | static READ16_HANDLER( sound_status_r ) |
| 131 | 131 | { |
| 132 | return soundlatch2_r(0); | |
| 132 | return soundlatch2_r(machine,0); | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | static WRITE16_HANDLER( sound_cmd_w ) |
| 136 | 136 | { |
| 137 | 137 | if (ACCESSING_LSB) { |
| 138 | 138 | data &= 0xff; |
| 139 | soundlatch_w(0, data); | |
| 139 | soundlatch_w(machine, 0, data); | |
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | static WRITE16_HANDLER( sound_irq_w ) |
| 144 | 144 | { |
| 145 | cpunum_set_input_line( | |
| 145 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | //int xmen_irqenabled; |
| r1877 | r1878 | |
| 151 | 151 | { |
| 152 | 152 | if(ACCESSING_LSB) { |
| 153 | 153 | /* bit 2 is interrupt enable */ |
| 154 | interrupt_enable_w(0,data & 0x04); | |
| 154 | interrupt_enable_w(machine,0,data & 0x04); | |
| 155 | 155 | // xmen_irqenabled = data; |
| 156 | 156 | } |
| 157 | 157 | } |
| r1877 | r1878 | |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | |
| 173 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 174 | AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM) | |
| 175 | AM_RANGE(0x080000, 0x0fffff) AM_READ(MRA16_ROM) | |
| 176 | AM_RANGE(0x100000, 0x100fff) AM_READ(K053247_word_r) | |
| 177 | AM_RANGE(0x101000, 0x101fff) AM_READ(MRA16_RAM) | |
| 178 | AM_RANGE(0x104000, 0x104fff) AM_READ(MRA16_RAM) | |
| 179 | AM_RANGE(0x108054, 0x108055) AM_READ(sound_status_r) | |
| 180 | AM_RANGE(0x10a000, 0x10a001) AM_READ(input_port_0_word_r) | |
| 181 | AM_RANGE(0x10a002, 0x10a003) AM_READ(input_port_1_word_r) | |
| 182 | AM_RANGE(0x10a004, 0x10a005) AM_READ(eeprom_r) | |
| 183 | AM_RANGE(0x10a00c, 0x10a00d) AM_READ(K053246_word_r) | |
| 184 | AM_RANGE(0x110000, 0x113fff) AM_READ(MRA16_RAM) /* main RAM */ | |
| 185 | AM_RANGE(0x18c000, 0x197fff) AM_READ(K052109_lsb_r) | |
| 186 | ||
| 187 | ||
| 188 | ADDRESS_MAP_END | |
| 189 | ||
| 190 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 191 | AM_RANGE(0x000000, 0x03ffff) AM_WRITE(MWA16_ROM) | |
| 192 | AM_RANGE(0x080000, 0x0fffff) AM_WRITE(MWA16_ROM) | |
| 193 | AM_RANGE(0x100000, 0x100fff) AM_WRITE(K053247_word_w) | |
| 194 | AM_RANGE(0x101000, 0x101fff) AM_WRITE(MWA16_RAM) | |
| 195 | AM_RANGE(0x104000, 0x104fff) AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 173 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 174 | AM_RANGE(0x000000, 0x03ffff) AM_ROM | |
| 175 | AM_RANGE(0x080000, 0x0fffff) AM_ROM | |
| 176 | AM_RANGE(0x100000, 0x100fff) AM_READWRITE(K053247_word_r, K053247_word_w) | |
| 177 | AM_RANGE(0x101000, 0x101fff) AM_RAM | |
| 178 | AM_RANGE(0x104000, 0x104fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 196 | 179 | AM_RANGE(0x108000, 0x108001) AM_WRITE(eeprom_w) |
| 197 | 180 | AM_RANGE(0x108020, 0x108027) AM_WRITE(K053246_word_w) |
| 198 | 181 | AM_RANGE(0x10804c, 0x10804d) AM_WRITE(sound_cmd_w) |
| 199 | 182 | AM_RANGE(0x10804e, 0x10804f) AM_WRITE(sound_irq_w) |
| 183 | AM_RANGE(0x108054, 0x108055) AM_READ(sound_status_r) | |
| 200 | 184 | AM_RANGE(0x108060, 0x10807f) AM_WRITE(K053251_lsb_w) |
| 201 | AM_RANGE(0x10a000, 0x10a001) AM_WRITE(watchdog_reset16_w) | |
| 202 | AM_RANGE(0x110000, 0x113fff) AM_WRITE(MWA16_RAM) /* main RAM */ | |
| 185 | AM_RANGE(0x10a000, 0x10a001) AM_READWRITE(input_port_0_word_r, watchdog_reset16_w) | |
| 186 | AM_RANGE(0x10a002, 0x10a003) AM_READ(input_port_1_word_r) | |
| 187 | AM_RANGE(0x10a004, 0x10a005) AM_READ(eeprom_r) | |
| 188 | AM_RANGE(0x10a00c, 0x10a00d) AM_READ(K053246_word_r) | |
| 189 | AM_RANGE(0x110000, 0x113fff) AM_RAM /* main RAM */ | |
| 203 | 190 | AM_RANGE(0x18fa00, 0x18fa01) AM_WRITE(xmen_18fa00_w) |
| 204 | AM_RANGE(0x18c000, 0x197fff) AM_WRITE(K052109_lsb_w) | |
| 205 | ||
| 191 | AM_RANGE(0x18c000, 0x197fff) AM_READWRITE(K052109_lsb_r, K052109_lsb_w) | |
| 206 | 192 | ADDRESS_MAP_END |
| 207 | 193 | |
| 208 | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 209 | AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM) | |
| 194 | static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 195 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 210 | 196 | AM_RANGE(0x8000, 0xbfff) AM_READ(MRA8_BANK4) |
| 211 | AM_RANGE(0xc000, 0xdfff) AM_READ(MRA8_RAM) | |
| 212 | AM_RANGE(0xe000, 0xe22f) AM_READ(K054539_0_r) | |
| 213 | AM_RANGE(0xec01, 0xec01) AM_READ(YM2151_status_port_0_r) | |
| 214 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_r) | |
| 215 | ADDRESS_MAP_END | |
| 216 | ||
| 217 | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 218 | AM_RANGE(0x0000, 0xbfff) AM_WRITE(MWA8_ROM) | |
| 219 | AM_RANGE(0xc000, 0xdfff) AM_WRITE(MWA8_RAM) | |
| 220 | AM_RANGE(0xe000, 0xe22f) AM_WRITE(K054539_0_w) | |
| 197 | AM_RANGE(0x8000, 0xbfff) AM_WRITE(MWA8_ROM) | |
| 198 | AM_RANGE(0xc000, 0xdfff) AM_RAM | |
| 199 | AM_RANGE(0xe000, 0xe22f) AM_READWRITE(K054539_0_r, K054539_0_w) | |
| 221 | 200 | AM_RANGE(0xe800, 0xe800) AM_WRITE(YM2151_register_port_0_w) |
| 222 | AM_RANGE(0xec01, 0xec01) AM_WRITE(YM2151_data_port_0_w) | |
| 201 | AM_RANGE(0xec01, 0xec01) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w) | |
| 223 | 202 | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch2_w) |
| 203 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_r) | |
| 224 | 204 | AM_RANGE(0xf800, 0xf800) AM_WRITE(sound_bankswitch_w) |
| 225 | 205 | ADDRESS_MAP_END |
| 226 | 206 | |
| 227 | /* 6p version */ | |
| 228 | 207 | |
| 229 | static ADDRESS_MAP_START( readmem6p, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 230 | AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM) | |
| 231 | AM_RANGE(0x080000, 0x0fffff) AM_READ(MRA16_ROM) | |
| 232 | AM_RANGE(0x100000, 0x100fff) AM_READ(MRA16_RAM) /* 1st sprite list on 6p */ | |
| 233 | AM_RANGE(0x101000, 0x101fff) AM_READ(MRA16_RAM) | |
| 234 | ||
| 235 | ||
| 236 | AM_RANGE(0x102000, 0x102fff) AM_READ(MRA16_RAM) /* 2nd sprite list on 6p */ | |
| 237 | AM_RANGE(0x102000, 0x103fff) AM_READ(MRA16_RAM) /* 6p - a buffer? */ | |
| 238 | ||
| 239 | ||
| 240 | AM_RANGE(0x104000, 0x104fff) AM_READ(MRA16_RAM) | |
| 241 | AM_RANGE(0x108054, 0x108055) AM_READ(sound_status_r) | |
| 242 | AM_RANGE(0x10a000, 0x10a001) AM_READ(input_port_0_word_r) | |
| 243 | AM_RANGE(0x10a002, 0x10a003) AM_READ(input_port_1_word_r) | |
| 244 | AM_RANGE(0x10a004, 0x10a005) AM_READ(xmen6p_eeprom_r) | |
| 245 | AM_RANGE(0x10a006, 0x10a007) AM_READ(input_port_3_word_r) | |
| 246 | AM_RANGE(0x10a00c, 0x10a00d) AM_READ(K053246_word_r) /* sprites */ | |
| 247 | AM_RANGE(0x110000, 0x113fff) AM_READ(MRA16_RAM) /* main RAM */ | |
| 248 | AM_RANGE(0x18c000, 0x197fff) AM_READ(MRA16_RAM) /* left tilemap */ | |
| 249 | ||
| 250 | /* | |
| 251 | AM_RANGE(0x1ac000, 0x1af7ff) AM_READ(MRA16_RAM) | |
| 252 | AM_RANGE(0x1b0000, 0x1b37ff) AM_READ(MRA16_RAM) | |
| 253 | AM_RANGE(0x1b4000, 0x1b77ff) AM_READ(MRA16_RAM) | |
| 254 | */ | |
| 255 | AM_RANGE(0x1ac000, 0x1b7fff) AM_READ(MRA16_RAM) /* right tilemap */ | |
| 256 | ||
| 257 | ||
| 258 | /* what are the regions below buffers? (used by hw or software?) */ | |
| 259 | /* | |
| 260 | AM_RANGE(0x1cc000, 0x1cf7ff) AM_READ(MRA16_RAM) | |
| 261 | AM_RANGE(0x1d0000, 0x1d37ff) AM_READ(MRA16_RAM) | |
| 262 | */ | |
| 263 | AM_RANGE(0x1cc000, 0x1d7fff) AM_READ(MRA16_RAM) /* tilemap ?*/ | |
| 264 | ||
| 265 | /* | |
| 266 | AM_RANGE(0x1ec000, 0x1ef7ff) AM_READ(MRA16_RAM) | |
| 267 | AM_RANGE(0x1f0000, 0x1f37ff) AM_READ(MRA16_RAM) | |
| 268 | AM_RANGE(0x1f4000, 0x1f77ff) AM_READ(MRA16_RAM) | |
| 269 | */ | |
| 270 | AM_RANGE(0x1ec000, 0x1f7fff) AM_READ(MRA16_RAM) /* tilemap ?*/ | |
| 271 | ||
| 272 | ADDRESS_MAP_END | |
| 273 | ||
| 208 | /* 6p version */ | |
| 274 | 209 | UINT16*xmen6p_spriteramleft; |
| 275 | 210 | UINT16*xmen6p_spriteramright; |
| 276 | 211 | UINT16*xmen6p_tilemapleft; |
| 277 | 212 | UINT16*xmen6p_tilemapright; |
| 278 | 213 | |
| 279 | static ADDRESS_MAP_START( writemem6p, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 280 | AM_RANGE(0x000000, 0x03ffff) AM_WRITE(MWA16_ROM) | |
| 281 | AM_RANGE(0x080000, 0x0fffff) AM_WRITE(MWA16_ROM) | |
| 282 | AM_RANGE(0x100000, 0x100fff) AM_WRITE(MWA16_RAM) AM_BASE(&xmen6p_spriteramleft) /* sprites (screen 1) */ | |
| 283 | AM_RANGE(0x101000, 0x101fff) AM_WRITE(MWA16_RAM) | |
| 284 | ||
| 285 | AM_RANGE(0x102000, 0x102fff) AM_WRITE(MWA16_RAM) AM_BASE(&xmen6p_spriteramright)/* sprites (screen 2) */ | |
| 286 | AM_RANGE(0x103000, 0x103fff) AM_WRITE(MWA16_RAM) | |
| 287 | ||
| 288 | AM_RANGE(0x104000, 0x104fff) AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 214 | static ADDRESS_MAP_START( 6p_main_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 215 | AM_RANGE(0x000000, 0x03ffff) AM_ROM | |
| 216 | AM_RANGE(0x080000, 0x0fffff) AM_ROM | |
| 217 | AM_RANGE(0x100000, 0x100fff) AM_RAM AM_BASE(&xmen6p_spriteramleft) /* sprites (screen 1) */ | |
| 218 | AM_RANGE(0x101000, 0x101fff) AM_RAM | |
| 219 | AM_RANGE(0x102000, 0x102fff) AM_RAM AM_BASE(&xmen6p_spriteramright) /* sprites (screen 2) */ | |
| 220 | AM_RANGE(0x103000, 0x103fff) AM_RAM /* 6p - a buffer? */ | |
| 221 | AM_RANGE(0x104000, 0x104fff) AM_READWRITE(MRA16_RAM,paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) | |
| 289 | 222 | AM_RANGE(0x108000, 0x108001) AM_WRITE(eeprom_w) |
| 290 | 223 | AM_RANGE(0x108020, 0x108027) AM_WRITE(K053246_word_w) /* sprites */ |
| 291 | 224 | AM_RANGE(0x10804c, 0x10804d) AM_WRITE(sound_cmd_w) |
| 292 | 225 | AM_RANGE(0x10804e, 0x10804f) AM_WRITE(sound_irq_w) |
| 226 | AM_RANGE(0x108054, 0x108055) AM_READ(sound_status_r) | |
| 293 | 227 | AM_RANGE(0x108060, 0x10807f) AM_WRITE(K053251_lsb_w) |
| 294 | AM_RANGE(0x10a000, 0x10a001) AM_WRITE(watchdog_reset16_w) | |
| 295 | AM_RANGE(0x110000, 0x113fff) AM_WRITE(MWA16_RAM) /* main RAM */ | |
| 228 | AM_RANGE(0x10a000, 0x10a001) AM_READWRITE(input_port_0_word_r,watchdog_reset16_w) | |
| 229 | AM_RANGE(0x10a002, 0x10a003) AM_READ(input_port_1_word_r) | |
| 230 | AM_RANGE(0x10a004, 0x10a005) AM_READ(xmen6p_eeprom_r) | |
| 231 | AM_RANGE(0x10a006, 0x10a007) AM_READ(input_port_3_word_r) | |
| 232 | AM_RANGE(0x10a00c, 0x10a00d) AM_READ(K053246_word_r) /* sprites */ | |
| 233 | AM_RANGE(0x110000, 0x113fff) AM_RAM /* main RAM */ | |
| 296 | 234 | AM_RANGE(0x18fa00, 0x18fa01) AM_WRITE(xmen_18fa00_w) |
| 297 | AM_RANGE(0x18c000, 0x197fff) AM_WRITE(MWA16_RAM/*K052109_lsb_w*/) AM_BASE(&xmen6p_tilemapleft) /* left tilemap (p1,p2,p3 counters) */ | |
| 298 | ||
| 235 | /* AM_RANGE(0x18c000, 0x197fff) AM_WRITE(K052109_lsb_w) AM_BASE(&xmen6p_tilemapleft) */ | |
| 236 | AM_RANGE(0x18c000, 0x197fff) AM_RAM AM_BASE(&xmen6p_tilemapleft) /* left tilemap (p1,p2,p3 counters) */ | |
| 299 | 237 | /* |
| 238 | AM_RANGE(0x1ac000, 0x1af7ff) AM_READ(MRA16_RAM) | |
| 300 | 239 | AM_RANGE(0x1ac000, 0x1af7ff) AM_WRITE(MWA16_RAM) |
| 240 | ||
| 241 | AM_RANGE(0x1b0000, 0x1b37ff) AM_READ(MRA16_RAM) | |
| 301 | 242 | AM_RANGE(0x1b0000, 0x1b37ff) AM_WRITE(MWA16_RAM) |
| 243 | ||
| 244 | AM_RANGE(0x1b4000, 0x1b77ff) AM_READ(MRA16_RAM) | |
| 302 | 245 | AM_RANGE(0x1b4000, 0x1b77ff) AM_WRITE(MWA16_RAM) |
| 303 | 246 | */ |
| 304 | AM_RANGE(0x1ac000, 0x1b7fff) AM_ | |
| 247 | AM_RANGE(0x1ac000, 0x1b7fff) AM_ | |
| 305 | 248 | |
| 306 | /* whats the stuff below, buffers? */ | |
| 307 | ||
| 249 | /* what are the regions below buffers? (used by hw or software?) */ | |
| 308 | 250 | /* |
| 251 | AM_RANGE(0x1cc000, 0x1cf7ff) AM_READ(MRA16_RAM) | |
| 309 | 252 | AM_RANGE(0x1cc000, 0x1cf7ff) AM_WRITE(MWA16_RAM) |
| 253 | ||
| 254 | AM_RANGE(0x1d0000, 0x1d37ff) AM_READ(MRA16_RAM) | |
| 310 | 255 | AM_RANGE(0x1d0000, 0x1d37ff) AM_WRITE(MWA16_RAM) |
| 311 | 256 | */ |
| 312 | AM_RANGE(0x1cc000, 0x1d7fff) AM_ | |
| 257 | AM_RANGE(0x1cc000, 0x1d7fff) AM_ | |
| 313 | 258 | |
| 259 | /* whats the stuff below, buffers? */ | |
| 314 | 260 | /* |
| 261 | AM_RANGE(0x1ec000, 0x1ef7ff) AM_READ(MRA16_RAM) | |
| 315 | 262 | AM_RANGE(0x1ec000, 0x1ef7ff) AM_WRITE(MWA16_RAM) |
| 263 | AM_RANGE(0x1f0000, 0x1f37ff) AM_READ(MRA16_RAM) | |
| 316 | 264 | AM_RANGE(0x1f0000, 0x1f37ff) AM_WRITE(MWA16_RAM) |
| 265 | AM_RANGE(0x1f4000, 0x1f77ff) AM_READ(MRA16_RAM) | |
| 317 | 266 | AM_RANGE(0x1f4000, 0x1f77ff) AM_WRITE(MWA16_RAM) |
| 318 | 267 | */ |
| 319 | AM_RANGE(0x1ec000, 0x1f7fff) AM_WRITE(MWA16_RAM) /* tilemap? */ | |
| 320 | ||
| 268 | AM_RANGE(0x1ec000, 0x1f7fff) AM_RAM /* tilemap ? */ | |
| 321 | 269 | ADDRESS_MAP_END |
| 322 | 270 | |
| 323 | 271 | |
| 324 | ||
| 325 | 272 | static INPUT_PORTS_START( xmen ) |
| 326 | 273 | PORT_START /* IN1 */ |
| 327 | 274 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| r1877 | r1878 | |
| 523 | 470 | |
| 524 | 471 | /* basic machine hardware */ |
| 525 | 472 | MDRV_CPU_ADD(M68000, 16000000) /* ? */ |
| 526 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 527 | MDRV_CPU_VBLANK_INT(xmen_interrupt,2) | |
| 473 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 474 | MDRV_CPU_VBLANK_INT_HACK(xmen_interrupt,2) | |
| 528 | 475 | |
| 529 | 476 | MDRV_CPU_ADD(Z80,8000000) /* verified with M1, guessed but accurate */ |
| 530 | 477 | /* audio CPU */ /* ????? */ |
| 531 | MDRV_CPU_PROGRAM_MAP(sound_ | |
| 478 | MDRV_CPU_PROGRAM_MAP(sound_ | |
| 532 | 479 | |
| 533 | 480 | MDRV_MACHINE_START(xmen) |
| 534 | 481 | |
| r1877 | r1878 | |
| 591 | 538 | |
| 592 | 539 | /* basic machine hardware */ |
| 593 | 540 | MDRV_CPU_ADD(M68000, 16000000) /* ? */ |
| 594 | MDRV_CPU_PROGRAM_MAP(readmem6p,writemem6p) | |
| 595 | MDRV_CPU_VBLANK_INT(xmen6p_interrupt,2) | |
| 541 | MDRV_CPU_PROGRAM_MAP(6p_main_map,0) | |
| 542 | MDRV_CPU_VBLANK_INT_HACK(xmen6p_interrupt,2) | |
| 596 | 543 | |
| 597 | 544 | MDRV_CPU_ADD(Z80,8000000) /* verified with M1, guessed but accurate */ |
| 598 | 545 | /* audio CPU */ /* ????? */ |
| 599 | MDRV_CPU_PROGRAM_MAP(sound_ | |
| 546 | MDRV_CPU_PROGRAM_MAP(sound_ | |
| 600 | 547 | |
| 601 | 548 | |
| 602 | 549 | MDRV_NVRAM_HANDLER(xmen) |
| r1877 | r1878 | |
|---|---|---|
| 103 | 103 | ***************************************************************************/ |
| 104 | 104 | |
| 105 | 105 | #include "driver.h" |
| 106 | #include "deprecat.h" | |
| 106 | 107 | #include "atarifb.h" |
| 107 | 108 | #include "sound/discrete.h" |
| 108 | 109 | |
| r1877 | r1878 | |
| 561 | 562 | /* basic machine hardware */ |
| 562 | 563 | MDRV_CPU_ADD_TAG("main", M6502, 750000) |
| 563 | 564 | MDRV_CPU_PROGRAM_MAP(atarifb_map,0) |
| 564 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 565 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 565 | 566 | |
| 566 | 567 | /* video hardware */ |
| 567 | 568 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 161 | 161 | |
| 162 | 162 | static READ32_HANDLER(silk_6295_0_r) |
| 163 | 163 | { |
| 164 | return OKIM6295_status_0_r(0)<<16; | |
| 164 | return OKIM6295_status_0_r(machine, 0)<<16; | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | static WRITE32_HANDLER(silk_6295_0_w) |
| r1877 | r1878 | |
| 169 | 169 | if (!(mem_mask & 0x00ff0000)) |
| 170 | 170 | { |
| 171 | 171 | logerror("OKI0: write %x mem_mask %8x\n", data>>16, mem_mask); |
| 172 | OKIM6295_data_0_w(0, (data>>16) & 0xff); | |
| 172 | OKIM6295_data_0_w(machine, 0, (data>>16) & 0xff); | |
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | static READ32_HANDLER(silk_6295_1_r) |
| 177 | 177 | { |
| 178 | return OKIM6295_status_1_r(0)<<16; | |
| 178 | return OKIM6295_status_1_r(machine, 0)<<16; | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | static WRITE32_HANDLER(silk_6295_1_w) |
| r1877 | r1878 | |
| 183 | 183 | if (!(mem_mask & 0x00ff0000)) |
| 184 | 184 | { |
| 185 | 185 | logerror("OKI1: write %x mem_mask %8x\n", data>>16, mem_mask); |
| 186 | OKIM6295_data_1_w(0, (data>>16) & 0xff); | |
| 186 | OKIM6295_data_1_w(machine, 0, (data>>16) & 0xff); | |
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | static READ32_HANDLER(silk_ym_r) |
| 191 | 191 | { |
| 192 | return YM2151_status_port_0_r(0)<<16; | |
| 192 | return YM2151_status_port_0_r(machine, 0)<<16; | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | static WRITE32_HANDLER(silk_ym_regport_w) |
| 196 | 196 | { |
| 197 | 197 | if (!(mem_mask & 0x00ff0000)) |
| 198 | 198 | { |
| 199 | YM2151_register_port_0_w(0, (data>>16) & 0xff); | |
| 199 | YM2151_register_port_0_w(machine, 0, (data>>16) & 0xff); | |
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | |
| r1877 | r1878 | |
| 204 | 204 | { |
| 205 | 205 | if (!(mem_mask & 0x00ff0000)) |
| 206 | 206 | { |
| 207 | YM2151_data_port_0_w(0, (data>>16) & 0xff); | |
| 207 | YM2151_data_port_0_w(machine, 0, (data>>16) & 0xff); | |
| 208 | 208 | } |
| 209 | 209 | } |
| 210 | 210 | |
| r1877 | r1878 | |
| 373 | 373 | /* basic machine hardware */ |
| 374 | 374 | MDRV_CPU_ADD(M68EC020, 16000000) |
| 375 | 375 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 376 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 376 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 377 | 377 | |
| 378 | 378 | /* video hardware */ |
| 379 | 379 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 320 | 320 | MDRV_CPU_ADD(Z80, 12000000 / 4) |
| 321 | 321 | MDRV_CPU_PROGRAM_MAP(wink_map,0) |
| 322 | 322 | MDRV_CPU_IO_MAP(wink_io,0) |
| 323 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 323 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 324 | 324 | |
| 325 | 325 | MDRV_CPU_ADD(Z80, 12000000 / 8) |
| 326 | 326 | MDRV_CPU_PROGRAM_MAP(wink_sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 230 | 230 | |
| 231 | 231 | static READ8_HANDLER( control2_r ) |
| 232 | 232 | { |
| 233 | return 0x02 | EEPROM_read_bit() | (input_port_1_r(0) & 0xf0); | |
| 233 | return 0x02 | EEPROM_read_bit() | (input_port_1_r(machine,0) & 0xf0); | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | static WRITE8_HANDLER( control2_w ) |
| r1877 | r1878 | |
| 257 | 257 | |
| 258 | 258 | static WRITE8_HANDLER( sound_cmd_w ) |
| 259 | 259 | { |
| 260 | soundlatch_w(0, data); | |
| 260 | soundlatch_w(machine, 0, data); | |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | static WRITE8_HANDLER( sound_irq_w ) |
| r1877 | r1878 | |
| 301 | 301 | case 0x44: |
| 302 | 302 | case 0x45: |
| 303 | 303 | case 0x46: |
| 304 | return K053244_r(offset-0x40); | |
| 304 | return K053244_r(machine,offset-0x40); | |
| 305 | 305 | break; |
| 306 | 306 | |
| 307 | 307 | case 0x80: |
| r1877 | r1878 | |
| 336 | 336 | case 0x9d: |
| 337 | 337 | case 0x9e: |
| 338 | 338 | case 0x9f: |
| 339 | return K054000_r(offset-0x80); | |
| 339 | return K054000_r(machine,offset-0x80); | |
| 340 | 340 | break; |
| 341 | 341 | |
| 342 | 342 | case 0xca: |
| 343 | return sound_status_r(0); | |
| 343 | return sound_status_r(machine,0); | |
| 344 | 344 | break; |
| 345 | 345 | } |
| 346 | 346 | } |
| 347 | 347 | else if (offset < 0x1800) |
| 348 | return K053245_r((offset - 0x0800) & 0x07ff); | |
| 348 | return K053245_r(machine,(offset - 0x0800) & 0x07ff); | |
| 349 | 349 | else if (offset < 0x2000) |
| 350 | return K056832_ram_code_lo_r(offset - 0x1800); | |
| 350 | return K056832_ram_code_lo_r(machine,offset - 0x1800); | |
| 351 | 351 | else if (offset < 0x2800) |
| 352 | return K056832_ram_code_hi_r(offset - 0x2000); | |
| 352 | return K056832_ram_code_hi_r(machine,offset - 0x2000); | |
| 353 | 353 | else if (offset < 0x3000) |
| 354 | return K056832_ram_attr_lo_r(offset - 0x2800); | |
| 354 | return K056832_ram_attr_lo_r(machine,offset - 0x2800); | |
| 355 | 355 | else // (offset < 0x3800) |
| 356 | return K056832_ram_attr_hi_r(offset - 0x3000); | |
| 356 | return K056832_ram_attr_hi_r(machine,offset - 0x3000); | |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | return 0; |
| r1877 | r1878 | |
| 363 | 363 | { |
| 364 | 364 | if (cur_control2 & 0x10) // RAM enable |
| 365 | 365 | { |
| 366 | paletteram_xBBBBBGGGGGRRRRR_be_w(offset,data); | |
| 366 | paletteram_xBBBBBGGGGGRRRRR_be_w(machine,offset,data); | |
| 367 | 367 | } |
| 368 | 368 | else |
| 369 | 369 | { |
| r1877 | r1878 | |
| 372 | 372 | switch (offset) |
| 373 | 373 | { |
| 374 | 374 | case 0xc6: |
| 375 | sound_cmd_w(0, data); | |
| 375 | sound_cmd_w(machine, 0, data); | |
| 376 | 376 | break; |
| 377 | 377 | |
| 378 | 378 | case 0xc7: |
| 379 | sound_irq_w(0, data); | |
| 379 | sound_irq_w(machine, 0, data); | |
| 380 | 380 | break; |
| 381 | 381 | |
| 382 | 382 | case 0x40: |
| r1877 | r1878 | |
| 386 | 386 | case 0x44: |
| 387 | 387 | case 0x45: |
| 388 | 388 | case 0x46: |
| 389 | K053244_w(offset-0x40, data); | |
| 389 | K053244_w(machine, offset-0x40, data); | |
| 390 | 390 | break; |
| 391 | 391 | |
| 392 | 392 | case 0x80: |
| r1877 | r1878 | |
| 421 | 421 | case 0x9d: |
| 422 | 422 | case 0x9e: |
| 423 | 423 | case 0x9f: |
| 424 | K054000_w(offset-0x80, data); | |
| 424 | K054000_w(machine, offset-0x80, data); | |
| 425 | 425 | break; |
| 426 | 426 | |
| 427 | 427 | default: |
| r1877 | r1878 | |
| 431 | 431 | } |
| 432 | 432 | else if (offset < 0x1800) |
| 433 | 433 | { |
| 434 | K053245_w((offset - 0x0800) & 0x07ff, data); | |
| 434 | K053245_w(machine, (offset - 0x0800) & 0x07ff, data); | |
| 435 | 435 | |
| 436 | 436 | } |
| 437 | 437 | else if (offset < 0x2000) |
| 438 | K056832_ram_code_lo_w(offset - 0x1800, data); | |
| 438 | K056832_ram_code_lo_w(machine, offset - 0x1800, data); | |
| 439 | 439 | else if (offset < 0x2800) |
| 440 | K056832_ram_code_hi_w(offset - 0x2000, data); | |
| 440 | K056832_ram_code_hi_w(machine, offset - 0x2000, data); | |
| 441 | 441 | else if (offset < 0x3000) |
| 442 | K056832_ram_attr_lo_w(offset - 0x2800, data); | |
| 442 | K056832_ram_attr_lo_w(machine, offset - 0x2800, data); | |
| 443 | 443 | else // (offset < 0x3800) |
| 444 | K056832_ram_attr_hi_w(offset - 0x3000, data); | |
| 444 | K056832_ram_attr_hi_w(machine, offset - 0x3000, data); | |
| 445 | 445 | } |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | // use one more palette entry for the BG color |
| 449 | 449 | static WRITE8_HANDLER(le_bgcolor_w) |
| 450 | 450 | { |
| 451 | paletteram_xBBBBBGGGGGRRRRR_be_w(0x3800+offset, data); | |
| 451 | paletteram_xBBBBBGGGGGRRRRR_be_w(machine,0x3800+offset, data); | |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | static READ8_HANDLER(guns_r) |
| r1877 | r1878 | |
| 656 | 656 | /* basic machine hardware */ |
| 657 | 657 | MDRV_CPU_ADD_TAG("main", HD6309, MAIN_CLOCK/2) // ??? |
| 658 | 658 | MDRV_CPU_PROGRAM_MAP(le_main, 0) |
| 659 | MDRV_CPU_VBLANK_INT(lethalen_interrupt | |
| 659 | MDRV_CPU_VBLANK_INT("main", lethalen_interrupt | |
| 660 | 660 | |
| 661 | 661 | MDRV_CPU_ADD_TAG("sound", Z80, 8000000) |
| 662 | 662 | MDRV_CPU_PROGRAM_MAP(le_sound, 0) |
| r1877 | r1878 | |
|---|---|---|
| 72 | 72 | |
| 73 | 73 | /* both output latches are cleared on reset */ |
| 74 | 74 | |
| 75 | videopin_out1_w(0, 0); | |
| 76 | videopin_out2_w(0, 0); | |
| 75 | videopin_out1_w(machine, 0, 0); | |
| 76 | videopin_out2_w(machine, 0, 0); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
| r1877 | r1878 | |
| 134 | 134 | if (i == 7) |
| 135 | 135 | set_led_status(0, data & 8); /* start button */ |
| 136 | 136 | |
| 137 | cpunum_set_input_line( | |
| 137 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | |
| r1877 | r1878 | |
| 152 | 152 | mask = ~data & 0x10; |
| 153 | 153 | |
| 154 | 154 | if (mask) |
| 155 | cpunum_set_input_line( | |
| 155 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 156 | 156 | |
| 157 | 157 | coin_lockout_global_w(~data & 0x08); |
| 158 | 158 | |
| 159 | 159 | /* Convert octave data to divide value and write to sound */ |
| 160 | discrete_sound_w(VIDEOPIN_OCTAVE_DATA, (0x01 << (~data & 0x07)) & 0xfe); | |
| 160 | discrete_sound_w(machine, VIDEOPIN_OCTAVE_DATA, (0x01 << (~data & 0x07)) & 0xfe); | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | |
| r1877 | r1878 | |
| 174 | 174 | |
| 175 | 175 | coin_counter_w(0, data & 0x10); |
| 176 | 176 | |
| 177 | discrete_sound_w(VIDEOPIN_BELL_EN, data & 0x40); // Bell | |
| 178 | discrete_sound_w(VIDEOPIN_BONG_EN, data & 0x20); // Bong | |
| 179 | discrete_sound_w(VIDEOPIN_ATTRACT_EN, data & 0x80); // Attract | |
| 180 | discrete_sound_w(VIDEOPIN_VOL_DATA, data & 0x07); // Vol0,1,2 | |
| 177 | discrete_sound_w(machine, VIDEOPIN_BELL_EN, data & 0x40); // Bell | |
| 178 | discrete_sound_w(machine, VIDEOPIN_BONG_EN, data & 0x20); // Bong | |
| 179 | discrete_sound_w(machine, VIDEOPIN_ATTRACT_EN, data & 0x80); // Attract | |
| 180 | discrete_sound_w(machine, VIDEOPIN_VOL_DATA, data & 0x07); // Vol0,1,2 | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | |
| 184 | 184 | static WRITE8_HANDLER( videopin_note_dvsr_w ) |
| 185 | 185 | { |
| 186 | 186 | /* note data */ |
| 187 | discrete_sound_w(VIDEOPIN_NOTE_DATA, ~data &0xff); | |
| 187 | discrete_sound_w(machine, VIDEOPIN_NOTE_DATA, ~data &0xff); | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 |
| r1877 | r1878 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | static WRITE8_HANDLER( sound_cpu_command_w ) |
| 101 | 101 | { |
| 102 | soundlatch_w(0,data); | |
| 103 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 102 | soundlatch_w(machine,0,data); | |
| 103 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | static READ8_HANDLER( vblank_r ) |
| r1877 | r1878 | |
| 307 | 307 | /* basic machine hardware */ |
| 308 | 308 | MDRV_CPU_ADD(M6502, 4000000) /* 4 MHz ??? */ |
| 309 | 309 | MDRV_CPU_PROGRAM_MAP(master_map, 0) |
| 310 | MDRV_CPU_VBLANK_INT(exprraid_interrupt | |
| 310 | MDRV_CPU_VBLANK_INT("main", exprraid_interrupt | |
| 311 | 311 | |
| 312 | 312 | MDRV_CPU_ADD(M6809, 2000000) /* 2 MHz ??? */ |
| 313 | 313 | MDRV_CPU_PROGRAM_MAP(slave_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 62 | 62 | { |
| 63 | 63 | if (ACCESSING_LSB) |
| 64 | 64 | { |
| 65 | soundlatch_w(0x00,data & 0xff); | |
| 66 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 65 | soundlatch_w(machine,0x00,data & 0xff); | |
| 66 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| r1877 | r1878 | |
| 443 | 443 | /* basic machine hardware */ |
| 444 | 444 | MDRV_CPU_ADD(M68000,24000000/2) /* 12MHz */ |
| 445 | 445 | MDRV_CPU_PROGRAM_MAP(fstarfrc_readmem,fstarfrc_writemem) |
| 446 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 446 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 447 | 447 | |
| 448 | 448 | MDRV_CPU_ADD(Z80,8000000/2) |
| 449 | 449 | /* audio CPU */ /* 4MHz */ |
| r1877 | r1878 | |
| 484 | 484 | /* basic machine hardware */ |
| 485 | 485 | MDRV_CPU_ADD(M68000,24000000/2) /* 12MHz */ |
| 486 | 486 | MDRV_CPU_PROGRAM_MAP(ginkun_readmem,ginkun_writemem) |
| 487 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 487 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 488 | 488 | |
| 489 | 489 | MDRV_CPU_ADD(Z80,8000000/2) |
| 490 | 490 | /* audio CPU */ /* 4MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 195 | 195 | static MACHINE_DRIVER_START( drill ) |
| 196 | 196 | MDRV_CPU_ADD_TAG("main", M68000, 16000000 ) |
| 197 | 197 | MDRV_CPU_PROGRAM_MAP(drill_map,0) |
| 198 | MDRV_CPU_VBLANK_INT(drill_interrupt | |
| 198 | MDRV_CPU_VBLANK_INT("main", drill_interrupt | |
| 199 | 199 | MDRV_GFXDECODE(2mindril) |
| 200 | 200 | |
| 201 | 201 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | |
| 130 | 130 | #include "driver.h" |
| 131 | #include "deprecat.h" | |
| 131 | 132 | #include "cpu/z80/z80.h" |
| 132 | 133 | #include "sound/2413intf.h" |
| 133 | 134 | |
| r1877 | r1878 | |
| 737 | 738 | MDRV_CPU_ADD_TAG("main",Z80, 3579545) |
| 738 | 739 | MDRV_CPU_PROGRAM_MAP(map,0) |
| 739 | 740 | MDRV_CPU_IO_MAP(cpoker_map,0) |
| 740 | MDRV_CPU_VBLANK_INT(cpoker_interrupt,8) | |
| 741 | MDRV_CPU_VBLANK_INT_HACK(cpoker_interrupt,8) | |
| 741 | 742 | |
| 742 | 743 | MDRV_MACHINE_RESET(cpk) |
| 743 | 744 | |
| r1877 | r1878 | |
| 768 | 769 | MDRV_CPU_MODIFY("main") |
| 769 | 770 | /* basic machine hardware */ |
| 770 | 771 | MDRV_CPU_IO_MAP(csk227_map,0) |
| 771 | MDRV_CPU_VBLANK_INT(cska_interrupt,8) | |
| 772 | MDRV_CPU_VBLANK_INT_HACK(cska_interrupt,8) | |
| 772 | 773 | MDRV_GFXDECODE(csk) |
| 773 | 774 | |
| 774 | 775 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
| 779 | 780 | MDRV_CPU_MODIFY("main") |
| 780 | 781 | /* basic machine hardware */ |
| 781 | 782 | MDRV_CPU_IO_MAP(csk234_map,0) |
| 782 | MDRV_CPU_VBLANK_INT(cska_interrupt,8) | |
| 783 | MDRV_CPU_VBLANK_INT_HACK(cska_interrupt,8) | |
| 783 | 784 | MDRV_GFXDECODE(csk) |
| 784 | 785 | |
| 785 | 786 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
|---|---|---|
| 111 | 111 | |
| 112 | 112 | static READ8_HANDLER( in0_port_r ) |
| 113 | 113 | { |
| 114 | int in0 = input_port_0_r(0); | |
| 114 | int in0 = input_port_0_r(machine,0); | |
| 115 | 115 | |
| 116 | 116 | if ( naughtyb_cocktail ) |
| 117 | 117 | { |
| 118 | 118 | // cabinet == cocktail -AND- handling player 2 |
| 119 | 119 | |
| 120 | 120 | in0 = ( in0 & 0x03 ) | // start buttons |
| 121 | ( input_port_1_r(0) & 0xFC ); // cocktail inputs | |
| 121 | ( input_port_1_r(machine,0) & 0xFC ); // cocktail inputs | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | return in0; |
| r1877 | r1878 | |
| 128 | 128 | { |
| 129 | 129 | // vblank replaces the cabinet dip |
| 130 | 130 | |
| 131 | return ( ( input_port_2_r(0) & 0x7F ) | // dsw0 | |
| 132 | ( input_port_3_r(0) & 0x80 ) ); // vblank | |
| 131 | return ( ( input_port_2_r(machine,0) & 0x7F ) | // dsw0 | |
| 132 | ( input_port_3_r(machine,0) & 0x80 ) ); // vblank | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /* Pop Flamer |
| r1877 | r1878 | |
| 381 | 381 | /* basic machine hardware */ |
| 382 | 382 | MDRV_CPU_ADD(Z80, CLOCK_XTAL / 4) /* 12 MHz clock, divided by 4. CPU is a Z80A */ |
| 383 | 383 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 384 | MDRV_CPU_VBLANK_INT(naughtyb_interrupt | |
| 384 | MDRV_CPU_VBLANK_INT("main", naughtyb_interrupt | |
| 385 | 385 | |
| 386 | 386 | /* video hardware */ |
| 387 | 387 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 418 | 418 | /* basic machine hardware */ |
| 419 | 419 | MDRV_CPU_ADD(Z80, CLOCK_XTAL / 4) /* 12 MHz clock, divided by 4. CPU is a Z80A */ |
| 420 | 420 | MDRV_CPU_PROGRAM_MAP(readmem,popflame_writemem) |
| 421 | MDRV_CPU_VBLANK_INT(naughtyb_interrupt | |
| 421 | MDRV_CPU_VBLANK_INT("main", naughtyb_interrupt | |
| 422 | 422 | |
| 423 | 423 | /* video hardware */ |
| 424 | 424 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | static void draw_char(running_machine *machine, | |
| 40 | static void draw_char(running_machine *machine, | |
| 41 | 41 | { |
| 42 | 42 | int i,j; |
| 43 | 43 | UINT8 *dp; |
| r1877 | r1878 | |
| 86 | 86 | |
| 87 | 87 | static READ8_HANDLER(at_dma8237_1_r) |
| 88 | 88 | { |
| 89 | return dma8237_1_r(offset / 2); | |
| 89 | return dma8237_1_r(machine, offset / 2); | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | static WRITE8_HANDLER(at_dma8237_1_w) |
| 93 | 93 | { |
| 94 | dma8237_1_w(offset / 2, data); | |
| 94 | dma8237_1_w(machine, offset / 2, data); | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | static READ32_HANDLER(at32_dma8237_1_r) |
| 98 | 98 | { |
| 99 | return read32le_with_read8_handler(at_dma8237_1_r, offset, mem_mask); | |
| 99 | return read32le_with_read8_handler(at_dma8237_1_r, machine, offset, mem_mask); | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | static WRITE32_HANDLER(at32_dma8237_1_w) |
| 103 | 103 | { |
| 104 | write32le_with_write8_handler(at_dma8237_1_w, offset, data, mem_mask); | |
| 104 | write32le_with_write8_handler(at_dma8237_1_w, machine, offset, data, mem_mask); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| r1877 | r1878 | |
| 269 | 269 | |
| 270 | 270 | static READ32_HANDLER( ide0_r ) |
| 271 | 271 | { |
| 272 | return ide_controller32_0_r(0x1f0/4 + offset, mem_mask); | |
| 272 | return ide_controller32_0_r(machine, 0x1f0/4 + offset, mem_mask); | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | static WRITE32_HANDLER( ide0_w ) |
| 276 | 276 | { |
| 277 | ide_controller32_0_w(0x1f0/4 + offset, data, mem_mask); | |
| 277 | ide_controller32_0_w(machine, 0x1f0/4 + offset, data, mem_mask); | |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | static READ32_HANDLER( fdc_r ) |
| 281 | 281 | { |
| 282 | return ide_controller32_0_r(0x3f0/4 + offset, mem_mask); | |
| 282 | return ide_controller32_0_r(machine, 0x3f0/4 + offset, mem_mask); | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | static WRITE32_HANDLER( fdc_w ) |
| 286 | 286 | { |
| 287 | 287 | //mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask); |
| 288 | ide_controller32_0_w(0x3f0/4 + offset, data, mem_mask); | |
| 288 | ide_controller32_0_w(machine, 0x3f0/4 + offset, data, mem_mask); | |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | |
| r1877 | r1878 | |
| 529 | 529 | |
| 530 | 530 | /*****************************************************************************/ |
| 531 | 531 | |
| 532 | GAME(1997, pf2012, 0, taitowlf, taitowlf, taitowlf, ROT0, "Taito", "Psychic Force 2012", GAME_NOT_WORKING | GAME_NO_SOUND) | |
| 532 | GAME(1997, pf2012, 0, taitowlf, taitowlf, taitowlf, ROT0, "Taito", "Psychic Force 2012", GAME_NOT_WORKING | GAME_NO_SOUND) |
| r1877 | r1878 | |
|---|---|---|
| 137 | 137 | static WRITE8_HANDLER( toypop_sound_sharedram_w ) |
| 138 | 138 | { |
| 139 | 139 | if (offset < 0x40) |
| 140 | namco_15xx_w(offset,data); | |
| 140 | namco_15xx_w(machine,offset,data); | |
| 141 | 141 | else |
| 142 | 142 | namco_soundregs[offset] = data; |
| 143 | 143 | } |
| r1877 | r1878 | |
| 571 | 571 | /* basic machine hardware */ |
| 572 | 572 | MDRV_CPU_ADD_TAG("main", M6809, 1536000) /* 1.536 MHz (measured on Libble Rabble board) */ |
| 573 | 573 | MDRV_CPU_PROGRAM_MAP(readmem_mainCPU_liblrabl,writemem_mainCPU_liblrabl) |
| 574 | MDRV_CPU_VBLANK_INT(toypop_main_interrupt | |
| 574 | MDRV_CPU_VBLANK_INT("main", toypop_main_interrupt | |
| 575 | 575 | |
| 576 | 576 | MDRV_CPU_ADD(M6809, 1536000) |
| 577 | 577 | /* audio CPU */ |
| 578 | 578 | MDRV_CPU_PROGRAM_MAP(readmem_soundCPU,writemem_soundCPU) |
| 579 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 579 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 580 | 580 | |
| 581 | 581 | MDRV_CPU_ADD(M68000, 6144000) /* 6.144 MHz (measured on Libble Rabble board) */ |
| 582 | 582 | MDRV_CPU_PROGRAM_MAP(readmem_68k,writemem_68k) |
| 583 | MDRV_CPU_VBLANK_INT(toypop_m68000_interrupt | |
| 583 | MDRV_CPU_VBLANK_INT("main", toypop_m68000_interrupt | |
| 584 | 584 | |
| 585 | 585 | MDRV_INTERLEAVE(100) /* 100 CPU slices per frame - an high value to ensure proper */ |
| 586 | 586 | /* synchronization of the CPUs */ |
| r1877 | r1878 | |
|---|---|---|
| 316 | 316 | |
| 317 | 317 | static WRITE16_HANDLER( tumblepb_oki_w ) |
| 318 | 318 | { |
| 319 | ||
| 320 | ||
| 321 | 319 | if (mem_mask==0x0000) |
| 322 | 320 | { |
| 323 | OKIM6295_data_0_w(0,data&0xff); | |
| 321 | OKIM6295_data_0_w(machine,0,data&0xff); | |
| 324 | 322 | //printf("tumbleb_oki_w %04x %04x\n",data,mem_mask); |
| 325 | 323 | } |
| 326 | 324 | else |
| 327 | 325 | { |
| 328 | OKIM6295_data_0_w(0,(data>>8)&0xff); | |
| 326 | OKIM6295_data_0_w(machine,0,(data>>8)&0xff); | |
| 329 | 327 | //printf("tumbleb_oki_w %04x %04x\n",data,mem_mask); |
| 330 | 328 | } |
| 331 | 329 | /* STUFF IN OTHER BYTE TOO..*/ |
| r1877 | r1878 | |
| 339 | 337 | #ifdef UNUSED_FUNCTION |
| 340 | 338 | static WRITE16_HANDLER( tumblepb_sound_w ) |
| 341 | 339 | { |
| 342 | soundlatch_w(0,data & 0xff); | |
| 340 | soundlatch_w(machine,0,data & 0xff); | |
| 343 | 341 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); |
| 344 | 342 | } |
| 345 | 343 | #endif |
| 346 | 344 | |
| 347 | 345 | static WRITE16_HANDLER( jumppop_sound_w ) |
| 348 | 346 | { |
| 349 | soundlatch_w(0,data & 0xff); | |
| 350 | cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE ); | |
| 347 | soundlatch_w(machine,0,data & 0xff); | |
| 348 | cpunum_set_input_line(machine, 1, 0, ASSERT_LINE ); | |
| 351 | 349 | } |
| 352 | 350 | |
| 353 | 351 | /******************************************************************************/ |
| r1877 | r1878 | |
| 444 | 442 | static int tumblep_music_bank; |
| 445 | 443 | static int tumbleb2_music_is_playing; |
| 446 | 444 | |
| 447 | static void tumbleb2_playmusic( | |
| 445 | static void tumbleb2_playmusic(running_machine *machine) | |
| 448 | 446 | { |
| 449 | int status = OKIM6295_status_0_r(0); | |
| 447 | int status = OKIM6295_status_0_r(machine,0); | |
| 450 | 448 | |
| 451 | 449 | if (tumbleb2_music_is_playing) |
| 452 | 450 | { |
| 453 | 451 | if ((status&0x08)==0x00) |
| 454 | 452 | { |
| 455 | OKIM6295_data_0_w(0,0x80|tumblep_music_command); | |
| 456 | OKIM6295_data_0_w(0,0x00|0x82); | |
| 453 | OKIM6295_data_0_w(machine,0,0x80|tumblep_music_command); | |
| 454 | OKIM6295_data_0_w(machine,0,0x00|0x82); | |
| 457 | 455 | } |
| 458 | 456 | } |
| 459 | 457 | } |
| r1877 | r1878 | |
| 462 | 460 | static INTERRUPT_GEN( tumbleb2_interrupt ) |
| 463 | 461 | { |
| 464 | 462 | cpunum_set_input_line(machine, 0, 6, HOLD_LINE); |
| 465 | tumbleb2_playmusic(); | |
| 463 | tumbleb2_playmusic(machine); | |
| 466 | 464 | } |
| 467 | 465 | |
| 468 | 466 | static const int tumbleb_sound_lookup[256] = { |
| r1877 | r1878 | |
| 492 | 490 | memcpy(&oki[0x38000], &oki[0x80000+0x38000+0x8000*bank],0x8000); |
| 493 | 491 | } |
| 494 | 492 | |
| 495 | static void tumbleb2_play_sound (int data) | |
| 493 | static void tumbleb2_play_sound (running_machine *machine, int data) | |
| 496 | 494 | { |
| 497 | int status = OKIM6295_status_0_r(0); | |
| 495 | int status = OKIM6295_status_0_r(machine,0); | |
| 498 | 496 | |
| 499 | 497 | if ((status&0x01)==0x00) |
| 500 | 498 | { |
| 501 | OKIM6295_data_0_w(0,0x80|data); | |
| 502 | OKIM6295_data_0_w(0,0x00|0x12); | |
| 499 | OKIM6295_data_0_w(machine,0,0x80|data); | |
| 500 | OKIM6295_data_0_w(machine,0,0x00|0x12); | |
| 503 | 501 | } |
| 504 | 502 | else if ((status&0x02)==0x00) |
| 505 | 503 | { |
| 506 | OKIM6295_data_0_w(0,0x80|data); | |
| 507 | OKIM6295_data_0_w(0,0x00|0x22); | |
| 504 | OKIM6295_data_0_w(machine,0,0x80|data); | |
| 505 | OKIM6295_data_0_w(machine,0,0x00|0x22); | |
| 508 | 506 | } |
| 509 | 507 | else if ((status&0x04)==0x00) |
| 510 | 508 | { |
| 511 | OKIM6295_data_0_w(0,0x80|data); | |
| 512 | OKIM6295_data_0_w(0,0x00|0x42); | |
| 509 | OKIM6295_data_0_w(machine,0,0x80|data); | |
| 510 | OKIM6295_data_0_w(machine,0,0x00|0x42); | |
| 513 | 511 | } |
| 514 | 512 | } |
| 515 | 513 | |
| r1877 | r1878 | |
| 525 | 523 | // bank 7 = how to play? |
| 526 | 524 | // bank 8 = boss??? |
| 527 | 525 | |
| 528 | static void process_tumbleb2_music_command(int data) | |
| 526 | static void process_tumbleb2_music_command(running_machine *machine, int data) | |
| 529 | 527 | { |
| 530 | int status = OKIM6295_status_0_r(0); | |
| 528 | int status = OKIM6295_status_0_r(machine,0); | |
| 531 | 529 | |
| 532 | 530 | if (data == 1) // stop? |
| 533 | 531 | { |
| 534 | 532 | if ((status&0x08)==0x08) |
| 535 | 533 | { |
| 536 | OKIM6295_data_0_w(0,0x40); /* Stop playing music */ | |
| 534 | OKIM6295_data_0_w(machine,0,0x40); /* Stop playing music */ | |
| 537 | 535 | tumbleb2_music_is_playing = 0; |
| 538 | 536 | } |
| 539 | 537 | } |
| r1877 | r1878 | |
| 542 | 540 | if (tumbleb2_music_is_playing != data) |
| 543 | 541 | { |
| 544 | 542 | tumbleb2_music_is_playing = data; |
| 545 | OKIM6295_data_0_w(0,0x40); // stop the current music | |
| 543 | OKIM6295_data_0_w(machine,0,0x40); // stop the current music | |
| 546 | 544 | switch (data) |
| 547 | 545 | { |
| 548 | 546 | case 0x04: // map screen |
| r1877 | r1878 | |
| 616 | 614 | break; |
| 617 | 615 | } |
| 618 | 616 | tumbleb2_set_music_bank(tumblep_music_bank); |
| 619 | tumbleb2_playmusic(); | |
| 617 | tumbleb2_playmusic(machine); | |
| 620 | 618 | |
| 621 | 619 | } |
| 622 | 620 | |
| r1877 | r1878 | |
| 638 | 636 | } |
| 639 | 637 | else if (sound == -2) |
| 640 | 638 | { |
| 641 | process_tumbleb2_music_command(data); | |
| 639 | process_tumbleb2_music_command(machine, data); | |
| 642 | 640 | } |
| 643 | 641 | else |
| 644 | 642 | { |
| 645 | tumbleb2_play_sound(sound); | |
| 643 | tumbleb2_play_sound(machine, sound); | |
| 646 | 644 | } |
| 647 | 645 | } |
| 648 | 646 | |
| r1877 | r1878 | |
| 768 | 766 | |
| 769 | 767 | static WRITE16_HANDLER( jumpkids_sound_w ) |
| 770 | 768 | { |
| 771 | soundlatch_w(0,data & 0xff); | |
| 772 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 769 | soundlatch_w(machine,0,data & 0xff); | |
| 770 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 773 | 771 | } |
| 774 | 772 | |
| 775 | 773 | |
| r1877 | r1878 | |
| 851 | 849 | { |
| 852 | 850 | if (ACCESSING_LSB) |
| 853 | 851 | { |
| 854 | soundlatch_w(0,data & 0xff); | |
| 852 | soundlatch_w(machine,0,data & 0xff); | |
| 855 | 853 | // needed for Super Trio which reads the sound with polling |
| 856 | 854 | // cpu_spinuntil_time(ATTOTIME_IN_USEC(100)); |
| 857 | 855 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(20)); |
| r1877 | r1878 | |
| 896 | 894 | |
| 897 | 895 | static READ8_HANDLER(jumppop_z80latch_r) |
| 898 | 896 | { |
| 899 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 900 | return soundlatch_r(0); | |
| 897 | cpunum_set_input_line(machine, 1, 0, CLEAR_LINE); | |
| 898 | return soundlatch_r(machine, 0); | |
| 901 | 899 | } |
| 902 | 900 | |
| 903 | 901 | static ADDRESS_MAP_START( jumppop_sound_io_map, ADDRESS_SPACE_IO, 8 ) |
| r1877 | r1878 | |
| 1783 | 1781 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1784 | 1782 | INPUT_PORTS_END |
| 1785 | 1783 | |
| 1784 | #ifdef UNUSED_DEFINITION | |
| 1786 | 1785 | static INPUT_PORTS_START( dquizgo ) |
| 1787 | 1786 | PORT_START /* Player 1 controls */ |
| 1788 | 1787 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| r1877 | r1878 | |
| 1853 | 1852 | PORT_DIPSETTING( 0x40, "4" ) |
| 1854 | 1853 | PORT_DIPSETTING( 0x80, "5" ) |
| 1855 | 1854 | INPUT_PORTS_END |
| 1855 | #endif | |
| 1856 | 1856 | |
| 1857 | 1857 | static INPUT_PORTS_START( jumppop ) |
| 1858 | 1858 | PORT_START /* Controls */ |
| r1877 | r1878 | |
| 2032 | 2032 | /* basic machine hardware */ |
| 2033 | 2033 | MDRV_CPU_ADD(M68000, 14000000) |
| 2034 | 2034 | MDRV_CPU_PROGRAM_MAP(tumblepopb_readmem,tumblepopb_writemem) |
| 2035 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 2035 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 2036 | 2036 | |
| 2037 | 2037 | /* video hardware */ |
| 2038 | 2038 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 2062 | 2062 | /* basic machine hardware */ |
| 2063 | 2063 | MDRV_CPU_ADD(M68000, 14000000) |
| 2064 | 2064 | MDRV_CPU_PROGRAM_MAP(tumblepopb_readmem,tumblepopb_writemem) |
| 2065 | MDRV_CPU_VBLANK_INT(tumbleb2_interrupt | |
| 2065 | MDRV_CPU_VBLANK_INT("main", tumbleb2_interrupt | |
| 2066 | 2066 | |
| 2067 | 2067 | /* video hardware */ |
| 2068 | 2068 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 2091 | 2091 | /* basic machine hardware */ |
| 2092 | 2092 | MDRV_CPU_ADD(M68000, 12000000) |
| 2093 | 2093 | MDRV_CPU_PROGRAM_MAP(jumpkids_readmem,jumpkids_writemem) |
| 2094 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 2094 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 2095 | 2095 | |
| 2096 | 2096 | /* z80? */ |
| 2097 | 2097 | MDRV_CPU_ADD( Z80, 8000000/2) |
| r1877 | r1878 | |
| 2123 | 2123 | /* basic machine hardware */ |
| 2124 | 2124 | MDRV_CPU_ADD(M68000, 12000000) |
| 2125 | 2125 | MDRV_CPU_PROGRAM_MAP(fncywld_readmem,fncywld_writemem) |
| 2126 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 2126 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 2127 | 2127 | |
| 2128 | 2128 | /* video hardware */ |
| 2129 | 2129 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 2181 | 2181 | /* basic machine hardware */ |
| 2182 | 2182 | MDRV_CPU_ADD(M68000, 15000000) /* verified */ |
| 2183 | 2183 | MDRV_CPU_PROGRAM_MAP(htchctch_readmem,htchctch_writemem) |
| 2184 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 2184 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 2185 | 2185 | |
| 2186 | 2186 | MDRV_CPU_ADD( Z80, 15000000/4) /* verified on dquizgo */ |
| 2187 | 2187 | |
| r1877 | r1878 | |
| 2258 | 2258 | /* basic machine hardware */ |
| 2259 | 2259 | MDRV_CPU_ADD(M68000, 16000000) |
| 2260 | 2260 | MDRV_CPU_PROGRAM_MAP(jumppop_readmem,jumppop_writemem) |
| 2261 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 2261 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 2262 | 2262 | |
| 2263 | 2263 | MDRV_CPU_ADD(Z80, 3500000) /* verified */ |
| 2264 | 2264 | /* audio CPU */ |
| r1877 | r1878 | |
| 2297 | 2297 | /* basic machine hardware */ |
| 2298 | 2298 | MDRV_CPU_ADD(M68000, 14000000) /* 14mhz should be correct, but lots of sprite flicker later in game */ |
| 2299 | 2299 | MDRV_CPU_PROGRAM_MAP(suprtrio_main_cpu,0) |
| 2300 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 2300 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 2301 | 2301 | |
| 2302 | 2302 | MDRV_CPU_ADD(Z80, 8000000) |
| 2303 | 2303 | /* audio CPU */ |
| r1877 | r1878 | |
| 2331 | 2331 | /* basic machine hardware */ |
| 2332 | 2332 | MDRV_CPU_ADD(M68000, 14000000) |
| 2333 | 2333 | MDRV_CPU_PROGRAM_MAP(pangpang_readmem,pangpang_writemem) |
| 2334 | MDRV_CPU_VBLANK_INT(tumbleb2_interrupt | |
| 2334 | MDRV_CPU_VBLANK_INT("main", tumbleb2_interrupt | |
| 2335 | 2335 | |
| 2336 | 2336 | /* video hardware */ |
| 2337 | 2337 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | |
| 140 | static void micro3d_scanline_update(running_machine *machine, int screen, | |
| 140 | static void micro3d_scanline_update(running_machine *machine, int screen, | |
| 141 | 141 | { |
| 142 | 142 | UINT16 *src = µ3d_sprite_vram[(params->rowaddr << 8) & 0x7fe00]; |
| 143 | 143 | UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0); |
| r1877 | r1878 | |
| 796 | 796 | |
| 797 | 797 | if(data & 0x10) |
| 798 | 798 | { |
| 799 | upd7759_0_reset_w(0,0); | |
| 799 | upd7759_0_reset_w(machine,0,0); | |
| 800 | 800 | } |
| 801 | 801 | else |
| 802 | 802 | { |
| 803 | upd7759_0_reset_w(0,1); | |
| 803 | upd7759_0_reset_w(machine,0,1); | |
| 804 | 804 | } |
| 805 | 805 | break; |
| 806 | 806 | } |
| r1877 | r1878 | |
| 812 | 812 | switch(offset) |
| 813 | 813 | { |
| 814 | 814 | case 0x01: return readinputport(3); /* Test push switch */ |
| 815 | case 0x03: return (int)(upd7759_0_busy_r(0))<<3; | |
| 815 | case 0x03: return (int)(upd7759_0_busy_r(machine,0))<<3; | |
| 816 | 816 | default: return 0; |
| 817 | 817 | } |
| 818 | 818 | |
| r1877 | r1878 | |
| 861 | 861 | static MACHINE_DRIVER_START( micro3d ) |
| 862 | 862 | MDRV_CPU_ADD(M68000, 12000000 ) |
| 863 | 863 | MDRV_CPU_PROGRAM_MAP(hostmem,0) |
| 864 | MDRV_CPU_VBLANK_INT(micro3d_vblank | |
| 864 | MDRV_CPU_VBLANK_INT("main", micro3d_vblank | |
| 865 | 865 | |
| 866 | 866 | MDRV_CPU_ADD(TMS34010, 40000000) |
| 867 | 867 | MDRV_CPU_CONFIG(vgb_config) |
| r1877 | r1878 | |
|---|---|---|
| 253 | 253 | /* basic machine hardware */ |
| 254 | 254 | MDRV_CPU_ADD(Z80, 5000000) /* 5.0MHz */ |
| 255 | 255 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 256 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 256 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 257 | 257 | |
| 258 | 258 | MDRV_CPU_ADD(Z80, 2500000) |
| 259 | 259 | /* audio CPU */ /* 2.5MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | static WRITE8_HANDLER( sound_command_w ) { |
| 131 | soundlatch_w( 0, data ); | |
| 132 | cpunum_set_input_line_and_vector(Machine, 1, 0, HOLD_LINE, 0xff ); | |
| 131 | soundlatch_w( machine, 0, data ); | |
| 132 | cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0xff ); | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | static int msm_data = 0; |
| r1877 | r1878 | |
| 444 | 444 | MDRV_CPU_ADD(Z80, 3000000) /* 12MHz / 4 = 3.0 MHz */ |
| 445 | 445 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 446 | 446 | MDRV_CPU_IO_MAP(readport,writeport) |
| 447 | MDRV_CPU_VBLANK_INT(kc_interrupt | |
| 447 | MDRV_CPU_VBLANK_INT("main", kc_interrupt | |
| 448 | 448 | |
| 449 | 449 | MDRV_CPU_ADD(Z80, 3000000) |
| 450 | 450 | /* audio CPU */ /* 12MHz / 4 = 3.0 MHz */ |
| r1877 | r1878 | |
| 492 | 492 | MDRV_CPU_ADD(Z80, 3000000) /* 12MHz / 4 = 3.0 MHz */ |
| 493 | 493 | MDRV_CPU_PROGRAM_MAP(kc_readmem,kc_writemem) |
| 494 | 494 | MDRV_CPU_IO_MAP(kc_readport,kc_writeport) |
| 495 | MDRV_CPU_VBLANK_INT(kc_interrupt | |
| 495 | MDRV_CPU_VBLANK_INT("main", kc_interrupt | |
| 496 | 496 | |
| 497 | 497 | MDRV_CPU_ADD(Z80, 3000000) |
| 498 | 498 | /* audio CPU */ /* 12MHz / 4 = 3.0 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 92 | 92 | 8, 8, 32, 32); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | static void draw_sprites(running_machine *machine, | |
| 95 | static void draw_sprites(running_machine *machine, | |
| 96 | 96 | { |
| 97 | 97 | int offs; |
| 98 | 98 | |
| r1877 | r1878 | |
| 173 | 173 | for (c = 15;c >= 0;c--) |
| 174 | 174 | if (cmd & (1 << c)) break; |
| 175 | 175 | |
| 176 | if (c >= 0) soundlatch_w(0,15-c); | |
| 176 | if (c >= 0) soundlatch_w(machine,0,15-c); | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | |
| r1877 | r1878 | |
| 368 | 368 | /* basic machine hardware */ |
| 369 | 369 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz ?? */ |
| 370 | 370 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 371 | MDRV_CPU_VBLANK_INT(olibochu_interrupt,2) | |
| 371 | MDRV_CPU_VBLANK_INT_HACK(olibochu_interrupt,2) | |
| 372 | 372 | |
| 373 | 373 | MDRV_CPU_ADD(Z80, 4000000) |
| 374 | 374 | /* audio CPU */ /* 4 MHz ?? */ |
| 375 | 375 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 376 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 376 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 377 | 377 | |
| 378 | 378 | /* video hardware */ |
| 379 | 379 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 133 | 133 | |
| 134 | 134 | static WRITE8_HANDLER( ultratnk_fire_1_w ) |
| 135 | 135 | { |
| 136 | discrete_sound_w(ULTRATNK_FIRE_EN_1, offset & 1); | |
| 136 | discrete_sound_w(machine, ULTRATNK_FIRE_EN_1, offset & 1); | |
| 137 | 137 | } |
| 138 | 138 | static WRITE8_HANDLER( ultratnk_fire_2_w ) |
| 139 | 139 | { |
| 140 | discrete_sound_w(ULTRATNK_FIRE_EN_2, offset & 1); | |
| 140 | discrete_sound_w(machine, ULTRATNK_FIRE_EN_2, offset & 1); | |
| 141 | 141 | } |
| 142 | 142 | static WRITE8_HANDLER( ultratnk_attract_w ) |
| 143 | 143 | { |
| 144 | discrete_sound_w(ULTRATNK_ATTRACT_EN, data & 1); | |
| 144 | discrete_sound_w(machine, ULTRATNK_ATTRACT_EN, data & 1); | |
| 145 | 145 | } |
| 146 | 146 | static WRITE8_HANDLER( ultratnk_explosion_w ) |
| 147 | 147 | { |
| 148 | discrete_sound_w(ULTRATNK_EXPLOSION_DATA, data & 15); | |
| 148 | discrete_sound_w(machine, ULTRATNK_EXPLOSION_DATA, data & 15); | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 |
| r1877 | r1878 | |
|---|---|---|
| 25 | 25 | *****************************************************************************/ |
| 26 | 26 | |
| 27 | 27 | #include "driver.h" |
| 28 | #include "deprecat.h" | |
| 28 | 29 | #include "m92.h" |
| 29 | 30 | #include "machine/irem_cpu.h" |
| 30 | 31 | #include "audio/m72.h" |
| r1877 | r1878 | |
| 655 | 656 | MDRV_CPU_ADD_TAG("main", V30,32000000/4) |
| 656 | 657 | MDRV_CPU_PROGRAM_MAP(main_cpu,0) |
| 657 | 658 | MDRV_CPU_IO_MAP(main_cpu_io,0) |
| 658 | MDRV_CPU_VBLANK_INT(m90_interrupt | |
| 659 | MDRV_CPU_VBLANK_INT("main", m90_interrupt | |
| 659 | 660 | |
| 660 | 661 | MDRV_CPU_ADD(Z80, 3579545) |
| 661 | 662 | /* audio CPU */ /* 3.579545 MHz */ |
| 662 | 663 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 663 | 664 | MDRV_CPU_IO_MAP(sound_readport,sound_writeport) |
| 664 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 665 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 665 | 666 | /* IRQs are generated by main Z80 and YM2151 */ |
| 666 | 667 | |
| 667 | 668 | MDRV_MACHINE_RESET(m72_sound) |
| r1877 | r1878 | |
| 738 | 739 | |
| 739 | 740 | MDRV_CPU_PROGRAM_MAP(main_cpu,0) |
| 740 | 741 | MDRV_CPU_IO_MAP(main_cpu_io,0) |
| 741 | MDRV_CPU_VBLANK_INT(m90_interrupt | |
| 742 | MDRV_CPU_VBLANK_INT("main", m90_interrupt | |
| 742 | 743 | |
| 743 | 744 | MDRV_CPU_ADD(Z80, 3579545) |
| 744 | 745 | /* audio CPU */ /* 3.579545 MHz */ |
| 745 | 746 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 746 | 747 | MDRV_CPU_IO_MAP(sound_readport,sound_writeport) |
| 747 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 748 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 748 | 749 | /* IRQs are generated by main Z80 and YM2151 */ |
| 749 | 750 | MDRV_MACHINE_RESET(m72_sound) |
| 750 | 751 | |
| r1877 | r1878 | |
| 784 | 785 | |
| 785 | 786 | MDRV_CPU_PROGRAM_MAP(main_cpu,0) |
| 786 | 787 | MDRV_CPU_IO_MAP(main_cpu_io,0) |
| 787 | MDRV_CPU_VBLANK_INT(m90_interrupt | |
| 788 | MDRV_CPU_VBLANK_INT("main", m90_interrupt | |
| 788 | 789 | |
| 789 | 790 | MDRV_CPU_ADD(Z80, 3579545) |
| 790 | 791 | /* audio CPU */ /* 3.579545 MHz */ |
| 791 | 792 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 792 | 793 | MDRV_CPU_IO_MAP(bbmanw_sound_readport,bbmanw_sound_writeport) |
| 793 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 794 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 794 | 795 | /* IRQs are generated by main Z80 and YM2151 */ |
| 795 | 796 | MDRV_MACHINE_RESET(m72_sound) |
| 796 | 797 | |
| r1877 | r1878 | |
| 829 | 830 | MDRV_CPU_MODIFY("main") |
| 830 | 831 | MDRV_CPU_CONFIG(no_table) |
| 831 | 832 | |
| 832 | MDRV_CPU_VBLANK_INT(bomblord_interrupt | |
| 833 | MDRV_CPU_VBLANK_INT("main", bomblord_interrupt | |
| 833 | 834 | |
| 834 | 835 | MACHINE_DRIVER_END |
| 835 | 836 | |
| r1877 | r1878 | |
| 841 | 842 | MDRV_CPU_ADD_TAG("main", V30,32000000/4) |
| 842 | 843 | MDRV_CPU_PROGRAM_MAP(bootleg_main_cpu,0) |
| 843 | 844 | MDRV_CPU_IO_MAP(main_cpu_io,0) |
| 844 | MDRV_CPU_VBLANK_INT(m90_interrupt | |
| 845 | MDRV_CPU_VBLANK_INT("main", m90_interrupt | |
| 845 | 846 | |
| 846 | 847 | MDRV_CPU_ADD(Z80, 3579545) |
| 847 | 848 | /* audio CPU */ /* 3.579545 MHz */ |
| 848 | 849 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 849 | 850 | MDRV_CPU_IO_MAP(sound_readport,sound_writeport) |
| 850 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 851 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 851 | 852 | /* IRQs are generated by main Z80 and YM2151 */ |
| 852 | 853 | MDRV_MACHINE_RESET(m72_sound) |
| 853 | 854 |
| r1877 | r1878 | |
|---|---|---|
| 79 | 79 | if (offset<0x8 ) tugboat_ram[0x291d + 32*offset + 32*9] = data ^ 0x0f; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | static void draw_tilemap(running_machine *machine, | |
| 82 | static void draw_tilemap(running_machine *machine, | |
| 83 | 83 | int addr,int gfx0,int gfx1,int transparency) |
| 84 | 84 | { |
| 85 | 85 | int x,y; |
| r1877 | r1878 | |
| 374 | 374 | static MACHINE_DRIVER_START( tugboat ) |
| 375 | 375 | MDRV_CPU_ADD_TAG("main", M6502, 2000000) /* 2 MHz ???? */ |
| 376 | 376 | MDRV_CPU_PROGRAM_MAP(tugboat_readmem,tugboat_writemem) |
| 377 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 377 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 378 | 378 | |
| 379 | 379 | MDRV_MACHINE_START(tugboat) |
| 380 | 380 | MDRV_MACHINE_RESET(tugboat) |
| r1877 | r1878 | |
|---|---|---|
| 92 | 92 | { |
| 93 | 93 | case 0x00: |
| 94 | 94 | { |
| 95 | return (input_port_0_word_r(0,0) << 16) | input_port_1_word_r(0,0) | | |
| 95 | return (input_port_0_word_r(machine,0,0) << 16) | input_port_1_word_r(machine,0,0) | | |
| 96 | 96 | (EEPROM_read_bit() << 7); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | case 0x01: |
| 100 | 100 | { |
| 101 | return input_port_2_word_r(0,0) | (coin_word << 16); | |
| 101 | return input_port_2_word_r(machine,0,0) | (coin_word << 16); | |
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | logerror("CPU #0 PC %06x: read input %06x\n",activecpu_get_pc(),offset); |
| r1877 | r1878 | |
| 126 | 126 | { |
| 127 | 127 | if (ACCESSING_MSB32) /* $400000 is watchdog */ |
| 128 | 128 | { |
| 129 | watchdog_reset | |
| 129 | watchdog_reset | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (ACCESSING_LSB32) |
| r1877 | r1878 | |
| 175 | 175 | |
| 176 | 176 | static READ32_HANDLER( gunbustr_gun_r ) |
| 177 | 177 | { |
| 178 | return ( input_port_3_word_r(0,0) << 24) | (input_port_4_word_r(0,0) << 16) | | |
| 179 | ( input_port_5_word_r(0,0) << 8) | input_port_6_word_r(0,0); | |
| 178 | return ( input_port_3_word_r(machine,0,0) << 24) | (input_port_4_word_r(machine,0,0) << 16) | | |
| 179 | ( input_port_5_word_r(machine,0,0) << 8) | input_port_6_word_r(machine,0,0); | |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | static WRITE32_HANDLER( gunbustr_gun_w ) |
| r1877 | r1878 | |
| 377 | 377 | /* basic machine hardware */ |
| 378 | 378 | MDRV_CPU_ADD(M68EC020, 16000000) /* 16 MHz */ |
| 379 | 379 | MDRV_CPU_PROGRAM_MAP(gunbustr_readmem,gunbustr_writemem) |
| 380 | MDRV_CPU_VBLANK_INT(gunbustr_interrupt | |
| 380 | MDRV_CPU_VBLANK_INT("main", gunbustr_interrupt | |
| 381 | 381 | |
| 382 | 382 | TAITO_F3_SOUND_SYSTEM_CPU(16000000) |
| 383 | 383 |
| r1877 | r1878 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | static WRITE8_HANDLER( scotrsht_soundlatch_w ) |
| 39 | 39 | { |
| 40 | soundlatch_w(0,data); | |
| 41 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 40 | soundlatch_w(machine,0,data); | |
| 41 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | static ADDRESS_MAP_START( scotrsht_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 226 | 226 | /* basic machine hardware */ |
| 227 | 227 | MDRV_CPU_ADD(M6809, 18432000/6) /* 3.072 MHz */ |
| 228 | 228 | MDRV_CPU_PROGRAM_MAP(scotrsht_map,0) |
| 229 | MDRV_CPU_VBLANK_INT(scotrsht_interrupt | |
| 229 | MDRV_CPU_VBLANK_INT("main", scotrsht_interrupt | |
| 230 | 230 | |
| 231 | 231 | MDRV_CPU_ADD(Z80, 18432000/6) |
| 232 | 232 | /* audio CPU */ /* 3.072 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 1013 | 1013 | break; |
| 1014 | 1014 | |
| 1015 | 1015 | default: |
| 1016 | TC0220IOC_w( offset,data ); /* might be a 510NIO ! */ | |
| 1016 | TC0220IOC_w( machine,offset,data ); /* might be a 510NIO ! */ | |
| 1017 | 1017 | } |
| 1018 | 1018 | } |
| 1019 | 1019 | |
| r1877 | r1878 | |
| 1026 | 1026 | { |
| 1027 | 1027 | /* Bypass TC0220IOC controller for analog input */ |
| 1028 | 1028 | |
| 1029 | UINT8 port = TC0220IOC_port_r(0); /* read port number */ | |
| 1029 | UINT8 port = TC0220IOC_port_r(machine,0); /* read port number */ | |
| 1030 | 1030 | int steer = 0; |
| 1031 | int fake = input_port_6_word_r(0,0); | |
| 1031 | int fake = input_port_6_word_r(machine,0,0); | |
| 1032 | 1032 | |
| 1033 | 1033 | if (!(fake &0x10)) /* Analogue steer (the real control method) */ |
| 1034 | 1034 | { |
| 1035 | 1035 | /* center around zero and reduce span to 0xc0 */ |
| 1036 | steer = ((input_port_5_word_r(0,0) - 0x80) * 0xc0) / 0x100; | |
| 1036 | steer = ((input_port_5_word_r(machine,0,0) - 0x80) * 0xc0) / 0x100; | |
| 1037 | 1037 | |
| 1038 | 1038 | } |
| 1039 | 1039 | else /* Digital steer */ |
| r1877 | r1878 | |
| 1057 | 1057 | return steer >> 8; |
| 1058 | 1058 | |
| 1059 | 1059 | default: |
| 1060 | return TC0220IOC_portreg_r( offset ); | |
| 1060 | return TC0220IOC_portreg_r( machine,offset ); | |
| 1061 | 1061 | } |
| 1062 | 1062 | } |
| 1063 | 1063 | |
| r1877 | r1878 | |
| 1066 | 1066 | { |
| 1067 | 1067 | /* Bypass TC0220IOC controller for extra inputs */ |
| 1068 | 1068 | |
| 1069 | UINT8 port = TC0220IOC_port_r(0); /* read port number */ | |
| 1069 | UINT8 port = TC0220IOC_port_r(machine,0); /* read port number */ | |
| 1070 | 1070 | int steer = 0; |
| 1071 | int fake = input_port_10_word_r(0,0); | |
| 1071 | int fake = input_port_10_word_r(machine,0,0); | |
| 1072 | 1072 | |
| 1073 | 1073 | if (!(fake &0x10)) /* Analogue steer (the real control method) */ |
| 1074 | 1074 | { |
| 1075 | 1075 | /* center around zero */ |
| 1076 | steer = input_port_9_word_r(0,0) - 0x80; | |
| 1076 | steer = input_port_9_word_r(machine,0,0) - 0x80; | |
| 1077 | 1077 | } |
| 1078 | 1078 | else /* Digital steer */ |
| 1079 | 1079 | { |
| r1877 | r1878 | |
| 1090 | 1090 | switch (port) |
| 1091 | 1091 | { |
| 1092 | 1092 | case 0x08: |
| 1093 | return input_port_5_word_r(0,mem_mask); | |
| 1093 | return input_port_5_word_r(machine,0,mem_mask); | |
| 1094 | 1094 | |
| 1095 | 1095 | case 0x09: |
| 1096 | return input_port_6_word_r(0,mem_mask); | |
| 1096 | return input_port_6_word_r(machine,0,mem_mask); | |
| 1097 | 1097 | |
| 1098 | 1098 | case 0x0a: |
| 1099 | return input_port_7_word_r(0,mem_mask); | |
| 1099 | return input_port_7_word_r(machine,0,mem_mask); | |
| 1100 | 1100 | |
| 1101 | 1101 | case 0x0b: |
| 1102 | return input_port_8_word_r(0,mem_mask); | |
| 1102 | return input_port_8_word_r(machine,0,mem_mask); | |
| 1103 | 1103 | |
| 1104 | 1104 | case 0x0c: |
| 1105 | 1105 | return steer &0xff; |
| r1877 | r1878 | |
| 1108 | 1108 | return steer >> 8; |
| 1109 | 1109 | |
| 1110 | 1110 | default: |
| 1111 | return TC0220IOC_portreg_r( offset ); | |
| 1111 | return TC0220IOC_portreg_r( machine, offset ); | |
| 1112 | 1112 | } |
| 1113 | 1113 | } |
| 1114 | 1114 | |
| r1877 | r1878 | |
| 1118 | 1118 | switch (offset) |
| 1119 | 1119 | { |
| 1120 | 1120 | case 0x00: |
| 1121 | return input_port_5_word_r(0,mem_mask); | |
| 1121 | return input_port_5_word_r(machine,0,mem_mask); | |
| 1122 | 1122 | |
| 1123 | 1123 | case 0x01: |
| 1124 | return input_port_6_word_r(0,mem_mask); | |
| 1124 | return input_port_6_word_r(machine,0,mem_mask); | |
| 1125 | 1125 | |
| 1126 | 1126 | case 0x02: |
| 1127 | return input_port_7_word_r(0,mem_mask); | |
| 1127 | return input_port_7_word_r(machine,0,mem_mask); | |
| 1128 | 1128 | |
| 1129 | 1129 | case 0x03: |
| 1130 | return input_port_8_word_r(0,mem_mask); | |
| 1130 | return input_port_8_word_r(machine,0,mem_mask); | |
| 1131 | 1131 | } |
| 1132 | 1132 | |
| 1133 | 1133 | logerror("CPU #0 PC %06x: warning - read unmapped stick offset %06x\n",activecpu_get_pc(),offset); |
| r1877 | r1878 | |
| 1151 | 1151 | switch (offset) |
| 1152 | 1152 | { |
| 1153 | 1153 | case 0x00: |
| 1154 | return nightstr_stick[(input_port_5_word_r(0,mem_mask) * 0x64) / 0x100]; | |
| 1154 | return nightstr_stick[(input_port_5_word_r(machine,0,mem_mask) * 0x64) / 0x100]; | |
| 1155 | 1155 | |
| 1156 | 1156 | case 0x01: |
| 1157 | return nightstr_stick[(input_port_6_word_r(0,mem_mask) * 0x64) / 0x100]; | |
| 1157 | return nightstr_stick[(input_port_6_word_r(machine,0,mem_mask) * 0x64) / 0x100]; | |
| 1158 | 1158 | |
| 1159 | 1159 | case 0x02: |
| 1160 | return input_port_7_word_r(0,mem_mask); | |
| 1160 | return input_port_7_word_r(machine,0,mem_mask); | |
| 1161 | 1161 | |
| 1162 | 1162 | case 0x03: |
| 1163 | return input_port_8_word_r(0,mem_mask); | |
| 1163 | return input_port_8_word_r(machine,0,mem_mask); | |
| 1164 | 1164 | } |
| 1165 | 1165 | |
| 1166 | 1166 | logerror("CPU #0 PC %06x: warning - read unmapped stick offset %06x\n",activecpu_get_pc(),offset); |
| r1877 | r1878 | |
| 1183 | 1183 | static READ16_HANDLER( sci_steer_input_r ) |
| 1184 | 1184 | { |
| 1185 | 1185 | int steer = 0; |
| 1186 | int fake = input_port_6_word_r(0,0); | |
| 1186 | int fake = input_port_6_word_r(machine,0,0); | |
| 1187 | 1187 | |
| 1188 | 1188 | if (!(fake &0x10)) /* Analogue steer (the real control method) */ |
| 1189 | 1189 | { |
| 1190 | 1190 | /* center around zero and reduce span to 0xc0 */ |
| 1191 | steer = ((input_port_5_word_r(0,0) - 0x80) * 0xc0) / 0x100; | |
| 1191 | steer = ((input_port_5_word_r(machine,0,0) - 0x80) * 0xc0) / 0x100; | |
| 1192 | 1192 | } |
| 1193 | 1193 | else /* Digital steer */ |
| 1194 | 1194 | { |
| r1877 | r1878 | |
| 1225 | 1225 | return eeprom_r(); |
| 1226 | 1226 | |
| 1227 | 1227 | default: |
| 1228 | return TC0220IOC_r( offset ); /* might be a 510NIO ! */ | |
| 1228 | return TC0220IOC_r( machine, offset ); /* might be a 510NIO ! */ | |
| 1229 | 1229 | } |
| 1230 | 1230 | } |
| 1231 | 1231 | |
| r1877 | r1878 | |
| 1234 | 1234 | switch (offset) |
| 1235 | 1235 | { |
| 1236 | 1236 | case 0x00: |
| 1237 | return input_port_5_word_r(0,mem_mask); /* P1X */ | |
| 1237 | return input_port_5_word_r(machine,0,mem_mask); /* P1X */ | |
| 1238 | 1238 | |
| 1239 | 1239 | case 0x01: |
| 1240 | return input_port_6_word_r(0,mem_mask); /* P1Y */ | |
| 1240 | return input_port_6_word_r(machine,0,mem_mask); /* P1Y */ | |
| 1241 | 1241 | |
| 1242 | 1242 | case 0x02: |
| 1243 | return input_port_7_word_r(0,mem_mask); /* P2X */ | |
| 1243 | return input_port_7_word_r(machine,0,mem_mask); /* P2X */ | |
| 1244 | 1244 | |
| 1245 | 1245 | case 0x03: |
| 1246 | return input_port_8_word_r(0,mem_mask); /* P2Y */ | |
| 1246 | return input_port_8_word_r(machine,0,mem_mask); /* P2Y */ | |
| 1247 | 1247 | } |
| 1248 | 1248 | |
| 1249 | 1249 | return 0x0; |
| r1877 | r1878 | |
| 1266 | 1266 | static READ16_HANDLER( dblaxle_steer_input_r ) |
| 1267 | 1267 | { |
| 1268 | 1268 | int steer = 0; |
| 1269 | int fake = input_port_6_word_r(0,0); | |
| 1269 | int fake = input_port_6_word_r(machine,0,0); | |
| 1270 | 1270 | |
| 1271 | 1271 | if (!(fake &0x10)) /* Analogue steer (the real control method) */ |
| 1272 | 1272 | { |
| 1273 | 1273 | /* center around zero and reduce span to 0x80 */ |
| 1274 | steer = ((input_port_5_word_r(0,0) - 0x80) * 0x80) / 0x100; | |
| 1274 | steer = ((input_port_5_word_r(machine,0,0) - 0x80) * 0x80) / 0x100; | |
| 1275 | 1275 | } |
| 1276 | 1276 | else /* Digital steer */ |
| 1277 | 1277 | { |
| r1877 | r1878 | |
| 1349 | 1349 | static WRITE16_HANDLER( taitoz_sound_w ) |
| 1350 | 1350 | { |
| 1351 | 1351 | if (offset == 0) |
| 1352 | taitosound_port_w (0, data & 0xff); | |
| 1352 | taitosound_port_w (machine, 0, data & 0xff); | |
| 1353 | 1353 | else if (offset == 1) |
| 1354 | taitosound_comm_w (0, data & 0xff); | |
| 1354 | taitosound_comm_w (machine, 0, data & 0xff); | |
| 1355 | 1355 | |
| 1356 | 1356 | #ifdef MAME_DEBUG |
| 1357 | 1357 | // if (data & 0xff00) |
| r1877 | r1878 | |
| 1367 | 1367 | static READ16_HANDLER( taitoz_sound_r ) |
| 1368 | 1368 | { |
| 1369 | 1369 | if (offset == 1) |
| 1370 | return ((taitosound_comm_r (0) & 0xff)); | |
| 1370 | return ((taitosound_comm_r (machine,0) & 0xff)); | |
| 1371 | 1371 | else return 0; |
| 1372 | 1372 | } |
| 1373 | 1373 | |
| r1877 | r1878 | |
| 2835 | 2835 | /* basic machine hardware */ |
| 2836 | 2836 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 2837 | 2837 | MDRV_CPU_PROGRAM_MAP(contcirc_readmem,contcirc_writemem) |
| 2838 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 2838 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 2839 | 2839 | |
| 2840 | 2840 | MDRV_CPU_ADD(Z80,16000000/4) |
| 2841 | 2841 | /* audio CPU */ /* 4 MHz ??? */ |
| r1877 | r1878 | |
| 2843 | 2843 | |
| 2844 | 2844 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 2845 | 2845 | MDRV_CPU_PROGRAM_MAP(contcirc_cpub_readmem,contcirc_cpub_writemem) |
| 2846 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 2846 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 2847 | 2847 | |
| 2848 | 2848 | MDRV_MACHINE_START(taitoz) |
| 2849 | 2849 | |
| r1877 | r1878 | |
| 2880 | 2880 | /* basic machine hardware */ |
| 2881 | 2881 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 2882 | 2882 | MDRV_CPU_PROGRAM_MAP(chasehq_readmem,chasehq_writemem) |
| 2883 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 2883 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 2884 | 2884 | |
| 2885 | 2885 | MDRV_CPU_ADD(Z80,16000000/4) |
| 2886 | 2886 | /* audio CPU */ /* 4 MHz ??? */ |
| r1877 | r1878 | |
| 2888 | 2888 | |
| 2889 | 2889 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 2890 | 2890 | MDRV_CPU_PROGRAM_MAP(chq_cpub_readmem,chq_cpub_writemem) |
| 2891 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 2891 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 2892 | 2892 | |
| 2893 | 2893 | MDRV_MACHINE_START(taitoz) |
| 2894 | 2894 | |
| r1877 | r1878 | |
| 2924 | 2924 | /* basic machine hardware */ |
| 2925 | 2925 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 2926 | 2926 | MDRV_CPU_PROGRAM_MAP(enforce_readmem,enforce_writemem) |
| 2927 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 2927 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 2928 | 2928 | |
| 2929 | 2929 | MDRV_CPU_ADD(Z80,16000000/4) |
| 2930 | 2930 | /* audio CPU */ /* 4 MHz ??? */ |
| r1877 | r1878 | |
| 2932 | 2932 | |
| 2933 | 2933 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 2934 | 2934 | MDRV_CPU_PROGRAM_MAP(enforce_cpub_readmem,enforce_cpub_writemem) |
| 2935 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 2935 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 2936 | 2936 | |
| 2937 | 2937 | MDRV_MACHINE_START(taitoz) |
| 2938 | 2938 | |
| r1877 | r1878 | |
| 2971 | 2971 | /* basic machine hardware */ |
| 2972 | 2972 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 2973 | 2973 | MDRV_CPU_PROGRAM_MAP(bshark_readmem,bshark_writemem) |
| 2974 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 2974 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 2975 | 2975 | |
| 2976 | 2976 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 2977 | 2977 | MDRV_CPU_PROGRAM_MAP(bshark_cpub_readmem,bshark_cpub_writemem) |
| 2978 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 2978 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 2979 | 2979 | |
| 2980 | 2980 | MDRV_MACHINE_START(taitoz) |
| 2981 | 2981 | |
| r1877 | r1878 | |
| 3012 | 3012 | /* basic machine hardware */ |
| 3013 | 3013 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 3014 | 3014 | MDRV_CPU_PROGRAM_MAP(sci_readmem,sci_writemem) |
| 3015 | MDRV_CPU_VBLANK_INT(sci_interrupt | |
| 3015 | MDRV_CPU_VBLANK_INT("main", sci_interrupt | |
| 3016 | 3016 | |
| 3017 | 3017 | MDRV_CPU_ADD(Z80,16000000/4) |
| 3018 | 3018 | /* audio CPU */ /* 4 MHz ??? */ |
| r1877 | r1878 | |
| 3020 | 3020 | |
| 3021 | 3021 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 3022 | 3022 | MDRV_CPU_PROGRAM_MAP(sci_cpub_readmem,sci_cpub_writemem) |
| 3023 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 3023 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 3024 | 3024 | |
| 3025 | 3025 | MDRV_MACHINE_START(taitoz) |
| 3026 | 3026 | |
| r1877 | r1878 | |
| 3057 | 3057 | /* basic machine hardware */ |
| 3058 | 3058 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 3059 | 3059 | MDRV_CPU_PROGRAM_MAP(nightstr_readmem,nightstr_writemem) |
| 3060 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 3060 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 3061 | 3061 | |
| 3062 | 3062 | MDRV_CPU_ADD(Z80,16000000/4) |
| 3063 | 3063 | /* audio CPU */ /* 4 MHz ??? */ |
| r1877 | r1878 | |
| 3065 | 3065 | |
| 3066 | 3066 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 3067 | 3067 | MDRV_CPU_PROGRAM_MAP(nightstr_cpub_readmem,nightstr_cpub_writemem) |
| 3068 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 3068 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 3069 | 3069 | |
| 3070 | 3070 | MDRV_MACHINE_START(taitoz) |
| 3071 | 3071 | |
| r1877 | r1878 | |
| 3103 | 3103 | /* basic machine hardware */ |
| 3104 | 3104 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 3105 | 3105 | MDRV_CPU_PROGRAM_MAP(aquajack_readmem,aquajack_writemem) |
| 3106 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 3106 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 3107 | 3107 | |
| 3108 | 3108 | MDRV_CPU_ADD(Z80,16000000/4) |
| 3109 | 3109 | /* audio CPU */ /* 4 MHz ??? */ |
| r1877 | r1878 | |
| 3111 | 3111 | |
| 3112 | 3112 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ??? */ |
| 3113 | 3113 | MDRV_CPU_PROGRAM_MAP(aquajack_cpub_readmem,aquajack_cpub_writemem) |
| 3114 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 3114 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 3115 | 3115 | |
| 3116 | 3116 | MDRV_MACHINE_START(taitoz) |
| 3117 | 3117 | |
| r1877 | r1878 | |
| 3148 | 3148 | /* basic machine hardware */ |
| 3149 | 3149 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz ??? */ |
| 3150 | 3150 | MDRV_CPU_PROGRAM_MAP(spacegun_readmem,spacegun_writemem) |
| 3151 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 3151 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 3152 | 3152 | |
| 3153 | 3153 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz ??? */ |
| 3154 | 3154 | MDRV_CPU_PROGRAM_MAP(spacegun_cpub_readmem,spacegun_cpub_writemem) |
| 3155 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 3155 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 3156 | 3156 | |
| 3157 | 3157 | MDRV_MACHINE_START(taitoz) |
| 3158 | 3158 | |
| r1877 | r1878 | |
| 3189 | 3189 | /* basic machine hardware */ |
| 3190 | 3190 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz ??? */ |
| 3191 | 3191 | MDRV_CPU_PROGRAM_MAP(dblaxle_readmem,dblaxle_writemem) |
| 3192 | MDRV_CPU_VBLANK_INT(dblaxle_interrupt | |
| 3192 | MDRV_CPU_VBLANK_INT("main", dblaxle_interrupt | |
| 3193 | 3193 | |
| 3194 | 3194 | MDRV_CPU_ADD(Z80,16000000/4) |
| 3195 | 3195 | /* audio CPU */ /* 4 MHz ??? */ |
| r1877 | r1878 | |
| 3197 | 3197 | |
| 3198 | 3198 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz ??? */ |
| 3199 | 3199 | MDRV_CPU_PROGRAM_MAP(dblaxle_cpub_readmem,dblaxle_cpub_writemem) |
| 3200 | MDRV_CPU_VBLANK_INT(dblaxle_cpub_interrupt | |
| 3200 | MDRV_CPU_VBLANK_INT("main", dblaxle_cpub_interrupt | |
| 3201 | 3201 | |
| 3202 | 3202 | MDRV_MACHINE_START(taitoz) |
| 3203 | 3203 | |
| r1877 | r1878 | |
| 3234 | 3234 | /* basic machine hardware */ |
| 3235 | 3235 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz ??? */ |
| 3236 | 3236 | MDRV_CPU_PROGRAM_MAP(racingb_readmem,racingb_writemem) |
| 3237 | MDRV_CPU_VBLANK_INT(dblaxle_interrupt | |
| 3237 | MDRV_CPU_VBLANK_INT("main", dblaxle_interrupt | |
| 3238 | 3238 | |
| 3239 | 3239 | MDRV_CPU_ADD(Z80,16000000/4) |
| 3240 | 3240 | /* audio CPU */ /* 4 MHz ??? */ |
| r1877 | r1878 | |
| 3242 | 3242 | |
| 3243 | 3243 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz ??? */ |
| 3244 | 3244 | MDRV_CPU_PROGRAM_MAP(racingb_cpub_readmem,racingb_cpub_writemem) |
| 3245 | MDRV_CPU_VBLANK_INT(dblaxle_cpub_interrupt | |
| 3245 | MDRV_CPU_VBLANK_INT("main", dblaxle_cpub_interrupt | |
| 3246 | 3246 | |
| 3247 | 3247 | MDRV_MACHINE_START(taitoz) |
| 3248 | 3248 | MDRV_INTERLEAVE(100) |
| r1877 | r1878 | |
|---|---|---|
| 70 | 70 | Video Hardware |
| 71 | 71 | ***************************************************************************/ |
| 72 | 72 | |
| 73 | static | |
| 73 | static | |
| 74 | 74 | static int clr_offset; |
| 75 | 75 | static int lastfght_dest; |
| 76 | 76 | |
| r1877 | r1878 | |
| 258 | 258 | { |
| 259 | 259 | int x,y, addr; |
| 260 | 260 | UINT8 *gfxdata = memory_region( REGION_GFX1 ); |
| 261 | | |
| 261 | | |
| 262 | 262 | |
| 263 | 263 | #if 0 |
| 264 | 264 | logerror("%06x: blit x %03x, y %03x, w %03x, h %03x, sx %03x.%02x, sx1 %03x.%02x, dsx %03x.%02x, sy %03x.%02x, sy1 %03x.%02x, dsy %03x.%02x, sp %02x, sr %02x, data %02x\n", activecpu_get_pc(), |
| r1877 | r1878 | |
| 463 | 463 | static MACHINE_DRIVER_START( lastfght ) |
| 464 | 464 | MDRV_CPU_ADD(H83044, 32000000/2) |
| 465 | 465 | MDRV_CPU_PROGRAM_MAP( lastfght_map, 0 ) |
| 466 | MDRV_CPU_VBLANK_INT(unknown_interrupt,2) | |
| 466 | MDRV_CPU_VBLANK_INT_HACK(unknown_interrupt,2) | |
| 467 | 467 | |
| 468 | 468 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 469 | 469 |
| r1877 | r1878 | |
|---|---|---|
| 200 | 200 | /* basic machine hardware */ |
| 201 | 201 | MDRV_CPU_ADD(Z80,8000000/2) /* 4.000MHz */ |
| 202 | 202 | MDRV_CPU_PROGRAM_MAP(readmem1,writemem1) |
| 203 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 203 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 204 | 204 | |
| 205 | 205 | MDRV_CPU_ADD(Z80,8000000/2) /* 4.000MHz */ |
| 206 | 206 | MDRV_CPU_PROGRAM_MAP(readmem2,writemem2) |
| 207 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 207 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 208 | 208 | |
| 209 | 209 | MDRV_INTERLEAVE(100) |
| 210 | 210 |
| r1877 | r1878 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | static WRITE8_HANDLER( sound_command_w ) |
| 71 | 71 | { |
| 72 | soundlatch_w(0,data); | |
| 72 | soundlatch_w(machine,0,data); | |
| 73 | 73 | timer_call_after_resynch(NULL, data,nmi_callback); |
| 74 | 74 | } |
| 75 | 75 | |
| r1877 | r1878 | |
| 530 | 530 | /* basic machine hardware */ |
| 531 | 531 | MDRV_CPU_ADD(Z80, 4000000) |
| 532 | 532 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 533 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 533 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 534 | 534 | |
| 535 | 535 | MDRV_CPU_ADD(Z80, 4000000) |
| 536 | 536 | /* audio CPU */ |
| 537 | 537 | MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound) |
| 538 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 538 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 539 | 539 | |
| 540 | 540 | #ifdef USE_MCU |
| 541 | 541 | MDRV_CPU_ADD(M68705,8000000/2) /* 4 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 930 | 930 | MDRV_CPU_ADD(Z80,12000000/2) /* 6 MHz */ |
| 931 | 931 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 932 | 932 | MDRV_CPU_IO_MAP(pbillian_port_map,0) |
| 933 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 933 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 934 | 934 | |
| 935 | 935 | /* video hardware */ |
| 936 | 936 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 961 | 961 | MDRV_CPU_ADD(Z80,12000000/2) /* 6 MHz */ |
| 962 | 962 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 963 | 963 | MDRV_CPU_IO_MAP(hotsmash_port_map,0) |
| 964 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 964 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 965 | 965 | |
| 966 | 966 | MDRV_CPU_ADD(M68705, 4000000) /* ???? */ |
| 967 | 967 | MDRV_CPU_PROGRAM_MAP(m68705_map,0) |
| r1877 | r1878 | |
| 997 | 997 | MDRV_CPU_ADD(Z80, 12000000/2) /* 6 MHz */ |
| 998 | 998 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 999 | 999 | MDRV_CPU_IO_MAP(sqix_port_map,0) |
| 1000 | MDRV_CPU_VBLANK_INT(sqix_interrupt,6) /* ??? */ | |
| 1000 | MDRV_CPU_VBLANK_INT_HACK(sqix_interrupt,6) /* ??? */ | |
| 1001 | 1001 | |
| 1002 | 1002 | MDRV_CPU_ADD(I8751, 12000000/3) /* ??? */ |
| 1003 | 1003 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| r1877 | r1878 | |
| 1038 | 1038 | MDRV_CPU_ADD(Z80, 12000000/2) /* 6 MHz */ |
| 1039 | 1039 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 1040 | 1040 | MDRV_CPU_IO_MAP(bootleg_port_map,0) |
| 1041 | MDRV_CPU_VBLANK_INT(bootleg_interrupt,6) /* ??? */ | |
| 1041 | MDRV_CPU_VBLANK_INT_HACK(bootleg_interrupt,6) /* ??? */ | |
| 1042 | 1042 | |
| 1043 | 1043 | /* video hardware */ |
| 1044 | 1044 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 409 | 409 | |
| 410 | 410 | static READ8_HANDLER( psg_4015_r ) |
| 411 | 411 | { |
| 412 | return NESPSG_0_r(0x15); | |
| 412 | return NESPSG_0_r(machine, 0x15); | |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | static WRITE8_HANDLER( psg_4015_w ) |
| 416 | 416 | { |
| 417 | NESPSG_0_w(0x15, data); | |
| 417 | NESPSG_0_w(machine, 0x15, data); | |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | static WRITE8_HANDLER( psg_4017_w ) |
| 421 | 421 | { |
| 422 | NESPSG_0_w(0x17, data); | |
| 422 | NESPSG_0_w(machine, 0x17, data); | |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | /******************************************************************************/ |
| r1877 | r1878 | |
| 735 | 735 | MDRV_CPU_ADD(Z80, 8000000/2) // 4 MHz |
| 736 | 736 | MDRV_CPU_PROGRAM_MAP(bios_map, 0) |
| 737 | 737 | MDRV_CPU_IO_MAP(bios_io_map, 0) |
| 738 | MDRV_CPU_VBLANK_INT(playch10_interrupt | |
| 738 | MDRV_CPU_VBLANK_INT("top", playch10_interrupt | |
| 739 | 739 | |
| 740 | 740 | MDRV_CPU_ADD(N2A03, N2A03_DEFAULTCLOCK) |
| 741 | 741 | MDRV_CPU_PROGRAM_MAP(cart_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 454 | 454 | |
| 455 | 455 | MDRV_CPU_ADD(M68000, ATARI_CLOCK_14MHz/2) |
| 456 | 456 | MDRV_CPU_PROGRAM_MAP(extra_map,0) |
| 457 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 457 | MDRV_CPU_VBLANK_INT("left", atarigen_video_int_gen | |
| 458 | 458 | |
| 459 | 459 | MDRV_CPU_ADD(M68000, ATARI_CLOCK_14MHz/2) |
| 460 | 460 | MDRV_CPU_PROGRAM_MAP(sound_68k_map,0) |
| r1877 | r1878 | |
| 506 | 506 | /* basic machine hardware */ |
| 507 | 507 | MDRV_CPU_ADD(M68000, ATARI_CLOCK_14MHz/2) |
| 508 | 508 | MDRV_CPU_PROGRAM_MAP(cyberb2p_map,0) |
| 509 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 509 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 510 | 510 | |
| 511 | 511 | MDRV_MACHINE_RESET(cyberb2p) |
| 512 | 512 | MDRV_NVRAM_HANDLER(atarigen) |
| r1877 | r1878 | |
|---|---|---|
| 161 | 161 | |
| 162 | 162 | static WRITE16_HANDLER( emres_w ) |
| 163 | 163 | { |
| 164 | watchdog_reset | |
| 164 | watchdog_reset | |
| 165 | 165 | lockon_main_inten = 0; |
| 166 | 166 | } |
| 167 | 167 |
| r1877 | r1878 | |
|---|---|---|
| 691 | 691 | static WRITE8_HANDLER( mappy_snd_sharedram_w ) |
| 692 | 692 | { |
| 693 | 693 | if (offset < 0x40) |
| 694 | namco_15xx_w(offset,data); | |
| 694 | namco_15xx_w(machine,offset,data); | |
| 695 | 695 | else |
| 696 | 696 | namco_soundregs[offset] = data; |
| 697 | 697 | } |
| r1877 | r1878 | |
| 833 | 833 | |
| 834 | 834 | /* Reset all latches */ |
| 835 | 835 | for (i = 0;i < 0x10;i += 2) |
| 836 | superpac_latch_w(i,0); | |
| 836 | superpac_latch_w(machine,i,0); | |
| 837 | 837 | } |
| 838 | 838 | |
| 839 | 839 | static MACHINE_RESET( phozon ) |
| r1877 | r1878 | |
| 842 | 842 | |
| 843 | 843 | /* Reset all latches */ |
| 844 | 844 | for (i = 0;i < 0x10;i += 2) |
| 845 | phozon_latch_w(i,0); | |
| 845 | phozon_latch_w(machine,i,0); | |
| 846 | 846 | } |
| 847 | 847 | |
| 848 | 848 | static MACHINE_RESET( mappy ) |
| r1877 | r1878 | |
| 851 | 851 | |
| 852 | 852 | /* Reset all latches */ |
| 853 | 853 | for (i = 0;i < 0x10;i += 2) |
| 854 | mappy_latch_w(i,0); | |
| 854 | mappy_latch_w(machine,i,0); | |
| 855 | 855 | } |
| 856 | 856 | |
| 857 | 857 | static INTERRUPT_GEN( mappy_interrupt_1 ) |
| r1877 | r1878 | |
| 1573 | 1573 | /* basic machine hardware */ |
| 1574 | 1574 | MDRV_CPU_ADD(M6809, PIXEL_CLOCK/4) /* 1.536 MHz */ |
| 1575 | 1575 | MDRV_CPU_PROGRAM_MAP(superpac_cpu1_map,0) |
| 1576 | MDRV_CPU_VBLANK_INT(mappy_interrupt_ | |
| 1576 | MDRV_CPU_VBLANK_INT("main", mappy_interrupt_ | |
| 1577 | 1577 | |
| 1578 | 1578 | MDRV_CPU_ADD(M6809, PIXEL_CLOCK/4) /* 1.536 MHz */ |
| 1579 | 1579 | MDRV_CPU_PROGRAM_MAP(superpac_cpu2_map,0) |
| 1580 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1580 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1581 | 1581 | |
| 1582 | 1582 | MDRV_WATCHDOG_VBLANK_INIT(8) |
| 1583 | 1583 | MDRV_INTERLEAVE(100) /* 100 CPU slices per frame - an high value to ensure proper */ |
| r1877 | r1878 | |
| 1620 | 1620 | /* basic machine hardware */ |
| 1621 | 1621 | MDRV_CPU_ADD(M6809, PIXEL_CLOCK/4) /* MAIN CPU */ |
| 1622 | 1622 | MDRV_CPU_PROGRAM_MAP(phozon_cpu1_map,0) |
| 1623 | MDRV_CPU_VBLANK_INT(mappy_interrupt_ | |
| 1623 | MDRV_CPU_VBLANK_INT("main", mappy_interrupt_ | |
| 1624 | 1624 | |
| 1625 | 1625 | MDRV_CPU_ADD(M6809, PIXEL_CLOCK/4) /* SOUND CPU */ |
| 1626 | 1626 | MDRV_CPU_PROGRAM_MAP(phozon_cpu2_map,0) |
| 1627 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1627 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1628 | 1628 | |
| 1629 | 1629 | MDRV_CPU_ADD(M6809, PIXEL_CLOCK/4) /* SUB CPU */ |
| 1630 | 1630 | MDRV_CPU_PROGRAM_MAP(phozon_cpu3_map,0) |
| 1631 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1631 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1632 | 1632 | |
| 1633 | 1633 | MDRV_WATCHDOG_VBLANK_INIT(8) |
| 1634 | 1634 | MDRV_INTERLEAVE(100) /* 100 CPU slices per frame - an high value to ensure proper */ |
| r1877 | r1878 | |
| 1661 | 1661 | /* basic machine hardware */ |
| 1662 | 1662 | MDRV_CPU_ADD(M6809, PIXEL_CLOCK/4) /* 1.536 MHz */ |
| 1663 | 1663 | MDRV_CPU_PROGRAM_MAP(mappy_cpu1_map,0) |
| 1664 | MDRV_CPU_VBLANK_INT(mappy_interrupt_ | |
| 1664 | MDRV_CPU_VBLANK_INT("main", mappy_interrupt_ | |
| 1665 | 1665 | |
| 1666 | 1666 | MDRV_CPU_ADD(M6809, PIXEL_CLOCK/4) /* 1.536 MHz */ |
| 1667 | 1667 | MDRV_CPU_PROGRAM_MAP(mappy_cpu2_map,0) |
| 1668 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 1668 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 1669 | 1669 | |
| 1670 | 1670 | MDRV_WATCHDOG_VBLANK_INIT(8) |
| 1671 | 1671 | MDRV_INTERLEAVE(100) /* 100 CPU slices per frame - an high value to ensure proper */ |
| r1877 | r1878 | |
|---|---|---|
| 125 | 125 | static TILE_GET_INFO( get_bg_tile_info ) |
| 126 | 126 | { |
| 127 | 127 | int color; |
| 128 | UINT8 code = ram_r(tile_index | 0x400); | |
| 128 | UINT8 code = ram_r(machine,tile_index | 0x400); | |
| 129 | 129 | |
| 130 | 130 | /* this is wrong */ |
| 131 | 131 | if (code & 0x80) |
| r1877 | r1878 | |
| 140 | 140 | static TILE_GET_INFO( get_fg_tile_info ) |
| 141 | 141 | { |
| 142 | 142 | int color, flags; |
| 143 | UINT8 code = ram_r(tile_index); | |
| 143 | UINT8 code = ram_r(machine,tile_index); | |
| 144 | 144 | |
| 145 | 145 | if (code & 0x80) |
| 146 | 146 | color = 7; /* white */ |
| r1877 | r1878 | |
|---|---|---|
| 383 | 383 | /* basic machine hardware */ |
| 384 | 384 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz */ |
| 385 | 385 | MDRV_CPU_PROGRAM_MAP(rastan_map,0) |
| 386 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 386 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 387 | 387 | |
| 388 | 388 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 389 | 389 | MDRV_CPU_PROGRAM_MAP(rastan_s_map,0) |
| r1877 | r1878 | |
| 407 | 407 | /* sound hardware */ |
| 408 | 408 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 409 | 409 | |
| 410 | MDRV_SOUND_ADD(YM2151, 4 | |
| 410 | MDRV_SOUND_ADD(YM2151, XTAL_16MHz/4 | |
| 411 | 411 | MDRV_SOUND_CONFIG(ym2151_interface) |
| 412 | 412 | MDRV_SOUND_ROUTE(0, "mono", 0.50) |
| 413 | 413 | MDRV_SOUND_ROUTE(1, "mono", 0.50) |
| 414 | 414 | |
| 415 | MDRV_SOUND_ADD(MSM5205, 384 | |
| 415 | MDRV_SOUND_ADD(MSM5205, XTAL_384kHz) /* verified on pcb */ | |
| 416 | 416 | MDRV_SOUND_CONFIG(msm5205_interface) |
| 417 | 417 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) |
| 418 | 418 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
|---|---|---|
| 455 | 455 | static MACHINE_DRIVER_START( pntnpuzl ) |
| 456 | 456 | MDRV_CPU_ADD_TAG("main", M68000, 12000000)//?? |
| 457 | 457 | MDRV_CPU_PROGRAM_MAP(pntnpuzl_map,0) |
| 458 | MDRV_CPU_VBLANK_INT(pntnpuzl_irq | |
| 458 | MDRV_CPU_VBLANK_INT("main", pntnpuzl_irq | |
| 459 | 459 | |
| 460 | 460 | MDRV_NVRAM_HANDLER(pntnpuzl) |
| 461 | 461 |
| r1877 | r1878 | |
|---|---|---|
| 97 | 97 | /* bit 8 is EEPROM data */ |
| 98 | 98 | /* bit 9 is EEPROM ready */ |
| 99 | 99 | /* bit 11 is service button */ |
| 100 | res = (EEPROM_read_bit()<<8) | input_port_0_word_r(0,0); | |
| 100 | res = (EEPROM_read_bit()<<8) | input_port_0_word_r(machine,0,0); | |
| 101 | 101 | |
| 102 | 102 | if (init_eeprom_count) |
| 103 | 103 | { |
| r1877 | r1878 | |
| 185 | 185 | { |
| 186 | 186 | if(ACCESSING_LSB) { |
| 187 | 187 | data &= 0xff; |
| 188 | soundlatch_w(0, data); | |
| 188 | soundlatch_w(machine, 0, data); | |
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | static WRITE16_HANDLER( sound_irq_w ) |
| 193 | 193 | { |
| 194 | cpunum_set_input_line( | |
| 194 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | static READ16_HANDLER( sound_status_r ) |
| 198 | 198 | { |
| 199 | return soundlatch2_r(0); | |
| 199 | return soundlatch2_r(machine,0); | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | static void sound_nmi(void) |
| r1877 | r1878 | |
| 344 | 344 | /* basic machine hardware */ |
| 345 | 345 | MDRV_CPU_ADD(M68000, 16000000) /* Confirmed */ |
| 346 | 346 | MDRV_CPU_PROGRAM_MAP(readmem, writemem) |
| 347 | MDRV_CPU_VBLANK_INT(gijoe_interrupt | |
| 347 | MDRV_CPU_VBLANK_INT("main", gijoe_interrupt | |
| 348 | 348 | |
| 349 | 349 | MDRV_CPU_ADD(Z80, 8000000) |
| 350 | 350 | /* audio CPU */ /* Amuse & confirmed. z80e */ |
| r1877 | r1878 | |
|---|---|---|
| 47 | 47 | // bit 3 - enable 752 Hz (D-3) square wave output |
| 48 | 48 | |
| 49 | 49 | logerror( "Writing control latch with %02X\n", data ); |
| 50 | } | |
| 50 | } | |
| 51 | 51 | |
| 52 | 52 | static READ8_HANDLER( jamma_if_control_latch_r ) |
| 53 | 53 | { |
| 54 | 54 | return jamma_if_control_latch & 0x08; |
| 55 | } | |
| 55 | } | |
| 56 | 56 | |
| 57 | 57 | static READ8_HANDLER( jamma_if_read_dsw ) |
| 58 | 58 | { |
| r1877 | r1878 | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | return dsw_val & 1; |
| 97 | } | |
| 97 | } | |
| 98 | 98 | |
| 99 | 99 | static UINT8 jamma_if_read_joystick( void ) |
| 100 | 100 | { |
| r1877 | r1878 | |
| 106 | 106 | { |
| 107 | 107 | return readinputportbytag( "IN" ) | 0x08; |
| 108 | 108 | } |
| 109 | } | |
| 109 | } | |
| 110 | 110 | |
| 111 | 111 | static MACHINE_RESET( uapce ) |
| 112 | 112 | { |
| 113 | 113 | pce_set_joystick_readinputport_callback( jamma_if_read_joystick ); |
| 114 | 114 | jamma_if_control_latch = 0; |
| 115 | } | |
| 115 | } | |
| 116 | 116 | |
| 117 | 117 | static ADDRESS_MAP_START( z80_map, ADDRESS_SPACE_PROGRAM, 8) |
| 118 | 118 | AM_RANGE( 0x0000, 0x07FF) AM_ROM |
| r1877 | r1878 | |
| 182 | 182 | MDRV_CPU_ADD(H6280, PCE_MAIN_CLOCK/3) |
| 183 | 183 | MDRV_CPU_PROGRAM_MAP(pce_mem, 0) |
| 184 | 184 | MDRV_CPU_IO_MAP(pce_io, 0) |
| 185 | MDRV_CPU_VBLANK_INT(pce_interrupt, VDC_LPF) | |
| 185 | MDRV_CPU_VBLANK_INT_HACK(pce_interrupt, VDC_LPF) | |
| 186 | 186 | |
| 187 | 187 | MDRV_CPU_ADD(Z80, 1400000) |
| 188 | 188 | MDRV_CPU_PROGRAM_MAP(z80_map, 0) |
| r1877 | r1878 | |
| 224 | 224 | static DRIVER_INIT(uapce) |
| 225 | 225 | { |
| 226 | 226 | DRIVER_INIT_CALL(pce); |
| 227 | } | |
| 227 | } | |
| 228 | 228 | |
| 229 | 229 | GAME( 1989, blazlaz, 0, uapce, uapce, uapce, ROT0, "Hudson Soft", "Blazing Lazers", GAME_IMPERFECT_SOUND ) |
| r1877 | r1878 | |
|---|---|---|
| 87 | 87 | 0x0003, 0x0080, 0x0006, 0x0060, 0x0000, 0x00e0, 0x000a, 0x00c0, 0x0003, 0x0080, 0x0006, 0x0060, 0x0000, 0x00e0, 0x000a, 0x00c0, |
| 88 | 88 | 0x0003, 0x0080, 0x0006, 0x0060, 0x0000, 0x00e0, 0x000a, 0x00c0, 0x0003, 0x0080, 0x0006, 0x0060, 0x0000, 0x00e0, 0x000a, 0x00c0 }; |
| 89 | 89 | |
| 90 | static void f1dream_protection_w( | |
| 90 | static void f1dream_protection_w(running_machine *machine) | |
| 91 | 91 | { |
| 92 | 92 | int indx; |
| 93 | 93 | int value = 255; |
| r1877 | r1878 | |
| 146 | 146 | else if ((prevpc == 0x27f8) || (prevpc == 0x511a) || (prevpc == 0x5142) || (prevpc == 0x516a)) |
| 147 | 147 | { |
| 148 | 148 | /* The main CPU stuffs the byte for the soundlatch into 0xfffffd.*/ |
| 149 | soundlatch_w(2,ram16[0x3ffc/2]); | |
| 149 | soundlatch_w(machine,2,ram16[0x3ffc/2]); | |
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | static WRITE16_HANDLER( f1dream_control_w ) |
| 154 | 154 | { |
| 155 | 155 | logerror("protection write, PC: %04x FFE1 Value:%01x\n",activecpu_get_pc(), ram16[0x3fe0/2]); |
| 156 | f1dream_protection_w(); | |
| 156 | f1dream_protection_w(machine); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | static WRITE16_HANDLER( tigeroad_soundcmd_w ) |
| 160 | 160 | { |
| 161 | 161 | if (ACCESSING_MSB) |
| 162 | soundlatch_w(offset,data >> 8); | |
| 162 | soundlatch_w(machine,offset,data >> 8); | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | static WRITE8_HANDLER( msm5205_w ) |
| r1877 | r1878 | |
| 549 | 549 | /* basic machine hardware */ |
| 550 | 550 | MDRV_CPU_ADD(M68000, 6000000) /* ? Main clock is 24MHz */ |
| 551 | 551 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 552 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 552 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 553 | 553 | |
| 554 | 554 | MDRV_CPU_ADD(Z80, 4000000) |
| 555 | 555 | /* audio CPU */ /* 4 MHz ??? */ |
| r1877 | r1878 | |
| 577 | 577 | /* sound hardware */ |
| 578 | 578 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 579 | 579 | |
| 580 | MDRV_SOUND_ADD(YM2203, 3579545) | |
| 580 | MDRV_SOUND_ADD(YM2203, XTAL_3_579545MHz) /* verified on pcb */ | |
| 581 | 581 | MDRV_SOUND_CONFIG(ym2203_interface) |
| 582 | 582 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 583 | 583 | |
| 584 | MDRV_SOUND_ADD(YM2203, 3579545) | |
| 584 | MDRV_SOUND_ADD(YM2203, XTAL_3_579545MHz) /* verified on pcb */ | |
| 585 | 585 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 586 | 586 | MACHINE_DRIVER_END |
| 587 | 587 |
| r1877 | r1878 | |
|---|---|---|
| 166 | 166 | fg_flag = 0; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | static void draw_sprites(running_machine *machine, | |
| 169 | static void draw_sprites(running_machine *machine, | |
| 170 | 170 | { |
| 171 | 171 | int offs; |
| 172 | 172 | |
| r1877 | r1878 | |
| 229 | 229 | { |
| 230 | 230 | int num_ays = (sndti_exists(SOUND_AY8910, 1)) ? 2 : 1; |
| 231 | 231 | if ((p2 & 0xf0) == 0xe0) |
| 232 | AY8910_control_port_0_w(0,offset); | |
| 232 | AY8910_control_port_0_w(machine,0,offset); | |
| 233 | 233 | else if ((p2 & 0xf0) == 0xa0) |
| 234 | AY8910_write_port_0_w(0,offset); | |
| 234 | AY8910_write_port_0_w(machine,0,offset); | |
| 235 | 235 | else if (num_ays == 2 && (p1 & 0xe0) == 0x60) |
| 236 | AY8910_control_port_1_w(0,offset); | |
| 236 | AY8910_control_port_1_w(machine,0,offset); | |
| 237 | 237 | else if (num_ays == 2 && (p1 & 0xe0) == 0x40) |
| 238 | AY8910_write_port_1_w(0,offset); | |
| 238 | AY8910_write_port_1_w(machine,0,offset); | |
| 239 | 239 | else // if ((p2 & 0xf0) != 0x70) |
| 240 | 240 | /* the port address is the data, while the data seems to be control bits */ |
| 241 | 241 | logerror("%04x: snddata_w ctrl = %02x, p1 = %02x, p2 = %02x, data = %02x\n",activecpu_get_pc(),data,p1,p2,offset); |
| r1877 | r1878 | |
| 515 | 515 | /* basic machine hardware */ |
| 516 | 516 | MDRV_CPU_ADD(Z80,4000000) /* 4 MHz ???? */ |
| 517 | 517 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 518 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 518 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 519 | 519 | |
| 520 | 520 | MDRV_CPU_ADD(I8039,8000000) /* ????? */ |
| 521 | 521 | /* audio CPU */ |
| r1877 | r1878 | |
| 552 | 552 | /* basic machine hardware */ |
| 553 | 553 | MDRV_CPU_ADD(Z80, 12000000/4) /* 3 MHz */ |
| 554 | 554 | MDRV_CPU_PROGRAM_MAP(fghtbskt_map,0) |
| 555 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 555 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 556 | 556 | |
| 557 | 557 | MDRV_CPU_ADD(I8039,12000000/4) /* ????? */ |
| 558 | 558 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 170 | 170 | |
| 171 | 171 | |
| 172 | 172 | |
| 173 | static UINT8 unkram | |
| 173 | static UINT8 *unkram | |
| 174 | 174 | |
| 175 | static int io9400; | |
| 176 | static int io9401; | |
| 175 | static UINT8 *io9400; | |
| 176 | static UINT8 *io9401; | |
| 177 | 177 | |
| 178 | 178 | static PALETTE_INIT( spaceg ) |
| 179 | 179 | { |
| r1877 | r1878 | |
| 205 | 205 | |
| 206 | 206 | static WRITE8_HANDLER( zvideoram_w ) |
| 207 | 207 | { |
| 208 | int | |
| 208 | int | |
| 209 | 209 | |
| 210 | 210 | col = unkram[0x400]; |
| 211 | 211 | |
| r1877 | r1878 | |
| 213 | 213 | |
| 214 | 214 | col &=0x0f; |
| 215 | 215 | |
| 216 | switch(io9401) | |
| 216 | switch(*io9401) | |
| 217 | 217 | { |
| 218 | 218 | case 0x0d: /* 1101 */ |
| 219 | 219 | videoram[offset] &= ~data; |
| r1877 | r1878 | |
| 226 | 226 | break; |
| 227 | 227 | |
| 228 | 228 | default: |
| 229 | logerror("mode =%02x pc=%04x\n",io9401,activecpu_get_pc() ); | |
| 230 | popmessage("mode =%02x pc=%04x\n",io9401,activecpu_get_pc() ); | |
| 229 | logerror("mode =%02x pc=%04x\n",*io9401,activecpu_get_pc() ); | |
| 230 | popmessage("mode =%02x pc=%04x\n",*io9401,activecpu_get_pc() ); | |
| 231 | 231 | return; |
| 232 | 232 | break; |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | |
| 236 | 236 | unkram [offset] = col; |
| 237 | ||
| 238 | y= 255 - (offset & 0xff); | |
| 239 | x= 255 - ((offset>>8)*8); | |
| 240 | x -= ((io9400&0xe0)>>5); | |
| 241 | ||
| 242 | /* draw modified eight pixels */ | |
| 243 | if (y >= 0 && y < tmpbitmap->height) | |
| 244 | for (i = 0; i < 8; i++) | |
| 245 | { | |
| 246 | if (x >= 0 && y < tmpbitmap->width) | |
| 247 | *BITMAP_ADDR16(tmpbitmap, y, x) = (data&1)? col : 0; | |
| 248 | x++; | |
| 249 | data >>= 1; | |
| 250 | } | |
| 251 | 237 | } |
| 252 | 238 | |
| 253 | 239 | static READ8_HANDLER(fake_r) |
| r1877 | r1878 | |
| 283 | 269 | logerror("palette? read from unkram offset = %04x\n",offset); |
| 284 | 270 | } |
| 285 | 271 | |
| 286 | if (io9401!=0x40) | |
| 287 | logerror("unkram read in mode: 9401 = %02x (offset=%04x)\n",io9401,offset); | |
| 272 | if (*io9401!=0x40) | |
| 273 | logerror("unkram read in mode: 9401 = %02x (offset=%04x)\n",*io9401,offset); | |
| 288 | 274 | |
| 289 | 275 | |
| 290 | 276 | return unkram[offset]; |
| 291 | 277 | } |
| 292 | 278 | |
| 293 | static WRITE8_HANDLER(spaceg_colorram_w) | |
| 279 | ||
| 280 | static VIDEO_UPDATE( spaceg ) | |
| 294 | 281 | { |
| 295 | | |
| 282 | offs_t | |
| 296 | 283 | |
| 297 | unkram[offset] = data; | |
| 284 | for (offs = 0; offs < 0x2000; offs++) | |
| 285 | { | |
| 286 | int i; | |
| 287 | UINT8 data = videoram[offs]; | |
| 298 | 288 | |
| 289 | int y = offs & 0xff; | |
| 290 | UINT8 x = ((offs >> 8) << 3) - ((*io9400 & 0xe0) >> 5); | |
| 299 | 291 | |
| 300 | /* refresh eight pixels because the color might have just been changed */ | |
| 301 | data = videoram[offset]; | |
| 302 | col = unkram [offset]; | |
| 303 | ||
| 304 | y= 255 - (offset & 0xff); | |
| 305 | x= 255 - ((offset>>8)*8); | |
| 306 | x -= ((io9400&0xe0)>>5); | |
| 307 | ||
| 308 | /* draw modified eight pixels */ | |
| 309 | if (y >= 0 && y < tmpbitmap->height) | |
| 310 | 292 | for (i = 0; i < 8; i++) |
| 311 | 293 | { |
| 312 | if (x >= 0 && x < tmpbitmap->width) | |
| 313 | *BITMAP_ADDR16(tmpbitmap, y, x) = (data&1)? col : 0; | |
| 294 | *BITMAP_ADDR16(bitmap, y, x) = (data & 0x80) ? unkram[offs] : 0; | |
| 295 | ||
| 314 | 296 | x++; |
| 315 | data | |
| 297 | data <<= 1; | |
| 316 | 298 | } |
| 317 | } | |
| 318 | ||
| 319 | ||
| 320 | static READ8_HANDLER(zr_r) | |
| 321 | { | |
| 322 | return videoram[offset]; | |
| 323 | } | |
| 324 | ||
| 325 | static WRITE8_HANDLER(io9400_w) | |
| 326 | { | |
| 327 | io9400=data; | |
| 328 | if (io9400 & 0x1f) | |
| 329 | { | |
| 330 | logerror("!!9400 =%02x pc=%04x\n",io9400,activecpu_get_pc() ); | |
| 331 | 299 | } |
| 332 | } | |
| 333 | 300 | |
| 334 | static WRITE8_HANDLER(io9401_w) | |
| 335 | { | |
| 336 | io9401 = data; | |
| 337 | ||
| 338 | ||
| 339 | //0x40 - loads the palette on READ, address line 0x100 is the ninth bit (3rd bit of the red component) | |
| 340 | ||
| 341 | switch(io9401) | |
| 342 | { | |
| 343 | case 0x0d: | |
| 344 | case 0x01: | |
| 345 | case 0x00: | |
| 346 | break; | |
| 347 | default: | |
| 348 | logerror("!!9401 mode =%02x pc=%04x\n",io9401,activecpu_get_pc() ); | |
| 349 | break; | |
| 350 | } | |
| 301 | return 0; | |
| 351 | 302 | } |
| 352 | 303 | |
| 304 | ||
| 353 | 305 | static ADDRESS_MAP_START( readwritemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 354 | 306 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 355 | 307 | AM_RANGE(0x3000, 0x3fff) AM_ROM |
| 356 | 308 | AM_RANGE(0x7000, 0x77ff) AM_RAM |
| 357 | AM_RANGE(0xc000, 0xdfff) AM_READWRITE(zr_r, zvideoram_w) AM_BASE(&videoram) | |
| 358 | AM_RANGE(0xa000, 0xbfff) AM_READWRITE(spaceg_colorram_r, spaceg_colorram_w) | |
| 309 | AM_RANGE(0xc000, 0xdfff) AM_READWRITE(MRA8_RAM, zvideoram_w) AM_BASE(&videoram) | |
| 310 | AM_RANGE(0xa000, 0xbfff) AM_READWRITE(spaceg_colorram_r, MWA8_RAM) AM_BASE(&unkram) | |
| 359 | 311 | |
| 360 | 312 | |
| 361 | AM_RANGE(0x9400, 0x9400) AM_WRITE(io9400_w) /* gfx ctrl */ | |
| 362 | AM_RANGE(0x9401, 0x9401) AM_WRITE(io9401_w) /* gfx ctrl */ | |
| 313 | AM_RANGE(0x9400, 0x9400) AM_WRITE(MWA8_RAM) AM_BASE(&io9400) /* gfx ctrl */ | |
| 314 | AM_RANGE(0x9401, 0x9401) AM_WRITE(MWA8_RAM) AM_BASE(&io9401) /* gfx ctrl */ | |
| 363 | 315 | /* 9402 - |
| 364 | 316 | bits 0 and 1 probably control the lamps under the player 1 and player 2 start buttons |
| 365 | 317 | bit 3 is probably a flip screen |
| r1877 | r1878 | |
| 414 | 366 | /* basic machine hardware */ |
| 415 | 367 | MDRV_CPU_ADD(Z80,2500000) /* 2.5 MHz */ |
| 416 | 368 | MDRV_CPU_PROGRAM_MAP(readwritemem,0) |
| 417 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 369 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 418 | 370 | |
| 419 | 371 | /* video hardware */ |
| 420 | 372 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 422 | 374 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 423 | 375 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 424 | 376 | MDRV_SCREEN_SIZE(256, 256) |
| 425 | MDRV_SCREEN_VISIBLE_AREA(0, 25 | |
| 377 | MDRV_SCREEN_VISIBLE_AREA(0, 255 | |
| 426 | 378 | |
| 427 | 379 | MDRV_PALETTE_LENGTH(16+128-16) |
| 428 | 380 | MDRV_PALETTE_INIT( spaceg ) |
| 429 | MDRV_VIDEO_START(generic_bitmapped) | |
| 430 | MDRV_VIDEO_UPDATE( generic_bitmapped ) | |
| 381 | MDRV_VIDEO_UPDATE( spaceg ) | |
| 431 | 382 | |
| 432 | 383 | /* sound hardware */ |
| 433 | 384 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r1877 | r1878 | |
| 469 | 420 | ROM_END |
| 470 | 421 | |
| 471 | 422 | |
| 472 | GAME( 1979, spaceg, 0, spaceg, spaceg, 0, ROT | |
| 423 | GAME( 1979, spaceg, 0, spaceg, spaceg, 0, ROT270, "Omori", "Space Guerrilla", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND) |
| r1877 | r1878 | |
|---|---|---|
| 241 | 241 | * |
| 242 | 242 | *************************************/ |
| 243 | 243 | |
| 244 | static void draw_sprites(running_machine *machine, | |
| 244 | static void draw_sprites(running_machine *machine, | |
| 245 | 245 | { |
| 246 | 246 | const UINT8 *source; |
| 247 | 247 | looping_state *state = machine->driver_data; |
| r1877 | r1878 | |
| 312 | 312 | static WRITE8_HANDLER( level2_irq_set ) |
| 313 | 313 | { |
| 314 | 314 | if (!(data & 1)) |
| 315 | cpunum_set_input_line_and_vector( | |
| 315 | cpunum_set_input_line_and_vector(machine, 0, 0, ASSERT_LINE, 4); | |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | |
| 319 | 319 | static WRITE8_HANDLER( main_irq_ack_w ) |
| 320 | 320 | { |
| 321 | 321 | if (data == 0) |
| 322 | cpunum_set_input_line( | |
| 322 | cpunum_set_input_line(machine, 0, 0, CLEAR_LINE); | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | |
| 326 | 326 | static WRITE8_HANDLER( looping_souint_clr ) |
| 327 | 327 | { |
| 328 | 328 | if (data == 0) |
| 329 | cpunum_set_input_line( | |
| 329 | cpunum_set_input_line(machine, 1, 0, CLEAR_LINE); | |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | |
| r1877 | r1878 | |
| 338 | 338 | |
| 339 | 339 | static WRITE8_HANDLER( looping_soundlatch_w ) |
| 340 | 340 | { |
| 341 | soundlatch_w(offset, data); | |
| 342 | cpunum_set_input_line_and_vector(Machine, 1, 0, ASSERT_LINE, 4); | |
| 341 | soundlatch_w(machine, offset, data); | |
| 342 | cpunum_set_input_line_and_vector(machine, 1, 0, ASSERT_LINE, 4); | |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | |
| r1877 | r1878 | |
| 581 | 581 | MDRV_CPU_ADD(TMS9995, MAIN_CPU_CLOCK) |
| 582 | 582 | MDRV_CPU_PROGRAM_MAP(looping_map,0) |
| 583 | 583 | MDRV_CPU_IO_MAP(looping_io_map,0) |
| 584 | MDRV_CPU_VBLANK_INT(looping_interrupt | |
| 584 | MDRV_CPU_VBLANK_INT("main", looping_interrupt | |
| 585 | 585 | |
| 586 | 586 | MDRV_CPU_ADD(TMS9980, SOUND_CLOCK/4) |
| 587 | 587 | MDRV_CPU_PROGRAM_MAP(looping_sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 359 | 359 | |
| 360 | 360 | /* I/O chips and custom I/O */ |
| 361 | 361 | static UINT8 misc_io_data[2][0x10]; |
| 362 | static read16_handler custom_io_r[2]; | |
| 363 | static write16_handler custom_io_w[2]; | |
| 362 | static read16_machine_func custom_io_r[2]; | |
| 363 | static write16_machine_func custom_io_w[2]; | |
| 364 | 364 | static UINT8 analog_bank; |
| 365 | 365 | static UINT8 analog_value[4]; |
| 366 | 366 | static UINT8 sonic_last[6]; |
| r1877 | r1878 | |
| 752 | 752 | static READ16_HANDLER( io_expansion_r ) |
| 753 | 753 | { |
| 754 | 754 | if (custom_io_r[0]) |
| 755 | return (*custom_io_r[0])(offset, mem_mask); | |
| 755 | return (*custom_io_r[0])(machine, offset, mem_mask); | |
| 756 | 756 | else |
| 757 | 757 | logerror("%06X:io_expansion_r(%X)\n", activecpu_get_pc(), offset); |
| 758 | 758 | return 0xffff; |
| r1877 | r1878 | |
| 766 | 766 | return; |
| 767 | 767 | |
| 768 | 768 | if (custom_io_w[0]) |
| 769 | (*custom_io_w[0])(offset, data, mem_mask); | |
| 769 | (*custom_io_w[0])(machine, offset, data, mem_mask); | |
| 770 | 770 | else |
| 771 | 771 | logerror("%06X:io_expansion_w(%X) = %02X\n", activecpu_get_pc(), offset, data & 0xff); |
| 772 | 772 | } |
| r1877 | r1878 | |
| 775 | 775 | static READ32_HANDLER( io_expansion_0_r ) |
| 776 | 776 | { |
| 777 | 777 | if (custom_io_r[0]) |
| 778 | return (*custom_io_r[0])(offset*2+0, mem_mask) | | |
| 779 | ((*custom_io_r[0])(offset*2+1, mem_mask >> 16) << 16); | |
| 778 | return (*custom_io_r[0])(machine, offset*2+0, mem_mask) | | |
| 779 | ((*custom_io_r[0])(machine, offset*2+1, mem_mask >> 16) << 16); | |
| 780 | 780 | else |
| 781 | 781 | logerror("%06X:io_expansion_r(%X)\n", activecpu_get_pc(), offset); |
| 782 | 782 | return 0xffffffff; |
| r1877 | r1878 | |
| 789 | 789 | if ((mem_mask & 0x000000ff) != 0x000000ff) |
| 790 | 790 | { |
| 791 | 791 | if (custom_io_w[0]) |
| 792 | (*custom_io_w[0])(offset*2+0, data, mem_mask); | |
| 792 | (*custom_io_w[0])(machine, offset*2+0, data, mem_mask); | |
| 793 | 793 | else |
| 794 | 794 | logerror("%06X:io_expansion_w(%X) = %02X\n", activecpu_get_pc(), offset, data & 0xff); |
| 795 | 795 | } |
| 796 | 796 | if ((mem_mask & 0x00ff0000) != 0x00ff0000) |
| 797 | 797 | { |
| 798 | 798 | if (custom_io_w[0]) |
| 799 | (*custom_io_w[0])(offset*2+1, data >> 16, mem_mask >> 16); | |
| 799 | (*custom_io_w[0])(machine, offset*2+1, data >> 16, mem_mask >> 16); | |
| 800 | 800 | else |
| 801 | 801 | logerror("%06X:io_expansion_w(%X) = %02X\n", activecpu_get_pc(), offset, data & 0xff); |
| 802 | 802 | } |
| r1877 | r1878 | |
| 806 | 806 | static READ32_HANDLER( io_expansion_1_r ) |
| 807 | 807 | { |
| 808 | 808 | if (custom_io_r[1]) |
| 809 | return (*custom_io_r[1])(offset*2+0, mem_mask) | | |
| 810 | ((*custom_io_r[1])(offset*2+1, mem_mask >> 16) << 16); | |
| 809 | return (*custom_io_r[1])(machine, offset*2+0, mem_mask) | | |
| 810 | ((*custom_io_r[1])(machine, offset*2+1, mem_mask >> 16) << 16); | |
| 811 | 811 | else |
| 812 | 812 | logerror("%06X:io_expansion_r(%X)\n", activecpu_get_pc(), offset); |
| 813 | 813 | return 0xffffffff; |
| r1877 | r1878 | |
| 820 | 820 | if ((mem_mask & 0x000000ff) != 0x000000ff) |
| 821 | 821 | { |
| 822 | 822 | if (custom_io_w[1]) |
| 823 | (*custom_io_w[1])(offset*2+0, data, mem_mask); | |
| 823 | (*custom_io_w[1])(machine, offset*2+0, data, mem_mask); | |
| 824 | 824 | else |
| 825 | 825 | logerror("%06X:io_expansion_w(%X) = %02X\n", activecpu_get_pc(), offset, data & 0xff); |
| 826 | 826 | } |
| 827 | 827 | if ((mem_mask & 0x00ff0000) != 0x00ff0000) |
| 828 | 828 | { |
| 829 | 829 | if (custom_io_w[1]) |
| 830 | (*custom_io_w[1])(offset*2+1, data >> 16, mem_mask >> 16); | |
| 830 | (*custom_io_w[1])(machine, offset*2+1, data >> 16, mem_mask >> 16); | |
| 831 | 831 | else |
| 832 | 832 | logerror("%06X:io_expansion_w(%X) = %02X\n", activecpu_get_pc(), offset, data & 0xff); |
| 833 | 833 | } |
| r1877 | r1878 | |
| 2192 | 2192 | /* basic machine hardware */ |
| 2193 | 2193 | MDRV_CPU_ADD(V60, MASTER_CLOCK/2) |
| 2194 | 2194 | MDRV_CPU_PROGRAM_MAP(system32_map,0) |
| 2195 | MDRV_CPU_VBLANK_INT(start_of_vblank_int | |
| 2195 | MDRV_CPU_VBLANK_INT("main", start_of_vblank_int | |
| 2196 | 2196 | |
| 2197 | 2197 | MDRV_CPU_ADD_TAG("sound", Z80, MASTER_CLOCK/4) |
| 2198 | 2198 | MDRV_CPU_PROGRAM_MAP(system32_sound_map,0) |
| r1877 | r1878 | |
| 2246 | 2246 | /* basic machine hardware */ |
| 2247 | 2247 | MDRV_CPU_ADD(V70, MULTI32_CLOCK/2) |
| 2248 | 2248 | MDRV_CPU_PROGRAM_MAP(multi32_map,0) |
| 2249 | MDRV_CPU_VBLANK_INT(start_of_vblank_int | |
| 2249 | MDRV_CPU_VBLANK_INT("left", start_of_vblank_int | |
| 2250 | 2250 | |
| 2251 | 2251 | MDRV_CPU_ADD_TAG("sound", Z80, MASTER_CLOCK/4) |
| 2252 | 2252 | MDRV_CPU_PROGRAM_MAP(multi32_sound_map,0) |
| r1877 | r1878 | |
| 3772 | 3772 | * |
| 3773 | 3773 | *************************************/ |
| 3774 | 3774 | |
| 3775 | static void segas32_common_init(read16_ | |
| 3775 | static void segas32_common_init(read16_machin | |
| 3776 | 3776 | { |
| 3777 | 3777 | /* reset the custom handlers and other pointers */ |
| 3778 | 3778 | custom_io_r[0] = custom_r; |
| r1877 | r1878 | |
|---|---|---|
| 79 | 79 | k3_bg_tilemap = tilemap_create(get_k3_bg_tile_info,tilemap_scan_rows,16, 16, 32,64); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | static void draw_sprites(running_machine *machine, | |
| 82 | static void draw_sprites(running_machine *machine, | |
| 83 | 83 | { |
| 84 | 84 | const gfx_element *gfx = machine->gfx[0]; |
| 85 | 85 | UINT16 *source = k3_spriteram_1; |
| r1877 | r1878 | |
| 246 | 246 | static MACHINE_DRIVER_START( k3 ) |
| 247 | 247 | MDRV_CPU_ADD(M68000, 16000000) |
| 248 | 248 | MDRV_CPU_PROGRAM_MAP(k3_map,0) |
| 249 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 249 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 250 | 250 | |
| 251 | 251 | MDRV_GFXDECODE(1945kiii) |
| 252 | 252 |
| r1877 | r1878 | |
|---|---|---|
| 138 | 138 | { |
| 139 | 139 | /* sound IRQ is on 32V */ |
| 140 | 140 | if (scanline & 32) |
| 141 | atarigen_6502_irq_ack_r(0); | |
| 141 | atarigen_6502_irq_ack_r(machine, 0); | |
| 142 | 142 | else if (!(readinputport(0) & 0x40)) |
| 143 | 143 | atarigen_6502_irq_gen(machine, 0); |
| 144 | 144 | } |
| r1877 | r1878 | |
| 166 | 166 | |
| 167 | 167 | static INTERRUPT_GEN( vblank_int ) |
| 168 | 168 | { |
| 169 | int pedal_state = input_port_4_r(0); | |
| 169 | int pedal_state = input_port_4_r(machine, 0); | |
| 170 | 170 | int i; |
| 171 | 171 | |
| 172 | 172 | /* update the pedals once per frame */ |
| r1877 | r1878 | |
| 226 | 226 | break; |
| 227 | 227 | |
| 228 | 228 | case 0x002: /* /RDP */ |
| 229 | result = atarigen_6502_sound_r(offset); | |
| 229 | result = atarigen_6502_sound_r(machine, offset); | |
| 230 | 230 | break; |
| 231 | 231 | |
| 232 | 232 | case 0x004: /* /RDIO */ |
| r1877 | r1878 | |
| 248 | 248 | break; |
| 249 | 249 | |
| 250 | 250 | case 0x006: /* /IRQACK */ |
| 251 | atarigen_6502_irq_ack_r(0); | |
| 251 | atarigen_6502_irq_ack_r(machine, 0); | |
| 252 | 252 | break; |
| 253 | 253 | |
| 254 | 254 | case 0x200: /* /VOICE */ |
| r1877 | r1878 | |
| 274 | 274 | break; |
| 275 | 275 | |
| 276 | 276 | case 0x006: /* /IRQACK */ |
| 277 | atarigen_6502_irq_ack_r(0); | |
| 277 | atarigen_6502_irq_ack_r(machine, 0); | |
| 278 | 278 | break; |
| 279 | 279 | |
| 280 | 280 | case 0x200: /* n/c */ |
| r1877 | r1878 | |
| 282 | 282 | break; |
| 283 | 283 | |
| 284 | 284 | case 0x202: /* /WRP */ |
| 285 | atarigen_6502_sound_w(offset, data); | |
| 285 | atarigen_6502_sound_w(machine, offset, data); | |
| 286 | 286 | break; |
| 287 | 287 | |
| 288 | 288 | case 0x204: /* WRIO */ |
| r1877 | r1878 | |
| 440 | 440 | /* basic machine hardware */ |
| 441 | 441 | MDRV_CPU_ADD(M68000, ATARI_CLOCK_14MHz/2) |
| 442 | 442 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 443 | MDRV_CPU_VBLANK_INT(vblank_int | |
| 443 | MDRV_CPU_VBLANK_INT("main", vblank_int | |
| 444 | 444 | |
| 445 | 445 | MDRV_CPU_ADD(M6502, ATARI_CLOCK_14MHz/8) |
| 446 | 446 | MDRV_CPU_PROGRAM_MAP(audio_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 186 | 186 | ***************************************************************************/ |
| 187 | 187 | |
| 188 | 188 | #include "driver.h" |
| 189 | #include "deprecat.h" | |
| 189 | 190 | #include "cpu/m6805/m6805.h" |
| 190 | 191 | #include "sound/ay8910.h" |
| 191 | 192 | |
| r1877 | r1878 | |
| 340 | 341 | |
| 341 | 342 | static READ8_HANDLER(tigerh_status_r) |
| 342 | 343 | { |
| 343 | return (slapfight_port_00_r(0)&0xf9)| ((tigerh_mcu_status_r(0))); | |
| 344 | return (slapfight_port_00_r(machine,0)&0xf9)| ((tigerh_mcu_status_r(machine,0))); | |
| 344 | 345 | } |
| 345 | 346 | |
| 346 | 347 | static ADDRESS_MAP_START( tigerh_readport, ADDRESS_SPACE_IO, 8 ) |
| r1877 | r1878 | |
| 833 | 834 | |
| 834 | 835 | static VIDEO_EOF( perfrman ) |
| 835 | 836 | { |
| 836 | buffer_spriteram_w(0,0); | |
| 837 | buffer_spriteram_w(machine,0,0); | |
| 837 | 838 | } |
| 838 | 839 | |
| 839 | 840 | static MACHINE_DRIVER_START( perfrman ) |
| r1877 | r1878 | |
| 842 | 843 | MDRV_CPU_ADD(Z80,16000000/4) /* 4MHz ???, 16MHz Oscillator */ |
| 843 | 844 | MDRV_CPU_PROGRAM_MAP(perfrman_readmem,perfrman_writemem) |
| 844 | 845 | MDRV_CPU_IO_MAP(readport,writeport) |
| 845 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 846 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 846 | 847 | |
| 847 | 848 | MDRV_CPU_ADD(Z80,16000000/8) /* 2MHz ???, 16MHz Oscillator */ |
| 848 | 849 | MDRV_CPU_PROGRAM_MAP(perfrman_sound_readmem,perfrman_sound_writemem) |
| 849 | MDRV_CPU_VBLANK_INT(getstar_interrupt,4) /* music speed, verified */ | |
| 850 | MDRV_CPU_VBLANK_INT_HACK(getstar_interrupt,4) /* music speed, verified */ | |
| 850 | 851 | |
| 851 | 852 | MDRV_INTERLEAVE(10) /* 10 CPU slices per frame - enough for the sound CPU to read all commands */ |
| 852 | 853 | |
| r1877 | r1878 | |
| 889 | 890 | MDRV_CPU_ADD(Z80, 6000000) |
| 890 | 891 | MDRV_CPU_PROGRAM_MAP(tigerh_readmem,writemem) |
| 891 | 892 | MDRV_CPU_IO_MAP(readport,tigerh_writeport) |
| 892 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 893 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 893 | 894 | |
| 894 | 895 | MDRV_CPU_ADD(Z80, 6000000) |
| 895 | 896 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 896 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,6) /* ??? */ | |
| 897 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,6) /* ??? */ | |
| 897 | 898 | |
| 898 | 899 | MDRV_INTERLEAVE(10) /* 10 CPU slices per frame - enough for the sound CPU to read all commands */ |
| 899 | 900 | |
| r1877 | r1878 | |
| 935 | 936 | MDRV_CPU_ADD(Z80, XTAL_36MHz/6) /* verified on pcb */ |
| 936 | 937 | MDRV_CPU_PROGRAM_MAP(tigerh_readmem,writemem) |
| 937 | 938 | MDRV_CPU_IO_MAP(tigerh_readport,tigerh_writeport) |
| 938 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 939 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 939 | 940 | |
| 940 | 941 | MDRV_CPU_ADD(Z80, XTAL_36MHz/12) /* verified on pcb */ |
| 941 | 942 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 942 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,6) /* ??? */ | |
| 943 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,6) /* ??? */ | |
| 943 | 944 | |
| 944 | 945 | MDRV_CPU_ADD(M68705,XTAL_36MHz/12) /* verified on pcb */ |
| 945 | 946 | MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem) |
| r1877 | r1878 | |
| 984 | 985 | MDRV_CPU_ADD_TAG("main",Z80, XTAL_36MHz/6) /* verified on pcb */ |
| 985 | 986 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 986 | 987 | MDRV_CPU_IO_MAP(readport,writeport) |
| 987 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 988 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 988 | 989 | |
| 989 | 990 | MDRV_CPU_ADD(Z80, XTAL_36MHz/12) /* verified on pcb */ |
| 990 | 991 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 991 | MDRV_CPU_VBLANK_INT(getstar_interrupt, 3) | |
| 992 | MDRV_CPU_VBLANK_INT_HACK(getstar_interrupt, 3) | |
| 992 | 993 | |
| 993 | 994 | MDRV_INTERLEAVE(10) /* 10 CPU slices per frame - enough for the sound CPU to read all commands */ |
| 994 | 995 |
| r1877 | r1878 | |
|---|---|---|
| 110 | 110 | * |
| 111 | 111 | *************************************/ |
| 112 | 112 | |
| 113 | static void plot_byte( | |
| 113 | static void plot_byte( | |
| 114 | 114 | { |
| 115 | 115 | pen_t fore_pen = MAKE_RGB(pal1bit(color >> 0), pal1bit(color >> 2), pal1bit(color >> 1)); |
| 116 | 116 | UINT8 flip_xor = screen_flip & 7; |
| r1877 | r1878 | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | |
| 204 | static IN | |
| 204 | static IN | |
| 205 | 205 | { |
| 206 | if (readinputport(2) & 1) /* coin */ | |
| 207 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 208 | ||
| 209 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 206 | /* coin insertion causes an NMI */ | |
| 207 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE); | |
| 210 | 208 | } |
| 211 | 209 | |
| 212 | 210 | |
| r1877 | r1878 | |
| 223 | 221 | |
| 224 | 222 | /* the address lines are used for /CS; yes, they can overlap! */ |
| 225 | 223 | if (!(offset & 4)) |
| 226 | result &= ppi8255_0_r(offset); | |
| 224 | result &= ppi8255_0_r(machine, offset); | |
| 227 | 225 | if (!(offset & 8)) |
| 228 | result &= ppi8255_1_r(offset); | |
| 226 | result &= ppi8255_1_r(machine, offset); | |
| 229 | 227 | return result; |
| 230 | 228 | } |
| 231 | 229 | |
| r1877 | r1878 | |
| 234 | 232 | { |
| 235 | 233 | /* the address lines are used for /CS; yes, they can overlap! */ |
| 236 | 234 | if (!(offset & 4)) |
| 237 | ppi8255_0_w(offset, data); | |
| 235 | ppi8255_0_w(machine, offset, data); | |
| 238 | 236 | if (!(offset & 8)) |
| 239 | ppi8255_1_w(offset, data); | |
| 237 | ppi8255_1_w(machine, offset, data); | |
| 240 | 238 | } |
| 241 | 239 | |
| 242 | 240 | |
| r1877 | r1878 | |
| 453 | 451 | PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) |
| 454 | 452 | |
| 455 | 453 | PORT_START_TAG("IN2") |
| 456 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_ | |
| 454 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANG | |
| 457 | 455 | |
| 458 | 456 | PORT_START_TAG("IN3") |
| 459 | 457 | PORT_DIPNAME( 0xff, 0x00, DEF_STR( Cabinet ) ) |
| r1877 | r1878 | |
| 538 | 536 | MDRV_CPU_ADD(Z80, MASTER_CLOCK) /* a guess */ |
| 539 | 537 | MDRV_CPU_PROGRAM_MAP(spaceint_map,0) |
| 540 | 538 | MDRV_CPU_IO_MAP(spaceint_portmap,0) |
| 541 | MDRV_CPU_VBLANK_INT( | |
| 539 | MDRV_CPU_VBLANK_INT("ma | |
| 542 | 540 | |
| 543 | 541 | /* video hardware */ |
| 544 | 542 | MDRV_VIDEO_START(spaceint) |
| r1877 | r1878 | |
|---|---|---|
| 463 | 463 | |
| 464 | 464 | static READ32_HANDLER( psh_ymf_fm_r ) |
| 465 | 465 | { |
| 466 | return YMF278B_status_port_0_r(0)<<24; /* Also, bit 0 being high indicates not ready to send sample data for test */ | |
| 466 | return YMF278B_status_port_0_r(machine,0)<<24; /* Also, bit 0 being high indicates not ready to send sample data for test */ | |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | static WRITE32_HANDLER( psh_ymf_fm_w ) |
| 470 | 470 | { |
| 471 | 471 | if (!(mem_mask & 0xff000000)) // FM bank 1 address (OPL2/OPL3 compatible) |
| 472 | 472 | { |
| 473 | YMF278B_control_port_0_A_w(0, data>>24); | |
| 473 | YMF278B_control_port_0_A_w(machine, 0, data>>24); | |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | if (!(mem_mask & 0x00ff0000)) // FM bank 1 data |
| 477 | 477 | { |
| 478 | YMF278B_data_port_0_A_w(0, data>>16); | |
| 478 | YMF278B_data_port_0_A_w(machine, 0, data>>16); | |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | if (!(mem_mask & 0x0000ff00)) // FM bank 2 address (OPL3/YMF 262 extended) |
| 482 | 482 | { |
| 483 | YMF278B_control_port_0_B_w(0, data>>8); | |
| 483 | YMF278B_control_port_0_B_w(machine, 0, data>>8); | |
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | if (!(mem_mask & 0x000000ff)) // FM bank 2 data |
| 487 | 487 | { |
| 488 | YMF278B_data_port_0_B_w(0, data); | |
| 488 | YMF278B_data_port_0_B_w(machine, 0, data); | |
| 489 | 489 | } |
| 490 | 490 | } |
| 491 | 491 | |
| r1877 | r1878 | |
| 493 | 493 | { |
| 494 | 494 | if (!(mem_mask & 0xff000000)) // PCM address (OPL4/YMF 278B extended) |
| 495 | 495 | { |
| 496 | YMF278B_control_port_0_C_w(0, data>>24); | |
| 496 | YMF278B_control_port_0_C_w(machine, 0, data>>24); | |
| 497 | 497 | |
| 498 | 498 | #if ROMTEST |
| 499 | 499 | if (data>>24 == 0x06) // Reset Sample reading (They always write this code immediately before reading data) |
| r1877 | r1878 | |
| 505 | 505 | |
| 506 | 506 | if (!(mem_mask & 0x00ff0000)) // PCM data |
| 507 | 507 | { |
| 508 | YMF278B_data_port_0_C_w(0, data>>16); | |
| 508 | YMF278B_data_port_0_C_w(machine, 0, data>>16); | |
| 509 | 509 | } |
| 510 | 510 | } |
| 511 | 511 | |
| r1877 | r1878 | |
| 598 | 598 | /* basic machine hardware */ |
| 599 | 599 | MDRV_CPU_ADD_TAG("main", SH2, MASTER_CLOCK/2) |
| 600 | 600 | MDRV_CPU_PROGRAM_MAP(ps3v1_readmem,ps3v1_writemem) |
| 601 | MDRV_CPU_VBLANK_INT(psikyosh_interrupt | |
| 601 | MDRV_CPU_VBLANK_INT("main", psikyosh_interrupt | |
| 602 | 602 | |
| 603 | 603 | MDRV_NVRAM_HANDLER(93C56) |
| 604 | 604 |
| r1877 | r1878 | |
|---|---|---|
| 305 | 305 | /* basic machine hardware */ |
| 306 | 306 | MDRV_CPU_ADD(M68000, 14000000) /* DE102 */ |
| 307 | 307 | MDRV_CPU_PROGRAM_MAP(boogwing_map,0) |
| 308 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 308 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 309 | 309 | |
| 310 | 310 | MDRV_CPU_ADD(H6280,32220000/4) |
| 311 | 311 | MDRV_CPU_PROGRAM_MAP(sound_readmem, sound_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 456 | 456 | MDRV_CPU_ADD_TAG("main", Z80, MCLK/2) /* 8.000 MHz */ |
| 457 | 457 | MDRV_CPU_PROGRAM_MAP(quizdna_readmem,quizdna_writemem) |
| 458 | 458 | MDRV_CPU_IO_MAP(quizdna_readport,quizdna_writeport) |
| 459 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 459 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 460 | 460 | |
| 461 | 461 | /* video hardware */ |
| 462 | 462 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 273 | 273 | |
| 274 | 274 | static MACHINE_RESET( supertnk ) |
| 275 | 275 | { |
| 276 | supertnk_bankswitch_0_w(0, 0); | |
| 277 | supertnk_bankswitch_1_w(0, 0); | |
| 276 | supertnk_bankswitch_0_w(machine, 0, 0); | |
| 277 | supertnk_bankswitch_1_w(machine, 0, 0); | |
| 278 | 278 | |
| 279 | supertnk_bitplane_select_0_w(0, 0); | |
| 280 | supertnk_bitplane_select_1_w(0, 0); | |
| 279 | supertnk_bitplane_select_0_w(machine, 0, 0); | |
| 280 | supertnk_bitplane_select_1_w(machine, 0, 0); | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | |
| r1877 | r1878 | |
| 413 | 413 | MDRV_CPU_ADD(TMS9980, 2598750) /* ? to which frequency is the 20.79 Mhz crystal mapped down? */ |
| 414 | 414 | MDRV_CPU_PROGRAM_MAP(supertnk_map,0) |
| 415 | 415 | MDRV_CPU_IO_MAP(supertnk_io_map,0) |
| 416 | MDRV_CPU_VBLANK_INT(supertnk_interrupt | |
| 416 | MDRV_CPU_VBLANK_INT("main", supertnk_interrupt | |
| 417 | 417 | |
| 418 | 418 | MDRV_MACHINE_RESET(supertnk) |
| 419 | 419 |
| r1877 | r1878 | |
|---|---|---|
| 101 | 101 | tilemap_mark_tile_dirty(darkhors_tmap2, offset); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | static void draw_sprites(running_machine *machine, | |
| 104 | static void draw_sprites(running_machine *machine, | |
| 105 | 105 | { |
| 106 | 106 | UINT32 *s = spriteram32; |
| 107 | 107 | UINT32 *end = spriteram32 + 0x02000/4; |
| r1877 | r1878 | |
| 258 | 258 | static WRITE32_HANDLER( OKIM6295_data_0_msb32_w ) |
| 259 | 259 | { |
| 260 | 260 | if (ACCESSING_MSB32) |
| 261 | OKIM6295_data_0_msb_w(offset, data >> 16, mem_mask >> 16); | |
| 261 | OKIM6295_data_0_msb_w(machine, offset, data >> 16, mem_mask >> 16); | |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | static READ32_HANDLER( OKIM6295_status_0_msb32_r ) |
| 265 | 265 | { |
| 266 | return OKIM6295_status_0_msb_r(offset, mem_mask >> 16) << 16; | |
| 266 | return OKIM6295_status_0_msb_r(machine, offset, mem_mask >> 16) << 16; | |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | static WRITE32_HANDLER( paletteram32_xBBBBBGGGGGRRRRR_dword_w ) |
| 270 | 270 | { |
| 271 | 271 | paletteram16 = (UINT16 *)paletteram32; |
| 272 | if (ACCESSING_MSW32) paletteram16_xBBBBBGGGGGRRRRR_word_w(offset*2, data >> 16, mem_mask >> 16); | |
| 273 | if (ACCESSING_LSW32) paletteram16_xBBBBBGGGGGRRRRR_word_w(offset*2+1, data, mem_mask); | |
| 272 | if (ACCESSING_MSW32) paletteram16_xBBBBBGGGGGRRRRR_word_w(machine, offset*2, data >> 16, mem_mask >> 16); | |
| 273 | if (ACCESSING_LSW32) paletteram16_xBBBBBGGGGGRRRRR_word_w(machine, offset*2+1, data, mem_mask); | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | static UINT32 input_sel; |
| r1877 | r1878 | |
| 600 | 600 | static MACHINE_DRIVER_START( darkhors ) |
| 601 | 601 | MDRV_CPU_ADD(M68EC020, 12000000) // 36MHz/3 ?? |
| 602 | 602 | MDRV_CPU_PROGRAM_MAP(darkhors_readmem,darkhors_writemem) |
| 603 | MDRV_CPU_VBLANK_INT(darkhors,3) | |
| 603 | MDRV_CPU_VBLANK_INT_HACK(darkhors,3) | |
| 604 | 604 | |
| 605 | 605 | MDRV_NVRAM_HANDLER(darkhors) |
| 606 | 606 |
| r1877 | r1878 | |
|---|---|---|
| 208 | 208 | (mame_rand(Machine) & 0x9800) | // bit 7 eeprom? |
| 209 | 209 | (((bishjan_sel==0x12) ? 0x40:0x00) << 8) | |
| 210 | 210 | // (mame_rand() & 0xff); |
| 211 | // ((( | |
| 211 | // (((vid | |
| 212 | 212 | 0x18; |
| 213 | 213 | } |
| 214 | 214 | |
| r1877 | r1878 | |
| 228 | 228 | |
| 229 | 229 | return (res << 8) | |
| 230 | 230 | readinputport(3) | |
| 231 | ((bishjan_hopper && !( | |
| 231 | ((bishjan_hopper && !(vid | |
| 232 | 232 | ; |
| 233 | 233 | } |
| 234 | 234 | |
| r1877 | r1878 | |
| 442 | 442 | static MACHINE_DRIVER_START( bishjan ) |
| 443 | 443 | MDRV_CPU_ADD(H83044, 44100000/3) |
| 444 | 444 | MDRV_CPU_PROGRAM_MAP( bishjan_map, 0 ) |
| 445 | MDRV_CPU_VBLANK_INT(bishjan_interrupt,2) | |
| 445 | MDRV_CPU_VBLANK_INT_HACK(bishjan_interrupt,2) | |
| 446 | 446 | |
| 447 | 447 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 448 | 448 |
| r1877 | r1878 | |
|---|---|---|
| 290 | 290 | /* basic machine hardware */ |
| 291 | 291 | MDRV_CPU_ADD(M68000, AMIGA_68000_NTSC_CLOCK) |
| 292 | 292 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 293 | MDRV_CPU_VBLANK_INT(amiga_scanline_callback, 262) | |
| 294 | 293 | |
| 295 | 294 | MDRV_MACHINE_RESET(amiga) |
| 296 | 295 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r1877 | r1878 | |
| 309 | 308 | MDRV_PALETTE_INIT(amiga) |
| 310 | 309 | |
| 311 | 310 | MDRV_VIDEO_START(amiga) |
| 312 | MDRV_VIDEO_UPDATE( | |
| 311 | MDRV_VIDEO_UPDATE(a | |
| 313 | 312 | |
| 314 | 313 | /* sound hardware */ |
| 315 | 314 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| r1877 | r1878 | |
|---|---|---|
| 308 | 308 | static WRITE16_HANDLER(splndrbt_flip0_w) |
| 309 | 309 | { |
| 310 | 310 | if (ACCESSING_LSB) splndrbt_flip = 0; |
| 311 | if (ACCESSING_MSB) equites_bgcolor_w(offset, data, 0x00ff); | |
| 311 | if (ACCESSING_MSB) equites_bgcolor_w(machine, offset, data, 0x00ff); | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | static WRITE16_HANDLER(splndrbt_flip1_w) |
| r1877 | r1878 | |
| 666 | 666 | /* basic machine hardware */ |
| 667 | 667 | MDRV_CPU_ADD(M68000, XTAL_12MHz/4) /* 68000P8 running at 3mhz! verified on pcb */ |
| 668 | 668 | MDRV_CPU_PROGRAM_MAP(equites_map,0) |
| 669 | MDRV_CPU_VBLANK_INT(equites_interrupt, 2) | |
| 669 | MDRV_CPU_VBLANK_INT_HACK(equites_interrupt, 2) | |
| 670 | 670 | |
| 671 | 671 | /* video hardware */ |
| 672 | 672 | MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) |
| r1877 | r1878 | |
| 695 | 695 | /* basic machine hardware */ |
| 696 | 696 | MDRV_CPU_ADD(M68000, XTAL_24MHz/4) /* 68000P8 running at 6mhz, verified on pcb */ |
| 697 | 697 | MDRV_CPU_PROGRAM_MAP(splndrbt_map, 0) |
| 698 | MDRV_CPU_VBLANK_INT(splndrbt_interrupt, 2) | |
| 698 | MDRV_CPU_VBLANK_INT_HACK(splndrbt_interrupt, 2) | |
| 699 | 699 | |
| 700 | 700 | MDRV_MACHINE_RESET(splndrbt) |
| 701 | 701 |
| r1877 | r1878 | |
|---|---|---|
| 286 | 286 | MDRV_CPU_ADD(Z80, PCB_CLOCK/6) /* The denominator is a Daphne guess based on PacMan's hardware */ |
| 287 | 287 | MDRV_CPU_PROGRAM_MAP(z80_0_mem,0) |
| 288 | 288 | MDRV_CPU_IO_MAP(z80_0_io,0) |
| 289 | MDRV_CPU_VBLANK_INT(vblank_callback_esh | |
| 289 | MDRV_CPU_VBLANK_INT("main", vblank_callback_esh | |
| 290 | 290 | |
| 291 | 291 | MDRV_MACHINE_START(esh) |
| 292 | 292 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | */ |
| 62 | 62 | |
| 63 | 63 | #include "driver.h" |
| 64 | #include "deprecat.h" | |
| 64 | 65 | #include "sound/ay8910.h" |
| 65 | 66 | |
| 66 | 67 | static int nSndNum=0x10; |
| r1877 | r1878 | |
| 105 | 106 | { |
| 106 | 107 | if(activecpu_get_previouspc()==0x309) |
| 107 | 108 | { |
| 108 | AY8910_control_port_0_w(0,nAyCtrl); | |
| 109 | AY8910_write_port_0_w(0,nAyData); | |
| 109 | AY8910_control_port_0_w(machine,0,nAyCtrl); | |
| 110 | AY8910_write_port_0_w(machine,0,nAyData); | |
| 110 | 111 | } |
| 111 | 112 | } |
| 112 | 113 | |
| r1877 | r1878 | |
| 115 | 116 | |
| 116 | 117 | if(activecpu_get_previouspc()==0x309) |
| 117 | 118 | { |
| 118 | AY8910_control_port_1_w(0,nAyCtrl); | |
| 119 | AY8910_write_port_1_w(0,nAyData); | |
| 119 | AY8910_control_port_1_w(machine,0,nAyCtrl); | |
| 120 | AY8910_write_port_1_w(machine,0,nAyData); | |
| 120 | 121 | } |
| 121 | 122 | } |
| 122 | 123 | |
| r1877 | r1878 | |
| 179 | 180 | MDRV_CPU_ADD(Z80, 12000000) // audio cpu ? |
| 180 | 181 | MDRV_CPU_PROGRAM_MAP(memory_map,0) |
| 181 | 182 | MDRV_CPU_IO_MAP(io_map,0) |
| 182 | MDRV_CPU_VBLANK_INT(irq0_line_hold, 2) | |
| 183 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 2) | |
| 183 | 184 | |
| 184 | 185 | /* video hardware */ |
| 185 | 186 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 35 | 35 | |
| 36 | 36 | static READ16_HANDLER( K052109_halfword_r ) |
| 37 | 37 | { |
| 38 | return K052109_r(offset); | |
| 38 | return K052109_r(machine,offset); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | static WRITE16_HANDLER( K052109_halfword_w ) |
| 42 | 42 | { |
| 43 | 43 | if (ACCESSING_LSB) |
| 44 | K052109_w(offset,data & 0xff); | |
| 44 | K052109_w(machine,offset,data & 0xff); | |
| 45 | 45 | |
| 46 | 46 | /* is this a bug in the game or something else? */ |
| 47 | 47 | if (!ACCESSING_LSB) |
| 48 | K052109_w(offset,(data >> 8) & 0xff); | |
| 48 | K052109_w(machine,offset,(data >> 8) & 0xff); | |
| 49 | 49 | // logerror("%06x half %04x = %04x\n",activecpu_get_pc(),offset,data); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | static READ16_HANDLER( K051937_halfword_r ) |
| 53 | 53 | { |
| 54 | return K051937_r(offset); | |
| 54 | return K051937_r(machine,offset); | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | static WRITE16_HANDLER( K051937_halfword_w ) |
| 58 | 58 | { |
| 59 | 59 | if (ACCESSING_LSB) |
| 60 | K051937_w(offset,data & 0xff); | |
| 60 | K051937_w(machine,offset,data & 0xff); | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | static READ16_HANDLER( K051960_halfword_r ) |
| 64 | 64 | { |
| 65 | return K051960_r(offset); | |
| 65 | return K051960_r(machine,offset); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static WRITE16_HANDLER( K051960_halfword_w ) |
| 69 | 69 | { |
| 70 | 70 | if (ACCESSING_LSB) |
| 71 | K051960_w(offset,data & 0xff); | |
| 71 | K051960_w(machine,offset,data & 0xff); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
| r1877 | r1878 | |
| 139 | 139 | if (irqBmask & 4) |
| 140 | 140 | { |
| 141 | 141 | logerror("%04x trigger cpu B irq 4 %02x\n",activecpu_get_pc(),data); |
| 142 | cpunum_set_input_line( | |
| 142 | cpunum_set_input_line(machine, 1,4,HOLD_LINE); | |
| 143 | 143 | } |
| 144 | 144 | else |
| 145 | 145 | logerror("%04x MISSED cpu B irq 4 %02x\n",activecpu_get_pc(),data); |
| r1877 | r1878 | |
| 148 | 148 | static WRITE16_HANDLER( sound_command_w ) |
| 149 | 149 | { |
| 150 | 150 | if (ACCESSING_MSB) |
| 151 | soundlatch_w(0,(data >> 8) & 0xff); | |
| 151 | soundlatch_w(machine,0,(data >> 8) & 0xff); | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | static WRITE16_HANDLER( sound_irq_w ) |
| r1877 | r1878 | |
| 339 | 339 | /* basic machine hardware */ |
| 340 | 340 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz */ |
| 341 | 341 | MDRV_CPU_PROGRAM_MAP(gradius3_map,0) |
| 342 | MDRV_CPU_VBLANK_INT(cpuA_interrupt | |
| 342 | MDRV_CPU_VBLANK_INT("main", cpuA_interrupt | |
| 343 | 343 | |
| 344 | 344 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz */ |
| 345 | 345 | MDRV_CPU_PROGRAM_MAP(gradius3_map2,0) |
| 346 | MDRV_CPU_VBLANK_INT(cpuB_interrupt,2) /* has three interrupt vectors, 1 2 and 4 */ | |
| 346 | MDRV_CPU_VBLANK_INT_HACK(cpuB_interrupt,2) /* has three interrupt vectors, 1 2 and 4 */ | |
| 347 | 347 | /* 4 is triggered by cpu A, the others are unknown but */ |
| 348 | 348 | /* required for the game to run. */ |
| 349 | 349 | MDRV_CPU_ADD(Z80, 3579545) |
| r1877 | r1878 | |
|---|---|---|
| 235 | 235 | static MACHINE_RESET( omegrace ) |
| 236 | 236 | { |
| 237 | 237 | /* Omega Race expects the vector processor to be ready. */ |
| 238 | avgdvg_reset_w (0, 0); | |
| 238 | avgdvg_reset_w (machine,0, 0); | |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | |
| r1877 | r1878 | |
| 248 | 248 | |
| 249 | 249 | static READ8_HANDLER( omegrace_vg_go_r ) |
| 250 | 250 | { |
| 251 | avgdvg_go_w(0,0); | |
| 251 | avgdvg_go_w(machine,0,0); | |
| 252 | 252 | return 0; |
| 253 | 253 | } |
| 254 | 254 | |
| r1877 | r1878 | |
| 322 | 322 | |
| 323 | 323 | static WRITE8_HANDLER( omegrace_soundlatch_w ) |
| 324 | 324 | { |
| 325 | soundlatch_w (offset, data); | |
| 326 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 325 | soundlatch_w (machine, offset, data); | |
| 326 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 |
| r1877 | r1878 | |
|---|---|---|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | static WRITE8_HANDLER( ram_w ) { decrypted[0x0000 + offset] = swap_bits_5_6(data); decocass_rambase[0x0000 + offset] = data; } |
| 75 | static WRITE8_HANDLER( charram_w ) { decrypted[0x6000 + offset] = swap_bits_5_6(data); decocass_charram_w(offset, data); } | |
| 76 | static WRITE8_HANDLER( fgvideoram_w ) { decrypted[0xc000 + offset] = swap_bits_5_6(data); decocass_fgvideoram_w(offset, data); } | |
| 77 | static WRITE8_HANDLER( fgcolorram_w ) { decrypted[0xc400 + offset] = swap_bits_5_6(data); decocass_colorram_w(offset, data); } | |
| 78 | static WRITE8_HANDLER( tileram_w ) { decrypted[0xd000 + offset] = swap_bits_5_6(data); decocass_tileram_w(offset, data); } | |
| 79 | static WRITE8_HANDLER( objectram_w ) { decrypted[0xd800 + offset] = swap_bits_5_6(data); decocass_objectram_w(offset, data); } | |
| 75 | static WRITE8_HANDLER( charram_w ) { decrypted[0x6000 + offset] = swap_bits_5_6(data); decocass_charram_w(machine, offset, data); } | |
| 76 | static WRITE8_HANDLER( fgvideoram_w ) { decrypted[0xc000 + offset] = swap_bits_5_6(data); decocass_fgvideoram_w(machine, offset, data); } | |
| 77 | static WRITE8_HANDLER( fgcolorram_w ) { decrypted[0xc400 + offset] = swap_bits_5_6(data); decocass_colorram_w(machine, offset, data); } | |
| 78 | static WRITE8_HANDLER( tileram_w ) { decrypted[0xd000 + offset] = swap_bits_5_6(data); decocass_tileram_w(machine, offset, data); } | |
| 79 | static WRITE8_HANDLER( objectram_w ) { decrypted[0xd800 + offset] = swap_bits_5_6(data); decocass_objectram_w(machine, offset, data); } | |
| 80 | 80 | |
| 81 | static WRITE8_HANDLER( mirrorvideoram_w ) { offset = ((offset >> 5) & 0x1f) | ((offset & 0x1f) << 5); fgvideoram_w(offset, data); } | |
| 82 | static WRITE8_HANDLER( mirrorcolorram_w ) { offset = ((offset >> 5) & 0x1f) | ((offset & 0x1f) << 5); fgcolorram_w(offset, data); } | |
| 81 | static WRITE8_HANDLER( mirrorvideoram_w ) { offset = ((offset >> 5) & 0x1f) | ((offset & 0x1f) << 5); fgvideoram_w(machine, offset, data); } | |
| 82 | static WRITE8_HANDLER( mirrorcolorram_w ) { offset = ((offset >> 5) & 0x1f) | ((offset & 0x1f) << 5); fgcolorram_w(machine, offset, data); } | |
| 83 | 83 | static READ8_HANDLER( mirrorvideoram_r ) { offset = ((offset >> 5) & 0x1f) | ((offset & 0x1f) << 5); return decocass_fgvideoram[offset]; } |
| 84 | 84 | static READ8_HANDLER( mirrorcolorram_r ) { offset = ((offset >> 5) & 0x1f) | ((offset & 0x1f) << 5); return decocass_colorram[offset]; } |
| 85 | 85 |
| r1877 | r1878 | |
|---|---|---|
| 258 | 258 | |
| 259 | 259 | static WRITE16_HANDLER( sound_cmd1_w ) |
| 260 | 260 | { |
| 261 | soundlatch_w(0, data&0xff); | |
| 261 | soundlatch_w(machine, 0, data&0xff); | |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | static WRITE16_HANDLER( sound_cmd1_msb_w ) |
| 265 | 265 | { |
| 266 | soundlatch_w(0, data>>8); | |
| 266 | soundlatch_w(machine, 0, data>>8); | |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | static WRITE16_HANDLER( sound_cmd2_w ) |
| 270 | 270 | { |
| 271 | soundlatch2_w(0, data&0xff); | |
| 271 | soundlatch2_w(machine, 0, data&0xff); | |
| 272 | 272 | return; |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | static WRITE16_HANDLER( sound_cmd2_msb_w ) |
| 276 | 276 | { |
| 277 | soundlatch2_w(0, data>>8); | |
| 277 | soundlatch2_w(machine, 0, data>>8); | |
| 278 | 278 | return; |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | static WRITE16_HANDLER( sound_irq_w ) |
| 282 | 282 | { |
| 283 | cpunum_set_input_line( | |
| 283 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | static READ16_HANDLER( sound_status_r ) |
| 287 | 287 | { |
| 288 | int latch = soundlatch3_r(0); | |
| 288 | int latch = soundlatch3_r(machine,0); | |
| 289 | 289 | |
| 290 | 290 | if ((latch & 0xf) == 0xe) latch |= 1; |
| 291 | 291 | |
| r1877 | r1878 | |
| 294 | 294 | |
| 295 | 295 | static READ16_HANDLER( sound_status_msb_r ) |
| 296 | 296 | { |
| 297 | int latch = soundlatch3_r(0); | |
| 297 | int latch = soundlatch3_r(machine,0); | |
| 298 | 298 | |
| 299 | 299 | if ((latch & 0xf) == 0xe) latch |= 1; |
| 300 | 300 | |
| r1877 | r1878 | |
| 303 | 303 | |
| 304 | 304 | static WRITE16_HANDLER( irq_ack_w ) |
| 305 | 305 | { |
| 306 | K056832_b_word_w(offset, data, mem_mask); | |
| 306 | K056832_b_word_w(machine, offset, data, mem_mask); | |
| 307 | 307 | |
| 308 | 308 | if (offset == 3 && ACCESSING_LSB) |
| 309 | 309 | { |
| r1877 | r1878 | |
| 369 | 369 | else |
| 370 | 370 | { |
| 371 | 371 | offset = (offset & 0x0007) | ((offset & 0x7f80) >> 4); |
| 372 | return K053247_word_r(offset,mem_mask); | |
| 372 | return K053247_word_r(machine,offset,mem_mask); | |
| 373 | 373 | } |
| 374 | 374 | } |
| 375 | 375 | |
| r1877 | r1878 | |
| 384 | 384 | { |
| 385 | 385 | offset = (offset & 0x0007) | ((offset & 0x7f80) >> 4); |
| 386 | 386 | |
| 387 | K053247_word_w(offset,data,mem_mask); | |
| 387 | K053247_word_w(machine,offset,data,mem_mask); | |
| 388 | 388 | } |
| 389 | 389 | } |
| 390 | 390 | |
| r1877 | r1878 | |
| 557 | 557 | else |
| 558 | 558 | { |
| 559 | 559 | offset = (offset & 0x0007) | ((offset & 0x1fe0) >> 2); |
| 560 | return K053247_word_r(offset,mem_mask); | |
| 560 | return K053247_word_r(machine,offset,mem_mask); | |
| 561 | 561 | } |
| 562 | 562 | } |
| 563 | 563 | |
| r1877 | r1878 | |
| 571 | 571 | { |
| 572 | 572 | offset = (offset & 0x0007) | ((offset & 0x1fe0) >> 2); |
| 573 | 573 | |
| 574 | K053247_word_w(offset,data,mem_mask); | |
| 574 | K053247_word_w(machine,offset,data,mem_mask); | |
| 575 | 575 | } |
| 576 | 576 | } |
| 577 | 577 | |
| r1877 | r1878 | |
| 931 | 931 | /* basic machine hardware */ |
| 932 | 932 | MDRV_CPU_ADD_TAG("main", M68000, 16000000) /* 16 MHz (confirmed) */ |
| 933 | 933 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 934 | MDRV_CPU_VBLANK_INT(mystwarr_interrupt, 3) | |
| 934 | MDRV_CPU_VBLANK_INT_HACK(mystwarr_interrupt, 3) | |
| 935 | 935 | |
| 936 | 936 | MDRV_CPU_ADD_TAG("sound", Z80, 8000000) |
| 937 | 937 | /* audio CPU */ |
| r1877 | r1878 | |
| 981 | 981 | /* basic machine hardware */ |
| 982 | 982 | MDRV_CPU_MODIFY("main") |
| 983 | 983 | MDRV_CPU_PROGRAM_MAP(vsreadmem,vswritemem) |
| 984 | MDRV_CPU_VBLANK_INT(metamrph_interrupt, 40) | |
| 984 | MDRV_CPU_VBLANK_INT_HACK(metamrph_interrupt, 40) | |
| 985 | 985 | |
| 986 | 986 | /* video hardware */ |
| 987 | 987 | MDRV_VIDEO_START(viostorm) |
| r1877 | r1878 | |
| 1001 | 1001 | /* basic machine hardware */ |
| 1002 | 1002 | MDRV_CPU_MODIFY("main") |
| 1003 | 1003 | MDRV_CPU_PROGRAM_MAP(mmreadmem,mmwritemem) |
| 1004 | MDRV_CPU_VBLANK_INT(metamrph_interrupt, 40) | |
| 1004 | MDRV_CPU_VBLANK_INT_HACK(metamrph_interrupt, 40) | |
| 1005 | 1005 | |
| 1006 | 1006 | /* video hardware */ |
| 1007 | 1007 | MDRV_VIDEO_START(metamrph) |
| r1877 | r1878 | |
| 1021 | 1021 | /* basic machine hardware */ |
| 1022 | 1022 | MDRV_CPU_MODIFY("main") |
| 1023 | 1023 | MDRV_CPU_PROGRAM_MAP(dddreadmem, dddwritemem) |
| 1024 | MDRV_CPU_VBLANK_INT(ddd_interrupt | |
| 1024 | MDRV_CPU_VBLANK_INT("main", ddd_interrupt | |
| 1025 | 1025 | |
| 1026 | 1026 | MDRV_GFXDECODE(dadandrn) |
| 1027 | 1027 | |
| r1877 | r1878 | |
| 1043 | 1043 | /* basic machine hardware */ |
| 1044 | 1044 | MDRV_CPU_MODIFY("main") |
| 1045 | 1045 | MDRV_CPU_PROGRAM_MAP(gaiareadmem,gaiawritemem) |
| 1046 | MDRV_CPU_VBLANK_INT(ddd_interrupt | |
| 1046 | MDRV_CPU_VBLANK_INT("main", ddd_interrupt | |
| 1047 | 1047 | |
| 1048 | 1048 | MDRV_GFXDECODE(gaiapols) |
| 1049 | 1049 | |
| r1877 | r1878 | |
| 1067 | 1067 | /* basic machine hardware */ |
| 1068 | 1068 | MDRV_CPU_MODIFY("main") |
| 1069 | 1069 | MDRV_CPU_PROGRAM_MAP(mcreadmem,mcwritemem) |
| 1070 | MDRV_CPU_VBLANK_INT(mchamp_interrupt, 2) | |
| 1070 | MDRV_CPU_VBLANK_INT_HACK(mchamp_interrupt, 2) | |
| 1071 | 1071 | |
| 1072 | 1072 | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS | VIDEO_UPDATE_BEFORE_VBLANK) |
| 1073 | 1073 |
| r1877 | r1878 | |
|---|---|---|
| 1060 | 1060 | /* basic machine hardware */ |
| 1061 | 1061 | MDRV_CPU_ADD(Z80,12000000/2) /* 6.00 Mhz ? */ |
| 1062 | 1062 | MDRV_CPU_PROGRAM_MAP(nekkyoku_readmem_main,nekkyoku_writemem_main) |
| 1063 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1063 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1064 | 1064 | |
| 1065 | 1065 | MDRV_CPU_ADD(Z80,12000000/2) /* 6.00 Mhz ? */ |
| 1066 | 1066 | MDRV_CPU_PROGRAM_MAP(nekkyoku_readmem_sub,nekkyoku_writemem_sub) |
| r1877 | r1878 | |
| 1098 | 1098 | /* basic machine hardware */ |
| 1099 | 1099 | MDRV_CPU_ADD(Z80,12000000/2) /* 6.00 Mhz ? */ |
| 1100 | 1100 | MDRV_CPU_PROGRAM_MAP(fromance_readmem_main,fromance_writemem_main) |
| 1101 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1101 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1102 | 1102 | |
| 1103 | 1103 | MDRV_CPU_ADD(Z80,12000000/2) /* 6.00 Mhz ? */ |
| 1104 | 1104 | MDRV_CPU_PROGRAM_MAP(fromance_readmem_sub,fromance_writemem_sub) |
| r1877 | r1878 | |
| 1136 | 1136 | /* basic machine hardware */ |
| 1137 | 1137 | MDRV_CPU_ADD(Z80,12000000/2) /* 6.00 Mhz ? */ |
| 1138 | 1138 | MDRV_CPU_PROGRAM_MAP(fromance_readmem_main,fromance_writemem_main) |
| 1139 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1139 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1140 | 1140 | |
| 1141 | 1141 | MDRV_CPU_ADD(Z80,12000000/2) /* 6.00 Mhz ? */ |
| 1142 | 1142 | MDRV_CPU_PROGRAM_MAP(fromance_readmem_sub,fromance_writemem_sub) |
| r1877 | r1878 | |
|---|---|---|
| 76 | 76 | static render_texture *overlay_texture; |
| 77 | 77 | static UINT32 last_seqid; |
| 78 | 78 | |
| 79 | static | |
| 79 | static | |
| 80 | 80 | |
| 81 | 81 | static const UINT8 led_map[16] = |
| 82 | 82 | { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x77,0x7c,0x39,0x5e,0x79,0x00 }; |
| r1877 | r1878 | |
| 164 | 164 | |
| 165 | 165 | static VIDEO_START( dlair ) |
| 166 | 166 | { |
| 167 | | |
| 167 | | |
| 168 | 168 | |
| 169 | 169 | /* create textures */ |
| 170 | 170 | last_seqid = laserdisc_get_video(discinfo, &vidbitmap); |
| r1877 | r1878 | |
| 207 | 207 | |
| 208 | 208 | static VIDEO_UPDATE( dlair ) |
| 209 | 209 | { |
| 210 | | |
| 210 | | |
| 211 | 211 | UINT32 seqid; |
| 212 | 212 | |
| 213 | 213 | /* get the current video and update the bitmap if different */ |
| r1877 | r1878 | |
| 229 | 229 | |
| 230 | 230 | static VIDEO_UPDATE( dleuro ) |
| 231 | 231 | { |
| 232 | | |
| 232 | | |
| 233 | 233 | UINT32 seqid; |
| 234 | 234 | int x, y; |
| 235 | 235 | |
| r1877 | r1878 | |
| 680 | 680 | INPUT_PORTS_END |
| 681 | 681 | |
| 682 | 682 | |
| 683 | #ifdef UNUSED_DEFINITION | |
| 683 | 684 | static INPUT_PORTS_START( dleuro ) |
| 684 | 685 | PORT_START /* IN0 */ |
| 685 | 686 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) |
| r1877 | r1878 | |
| 751 | 752 | PORT_DIPSETTING( 0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1",0x04,PORTCOND_EQUALS,0x04) |
| 752 | 753 | PORT_DIPSETTING( 0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1",0x04,PORTCOND_EQUALS,0x04) |
| 753 | 754 | INPUT_PORTS_END |
| 755 | #endif | |
| 754 | 756 | |
| 755 | 757 | |
| 756 | ||
| 757 | 758 | /************************************* |
| 758 | 759 | * |
| 759 | 760 | * Graphics definitions |
| r1877 | r1878 | |
| 803 | 804 | /* basic machine hardware */ |
| 804 | 805 | MDRV_CPU_ADD_TAG("main", Z80, MASTER_CLOCK_US/4) |
| 805 | 806 | MDRV_CPU_PROGRAM_MAP(dlus_map,0) |
| 806 | MDRV_CPU_VBLANK_INT(vblank_callback | |
| 807 | MDRV_CPU_VBLANK_INT("main", vblank_callback | |
| 807 | 808 | MDRV_CPU_PERIODIC_INT(irq0_line_hold, (double)MASTER_CLOCK_US/8/16/16/16/16) |
| 808 | 809 | |
| 809 | 810 | MDRV_MACHINE_START(dlair) |
| r1877 | r1878 | |
| 843 | 844 | MDRV_CPU_CONFIG(dleuro_daisy_chain) |
| 844 | 845 | MDRV_CPU_PROGRAM_MAP(dleuro_map,0) |
| 845 | 846 | MDRV_CPU_IO_MAP(dleuro_io_map,0) |
| 846 | MDRV_CPU_VBLANK_INT(vblank_callback | |
| 847 | MDRV_CPU_VBLANK_INT("main", vblank_callback | |
| 847 | 848 | |
| 848 | 849 | MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_HZ(MASTER_CLOCK_EURO/(16*16*16*16*16*8))) |
| 849 | 850 |
| r1877 | r1878 | |
|---|---|---|
| 279 | 279 | tilemap_set_scroll_cols(bg_tilemap, 32); |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | static void draw_bitmap( | |
| 282 | static void draw_bitmap( | |
| 283 | 283 | { |
| 284 | 284 | int x,y,count; |
| 285 | 285 | int i, bit0, bit1, bit2; |
| r1877 | r1878 | |
| 400 | 400 | static MACHINE_DRIVER_START( jollyjgr ) |
| 401 | 401 | MDRV_CPU_ADD(Z80, 3579545) /* 3,579545 MHz */ |
| 402 | 402 | MDRV_CPU_PROGRAM_MAP(jollyjgr_map,0) |
| 403 | MDRV_CPU_VBLANK_INT(jollyjgr_interrupt | |
| 403 | MDRV_CPU_VBLANK_INT("main", jollyjgr_interrupt | |
| 404 | 404 | |
| 405 | 405 | /* video hardware */ |
| 406 | 406 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 454 | 454 | /* basic machine hardware */ |
| 455 | 455 | MDRV_CPU_ADD(M6809,49152000/32) |
| 456 | 456 | MDRV_CPU_PROGRAM_MAP(skykid_map,0) |
| 457 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 457 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 458 | 458 | |
| 459 | 459 | MDRV_CPU_ADD(HD63701,49152000/8) /* or compatible 6808 with extra instructions */ |
| 460 | 460 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 461 | 461 | MDRV_CPU_IO_MAP(mcu_port_map,0) |
| 462 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 462 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 463 | 463 | |
| 464 | 464 | MDRV_INTERLEAVE(100) /* we need heavy synch */ |
| 465 | 465 |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | |
| 55 | 55 | static WRITE16_HANDLER( interrupt_ack_w ) |
| 56 | 56 | { |
| 57 | atarigen_scanline_int_ack_w(offset, data, mem_mask); | |
| 58 | atarigen_video_int_ack_w(offset, data, mem_mask); | |
| 57 | atarigen_scanline_int_ack_w(machine, offset, data, mem_mask); | |
| 58 | atarigen_video_int_ack_w(machine, offset, data, mem_mask); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| r1877 | r1878 | |
| 83 | 83 | |
| 84 | 84 | static READ16_HANDLER( adpcm_r ) |
| 85 | 85 | { |
| 86 | return OKIM6295_status_0_r(offset) | 0xff00; | |
| 86 | return OKIM6295_status_0_r(machine, offset) | 0xff00; | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | |
| 90 | 90 | static WRITE16_HANDLER( adpcm_w ) |
| 91 | 91 | { |
| 92 | 92 | if (ACCESSING_LSB) |
| 93 | OKIM6295_data_0_w(offset, data & 0xff); | |
| 93 | OKIM6295_data_0_w(machine, offset, data & 0xff); | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
| r1877 | r1878 | |
| 198 | 198 | /* basic machine hardware */ |
| 199 | 199 | MDRV_CPU_ADD(M68000, ATARI_CLOCK_14MHz/2) |
| 200 | 200 | MDRV_CPU_PROGRAM_MAP(main_readmem,main_writemem) |
| 201 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 201 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 202 | 202 | |
| 203 | 203 | MDRV_MACHINE_RESET(klax) |
| 204 | 204 | MDRV_NVRAM_HANDLER(atarigen) |
| r1877 | r1878 | |
|---|---|---|
| 249 | 249 | static MACHINE_DRIVER_START( quizpani ) |
| 250 | 250 | MDRV_CPU_ADD(M68000, 10000000) |
| 251 | 251 | MDRV_CPU_PROGRAM_MAP(quizpani_readmem,quizpani_writemem) |
| 252 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 252 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 253 | 253 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,164) // music tempo |
| 254 | 254 | |
| 255 | 255 | MDRV_MACHINE_RESET( quizpani ) |
| r1877 | r1878 | |
|---|---|---|
| 1202 | 1202 | } |
| 1203 | 1203 | |
| 1204 | 1204 | |
| 1205 | static void copy_scroll_op( | |
| 1205 | static void copy_scroll_op( | |
| 1206 | 1206 | { |
| 1207 | 1207 | |
| 1208 | 1208 | //-------------------------------------------------------------------------- |
| r1877 | r1878 | |
| 1240 | 1240 | } |
| 1241 | 1241 | |
| 1242 | 1242 | |
| 1243 | static void copy_scroll_xp( | |
| 1243 | static void copy_scroll_xp( | |
| 1244 | 1244 | { |
| 1245 | 1245 | |
| 1246 | 1246 | //-------------------------------------------------------------------------- |
| r1877 | r1878 | |
| 1296 | 1296 | |
| 1297 | 1297 | |
| 1298 | 1298 | |
| 1299 | static void copy_fixed_xp( | |
| 1299 | static void copy_fixed_xp( | |
| 1300 | 1300 | { |
| 1301 | 1301 | UINT16 *esi, *edi; |
| 1302 | 1302 | int dst_pitch, ecx, edx; |
| r1877 | r1878 | |
| 1331 | 1331 | } |
| 1332 | 1332 | |
| 1333 | 1333 | |
| 1334 | static void copy_fixed_2b( | |
| 1334 | static void copy_fixed_2b( | |
| 1335 | 1335 | { |
| 1336 | 1336 | UINT16 *esi, *edi; |
| 1337 | 1337 | int dst_pitch, ecx, edx; |
| r1877 | r1878 | |
| 1378 | 1378 | } |
| 1379 | 1379 | |
| 1380 | 1380 | |
| 1381 | static void filter_bitmap( | |
| 1381 | static void filter_bitmap( | |
| 1382 | 1382 | { |
| 1383 | 1383 | int dst_pitch; |
| 1384 | 1384 | |
| r1877 | r1878 | |
| 1499 | 1499 | latch_data = sound_fifo[fftail]; |
| 1500 | 1500 | fftail = (fftail + 1) & (MAX_SOUNDS - 1); |
| 1501 | 1501 | latch_delay = (latch_data) ? 0 : 4; |
| 1502 | soundlatch_w(0, latch_data); | |
| 1502 | soundlatch_w(machine, 0, latch_data); | |
| 1503 | 1503 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); |
| 1504 | 1504 | } |
| 1505 | 1505 | |
| r1877 | r1878 | |
| 1539 | 1539 | latch_data = sound_fifo[fftail]; |
| 1540 | 1540 | fftail = (fftail + 1) & (MAX_SOUNDS - 1); |
| 1541 | 1541 | latch_delay = (latch_data) ? 0 : 4; |
| 1542 | soundlatch_w(0, latch_data); | |
| 1542 | soundlatch_w(machine, 0, latch_data); | |
| 1543 | 1543 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); |
| 1544 | 1544 | } |
| 1545 | 1545 | break; |
| r1877 | r1878 | |
| 1950 | 1950 | static MACHINE_DRIVER_START( halleys ) |
| 1951 | 1951 | MDRV_CPU_ADD_TAG("main", M6809, 1664000) /* 19968000/12 (verified on pcb) */ |
| 1952 | 1952 | MDRV_CPU_PROGRAM_MAP(readmem, writemem) |
| 1953 | MDRV_CPU_VBLANK_INT(halleys_interrupt, 4) | |
| 1953 | MDRV_CPU_VBLANK_INT_HACK(halleys_interrupt, 4) | |
| 1954 | 1954 | |
| 1955 | 1955 | MDRV_CPU_ADD(Z80, 6000000/2) /* (verified on pcb) */ |
| 1956 | 1956 | /* audio CPU */ |
| r1877 | r1878 | |
| 1977 | 1977 | // sound hardware |
| 1978 | 1978 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1979 | 1979 | |
| 1980 | MDRV_SOUND_ADD(AY8910, 6 | |
| 1980 | MDRV_SOUND_ADD(AY8910, XTAL_6MHz | |
| 1981 | 1981 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) |
| 1982 | 1982 | |
| 1983 | MDRV_SOUND_ADD(AY8910, 6 | |
| 1983 | MDRV_SOUND_ADD(AY8910, XTAL_6MHz | |
| 1984 | 1984 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) |
| 1985 | 1985 | |
| 1986 | MDRV_SOUND_ADD(AY8910, 6 | |
| 1986 | MDRV_SOUND_ADD(AY8910, XTAL_6MHz | |
| 1987 | 1987 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) |
| 1988 | 1988 | |
| 1989 | MDRV_SOUND_ADD(AY8910, 6 | |
| 1989 | MDRV_SOUND_ADD(AY8910, XTAL_6MHz | |
| 1990 | 1990 | MDRV_SOUND_CONFIG(ay8910_interface) |
| 1991 | 1991 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) |
| 1992 | 1992 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
| 1995 | 1995 | static MACHINE_DRIVER_START( benberob ) |
| 1996 | 1996 | MDRV_IMPORT_FROM(halleys) |
| 1997 | 1997 | MDRV_CPU_REPLACE("main", M6809, 1000000) // 19.968MHz/20? (CAUTION: timing critical) |
| 1998 | MDRV_CPU_VBLANK_INT(benberob_interrupt, 4) | |
| 1998 | MDRV_CPU_VBLANK_INT_HACK(benberob_interrupt, 4) | |
| 1999 | 1999 | MDRV_VIDEO_UPDATE(benberob) |
| 2000 | 2000 | MACHINE_DRIVER_END |
| 2001 | 2001 |
| r1877 | r1878 | |
|---|---|---|
| 169 | 169 | /* basic machine hardware */ |
| 170 | 170 | MDRV_CPU_ADD(Z80, 18432000/12) /* 1.536 MHz ? */ |
| 171 | 171 | MDRV_CPU_PROGRAM_MAP(readmem_gomoku, writemem_gomoku) |
| 172 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 172 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 173 | 173 | |
| 174 | 174 | /* video hardware */ |
| 175 | 175 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 145 | 145 | UINT16 ret = 0; |
| 146 | 146 | |
| 147 | 147 | if (ACCESSING_LSB16) |
| 148 | ret |= K054539_1_r(offset); | |
| 148 | ret |= K054539_1_r(machine, offset); | |
| 149 | 149 | if (ACCESSING_MSB16) |
| 150 | ret |= K054539_0_r(offset)<<8; | |
| 150 | ret |= K054539_0_r(machine, offset)<<8; | |
| 151 | 151 | |
| 152 | 152 | return ret; |
| 153 | 153 | } |
| r1877 | r1878 | |
| 155 | 155 | static WRITE16_HANDLER( dual539_16_w ) |
| 156 | 156 | { |
| 157 | 157 | if (ACCESSING_LSB16) |
| 158 | K054539_1_w(offset, data); | |
| 158 | K054539_1_w(machine, offset, data); | |
| 159 | 159 | if (ACCESSING_MSB16) |
| 160 | K054539_0_w(offset, data>>8); | |
| 160 | K054539_0_w(machine, offset, data>>8); | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | static READ32_HANDLER( dual539_r ) |
| r1877 | r1878 | |
| 165 | 165 | UINT32 data = 0; |
| 166 | 166 | |
| 167 | 167 | if (~mem_mask & 0xffff0000) |
| 168 | data |= dual539_16_r(offset * 2, mem_mask >> 16) << 16; | |
| 168 | data |= dual539_16_r(machine, offset * 2, mem_mask >> 16) << 16; | |
| 169 | 169 | if (~mem_mask & 0x0000ffff) |
| 170 | data |= dual539_16_r(offset * 2 + 1, mem_mask); | |
| 170 | data |= dual539_16_r(machine, offset * 2 + 1, mem_mask); | |
| 171 | 171 | |
| 172 | 172 | return data; |
| 173 | 173 | } |
| r1877 | r1878 | |
| 175 | 175 | static WRITE32_HANDLER( dual539_w ) |
| 176 | 176 | { |
| 177 | 177 | if (~mem_mask & 0xffff0000) |
| 178 | dual539_16_w(offset * 2, data >> 16, mem_mask >> 16); | |
| 178 | dual539_16_w(machine, offset * 2, data >> 16, mem_mask >> 16); | |
| 179 | 179 | if (~mem_mask & 0x0000ffff) |
| 180 | dual539_16_w(offset * 2 + 1, data, mem_mask); | |
| 180 | dual539_16_w(machine, offset * 2 + 1, data, mem_mask); | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | |
| r1877 | r1878 | |
| 237 | 237 | static READ32_HANDLER( v_rom_r ) |
| 238 | 238 | { |
| 239 | 239 | UINT8 *mem8 = memory_region(REGION_GFX2); |
| 240 | int bank = K056832_word_r(0x34/2, 0xffff); | |
| 240 | int bank = K056832_word_r(machine, 0x34/2, 0xffff); | |
| 241 | 241 | |
| 242 | 242 | offset *= 2; |
| 243 | 243 | |
| r1877 | r1878 | |
| 307 | 307 | static READ32_HANDLER( ide_std_r ) |
| 308 | 308 | { |
| 309 | 309 | if (ACCESSING_LSB32) |
| 310 | return ide_controller16_0_r(IDE_STD_OFFSET + offset, 0x00ff) >> 8; | |
| 310 | return ide_controller16_0_r(machine, IDE_STD_OFFSET + offset, 0x00ff) >> 8; | |
| 311 | 311 | else |
| 312 | return ide_controller16_0_r(IDE_STD_OFFSET + offset, 0x0000) << 16; | |
| 312 | return ide_controller16_0_r(machine, IDE_STD_OFFSET + offset, 0x0000) << 16; | |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | static WRITE32_HANDLER( ide_std_w ) |
| 316 | 316 | { |
| 317 | 317 | if (ACCESSING_LSB32) |
| 318 | ide_controller16_0_w(IDE_STD_OFFSET + offset, data << 8, 0x00ff); | |
| 318 | ide_controller16_0_w(machine, IDE_STD_OFFSET + offset, data << 8, 0x00ff); | |
| 319 | 319 | else |
| 320 | ide_controller16_0_w(IDE_STD_OFFSET + offset, data >> 16, 0x0000); | |
| 320 | ide_controller16_0_w(machine, IDE_STD_OFFSET + offset, data >> 16, 0x0000); | |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | |
| 324 | 324 | static READ32_HANDLER( ide_alt_r ) |
| 325 | 325 | { |
| 326 | 326 | if (offset == 0) |
| 327 | return ide_controller16_0_r(IDE_ALT_OFFSET, 0xff00) << 24; | |
| 327 | return ide_controller16_0_r(machine, IDE_ALT_OFFSET, 0xff00) << 24; | |
| 328 | 328 | |
| 329 | 329 | return 0; |
| 330 | 330 | } |
| r1877 | r1878 | |
| 332 | 332 | static WRITE32_HANDLER( ide_alt_w ) |
| 333 | 333 | { |
| 334 | 334 | if (offset == 0 && !(mem_mask & 0x00ff0000)) |
| 335 | ide_controller16_0_w(IDE_ALT_OFFSET, data >> 24, 0xff00); | |
| 335 | ide_controller16_0_w(machine, IDE_ALT_OFFSET, data >> 24, 0xff00); | |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | |
| r1877 | r1878 | |
| 1013 | 1013 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1014 | 1014 | |
| 1015 | 1015 | |
| 1016 | #ifdef UNUSED_DEFINITION | |
| 1016 | 1017 | static INPUT_PORTS_START( popnmusic ) |
| 1017 | 1018 | POPN_INPUT /* IN 0-2 */ |
| 1018 | 1019 | POPN_DSW1 /* IN 3 */ |
| 1019 | 1020 | POPN_DSW2 /* IN 4 */ |
| 1020 | 1021 | POPN_DSW3 /* IN 5 */ |
| 1021 | 1022 | INPUT_PORTS_END |
| 1023 | #endif | |
| 1022 | 1024 | |
| 1025 | #ifdef UNUSED_DEFINITION | |
| 1023 | 1026 | static INPUT_PORTS_START( popn1 ) |
| 1024 | 1027 | POPN_INPUT /* IN 0-2 */ |
| 1025 | 1028 | POPN1_DSW1 /* IN 3 */ |
| 1026 | 1029 | POPN1_DSW2 /* IN 4 */ |
| 1027 | 1030 | POPN1_DSW3 /* IN 5 */ |
| 1028 | 1031 | INPUT_PORTS_END |
| 1032 | #endif | |
| 1029 | 1033 | |
| 1030 | ||
| 1031 | 1034 | #define POPNST_INPUT \ |
| 1032 | 1035 | PORT_START /* IN 0 */ \ |
| 1033 | 1036 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) \ |
| r1877 | r1878 | |
| 1114 | 1117 | PORT_DIPSETTING( 0x2a, DEF_STR( Off ) ) \ |
| 1115 | 1118 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1116 | 1119 | |
| 1120 | #ifdef UNUSED_DEFINITION | |
| 1117 | 1121 | static INPUT_PORTS_START( popnstage ) |
| 1118 | 1122 | POPNST_INPUT /* IN 0-2 */ |
| 1119 | 1123 | POPNST_DSW1 /* IN 3 */ |
| 1120 | 1124 | POPNST_DSW2 /* IN 4 */ |
| 1121 | 1125 | POPNST_DSW3 /* IN 5 */ |
| 1122 | 1126 | INPUT_PORTS_END |
| 1127 | #endif | |
| 1123 | 1128 | |
| 1124 | ||
| 1125 | 1129 | /************************************* |
| 1126 | 1130 | * |
| 1127 | 1131 | * Graphics layouts |
| r1877 | r1878 | |
| 1223 | 1227 | //MDRV_CPU_ADD(M68EC020, 18432000/2) /* 9.216 MHz!? */ |
| 1224 | 1228 | MDRV_CPU_ADD(M68EC020, 32000000/4) /* 8.000 MHz!? */ |
| 1225 | 1229 | MDRV_CPU_PROGRAM_MAP(memory_map, 0) |
| 1226 | MDRV_CPU_VBLANK_INT(vb_interrupt | |
| 1230 | MDRV_CPU_VBLANK_INT("main", vb_interrupt | |
| 1227 | 1231 | |
| 1228 | 1232 | MDRV_MACHINE_START(djmain) |
| 1229 | 1233 | MDRV_MACHINE_RESET(djmain) |
| r1877 | r1878 | |
|---|---|---|
| 335 | 335 | return (PS7500_IO[IRQSTA]&PS7500_IO[IRQMSKA])|0x80; |
| 336 | 336 | |
| 337 | 337 | case IOCR: //TODO: nINT1, OD[n] p.81 |
| 338 | return (input_port_0_r(0)&0x80)|0x34|3; | |
| 338 | return (input_port_0_r(machine,0)&0x80)|0x34|3; | |
| 339 | 339 | |
| 340 | 340 | case VIDCR: |
| 341 | 341 | return (PS7500_IO[offset]|0x50)&0xfffffff0; |
| r1877 | r1878 | |
| 613 | 613 | MDRV_CPU_ADD(ARM7, 54000000) // guess... |
| 614 | 614 | MDRV_CPU_PROGRAM_MAP(ssfindo_map,0) |
| 615 | 615 | |
| 616 | MDRV_CPU_VBLANK_INT(ssfindo_interrupt | |
| 616 | MDRV_CPU_VBLANK_INT("main", ssfindo_interrupt | |
| 617 | 617 | MDRV_MACHINE_RESET(ssfindo) |
| 618 | 618 | |
| 619 | 619 | |
| r1877 | r1878 | |
| 636 | 636 | MDRV_CPU_ADD(ARM7, 54000000) // guess... |
| 637 | 637 | MDRV_CPU_PROGRAM_MAP(ppcar_map,0) |
| 638 | 638 | |
| 639 | MDRV_CPU_VBLANK_INT(ssfindo_interrupt | |
| 639 | MDRV_CPU_VBLANK_INT("main", ssfindo_interrupt | |
| 640 | 640 | MDRV_MACHINE_RESET(ssfindo) |
| 641 | 641 | |
| 642 | 642 |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | #include "sound/discrete.h" |
| 11 | 11 | |
| 12 | 12 | #define FIRETRK_CPU_CLOCK_1MHZ (12096000 / 12) |
| 13 | #define FIRETRK_CPU_CLOCK_750KZ (12096000 /16) | |
| 13 | #define FIRETRK_CPU_CLOCK_750KZ (12096000 / 16) | |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | int firetrk_game; |
| 17 | 17 | |
| 18 | UINT32 firetrk_color1_mask; | |
| 19 | UINT32 firetrk_color2_mask; | |
| 18 | static UINT8 in_service_mode; | |
| 19 | static UINT32 dial[2]; | |
| 20 | static UINT8 steer_dir[2]; | |
| 21 | static UINT8 steer_flag[2]; | |
| 22 | static UINT8 gear; | |
| 20 | 23 | |
| 21 | static int last_service; | |
| 22 | static int steer_dir[2]; | |
| 23 | static int steer_flag[2]; | |
| 24 | static int attract; | |
| 25 | static int gear; | |
| 26 | 24 | |
| 27 | ||
| 28 | static DRIVER_INIT( firetrk ) | |
| 25 | static void set_service_mode(running_machine *machine, int enable) | |
| 29 | 26 | { |
| 30 | firetrk_game = 1; | |
| 31 | } | |
| 32 | static DRIVER_INIT( superbug ) | |
| 33 | { | |
| 34 | firetrk_game = 2; | |
| 35 | } | |
| 36 | static DRIVER_INIT( montecar ) | |
| 37 | { | |
| 38 | firetrk_game = 3; | |
| 39 | } | |
| 27 | in_service_mode = enable; | |
| 40 | 28 | |
| 41 | ||
| 42 | static void set_firetrk_service(running_machine *machine, int enable) | |
| 43 | { | |
| 44 | 29 | /* watchdog is disabled during service mode */ |
| 45 | 30 | watchdog_enable(machine, !enable); |
| 46 | 31 | |
| r1877 | r1878 | |
| 49 | 34 | } |
| 50 | 35 | |
| 51 | 36 | |
| 52 | static IN | |
| 37 | static IN | |
| 53 | 38 | { |
| 54 | int firetrk_service; | |
| 39 | set_service_mode(machine, newval); | |
| 40 | } | |
| 55 | 41 | |
| 56 | if (GAME_IS_FIRETRUCK) | |
| 57 | { | |
| 58 | firetrk_service = readinputport(4) & 0x80; | |
| 59 | if (firetrk_service != last_service) | |
| 60 | { | |
| 61 | set_firetrk_service(machine, firetrk_service); | |
| 62 | 42 | |
| 63 | last_service = firetrk_service; | |
| 64 | } | |
| 65 | if (firetrk_service) | |
| 66 | return; | |
| 67 | } | |
| 68 | else | |
| 69 | if (GAME_IS_MONTECARLO) | |
| 70 | { | |
| 71 | firetrk_service = readinputport(6) & 0x04; | |
| 72 | if (firetrk_service != last_service) | |
| 73 | { | |
| 74 | set_firetrk_service(machine, firetrk_service); | |
| 43 | static INPUT_CHANGED( firetrk_horn_changed ) | |
| 44 | { | |
| 45 | discrete_sound_w(machine, FIRETRUCK_HORN_EN, newval); | |
| 46 | } | |
| 75 | 47 | |
| 76 | last_service = firetrk_service; | |
| 77 | } | |
| 78 | if (firetrk_service) | |
| 79 | return; | |
| 80 | } | |
| 81 | else | |
| 82 | discrete_sound_w(SUPERBUG_ASR_EN, 0); /* Super Bug - ASR */ | |
| 83 | 48 | |
| 49 | static INPUT_CHANGED( gear_changed ) | |
| 50 | { | |
| 51 | if (newval) | |
| 52 | gear = (FPTR)param; | |
| 53 | } | |
| 54 | ||
| 55 | ||
| 56 | static INTERRUPT_GEN( firetrk_interrupt ) | |
| 57 | { | |
| 58 | /* Super Bug - ASR - when is this used and what is an ASR? */ | |
| 59 | // discrete_sound_w(machine, SUPERBUG_ASR_EN, 0); | |
| 60 | ||
| 84 | 61 | /* NMI interrupts are disabled during service mode in firetrk and montecar */ |
| 85 | /* they never make it here if in service mode */ | |
| 86 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 62 | if (!in_service_mode) | |
| 63 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 87 | 64 | } |
| 88 | 65 | |
| 89 | 66 | |
| r1877 | r1878 | |
| 94 | 71 | cpunum_set_input_line(machine, 0, 0, PULSE_LINE); |
| 95 | 72 | |
| 96 | 73 | /* IRQs are generated by inverse 16V signal */ |
| 97 | ||
| 98 | 74 | scanline += 32; |
| 99 | 75 | |
| 100 | 76 | if (scanline > 262) |
| 101 | { | |
| 102 | 77 | scanline = 0; |
| 103 | } | |
| 104 | 78 | |
| 105 | 79 | timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, periodic_callback); |
| 106 | 80 | } |
| 107 | 81 | |
| 108 | 82 | |
| 109 | static | |
| 83 | static WRITE8_HANDLER | |
| 110 | 84 | { |
| 111 | static UINT8 dial[2]; | |
| 85 | /* BIT0 => START1 LAMP */ | |
| 86 | set_led_status(0, !(data & 0x01)); | |
| 112 | 87 | |
| 113 | int i; | |
| 88 | /* BIT1 => START2 LAMP */ | |
| 89 | set_led_status(1, !(data & 0x02)); | |
| 114 | 90 | |
| 115 | /* handle steering wheels */ | |
| 91 | /* BIT2 => FLASH */ | |
| 92 | firetrk_flash = data & 0x04; | |
| 116 | 93 | |
| 117 | for (i = 0; i < 2; i++) | |
| 118 | { | |
| 119 | signed char delta = readinputport(i) - dial[i]; | |
| 94 | /* BIT3 => TRACK LAMP */ | |
| 95 | set_led_status(3, !(data & 0x08)); | |
| 120 | 96 | |
| 121 | if (delta < 0) | |
| 122 | { | |
| 123 | steer_flag[i] = 1; | |
| 124 | steer_dir[i] = 0; | |
| 125 | } | |
| 126 | if (delta > 0) | |
| 127 | { | |
| 128 | steer_flag[i] = 1; | |
| 129 | steer_dir[i] = 1; | |
| 130 | } | |
| 97 | /* BIT4 => ATTRACT */ | |
| 98 | discrete_sound_w(machine, FIRETRUCK_ATTRACT_EN, data & 0x10); | |
| 99 | coin_lockout_w(0, !(data & 0x10)); | |
| 100 | coin_lockout_w(1, !(data & 0x10)); | |
| 131 | 101 | |
| 132 | dial[i] += delta; | |
| 133 | } | |
| 102 | /* BIT5 => START3 LAMP */ | |
| 103 | set_led_status(2, !(data & 0x20)); | |
| 134 | 104 | |
| 135 | if (GAME_IS_FIRETRUCK) | |
| 136 | { | |
| 137 | /* map horn button onto discrete sound emulation */ | |
| 138 | discrete_sound_w(FIRETRUCK_HORN_EN, readinputport(7)); | |
| 139 | } | |
| 105 | /* BIT6 => UNUSED */ | |
| 140 | 106 | |
| 141 | /* update gear shift */ | |
| 142 | if (GAME_IS_SUPERBUG || GAME_IS_MONTECARLO) | |
| 143 | { | |
| 144 | switch (readinputport(7) & 15) | |
| 145 | { | |
| 146 | case 1: gear = 1; break; | |
| 147 | case 2: gear = 2; break; | |
| 148 | case 4: gear = 3; break; | |
| 149 | case 8: gear = 4; break; | |
| 150 | } | |
| 151 | } | |
| 107 | /* BIT7 => BELL OUT */ | |
| 108 | discrete_sound_w(machine, FIRETRUCK_BELL_EN, data & 0x80); | |
| 152 | 109 | } |
| 153 | 110 | |
| 154 | 111 | |
| 155 | static | |
| 112 | static WRITE8_HANDLER( sup | |
| 156 | 113 | { |
| 157 | if (GAME_IS_FIRETRUCK) | |
| 158 | { | |
| 159 | /* BIT0 => START1 LAMP */ | |
| 160 | /* BIT1 => START2 LAMP */ | |
| 161 | /* BIT2 => FLASH */ | |
| 162 | /* BIT3 => TRACK LAMP */ | |
| 163 | /* BIT4 => ATTRACT */ | |
| 164 | /* BIT5 => START3 LAMP */ | |
| 165 | /* BIT6 => UNUSED */ | |
| 166 | /* BIT7 => BELL OUT */ | |
| 114 | /* BIT0 => START LAMP */ | |
| 115 | set_led_status(0, offset & 0x01); | |
| 167 | 116 | |
| 168 | set_led_status(0, !(flags & 0x01)); | |
| 169 | set_led_status(1, !(flags & 0x02)); | |
| 170 | set_led_status(2, !(flags & 0x20)); | |
| 171 | set_led_status(3, !(flags & 0x08)); | |
| 117 | /* BIT1 => ATTRACT */ | |
| 118 | discrete_sound_w(machine, SUPERBUG_ATTRACT_EN, offset & 0x02); | |
| 119 | coin_lockout_w(0, !(offset & 0x02)); | |
| 120 | coin_lockout_w(1, !(offset & 0x02)); | |
| 172 | 121 | |
| 173 | attract = flags & 0x10; | |
| 122 | /* BIT2 => FLASH */ | |
| 123 | firetrk_flash = offset & 0x04; | |
| 174 | 124 | |
| 175 | discrete_sound_w(FIRETRUCK_BELL_EN, flags & 0x80); /* Bell Sound */ | |
| 176 | discrete_sound_w(FIRETRUCK_ATTRACT_EN, flags & 0x10); /* Attract */ | |
| 125 | /* BIT3 => TRACK LAMP */ | |
| 126 | set_led_status(1, offset & 0x08); | |
| 127 | } | |
| 177 | 128 | |
| 178 | coin_lockout_w(0, !attract); | |
| 179 | coin_lockout_w(1, !attract); | |
| 180 | 129 | |
| 181 | firetrk_set_flash(flags & 0x04); | |
| 182 | } | |
| 130 | static WRITE8_HANDLER( montecar_output_1_w ) | |
| 131 | { | |
| 132 | /* BIT0 => START LAMP */ | |
| 133 | set_led_status(0, !(data & 0x01)); | |
| 183 | 134 | |
| 184 | if (GAME_IS_SUPERBUG) | |
| 185 | { | |
| 186 | /* BIT0 => START LAMP */ | |
| 187 | /* BIT1 => ATTRACT */ | |
| 188 | /* BIT2 => FLASH */ | |
| 189 | /* BIT3 => TRACK LAMP */ | |
| 135 | /* BIT1 => TRACK LAMP */ | |
| 136 | set_led_status(1, !(data & 0x02)); | |
| 190 | 137 | |
| 191 | attract = flags & 0x02; | |
| 138 | /* BIT2 => ATTRACT */ | |
| 139 | discrete_sound_w(machine, MONTECAR_ATTRACT_INV, data & 0x04); | |
| 192 | 140 | |
| 193 | set_led_status(0, flags & 0x01); | |
| 194 | set_led_status(1, flags & 0x08); | |
| 141 | /* BIT3 => UNUSED */ | |
| 142 | /* BIT4 => UNUSED */ | |
| 195 | 143 | |
| 196 | discrete_sound_w(SUPERBUG_ATTRACT_EN, flags & 0x02); /* Attract */ | |
| 144 | /* BIT5 => COIN3 COUNTER */ | |
| 145 | coin_counter_w(0, data & 0x80); | |
| 197 | 146 | |
| 198 | coin_lockout_w(0, !attract); | |
| 199 | coin_lockout_w(1, !attract); | |
| 147 | /* BIT6 => COIN2 COUNTER */ | |
| 148 | coin_counter_w(1, data & 0x40); | |
| 200 | 149 | |
| 201 | firetrk_set_flash(flags & 0x04); | |
| 202 | } | |
| 150 | /* BIT7 => COIN1 COUNTER */ | |
| 151 | coin_counter_w(2, data & 0x20); | |
| 152 | } | |
| 203 | 153 | |
| 204 | if (GAME_IS_MONTECARLO) | |
| 205 | { | |
| 206 | /* BIT0 => START LAMP */ | |
| 207 | /* BIT1 => TRACK LAMP */ | |
| 208 | /* BIT2 => ATTRACT */ | |
| 209 | /* BIT3 => UNUSED */ | |
| 210 | /* BIT4 => UNUSED */ | |
| 211 | /* BIT5 => COIN3 COUNTER */ | |
| 212 | /* BIT6 => COIN2 COUNTER */ | |
| 213 | /* BIT7 => COIN1 COUNTER */ | |
| 214 | 154 | |
| 215 | set_led_status(0, !(flags & 0x01)); | |
| 216 | set_led_status(1, !(flags & 0x02)); | |
| 155 | static WRITE8_HANDLER( montecar_output_2_w ) | |
| 156 | { | |
| 157 | firetrk_flash = data & 0x80; | |
| 217 | 158 | |
| 218 | discrete_sound_w(MONTECAR_ATTRACT_INV, flags & 0x04); /* Attract */ | |
| 219 | ||
| 220 | coin_counter_w(0, flags & 0x80); | |
| 221 | coin_counter_w(1, flags & 0x40); | |
| 222 | coin_counter_w(2, flags & 0x20); | |
| 223 | } | |
| 159 | discrete_sound_w(machine, MONTECAR_BEEPER_EN, data & 0x10); | |
| 160 | discrete_sound_w(machine, MONTECAR_DRONE_LOUD_DATA, data & 0x0f); | |
| 224 | 161 | } |
| 225 | 162 | |
| 226 | 163 | |
| 227 | 164 | static MACHINE_RESET( firetrk ) |
| 228 | 165 | { |
| 229 | | |
| 166 | s | |
| 230 | 167 | |
| 231 | if (GAME_IS_MONTECARLO) | |
| 232 | { | |
| 233 | write_output(0); | |
| 234 | last_service = readinputport(6) & 0x04; | |
| 235 | set_firetrk_service(machine, last_service); | |
| 236 | } | |
| 237 | else | |
| 238 | if (GAME_IS_FIRETRUCK) | |
| 239 | { | |
| 240 | last_service = readinputport(4) & 0x80; | |
| 241 | set_firetrk_service(machine, last_service); | |
| 242 | } | |
| 243 | ||
| 244 | 168 | timer_call_after_resynch(NULL, 0, periodic_callback); |
| 245 | 169 | } |
| 246 | 170 | |
| 247 | 171 | |
| 248 | static | |
| 172 | static R | |
| 249 | 173 | { |
| 250 | static const UINT8 colortable_source[] = | |
| 251 | { | |
| 252 | 0, 0, 1, 0, | |
| 253 | 2, 0, 3, 0, | |
| 254 | 3, 3, 2, 3, | |
| 255 | 1, 3, 0, 3, | |
| 256 | 0, 0, 1, 0, | |
| 257 | 2, 0, 0, 3, | |
| 258 | 3, 0, 0, 3 | |
| 259 | }; | |
| 260 | static const rgb_t palette_source[] = | |
| 261 | { | |
| 262 | MAKE_RGB(0x00, 0x00, 0x00), | |
| 263 | MAKE_RGB(0x5b, 0x5b, 0x5b), | |
| 264 | MAKE_RGB(0xa4, 0xa4, 0xa4), | |
| 265 | MAKE_RGB(0xff, 0xff, 0xff) | |
| 266 | }; | |
| 267 | int i; | |
| 174 | UINT8 val0 = readinputportbytag("DIP_0"); | |
| 175 | UINT8 val1 = readinputportbytag("DIP_1"); | |
| 268 | 176 | |
| 269 | firetrk_color1_mask = firetrk_color2_mask = 0; | |
| 270 | for (i = 0; i < ARRAY_LENGTH(colortable_source); i++) | |
| 271 | { | |
| 272 | UINT8 color = colortable_source[i]; | |
| 273 | if (color == 1) | |
| 274 | firetrk_color1_mask |= 1 << i; | |
| 275 | else if (color == 2) | |
| 276 | firetrk_color2_mask |= 1 << i; | |
| 277 | palette_set_color(machine, i, palette_source[color]); | |
| 278 | } | |
| 177 | if (val1 & (1 << (2 * offset + 0))) val0 |= 1; | |
| 178 | if (val1 & (1 << (2 * offset + 1))) val0 |= 2; | |
| 179 | ||
| 180 | return val0; | |
| 279 | 181 | } |
| 280 | 182 | |
| 281 | 183 | |
| 282 | static | |
| 184 | static READ8_HANDLER( | |
| 283 | 185 | { |
| 284 | palette_set_color_rgb(machine, number, pal1bit(val >> 2), pal1bit(val >> 1), pal1bit(val >> 0)); | |
| 186 | UINT8 val0 = readinputportbytag("DIP_0"); | |
| 187 | UINT8 val1 = readinputportbytag("DIP_1"); | |
| 188 | ||
| 189 | if (val1 & (1 << (3 - offset))) val0 |= 1; | |
| 190 | if (val1 & (1 << (7 - offset))) val0 |= 2; | |
| 191 | ||
| 192 | return val0; | |
| 285 | 193 | } |
| 286 | 194 | |
| 287 | 195 | |
| 288 | static | |
| 196 | static CUS | |
| 289 | 197 | { |
| 290 | static const UINT8 colortable_source[] = | |
| 291 | { | |
| 292 | 0x00, 0x00, 0x00, 0x01, | |
| 293 | 0x00, 0x02, 0x00, 0x03, | |
| 294 | 0x03, 0x03, 0x03, 0x02, | |
| 295 | 0x03, 0x01, 0x03, 0x00, | |
| 296 | 0x00, 0x00, 0x02, 0x00, | |
| 297 | 0x02, 0x01, 0x02, 0x02, | |
| 298 | 0x00, 0x10, 0x20, 0x30, | |
| 299 | 0x00, 0x04, 0x08, 0x0C, | |
| 300 | 0x00, 0x44, 0x48, 0x4C, | |
| 301 | 0x00, 0x84, 0x88, 0x8C, | |
| 302 | 0x00, 0xC4, 0xC8, 0xCC | |
| 303 | }; | |
| 198 | return steer_dir[(FPTR)param]; | |
| 199 | } | |
| 304 | 200 | |
| 305 | /* | |
| 306 | * The color PROM is addressed as follows: | |
| 307 | * | |
| 308 | * A0 => PLAYFIELD 1 | |
| 309 | * A1 => PLAYFIELD 2 | |
| 310 | * A2 => DRONE 1 | |
| 311 | * A3 => DRONE 2 | |
| 312 | * A4 => CAR 1 | |
| 313 | * A5 => CAR 2 | |
| 314 | * A6 => DRONE COLOR 1 | |
| 315 | * A7 => DRONE COLOR 2 | |
| 316 | * A8 => PLAYFIELD WINDOW | |
| 317 | * | |
| 318 | * This driver hard-codes some behavior which actually depends | |
| 319 | * on the PROM, like priorities, clipping and transparency. | |
| 320 | * | |
| 321 | */ | |
| 322 | 201 | |
| 323 | const UINT8* p = memory_region(REGION_PROMS); | |
| 324 | int i; | |
| 202 | static CUSTOM_INPUT( steer_flag_r ) | |
| 203 | { | |
| 204 | return steer_flag[(FPTR)param]; | |
| 205 | } | |
| 325 | 206 | |
| 326 | firetrk_color1_mask = firetrk_color2_mask = 0; | |
| 327 | for (i = 0; i < ARRAY_LENGTH(colortable_source); i++) | |
| 328 | { | |
| 329 | UINT8 color = colortable_source[i]; | |
| 330 | if (color == 1) | |
| 331 | firetrk_color1_mask |= 1 << i; | |
| 332 | else if (color == 2) | |
| 333 | firetrk_color2_mask |= 1 << i; | |
| 334 | prom_to_palette(machine, i, p[0x100 + colortable_source[i]]); | |
| 335 | } | |
| 336 | 207 | |
| 337 | palette_set_color(machine, ARRAY_LENGTH(colortable_source) + 0, MAKE_RGB(0x00, 0x00, 0x00)); | |
| 338 | palette_set_color(machine, ARRAY_LENGTH(colortable_source) + 1, MAKE_RGB(0xff, 0xff, 0xff)); | |
| 208 | static CUSTOM_INPUT( skid_r ) | |
| 209 | { | |
| 210 | UINT32 ret; | |
| 211 | int which = (FPTR)param; | |
| 212 | ||
| 213 | if (which != 2) | |
| 214 | ret = firetrk_skid[which]; | |
| 215 | else | |
| 216 | ret = firetrk_skid[0] | firetrk_skid[1]; | |
| 217 | ||
| 218 | return ret; | |
| 339 | 219 | } |
| 340 | 220 | |
| 341 | 221 | |
| 342 | static | |
| 222 | static CUSTOM_I | |
| 343 | 223 | { |
| 344 | UINT8 val0 = readinputport(2); | |
| 345 | UINT8 val1 = readinputport(3); | |
| 224 | UINT32 ret; | |
| 225 | int which = (FPTR)param; | |
| 346 | 226 | |
| 347 | if (GAME_IS_FIRETRUCK || GAME_IS_SUPERBUG) | |
| 348 | { | |
| 349 | if (val1 & (1 << (2 * offset + 0))) val0 |= 1; | |
| 350 | if (val1 & (1 << (2 * offset + 1))) val0 |= 2; | |
| 351 | } | |
| 352 | if (GAME_IS_MONTECARLO) | |
| 353 | { | |
| 354 | if (val1 & (1 << (3 - offset))) val0 |= 1; | |
| 355 | if (val1 & (1 << (7 - offset))) val0 |= 2; | |
| 356 | } | |
| 227 | if (which != 2) | |
| 228 | ret = firetrk_crash[which]; | |
| 229 | else | |
| 230 | ret = firetrk_crash[0] | firetrk_crash[1]; | |
| 357 | 231 | |
| 358 | return | |
| 232 | return ret | |
| 359 | 233 | } |
| 360 | 234 | |
| 361 | 235 | |
| 362 | static | |
| 236 | static CUSTOM_I | |
| 363 | 237 | { |
| 364 | UINT8 val = 0; | |
| 238 | return (gear == (FPTR)param) ? 1 : 0; | |
| 239 | } | |
| 365 | 240 | |
| 366 | UINT8 bit0 = readinputport(4); | |
| 367 | UINT8 bit6 = readinputport(5); | |
| 368 | UINT8 bit7 = readinputport(6); | |
| 369 | 241 | |
| 370 | if (GAME_IS_FIRETRUCK) | |
| 371 | { | |
| 372 | if (!steer_dir[0]) | |
| 373 | bit0 |= 0x04; | |
| 374 | if (!steer_flag[0]) | |
| 375 | bit7 |= 0x04; | |
| 376 | if (firetrk_skid[0] || firetrk_skid[1]) | |
| 377 | bit0 |= 0x40; | |
| 378 | if (firetrk_crash[0] || firetrk_crash[1]) | |
| 379 | bit7 |= 0x40; | |
| 380 | if (!steer_dir[1]) | |
| 381 | bit0 |= 0x08; | |
| 382 | if (!steer_flag[1]) | |
| 383 | bit7 |= 0x08; | |
| 384 | } | |
| 242 | static READ8_HANDLER( firetrk_input_r ) | |
| 243 | { | |
| 244 | int i; | |
| 385 | 245 | |
| 386 | if (GAME_IS_SUPERBUG) | |
| 246 | /* update steering wheels */ | |
| 247 | for (i = 0; i < 2; i++) | |
| 387 | 248 | { |
| 388 | if (!steer_dir[0]) | |
| 389 | bit0 |= 0x04; | |
| 390 | if (!steer_flag[0]) | |
| 391 | bit7 |= 0x04; | |
| 392 | if (firetrk_skid[0]) | |
| 393 | bit0 |= 0x40; | |
| 394 | if (firetrk_crash[0]) | |
| 395 | bit7 |= 0x40; | |
| 396 | if (gear == 1) | |
| 397 | bit7 |= 0x02; | |
| 398 | if (gear == 2) | |
| 399 | bit0 |= 0x01; | |
| 400 | if (gear == 3) | |
| 401 | bit7 |= 0x01; | |
| 402 | } | |
| 249 | UINT32 new_dial = readinputportbytag_safe((i ? "STEER_2" : "STEER_1"), 0); | |
| 250 | INT32 delta = new_dial - dial[i]; | |
| 403 | 251 | |
| 404 | if (GAME_IS_MONTECARLO) | |
| 405 | { | |
| 406 | if (!steer_dir[0]) | |
| 407 | bit6 |= 0x40; | |
| 408 | if (!steer_flag[0]) | |
| 409 | bit7 |= 0x40; | |
| 410 | if (gear == 1) | |
| 411 | bit6 |= 0x01; | |
| 412 | if (gear == 2) | |
| 413 | bit6 |= 0x02; | |
| 414 | if (gear == 3) | |
| 415 | bit6 |= 0x04; | |
| 416 | if (firetrk_skid[0]) | |
| 417 | bit7 |= 0x80; | |
| 418 | if (firetrk_skid[1]) | |
| 419 | bit6 |= 0x80; | |
| 420 | if (firetrk_crash[0]) | |
| 421 | val |= 0x02; | |
| 422 | if (firetrk_crash[1]) | |
| 423 | val |= 0x01; | |
| 252 | if (delta != 0) | |
| 253 | { | |
| 254 | steer_flag[i] = 0; | |
| 255 | steer_dir[i] = (delta < 0) ? 1 : 0; | |
| 256 | ||
| 257 | dial[i] = dial[i] + delta; | |
| 258 | } | |
| 424 | 259 | } |
| 425 | 260 | |
| 426 | if (bit0 & (1 << offset)) val |= 0x01; | |
| 427 | if (bit6 & (1 << offset)) val |= 0x40; | |
| 428 | if (bit7 & (1 << offset)) val |= 0x80; | |
| 261 | return ((readinputportbytag_safe("BIT_0", 0) & (1 << offset)) ? 0x01 : 0) | | |
| 262 | ((readinputportbytag_safe("BIT_6", 0) & (1 << offset)) ? 0x40 : 0) | | |
| 263 | ((readinputportbytag_safe("BIT_7", 0) & (1 << offset)) ? 0x80 : 0); | |
| 264 | } | |
| 429 | 265 | |
| 430 | return val; | |
| 266 | ||
| 267 | static READ8_HANDLER( montecar_input_r ) | |
| 268 | { | |
| 269 | UINT8 ret = firetrk_input_r(machine, offset); | |
| 270 | ||
| 271 | if (firetrk_crash[0]) | |
| 272 | ret |= 0x02; | |
| 273 | ||
| 274 | /* can this be right, bit 0 again ???? */ | |
| 275 | if (firetrk_crash[1]) | |
| 276 | ret |= 0x01; | |
| 277 | ||
| 278 | return ret; | |
| 431 | 279 | } |
| 432 | 280 | |
| 433 | 281 | |
| 434 | static WRITE8_HANDLER( | |
| 282 | static WRITE8_HANDLER( blin | |
| 435 | 283 | { |
| 436 | firetrk_ | |
| 284 | *firetrk_ | |
| 437 | 285 | } |
| 438 | 286 | |
| 439 | 287 | |
| 440 | static WRITE8_HANDLER( | |
| 288 | static WRITE8_HANDLER( mon | |
| 441 | 289 | { |
| 442 | 290 | firetrk_crash[0] = 0; |
| 443 | 291 | firetrk_skid[0] = 0; |
| 444 | 292 | } |
| 445 | 293 | |
| 446 | 294 | |
| 447 | static WRITE8_HANDLER( | |
| 295 | static WRITE8_HANDLER( mon | |
| 448 | 296 | { |
| 449 | 297 | firetrk_crash[1] = 0; |
| 450 | 298 | firetrk_skid[1] = 0; |
| 451 | 299 | } |
| 452 | 300 | |
| 453 | 301 | |
| 454 | static WRITE8_HANDLER( | |
| 302 | static WRITE8_HANDLER( | |
| 455 | 303 | { |
| 456 | steer_flag[0] = 0; | |
| 457 | steer_flag[1] = 0; | |
| 304 | steer_flag[0] = 1; | |
| 305 | steer_flag[1] = 1; | |
| 458 | 306 | } |
| 459 | 307 | |
| 460 | 308 | |
| 461 | static WRITE8_HANDLER( | |
| 309 | static WRITE8_HANDLER( | |
| 462 | 310 | { |
| 463 | 311 | firetrk_crash[0] = 0; |
| 464 | 312 | firetrk_crash[1] = 0; |
| 465 | 313 | } |
| 466 | 314 | |
| 467 | 315 | |
| 468 | static WRITE8_HANDLER( firetrk_out_w ) | |
| 469 | { | |
| 470 | if (GAME_IS_FIRETRUCK || GAME_IS_MONTECARLO) | |
| 471 | { | |
| 472 | write_output(data); | |
| 473 | } | |
| 474 | if (GAME_IS_SUPERBUG) | |
| 475 | { | |
| 476 | write_output(offset); | |
| 477 | } | |
| 478 | } | |
| 479 | ||
| 480 | ||
| 481 | ||
| 482 | 316 | static ADDRESS_MAP_START( firetrk_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 483 | 317 | ADDRESS_MAP_FLAGS( AMEF_ABITS(14) ) |
| 484 | AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0x700) AM_RAM AM_BASE(&firetrk_alpha_num_ram) | |
| 485 | AM_RANGE(0x0800, 0x08ff) AM_MIRROR(0x700) AM_READWRITE(MRA8_RAM, firetrk_playfield_w) AM_BASE(&firetrk_playfield_ram) | |
| 486 | AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x1f) AM_WRITE(firetrk_vert_w) | |
| 487 | AM_RANGE(0x1020, 0x1020) AM_MIRROR(0x1f) AM_WRITE(firetrk_horz_w) | |
| 488 | AM_RANGE(0x1040, 0x1040) AM_MIRROR(0x1f) AM_WRITE(firetrk_crash_reset_w) | |
| 489 | AM_RANGE(0x1060, 0x1060) AM_MIRROR(0x1f) AM_WRITE(firetrk_skid_reset_w) | |
| 490 | AM_RANGE(0x1080, 0x1080) AM_MIRROR(0x1f) AM_WRITE(firetrk_car_rot_w) | |
| 491 | AM_RANGE(0x10a0, 0x10a0) AM_MIRROR(0x1f) AM_WRITE(firetrk_steer_reset_w) | |
| 492 | AM_RANGE(0x10c0, 0x10c0) AM_MIRROR(0x1f) AM_WRITE(watchdog_reset_w) | |
| 493 | AM_RANGE(0x10e0, 0x10e0) AM_MIRROR(0x1f) AM_WRITE(firetrk_arrow_off_w) | |
| 494 | AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x1f) AM_WRITE(firetrk_motor_snd_w) | |
| 495 | AM_RANGE(0x1420, 0x1420) AM_MIRROR(0x1f) AM_WRITE(firetrk_crash_snd_w) | |
| 496 | AM_RANGE(0x1440, 0x1440) AM_MIRROR(0x1f) AM_WRITE(firetrk_skid_snd_w) | |
| 497 | AM_RANGE(0x1460, 0x1460) AM_MIRROR(0x1f) AM_WRITE(firetrk_drone_hpos_w) | |
| 498 | AM_RANGE(0x1480, 0x1480) AM_MIRROR(0x1f) AM_WRITE(firetrk_drone_vpos_w) | |
| 499 | AM_RANGE(0x14a0, 0x14a0) AM_MIRROR(0x1f) AM_WRITE(firetrk_drone_rot_w) | |
| 500 | AM_RANGE(0x14c0, 0x14c0) AM_MIRROR(0x1f) AM_WRITE(firetrk_out_w) | |
| 501 | AM_RANGE(0x14e0, 0x14e0) AM_MIRROR(0x1f) AM_WRITE(firetrk_xtndply_w) | |
| 502 | AM_RANGE(0x1800, 0x1807) AM_MIRROR(0x3f8) AM_READWRITE(firetrk_input_r, MWA8_NOP) | |
| 503 | AM_RANGE(0x1c00, 0x1c03) AM_MIRROR(0x3fc) AM_READ(firetrk_dip_r) | |
| 318 | AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0x0700) AM_RAM AM_BASE(&firetrk_alpha_num_ram) | |
| 319 | AM_RANGE(0x0800, 0x08ff) AM_MIRROR(0x0700) AM_RAM AM_BASE(&firetrk_playfield_ram) | |
| 320 | AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x001f) AM_WRITE(MWA8_RAM) AM_BASE(&firetrk_scroll_y) | |
| 321 | AM_RANGE(0x1020, 0x1020) AM_MIRROR(0x001f) AM_WRITE(MWA8_RAM) AM_BASE(&firetrk_scroll_x) | |
| 322 | AM_RANGE(0x1040, 0x1040) AM_MIRROR(0x001f) AM_WRITE(crash_reset_w) | |
| 323 | AM_RANGE(0x1060, 0x1060) AM_MIRROR(0x001f) AM_WRITE(firetrk_skid_reset_w) | |
| 324 | AM_RANGE(0x1080, 0x1080) AM_MIRROR(0x001f) AM_WRITE(MWA8_RAM) AM_BASE(&firetrk_car_rot) | |
| 325 | AM_RANGE(0x10a0, 0x10a0) AM_MIRROR(0x001f) AM_WRITE(steer_reset_w) | |
| 326 | AM_RANGE(0x10c0, 0x10c0) AM_MIRROR(0x001f) AM_WRITE(watchdog_reset_w) | |
| 327 | AM_RANGE(0x10e0, 0x10e0) AM_MIRROR(0x001f) AM_WRITE(blink_on_w) AM_BASE(&firetrk_blink) | |
| 328 | AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x001f) AM_WRITE(firetrk_motor_snd_w) | |
| 329 | AM_RANGE(0x1420, 0x1420) AM_MIRROR(0x001f) AM_WRITE(firetrk_crash_snd_w) | |
| 330 | AM_RANGE(0x1440, 0x1440) AM_MIRROR(0x001f) AM_WRITE(firetrk_skid_snd_w) | |
| 331 | AM_RANGE(0x1460, 0x1460) AM_MIRROR(0x001f) AM_WRITE(MWA8_RAM) AM_BASE(&firetrk_drone_x) | |
| 332 | AM_RANGE(0x1480, 0x1480) AM_MIRROR(0x001f) AM_WRITE(MWA8_RAM) AM_BASE(&firetrk_drone_y) | |
| 333 | AM_RANGE(0x14a0, 0x14a0) AM_MIRROR(0x001f) AM_WRITE(MWA8_RAM) AM_BASE(&firetrk_drone_rot) | |
| 334 | AM_RANGE(0x14c0, 0x14c0) AM_MIRROR(0x001f) AM_WRITE(firetrk_output_w) | |
| 335 | AM_RANGE(0x14e0, 0x14e0) AM_MIRROR(0x001f) AM_WRITE(firetrk_xtndply_w) | |
| 336 | AM_RANGE(0x1800, 0x1807) AM_MIRROR(0x03f8) AM_READWRITE(firetrk_input_r, MWA8_NOP) | |
| 337 | AM_RANGE(0x1c00, 0x1c03) AM_MIRROR(0x03fc) AM_READ(firetrk_dip_r) | |
| 504 | 338 | AM_RANGE(0x2000, 0x3fff) AM_ROM |
| 505 | 339 | ADDRESS_MAP_END |
| 506 | 340 | |
| r1877 | r1878 | |
| 508 | 342 | static ADDRESS_MAP_START( superbug_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 509 | 343 | ADDRESS_MAP_FLAGS( AMEF_ABITS(13) ) |
| 510 | 344 | AM_RANGE(0x0000, 0x00ff) AM_RAM |
| 511 | AM_RANGE(0x0100, 0x0100) AM_MIRROR(0x1f) AM_WRITE(firetrk_vert_w) | |
| 512 | AM_RANGE(0x0120, 0x0120) AM_MIRROR(0x1f) AM_WRITE(firetrk_horz_w) | |
| 513 | AM_RANGE(0x0140, 0x0140) AM_MIRROR(0x1f) AM_WRITE(firetrk_crash_reset_w) | |
| 514 | AM_RANGE(0x0160, 0x0160) AM_MIRROR(0x1f) AM_WRITE(firetrk_skid_reset_w) | |
| 515 | AM_RANGE(0x0180, 0x0180) AM_MIRROR(0x1f) AM_WRITE(firetrk_car_rot_w) | |
| 516 | AM_RANGE(0x01a0, 0x01a0) AM_MIRROR(0x1f) AM_WRITE(firetrk_steer_reset_w) | |
| 517 | AM_RANGE(0x01c0, 0x01c0) AM_MIRROR(0x1f) AM_WRITE(watchdog_reset_w) | |
| 518 | AM_RANGE(0x01e0, 0x01e0) AM_MIRROR(0x1f) AM_WRITE(firetrk_arrow_off_w) | |
| 519 | AM_RANGE(0x0200, 0x0207) AM_MIRROR(0x18) AM_READ(firetrk_input_r) | |
| 520 | AM_RANGE(0x0220, 0x0220) AM_MIRROR(0x1f) AM_WRITE(firetrk_asr_w) | |
| 521 | AM_RANGE(0x0240, 0x0243) AM_MIRROR(0x1c) AM_READ(firetrk_dip_r) | |
| 522 | AM_RANGE(0x0260, 0x026f) AM_MIRROR(0x10) AM_WRITE(firetrk_out_w) | |
| 523 | AM_RANGE(0x0280, 0x0280) AM_MIRROR(0x1f) AM_WRITE(firetrk_motor_snd_w) | |
| 524 | AM_RANGE(0x02a0, 0x02a0) AM_MIRROR(0x1f) AM_WRITE(firetrk_crash_snd_w) | |
| 525 | AM_RANGE(0x02c0, 0x02c0) AM_MIRROR(0x1f) AM_WRITE(firetrk_skid_snd_w) | |
| 345 | AM_RANGE(0x0100, 0x0100) AM_MIRROR(0x001f) AM_WRITE(MWA8_RAM) AM_BASE(&firetrk_scroll_y) | |
| 346 | AM_RANGE(0x0120, 0x0120) AM_MIRROR(0x001f) AM_WRITE(MWA8_RAM) AM_BASE(&firetrk_scroll_x) | |
| 347 | AM_RANGE(0x0140, 0x0140) AM_MIRROR(0x001f) AM_WRITE(crash_reset_w) | |
| 348 | AM_RANGE(0x0160, 0x0160) AM_MIRROR(0x001f) AM_WRITE(firetrk_skid_reset_w) | |
| 349 | AM_RANGE(0x0180, 0x0180) AM_MIRROR(0x001f) AM_WRITE(MWA8_RAM) AM_BASE(&firetrk_car_rot) | |
| 350 | AM_RANGE(0x01a0, 0x01a0) AM_MIRROR(0x001f) AM_WRITE(steer_reset_w) | |
| 351 | AM_RANGE(0x01c0, 0x01c0) AM_MIRROR(0x001f) AM_WRITE(watchdog_reset_w) | |
| 352 | AM_RANGE(0x01e0, 0x01e0) AM_MIRROR(0x001f) AM_WRITE(blink_on_w) AM_BASE(&firetrk_blink) | |
| 353 | AM_RANGE(0x0200, 0x0207) AM_MIRROR(0x0018) AM_READ(firetrk_input_r) | |
| 354 | AM_RANGE(0x0220, 0x0220) AM_MIRROR(0x001f) AM_WRITE(superbug_asr_w) | |
| 355 | AM_RANGE(0x0240, 0x0243) AM_MIRROR(0x001c) AM_READ(firetrk_dip_r) | |
| 356 | AM_RANGE(0x0260, 0x026f) AM_MIRROR(0x0010) AM_WRITE(superbug_output_w) | |
| 357 | AM_RANGE(0x0280, 0x0280) AM_MIRROR(0x001f) AM_WRITE(superbug_motor_snd_w) | |
| 358 | AM_RANGE(0x02a0, 0x02a0) AM_MIRROR(0x001f) AM_WRITE(firetrk_crash_snd_w) | |
| 359 | AM_RANGE(0x02c0, 0x02c0) AM_MIRROR(0x001f) AM_WRITE(firetrk_skid_snd_w) | |
| 526 | 360 | AM_RANGE(0x0400, 0x041f) AM_RAM AM_BASE(&firetrk_alpha_num_ram) |
| 527 | AM_RANGE(0x0500, 0x05ff) AM_R | |
| 361 | AM_RANGE(0x0500, 0x05ff) AM_R | |
| 528 | 362 | AM_RANGE(0x0800, 0x1fff) AM_ROM |
| 529 | 363 | ADDRESS_MAP_END |
| 530 | 364 | |
| 531 | 365 | |
| 532 | 366 | static ADDRESS_MAP_START( montecar_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 533 | 367 | ADDRESS_MAP_FLAGS( AMEF_ABITS(14) ) |
| 534 | AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0x700) AM_RAM AM_BASE(&firetrk_alpha_num_ram) | |
| 535 | AM_RANGE(0x0800, 0x08ff) AM_MIRROR(0x700) AM_READWRITE(MRA8_RAM, firetrk_playfield_w) AM_BASE(&firetrk_playfield_ram) | |
| 536 | AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x1f) AM_WRITE(firetrk_vert_w) | |
| 537 | AM_RANGE(0x1020, 0x1020) AM_MIRROR(0x1f) AM_WRITE(firetrk_horz_w) | |
| 538 | AM_RANGE(0x1040, 0x1040) AM_MIRROR(0x1f) AM_WRITE(firetrk_drone_reset_w) | |
| 539 | AM_RANGE(0x1060, 0x1060) AM_MIRROR(0x1f) AM_WRITE(firetrk_car_reset_w) | |
| 540 | AM_RANGE(0x1080, 0x1080) AM_MIRROR(0x1f) AM_WRITE(firetrk_car_rot_w) | |
| 541 | AM_RANGE(0x10a0, 0x10a0) AM_MIRROR(0x1f) AM_WRITE(firetrk_steer_reset_w) | |
| 542 | AM_RANGE(0x10c0, 0x10c0) AM_MIRROR(0x1f) AM_WRITE(watchdog_reset_w) | |
| 543 | AM_RANGE(0x10e0, 0x10e0) AM_MIRROR(0x1f) AM_WRITE(firetrk_skid_reset_w) | |
| 544 | AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x1f) AM_WRITE(firetrk_motor_snd_w) | |
| 545 | AM_RANGE(0x1420, 0x1420) AM_MIRROR(0x1f) AM_WRITE(firetrk_crash_snd_w) | |
| 546 | AM_RANGE(0x1440, 0x1440) AM_MIRROR(0x1f) AM_WRITE(firetrk_skid_snd_w) | |
| 547 | AM_RANGE(0x1460, 0x1460) AM_MIRROR(0x1f) AM_WRITE(firetrk_drone_hpos_w) | |
| 548 | AM_RANGE(0x1480, 0x1480) AM_MIRROR(0x1f) AM_WRITE(firetrk_drone_vpos_w) | |
| 549 | AM_RANGE(0x14a0, 0x14a0) AM_MIRROR(0x1f) AM_WRITE(firetrk_drone_rot_w) | |
| 550 | AM_RANGE(0x14c0, 0x14c0) AM_MIRROR(0x1f) AM_WRITE(firetrk_out_w) | |
| 551 | AM_RANGE(0x14e0, 0x14e0) AM_MIRROR(0x1f) AM_WRITE(firetrk_out2_w) | |
| 552 | AM_RANGE(0x1800, 0x1807) AM_MIRROR(0x3f8) AM_READWRITE(firetrk_input_r, MWA8_NOP) | |
| 553 | AM_RANGE(0x1c00, 0x1c03) AM_MIRROR(0x3fc) AM_READ(firetrk_dip_r) | |
| 368 | AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0x0700) AM_RAM AM_BASE(&firetrk_alpha_num_ram) | |
| 369 | AM_RANGE(0x0800, 0x08ff) AM_MIRROR(0x0700) AM_RAM AM_BASE(&firetrk_playfield_ram) | |
| 370 | AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x001f) AM_WRITE(MWA8_RAM) AM_BASE(&firetrk_scroll_y) | |
| 371 | AM_RANGE(0x1020, 0x1020) AM_MIRROR(0x001f) AM_WRITE(MWA8_RAM) AM_BASE(&firetrk_scroll_x) | |
| 372 | AM_RANGE(0x1040, 0x1040) AM_MIRROR(0x001f) AM_WRITE(montecar_drone_reset_w) | |
| 373 | AM_RANGE(0x1060, 0x1060) AM_MIRROR(0x001f) AM_WRITE(montecar_car_reset_w) | |
| 374 | AM_RANGE(0x1080, 0x1080) AM_MIRROR(0x001f) AM_WRITE(MWA8_RAM) AM_BASE(&firetrk_car_rot) | |
| 375 | AM_RANGE(0x10a0, 0x10a0) AM_MIRROR(0x001f) AM_WRITE(steer_reset_w) | |
| 376 | AM_RANGE(0x10c0, 0x10c0) AM_MIRROR(0x001f) AM_WRITE(watchdog_reset_w) | |
| 377 | AM_RANGE(0x10e0, 0x10e0) AM_MIRROR(0x001f) AM_WRITE(montecar_skid_reset_w) | |
| 378 | AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x001f) AM_WRITE(firetrk_motor_snd_w) | |
| 379 | AM_RANGE(0x1420, 0x1420) AM_MIRROR(0x001f) AM_WRITE(firetrk_crash_snd_w) | |
| 380 | AM_RANGE(0x1440, 0x1440) AM_MIRROR(0x001f) AM_WRITE(firetrk_skid_snd_w) | |
| 381 | AM_RANGE(0x1460, 0x1460) AM_MIRROR(0x001f) AM_WRITE(MWA8_RAM) AM_BASE(&firetrk_drone_x) | |
| 382 | AM_RANGE(0x1480, 0x1480) AM_MIRROR(0x001f) AM_WRITE(MWA8_RAM) AM_BASE(&firetrk_drone_y) | |
| 383 | AM_RANGE(0x14a0, 0x14a0) AM_MIRROR(0x001f) AM_WRITE(MWA8_RAM) AM_BASE(&firetrk_drone_rot) | |
| 384 | AM_RANGE(0x14c0, 0x14c0) AM_MIRROR(0x001f) AM_WRITE(montecar_output_1_w) | |
| 385 | AM_RANGE(0x14e0, 0x14e0) AM_MIRROR(0x001f) AM_WRITE(montecar_output_2_w) | |
| 386 | AM_RANGE(0x1800, 0x1807) AM_MIRROR(0x03f8) AM_READWRITE(montecar_input_r, MWA8_NOP) | |
| 387 | AM_RANGE(0x1c00, 0x1c03) AM_MIRROR(0x03fc) AM_READ(montecar_dip_r) | |
| 554 | 388 | AM_RANGE(0x2000, 0x3fff) AM_ROM |
| 555 | 389 | ADDRESS_MAP_END |
| 556 | 390 | |
| 557 | 391 | |
| 558 | 392 | static INPUT_PORTS_START( firetrk ) |
| 559 | PORT_START | |
| 393 | PORT_START_TAG("STEER_1") | |
| 560 | 394 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(1) |
| 561 | 395 | |
| 562 | PORT_START | |
| 396 | PORT_START_TAG("STEER_2") | |
| 563 | 397 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(2) |
| 564 | 398 | |
| 565 | PORT_START | |
| 566 | PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_UNUSED) /* other DIPs connect here */ | |
| 567 | PORT_BIT (0x02, IP_ACTIVE_HIGH, IPT_UNUSED) /* other DIPs connect here */ | |
| 399 | PORT_START_TAG("DIP_0") | |
| 400 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* other DIPs connect here */ | |
| 401 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) /* other DIPs connect here */ | |
| 568 | 402 | PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Coinage )) |
| 569 | 403 | PORT_DIPSETTING( 0x0c, DEF_STR( 2C_1C )) |
| 570 | 404 | PORT_DIPSETTING( 0x08, DEF_STR( 1C_1C )) |
| r1877 | r1878 | |
| 577 | 411 | PORT_DIPSETTING( 0x20, DEF_STR( Off )) |
| 578 | 412 | PORT_DIPSETTING( 0x00, DEF_STR( On )) |
| 579 | 413 | |
| 580 | PORT_START | |
| 414 | PORT_START_TAG("DIP_1") | |
| 581 | 415 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Language ) ) |
| 582 | 416 | PORT_DIPSETTING( 0x00, DEF_STR( English ) ) |
| 583 | 417 | PORT_DIPSETTING( 0x01, DEF_STR( French ) ) |
| r1877 | r1878 | |
| 594 | 428 | PORT_DIPSETTING( 0x30, "Conservative" ) |
| 595 | 429 | PORT_DIPSETTING( 0x00, "Never" ) |
| 596 | 430 | |
| 597 | PORT_START /* bit 0 */ | |
| 598 | PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 599 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gas") PORT_PLAYER(1) | |
| 600 | PORT_BIT (0x04, IP_ACTIVE_HIGH, IPT_UNUSED) /* STEER DIR 1 */ | |
| 601 | PORT_BIT (0x08, IP_ACTIVE_HIGH, IPT_UNUSED) /* STEER DIR 2 */ | |
| 602 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Bell") PORT_PLAYER(2) | |
| 603 | PORT_BIT (0x20, IP_ACTIVE_HIGH, IPT_TILT) | |
| 604 | PORT_BIT (0x40, IP_ACTIVE_HIGH, IPT_UNUSED) /* SKID */ | |
| 605 | PORT_SERVICE(0x80, IP_ACTIVE_HIGH) | |
| 431 | PORT_START_TAG("BIT_0") | |
| 432 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 433 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gas") PORT_PLAYER(1) | |
| 434 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(steer_dir_r, (void *)0) | |
| 435 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(steer_dir_r, (void *)1) | |
| 436 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Bell") PORT_PLAYER(2) | |
| 437 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_TILT ) | |
| 438 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(skid_r, (void *)2) | |
| 439 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Service_Mode ) ) PORT_CODE(KEYCODE_F2) PORT_TOGGLE PORT_CHANGED(service_mode_switch_changed, 0) | |
| 440 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 441 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) | |
| 606 | 442 | |
| 607 | PORT_START /* bit 6 */ | |
| 608 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Front Player Start") | |
| 609 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("Back Player Start") | |
| 610 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START3 ) PORT_NAME("Both Players Start") | |
| 611 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Track Select") PORT_CODE(KEYCODE_SPACE) PORT_PLAYER(1) | |
| 612 | PORT_BIT (0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 613 | PORT_BIT (0x20, IP_ACTIVE_LOW, IPT_VBLANK) | |
| 443 | PORT_START_TAG("BIT_6") | |
| 444 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Front Player Start") | |
| 445 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("Back Player Start") | |
| 446 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START3 ) PORT_NAME("Both Players Start") | |
| 447 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Track Select") PORT_CODE(KEYCODE_SPACE) PORT_PLAYER(1) | |
| 448 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 449 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_VBLANK ) | |
| 614 | 450 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet )) |
| 615 | 451 | PORT_DIPSETTING( 0x00, "Smokey Joe (1 Player)" ) |
| 616 | 452 | PORT_DIPSETTING( 0x40, "Fire Truck (2 Players)" ) |
| 617 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Diag Hold") PORT_CODE(KEYCODE_F6) | |
| 453 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Diag Hold") PORT_CODE(KEYCODE_F6) | |
| 618 | 454 | |
| 619 | PORT_START /* bit 7 */ | |
| 620 | PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 621 | PORT_BIT (0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 622 | PORT_BIT (0x04, IP_ACTIVE_HIGH, IPT_UNUSED) /* STEER FLAG 1 */ | |
| 623 | PORT_BIT (0x08, IP_ACTIVE_HIGH, IPT_UNUSED) /* STEER FLAG 2 */ | |
| 624 | PORT_BIT (0x10, IP_ACTIVE_HIGH, IPT_COIN1) | |
| 625 | PORT_BIT (0x20, IP_ACTIVE_HIGH, IPT_COIN2) | |
| 626 | PORT_BIT (0x40, IP_ACTIVE_HIGH, IPT_UNUSED) /* CRASH */ | |
| 627 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Diag Step") PORT_CODE(KEYCODE_F1) | |
| 455 | PORT_START_TAG("BIT_7") | |
| 456 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 457 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 458 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(steer_flag_r, (void *)0) | |
| 459 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(steer_flag_r, (void *)1) | |
| 460 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 461 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 462 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(crash_r, (void *)2) | |
| 463 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Diag Step") PORT_CODE(KEYCODE_F1) | |
| 628 | 464 | |
| 629 | PORT_START | |
| 630 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Horn") PORT_PLAYER(1) | |
| 465 | PORT_START_TAG("HORN") | |
| 466 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Horn") PORT_PLAYER(1) PORT_CHANGED(firetrk_horn_changed, 0) | |
| 631 | 467 | |
| 632 | 468 | PORT_START_TAG("R27") |
| 633 | 469 | PORT_ADJUSTER( 20, "R27 - Motor Frequency" ) |
| r1877 | r1878 | |
| 635 | 471 | |
| 636 | 472 | |
| 637 | 473 | static INPUT_PORTS_START( superbug ) |
| 638 | PORT_START | |
| 474 | PORT_START_TAG("STEER_1") | |
| 639 | 475 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) |
| 640 | 476 | |
| 641 | PORT_START | |
| 642 | PORT_BIT (0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 477 | PORT_START_TAG("DIP_0") | |
| 478 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* other DIPs connect here */ | |
| 479 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) /* other DIPs connect here */ | |
| 643 | 480 | |
| 644 | PORT_START | |
| 645 | PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_UNUSED) /* other DIPs connect here */ | |
| 646 | PORT_BIT (0x02, IP_ACTIVE_HIGH, IPT_UNUSED) /* other DIPs connect here */ | |
| 647 | ||
| 648 | PORT_START | |
| 481 | PORT_START_TAG("DIP_1") | |
| 649 | 482 | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coinage )) |
| 650 | 483 | PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C )) |
| 651 | 484 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_1C )) |
| r1877 | r1878 | |
| 667 | 500 | PORT_DIPSETTING( 0x80, DEF_STR( Spanish ) ) |
| 668 | 501 | PORT_DIPSETTING( 0xc0, DEF_STR( German ) ) |
| 669 | 502 | |
| 670 | PORT_START /* bit 0 */ | |
| 671 | PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_UNUSED) /* GEAR 2 */ | |
| 672 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gas") | |
| 673 | PORT_BIT (0x04, IP_ACTIVE_HIGH, IPT_UNUSED) /* STEER DIR */ | |
| 674 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Hiscore Reset") PORT_CODE(KEYCODE_H) | |
| 675 | PORT_BIT (0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 676 | PORT_SERVICE( 0x20, IP_ACTIVE_HIGH) | |
| 677 | PORT_BIT (0x40, IP_ACTIVE_HIGH, IPT_UNUSED) /* SKID */ | |
| 678 | PORT_BIT (0x80, IP_ACTIVE_HIGH, IPT_TILT) | |
| 503 | PORT_START_TAG("BIT_0") | |
| 504 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(gear_r, (void *)1) | |
| 505 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gas") | |
| 506 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(steer_dir_r, (void *)0) | |
| 507 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Hiscore Reset") PORT_CODE(KEYCODE_H) | |
| 508 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 509 | PORT_SERVICE( 0x20, IP_ACTIVE_HIGH ) | |
| 510 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(skid_r, (void *)0) | |
| 511 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_TILT ) | |
| 679 | 512 | |
| 680 | PORT_START /* bit 6 */ | |
| 681 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 513 | PORT_START_TAG("BIT_7") | |
| 514 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(gear_r, (void *)2) | |
| 515 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(gear_r, (void *)0) | |
| 516 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(steer_flag_r, (void *)0) | |
| 517 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 518 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 519 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 520 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(crash_r, (void *)0) | |
| 521 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Track Select") PORT_CODE(KEYCODE_SPACE) | |
| 682 | 522 | |
| 683 | PORT_START /* bit 7 */ | |
| 684 | PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_UNUSED) /* GEAR 3 */ | |
| 685 | PORT_BIT (0x02, IP_ACTIVE_HIGH, IPT_UNUSED) /* GEAR 1 */ | |
| 686 | PORT_BIT (0x04, IP_ACTIVE_HIGH, IPT_UNUSED) /* STEER FLAG */ | |
| 687 | PORT_BIT (0x08, IP_ACTIVE_HIGH, IPT_COIN1) | |
| 688 | PORT_BIT (0x10, IP_ACTIVE_HIGH, IPT_COIN2) | |
| 689 | PORT_BIT (0x20, IP_ACTIVE_HIGH, IPT_START1) | |
| 690 | PORT_BIT (0x40, IP_ACTIVE_HIGH, IPT_UNUSED) /* CRASH */ | |
| 691 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Track Select") PORT_CODE(KEYCODE_SPACE) | |
| 523 | PORT_START_TAG("GEAR") | |
| 524 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Gear 1") PORT_CODE(KEYCODE_Z) PORT_CHANGED(gear_changed, (void *)0) | |
| 525 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Gear 2") PORT_CODE(KEYCODE_X) PORT_CHANGED(gear_changed, (void *)1) | |
| 526 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Gear 3") PORT_CODE(KEYCODE_C) PORT_CHANGED(gear_changed, (void *)2) | |
| 527 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Gear 4") PORT_CODE(KEYCODE_V) PORT_CHANGED(gear_changed, (void *)3) | |
| 692 | 528 | |
| 693 | PORT_START | |
| 694 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Gear 1") PORT_CODE(KEYCODE_Z) | |
| 695 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Gear 2") PORT_CODE(KEYCODE_X) | |
| 696 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Gear 3") PORT_CODE(KEYCODE_C) | |
| 697 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Gear 4") PORT_CODE(KEYCODE_V) | |
| 698 | ||
| 699 | 529 | PORT_START_TAG("R62") |
| 700 | 530 | PORT_ADJUSTER( 20, "R62 - Motor Frequency" ) |
| 701 | 531 | INPUT_PORTS_END |
| 702 | 532 | |
| 703 | 533 | |
| 704 | 534 | static INPUT_PORTS_START( montecar ) |
| 705 | PORT_START | |
| 535 | PORT_START_TAG("STEER_1") | |
| 706 | 536 | PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(1) |
| 707 | 537 | |
| 708 | PORT_START | |
| 709 | PORT_BIT (0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 710 | ||
| 711 | PORT_START | |
| 712 | PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_UNUSED) /* other DIPs connect here */ | |
| 713 | PORT_BIT (0x02, IP_ACTIVE_HIGH, IPT_UNUSED) /* other DIPs connect here */ | |
| 538 | PORT_START_TAG("DIP_0") | |
| 539 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* other DIPs connect here */ | |
| 540 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) /* other DIPs connect here */ | |
| 714 | 541 | PORT_DIPNAME( 0x0c, 0x0c, "Coin 3 Multiplier" ) |
| 715 | 542 | PORT_DIPSETTING( 0x0c, "1" ) |
| 716 | 543 | PORT_DIPSETTING( 0x08, "4" ) |
| r1877 | r1878 | |
| 723 | 550 | PORT_DIPSETTING( 0x20, DEF_STR( Off )) |
| 724 | 551 | PORT_DIPSETTING( 0x00, DEF_STR( On )) |
| 725 | 552 | |
| 726 | PORT_START | |
| 553 | PORT_START_TAG("DIP_1") | |
| 727 | 554 | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coinage )) |
| 728 | 555 | PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C )) |
| 729 | 556 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_1C )) |
| r1877 | r1878 | |
| 745 | 572 | PORT_DIPSETTING( 0x40, DEF_STR( French ) ) |
| 746 | 573 | PORT_DIPSETTING( 0x00, DEF_STR( German ) ) |
| 747 | 574 | |
| 748 | PORT_START /* bit 0 */ | |
| 749 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 575 | PORT_START_TAG("BIT_6") | |
| 576 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(gear_r, (void *)0) | |
| 577 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(gear_r, (void *)1) | |
| 578 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(gear_r, (void *)2) | |
| 579 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Track Select") PORT_CODE(KEYCODE_SPACE) | |
| 580 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gas") | |
| 581 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK ) | |
| 582 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(steer_dir_r, (void *)0) | |
| 583 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(skid_r, (void *)1) | |
| 750 | 584 | |
| 751 | PORT_START /* bit 6 */ | |
| 752 | PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_UNUSED) /* GEAR 1 */ | |
| 753 | PORT_BIT (0x02, IP_ACTIVE_HIGH, IPT_UNUSED) /* GEAR 2 */ | |
| 754 | PORT_BIT (0x04, IP_ACTIVE_HIGH, IPT_UNUSED) /* GEAR 3 */ | |
| 755 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Track Select") PORT_CODE(KEYCODE_SPACE) | |
| 756 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gas") | |
| 757 | PORT_BIT (0x20, IP_ACTIVE_HIGH, IPT_VBLANK) | |
| 758 | PORT_BIT (0x40, IP_ACTIVE_HIGH, IPT_UNUSED) /* STEER DIR */ | |
| 759 | PORT_BIT (0x80, IP_ACTIVE_HIGH, IPT_UNUSED) /* SKID 1 */ | |
| 585 | PORT_START_TAG("BIT_7") | |
| 586 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) | |
| 587 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT ) | |
| 588 | PORT_SERVICE( 0x04, IP_ACTIVE_HIGH ) PORT_CHANGED(service_mode_switch_changed, 0) | |
| 589 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 590 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 591 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 592 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(steer_flag_r, (void *)0) | |
| 593 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(skid_r, (void *)0) | |
| 760 | 594 | |
| 761 | PORT_START /* bit 7 */ | |
| 762 | PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_START1) | |
| 763 | PORT_BIT (0x02, IP_ACTIVE_HIGH, IPT_TILT) | |
| 764 | PORT_SERVICE(0x04, IP_ACTIVE_HIGH) | |
| 765 | PORT_BIT (0x08, IP_ACTIVE_HIGH, IPT_COIN1) | |
| 766 | PORT_BIT (0x10, IP_ACTIVE_HIGH, IPT_COIN2) | |
| 767 | PORT_BIT (0x20, IP_ACTIVE_HIGH, IPT_COIN3) | |
| 768 | PORT_BIT (0x40, IP_ACTIVE_HIGH, IPT_UNUSED) /* STEER FLAG */ | |
| 769 | PORT_BIT (0x80, IP_ACTIVE_HIGH, IPT_UNUSED) /* SKID 0 */ | |
| 595 | PORT_START_TAG("GEAR") | |
| 596 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Gear 1") PORT_CODE(KEYCODE_Z) PORT_CHANGED(gear_changed, (void *)0) | |
| 597 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Gear 2") PORT_CODE(KEYCODE_X) PORT_CHANGED(gear_changed, (void *)1) | |
| 598 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Gear 3") PORT_CODE(KEYCODE_C) PORT_CHANGED(gear_changed, (void *)2) | |
| 599 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Gear 4") PORT_CODE(KEYCODE_V) PORT_CHANGED(gear_changed, (void *)3) | |
| 770 | 600 | |
| 771 | PORT_START | |
| 772 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Gear 1") PORT_CODE(KEYCODE_Z) | |
| 773 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Gear 2") PORT_CODE(KEYCODE_X) | |
| 774 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Gear 3") PORT_CODE(KEYCODE_C) | |
| 775 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Gear 4") PORT_CODE(KEYCODE_V) | |
| 776 | ||
| 777 | 601 | PORT_START_TAG("R89") |
| 778 | 602 | PORT_ADJUSTER( 20, "R89 - Motor Frequency" ) |
| 779 | 603 | |
| r1877 | r1878 | |
| 789 | 613 | 1, /* planes */ |
| 790 | 614 | { 0 }, /* plane offsets */ |
| 791 | 615 | { |
| 792 | 0x1C, 0x1D, 0x1E, 0x1F, 0x04, 0x05, 0x06, 0x07, | |
| 793 | 0x0C, 0x0D, 0x0E, 0x0F, 0x14, 0x15, 0x16, 0x17 | |
| 616 | 0x1c, 0x1d, 0x1e, 0x1f, 0x04, 0x05, 0x06, 0x07, | |
| 617 | 0x0c, 0x0d, 0x0e, 0x0f, 0x14, 0x15, 0x16, 0x17 | |
| 794 | 618 | }, |
| 795 | 619 | { |
| 796 | 0x000, 0x020, 0x040, 0x060, 0x080, 0x0A0, 0x0C0, 0x0E0, | |
| 797 | 0x100, 0x120, 0x140, 0x160, 0x180, 0x1A0, 0x1C0, 0x1E0 | |
| 620 | 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0, | |
| 621 | 0x100, 0x120, 0x140, 0x160, 0x180, 0x1a0, 0x1c0, 0x1e0 | |
| 798 | 622 | }, |
| 799 | 623 | 0x200 |
| 800 | 624 | }; |
| r1877 | r1878 | |
| 807 | 631 | 1, /* planes */ |
| 808 | 632 | { 0 }, /* plane offsets */ |
| 809 | 633 | { |
| 810 | 0x0C, 0x0D, 0x0E, 0x0F, 0x14, 0x15, 0x16, 0x17, | |
| 811 | 0x1C, 0x1D, 0x1E, 0x1F, 0x04, 0x05, 0x06, 0x07 | |
| 634 | 0x0c, 0x0d, 0x0e, 0x0f, 0x14, 0x15, 0x16, 0x17, | |
| 635 | 0x1c, 0x1d, 0x1e, 0x1f, 0x04, 0x05, 0x06, 0x07 | |
| 812 | 636 | }, |
| 813 | 637 | { |
| 814 | 0x000, 0x020, 0x040, 0x060, 0x080, 0x0A0, 0x0C0, 0x0E0, | |
| 815 | 0x100, 0x120, 0x140, 0x160, 0x180, 0x1A0, 0x1C0, 0x1E0 | |
| 638 | 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0, | |
| 639 | 0x100, 0x120, 0x140, 0x160, 0x180, 0x1a0, 0x1c0, 0x1e0 | |
| 816 | 640 | }, |
| 817 | 641 | 0x200 |
| 818 | 642 | }; |
| r1877 | r1878 | |
| 825 | 649 | 1, /* planes */ |
| 826 | 650 | { 0 }, /* plane offsets */ |
| 827 | 651 | { |
| 828 | 0x | |
| 652 | 0xc, 0xd, 0xe, 0xf, 0x4, 0x5, 0x6, 0x7 | |
| 829 | 653 | }, |
| 830 | 654 | { |
| 831 | 655 | 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70 |
| r1877 | r1878 | |
| 842 | 666 | { 0 }, /* plane offsets */ |
| 843 | 667 | { |
| 844 | 668 | 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, |
| 845 | 0x8, 0x9, 0x | |
| 669 | 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf | |
| 846 | 670 | }, |
| 847 | 671 | { |
| 848 | 672 | 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, |
| 849 | 0x80, 0x90, 0x | |
| 673 | 0x80, 0x90, 0xa0, 0xb0, 0xc0, 0xd0, 0xe0, 0xf | |
| 850 | 674 | }, |
| 851 | 675 | 0x100 |
| 852 | 676 | }; |
| r1877 | r1878 | |
| 859 | 683 | 1, /* planes */ |
| 860 | 684 | { 0 }, /* plane offsets */ |
| 861 | 685 | { |
| 862 | 0x07, 0x06, 0x05, 0x04, 0x0F, 0x0E, 0x0D, 0x0C, | |
| 863 | 0x17, 0x16, 0x15, 0x14, 0x1F, 0x1E, 0x1D, 0x1C | |
| 686 | 0x07, 0x06, 0x05, 0x04, 0x0f, 0x0e, 0x0d, 0x0c, | |
| 687 | 0x17, 0x16, 0x15, 0x14, 0x1f, 0x1e, 0x1d, 0x1c | |
| 864 | 688 | }, |
| 865 | 689 | { |
| 866 | 0x000, 0x020, 0x040, 0x060, 0x080, 0x0A0, 0x0C0, 0x0E0, | |
| 867 | 0x100, 0x120, 0x140, 0x160, 0x180, 0x1A0, 0x1C0, 0x1E0 | |
| 690 | 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0, | |
| 691 | 0x100, 0x120, 0x140, 0x160, 0x180, 0x1a0, 0x1c0, 0x1e0 | |
| 868 | 692 | }, |
| 869 | 693 | 0x200 |
| 870 | 694 | }; |
| r1877 | r1878 | |
| 877 | 701 | 1, /* planes */ |
| 878 | 702 | { 0 }, /* plane offsets */ |
| 879 | 703 | { |
| 880 | 0x000, 0x040, 0x080, 0x0C0, 0x100, 0x140, 0x180, 0x1C0, | |
| 881 | 0x200, 0x240, 0x280, 0x2C0, 0x300, 0x340, 0x380, 0x3C0, | |
| 882 | 0x400, 0x440, 0x480, 0x4C0, 0x500, 0x540, 0x580, 0x5C0, | |
| 883 | 0x600, 0x640, 0x680, 0x6C0, 0x700, 0x740, 0x780, 0x7C0 | |
| 704 | 0x000, 0x040, 0x080, 0x0c0, 0x100, 0x140, 0x180, 0x1c0, | |
| 705 | 0x200, 0x240, 0x280, 0x2c0, 0x300, 0x340, 0x380, 0x3c0, | |
| 706 | 0x400, 0x440, 0x480, 0x4c0, 0x500, 0x540, 0x580, 0x5c0, | |
| 707 | 0x600, 0x640, 0x680, 0x6c0, 0x700, 0x740, 0x780, 0x7c0 | |
| 884 | 708 | }, |
| 885 | 709 | { |
| 886 | 0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F, | |
| 887 | 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F, | |
| 888 | 0x24, 0x25, 0x26, 0x27, 0x2C, 0x2D, 0x2E, 0x2F, | |
| 889 | 0x34, 0x35, 0x36, 0x37, 0x3C, 0x3D, 0x3E, 0x3B | |
| 710 | 0x04, 0x05, 0x06, 0x07, 0x0c, 0x0d, 0x0e, 0x0f, | |
| 711 | 0x14, 0x15, 0x16, 0x17, 0x1c, 0x1d, 0x1e, 0x1f, | |
| 712 | 0x24, 0x25, 0x26, 0x27, 0x2c, 0x2d, 0x2e, 0x2f, | |
| 713 | 0x34, 0x35, 0x36, 0x37, 0x3c, 0x3d, 0x3e, 0x3b | |
| 890 | 714 | }, |
| 891 | 715 | 0x800 |
| 892 | 716 | }; |
| r1877 | r1878 | |
| 900 | 724 | { 0 }, /* plane offsets */ |
| 901 | 725 | { |
| 902 | 726 | 0x0000, 0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700, |
| 903 | 0x0800, 0x0900, 0x0 | |
| 727 | 0x0800, 0x0900, 0x0a00, 0x0b00, 0x0c00, 0x0d00, 0x0e00, 0x0f00, | |
| 904 | 728 | 0x1000, 0x1100, 0x1200, 0x1300, 0x1400, 0x1500, 0x1600, 0x1700, |
| 905 | 0x1800, 0x1900, 0x1 | |
| 729 | 0x1800, 0x1900, 0x1a00, 0x1b00, 0x1c00, 0x1d00, 0x1e00, 0x1f00 | |
| 906 | 730 | }, |
| 907 | 731 | { |
| 908 | 0x04, 0x0C, 0x14, 0x1C, 0x24, 0x2C, 0x34, 0x3C, | |
| 909 | 0x44, 0x4C, 0x54, 0x5C, 0x64, 0x6C, 0x74, 0x7C, | |
| 910 | 0x84, 0x8C, 0x94, 0x9C, 0xA4, 0xAC, 0xB4, 0xBC, | |
| 911 | 0xC4, 0xCC, 0xD4, 0xDC, 0xE4, 0xEC, 0xF4, 0xFC | |
| 732 | 0x04, 0x0c, 0x14, 0x1c, 0x24, 0x2c, 0x34, 0x3c, | |
| 733 | 0x44, 0x4c, 0x54, 0x5c, 0x64, 0x6c, 0x74, 0x7c, | |
| 734 | 0x84, 0x8c, 0x94, 0x9c, 0xa4, 0xac, 0xb4, 0xbc, | |
| 735 | 0xc4, 0xcc, 0xd4, 0xdc, 0xe4, 0xec, 0xf4, 0xfc | |
| 912 | 736 | }, |
| 913 | 737 | 0x001 |
| 914 | 738 | }; |
| r1877 | r1878 | |
| 922 | 746 | /* plane offsets */ |
| 923 | 747 | { 1, 0 }, |
| 924 | 748 | { |
| 925 | 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, | |
| 926 | 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E, | |
| 927 | 0x20, 0x22, 0x24, 0x26, 0x28, 0x2A, 0x2C, 0x2E, | |
| 928 | 0x30, 0x32, 0x34, 0x36, 0x38, 0x3A, 0x3C, 0x3E | |
| 749 | 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, | |
| 750 | 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e, | |
| 751 | 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, | |
| 752 | 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e | |
| 929 | 753 | }, |
| 930 | 754 | { |
| 931 | 0x000, 0x040, 0x080, 0x0C0, 0x100, 0x140, 0x180, 0x1C0, | |
| 932 | 0x200, 0x240, 0x280, 0x2C0, 0x300, 0x340, 0x380, 0x3C0, | |
| 933 | 0x400, 0x440, 0x480, 0x4C0, 0x500, 0x540, 0x580, 0x5C0, | |
| 934 | 0x600, 0x640, 0x680, 0x6C0, 0x700, 0x740, 0x780, 0x7C0 | |
| 755 | 0x000, 0x040, 0x080, 0x0c0, 0x100, 0x140, 0x180, 0x1c0, | |
| 756 | 0x200, 0x240, 0x280, 0x2c0, 0x300, 0x340, 0x380, 0x3c0, | |
| 757 | 0x400, 0x440, 0x480, 0x4c0, 0x500, 0x540, 0x580, 0x5c0, | |
| 758 | 0x600, 0x640, 0x680, 0x6c0, 0x700, 0x740, 0x780, 0x7c0 | |
| 935 | 759 | }, |
| 936 | 760 | 0x800 |
| 937 | 761 | }; |
| r1877 | r1878 | |
| 944 | 768 | 1, /* planes */ |
| 945 | 769 | { 0 }, /* plane offsets */ |
| 946 | 770 | { |
| 947 | 0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F, | |
| 948 | 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F, | |
| 949 | 0x24, 0x25, 0x26, 0x27, 0x2C, 0x2D, 0x2E, 0x2F, | |
| 950 | 0x34, 0x35, 0x36, 0x37, 0x3C, 0x3D, 0x3E, 0x3B | |
| 771 | 0x04, 0x05, 0x06, 0x07, 0x0c, 0x0d, 0x0e, 0x0f, | |
| 772 | 0x14, 0x15, 0x16, 0x17, 0x1c, 0x1d, 0x1e, 0x1f, | |
| 773 | 0x24, 0x25, 0x26, 0x27, 0x2c, 0x2d, 0x2e, 0x2f, | |
| 774 | 0x34, 0x35, 0x36, 0x37, 0x3c, 0x3d, 0x3e, 0x3b | |
| 951 | 775 | }, |
| 952 | 776 | { |
| 953 | 0x000, 0x040, 0x080, 0x0C0, 0x100, 0x140, 0x180, 0x1C0, | |
| 954 | 0x200, 0x240, 0x280, 0x2C0, 0x300, 0x340, 0x380, 0x3C0, | |
| 955 | 0x400, 0x440, 0x480, 0x4C0, 0x500, 0x540, 0x580, 0x5C0, | |
| 956 | 0x600, 0x640, 0x680, 0x6C0, 0x700, 0x740, 0x780, 0x7C0 | |
| 777 | 0x000, 0x040, 0x080, 0x0c0, 0x100, 0x140, 0x180, 0x1c0, | |
| 778 | 0x200, 0x240, 0x280, 0x2c0, 0x300, 0x340, 0x380, 0x3c0, | |
| 779 | 0x400, 0x440, 0x480, 0x4c0, 0x500, 0x540, 0x580, 0x5c0, | |
| 780 | 0x600, 0x640, 0x680, 0x6c0, 0x700, 0x740, 0x780, 0x7c0 | |
| 957 | 781 | }, |
| 958 | 782 | 0x800 |
| 959 | 783 | }; |
| r1877 | r1878 | |
| 966 | 790 | 1, /* planes */ |
| 967 | 791 | { 0 }, /* plane offsets */ |
| 968 | 792 | { |
| 969 | 0x04, 0x0C, 0x14, 0x1C, 0x24, 0x2C, 0x34, 0x3C, | |
| 970 | 0x44, 0x4C, 0x54, 0x5C, 0x64, 0x6C, 0x74, 0x7C, | |
| 971 | 0x84, 0x8C, 0x94, 0x9C, 0xA4, 0xAC, 0xB4, 0xBC, | |
| 972 | 0xC4, 0xCC, 0xD4, 0xDC, 0xE4, 0xEC, 0xF4, 0xFC | |
| 793 | 0x04, 0x0c, 0x14, 0x1c, 0x24, 0x2c, 0x34, 0x3c, | |
| 794 | 0x44, 0x4c, 0x54, 0x5c, 0x64, 0x6c, 0x74, 0x7c, | |
| 795 | 0x84, 0x8c, 0x94, 0x9c, 0xa4, 0xac, 0xb4, 0xbc, | |
| 796 | 0xc4, 0xcc, 0xd4, 0xdc, 0xe4, 0xec, 0xf4, 0xfc | |
| 973 | 797 | }, |
| 974 | 798 | { |
| 975 | 799 | 0x0000, 0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700, |
| 976 | 0x0800, 0x0900, 0x0 | |
| 800 | 0x0800, 0x0900, 0x0a00, 0x0b00, 0x0c00, 0x0d00, 0x0e00, 0x0f00, | |
| 977 | 801 | 0x1000, 0x1100, 0x1200, 0x1300, 0x1400, 0x1500, 0x1600, 0x1700, |
| 978 | 0x1800, 0x1900, 0x1 | |
| 802 | 0x1800, 0x1900, 0x1a00, 0x1b00, 0x1c00, 0x1d00, 0x1e00, 0x1f00 | |
| 979 | 803 | }, |
| 980 | 804 | 0x001 |
| 981 | 805 | }; |
| r1877 | r1878 | |
| 983 | 807 | static const UINT32 firetrk_trailer_layout_xoffset[64] = |
| 984 | 808 | { |
| 985 | 809 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, |
| 986 | 0x08, 0x09, 0x0 | |
| 810 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, | |
| 987 | 811 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, |
| 988 | 0x18, 0x19, 0x1 | |
| 812 | 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, | |
| 989 | 813 | 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, |
| 990 | 0x28, 0x29, 0x2 | |
| 814 | 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, | |
| 991 | 815 | 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, |
| 992 | 0x38, 0x39, 0x3 | |
| 816 | 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f | |
| 993 | 817 | }; |
| 994 | 818 | |
| 995 | 819 | static const UINT32 firetrk_trailer_layout_yoffset[64] = |
| 996 | 820 | { |
| 997 | 0x000, 0x040, 0x080, 0x0C0, 0x100, 0x140, 0x180, 0x1C0, | |
| 998 | 0x200, 0x240, 0x280, 0x2C0, 0x300, 0x340, 0x380, 0x3C0, | |
| 999 | 0x400, 0x440, 0x480, 0x4C0, 0x500, 0x540, 0x580, 0x5C0, | |
| 1000 | 0x600, 0x640, 0x680, 0x6C0, 0x700, 0x740, 0x780, 0x7C0, | |
| 1001 | 0x800, 0x840, 0x880, 0x8C0, 0x900, 0x940, 0x980, 0x9C0, | |
| 1002 | 0xA00, 0xA40, 0xA80, 0xAC0, 0xB00, 0xB40, 0xB80, 0xBC0, | |
| 1003 | 0xC00, 0xC40, 0xC80, 0xCC0, 0xD00, 0xD40, 0xD80, 0xDC0, | |
| 1004 | 0xE00, 0xE40, 0xE80, 0xEC0, 0xF00, 0xF40, 0xF80, 0xFC0 | |
| 821 | 0x000, 0x040, 0x080, 0x0c0, 0x100, 0x140, 0x180, 0x1c0, | |
| 822 | 0x200, 0x240, 0x280, 0x2c0, 0x300, 0x340, 0x380, 0x3c0, | |
| 823 | 0x400, 0x440, 0x480, 0x4c0, 0x500, 0x540, 0x580, 0x5c0, | |
| 824 | 0x600, 0x640, 0x680, 0x6c0, 0x700, 0x740, 0x780, 0x7c0, | |
| 825 | 0x800, 0x840, 0x880, 0x8c0, 0x900, 0x940, 0x980, 0x9c0, | |
| 826 | 0xa00, 0xa40, 0xa80, 0xac0, 0xb00, 0xb40, 0xb80, 0xbc0, | |
| 827 | 0xc00, 0xc40, 0xc80, 0xcc0, 0xd00, 0xd40, 0xd80, 0xdc0, | |
| 828 | 0xe00, 0xe40, 0xe80, 0xec0, 0xf00, 0xf40, 0xf80, 0xfc0 | |
| 1005 | 829 | }; |
| 1006 | 830 | |
| 1007 | 831 | static const gfx_layout firetrk_trailer_layout = |
| r1877 | r1878 | |
| 1051 | 875 | /* basic machine hardware */ |
| 1052 | 876 | MDRV_CPU_ADD_TAG("main", M6800, FIRETRK_CPU_CLOCK_1MHZ) /* 750Khz during service mode */ |
| 1053 | 877 | MDRV_CPU_PROGRAM_MAP(firetrk_map, 0) |
| 1054 | MDRV_CPU_VBLANK_INT(firetrk_interrupt | |
| 878 | MDRV_CPU_VBLANK_INT("main", firetrk_interrupt | |
| 1055 | 879 | MDRV_WATCHDOG_VBLANK_INIT(5) |
| 1056 | 880 | |
| 1057 | 881 | MDRV_MACHINE_RESET(firetrk) |
| 1058 | 882 | |
| 1059 | 883 | /* video hardware */ |
| 884 | MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) | |
| 885 | ||
| 1060 | 886 | MDRV_SCREEN_ADD("main", RASTER) |
| 1061 | 887 | MDRV_SCREEN_REFRESH_RATE(60) |
| 1062 | 888 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 1063 | 889 | MDRV_SCREEN_SIZE(320, 262) |
| 1064 | 890 | MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239) |
| 1065 | 891 | |
| 1066 | MDRV_GFXDECODE(firetrk) | |
| 1067 | ||
| 892 | MDRV_VIDEO_START(firetrk) | |
| 893 | MDRV_VIDEO_UPDATE(firetrk) | |
| 1068 | 894 | MDRV_PALETTE_INIT(firetrk) |
| 1069 | 895 | MDRV_PALETTE_LENGTH(28) |
| 896 | MDRV_GFXDECODE(firetrk) | |
| 1070 | 897 | |
| 1071 | MDRV_VIDEO_START(firetrk) | |
| 1072 | MDRV_VIDEO_EOF(firetrk) | |
| 1073 | MDRV_VIDEO_UPDATE(firetrk) | |
| 1074 | ||
| 1075 | 898 | /* sound hardware */ |
| 1076 | 899 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1077 | 900 | |
| r1877 | r1878 | |
| 1089 | 912 | MDRV_CPU_PROGRAM_MAP(superbug_map, 0) |
| 1090 | 913 | |
| 1091 | 914 | /* video hardware */ |
| 915 | MDRV_VIDEO_START(superbug) | |
| 916 | MDRV_VIDEO_UPDATE(superbug) | |
| 1092 | 917 | MDRV_GFXDECODE(superbug) |
| 1093 | ||
| 1094 | MDRV_PALETTE_INIT(firetrk) | |
| 1095 | 918 | MDRV_PALETTE_LENGTH(28) |
| 1096 | 919 | |
| 1097 | 920 | /* sound hardware */ |
| r1877 | r1878 | |
| 1109 | 932 | MDRV_CPU_PROGRAM_MAP(montecar_map, 0) |
| 1110 | 933 | |
| 1111 | 934 | /* video hardware */ |
| 935 | MDRV_VIDEO_START(montecar) | |
| 936 | MDRV_VIDEO_UPDATE(montecar) | |
| 1112 | 937 | MDRV_GFXDECODE(montecar) |
| 1113 | 938 | |
| 1114 | 939 | MDRV_PALETTE_INIT(montecar) |
| r1877 | r1878 | |
| 1197 | 1022 | ROM_END |
| 1198 | 1023 | |
| 1199 | 1024 | |
| 1200 | GAME( 1977, superbug, 0, superbug, superbug, superbug, ROT270, "Atari", "Super Bug", 0 ) | |
| 1201 | GAME( 1978, firetrk, 0, firetrk, firetrk, firetrk, ROT270, "Atari", "Fire Truck", 0 ) | |
| 1202 | GAME( 1979, montecar, 0, montecar, montecar, montecar, ROT270, "Atari", "Monte Carlo", 0 ) | |
| 1025 | GAME( 1977, superbug, 0, superbug, superbug, 0, ROT270, "Atari", "Super Bug", 0 ) | |
| 1026 | GAME( 1978, firetrk, 0, firetrk, firetrk, 0, ROT270, "Atari", "Fire Truck", 0 ) | |
| 1027 | GAME( 1979, montecar, 0, montecar, montecar, 0, ROT270, "Atari", "Monte Carlo", 0 ) |
| r1877 | r1878 | |
|---|---|---|
| 224 | 224 | /* basic machine hardware */ |
| 225 | 225 | MDRV_CPU_ADD(Z80, XTAL_18_432MHz/6) /* verified on pcb */ |
| 226 | 226 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 227 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 227 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 228 | 228 | |
| 229 | 229 | /* video hardware */ |
| 230 | 230 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 978 | 978 | MDRV_CPU_PROGRAM_MAP(peplus_map, 0) |
| 979 | 979 | MDRV_CPU_DATA_MAP(peplus_datamap, 0) |
| 980 | 980 | MDRV_CPU_IO_MAP(peplus_iomap, 0) |
| 981 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 981 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 982 | 982 | |
| 983 | 983 | MDRV_MACHINE_RESET(peplus) |
| 984 | 984 | MDRV_NVRAM_HANDLER(peplus) |
| r1877 | r1878 | |
|---|---|---|
| 506 | 506 | |
| 507 | 507 | // I/O Mappers |
| 508 | 508 | |
| 509 | static UINT8 hotrod_io_r(int port) | |
| 509 | static UINT8 hotrod_io_r(running_machine *machine, int port) | |
| 510 | 510 | { |
| 511 | 511 | switch(port) { |
| 512 | 512 | case 0: |
| r1877 | r1878 | |
| 529 | 529 | return 0x00; |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | static UINT8 dcclub_io_r(int port) | |
| 532 | static UINT8 dcclub_io_r(running_machine *machine, int port) | |
| 533 | 533 | { |
| 534 | 534 | switch(port) { |
| 535 | 535 | case 0: { |
| r1877 | r1878 | |
| 556 | 556 | |
| 557 | 557 | static int cur_input_line; |
| 558 | 558 | |
| 559 | static UINT8 mahmajn_io_r(int port) | |
| 559 | static UINT8 mahmajn_io_r(running_machine *machine, int port) | |
| 560 | 560 | { |
| 561 | 561 | switch(port) { |
| 562 | 562 | case 0: |
| r1877 | r1878 | |
| 579 | 579 | return 0x00; |
| 580 | 580 | } |
| 581 | 581 | |
| 582 | static UINT8 gground_io_r(int port) | |
| 582 | static UINT8 gground_io_r(running_machine *machine, int port) | |
| 583 | 583 | { |
| 584 | 584 | switch(port) { |
| 585 | 585 | case 0: |
| r1877 | r1878 | |
| 602 | 602 | return 0x00; |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | static void mahmajn_io_w(int port, UINT8 data) | |
| 605 | static void mahmajn_io_w(running_machine *machine, int port, UINT8 data) | |
| 606 | 606 | { |
| 607 | 607 | switch(port) { |
| 608 | 608 | case 3: |
| r1877 | r1878 | |
| 610 | 610 | cur_input_line = (cur_input_line + 1) & 7; |
| 611 | 611 | break; |
| 612 | 612 | case 7: // DAC |
| 613 | DAC_0_signed_data_w(0, data); | |
| 613 | DAC_0_signed_data_w(machine, 0, data); | |
| 614 | 614 | break; |
| 615 | 615 | default: |
| 616 | 616 | fprintf(stderr, "Port %d : %02x\n", port, data & 0xff); |
| 617 | 617 | } |
| 618 | 618 | } |
| 619 | 619 | |
| 620 | static void hotrod_io_w(int port, UINT8 data) | |
| 620 | static void hotrod_io_w(running_machine *machine, int port, UINT8 data) | |
| 621 | 621 | { |
| 622 | 622 | switch(port) { |
| 623 | 623 | case 3: // Lamps |
| 624 | 624 | break; |
| 625 | 625 | case 7: // DAC |
| 626 | DAC_0_signed_data_w(0, data); | |
| 626 | DAC_0_signed_data_w(machine,0, data); | |
| 627 | 627 | break; |
| 628 | 628 | default: |
| 629 | 629 | fprintf(stderr, "Port %d : %02x\n", port, data & 0xff); |
| r1877 | r1878 | |
| 746 | 746 | |
| 747 | 747 | static READ16_HANDLER( ym_status_r ) |
| 748 | 748 | { |
| 749 | return YM2151_status_port_0_r(0); | |
| 749 | return YM2151_status_port_0_r(machine, 0); | |
| 750 | 750 | } |
| 751 | 751 | |
| 752 | 752 | static WRITE16_HANDLER( ym_register_w ) |
| 753 | 753 | { |
| 754 | 754 | if(ACCESSING_LSB) |
| 755 | YM2151_register_port_0_w(0, data); | |
| 755 | YM2151_register_port_0_w(machine, 0, data); | |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | static WRITE16_HANDLER( ym_data_w ) |
| 759 | 759 | { |
| 760 | 760 | if(ACCESSING_LSB) |
| 761 | YM2151_data_port_0_w(0, data); | |
| 761 | YM2151_data_port_0_w(machine, 0, data); | |
| 762 | 762 | } |
| 763 | 763 | |
| 764 | 764 | |
| r1877 | r1878 | |
| 1908 | 1908 | static MACHINE_DRIVER_START( system24 ) |
| 1909 | 1909 | MDRV_CPU_ADD(M68000, 10000000) |
| 1910 | 1910 | MDRV_CPU_PROGRAM_MAP(system24_cpu1_map, 0) |
| 1911 | MDRV_CPU_VBLANK_INT(irq_vbl, 2) | |
| 1911 | MDRV_CPU_VBLANK_INT_HACK(irq_vbl, 2) | |
| 1912 | 1912 | |
| 1913 | 1913 | MDRV_CPU_ADD(M68000, 10000000) |
| 1914 | 1914 | MDRV_CPU_PROGRAM_MAP(system24_cpu2_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 206 | 206 | /* basic machine hardware */ |
| 207 | 207 | MDRV_CPU_ADD(Z80, CPU_CLOCK) |
| 208 | 208 | MDRV_CPU_PROGRAM_MAP(memmap, 0) |
| 209 | MDRV_CPU_VBLANK_INT(assert_irq | |
| 209 | MDRV_CPU_VBLANK_INT("main", assert_irq | |
| 210 | 210 | |
| 211 | 211 | MDRV_CPU_ADD_TAG(CPUTAG_T5182,Z80, T5182_CLOCK) |
| 212 | 212 | MDRV_CPU_PROGRAM_MAP(t5182_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 89 | 89 | } /* namco_tilemap_init */ |
| 90 | 90 | |
| 91 | 91 | void |
| 92 | namco_tilemap_draw( | |
| 92 | namco_tilemap_draw( | |
| 93 | 93 | { |
| 94 | 94 | int i; |
| 95 | 95 | for( i=0; i<6; i++ ) |
| r1877 | r1878 | |
| 266 | 266 | /**************************************************************************************/ |
| 267 | 267 | |
| 268 | 268 | static void zdrawgfxzoom(running_machine *machine, |
| 269 | | |
| 269 | | |
| 270 | 270 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 271 | 271 | const rectangle *clip,int transparency,int transparent_color, |
| 272 | 272 | int scalex, int scaley, int zpos ) |
| r1877 | r1878 | |
| 414 | 414 | } /* zdrawgfxzoom */ |
| 415 | 415 | |
| 416 | 416 | void |
| 417 | namcos2_draw_sprites(running_machine *machine, | |
| 417 | namcos2_draw_sprites(running_machine *machine, | |
| 418 | 418 | { |
| 419 | 419 | int offset = (control & 0x000f) * (128*4); |
| 420 | 420 | int loop; |
| r1877 | r1878 | |
| 498 | 498 | } /* namcos2_draw_sprites */ |
| 499 | 499 | |
| 500 | 500 | void |
| 501 | namcos2_draw_sprites_metalhawk(running_machine *machine, | |
| 501 | namcos2_draw_sprites_metalhawk(running_machine *machine, | |
| 502 | 502 | { |
| 503 | 503 | /** |
| 504 | 504 | * word#0 |
| r1877 | r1878 | |
| 674 | 674 | /* nth_word32 is a general-purpose utility function, which allows us to |
| 675 | 675 | * read from 32-bit aligned memory as if it were an array of 16 bit words. |
| 676 | 676 | */ |
| 677 | #ifdef UNUSED_FUNCTION | |
| 677 | 678 | INLINE UINT16 |
| 678 | 679 | nth_word32( const UINT32 *pSource, int which ) |
| 679 | 680 | { |
| r1877 | r1878 | |
| 687 | 688 | return data>>16; |
| 688 | 689 | } |
| 689 | 690 | } /* nth_word32 */ |
| 691 | #endif | |
| 690 | 692 | |
| 691 | 693 | /* nth_byte32 is a general-purpose utility function, which allows us to |
| 692 | 694 | * read from 32-bit aligned memory as if it were an array of bytes. |
| 693 | 695 | */ |
| 696 | #ifdef UNUSED_FUNCTON | |
| 694 | 697 | INLINE UINT8 |
| 695 | 698 | nth_byte32( const UINT32 *pSource, int which ) |
| 696 | 699 | { |
| r1877 | r1878 | |
| 703 | 706 | default: return data&0xff; |
| 704 | 707 | } |
| 705 | 708 | } /* nth_byte32 */ |
| 709 | #endif | |
| 706 | 710 | |
| 707 | 711 | /**************************************************************************************************************/ |
| 708 | 712 | |
| r1877 | r1878 | |
| 720 | 724 | * 0x14000 sprite list (page1) |
| 721 | 725 | */ |
| 722 | 726 | static void |
| 723 | draw_spriteC355(running_machine *machine, | |
| 727 | draw_spriteC355(running_machine *machine, | |
| 724 | 728 | { |
| 725 | 729 | unsigned screen_height_remaining, screen_width_remaining; |
| 726 | 730 | unsigned source_height_remaining, source_width_remaining; |
| r1877 | r1878 | |
| 927 | 931 | |
| 928 | 932 | static void |
| 929 | 933 | DrawObjectList(running_machine *machine, |
| 930 | | |
| 934 | | |
| 931 | 935 | const rectangle *cliprect, |
| 932 | 936 | int pri, |
| 933 | 937 | const UINT16 *pSpriteList16, |
| r1877 | r1878 | |
| 944 | 948 | } /* DrawObjectList */ |
| 945 | 949 | |
| 946 | 950 | void |
| 947 | namco_obj_draw(running_machine *machine, | |
| 951 | namco_obj_draw(running_machine *machine, | |
| 948 | 952 | { |
| 949 | 953 | // int offs = spriteram16[0x18000/2]; /* end-of-sprite-list */ |
| 950 | 954 | if( pri==0 ) |
| r1877 | r1878 | |
| 1118 | 1122 | namco_roz_init( int gfxbank, int maskregion ) |
| 1119 | 1123 | { |
| 1120 | 1124 | int i; |
| 1121 | static const tile_get_info_c | |
| 1125 | static const tile_get_info_func | |
| 1122 | 1126 | { |
| 1123 | 1127 | roz_get_info0, |
| 1124 | 1128 | roz_get_info1 |
| r1877 | r1878 | |
| 1210 | 1214 | |
| 1211 | 1215 | static void |
| 1212 | 1216 | DrawRozHelper( |
| 1213 | | |
| 1217 | | |
| 1214 | 1218 | tilemap *tmap, |
| 1215 | 1219 | const rectangle *clip, |
| 1216 | 1220 | const struct RozParam *rozInfo ) |
| r1877 | r1878 | |
| 1221 | 1225 | (namcos2_gametype != NAMCOFL_FINAL_LAP_R)) |
| 1222 | 1226 | { |
| 1223 | 1227 | UINT32 size_mask = rozInfo->size-1; |
| 1224 | mame_bitmap *srcbitmap = tilemap_get_pixmap( tmap ); | |
| 1225 | mame_bitmap *flagsbitmap = tilemap_get_flagsmap( tmap ); | |
| 1228 | bitmap_t *srcbitmap = tilemap_get_pixmap( tmap ); | |
| 1229 | bitmap_t *flagsbitmap = tilemap_get_flagsmap( tmap ); | |
| 1226 | 1230 | UINT32 startx = rozInfo->startx + clip->min_x * rozInfo->incxx + clip->min_y * rozInfo->incyx; |
| 1227 | 1231 | UINT32 starty = rozInfo->starty + clip->min_x * rozInfo->incxy + clip->min_y * rozInfo->incyy; |
| 1228 | 1232 | int sx = clip->min_x; |
| r1877 | r1878 | |
| 1268 | 1272 | } /* DrawRozHelper */ |
| 1269 | 1273 | |
| 1270 | 1274 | static void |
| 1271 | DrawRozScanline( | |
| 1275 | DrawRozScanline( | |
| 1272 | 1276 | { |
| 1273 | 1277 | if( line>=cliprect->min_y && line<=cliprect->max_y ) |
| 1274 | 1278 | { |
| r1877 | r1878 | |
| 1298 | 1302 | } /* DrawRozScanline */ |
| 1299 | 1303 | |
| 1300 | 1304 | void |
| 1301 | namco_roz_draw( | |
| 1305 | namco_roz_draw( | |
| 1302 | 1306 | { |
| 1303 | 1307 | int mode = rozcontrol16[0]; /* 0x8000 or 0x1000 */ |
| 1304 | 1308 | int which, special = 1; |
| r1877 | r1878 | |
| 1642 | 1646 | } |
| 1643 | 1647 | |
| 1644 | 1648 | void |
| 1645 | namco_road_draw(running_machine *machine, | |
| 1649 | namco_road_draw(running_machine *machine, | |
| 1646 | 1650 | { |
| 1647 | 1651 | const UINT8 *clut = (void *)memory_region(REGION_USER3); |
| 1648 | | |
| 1652 | | |
| 1649 | 1653 | unsigned yscroll; |
| 1650 | 1654 | int i; |
| 1651 | 1655 |
| r1877 | r1878 | |
|---|---|---|
| 114 | 114 | |
| 115 | 115 | static READ8_HANDLER(prot_r) |
| 116 | 116 | { |
| 117 | return (input_port_1_r(0)&0x1f)|protData[protAdr]; | |
| 117 | return (input_port_1_r(machine,0)&0x1f)|protData[protAdr]; | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | static WRITE8_HANDLER(prot_w) |
| r1877 | r1878 | |
| 171 | 171 | |
| 172 | 172 | static WRITE8_HANDLER( sound_w ) |
| 173 | 173 | { |
| 174 | soundlatch_w(offset,data); | |
| 175 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 174 | soundlatch_w(machine,offset,data); | |
| 175 | cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff); | |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | static WRITE8_HANDLER( i8257_CH0_w ) |
| r1877 | r1878 | |
| 399 | 399 | static MACHINE_DRIVER_START( ddayjlc ) |
| 400 | 400 | MDRV_CPU_ADD(Z80,12000000/3) |
| 401 | 401 | MDRV_CPU_PROGRAM_MAP(main_cpu,0) |
| 402 | MDRV_CPU_VBLANK_INT(ddayjlc_interrupt | |
| 402 | MDRV_CPU_VBLANK_INT("main", ddayjlc_interrupt | |
| 403 | 403 | |
| 404 | 404 | MDRV_CPU_ADD(Z80, 12000000/4) |
| 405 | 405 | /* audio CPU */ |
| 406 | 406 | MDRV_CPU_PROGRAM_MAP(sound_cpu,0) |
| 407 | MDRV_CPU_VBLANK_INT(ddayjlc_snd_interrupt | |
| 407 | MDRV_CPU_VBLANK_INT("main", ddayjlc_snd_interrupt | |
| 408 | 408 | |
| 409 | 409 | MDRV_INTERLEAVE(100) |
| 410 | 410 |
| r1877 | r1878 | |
|---|---|---|
| 163 | 163 | static UINT8 video_control; |
| 164 | 164 | static UINT8 mj_input_num; |
| 165 | 165 | |
| 166 | static read16_handler custom_io_r; | |
| 167 | static write16_handler custom_io_w; | |
| 166 | static read16_machine_func custom_io_r; | |
| 167 | static write16_machine_func custom_io_w; | |
| 168 | 168 | static void (*lamp_changed_w)(UINT8 changed, UINT8 newval); |
| 169 | static void (*i8751_vblank_hook)( | |
| 169 | static void (*i8751_vblank_hook)(running_machine *machine); | |
| 170 | 170 | |
| 171 | 171 | static UINT8 n7751_command; |
| 172 | 172 | static UINT32 n7751_rom_address; |
| r1877 | r1878 | |
| 266 | 266 | |
| 267 | 267 | static TIMER_CALLBACK( delayed_ppi8255_w ) |
| 268 | 268 | { |
| 269 | ppi8255_0_w(param >> 8, param & 0xff); | |
| 269 | ppi8255_0_w(machine, param >> 8, param & 0xff); | |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | |
| r1877 | r1878 | |
| 276 | 276 | switch (offset & (0x3000/2)) |
| 277 | 277 | { |
| 278 | 278 | case 0x0000/2: |
| 279 | return ppi8255_0_r(offset & 3); | |
| 279 | return ppi8255_0_r(machine, offset & 3); | |
| 280 | 280 | |
| 281 | 281 | case 0x1000/2: |
| 282 | 282 | return readinputport(offset & 3); |
| r1877 | r1878 | |
| 308 | 308 | static READ16_HANDLER( misc_io_r ) |
| 309 | 309 | { |
| 310 | 310 | if (custom_io_r) |
| 311 | return (*custom_io_r)(offset, mem_mask); | |
| 311 | return (*custom_io_r)(machine, offset, mem_mask); | |
| 312 | 312 | else |
| 313 | return standard_io_r(offset, mem_mask); | |
| 313 | return standard_io_r(machine, offset, mem_mask); | |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | |
| 317 | 317 | static WRITE16_HANDLER( misc_io_w ) |
| 318 | 318 | { |
| 319 | 319 | if (custom_io_w) |
| 320 | (*custom_io_w)(offset, data, mem_mask); | |
| 320 | (*custom_io_w)(machine, offset, data, mem_mask); | |
| 321 | 321 | else |
| 322 | standard_io_w(offset, data, mem_mask); | |
| 322 | standard_io_w(machine, offset, data, mem_mask); | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | |
| r1877 | r1878 | |
| 397 | 397 | { |
| 398 | 398 | /* assert ACK */ |
| 399 | 399 | ppi8255_set_portC(0, 0x00); |
| 400 | return soundlatch_r(offset); | |
| 400 | return soundlatch_r(machine, offset); | |
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | |
| r1877 | r1878 | |
| 491 | 491 | { |
| 492 | 492 | /* if we have a fake 8751 handler, call it on VBLANK */ |
| 493 | 493 | if (i8751_vblank_hook != NULL) |
| 494 | (*i8751_vblank_hook)(); | |
| 494 | (*i8751_vblank_hook)(machine); | |
| 495 | 495 | } |
| 496 | 496 | |
| 497 | 497 | |
| r1877 | r1878 | |
| 502 | 502 | * |
| 503 | 503 | *************************************/ |
| 504 | 504 | |
| 505 | static void bodyslam_i8751_sim( | |
| 505 | static void bodyslam_i8751_sim(running_machine *machine) | |
| 506 | 506 | { |
| 507 | 507 | UINT8 flag = workram[0x200/2] >> 8; |
| 508 | 508 | UINT8 tick = workram[0x200/2] & 0xff; |
| r1877 | r1878 | |
| 510 | 510 | UINT8 min = workram[0x202/2] & 0xff; |
| 511 | 511 | |
| 512 | 512 | /* signal a VBLANK to the main CPU */ |
| 513 | cpunum_set_input_line( | |
| 513 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 514 | 514 | |
| 515 | 515 | /* out of time? set the flag */ |
| 516 | 516 | if (tick == 0 && sec == 0 && min == 0) |
| r1877 | r1878 | |
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | |
| 550 | static void quartet_i8751_sim( | |
| 550 | static void quartet_i8751_sim(running_machine *machine) | |
| 551 | 551 | { |
| 552 | 552 | /* signal a VBLANK to the main CPU */ |
| 553 | cpunum_set_input_line( | |
| 553 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 554 | 554 | |
| 555 | 555 | /* X scroll values */ |
| 556 | segaic16_textram_0_w(0xff8/2, workram[0x0d14/2], 0); | |
| 557 | segaic16_textram_0_w(0xffa/2, workram[0x0d18/2], 0); | |
| 556 | segaic16_textram_0_w(machine, 0xff8/2, workram[0x0d14/2], 0); | |
| 557 | segaic16_textram_0_w(machine, 0xffa/2, workram[0x0d18/2], 0); | |
| 558 | 558 | |
| 559 | 559 | /* page values */ |
| 560 | segaic16_textram_0_w(0xe9e/2, workram[0x0d1c/2], 0); | |
| 561 | segaic16_textram_0_w(0xe9c/2, workram[0x0d1e/2], 0); | |
| 560 | segaic16_textram_0_w(machine, 0xe9e/2, workram[0x0d1c/2], 0); | |
| 561 | segaic16_textram_0_w(machine, 0xe9c/2, workram[0x0d1e/2], 0); | |
| 562 | 562 | } |
| 563 | 563 | |
| 564 | 564 | |
| r1877 | r1878 | |
| 606 | 606 | break; |
| 607 | 607 | } |
| 608 | 608 | |
| 609 | return standard_io_r(offset, mem_mask); | |
| 609 | return standard_io_r(machine, offset, mem_mask); | |
| 610 | 610 | } |
| 611 | 611 | |
| 612 | 612 | |
| r1877 | r1878 | |
| 690 | 690 | } |
| 691 | 691 | break; |
| 692 | 692 | } |
| 693 | return standard_io_r(offset, mem_mask); | |
| 693 | return standard_io_r(machine, offset, mem_mask); | |
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | /************************************* |
| r1877 | r1878 | |
| 702 | 702 | static READ16_HANDLER( pshot16a_custom_io_r ) |
| 703 | 703 | { |
| 704 | 704 | static int read_port = 0; |
| 705 | ||
| 706 | 705 | switch (offset & (0x3000/2)) |
| 707 | 706 | { |
| 708 | 707 | case 0x1000/2: |
| r1877 | r1878 | |
| 725 | 724 | } |
| 726 | 725 | break; |
| 727 | 726 | } |
| 728 | return standard_io_r(offset, mem_mask); | |
| 727 | return standard_io_r(machine, offset, mem_mask); | |
| 729 | 728 | } |
| 730 | 729 | |
| 731 | 730 | /************************************* |
| r1877 | r1878 | |
| 746 | 745 | } |
| 747 | 746 | break; |
| 748 | 747 | } |
| 749 | return standard_io_r(offset, mem_mask); | |
| 748 | return standard_io_r(machine, offset, mem_mask); | |
| 750 | 749 | } |
| 751 | 750 | |
| 752 | 751 | |
| r1877 | r1878 | |
| 760 | 759 | static READ16_HANDLER( sjryuko_custom_io_r ) |
| 761 | 760 | { |
| 762 | 761 | static const char *const portname[] = { "MJ0", "MJ1", "MJ2", "MJ3", "MJ4", "MJ5" }; |
| 763 | ||
| 764 | 762 | switch (offset & (0x3000/2)) |
| 765 | 763 | { |
| 766 | 764 | case 0x1000/2: |
| r1877 | r1878 | |
| 776 | 774 | } |
| 777 | 775 | break; |
| 778 | 776 | } |
| 779 | return standard_io_r(offset, mem_mask); | |
| 777 | return standard_io_r(machine, offset, mem_mask); | |
| 780 | 778 | } |
| 781 | 779 | |
| 782 | 780 | |
| r1877 | r1878 | |
| 1778 | 1776 | /* basic machine hardware */ |
| 1779 | 1777 | MDRV_CPU_ADD_TAG("main", M68000, 10000000) |
| 1780 | 1778 | MDRV_CPU_PROGRAM_MAP(system16a_map,0) |
| 1781 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 1779 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 1782 | 1780 | |
| 1783 | 1781 | MDRV_CPU_ADD_TAG("sound", Z80, 4000000) |
| 1784 | 1782 | /* audio CPU */ |
| r1877 | r1878 | |
| 1831 | 1829 | static MACHINE_DRIVER_START( system16a_8751 ) |
| 1832 | 1830 | MDRV_IMPORT_FROM(system16a) |
| 1833 | 1831 | MDRV_CPU_MODIFY("main") |
| 1834 | MDRV_CPU_VBLANK_INT(i8751_main_cpu_vblank | |
| 1832 | MDRV_CPU_VBLANK_INT("main", i8751_main_cpu_vblank | |
| 1835 | 1833 | |
| 1836 | 1834 | MDRV_CPU_ADD_TAG("mcu", I8751, 8000000) |
| 1837 | 1835 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 1838 | 1836 | MDRV_CPU_DATA_MAP(mcu_data_map,0) |
| 1839 | MDRV_CPU_VBLANK_INT(irq0_line_pulse | |
| 1837 | MDRV_CPU_VBLANK_INT("main", irq0_line_pulse | |
| 1840 | 1838 | MACHINE_DRIVER_END |
| 1841 | 1839 | |
| 1842 | 1840 |
| r1877 | r1878 | |
|---|---|---|
| 368 | 368 | case 0x00: select_controller(data & 0x00ff); break; |
| 369 | 369 | case 0x18: set_output_latch(data & 0x00ff); break; |
| 370 | 370 | case 0x20: set_output_data(data & 0x00ff); break; |
| 371 | case 0x28: pd4990a_control_16_w(0, data, mem_mask); break; | |
| 371 | case 0x28: pd4990a_control_16_w(machine, 0, data, mem_mask); break; | |
| 372 | 372 | // case 0x30: break; // coin counters |
| 373 | 373 | // case 0x31: break; // coin counters |
| 374 | 374 | // case 0x32: break; // coin lockout |
| r1877 | r1878 | |
| 444 | 444 | |
| 445 | 445 | static CUSTOM_INPUT( get_calendar_status ) |
| 446 | 446 | { |
| 447 | return (pd4990a_databit_r(0) << 1) | pd4990a_testbit_r(0); | |
| 447 | return (pd4990a_databit_r(machine, 0) << 1) | pd4990a_testbit_r(machine, 0); | |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | |
| r1877 | r1878 | |
| 564 | 564 | /* accessing the LSB only is not mapped */ |
| 565 | 565 | if (mem_mask != 0xff00) |
| 566 | 566 | { |
| 567 | soundlatch_w(0, data >> 8); | |
| 567 | soundlatch_w(machine, 0, data >> 8); | |
| 568 | 568 | |
| 569 | 569 | audio_cpu_assert_nmi(); |
| 570 | 570 | |
| r1877 | r1878 | |
| 578 | 578 | |
| 579 | 579 | static READ8_HANDLER( audio_command_r ) |
| 580 | 580 | { |
| 581 | UINT8 ret = soundlatch_r(0); | |
| 581 | UINT8 ret = soundlatch_r(machine, 0); | |
| 582 | 582 | |
| 583 | 583 | if (LOG_CPU_COMM) logerror(" AUD CPU PC %04x: audio_command_r %02x\n", activecpu_get_pc(), ret); |
| 584 | 584 | |
| 585 | 585 | /* this is a guess */ |
| 586 | audio_cpu_clear_nmi_w(0, 0); | |
| 586 | audio_cpu_clear_nmi_w(machine, 0, 0); | |
| 587 | 587 | |
| 588 | 588 | return ret; |
| 589 | 589 | } |
| r1877 | r1878 | |
| 877 | 877 | /* only an LSB write resets the watchdog */ |
| 878 | 878 | if (ACCESSING_LSB) |
| 879 | 879 | { |
| 880 | watchdog_reset16_w(offset, data, mem_mask); | |
| 880 | watchdog_reset16_w(machine, offset, data, mem_mask); | |
| 881 | 881 | } |
| 882 | 882 | } |
| 883 | 883 | |
| r1877 | r1878 | |
| 1008 | 1008 | |
| 1009 | 1009 | /* reset system control registers */ |
| 1010 | 1010 | for (offs = 0; offs < 8; offs++) |
| 1011 | system_control_w(offs, 0, 0xff00); | |
| 1011 | system_control_w(machine, offs, 0, 0xff00); | |
| 1012 | 1012 | |
| 1013 | 1013 | neogeo_reset_rng(); |
| 1014 | 1014 | |
| r1877 | r1878 | |
| 1085 | 1085 | AM_RANGE(0x06, 0x06) AM_MIRROR(0xff00) AM_READWRITE(YM2610_status_port_0_B_r, YM2610_control_port_0_B_w) |
| 1086 | 1086 | AM_RANGE(0x07, 0x07) AM_MIRROR(0xff00) AM_WRITE(YM2610_data_port_0_B_w) |
| 1087 | 1087 | AM_RANGE(0x08, 0x08) AM_MIRROR(0xff00) /* write - NMI enable / acknowledge? (the data written doesn't matter) */ |
| 1088 | AM_SPACE(0x08, 0x0f) AM_READ(audio_cpu_bank_select_f000_f7ff_r) | |
| 1089 | AM_SPACE(0x09, 0x0f) AM_READ(audio_cpu_bank_select_e000_efff_r) | |
| 1090 | AM_SPACE(0x0a, 0x0f) AM_READ(audio_cpu_bank_select_c000_dfff_r) | |
| 1091 | AM_SPACE(0x0b, 0x0f) AM_READ(audio_cpu_bank_select_8000_bfff_r) | |
| 1088 | AM_RANGE(0x08, 0x08) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_f000_f7ff_r) | |
| 1089 | AM_RANGE(0x09, 0x09) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_e000_efff_r) | |
| 1090 | AM_RANGE(0x0a, 0x0a) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_c000_dfff_r) | |
| 1091 | AM_RANGE(0x0b, 0x0b) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_8000_bfff_r) | |
| 1092 | 1092 | AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xff00) AM_WRITE(audio_result_w) |
| 1093 | 1093 | AM_RANGE(0x18, 0x18) AM_MIRROR(0xff00) /* write - NMI disable? (the data written doesn't matter) */ |
| 1094 | 1094 | ADDRESS_MAP_END |
| r1877 | r1878 | |
|---|---|---|
| 919 | 919 | |
| 920 | 920 | static READ32_HANDLER( gx5bppspr_r ) |
| 921 | 921 | { |
| 922 | return (K055673_rom_word_r(offset*2+1, 0xffff) | K055673_rom_word_r(offset*2, 0xffff)<<16); | |
| 922 | return (K055673_rom_word_r(machine, offset*2+1, 0xffff) | K055673_rom_word_r(machine, offset*2, 0xffff)<<16); | |
| 923 | 923 | } |
| 924 | 924 | |
| 925 | 925 | static READ32_HANDLER( gx6bppspr_r ) |
| 926 | 926 | { |
| 927 | return (K055673_GX6bpp_rom_word_r(offset*2+1, 0xffff) | K055673_GX6bpp_rom_word_r(offset*2, 0xffff)<<16); | |
| 927 | return (K055673_GX6bpp_rom_word_r(machine, offset*2+1, 0xffff) | K055673_GX6bpp_rom_word_r(machine, offset*2, 0xffff)<<16); | |
| 928 | 928 | } |
| 929 | 929 | |
| 930 | 930 | static READ32_HANDLER( type1_roz_r1 ) |
| r1877 | r1878 | |
| 1208 | 1208 | UINT16 ret = 0; |
| 1209 | 1209 | |
| 1210 | 1210 | if (ACCESSING_LSB16) |
| 1211 | ret |= K054539_1_r(offset); | |
| 1211 | ret |= K054539_1_r(machine, offset); | |
| 1212 | 1212 | if (ACCESSING_MSB16) |
| 1213 | ret |= K054539_0_r(offset)<<8; | |
| 1213 | ret |= K054539_0_r(machine, offset)<<8; | |
| 1214 | 1214 | |
| 1215 | 1215 | return ret; |
| 1216 | 1216 | } |
| r1877 | r1878 | |
| 1218 | 1218 | static WRITE16_HANDLER( dual539_w ) |
| 1219 | 1219 | { |
| 1220 | 1220 | if (ACCESSING_LSB16) |
| 1221 | K054539_1_w(offset, data); | |
| 1221 | K054539_1_w(machine, offset, data); | |
| 1222 | 1222 | if (ACCESSING_MSB16) |
| 1223 | K054539_0_w(offset, data>>8); | |
| 1223 | K054539_0_w(machine, offset, data>>8); | |
| 1224 | 1224 | } |
| 1225 | 1225 | |
| 1226 | 1226 | static READ16_HANDLER( sndcomm68k_r ) |
| r1877 | r1878 | |
| 1313 | 1313 | /* basic machine hardware */ |
| 1314 | 1314 | MDRV_CPU_ADD_TAG("main", M68EC020, 24000000) |
| 1315 | 1315 | MDRV_CPU_PROGRAM_MAP(gx_base_memmap, gx_type2_map) |
| 1316 | MDRV_CPU_VBLANK_INT(konamigx_vbinterrupt | |
| 1316 | MDRV_CPU_VBLANK_INT("main", konamigx_vbinterrupt | |
| 1317 | 1317 | |
| 1318 | 1318 | /* note: part is a -8, crystals are 18.4 and 32.0 MHz, and |
| 1319 | 1319 | twinbee yahhoo will not pass POST if the 68000 isn't |
| r1877 | r1878 | |
| 1408 | 1408 | |
| 1409 | 1409 | MDRV_CPU_MODIFY("main") |
| 1410 | 1410 | MDRV_CPU_PROGRAM_MAP(gx_base_memmap, gx_type3_map) |
| 1411 | MDRV_CPU_VBLANK_INT(konamigx_hbinterrupt, 262) | |
| 1411 | MDRV_CPU_VBLANK_INT_HACK(konamigx_hbinterrupt, 262) | |
| 1412 | 1412 | |
| 1413 | 1413 | MDRV_VIDEO_START(konamigx_type3) |
| 1414 | 1414 | MDRV_PALETTE_LENGTH(16384) |
| r1877 | r1878 | |
| 1423 | 1423 | |
| 1424 | 1424 | MDRV_CPU_MODIFY("main") |
| 1425 | 1425 | MDRV_CPU_PROGRAM_MAP(gx_base_memmap, gx_type4_map) |
| 1426 | MDRV_CPU_VBLANK_INT(konamigx_hbinterrupt, 262) | |
| 1426 | MDRV_CPU_VBLANK_INT_HACK(konamigx_hbinterrupt, 262) | |
| 1427 | 1427 | |
| 1428 | 1428 | MDRV_SCREEN_MODIFY("main") |
| 1429 | 1429 | MDRV_SCREEN_SIZE(64*8, 32*8) |
| r1877 | r1878 | |
|---|---|---|
| 138 | 138 | |
| 139 | 139 | static TIMER_CALLBACK( delayed_ppi8255_w ) |
| 140 | 140 | { |
| 141 | ppi8255_0_w(param >> 8, param & 0xff); | |
| 141 | ppi8255_0_w(machine, param >> 8, param & 0xff); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | |
| r1877 | r1878 | |
| 147 | 147 | switch (offset & 0x3020/2) |
| 148 | 148 | { |
| 149 | 149 | case 0x0000/2: /* PPI @ 4B */ |
| 150 | return ppi8255_0_r(offset & 3); | |
| 150 | return ppi8255_0_r(machine, offset & 3); | |
| 151 | 151 | |
| 152 | 152 | case 0x1000/2: /* Input ports and DIP switches */ |
| 153 | 153 | return readinputport(offset & 3); |
| 154 | 154 | |
| 155 | 155 | case 0x3000/2: /* PPI @ 4C */ |
| 156 | return ppi8255_1_r(offset & 3); | |
| 156 | return ppi8255_1_r(machine, offset & 3); | |
| 157 | 157 | |
| 158 | 158 | case 0x3020/2: /* ADC0804 data output */ |
| 159 | 159 | return readinputport(4 + adc_select); |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | logerror("%06X:hangon_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2); |
| 163 | return segaic16_open_bus_r(0,0); | |
| 163 | return segaic16_open_bus_r(machine,0,0); | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | |
| r1877 | r1878 | |
| 176 | 176 | return; |
| 177 | 177 | |
| 178 | 178 | case 0x3000/2: /* PPI @ 4C */ |
| 179 | ppi8255_1_w(offset & 3, data & 0xff); | |
| 179 | ppi8255_1_w(machine, offset & 3, data & 0xff); | |
| 180 | 180 | return; |
| 181 | 181 | |
| 182 | 182 | case 0x3020/2: /* ADC0804 */ |
| r1877 | r1878 | |
| 192 | 192 | switch (offset & 0x0030/2) |
| 193 | 193 | { |
| 194 | 194 | case 0x0000/2: |
| 195 | return ppi8255_0_r(offset & 3); | |
| 195 | return ppi8255_0_r(machine, offset & 3); | |
| 196 | 196 | |
| 197 | 197 | case 0x0010/2: /* Input ports and DIP switches */ |
| 198 | 198 | return readinputport(offset & 3); |
| 199 | 199 | |
| 200 | 200 | case 0x0020/2: /* PPI @ 4C */ |
| 201 | 201 | if (offset == 2) return 0; |
| 202 | return ppi8255_1_r(offset & 3); | |
| 202 | return ppi8255_1_r(machine, offset & 3); | |
| 203 | 203 | |
| 204 | 204 | case 0x0030/2: /* ADC0804 data output */ |
| 205 | 205 | return readinputport(4 + adc_select); |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | logerror("%06X:sharrier_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2); |
| 209 | return segaic16_open_bus_r(0,0); | |
| 209 | return segaic16_open_bus_r(machine,0,0); | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | |
| r1877 | r1878 | |
| 222 | 222 | return; |
| 223 | 223 | |
| 224 | 224 | case 0x0020/2: /* PPI @ 4C */ |
| 225 | ppi8255_1_w(offset & 3, data & 0xff); | |
| 225 | ppi8255_1_w(machine, offset & 3, data & 0xff); | |
| 226 | 226 | return; |
| 227 | 227 | |
| 228 | 228 | case 0x0030/2: /* ADC0804 */ |
| r1877 | r1878 | |
| 347 | 347 | { |
| 348 | 348 | /* assert ACK */ |
| 349 | 349 | ppi8255_set_portC(0, 0x00); |
| 350 | return soundlatch_r(offset); | |
| 350 | return soundlatch_r(machine, offset); | |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | |
| r1877 | r1878 | |
| 845 | 845 | /* basic machine hardware */ |
| 846 | 846 | MDRV_CPU_ADD_TAG("main", M68000, MASTER_CLOCK_25MHz/4) |
| 847 | 847 | MDRV_CPU_PROGRAM_MAP(hangon_map,0) |
| 848 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 848 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 849 | 849 | |
| 850 | 850 | MDRV_CPU_ADD_TAG("sub", M68000, MASTER_CLOCK_25MHz/4) |
| 851 | 851 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| r1877 | r1878 | |
| 872 | 872 | /* basic machine hardware */ |
| 873 | 873 | MDRV_CPU_REPLACE("main", M68000, MASTER_CLOCK_10MHz) |
| 874 | 874 | MDRV_CPU_PROGRAM_MAP(sharrier_map,0) |
| 875 | MDRV_CPU_VBLANK_INT(i8751_main_cpu_vblank | |
| 875 | MDRV_CPU_VBLANK_INT("main", i8751_main_cpu_vblank | |
| 876 | 876 | |
| 877 | 877 | MDRV_CPU_REPLACE("sub", M68000, MASTER_CLOCK_10MHz) |
| 878 | 878 | |
| r1877 | r1878 | |
| 999 | 999 | MDRV_CPU_ADD_TAG("mcu", I8751, 8000000) |
| 1000 | 1000 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 1001 | 1001 | MDRV_CPU_DATA_MAP(mcu_data_map,0) |
| 1002 | MDRV_CPU_VBLANK_INT(irq0_line_pulse | |
| 1002 | MDRV_CPU_VBLANK_INT("main", irq0_line_pulse | |
| 1003 | 1003 | MACHINE_DRIVER_END |
| 1004 | 1004 | |
| 1005 | 1005 |
| r1877 | r1878 | |
|---|---|---|
| 304 | 304 | MDRV_CPU_ADD(Z80,10000000/2) |
| 305 | 305 | MDRV_CPU_PROGRAM_MAP(sprcros2_m_readmem,sprcros2_m_writemem) |
| 306 | 306 | MDRV_CPU_IO_MAP(sprcros2_m_readport,sprcros2_m_writeport) |
| 307 | MDRV_CPU_VBLANK_INT(sprcros2_m_interrupt,2) //1 nmi + 1 irq | |
| 307 | MDRV_CPU_VBLANK_INT_HACK(sprcros2_m_interrupt,2) //1 nmi + 1 irq | |
| 308 | 308 | |
| 309 | 309 | MDRV_CPU_ADD(Z80,10000000/2) |
| 310 | 310 | MDRV_CPU_PROGRAM_MAP(sprcros2_s_readmem,sprcros2_s_writemem) |
| 311 | 311 | MDRV_CPU_IO_MAP(0,sprcros2_s_writeport) |
| 312 | MDRV_CPU_VBLANK_INT(sprcros2_s_interrupt,2) //2 nmis | |
| 312 | MDRV_CPU_VBLANK_INT_HACK(sprcros2_s_interrupt,2) //2 nmis | |
| 313 | 313 | |
| 314 | 314 | MDRV_MACHINE_START(sprcros2) |
| 315 | 315 |
| r1877 | r1878 | |
|---|---|---|
| 607 | 607 | MDRV_CPU_ADD_TAG("main",8085A,12400000*2) /* 12.4MHz / 4? */ |
| 608 | 608 | MDRV_CPU_PROGRAM_MAP(statriv2_readmem,statriv2_writemem) |
| 609 | 609 | MDRV_CPU_IO_MAP(statriv2_readport,statriv2_writeport) |
| 610 | MDRV_CPU_VBLANK_INT(statriv2_interrupt | |
| 610 | MDRV_CPU_VBLANK_INT("main", statriv2_interrupt | |
| 611 | 611 | |
| 612 | 612 | MDRV_NVRAM_HANDLER(statriv2) |
| 613 | 613 |
| r1877 | r1878 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | |
| 54 | static WRITE8_HANDLER( carrera_mc6845_address_w ) | |
| 55 | { | |
| 56 | mc6845_address_w(mc6845, data); | |
| 57 | } | |
| 58 | ||
| 59 | static WRITE8_HANDLER( carrera_mc6845_register_w ) | |
| 60 | { | |
| 61 | mc6845_register_w(mc6845, data); | |
| 62 | } | |
| 63 | ||
| 64 | ||
| 65 | 54 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 66 | 55 | AM_RANGE(0x0000, 0x4fff) AM_READ(MRA8_ROM) |
| 67 | 56 | AM_RANGE(0xe000, 0xe7ff) AM_READ(MRA8_RAM) |
| r1877 | r1878 | |
| 71 | 60 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 72 | 61 | AM_RANGE(0x0000, 0x4fff) AM_WRITE(MWA8_ROM) |
| 73 | 62 | AM_RANGE(0xe000, 0xe7ff) AM_WRITE(MWA8_RAM) |
| 74 | AM_RANGE(0xe800, 0xe800) AM_WRITE(carrera_mc6845_address_w) | |
| 75 | AM_RANGE(0xe801, 0xe801) AM_WRITE(carrera_mc6845_register_w) | |
| 63 | AM_RANGE(0xe800, 0xe800) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 64 | AM_RANGE(0xe801, 0xe801) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 76 | 65 | AM_RANGE(0xf000, 0xffff) AM_WRITE(MWA8_RAM) AM_BASE(&carrera_tileram) |
| 77 | 66 | ADDRESS_MAP_END |
| 78 | 67 | |
| r1877 | r1878 | |
| 307 | 296 | MDRV_CPU_ADD(Z80,MASTER_CLOCK/6) |
| 308 | 297 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 309 | 298 | MDRV_CPU_IO_MAP(readport,writeport) |
| 310 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 299 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 311 | 300 | |
| 312 | 301 | /* video hardware */ |
| 313 | 302 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "deprecat.h" | |
| 12 | 13 | |
| 13 | 14 | |
| 14 | 15 | #define NUM_PENS (8) |
| r1877 | r1878 | |
| 213 | 214 | MDRV_CPU_ADD(Z80, 2000000) |
| 214 | 215 | MDRV_CPU_PROGRAM_MAP(dorachan_map,0) |
| 215 | 216 | MDRV_CPU_IO_MAP(dorachan_io_map,0) |
| 216 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 217 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 217 | 218 | |
| 218 | 219 | /* video hardware */ |
| 219 | 220 | MDRV_VIDEO_UPDATE(dorachan) |
| r1877 | r1878 | |
|---|---|---|
| 180 | 180 | if (cpu_readmem24bew_word(0x163482) > 0xfff) |
| 181 | 181 | mame_printf_debug("You're screwed!");*/ |
| 182 | 182 | |
| 183 | return atarivc_r(offset,0); | |
| 183 | return atarivc_r(machine,offset,0); | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 |
| r1877 | r1878 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | static READ16_HANDLER( ultraman_K051937_r ) |
| 26 | 26 | { |
| 27 | return K051937_r(offset); | |
| 27 | return K051937_r(machine, offset); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | static READ16_HANDLER( ultraman_K051960_r ) |
| 31 | 31 | { |
| 32 | return K051960_r(offset); | |
| 32 | return K051960_r(machine, offset); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static READ16_HANDLER( ultraman_K051316_0_r ) |
| 36 | 36 | { |
| 37 | return K051316_0_r(offset); | |
| 37 | return K051316_0_r(machine, offset); | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | static READ16_HANDLER( ultraman_K051316_1_r ) |
| 41 | 41 | { |
| 42 | return K051316_1_r(offset); | |
| 42 | return K051316_1_r(machine, offset); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | static READ16_HANDLER( ultraman_K051316_2_r ) |
| 46 | 46 | { |
| 47 | return K051316_2_r(offset); | |
| 47 | return K051316_2_r(machine, offset); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | static WRITE16_HANDLER( ultraman_K051316_0_w ) |
| 51 | 51 | { |
| 52 | 52 | if (ACCESSING_LSB) |
| 53 | K051316_0_w(offset, data & 0xff); | |
| 53 | K051316_0_w(machine, offset, data & 0xff); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | static WRITE16_HANDLER( ultraman_K051316_1_w ) |
| 57 | 57 | { |
| 58 | 58 | if (ACCESSING_LSB) |
| 59 | K051316_1_w(offset, data & 0xff); | |
| 59 | K051316_1_w(machine, offset, data & 0xff); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | static WRITE16_HANDLER( ultraman_K051316_2_w ) |
| 63 | 63 | { |
| 64 | 64 | if (ACCESSING_LSB) |
| 65 | K051316_2_w(offset, data & 0xff); | |
| 65 | K051316_2_w(machine, offset, data & 0xff); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static WRITE16_HANDLER( ultraman_K051316_ctrl_0_w ) |
| 69 | 69 | { |
| 70 | 70 | if (ACCESSING_LSB) |
| 71 | K051316_ctrl_0_w(offset, data & 0xff); | |
| 71 | K051316_ctrl_0_w(machine, offset, data & 0xff); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | static WRITE16_HANDLER( ultraman_K051316_ctrl_1_w ) |
| 75 | 75 | { |
| 76 | 76 | if (ACCESSING_LSB) |
| 77 | K051316_ctrl_1_w(offset, data & 0xff); | |
| 77 | K051316_ctrl_1_w(machine, offset, data & 0xff); | |
| 78 | 78 | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | static WRITE16_HANDLER( ultraman_K051316_ctrl_2_w ) |
| 82 | 82 | { |
| 83 | 83 | if (ACCESSING_LSB) |
| 84 | K051316_ctrl_2_w(offset, data & 0xff); | |
| 84 | K051316_ctrl_2_w(machine, offset, data & 0xff); | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | static WRITE16_HANDLER( ultraman_K051937_w ) |
| 88 | 88 | { |
| 89 | 89 | if (ACCESSING_LSB) |
| 90 | K051937_w(offset, data & 0xff); | |
| 90 | K051937_w(machine, offset, data & 0xff); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | static WRITE16_HANDLER( ultraman_K051960_w ) |
| 94 | 94 | { |
| 95 | 95 | if (ACCESSING_LSB) |
| 96 | K051960_w(offset, data & 0xff); | |
| 96 | K051960_w(machine, offset, data & 0xff); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | static WRITE16_HANDLER( sound_cmd_w ) |
| 100 | 100 | { |
| 101 | 101 | if (ACCESSING_LSB) |
| 102 | soundlatch_w(0,data & 0xff); | |
| 102 | soundlatch_w(machine,0,data & 0xff); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | static WRITE16_HANDLER( sound_irq_trigger_w ) |
| r1877 | r1878 | |
| 267 | 267 | /* basic machine hardware */ |
| 268 | 268 | MDRV_CPU_ADD(M68000,24000000/2) /* 12 MHz? */ |
| 269 | 269 | MDRV_CPU_PROGRAM_MAP(ultraman_readmem,ultraman_writemem) |
| 270 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 270 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 271 | 271 | |
| 272 | 272 | MDRV_CPU_ADD(Z80,24000000/6) |
| 273 | 273 | /* audio CPU */ /* 4 MHz? */ |
| r1877 | r1878 | |
|---|---|---|
| 45 | 45 | if (videobank & 0x01) |
| 46 | 46 | { |
| 47 | 47 | if (videobank & 0x04) |
| 48 | paletteram_xBBBBBGGGGGRRRRR_be_w(offset + 0x0800,data); | |
| 48 | paletteram_xBBBBBGGGGGRRRRR_be_w(machine,offset + 0x0800,data); | |
| 49 | 49 | else |
| 50 | paletteram_xBBBBBGGGGGRRRRR_be_w(offset,data); | |
| 50 | paletteram_xBBBBBGGGGGRRRRR_be_w(machine,offset,data); | |
| 51 | 51 | } |
| 52 | 52 | else |
| 53 | 53 | ram[offset] = data; |
| r1877 | r1878 | |
| 56 | 56 | static READ8_HANDLER( parodius_052109_053245_r ) |
| 57 | 57 | { |
| 58 | 58 | if (videobank & 0x02) |
| 59 | return K053245_r(offset); | |
| 59 | return K053245_r(machine,offset); | |
| 60 | 60 | else |
| 61 | return K052109_r(offset); | |
| 61 | return K052109_r(machine,offset); | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | static WRITE8_HANDLER( parodius_052109_053245_w ) |
| 65 | 65 | { |
| 66 | 66 | if (videobank & 0x02) |
| 67 | K053245_w(offset,data); | |
| 67 | K053245_w(machine,offset,data); | |
| 68 | 68 | else |
| 69 | K052109_w(offset,data); | |
| 69 | K052109_w(machine,offset,data); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | static WRITE8_HANDLER( parodius_videobank_w ) |
| r1877 | r1878 | |
| 95 | 95 | |
| 96 | 96 | static READ8_HANDLER( parodius_sound_r ) |
| 97 | 97 | { |
| 98 | return K053260_0_r(2 + offset); | |
| 98 | return K053260_0_r(machine,2 + offset); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | static WRITE8_HANDLER( parodius_sh_irqtrigger_w ) |
| r1877 | r1878 | |
| 299 | 299 | /* basic machine hardware */ |
| 300 | 300 | MDRV_CPU_ADD(KONAMI, 3000000) /* 053248 */ |
| 301 | 301 | MDRV_CPU_PROGRAM_MAP(parodius_readmem,parodius_writemem) |
| 302 | MDRV_CPU_VBLANK_INT(parodius_interrupt | |
| 302 | MDRV_CPU_VBLANK_INT("main", parodius_interrupt | |
| 303 | 303 | |
| 304 | 304 | MDRV_CPU_ADD(Z80, 3579545) |
| 305 | 305 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 76 | 76 | WRITE8_HANDLER( sraider_io_w ); |
| 77 | 77 | WRITE8_HANDLER( sraider_misc_w ); |
| 78 | 78 | |
| 79 | //extern UINT8 sraider_grid_status; | |
| 80 | //extern UINT8 sraider_0x30, sraider_0x38; | |
| 81 | 79 | |
| 82 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 83 | AM_RANGE(0x0000, 0x5fff) AM_READ(MRA8_ROM) | |
| 84 | AM_RANGE(0x6000, 0x6fff) AM_READ(MRA8_RAM) | |
| 80 | static ADDRESS_MAP_START( ladybug_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 81 | AM_RANGE(0x0000, 0x5fff) AM_ROM | |
| 82 | AM_RANGE(0x6000, 0x6fff) AM_RAM | |
| 83 | AM_RANGE(0x7000, 0x73ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 85 | 84 | AM_RANGE(0x8000, 0x8fff) AM_READ(MRA8_NOP) |
| 86 | AM_RANGE(0x9000, 0x9000) AM_READ(input_port_0_r) /* IN0 */ | |
| 87 | AM_RANGE(0x9001, 0x9001) AM_READ(input_port_1_r) /* IN1 */ | |
| 88 | AM_RANGE(0x9002, 0x9002) AM_READ(input_port_3_r) /* DSW0 */ | |
| 89 | AM_RANGE(0x9003, 0x9003) AM_READ(input_port_4_r) /* DSW1 */ | |
| 90 | AM_RANGE(0xd000, 0xd7ff) AM_READ(MRA8_RAM) /* video and color RAM */ | |
| 85 | AM_RANGE(0x9000, 0x9000) AM_READ(input_port_0_r) | |
| 86 | AM_RANGE(0x9001, 0x9001) AM_READ(input_port_1_r) | |
| 87 | AM_RANGE(0x9002, 0x9002) AM_READ(input_port_3_r) | |
| 88 | AM_RANGE(0x9003, 0x9003) AM_READ(input_port_4_r) | |
| 89 | AM_RANGE(0xa000, 0xa000) AM_WRITE(ladybug_flipscreen_w) | |
| 90 | AM_RANGE(0xb000, 0xbfff) AM_WRITE(SN76496_0_w) | |
| 91 | AM_RANGE(0xc000, 0xcfff) AM_WRITE(SN76496_1_w) | |
| 92 | AM_RANGE(0xd000, 0xd3ff) AM_READWRITE(MRA8_RAM, ladybug_videoram_w) AM_BASE(&videoram) | |
| 93 | AM_RANGE(0xd400, 0xd7ff) AM_READWRITE(MRA8_RAM, ladybug_colorram_w) AM_BASE(&colorram) | |
| 91 | 94 | AM_RANGE(0xe000, 0xe000) AM_READ(input_port_2_r) /* IN2 */ |
| 92 | 95 | ADDRESS_MAP_END |
| 93 | 96 | |
| 94 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 95 | AM_RANGE(0x0000, 0x5fff) AM_WRITE(MWA8_ROM) | |
| 96 | AM_RANGE(0x6000, 0x6fff) AM_WRITE(MWA8_RAM) | |
| 97 | ||
| 98 | static ADDRESS_MAP_START( sraider_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 99 | AM_RANGE(0x0000, 0x5fff) AM_ROM | |
| 100 | AM_RANGE(0x6000, 0x6fff) AM_RAM | |
| 97 | 101 | AM_RANGE(0x7000, 0x73ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 98 | AM_RANGE(0xa000, 0xa000) AM_WRITE(ladybug_flipscreen_w) | |
| 99 | AM_RANGE(0xb000, 0xbfff) AM_WRITE(SN76496_0_w) | |
| 100 | AM_RANGE(0xc000, 0xcfff) AM_WRITE(SN76496_1_w) | |
| 102 | AM_RANGE(0x8005, 0x8005) AM_READ(sraider_8005_r) // protection check? | |
| 103 | AM_RANGE(0x8006, 0x8006) AM_WRITE(sraider_sound_low_w) | |
| 104 | AM_RANGE(0x8007, 0x8007) AM_WRITE(sraider_sound_high_w) | |
| 105 | AM_RANGE(0x9000, 0x9000) AM_READ(input_port_0_r) | |
| 106 | AM_RANGE(0x9001, 0x9001) AM_READ(input_port_1_r) | |
| 107 | AM_RANGE(0x9002, 0x9002) AM_READ(input_port_2_r) | |
| 108 | AM_RANGE(0x9003, 0x9003) AM_READ(input_port_3_r) | |
| 101 | 109 | AM_RANGE(0xd000, 0xd3ff) AM_WRITE(ladybug_videoram_w) AM_BASE(&videoram) |
| 102 | 110 | AM_RANGE(0xd400, 0xd7ff) AM_WRITE(ladybug_colorram_w) AM_BASE(&colorram) |
| 111 | AM_RANGE(0xe000, 0xe000) AM_WRITE(MWA8_NOP) //unknown 0x10 when in attract, 0x20 when coined/playing | |
| 103 | 112 | ADDRESS_MAP_END |
| 104 | 113 | |
| 105 | /*************************************************************************** | |
| 106 | 114 | |
| 107 | Lady Bug doesn't have VBlank interrupts. | |
| 108 | Interrupts are still used by the game: but they are related to coin | |
| 109 | slots. Left slot generates a NMI, Right slot an IRQ. | |
| 115 | static ADDRESS_MAP_START( sraider_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 116 | AM_RANGE(0x0000, 0x5fff) AM_ROM | |
| 117 | AM_RANGE(0x6000, 0x63ff) AM_RAM | |
| 118 | AM_RANGE(0x8000, 0x8000) AM_READ(sraider_sound_low_r) | |
| 119 | AM_RANGE(0xa000, 0xa000) AM_READ(sraider_sound_high_r) | |
| 120 | AM_RANGE(0xc000, 0xc000) AM_READ(MRA8_NOP) //some kind of sync | |
| 121 | AM_RANGE(0xe000, 0xe0ff) AM_WRITE(MWA8_RAM) AM_BASE(&sraider_grid_data) | |
| 122 | AM_RANGE(0xe800, 0xe800) AM_WRITE(sraider_io_w) | |
| 123 | ADDRESS_MAP_END | |
| 110 | 124 | |
| 111 | ***************************************************************************/ | |
| 112 | static INTERRUPT_GEN( ladybug_interrupt ) | |
| 125 | ||
| 126 | static ADDRESS_MAP_START( sraider_cpu2_io_map, ADDRESS_SPACE_IO, 8 ) | |
| 127 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) | |
| 128 | AM_RANGE(0x00, 0x00) AM_WRITE(SN76496_0_w) | |
| 129 | AM_RANGE(0x08, 0x08) AM_WRITE(SN76496_1_w) | |
| 130 | AM_RANGE(0x10, 0x10) AM_WRITE(SN76496_2_w) | |
| 131 | AM_RANGE(0x18, 0x18) AM_WRITE(SN76496_3_w) | |
| 132 | AM_RANGE(0x20, 0x20) AM_WRITE(SN76496_4_w) | |
| 133 | AM_RANGE(0x28, 0x3f) AM_WRITE(sraider_misc_w) // lots unknown | |
| 134 | ADDRESS_MAP_END | |
| 135 | ||
| 136 | ||
| 137 | ||
| 138 | static INPUT_CHANGED( coin1_inserted ) | |
| 113 | 139 | { |
| 114 | if (readinputport(5) & 1) /* Left Coin */ | |
| 115 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 116 | else if (readinputport(5) & 2) /* Right Coin */ | |
| 140 | /* left coin insertion causes an NMI */ | |
| 141 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE); | |
| 142 | } | |
| 143 | ||
| 144 | static INPUT_CHANGED( coin2_inserted ) | |
| 145 | { | |
| 146 | /* right coin insertion causes an IRQ */ | |
| 147 | if (newval) | |
| 117 | 148 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); |
| 118 | 149 | } |
| 119 | 150 | |
| r1877 | r1878 | |
| 213 | 244 | PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) ) |
| 214 | 245 | /* settings 0x00 thru 0x50 all give 1 Coin/1 Credit */ |
| 215 | 246 | |
| 216 | PORT_START_TAG("FAKE") /* FAKE */ | |
| 217 | /* The coin slots are not memory mapped. Coin Left causes a NMI, */ | |
| 218 | /* Coin Right an IRQ. This fake input port is used by the interrupt */ | |
| 219 | /* handler to be notified of coin insertions. We use IMPULSE to */ | |
| 220 | /* trigger exactly one interrupt, without having to check when the */ | |
| 221 | /* user releases the key. */ | |
| 222 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) | |
| 223 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) | |
| 247 | PORT_START_TAG("COIN") /* FAKE */ | |
| 248 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin1_inserted, 0) | |
| 249 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED(coin2_inserted, 0) | |
| 224 | 250 | |
| 225 | 251 | PORT_START_TAG(LADYBUG_P1_CONTROL_PORT_TAG) |
| 226 | 252 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY |
| r1877 | r1878 | |
| 320 | 346 | PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) ) |
| 321 | 347 | /* settings 0x00 thru 0x04 all give 1 Coin/1 Credit */ |
| 322 | 348 | |
| 323 | PORT_START_TAG("FAKE") | |
| 324 | /* The coin slots are not memory mapped. Coin Left causes a NMI, */ | |
| 325 | /* Coin Right an IRQ. This fake input port is used by the interrupt */ | |
| 326 | /* handler to be notified of coin insertions. We use IMPULSE to */ | |
| 327 | /* trigger exactly one interrupt, without having to check when the */ | |
| 328 | /* user releases the key. */ | |
| 329 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) | |
| 330 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) | |
| 349 | PORT_START_TAG("COIN") /* FAKE */ | |
| 350 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin1_inserted, 0) | |
| 351 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED(coin2_inserted, 0) | |
| 331 | 352 | INPUT_PORTS_END |
| 332 | 353 | |
| 333 | 354 | static INPUT_PORTS_START( cavenger ) |
| r1877 | r1878 | |
| 409 | 430 | PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) ) |
| 410 | 431 | /* settings 0x00 thru 0x50 all give 1 Coin/1 Credit */ |
| 411 | 432 | |
| 412 | PORT_START_TAG("FAKE") | |
| 413 | /* The coin slots are not memory mapped. Coin Left causes a NMI, */ | |
| 414 | /* Coin Right an IRQ. This fake input port is used by the interrupt */ | |
| 415 | /* handler to be notified of coin insertions. We use IMPULSE to */ | |
| 416 | /* trigger exactly one interrupt, without having to check when the */ | |
| 417 | /* user releases the key. */ | |
| 418 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) | |
| 419 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) | |
| 433 | PORT_START_TAG("COIN") /* FAKE */ | |
| 434 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin1_inserted, 0) | |
| 435 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED(coin2_inserted, 0) | |
| 420 | 436 | INPUT_PORTS_END |
| 421 | 437 | |
| 422 | 438 | static INPUT_PORTS_START( dorodon ) |
| r1877 | r1878 | |
| 500 | 516 | PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) ) |
| 501 | 517 | /* settings 0x00 thru 0x50 all give 1 Coin/1 Credit */ |
| 502 | 518 | |
| 503 | PORT_START_TAG("FAKE") | |
| 504 | /* The coin slots are not memory mapped. Coin Left causes a NMI, */ | |
| 505 | /* Coin Right an IRQ. This fake input port is used by the interrupt */ | |
| 506 | /* handler to be notified of coin insertions. We use IMPULSE to */ | |
| 507 | /* trigger exactly one interrupt, without having to check when the */ | |
| 508 | /* user releases the key. */ | |
| 509 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) | |
| 510 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) | |
| 519 | PORT_START_TAG("COIN") /* FAKE */ | |
| 520 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin1_inserted, 0) | |
| 521 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED(coin2_inserted, 0) | |
| 511 | 522 | INPUT_PORTS_END |
| 512 | 523 | |
| 513 | 524 | static INPUT_PORTS_START( sraider ) |
| r1877 | r1878 | |
| 659 | 670 | |
| 660 | 671 | /* basic machine hardware */ |
| 661 | 672 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 662 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 663 | MDRV_CPU_VBLANK_INT(ladybug_interrupt,1) | |
| 673 | MDRV_CPU_PROGRAM_MAP(ladybug_map,0) | |
| 664 | 674 | |
| 665 | 675 | /* video hardware */ |
| 666 | 676 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 688 | 698 | MACHINE_DRIVER_END |
| 689 | 699 | |
| 690 | 700 | |
| 691 | static ADDRESS_MAP_START( sraider_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 692 | AM_RANGE(0x0000, 0x5fff) AM_ROM | |
| 693 | AM_RANGE(0x6000, 0x6fff) AM_RAM | |
| 694 | AM_RANGE(0x7000, 0x73ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 695 | AM_RANGE(0x8005, 0x8005) AM_READ(sraider_8005_r) // protection check? | |
| 696 | AM_RANGE(0x8006, 0x8006) AM_WRITE(sraider_sound_low_w) | |
| 697 | AM_RANGE(0x8007, 0x8007) AM_WRITE(sraider_sound_high_w) | |
| 698 | AM_RANGE(0x9000, 0x9000) AM_READ(input_port_0_r) /* IN0 */ | |
| 699 | AM_RANGE(0x9001, 0x9001) AM_READ(input_port_1_r) /* IN1 */ | |
| 700 | AM_RANGE(0x9002, 0x9002) AM_READ(input_port_2_r) /* DSW0 */ | |
| 701 | AM_RANGE(0x9003, 0x9003) AM_READ(input_port_3_r) /* DSW1 */ | |
| 702 | AM_RANGE(0xd000, 0xd3ff) AM_WRITE(ladybug_videoram_w) AM_BASE(&videoram) | |
| 703 | AM_RANGE(0xd400, 0xd7ff) AM_WRITE(ladybug_colorram_w) AM_BASE(&colorram) | |
| 704 | AM_RANGE(0xe000, 0xe000) AM_WRITE(MWA8_NOP) //unknown | |
| 705 | // 0x10 when in attract, 0x20 when coined/playing | |
| 706 | ADDRESS_MAP_END | |
| 707 | ||
| 708 | static ADDRESS_MAP_START( sraider_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 709 | AM_RANGE(0x0000, 0x5fff) AM_ROM | |
| 710 | AM_RANGE(0x6000, 0x63ff) AM_RAM | |
| 711 | AM_RANGE(0x8000, 0x8000) AM_READ(sraider_sound_low_r) | |
| 712 | AM_RANGE(0xa000, 0xa000) AM_READ(sraider_sound_high_r) | |
| 713 | AM_RANGE(0xc000, 0xc000) AM_READ(MRA8_NOP) //some kind of sync | |
| 714 | AM_RANGE(0xe000, 0xe0ff) AM_WRITE(MWA8_RAM) AM_BASE(&sraider_grid_data) | |
| 715 | AM_RANGE(0xe800, 0xe800) AM_WRITE(sraider_io_w) | |
| 716 | ADDRESS_MAP_END | |
| 717 | ||
| 718 | static ADDRESS_MAP_START( sraider_cpu2_io, ADDRESS_SPACE_IO, 8 ) | |
| 719 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) | |
| 720 | AM_RANGE(0x00, 0x00) AM_WRITE(SN76496_0_w) | |
| 721 | AM_RANGE(0x08, 0x08) AM_WRITE(SN76496_1_w) | |
| 722 | AM_RANGE(0x10, 0x10) AM_WRITE(SN76496_2_w) | |
| 723 | AM_RANGE(0x18, 0x18) AM_WRITE(SN76496_3_w) | |
| 724 | AM_RANGE(0x20, 0x20) AM_WRITE(SN76496_4_w) | |
| 725 | AM_RANGE(0x28, 0x3f) AM_WRITE(sraider_misc_w) // lots unknown | |
| 726 | ADDRESS_MAP_END | |
| 727 | ||
| 728 | ||
| 729 | 701 | static MACHINE_DRIVER_START( sraider ) |
| 730 | 702 | |
| 731 | 703 | /* basic machine hardware */ |
| 732 | 704 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 733 | 705 | MDRV_CPU_PROGRAM_MAP(sraider_cpu1_map,0) |
| 734 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 706 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 735 | 707 | |
| 736 | 708 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz */ |
| 737 | 709 | MDRV_CPU_PROGRAM_MAP(sraider_cpu2_map,0) |
| 738 | MDRV_CPU_IO_MAP(sraider_cpu2_io,0) | |
| 739 | MDRV_CPU_VBLANK_INT(irq0_line_hold,1) | |
| 710 | MDRV_CPU_IO_MAP(sraider_cpu2_io_map,0) | |
| 711 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 740 | 712 | |
| 741 | 713 | /* video hardware */ |
| 742 | 714 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 896 | 868 | ROM_END |
| 897 | 869 | |
| 898 | 870 | ROM_START( dorodon ) |
| 899 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) | |
| 871 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) | |
| 900 | 872 | ROM_LOAD( "dorodon.0", 0x0000, 0x2000, CRC(460aaf26) SHA1(c4ea41cba4ac2d93fedec3c117a4470fee2a910f) ) |
| 901 | 873 | ROM_LOAD( "dorodon.1", 0x2000, 0x2000, CRC(d2451eb6) SHA1(4154bfe50b7f75444d3f0c9be6bd2475fdba1938) ) |
| 902 | 874 | ROM_LOAD( "dorodon.2", 0x4000, 0x2000, CRC(d3c6ee6c) SHA1(6971ecdc968810c19f8601efc3d389450156bb22) ) |
| 903 | 875 | |
| 904 | /* Characters */ | |
| 905 | 876 | ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 906 | 877 | ROM_LOAD( "dorodon.5", 0x0000, 0x1000, CRC(5eee2b85) SHA1(55ac9566e805d103b6916f51c764e2601cc1f715) ) |
| 907 | 878 | ROM_LOAD( "dorodon.6", 0x1000, 0x1000, CRC(395ac25a) SHA1(d8a55e42b8c5d957c2e6a3181d7ac10c6a448f46) ) |
| 908 | 879 | |
| 909 | /* Sprites */ | |
| 910 | 880 | ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE ) |
| 911 | 881 | ROM_LOAD( "dorodon.4", 0x0000, 0x1000, CRC(d70bb50a) SHA1(b9d46862f288c49bb8b660da87b63bd4ecb36379) ) |
| 912 | 882 | ROM_LOAD( "dorodon.3", 0x1000, 0x1000, CRC(e44e59e6) SHA1(ff730152804d75ddb9fb19e8ec33cc764d8a50e8) ) |
| 913 | 883 | |
| 914 | /* Opcode Decryption PROMS */ | |
| 915 | 884 | ROM_REGION( 0x0100, REGION_USER1, ROMREGION_DISPOSE ) |
| 916 | ROM_LOAD_NIB_HIGH( "dorodon.bp4",0x0000,0x0100,CRC(f865c135) SHA1(1202f83bfa50afa5a5d24401efa8bf058e7e30b5) ) | |
| 917 | ROM_LOAD_NIB_LOW( "dorodon.bp3",0x0000,0x0100,CRC(47b2f0bb) SHA1(640720aa5c1119080c6da928f6d1b0e76b989742) ) | |
| 885 | ROM_LOAD_NIB_HIGH( "dorodon.bp4", 0x0000, 0x0100, CRC(f865c135) SHA1(1202f83bfa50afa5a5d24401efa8bf058e7e30b5) ) | |
| 886 | ROM_LOAD_NIB_LOW( "dorodon.bp3", 0x0000, 0x0100, CRC(47b2f0bb) SHA1(640720aa5c1119080c6da928f6d1b0e76b989742) ) | |
| 918 | 887 | |
| 919 | 888 | ROM_REGION( 0x0060, REGION_PROMS, 0 ) |
| 920 | 889 | ROM_LOAD( "dorodon.bp0", 0x0000, 0x0020, CRC(8fcf0bc8) SHA1(392d22731b3e4bc663d6e4385f6069ee2b4ee029) ) /* palette */ |
| r1877 | r1878 | |
| 923 | 892 | ROM_END |
| 924 | 893 | |
| 925 | 894 | ROM_START( dorodon2 ) |
| 926 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) | |
| 895 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) | |
| 927 | 896 | ROM_LOAD( "1.3fg", 0x0000, 0x2000, CRC(4d05d6f8) SHA1(db12ad04295f0ce112b6e90fde94a53ed1d6c3b9) ) |
| 928 | 897 | ROM_LOAD( "2.3h", 0x2000, 0x2000, CRC(27b43b09) SHA1(12a8a6b8665bb9d1967ec631a794aab564a50570) ) |
| 929 | 898 | ROM_LOAD( "3.3k", 0x4000, 0x2000, CRC(38d2f295) SHA1(b4d2cfd6e9f03c3ef18dcf67326f4106749b62b1) ) |
| 930 | 899 | |
| 931 | /* Characters */ | |
| 932 | 900 | ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 933 | 901 | ROM_LOAD( "6.6a", 0x0000, 0x1000, CRC(2a2d8b9c) SHA1(ba3ce8ed6cafa711bf4c6ed260dd15b38adbd6cc) ) |
| 934 | 902 | ROM_LOAD( "7.6bc", 0x1000, 0x1000, CRC(d14f95fa) SHA1(e9ba87602d779d833b8152c077c692e67ef696cc) ) |
| 935 | 903 | |
| 936 | /* Sprites */ | |
| 937 | 904 | ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE ) |
| 938 | 905 | ROM_LOAD( "5.3t", 0x0000, 0x1000, CRC(54c04f58) SHA1(342ef914e6f8bf37472d146bb5e9fb67056d7fc5) ) |
| 939 | 906 | ROM_LOAD( "4.3r", 0x1000, 0x1000, CRC(1ebb6493) SHA1(30367d7594118e0fa8620e5d20c66a650ca82c86) ) |
| 940 | 907 | |
| 941 | /* Opcode Decryption PROMS (from other romset) */ | |
| 942 | 908 | ROM_REGION( 0x0100, REGION_USER1, ROMREGION_DISPOSE ) |
| 943 | ROM_LOAD_NIB_HIGH( "dorodon.bp4",0x0000,0x0100,CRC(f865c135) SHA1(1202f83bfa50afa5a5d24401efa8bf058e7e30b5) ) | |
| 944 | ROM_LOAD_NIB_LOW( "dorodon.bp3",0x0000,0x0100,CRC(47b2f0bb) SHA1(640720aa5c1119080c6da928f6d1b0e76b989742) ) | |
| 909 | ROM_LOAD_NIB_HIGH( "dorodon.bp4", 0x0000, 0x0100, CRC(f865c135) SHA1(1202f83bfa50afa5a5d24401efa8bf058e7e30b5) ) | |
| 910 | ROM_LOAD_NIB_LOW( "dorodon.bp3", 0x0000, 0x0100, CRC(47b2f0bb) SHA1(640720aa5c1119080c6da928f6d1b0e76b989742) ) | |
| 945 | 911 | |
| 946 | 912 | /* (from other romset - I think these are correct, they match the Starcade video) */ |
| 947 | 913 | ROM_REGION( 0x0060, REGION_PROMS, 0 ) |
| r1877 | r1878 | |
| 981 | 947 | |
| 982 | 948 | static DRIVER_INIT( dorodon ) |
| 983 | 949 | { |
| 984 | /* | |
| 950 | /* decode the opcodes */ | |
| 985 | 951 | |
| 986 | 952 | offs_t i; |
| 987 | 953 | UINT8 *decrypted = auto_malloc(0x6000); |
| r1877 | r1878 | |
| 990 | 956 | |
| 991 | 957 | memory_set_decrypted_region(0, 0x0000, 0x5fff, decrypted); |
| 992 | 958 | |
| 993 | for (i = 0;i < 0x6000;i++) | |
| 994 | { | |
| 959 | for (i = 0; i < 0x6000; i++) | |
| 995 | 960 | decrypted[i] = table[rom[i]]; |
| 996 | } | |
| 997 | 961 | } |
| 998 | 962 | |
| 999 | static DRIVER_INIT( sraider ) | |
| 1000 | { | |
| 1001 | } | |
| 1002 | 963 | |
| 1003 | 964 | GAME( 1981, cavenger, 0, ladybug, cavenger, 0, ROT0, "Universal", "Cosmic Avenger", 0 ) |
| 1004 | 965 | GAME( 1981, ladybug, 0, ladybug, ladybug, 0, ROT270, "Universal", "Lady Bug", 0 ) |
| r1877 | r1878 | |
| 1007 | 968 | GAME( 1982, dorodon, 0, ladybug, dorodon, dorodon, ROT270, "Falcon", "Dorodon (set 1)", 0 ) |
| 1008 | 969 | GAME( 1982, dorodon2, dorodon, ladybug, dorodon, dorodon, ROT270, "Falcon", "Dorodon (set 2)", 0 ) |
| 1009 | 970 | GAME( 1982, snapjack, 0, ladybug, snapjack, 0, ROT0, "Universal", "Snap Jack", 0 ) |
| 1010 | GAME( 1982, sraider, 0, sraider, sraider, | |
| 971 | GAME( 1982, sraider, 0, sraider, sraider, 0 |
| r1877 | r1878 | |
|---|---|---|
| 120 | 120 | static WRITE16_HANDLER( pokey_word_w ) |
| 121 | 121 | { |
| 122 | 122 | if (offset & 0x10) /* A5 selects chip */ |
| 123 | pokey2_w(offset & 0x0f, data); | |
| 123 | pokey2_w(machine, offset & 0x0f, data); | |
| 124 | 124 | else |
| 125 | pokey1_w(offset & 0x0f, data); | |
| 125 | pokey1_w(machine, offset & 0x0f, data); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
| 129 | 129 | static READ16_HANDLER( pokey_word_r ) |
| 130 | 130 | { |
| 131 | 131 | if (offset & 0x10) |
| 132 | return pokey2_r(offset & 0x0f); | |
| 132 | return pokey2_r(machine, offset & 0x0f); | |
| 133 | 133 | else |
| 134 | return pokey1_r(offset & 0x0f); | |
| 134 | return pokey1_r(machine, offset & 0x0f); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 |
| r1877 | r1878 | |
|---|---|---|
| 81 | 81 | |
| 82 | 82 | static WRITE8_HANDLER( blueprnt_sound_command_w ) |
| 83 | 83 | { |
| 84 | soundlatch_w(offset, data); | |
| 85 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 84 | soundlatch_w(machine, offset, data); | |
| 85 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | static WRITE8_HANDLER( blueprnt_coin_counter_w ) |
| r1877 | r1878 | |
| 297 | 297 | // basic machine hardware |
| 298 | 298 | MDRV_CPU_ADD(Z80, 7000000/2) // 3.5 MHz |
| 299 | 299 | MDRV_CPU_PROGRAM_MAP(blueprnt_map, 0) |
| 300 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 300 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 301 | 301 | |
| 302 | 302 | MDRV_CPU_ADD(Z80, 10000000/2/2/2) // 1.25 MHz (2H) |
| 303 | 303 | MDRV_CPU_PROGRAM_MAP(sound_map, 0) |
| 304 | MDRV_CPU_VBLANK_INT(irq0_line_hold, 4) // IRQs connected to 32V | |
| 304 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 4) // IRQs connected to 32V | |
| 305 | 305 | // NMIs are caused by the main CPU |
| 306 | 306 | // video hardware |
| 307 | 307 |
| r1877 | r1878 | |
|---|---|---|
| 237 | 237 | static READ8_HANDLER ( combasc_YM2203_status_port_0_r ) |
| 238 | 238 | { |
| 239 | 239 | static int boost = 1; |
| 240 | int status = YM2203_status_port_0_r(0); | |
| 240 | int status = YM2203_status_port_0_r(machine,0); | |
| 241 | 241 | |
| 242 | 242 | if (activecpu_get_pc() == 0x334) |
| 243 | 243 | { |
| r1877 | r1878 | |
| 662 | 662 | /* basic machine hardware */ |
| 663 | 663 | MDRV_CPU_ADD(HD6309, 3000000*4) /* 3 MHz? */ |
| 664 | 664 | MDRV_CPU_PROGRAM_MAP(combasc_readmem,combasc_writemem) |
| 665 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 665 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 666 | 666 | |
| 667 | 667 | MDRV_CPU_ADD(Z80,3579545) /* 3.579545 MHz */ |
| 668 | 668 | /* audio CPU */ |
| r1877 | r1878 | |
| 705 | 705 | /* basic machine hardware */ |
| 706 | 706 | MDRV_CPU_ADD(HD6309, 3000000*4) /* 3 MHz? */ |
| 707 | 707 | MDRV_CPU_PROGRAM_MAP(combascb_readmem,combascb_writemem) |
| 708 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 708 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 709 | 709 | |
| 710 | 710 | MDRV_CPU_ADD(Z80,3579545) /* 3.579545 MHz */ |
| 711 | 711 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 87 | 87 | |
| 88 | 88 | static WRITE8_HANDLER( rockrage_sh_irqtrigger_w ) |
| 89 | 89 | { |
| 90 | soundlatch_w(offset, data); | |
| 91 | cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,HOLD_LINE); | |
| 90 | soundlatch_w(machine, offset, data); | |
| 91 | cpunum_set_input_line(machine, 1,M6809_IRQ_LINE,HOLD_LINE); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | static READ8_HANDLER( rockrage_VLM5030_busy_r ) { |
| r1877 | r1878 | |
| 295 | 295 | /* basic machine hardware */ |
| 296 | 296 | MDRV_CPU_ADD(HD6309, 3000000*4) /* 24MHz/8 */ |
| 297 | 297 | MDRV_CPU_PROGRAM_MAP(rockrage_readmem,rockrage_writemem) |
| 298 | MDRV_CPU_VBLANK_INT(rockrage_interrupt | |
| 298 | MDRV_CPU_VBLANK_INT("main", rockrage_interrupt | |
| 299 | 299 | |
| 300 | 300 | MDRV_CPU_ADD(M6809, 1500000) /* 24MHz/16 */ |
| 301 | 301 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 227 | 227 | MDRV_CPU_ADD(V30, 8000000) |
| 228 | 228 | MDRV_CPU_PROGRAM_MAP(ttchamp_map, 0) |
| 229 | 229 | MDRV_CPU_IO_MAP(ttchamp_io,0) |
| 230 | MDRV_CPU_VBLANK_INT(ttchamp_irq | |
| 230 | MDRV_CPU_VBLANK_INT("main", ttchamp_irq | |
| 231 | 231 | |
| 232 | 232 | /* video hardware */ |
| 233 | 233 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | static UINT8 egghunt_okibanking; |
| 55 | 55 | static UINT8 egghunt_gfx_banking; |
| 56 | 56 | |
| 57 | static void draw_sprites(running_machine *machine, | |
| 57 | static void draw_sprites(running_machine *machine, | |
| 58 | 58 | { |
| 59 | 59 | int flipscreen = 0; |
| 60 | 60 | int offs,sx,sy; |
| r1877 | r1878 | |
| 173 | 173 | |
| 174 | 174 | static WRITE8_HANDLER( egghunt_soundlatch_w ) |
| 175 | 175 | { |
| 176 | soundlatch_w(0,data); | |
| 177 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 176 | soundlatch_w(machine,0,data); | |
| 177 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | static READ8_HANDLER( egghunt_okibanking_r ) |
| r1877 | r1878 | |
| 389 | 389 | MDRV_CPU_ADD(Z80,12000000/2) /* 6 MHz ?*/ |
| 390 | 390 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 391 | 391 | MDRV_CPU_IO_MAP(readport,writeport) |
| 392 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 392 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 393 | 393 | |
| 394 | 394 | MDRV_CPU_ADD(Z80,12000000/2) /* 6 MHz ?*/ |
| 395 | 395 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 133 | 133 | |
| 134 | 134 | static WRITE8_HANDLER( sound_command_w ) |
| 135 | 135 | { |
| 136 | soundlatch_w(0,data); | |
| 136 | soundlatch_w(machine,0,data); | |
| 137 | 137 | timer_call_after_resynch(NULL, data,nmi_callback); |
| 138 | 138 | } |
| 139 | 139 | |
| r1877 | r1878 | |
| 432 | 432 | /* basic machine hardware */ |
| 433 | 433 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz??? */ |
| 434 | 434 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 435 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 435 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 436 | 436 | |
| 437 | 437 | MDRV_CPU_ADD(Z80, 4000000) |
| 438 | 438 | /* audio CPU */ /* 4 MHz??? */ |
| 439 | 439 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 440 | MDRV_CPU_VBLANK_INT(irq0_line_hold,60) /* irq is timed, tied to the cpu clock and not to vblank */ | |
| 440 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,60) /* irq is timed, tied to the cpu clock and not to vblank */ | |
| 441 | 441 | /* nmi is caused by the main cpu */ |
| 442 | 442 | |
| 443 | 443 | MDRV_CPU_ADD(M68705,8000000/2) /* 4 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 180 | 180 | { |
| 181 | 181 | switch (offset) |
| 182 | 182 | { |
| 183 | case 0: return YM3438_status_port_0_A_r(0); | |
| 184 | case 1: return YM3438_read_port_0_r(0); | |
| 185 | case 2: return YM3438_status_port_0_B_r(0); | |
| 183 | case 0: return YM3438_status_port_0_A_r(machine, 0); | |
| 184 | case 1: return YM3438_read_port_0_r(machine, 0); | |
| 185 | case 2: return YM3438_status_port_0_B_r(machine, 0); | |
| 186 | 186 | } |
| 187 | 187 | return 0xff; |
| 188 | 188 | } |
| r1877 | r1878 | |
| 205 | 205 | |
| 206 | 206 | switch (offset) |
| 207 | 207 | { |
| 208 | case 0: YM3438_control_port_0_A_w(0, data & 0xff); last_port = data; break; | |
| 209 | case 1: YM3438_data_port_0_A_w(0, data & 0xff); break; | |
| 210 | case 2: YM3438_control_port_0_B_w(0, data & 0xff); last_port = data; break; | |
| 211 | case 3: YM3438_data_port_0_B_w(0, data & 0xff); break; | |
| 208 | case 0: YM3438_control_port_0_A_w(machine, 0, data & 0xff); last_port = data; break; | |
| 209 | case 1: YM3438_data_port_0_A_w(machine, 0, data & 0xff); break; | |
| 210 | case 2: YM3438_control_port_0_B_w(machine, 0, data & 0xff); last_port = data; break; | |
| 211 | case 3: YM3438_data_port_0_B_w(machine, 0, data & 0xff); break; | |
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | } |
| r1877 | r1878 | |
| 372 | 372 | |
| 373 | 373 | /* otherwise, return an input port */ |
| 374 | 374 | if (offset == 0x04/2 && sound_banks) |
| 375 | return (readinputport(offset) & 0xbf) | (upd7759_0_busy_r(0) << 6); | |
| 375 | return (readinputport(offset) & 0xbf) | (upd7759_0_busy_r(machine,0) << 6); | |
| 376 | 376 | return readinputport(offset); |
| 377 | 377 | |
| 378 | 378 | /* 'SEGA' protection */ |
| r1877 | r1878 | |
| 1365 | 1365 | /* basic machine hardware */ |
| 1366 | 1366 | MDRV_CPU_ADD_TAG("main", M68000, XL2_CLOCK/6) |
| 1367 | 1367 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 1368 | MDRV_CPU_VBLANK_INT(genesis_vblank_interrupt | |
| 1368 | MDRV_CPU_VBLANK_INT("main", genesis_vblank_interrupt | |
| 1369 | 1369 | |
| 1370 | 1370 | MDRV_MACHINE_START(segac2) |
| 1371 | 1371 | MDRV_MACHINE_RESET(segac2) |
| r1877 | r1878 | |
|---|---|---|
| 277 | 277 | /* basic machine hardware */ |
| 278 | 278 | MDRV_CPU_ADD(M68000,14318180) /* 14.31818 MHz */ |
| 279 | 279 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 280 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 280 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 281 | 281 | |
| 282 | 282 | MDRV_CPU_ADD(Z80,6000000) /* 6 MHz */ |
| 283 | 283 | /* audio CPU */ |
| 284 | 284 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 285 | // MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 285 | // MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 286 | 286 | |
| 287 | 287 | /* video hardware */ |
| 288 | 288 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 302 | 302 | |
| 303 | 303 | MDRV_CPU_ADD(M6502, STARSHP1_CPU_CLOCK) |
| 304 | 304 | MDRV_CPU_PROGRAM_MAP(readmem, writemem) |
| 305 | MDRV_CPU_VBLANK_INT(starshp1_interrupt | |
| 305 | MDRV_CPU_VBLANK_INT("main", starshp1_interrupt | |
| 306 | 306 | |
| 307 | 307 | /* video hardware */ |
| 308 | 308 |
| r1877 | r1878 | |
|---|---|---|
| 224 | 224 | static MACHINE_DRIVER_START( bigstrkb ) |
| 225 | 225 | MDRV_CPU_ADD(M68000, 12000000) |
| 226 | 226 | MDRV_CPU_PROGRAM_MAP(bigstrkb_readmem,bigstrkb_writemem) |
| 227 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 227 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 228 | 228 | |
| 229 | 229 | MDRV_GFXDECODE(bigstrkb) |
| 230 | 230 |
| r1877 | r1878 | |
|---|---|---|
| 62 | 62 | break; |
| 63 | 63 | case 0x03: coin_counter_w(1,data & 0x01); |
| 64 | 64 | break; |
| 65 | case 0x05: pandoras_flipscreen_w(0, data); | |
| 65 | case 0x05: pandoras_flipscreen_w(machine, 0, data); | |
| 66 | 66 | break; |
| 67 | 67 | case 0x06: if (!data) cpunum_set_input_line(Machine, 1, M6809_IRQ_LINE, CLEAR_LINE); |
| 68 | 68 | irq_enable_b = data; |
| r1877 | r1878 | |
| 379 | 379 | /* basic machine hardware */ |
| 380 | 380 | MDRV_CPU_ADD(M6809,18432000/6) /* CPU A */ |
| 381 | 381 | MDRV_CPU_PROGRAM_MAP(pandoras_readmem_a,pandoras_writemem_a) |
| 382 | MDRV_CPU_VBLANK_INT(pandoras_interrupt_a | |
| 382 | MDRV_CPU_VBLANK_INT("main", pandoras_interrupt_a | |
| 383 | 383 | |
| 384 | 384 | MDRV_CPU_ADD(M6809,18432000/6) /* CPU B */ |
| 385 | 385 | MDRV_CPU_PROGRAM_MAP(pandoras_readmem_b,pandoras_writemem_b) |
| 386 | MDRV_CPU_VBLANK_INT(pandoras_interrupt_b | |
| 386 | MDRV_CPU_VBLANK_INT("main", pandoras_interrupt_b | |
| 387 | 387 | |
| 388 | 388 | MDRV_CPU_ADD(Z80,14318000/8) |
| 389 | 389 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 310 | 310 | |
| 311 | 311 | static WRITE16_HANDLER( taitof2_watchdog_w ) |
| 312 | 312 | { |
| 313 | watchdog_reset | |
| 313 | watchdog_reset | |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | static WRITE16_HANDLER( growl_coin_word_w ) /* what about coins 3&4 ?? */ |
| r1877 | r1878 | |
| 359 | 359 | switch (offset) |
| 360 | 360 | { |
| 361 | 361 | case 0x00: |
| 362 | return input_port_3_word_r(0,mem_mask); /* DSW A */ | |
| 362 | return input_port_3_word_r(machine,0,mem_mask); /* DSW A */ | |
| 363 | 363 | |
| 364 | 364 | case 0x01: |
| 365 | return input_port_4_word_r(0,mem_mask); /* DSW B */ | |
| 365 | return input_port_4_word_r(machine,0,mem_mask); /* DSW B */ | |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | logerror("CPU #0 PC %06x: warning - read unmapped dsw_r offset %06x\n",activecpu_get_pc(),offset); |
| r1877 | r1878 | |
| 375 | 375 | switch (offset) |
| 376 | 376 | { |
| 377 | 377 | case 0x00: |
| 378 | return input_port_0_word_r(0,mem_mask); /* IN0 */ | |
| 378 | return input_port_0_word_r(machine,0,mem_mask); /* IN0 */ | |
| 379 | 379 | |
| 380 | 380 | case 0x01: |
| 381 | return input_port_1_word_r(0,mem_mask); /* IN1 */ | |
| 381 | return input_port_1_word_r(machine,0,mem_mask); /* IN1 */ | |
| 382 | 382 | |
| 383 | 383 | case 0x02: |
| 384 | return input_port_2_word_r(0,mem_mask); /* IN2 */ | |
| 384 | return input_port_2_word_r(machine,0,mem_mask); /* IN2 */ | |
| 385 | 385 | |
| 386 | 386 | } |
| 387 | 387 | |
| r1877 | r1878 | |
| 395 | 395 | switch (offset) |
| 396 | 396 | { |
| 397 | 397 | case 0x00: |
| 398 | return input_port_3_word_r(0,mem_mask); /* DSW A */ | |
| 398 | return input_port_3_word_r(machine,0,mem_mask); /* DSW A */ | |
| 399 | 399 | |
| 400 | 400 | case 0x01: |
| 401 | return input_port_4_word_r(0,mem_mask); /* DSW B */ | |
| 401 | return input_port_4_word_r(machine,0,mem_mask); /* DSW B */ | |
| 402 | 402 | |
| 403 | 403 | case 0x02: |
| 404 | return input_port_2_word_r(0,mem_mask); /* IN2 */ | |
| 404 | return input_port_2_word_r(machine,0,mem_mask); /* IN2 */ | |
| 405 | 405 | |
| 406 | 406 | // case 0x03: |
| 407 | 407 | // return (coin_word & ~mem_mask); |
| 408 | 408 | |
| 409 | 409 | case 0x05: |
| 410 | return input_port_0_word_r(0,mem_mask); /* IN0 */ | |
| 410 | return input_port_0_word_r(machine,0,mem_mask); /* IN0 */ | |
| 411 | 411 | |
| 412 | 412 | case 0x06: |
| 413 | return input_port_1_word_r(0,mem_mask); /* IN1 */ | |
| 413 | return input_port_1_word_r(machine,0,mem_mask); /* IN1 */ | |
| 414 | 414 | |
| 415 | 415 | case 0x07: |
| 416 | return input_port_5_word_r(0,mem_mask); /* IN3 */ | |
| 416 | return input_port_5_word_r(machine,0,mem_mask); /* IN3 */ | |
| 417 | 417 | |
| 418 | 418 | case 0x08: |
| 419 | return input_port_6_word_r(0,mem_mask); /* IN4 */ | |
| 419 | return input_port_6_word_r(machine,0,mem_mask); /* IN4 */ | |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | logerror("CPU #0 PC %06x: warning - read unmapped input offset %06x\n",activecpu_get_pc(),offset); |
| r1877 | r1878 | |
| 429 | 429 | switch (offset) |
| 430 | 430 | { |
| 431 | 431 | case 0x00: |
| 432 | return (input_port_3_word_r(0,0) << 8); /* DSW A */ | |
| 432 | return (input_port_3_word_r(machine,0,0) << 8); /* DSW A */ | |
| 433 | 433 | |
| 434 | 434 | case 0x01: |
| 435 | return (input_port_4_word_r(0,0) << 8); /* DSW B */ | |
| 435 | return (input_port_4_word_r(machine,0,0) << 8); /* DSW B */ | |
| 436 | 436 | |
| 437 | 437 | case 0x02: |
| 438 | return (input_port_0_word_r(0,0) << 8); /* IN 0 */ | |
| 438 | return (input_port_0_word_r(machine,0,0) << 8); /* IN 0 */ | |
| 439 | 439 | |
| 440 | 440 | case 0x03: |
| 441 | return (input_port_1_word_r(0,0) << 8); /* IN 1 */ | |
| 441 | return (input_port_1_word_r(machine,0,0) << 8); /* IN 1 */ | |
| 442 | 442 | |
| 443 | 443 | case 0x04: |
| 444 | return (input_port_5_word_r(0,0) << 8); /* IN 3 */ | |
| 444 | return (input_port_5_word_r(machine,0,0) << 8); /* IN 3 */ | |
| 445 | 445 | |
| 446 | 446 | case 0x05: |
| 447 | return (input_port_6_word_r(0,0) << 8); /* IN 4 */ | |
| 447 | return (input_port_6_word_r(machine,0,0) << 8); /* IN 4 */ | |
| 448 | 448 | |
| 449 | 449 | case 0x06: |
| 450 | return (input_port_2_word_r(0,0) << 8); /* IN 2 */ | |
| 450 | return (input_port_2_word_r(machine,0,0) << 8); /* IN 2 */ | |
| 451 | 451 | |
| 452 | 452 | // case 0x07: |
| 453 | 453 | // return (coin_word & ~mem_mask); |
| r1877 | r1878 | |
| 466 | 466 | switch (offset) |
| 467 | 467 | { |
| 468 | 468 | case 0x00: |
| 469 | curr = input_port_5_word_r(0,0); /* Paddle A */ | |
| 469 | curr = input_port_5_word_r(machine,0,0); /* Paddle A */ | |
| 470 | 470 | res = curr - last[0]; |
| 471 | 471 | last[0] = curr; |
| 472 | 472 | return res; |
| 473 | 473 | |
| 474 | 474 | case 0x02: |
| 475 | curr = input_port_6_word_r(0,0); /* Paddle B */ | |
| 475 | curr = input_port_6_word_r(machine,0,0); /* Paddle B */ | |
| 476 | 476 | res = curr - last[1]; |
| 477 | 477 | last[1] = curr; |
| 478 | 478 | return res; |
| r1877 | r1878 | |
| 488 | 488 | switch (offset) |
| 489 | 489 | { |
| 490 | 490 | case 0x00: |
| 491 | return input_port_5_word_r(0,mem_mask); /* Paddle A */ | |
| 491 | return input_port_5_word_r(machine,0,mem_mask); /* Paddle A */ | |
| 492 | 492 | |
| 493 | 493 | case 0x01: |
| 494 | return input_port_6_word_r(0,mem_mask); /* Paddle B */ | |
| 494 | return input_port_6_word_r(machine,0,mem_mask); /* Paddle B */ | |
| 495 | 495 | } |
| 496 | 496 | |
| 497 | 497 | logerror("CPU #0 PC %06x: warning - read unmapped paddle offset %06x\n",activecpu_get_pc(),offset); |
| r1877 | r1878 | |
| 504 | 504 | switch (offset) |
| 505 | 505 | { |
| 506 | 506 | case 0x00: |
| 507 | return input_port_3_word_r(0,mem_mask); /* DSW A */ | |
| 507 | return input_port_3_word_r(machine,0,mem_mask); /* DSW A */ | |
| 508 | 508 | |
| 509 | 509 | case 0x01: |
| 510 | return input_port_4_word_r(0,mem_mask); /* DSW B */ | |
| 510 | return input_port_4_word_r(machine,0,mem_mask); /* DSW B */ | |
| 511 | 511 | |
| 512 | 512 | case 0x02: |
| 513 | return input_port_2_word_r(0,mem_mask); /* IN2 */ | |
| 513 | return input_port_2_word_r(machine,0,mem_mask); /* IN2 */ | |
| 514 | 514 | |
| 515 | 515 | // case 0x03: |
| 516 | 516 | // return (coin_word & ~mem_mask); |
| 517 | 517 | |
| 518 | 518 | case 0x05: |
| 519 | return input_port_0_word_r(0,mem_mask); /* IN0 */ | |
| 519 | return input_port_0_word_r(machine,0,mem_mask); /* IN0 */ | |
| 520 | 520 | |
| 521 | 521 | case 0x06: |
| 522 | return input_port_1_word_r(0,mem_mask); /* IN1 */ | |
| 522 | return input_port_1_word_r(machine,0,mem_mask); /* IN1 */ | |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | logerror("CPU #0 PC %06x: warning - read unmapped input offset %06x\n",activecpu_get_pc(),offset); |
| r1877 | r1878 | |
| 533 | 533 | { |
| 534 | 534 | case 0x00: |
| 535 | 535 | { |
| 536 | return (input_port_5_word_r(0,0) << 8) + input_port_7_word_r(0,0); /* DSW A + coin */ | |
| 536 | return (input_port_5_word_r(machine,0,0) << 8) + input_port_7_word_r(machine,0,0); /* DSW A + coin */ | |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | case 0x01: |
| 540 | 540 | { |
| 541 | return (input_port_6_word_r(0,0) << 8) + input_port_8_word_r(0,0); /* DSW B + coin */ | |
| 541 | return (input_port_6_word_r(machine,0,0) << 8) + input_port_8_word_r(machine,0,0); /* DSW B + coin */ | |
| 542 | 542 | } |
| 543 | 543 | } |
| 544 | 544 | |
| r1877 | r1878 | |
| 552 | 552 | switch (mjnquest_input) |
| 553 | 553 | { |
| 554 | 554 | case 0x01: |
| 555 | return input_port_0_word_r(0,mem_mask); /* IN0 */ | |
| 555 | return input_port_0_word_r(machine,0,mem_mask); /* IN0 */ | |
| 556 | 556 | |
| 557 | 557 | case 0x02: |
| 558 | return input_port_1_word_r(0,mem_mask); /* IN1 */ | |
| 558 | return input_port_1_word_r(machine,0,mem_mask); /* IN1 */ | |
| 559 | 559 | |
| 560 | 560 | case 0x04: |
| 561 | return input_port_2_word_r(0,mem_mask); /* IN2 */ | |
| 561 | return input_port_2_word_r(machine,0,mem_mask); /* IN2 */ | |
| 562 | 562 | |
| 563 | 563 | case 0x08: |
| 564 | return input_port_3_word_r(0,mem_mask); /* IN3 */ | |
| 564 | return input_port_3_word_r(machine,0,mem_mask); /* IN3 */ | |
| 565 | 565 | |
| 566 | 566 | case 0x10: |
| 567 | return input_port_4_word_r(0,mem_mask); /* IN4 */ | |
| 567 | return input_port_4_word_r(machine,0,mem_mask); /* IN4 */ | |
| 568 | 568 | |
| 569 | 569 | } |
| 570 | 570 | |
| r1877 | r1878 | |
| 583 | 583 | switch (offset) |
| 584 | 584 | { |
| 585 | 585 | case 0x00: |
| 586 | return input_port_4_word_r(0,mem_mask); /* DSW B */ | |
| 586 | return input_port_4_word_r(machine,0,mem_mask); /* DSW B */ | |
| 587 | 587 | |
| 588 | 588 | case 0x01: |
| 589 | return input_port_0_word_r(0,mem_mask); /* IN0 */ | |
| 589 | return input_port_0_word_r(machine,0,mem_mask); /* IN0 */ | |
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n",activecpu_get_pc(),offset); |
| r1877 | r1878 | |
| 599 | 599 | switch (offset) |
| 600 | 600 | { |
| 601 | 601 | case 0x00: |
| 602 | return input_port_3_word_r(0,mem_mask); /* DSW A */ | |
| 602 | return input_port_3_word_r(machine,0,mem_mask); /* DSW A */ | |
| 603 | 603 | |
| 604 | 604 | case 0x01: |
| 605 | return input_port_1_word_r(0,mem_mask); /* IN1 */ | |
| 605 | return input_port_1_word_r(machine,0,mem_mask); /* IN1 */ | |
| 606 | 606 | |
| 607 | 607 | case 0x02: |
| 608 | return input_port_2_word_r(0,mem_mask); /* IN2 */ | |
| 608 | return input_port_2_word_r(machine,0,mem_mask); /* IN2 */ | |
| 609 | 609 | } |
| 610 | 610 | |
| 611 | 611 | logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n",activecpu_get_pc(),offset); |
| r1877 | r1878 | |
| 618 | 618 | switch (offset) |
| 619 | 619 | { |
| 620 | 620 | case 0x00: |
| 621 | return input_port_0_word_r(0,mem_mask); /* IN0 */ | |
| 621 | return input_port_0_word_r(machine,0,mem_mask); /* IN0 */ | |
| 622 | 622 | |
| 623 | 623 | /* case 0x01 only used if "printer" DSW is on, and appears to |
| 624 | 624 | be printer status byte */ |
| 625 | 625 | |
| 626 | 626 | case 0x02: |
| 627 | return input_port_1_word_r(0,mem_mask); /* IN1 */ | |
| 627 | return input_port_1_word_r(machine,0,mem_mask); /* IN1 */ | |
| 628 | 628 | } |
| 629 | 629 | |
| 630 | 630 | logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n",activecpu_get_pc(),offset); |
| r1877 | r1878 | |
| 642 | 642 | |
| 643 | 643 | if (yesnoj_dsw) |
| 644 | 644 | { |
| 645 | return input_port_2_word_r(0,mem_mask); | |
| 645 | return input_port_2_word_r(machine,0,mem_mask); | |
| 646 | 646 | } |
| 647 | 647 | else |
| 648 | 648 | { |
| 649 | return input_port_3_word_r(0,mem_mask); | |
| 649 | return input_port_3_word_r(machine,0,mem_mask); | |
| 650 | 650 | } |
| 651 | 651 | } |
| 652 | 652 | |
| r1877 | r1878 | |
| 829 | 829 | static READ16_HANDLER( taitof2_sound_r ) |
| 830 | 830 | { |
| 831 | 831 | if (offset == 1) |
| 832 | return (taitosound_comm16_lsb_r(0,mem_mask)); | |
| 832 | return (taitosound_comm16_lsb_r(machine,0,mem_mask)); | |
| 833 | 833 | else return 0; |
| 834 | 834 | } |
| 835 | 835 | |
| 836 | 836 | static READ16_HANDLER( taitof2_msb_sound_r ) |
| 837 | 837 | { |
| 838 | 838 | if (offset == 1) |
| 839 | return (taitosound_comm16_msb_r(0,mem_mask)); | |
| 839 | return (taitosound_comm16_msb_r(machine,0,mem_mask)); | |
| 840 | 840 | else return 0; |
| 841 | 841 | } |
| 842 | 842 | |
| r1877 | r1878 | |
| 3868 | 3868 | |
| 3869 | 3869 | /* basic machine hardware */ |
| 3870 | 3870 | MDRV_CPU_ADD_TAG("main", M68000, 24000000/2) /* 12 MHz */ |
| 3871 | MDRV_CPU_VBLANK_INT(taitof2_interrupt | |
| 3871 | MDRV_CPU_VBLANK_INT("main", taitof2_interrupt | |
| 3872 | 3872 | |
| 3873 | 3873 | MDRV_CPU_ADD(Z80, 24000000/6) /* 4 MHz */ |
| 3874 | 3874 | /* audio CPU */ |
| r1877 | r1878 | |
| 4322 | 4322 | /* basic machine hardware */ |
| 4323 | 4323 | MDRV_CPU_ADD(M68000,24000000/2) /* verified on pcb */ |
| 4324 | 4324 | MDRV_CPU_PROGRAM_MAP(cameltry_readmem,cameltry_writemem) |
| 4325 | MDRV_CPU_VBLANK_INT(taitof2_interrupt | |
| 4325 | MDRV_CPU_VBLANK_INT("main", taitof2_interrupt | |
| 4326 | 4326 | |
| 4327 | 4327 | MDRV_CPU_ADD(Z80,24000000/4) /* verifed on pcb */ |
| 4328 | 4328 | /* audio CPU */ |
| r1877 | r1878 | |
| 4364 | 4364 | /* basic machine hardware */ |
| 4365 | 4365 | MDRV_CPU_ADD(M68000,24000000/2) /* 12 MHz */ |
| 4366 | 4366 | MDRV_CPU_PROGRAM_MAP(driveout_readmem,driveout_writemem) |
| 4367 | MDRV_CPU_VBLANK_INT(taitof2_interrupt | |
| 4367 | MDRV_CPU_VBLANK_INT("main", taitof2_interrupt | |
| 4368 | 4368 | |
| 4369 | 4369 | MDRV_CPU_ADD(Z80,24000000/6) /* 4 MHz */ |
| 4370 | 4370 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 552 | 552 | // basic machine hardware |
| 553 | 553 | MDRV_CPU_ADD_TAG("main", Z80, 18432000/6) // X1S (generated by a custom IC) |
| 554 | 554 | MDRV_CPU_PROGRAM_MAP(gberet_map, 0) |
| 555 | MDRV_CPU_VBLANK_INT(gberet_interrupt, 32) // 1 IRQ + 16 NMI (generated by a custom IC) | |
| 555 | MDRV_CPU_VBLANK_INT_HACK(gberet_interrupt, 32) // 1 IRQ + 16 NMI (generated by a custom IC) | |
| 556 | 556 | |
| 557 | 557 | // video hardware |
| 558 | 558 | |
| r1877 | r1878 | |
| 583 | 583 | // basic machine hardware |
| 584 | 584 | MDRV_CPU_MODIFY("main") |
| 585 | 585 | MDRV_CPU_PROGRAM_MAP(gberetb_map, 0) |
| 586 | MDRV_CPU_VBLANK_INT(gberet_interrupt, 16) // 1 IRQ + 8 NMI | |
| 586 | MDRV_CPU_VBLANK_INT_HACK(gberet_interrupt, 16) // 1 IRQ + 8 NMI | |
| 587 | 587 | |
| 588 | 588 | MDRV_SCREEN_MODIFY("main") |
| 589 | 589 | MDRV_SCREEN_REFRESH_RATE(60) |
| r1877 | r1878 | |
| 601 | 601 | // basic machine hardware |
| 602 | 602 | MDRV_CPU_MODIFY("main") |
| 603 | 603 | MDRV_CPU_PROGRAM_MAP(mrgoemon_map, 0) |
| 604 | MDRV_CPU_VBLANK_INT(gberet_interrupt, 16) // 1 IRQ + 8 NMI | |
| 604 | MDRV_CPU_VBLANK_INT_HACK(gberet_interrupt, 16) // 1 IRQ + 8 NMI | |
| 605 | 605 | |
| 606 | 606 | MDRV_SCREEN_MODIFY("main") |
| 607 | 607 | MDRV_SCREEN_REFRESH_RATE(60) |
| r1877 | r1878 | |
|---|---|---|
| 487 | 487 | /* basic machine hardware */ |
| 488 | 488 | MDRV_CPU_ADD(Z80, 3000000) /* 3 MHz */ |
| 489 | 489 | MDRV_CPU_PROGRAM_MAP(readmem_cpu1,writemem_cpu1) |
| 490 | MDRV_CPU_VBLANK_INT(stfight_vb_interrupt | |
| 490 | MDRV_CPU_VBLANK_INT("main", stfight_vb_interrupt | |
| 491 | 491 | |
| 492 | 492 | MDRV_CPU_ADD(Z80, 3000000) |
| 493 | 493 | /* audio CPU */ /* 3 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 197 | 197 | |
| 198 | 198 | static READ8_HANDLER( gottlieb_track_0_r ) |
| 199 | 199 | { |
| 200 | return input_port_2_r(offset) - track[0]; | |
| 200 | return input_port_2_r(machine, offset) - track[0]; | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | static READ8_HANDLER( gottlieb_track_1_r ) |
| 204 | 204 | { |
| 205 | return input_port_3_r(offset) - track[1]; | |
| 205 | return input_port_3_r(machine, offset) - track[1]; | |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | static WRITE8_HANDLER( gottlieb_track_reset_w ) |
| 209 | 209 | { |
| 210 | 210 | /* reset the trackball counters */ |
| 211 | track[0] = input_port_2_r(offset); | |
| 212 | track[1] = input_port_3_r(offset); | |
| 211 | track[0] = input_port_2_r(machine, offset); | |
| 212 | track[1] = input_port_3_r(machine, offset); | |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | static int joympx; |
| r1877 | r1878 | |
| 240 | 240 | set_led_status(0,data & 0x20); |
| 241 | 241 | set_led_status(1,data & 0x40); |
| 242 | 242 | set_led_status(2,data & 0x80); |
| 243 | gottlieb_video_outputs_w(offset,data); | |
| 243 | gottlieb_video_outputs_w(machine,offset,data); | |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | static WRITE8_HANDLER( stooges_output_w ) |
| 247 | 247 | { |
| 248 | 248 | joympx = (data >> 5) & 0x03; |
| 249 | gottlieb_video_outputs_w(offset,data); | |
| 249 | gottlieb_video_outputs_w(machine,offset,data); | |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | |
| r1877 | r1878 | |
| 1523 | 1523 | /* basic machine hardware */ |
| 1524 | 1524 | MDRV_CPU_ADD_TAG("main", I8088, 5000000) /* 5 MHz */ |
| 1525 | 1525 | MDRV_CPU_PROGRAM_MAP(gottlieb_map,0) |
| 1526 | MDRV_CPU_VBLANK_INT(gottlieb_interrupt | |
| 1526 | MDRV_CPU_VBLANK_INT("main", gottlieb_interrupt | |
| 1527 | 1527 | |
| 1528 | 1528 | /* audio CPU */ |
| 1529 | 1529 | MDRV_CPU_ADD_TAG("sound", M6502, 3579545/4) /* the board can be set to /2 as well */ |
| r1877 | r1878 | |
| 1601 | 1601 | /* basic machine hardware */ |
| 1602 | 1602 | MDRV_CPU_ADD_TAG("main", I8088, 5000000) /* 5 MHz */ |
| 1603 | 1603 | MDRV_CPU_PROGRAM_MAP(gottlieb_map,0) |
| 1604 | MDRV_CPU_VBLANK_INT(gottlieb_interrupt | |
| 1604 | MDRV_CPU_VBLANK_INT("main", gottlieb_interrupt | |
| 1605 | 1605 | |
| 1606 | 1606 | MDRV_CPU_ADD_TAG("sound", M6502, 1000000) /* 1 MHz */ |
| 1607 | 1607 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 187 | 187 | static READ16_HANDLER( sandscrp_soundlatch_word_r ) |
| 188 | 188 | { |
| 189 | 189 | latch2_full = 0; |
| 190 | return soundlatch2_r(0); | |
| 190 | return soundlatch2_r(machine,0); | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | static WRITE16_HANDLER( sandscrp_soundlatch_word_w ) |
| r1877 | r1878 | |
| 195 | 195 | if (ACCESSING_LSB) |
| 196 | 196 | { |
| 197 | 197 | latch1_full = 1; |
| 198 | soundlatch_w(0, data & 0xff); | |
| 199 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 198 | soundlatch_w(machine, 0, data & 0xff); | |
| 199 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 200 | 200 | cpu_spinuntil_time(ATTOTIME_IN_USEC(100)); // Allow the other cpu to reply |
| 201 | 201 | } |
| 202 | 202 | } |
| r1877 | r1878 | |
| 253 | 253 | static READ8_HANDLER( sandscrp_soundlatch_r ) |
| 254 | 254 | { |
| 255 | 255 | latch1_full = 0; |
| 256 | return soundlatch_r(0); | |
| 256 | return soundlatch_r(machine,0); | |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | static WRITE8_HANDLER( sandscrp_soundlatch_w ) |
| 260 | 260 | { |
| 261 | 261 | latch2_full = 1; |
| 262 | soundlatch2_w(0,data); | |
| 262 | soundlatch2_w(machine,0,data); | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | static ADDRESS_MAP_START( sandscrp_soundmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 435 | 435 | /* basic machine hardware */ |
| 436 | 436 | MDRV_CPU_ADD(M68000,12000000) /* TMP68HC000N-12 */ |
| 437 | 437 | MDRV_CPU_PROGRAM_MAP(sandscrp,0) |
| 438 | MDRV_CPU_VBLANK_INT(sandscrp_interrupt | |
| 438 | MDRV_CPU_VBLANK_INT("main", sandscrp_interrupt | |
| 439 | 439 | |
| 440 | 440 | MDRV_CPU_ADD(Z80,4000000) /* Z8400AB1, Reads the DSWs: it can't be disabled */ |
| 441 | 441 | MDRV_CPU_PROGRAM_MAP(sandscrp_soundmem,0) |
| r1877 | r1878 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | /* VIDEO GOODS */ |
| 62 | static void gpworld_draw_tiles(running_machine *machine, | |
| 62 | static void gpworld_draw_tiles(running_machine *machine, | |
| 63 | 63 | { |
| 64 | 64 | UINT8 characterX, characterY; |
| 65 | 65 | |
| r1877 | r1878 | |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | INLINE void draw_pixel( | |
| 79 | INLINE void draw_pixel( | |
| 80 | 80 | { |
| 81 | 81 | if (flip_screen_get()) |
| 82 | 82 | { |
| r1877 | r1878 | |
| 93 | 93 | *BITMAP_ADDR32(bitmap, y, x) = color; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | static void gpworld_draw_sprites( | |
| 96 | static void gpworld_draw_sprites( | |
| 97 | 97 | { |
| 98 | 98 | const int SPR_Y_TOP = 0; |
| 99 | 99 | const int SPR_Y_BOTTOM = 1; |
| r1877 | r1878 | |
| 434 | 434 | MDRV_CPU_ADD(Z80, GUESSED_CLOCK) |
| 435 | 435 | MDRV_CPU_PROGRAM_MAP(mainmem,0) |
| 436 | 436 | MDRV_CPU_IO_MAP(mainport,0) |
| 437 | MDRV_CPU_VBLANK_INT(vblank_callback_gpworld | |
| 437 | MDRV_CPU_VBLANK_INT("main", vblank_callback_gpworld | |
| 438 | 438 | |
| 439 | 439 | MDRV_MACHINE_START(gpworld) |
| 440 | 440 |
| r1877 | r1878 | |
|---|---|---|
| 323 | 323 | break; |
| 324 | 324 | |
| 325 | 325 | case 3: /* 380e - SND irq */ |
| 326 | soundlatch_w(0, data); | |
| 327 | cpunum_set_input_line(Machine, snd_cpu, sound_irq, (sound_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE); | |
| 326 | soundlatch_w(machine, 0, data); | |
| 327 | cpunum_set_input_line(machine, snd_cpu, sound_irq, (sound_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE); | |
| 328 | 328 | break; |
| 329 | 329 | |
| 330 | 330 | case 4: /* 380f - ? */ |
| r1877 | r1878 | |
|---|---|---|
| 86 | 86 | 0); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | static void draw_sprites(running_machine *machine, | |
| 89 | static void draw_sprites(running_machine *machine, | |
| 90 | 90 | { |
| 91 | 91 | int offs; |
| 92 | 92 | |
| r1877 | r1878 | |
| 162 | 162 | #define SHOW_LEDS 0 |
| 163 | 163 | |
| 164 | 164 | #if SHOW_LEDS |
| 165 | static void draw_led( | |
| 165 | static void draw_led( | |
| 166 | 166 | { |
| 167 | 167 | plot_box(bitmap, x, y, 5, 9, 0x00000000); |
| 168 | 168 | |
| r1877 | r1878 | |
| 281 | 281 | ---- ---- ---- --x- (Activate Test) |
| 282 | 282 | ---- ---- ---- ---x (Advance Thru Tests) |
| 283 | 283 | */ |
| 284 | return input_port_0_word_r(0,0); | |
| 284 | return input_port_0_word_r(machine,0,0); | |
| 285 | 285 | case 0x0014/2: |
| 286 | 286 | /* |
| 287 | 287 | write 0x40,read (~0x08) |
| r1877 | r1878 | |
| 291 | 291 | */ |
| 292 | 292 | return (ac_devram[offset]); |
| 293 | 293 | case 0x0016/2: |
| 294 | return OKIM6295_status_0_r(0); | |
| 294 | return OKIM6295_status_0_r(machine,0); | |
| 295 | 295 | case 0x0018/2: |
| 296 | 296 | /* |
| 297 | 297 | ---- ---- ---- x--- Astronaut - switch |
| 298 | 298 | */ |
| 299 | 299 | return ac_devram[offset]; |
| 300 | 300 | case 0x001a/2: |
| 301 | return OKIM6295_status_1_r(0); | |
| 301 | return OKIM6295_status_1_r(machine,0); | |
| 302 | 302 | case 0x0040/2: |
| 303 | 303 | /* |
| 304 | 304 | x-x- x-x- x-x- xx-- (ACTIVE HIGH?) [eori #$aaac, D0] |
| r1877 | r1878 | |
| 315 | 315 | xxxx xxxx ---- ---- DIPSW4 |
| 316 | 316 | ---- ---- xxxx xxxx DIPSW3 |
| 317 | 317 | */ |
| 318 | return input_port_1_word_r(0,0); | |
| 318 | return input_port_1_word_r(machine,0,0); | |
| 319 | 319 | } |
| 320 | 320 | return ac_devram[offset]; |
| 321 | 321 | } |
| r1877 | r1878 | |
| 329 | 329 | if(ACCESSING_LSB) |
| 330 | 330 | { |
| 331 | 331 | logerror("Request to play sample %02x with rom 2\n",data); |
| 332 | OKIM6295_data_0_w(0,data); | |
| 332 | OKIM6295_data_0_w(machine,0,data); | |
| 333 | 333 | } |
| 334 | 334 | break; |
| 335 | 335 | case 0x1a/2: |
| 336 | 336 | if(ACCESSING_LSB) |
| 337 | 337 | { |
| 338 | 338 | logerror("Request to play sample %02x with rom 1\n",data); |
| 339 | OKIM6295_data_1_w(0,data); | |
| 339 | OKIM6295_data_1_w(machine,0,data); | |
| 340 | 340 | } |
| 341 | 341 | break; |
| 342 | 342 | case 0x1c/2: |
| r1877 | r1878 | |
| 519 | 519 | /* basic machine hardware */ |
| 520 | 520 | MDRV_CPU_ADD(M68000,12000000) |
| 521 | 521 | MDRV_CPU_PROGRAM_MAP(acommand,0) |
| 522 | MDRV_CPU_VBLANK_INT(acommand_irq,2) | |
| 522 | MDRV_CPU_VBLANK_INT_HACK(acommand_irq,2) | |
| 523 | 523 | |
| 524 | 524 | /* video hardware */ |
| 525 | 525 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 68 | 68 | /* bit 8 is EEPROM data */ |
| 69 | 69 | /* bit 9 is EEPROM ready */ |
| 70 | 70 | /* bit 10 is service button */ |
| 71 | res = (EEPROM_read_bit()<<8) | input_port_1_word_r(0,0); | |
| 71 | res = (EEPROM_read_bit()<<8) | input_port_1_word_r(machine,0,0); | |
| 72 | 72 | |
| 73 | 73 | if (init_eeprom_count) |
| 74 | 74 | { |
| r1877 | r1878 | |
| 117 | 117 | |
| 118 | 118 | static READ16_HANDLER( asterix_sound_r ) |
| 119 | 119 | { |
| 120 | return K053260_0_r(2 + offset); | |
| 120 | return K053260_0_r(machine,2 + offset); | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | static TIMER_CALLBACK( nmi_callback ) |
| r1877 | r1878 | |
| 127 | 127 | |
| 128 | 128 | static WRITE8_HANDLER( sound_arm_nmi_w ) |
| 129 | 129 | { |
| 130 | cpunum_set_input_line( | |
| 130 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE); | |
| 131 | 131 | timer_set(ATTOTIME_IN_USEC(5), NULL,0,nmi_callback); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | static WRITE16_HANDLER( sound_irq_w ) |
| 135 | 135 | { |
| 136 | cpunum_set_input_line( | |
| 136 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | // Check the routine at 7f30 in the ead version. |
| r1877 | r1878 | |
| 257 | 257 | /* basic machine hardware */ |
| 258 | 258 | MDRV_CPU_ADD(M68000, 12000000) |
| 259 | 259 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 260 | MDRV_CPU_VBLANK_INT(asterix_interrupt | |
| 260 | MDRV_CPU_VBLANK_INT("main", asterix_interrupt | |
| 261 | 261 | |
| 262 | 262 | MDRV_CPU_ADD(Z80, 8000000) |
| 263 | 263 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 146 | 146 | //screen_flip_w(offset,data&1); /* bit 0 = screen flip, active high */ |
| 147 | 147 | break; |
| 148 | 148 | case 6: |
| 149 | tubep_background_romselect_w(offset,data); /* bit0 = 0->select roms: B1,B3,B5; bit0 = 1->select roms: B2,B4,B6 */ | |
| 149 | tubep_background_romselect_w(machine,offset,data); /* bit0 = 0->select roms: B1,B3,B5; bit0 = 1->select roms: B2,B4,B6 */ | |
| 150 | 150 | break; |
| 151 | 151 | case 7: |
| 152 | tubep_colorproms_A4_line_w(offset,data); /* bit0 = line A4 (color proms address) state */ | |
| 152 | tubep_colorproms_A4_line_w(machine,offset,data); /* bit0 = line A4 (color proms address) state */ | |
| 153 | 153 | break; |
| 154 | 154 | default: |
| 155 | 155 | break; |
| r1877 | r1878 | |
| 955 | 955 | |
| 956 | 956 | MDRV_CPU_ADD(M6802,6000000) /* ? MHz Xtal */ |
| 957 | 957 | MDRV_CPU_PROGRAM_MAP(nsc_map,0) |
| 958 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 958 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 959 | 959 | MACHINE_DRIVER_END |
| 960 | 960 | |
| 961 | 961 |
| r1877 | r1878 | |
|---|---|---|
| 190 | 190 | { |
| 191 | 191 | switch(offset&0xff) |
| 192 | 192 | { |
| 193 | case 0: YM2413_register_port_0_w(0,data); break; | |
| 194 | case 1: YM2413_data_port_0_w(0,data); break; | |
| 195 | case 2: DAC_0_data_w(0,data);break; | |
| 193 | case 0: YM2413_register_port_0_w(machine,0,data); break; | |
| 194 | case 1: YM2413_data_port_0_w(machine,0,data); break; | |
| 195 | case 2: DAC_0_data_w(machine,0,data);break; | |
| 196 | 196 | default: logerror("%x %x - %x\n",offset,data,activecpu_get_previouspc()); |
| 197 | 197 | } |
| 198 | 198 | } |
| r1877 | r1878 | |
| 347 | 347 | MDRV_CPU_ADD(Z80,5000000) /* 5 MHz */ |
| 348 | 348 | MDRV_CPU_PROGRAM_MAP(ppmast93_cpu1_map,0) |
| 349 | 349 | MDRV_CPU_IO_MAP(ppmast93_cpu1_io,0) |
| 350 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 350 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 351 | 351 | |
| 352 | 352 | MDRV_CPU_ADD(Z80,5000000) /* 5 MHz */ |
| 353 | 353 | MDRV_CPU_PROGRAM_MAP(ppmast93_cpu2_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 298 | 298 | static READ8_HANDLER( mrokumei_sound_io_r ) |
| 299 | 299 | { |
| 300 | 300 | if (sndbank & 4) |
| 301 | return(soundlatch_r(0)); | |
| 301 | return(soundlatch_r(machine,0)); | |
| 302 | 302 | else |
| 303 | 303 | return memory_region(REGION_CPU2)[0x10000 + offset + (sndbank & 1) * 0x10000]; |
| 304 | 304 | } |
| r1877 | r1878 | |
| 326 | 326 | |
| 327 | 327 | static WRITE8_HANDLER( mrokumei_sound_cmd_w ) |
| 328 | 328 | { |
| 329 | soundlatch_w(offset,data); | |
| 330 | cpunum_set_input_line(Machine, 1,0,HOLD_LINE); | |
| 329 | soundlatch_w(machine,offset,data); | |
| 330 | cpunum_set_input_line(machine, 1,0,HOLD_LINE); | |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | |
| r1877 | r1878 | |
| 373 | 373 | if (BIT(upd7807_portc,5) && !BIT(data,5)) /* write clock 1->0 */ |
| 374 | 374 | { |
| 375 | 375 | if (BIT(data,3)) |
| 376 | YM2203_write_port_0_w(0,upd7807_porta); | |
| 376 | YM2203_write_port_0_w(machine,0,upd7807_porta); | |
| 377 | 377 | else |
| 378 | YM2203_control_port_0_w(0,upd7807_porta); | |
| 378 | YM2203_control_port_0_w(machine,0,upd7807_porta); | |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | if (BIT(upd7807_portc,4) && !BIT(data,4)) /* read clock 1->0 */ |
| 382 | 382 | { |
| 383 | 383 | if (BIT(data,3)) |
| 384 | upd7807_porta = YM2203_read_port_0_r(0); | |
| 384 | upd7807_porta = YM2203_read_port_0_r(machine,0); | |
| 385 | 385 | else |
| 386 | upd7807_porta = YM2203_status_port_0_r(0); | |
| 386 | upd7807_porta = YM2203_status_port_0_r(machine,0); | |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | upd7807_portc = data; |
| r1877 | r1878 | |
| 393 | 393 | { |
| 394 | 394 | /* on reset, ports are set as input (high impedance), therefore 0xff output */ |
| 395 | 395 | reikaids_which=homedata_priority; |
| 396 | reikaids_upd7807_portc_w(0,0xff); | |
| 396 | reikaids_upd7807_portc_w(machine,0,0xff); | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | static READ8_HANDLER( reikaids_io_r ) |
| r1877 | r1878 | |
| 529 | 529 | coin_counter_w(0,~data & 0x80); |
| 530 | 530 | |
| 531 | 531 | if (BIT(upd7807_portc,5) && !BIT(data,5)) /* clock 1->0 */ |
| 532 | SN76496_0_w(0,upd7807_porta); | |
| 532 | SN76496_0_w(machine,0,upd7807_porta); | |
| 533 | 533 | |
| 534 | 534 | upd7807_portc = data; |
| 535 | 535 | } |
| r1877 | r1878 | |
| 537 | 537 | static MACHINE_RESET( pteacher_upd7807 ) |
| 538 | 538 | { |
| 539 | 539 | /* on reset, ports are set as input (high impedance), therefore 0xff output */ |
| 540 | pteacher_upd7807_portc_w(0,0xff); | |
| 540 | pteacher_upd7807_portc_w(machine,0,0xff); | |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | |
| r1877 | r1878 | |
| 1262 | 1262 | /* basic machine hardware */ |
| 1263 | 1263 | MDRV_CPU_ADD(M6809, 16000000/4) /* 4MHz ? */ |
| 1264 | 1264 | MDRV_CPU_PROGRAM_MAP(mrokumei_readmem,mrokumei_writemem) |
| 1265 | MDRV_CPU_VBLANK_INT(homedata_irq | |
| 1265 | MDRV_CPU_VBLANK_INT("main", homedata_irq | |
| 1266 | 1266 | |
| 1267 | 1267 | MDRV_CPU_ADD(Z80, 16000000/4) /* 4MHz ? */ |
| 1268 | 1268 | /* audio CPU */ |
| r1877 | r1878 | |
| 1319 | 1319 | /* basic machine hardware */ |
| 1320 | 1320 | MDRV_CPU_ADD(M6809, 16000000/4) /* 4MHz ? */ |
| 1321 | 1321 | MDRV_CPU_PROGRAM_MAP(reikaids_readmem,reikaids_writemem) |
| 1322 | MDRV_CPU_VBLANK_INT(homedata_irq | |
| 1322 | MDRV_CPU_VBLANK_INT("main", homedata_irq | |
| 1323 | 1323 | |
| 1324 | 1324 | MDRV_CPU_ADD(UPD7807, 8000000) /* ??? MHz (max speed for the 7807 is 12MHz) */ |
| 1325 | 1325 | MDRV_CPU_CONFIG(upd_config) |
| 1326 | 1326 | MDRV_CPU_PROGRAM_MAP(reikaids_upd7807_readmem,reikaids_upd7807_writemem) |
| 1327 | 1327 | MDRV_CPU_IO_MAP(reikaids_upd7807_readport,reikaids_upd7807_writeport) |
| 1328 | MDRV_CPU_VBLANK_INT(upd7807_irq | |
| 1328 | MDRV_CPU_VBLANK_INT("main", upd7807_irq | |
| 1329 | 1329 | |
| 1330 | 1330 | MDRV_INTERLEAVE(500) // very high interleave required to sync for startup tests |
| 1331 | 1331 | |
| r1877 | r1878 | |
| 1369 | 1369 | /* basic machine hardware */ |
| 1370 | 1370 | MDRV_CPU_ADD(M6809, 16000000/4) /* 4MHz ? */ |
| 1371 | 1371 | MDRV_CPU_PROGRAM_MAP(pteacher_readmem,pteacher_writemem) |
| 1372 | MDRV_CPU_VBLANK_INT(homedata_irq | |
| 1372 | MDRV_CPU_VBLANK_INT("main", homedata_irq | |
| 1373 | 1373 | |
| 1374 | 1374 | MDRV_CPU_ADD_TAG("sound", UPD7807, 9000000) /* 9MHz ? */ |
| 1375 | 1375 | MDRV_CPU_CONFIG(upd_config) |
| 1376 | 1376 | MDRV_CPU_PROGRAM_MAP(pteacher_upd7807_readmem,pteacher_upd7807_writemem) |
| 1377 | 1377 | MDRV_CPU_IO_MAP(pteacher_upd7807_readport,pteacher_upd7807_writeport) |
| 1378 | MDRV_CPU_VBLANK_INT(upd7807_irq | |
| 1378 | MDRV_CPU_VBLANK_INT("main", upd7807_irq | |
| 1379 | 1379 | |
| 1380 | 1380 | MDRV_INTERLEAVE(100) // should be enough |
| 1381 | 1381 |
| r1877 | r1878 | |
|---|---|---|
| 126 | 126 | ***************************************************************************/ |
| 127 | 127 | |
| 128 | 128 | #include "driver.h" |
| 129 | #include "deprecat.h" | |
| 129 | 130 | #include "exidy.h" |
| 130 | 131 | #include "targ.h" |
| 131 | 132 | #include "machine/6821pia.h" |
| r1877 | r1878 | |
| 782 | 783 | |
| 783 | 784 | /* basic machine hardware */ |
| 784 | 785 | MDRV_CPU_ADD_TAG("main", M6502, EXIDY_CPU_CLOCK) |
| 785 | MDRV_CPU_VBLANK_INT(exidy_vblank_interrupt | |
| 786 | MDRV_CPU_VBLANK_INT("main", exidy_vblank_interrupt | |
| 786 | 787 | |
| 787 | 788 | /* video hardware */ |
| 788 | 789 | MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) |
| r1877 | r1878 | |
| 862 | 863 | /* basic machine hardware */ |
| 863 | 864 | MDRV_IMPORT_FROM(venture) |
| 864 | 865 | MDRV_CPU_MODIFY("main") |
| 865 | MDRV_CPU_VBLANK_INT(teetert_vblank_interrupt,10) | |
| 866 | MDRV_CPU_VBLANK_INT_HACK(teetert_vblank_interrupt,10) | |
| 866 | 867 | MACHINE_DRIVER_END |
| 867 | 868 | |
| 868 | 869 | |
| r1877 | r1878 | |
| 1412 | 1413 | exidy_video_config(0x04, 0x04, TRUE); |
| 1413 | 1414 | |
| 1414 | 1415 | /* reset the ROM bank */ |
| 1415 | fax_bank_select_w(0,0); | |
| 1416 | fax_bank_select_w(machine,0,0); | |
| 1416 | 1417 | } |
| 1417 | 1418 | |
| 1418 | 1419 |
| r1877 | r1878 | |
|---|---|---|
| 292 | 292 | /* basic machine hardware */ |
| 293 | 293 | MDRV_CPU_ADD(Z80,12000000/4) /* 3.0MHz */ |
| 294 | 294 | MDRV_CPU_PROGRAM_MAP(map1,0) |
| 295 | MDRV_CPU_VBLANK_INT(xxmissio_interrupt_m | |
| 295 | MDRV_CPU_VBLANK_INT("main", xxmissio_interrupt_m | |
| 296 | 296 | |
| 297 | 297 | MDRV_CPU_ADD(Z80,12000000/4) /* 3.0MHz */ |
| 298 | 298 | MDRV_CPU_PROGRAM_MAP(map2,0) |
| 299 | MDRV_CPU_VBLANK_INT(xxmissio_interrupt_s,2) | |
| 299 | MDRV_CPU_VBLANK_INT_HACK(xxmissio_interrupt_s,2) | |
| 300 | 300 | |
| 301 | 301 | MDRV_INTERLEAVE(100) |
| 302 | 302 |
| r1877 | r1878 | |
|---|---|---|
| 62 | 62 | switch (offset) |
| 63 | 63 | { |
| 64 | 64 | case 1: |
| 65 | soundlatch_w(1,data&0xff); | |
| 66 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 65 | soundlatch_w(machine,1,data&0xff); | |
| 66 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 67 | 67 | break; |
| 68 | 68 | |
| 69 | 69 | default: |
| r1877 | r1878 | |
| 430 | 430 | static MACHINE_DRIVER_START( mugsmash ) |
| 431 | 431 | MDRV_CPU_ADD(M68000, 12000000) |
| 432 | 432 | MDRV_CPU_PROGRAM_MAP(mugsmash_readmem,mugsmash_writemem) |
| 433 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 433 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 434 | 434 | |
| 435 | 435 | MDRV_CPU_ADD(Z80, 4000000) |
| 436 | 436 | /* audio CPU */ /* Guess */ |
| r1877 | r1878 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | static WRITE8_HANDLER( pcktgal_sound_w ) |
| 48 | 48 | { |
| 49 | soundlatch_w(0,data); | |
| 50 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 49 | soundlatch_w(machine,0,data); | |
| 50 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | static int msm5205next; |
| r1877 | r1878 | |
| 239 | 239 | /* basic machine hardware */ |
| 240 | 240 | MDRV_CPU_ADD(M6502, 2000000) |
| 241 | 241 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 242 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 242 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 243 | 243 | |
| 244 | 244 | MDRV_CPU_ADD(M6502, 1500000) |
| 245 | 245 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 268 | 268 | MDRV_CPU_ADD(Z80, 5000000/1) /* 5.00 MHz ?? */ |
| 269 | 269 | MDRV_CPU_PROGRAM_MAP(readmem_hyhoo, writemem_hyhoo) |
| 270 | 270 | MDRV_CPU_IO_MAP(readport_hyhoo, writeport_hyhoo) |
| 271 | MDRV_CPU_VBLANK_INT(nb1413m3_interrupt | |
| 271 | MDRV_CPU_VBLANK_INT("main", nb1413m3_interrupt | |
| 272 | 272 | |
| 273 | 273 | MDRV_MACHINE_RESET(nb1413m3) |
| 274 | 274 | MDRV_NVRAM_HANDLER(nb1413m3) |
| r1877 | r1878 | |
|---|---|---|
| 1518 | 1518 | MDRV_CPU_ADD(R4600BE, MASTER_CLOCK) // actually R4300 |
| 1519 | 1519 | MDRV_CPU_CONFIG(config) |
| 1520 | 1520 | MDRV_CPU_PROGRAM_MAP(hng_map, 0) |
| 1521 | MDRV_CPU_VBLANK_INT(irq_start,3) | |
| 1521 | MDRV_CPU_VBLANK_INT_HACK(irq_start,3) | |
| 1522 | 1522 | |
| 1523 | 1523 | MDRV_CPU_ADD(V30,8000000) // v53, 16? mhz! |
| 1524 | 1524 | MDRV_CPU_PROGRAM_MAP(hng_sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | static WRITE8_HANDLER( solomon_sh_command_w ) |
| 26 | 26 | { |
| 27 | soundlatch_w(offset,data); | |
| 28 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 27 | soundlatch_w(machine,offset,data); | |
| 28 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /* this is checked on the title screen and when you reach certain scores in the game |
| r1877 | r1878 | |
| 206 | 206 | /* basic machine hardware */ |
| 207 | 207 | MDRV_CPU_ADD(Z80, 4000000) /* 4.0 MHz (?????) */ |
| 208 | 208 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 209 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 209 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 210 | 210 | |
| 211 | 211 | MDRV_CPU_ADD(Z80, 3072000) |
| 212 | 212 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 213 | 213 | MDRV_CPU_IO_MAP(sound_portmap,0) |
| 214 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) /* ??? */ | |
| 214 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) /* ??? */ | |
| 215 | 215 | /* NMIs are caused by the main CPU */ |
| 216 | 216 | |
| 217 | 217 | /* video hardware */ |
| r1877 | r1878 | |
|---|---|---|
| 278 | 278 | if (ACCESSING_MSW32) |
| 279 | 279 | { |
| 280 | 280 | //logerror("%08x write soundcmd %08x (%08x)\n",activecpu_get_pc(),data,mem_mask); |
| 281 | soundlatch_word_w(0,data >> 16,0); | |
| 281 | soundlatch_word_w(machine,0,data >> 16,0); | |
| 282 | 282 | sndpending = 1; |
| 283 | 283 | cpunum_set_input_line(Machine, 1,2,HOLD_LINE); |
| 284 | 284 | /* spin for a while to let the sound CPU read the command */ |
| r1877 | r1878 | |
| 290 | 290 | { |
| 291 | 291 | // logerror("%06x read soundcmd\n",activecpu_get_pc()); |
| 292 | 292 | sndpending = 0; |
| 293 | return soundlatch_word_r(offset,mem_mask); | |
| 293 | return soundlatch_word_r(machine,offset,mem_mask); | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | |
| r1877 | r1878 | |
| 534 | 534 | /* basic machine hardware */ |
| 535 | 535 | MDRV_CPU_ADD(M68EC020, 50000000/2) /* 25 MHz */ |
| 536 | 536 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 537 | MDRV_CPU_VBLANK_INT(irq3_line_hold | |
| 537 | MDRV_CPU_VBLANK_INT("main", irq3_line_hold | |
| 538 | 538 | |
| 539 | 539 | MDRV_CPU_ADD(M68000, 32000000/2) /* 16 MHz */ |
| 540 | 540 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 309 | 309 | |
| 310 | 310 | static WRITE8_HANDLER( glad_cpu_sound_command_w ) |
| 311 | 311 | { |
| 312 | soundlatch_w(0,data); | |
| 313 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, ASSERT_LINE); | |
| 312 | soundlatch_w(machine,0,data); | |
| 313 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, ASSERT_LINE); | |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | static READ8_HANDLER( glad_cpu_sound_command_r ) |
| 317 | 317 | { |
| 318 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 319 | return soundlatch_r(0); | |
| 318 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, CLEAR_LINE); | |
| 319 | return soundlatch_r(machine,0); | |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | static WRITE8_HANDLER( gladiatr_flipscreen_w ) |
| r1877 | r1878 | |
| 683 | 683 | MDRV_CPU_ADD(Z80, XTAL_12MHz/2) /* verified on pcb */ |
| 684 | 684 | MDRV_CPU_PROGRAM_MAP(ppking_cpu1_map,0) |
| 685 | 685 | MDRV_CPU_IO_MAP(ppking_cpu1_io,0) |
| 686 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 686 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 687 | 687 | |
| 688 | 688 | MDRV_CPU_ADD(Z80, XTAL_12MHz/4) /* verified on pcb */ |
| 689 | 689 | MDRV_CPU_PROGRAM_MAP(cpu2_map,0) |
| 690 | 690 | MDRV_CPU_IO_MAP(ppking_cpu2_io,0) |
| 691 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 691 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 692 | 692 | |
| 693 | 693 | MDRV_CPU_ADD(M6809, XTAL_12MHz/16) /* verified on pcb */ |
| 694 | 694 | /* audio CPU */ |
| r1877 | r1878 | |
| 733 | 733 | MDRV_CPU_ADD(Z80, XTAL_12MHz/2) /* verified on pcb */ |
| 734 | 734 | MDRV_CPU_PROGRAM_MAP(gladiatr_cpu1_map,0) |
| 735 | 735 | MDRV_CPU_IO_MAP(gladiatr_cpu1_io,0) |
| 736 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 736 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 737 | 737 | |
| 738 | 738 | MDRV_CPU_ADD(Z80, XTAL_12MHz/4) /* verified on pcb */ |
| 739 | 739 | MDRV_CPU_PROGRAM_MAP(cpu2_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 396 | 396 | MDRV_CPU_ADD(Z80,8000000) /* ? */ |
| 397 | 397 | MDRV_CPU_PROGRAM_MAP(imolagp_master,0) |
| 398 | 398 | MDRV_CPU_IO_MAP(readport_master,0) |
| 399 | MDRV_CPU_VBLANK_INT(master_interrupt,4) | |
| 399 | MDRV_CPU_VBLANK_INT_HACK(master_interrupt,4) | |
| 400 | 400 | |
| 401 | 401 | MDRV_CPU_ADD(Z80,8000000) /* ? */ |
| 402 | 402 | MDRV_CPU_PROGRAM_MAP(imolagp_slave,0) |
| 403 | 403 | MDRV_CPU_IO_MAP(readport_slave,0) |
| 404 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 404 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 405 | 405 | |
| 406 | 406 | MDRV_INTERLEAVE(100) |
| 407 | 407 |
| r1877 | r1878 | |
|---|---|---|
| 92 | 92 | |
| 93 | 93 | static READ16_HANDLER( puckpkmn_YM3438_r ) |
| 94 | 94 | { |
| 95 | return YM3438_status_port_0_A_r(0) << 8; | |
| 95 | return YM3438_status_port_0_A_r(machine, 0) << 8; | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | static WRITE16_HANDLER( puckpkmn_YM3438_w ) |
| r1877 | r1878 | |
| 100 | 100 | switch (offset) |
| 101 | 101 | { |
| 102 | 102 | case 0: |
| 103 | if (ACCESSING_MSB) YM3438_control_port_0_A_w (0, (data >> 8) & 0xff); | |
| 104 | else YM3438_data_port_0_A_w (0, (data >> 0) & 0xff); | |
| 103 | if (ACCESSING_MSB) YM3438_control_port_0_A_w (machine, 0, (data >> 8) & 0xff); | |
| 104 | else YM3438_data_port_0_A_w (machine, 0, (data >> 0) & 0xff); | |
| 105 | 105 | break; |
| 106 | 106 | case 1: |
| 107 | if (ACCESSING_MSB) YM3438_control_port_0_B_w (0, (data >> 8) & 0xff); | |
| 108 | else YM3438_data_port_0_B_w (0, (data >> 0) & 0xff); | |
| 107 | if (ACCESSING_MSB) YM3438_control_port_0_B_w (machine, 0, (data >> 8) & 0xff); | |
| 108 | else YM3438_data_port_0_B_w (machine, 0, (data >> 0) & 0xff); | |
| 109 | 109 | break; |
| 110 | 110 | } |
| 111 | 111 | } |
| r1877 | r1878 | |
| 158 | 158 | /* basic machine hardware */ |
| 159 | 159 | MDRV_CPU_ADD_TAG("main",M68000, MASTER_CLOCK/7) /*???*/ |
| 160 | 160 | MDRV_CPU_PROGRAM_MAP(puckpkmn_readmem,puckpkmn_writemem) |
| 161 | MDRV_CPU_VBLANK_INT(genesis_vblank_interrupt | |
| 161 | MDRV_CPU_VBLANK_INT("main", genesis_vblank_interrupt | |
| 162 | 162 | |
| 163 | 163 | MDRV_MACHINE_START(genesis) |
| 164 | 164 | MDRV_MACHINE_RESET(genesis) |
| r1877 | r1878 | |
|---|---|---|
| 84 | 84 | |
| 85 | 85 | static READ8_HANDLER( spc_ram_100_r ) |
| 86 | 86 | { |
| 87 | return spc_ram_r(offset + 0x100); | |
| 87 | return spc_ram_r(machine, offset + 0x100); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | static WRITE8_HANDLER( spc_ram_100_w ) |
| 91 | 91 | { |
| 92 | spc_ram_w(offset + 0x100, data); | |
| 92 | spc_ram_w(machine, offset + 0x100, data); | |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | static ADDRESS_MAP_START( spc_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 214 | 214 | MDRV_CPU_ADD_TAG("sound", SPC700, 2048000/2) /* 2.048 Mhz, but internal divider */ |
| 215 | 215 | /* audio CPU */ |
| 216 | 216 | MDRV_CPU_PROGRAM_MAP(spc_mem, 0) |
| 217 | MDRV_CPU_VBLANK_INT(NULL, 0) | |
| 218 | 217 | |
| 219 | 218 | MDRV_INTERLEAVE(400) |
| 220 | 219 |
| r1877 | r1878 | |
|---|---|---|
| 98 | 98 | /* bit 1 is EEPROM ready */ |
| 99 | 99 | /* bit 3 is service button */ |
| 100 | 100 | /* bits 4-7 are DIP switches */ |
| 101 | res = EEPROM_read_bit() | input_port_1_r(0); | |
| 101 | res = EEPROM_read_bit() | input_port_1_r(machine,0); | |
| 102 | 102 | |
| 103 | 103 | if (init_eeprom_count) |
| 104 | 104 | { |
| r1877 | r1878 | |
| 202 | 202 | { |
| 203 | 203 | if((data & 0x00ff0000) == 0) { |
| 204 | 204 | data &= 0xff; |
| 205 | soundlatch_w(0, data); | |
| 205 | soundlatch_w(machine, 0, data); | |
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | static WRITE16_HANDLER( sound_cmd2_w ) |
| 210 | 210 | { |
| 211 | 211 | if((data & 0x00ff0000) == 0) { |
| 212 | soundlatch2_w(0, data & 0xff); | |
| 212 | soundlatch2_w(machine, 0, data & 0xff); | |
| 213 | 213 | } |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | static WRITE16_HANDLER( sound_irq_w ) |
| 217 | 217 | { |
| 218 | cpunum_set_input_line( | |
| 218 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | static READ16_HANDLER( sound_status_r ) |
| 222 | 222 | { |
| 223 | return soundlatch3_r(0); | |
| 223 | return soundlatch3_r(machine,0); | |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | static WRITE8_HANDLER( sound_bankswitch_w ) |
| r1877 | r1878 | |
| 240 | 240 | else |
| 241 | 241 | { |
| 242 | 242 | offset = (offset & 0x0007) | ((offset & 0x7f80) >> 4); |
| 243 | return K053247_word_r(offset,mem_mask); | |
| 243 | return K053247_word_r(machine,offset,mem_mask); | |
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | |
| r1877 | r1878 | |
| 252 | 252 | { |
| 253 | 253 | offset = (offset & 0x0007) | ((offset & 0x7f80) >> 4); |
| 254 | 254 | |
| 255 | K053247_word_w(offset,data,mem_mask); | |
| 255 | K053247_word_w(machine,offset,data,mem_mask); | |
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | |
| r1877 | r1878 | |
| 261 | 261 | |
| 262 | 262 | static READ16_HANDLER( player1_r ) // players 1 and 3 |
| 263 | 263 | { |
| 264 | return input_port_2_r(0) | (input_port_4_r(0)<<8); | |
| 264 | return input_port_2_r(machine,0) | (input_port_4_r(machine,0)<<8); | |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | static READ16_HANDLER( player2_r ) // players 2 and 4 |
| 268 | 268 | { |
| 269 | return input_port_3_r(0) | (input_port_5_r(0)<<8); | |
| 269 | return input_port_3_r(machine,0) | (input_port_5_r(machine,0)<<8); | |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | static WRITE16_HANDLER( moo_prot_w ) |
| r1877 | r1878 | |
| 629 | 629 | /* basic machine hardware */ |
| 630 | 630 | MDRV_CPU_ADD_TAG("main", M68000, 16000000) |
| 631 | 631 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 632 | MDRV_CPU_VBLANK_INT(moo_interrupt | |
| 632 | MDRV_CPU_VBLANK_INT("main", moo_interrupt | |
| 633 | 633 | |
| 634 | 634 | MDRV_CPU_ADD_TAG("sound", Z80, 8000000) |
| 635 | 635 | /* audio CPU */ |
| r1877 | r1878 | |
| 673 | 673 | /* basic machine hardware */ |
| 674 | 674 | MDRV_CPU_ADD_TAG("main", M68000, 16100000) |
| 675 | 675 | MDRV_CPU_PROGRAM_MAP(readmembl,writemembl) |
| 676 | MDRV_CPU_VBLANK_INT(moobl_interrupt | |
| 676 | MDRV_CPU_VBLANK_INT("main", moobl_interrupt | |
| 677 | 677 | |
| 678 | 678 | MDRV_MACHINE_START(moo) |
| 679 | 679 | MDRV_MACHINE_RESET(moo) |
| r1877 | r1878 | |
|---|---|---|
| 123 | 123 | /* basic machine hardware */ |
| 124 | 124 | MDRV_CPU_ADD(M68000, 16000000 ) //?? |
| 125 | 125 | MDRV_CPU_PROGRAM_MAP(stepstag_readmem,stepstag_writemem) |
| 126 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 126 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 127 | 127 | |
| 128 | 128 | MDRV_CPU_ADD(M68000, 16000000 ) //?? |
| 129 | 129 | MDRV_CPU_PROGRAM_MAP(stepstag_sub_readmem,stepstag_sub_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "deprecat.h" | |
| 21 | 22 | #include "sound/2203intf.h" |
| 22 | 23 | |
| 23 | 24 | VIDEO_START( goindol ); |
| r1877 | r1878 | |
| 272 | 273 | /* basic machine hardware */ |
| 273 | 274 | MDRV_CPU_ADD(Z80, 6000000) /* 6 MHz (?) */ |
| 274 | 275 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 275 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 276 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 276 | 277 | |
| 277 | 278 | MDRV_CPU_ADD(Z80, 4000000) |
| 278 | 279 | /* audio CPU */ |
| 279 | 280 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 280 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) | |
| 281 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) | |
| 281 | 282 | |
| 282 | 283 | /* video hardware */ |
| 283 | 284 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | **********************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "deprecat.h" | |
| 13 | 14 | #include "machine/eeprom.h" |
| 14 | 15 | #include "sound/okim6295.h" |
| 15 | 16 | #include "eolithsp.h" |
| r1877 | r1878 | |
| 165 | 166 | static MACHINE_DRIVER_START( eolith16 ) |
| 166 | 167 | MDRV_CPU_ADD(E116T, 60000000) /* no internal multiplier */ |
| 167 | 168 | MDRV_CPU_PROGRAM_MAP(eolith16_map,0) |
| 168 | MDRV_CPU_VBLANK_INT(eolith_speedup,262) | |
| 169 | MDRV_CPU_VBLANK_INT_HACK(eolith_speedup,262) | |
| 169 | 170 | |
| 170 | 171 | MDRV_NVRAM_HANDLER(eolith16_eeprom) |
| 171 | 172 |
| r1877 | r1878 | |
|---|---|---|
| 107 | 107 | static UINT8 *empty_ram; |
| 108 | 108 | static UINT8 *shared_ram; |
| 109 | 109 | |
| 110 | static read8_handler porte0_r; | |
| 111 | static read8_handler porte1_r; | |
| 112 | static read8_handler portf0_r; | |
| 113 | static read8_handler portf1_r; | |
| 110 | static read8_machine_func porte0_r; | |
| 111 | static read8_machine_func porte1_r; | |
| 112 | static read8_machine_func portf0_r; | |
| 113 | static read8_machine_func portf1_r; | |
| 114 | 114 | |
| 115 | 115 | static void palette_notifier(int addr) |
| 116 | 116 | { |
| r1877 | r1878 | |
| 446 | 446 | |
| 447 | 447 | static READ8_HANDLER( portA_r ) |
| 448 | 448 | { |
| 449 | if (extport == 0) return porte0_r(0); | |
| 450 | else return porte1_r(0); | |
| 449 | if (extport == 0) return porte0_r(machine,0); | |
| 450 | else return porte1_r(machine,0); | |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | static READ8_HANDLER( portB_r ) |
| 454 | 454 | { |
| 455 | if (extport == 0) return portf0_r(0); | |
| 456 | else return portf1_r(0); | |
| 455 | if (extport == 0) return portf0_r(machine,0); | |
| 456 | else return portf1_r(machine,0); | |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | static READ8_HANDLER( ym2203_data0_r ) |
| 460 | 460 | { |
| 461 | 461 | extport = 0; |
| 462 | return YM2203_read_port_0_r(offset); | |
| 462 | return YM2203_read_port_0_r(machine,offset); | |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | static READ8_HANDLER( ym2203_data1_r ) |
| 466 | 466 | { |
| 467 | 467 | extport = 1; |
| 468 | return YM2203_read_port_0_r(offset); | |
| 468 | return YM2203_read_port_0_r(machine,offset); | |
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | static const UINT8 *mcu_reply; |
| r1877 | r1878 | |
| 533 | 533 | switch(mux_ctrl) |
| 534 | 534 | { |
| 535 | 535 | case 0: |
| 536 | return input_port_0_r(0); | |
| 536 | return input_port_0_r(machine,0); | |
| 537 | 537 | case 1: |
| 538 | return input_port_1_r(0); | |
| 538 | return input_port_1_r(machine,0); | |
| 539 | 539 | case 2: |
| 540 | return input_port_2_r(0); | |
| 540 | return input_port_2_r(machine,0); | |
| 541 | 541 | case 3: |
| 542 | return input_port_3_r(0); | |
| 542 | return input_port_3_r(machine,0); | |
| 543 | 543 | case 7: |
| 544 | return input_port_4_r(0); | |
| 544 | return input_port_4_r(machine,0); | |
| 545 | 545 | default: |
| 546 | 546 | logerror("Mux read from unknown port %d (%04x)\n", mux_ctrl, activecpu_get_pc()); |
| 547 | 547 | return 0xff; |
| r1877 | r1878 | |
| 553 | 553 | switch(mux_ctrl) |
| 554 | 554 | { |
| 555 | 555 | case 4: |
| 556 | control2_w(0, data); | |
| 556 | control2_w(machine,0, data); | |
| 557 | 557 | break; |
| 558 | 558 | default: |
| 559 | 559 | logerror("Mux write to unknown port %d, %02x (%04x)\n", mux_ctrl, data, activecpu_get_pc()); |
| r1877 | r1878 | |
| 2285 | 2285 | /* basic machine hardware */ |
| 2286 | 2286 | MDRV_CPU_ADD_TAG("cpu1", Z80, 13330560/2) /* verified freq on pin122 of TC0090LVC cpu */ |
| 2287 | 2287 | MDRV_CPU_PROGRAM_MAP(fhawk_readmem,fhawk_writemem) |
| 2288 | MDRV_CPU_VBLANK_INT(vbl_interrupt,3) | |
| 2288 | MDRV_CPU_VBLANK_INT_HACK(vbl_interrupt,3) | |
| 2289 | 2289 | |
| 2290 | 2290 | MDRV_CPU_ADD_TAG("sound", Z80, 4000000) /* verified on pcb */ |
| 2291 | 2291 | /* audio CPU */ |
| r1877 | r1878 | |
| 2293 | 2293 | |
| 2294 | 2294 | MDRV_CPU_ADD_TAG("cpu2", Z80, 12000000/3) /* verified on pcb */ |
| 2295 | 2295 | MDRV_CPU_PROGRAM_MAP(fhawk_2_readmem,fhawk_2_writemem) |
| 2296 | MDRV_CPU_VBLANK_INT(irq0_line_hold,3) /* fixes slow down problems */ | |
| 2296 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,3) /* fixes slow down problems */ | |
| 2297 | 2297 | |
| 2298 | 2298 | MDRV_INTERLEAVE(100) |
| 2299 | 2299 | |
| r1877 | r1878 | |
| 2385 | 2385 | /* basic machine hardware */ |
| 2386 | 2386 | MDRV_CPU_ADD(Z80, 13330560/2) /* verified freq on pin122 of TC0090LVC cpu */ |
| 2387 | 2387 | MDRV_CPU_PROGRAM_MAP(kurikint_readmem,kurikint_writemem) |
| 2388 | MDRV_CPU_VBLANK_INT(vbl_interrupt,3) | |
| 2388 | MDRV_CPU_VBLANK_INT_HACK(vbl_interrupt,3) | |
| 2389 | 2389 | |
| 2390 | 2390 | MDRV_CPU_ADD( Z80, 12000000/3) /* verified on pcb */ |
| 2391 | 2391 | MDRV_CPU_PROGRAM_MAP(kurikint_2_readmem,kurikint_2_writemem) |
| 2392 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 2392 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 2393 | 2393 | |
| 2394 | 2394 | MDRV_INTERLEAVE(100) |
| 2395 | 2395 | |
| r1877 | r1878 | |
| 2436 | 2436 | /* basic machine hardware */ |
| 2437 | 2437 | MDRV_CPU_ADD_TAG("main", Z80, 13330560/2) /* verified freq on pin122 of TC0090LVC cpu */ |
| 2438 | 2438 | MDRV_CPU_PROGRAM_MAP(plotting_readmem,plotting_writemem) |
| 2439 | MDRV_CPU_VBLANK_INT(vbl_interrupt,3) | |
| 2439 | MDRV_CPU_VBLANK_INT_HACK(vbl_interrupt,3) | |
| 2440 | 2440 | |
| 2441 | 2441 | MDRV_MACHINE_RESET(plotting) |
| 2442 | 2442 | |
| r1877 | r1878 | |
| 2515 | 2515 | /* basic machine hardware */ |
| 2516 | 2516 | MDRV_CPU_ADD(Z80, 13330560/2) /* not verfied */ |
| 2517 | 2517 | MDRV_CPU_PROGRAM_MAP(evilston_readmem,evilston_writemem) |
| 2518 | MDRV_CPU_VBLANK_INT(vbl_interrupt,3) | |
| 2518 | MDRV_CPU_VBLANK_INT_HACK(vbl_interrupt,3) | |
| 2519 | 2519 | |
| 2520 | 2520 | MDRV_CPU_ADD(Z80, 12000000/3) /* not verified */ |
| 2521 | 2521 | MDRV_CPU_PROGRAM_MAP(evilston_2_readmem,evilston_2_writemem) |
| 2522 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 2522 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 2523 | 2523 | |
| 2524 | 2524 | MDRV_INTERLEAVE(100) |
| 2525 | 2525 |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | #include "sound/dac.h" |
| 62 | 62 | |
| 63 | 63 | |
| 64 | void konami1_decode_cpu2(void); | |
| 64 | extern UINT8 *gyruss_videoram; | |
| 65 | extern UINT8 *gyruss_colorram; | |
| 66 | extern UINT8 *gyruss_spriteram; | |
| 67 | extern UINT8 *gyruss_flipscreen; | |
| 65 | 68 | |
| 66 | WRITE8_HANDLER( gyruss_flipscreen_w ); | |
| 69 | void konami1_decode_cpu2(void); | |
| 70 | WRITE8_HANDLER( gyruss_spriteram_w ); | |
| 67 | 71 | READ8_HANDLER( gyruss_scanline_r ); |
| 68 | 72 | VIDEO_START( gyruss ); |
| 69 | 73 | PALETTE_INIT( gyruss ); |
| 70 | 74 | VIDEO_UPDATE( gyruss ); |
| 71 | INTERRUPT_GEN( gyruss_6809_interrupt ); | |
| 72 | 75 | |
| 73 | ||
| 74 | 76 | READ8_HANDLER( gyruss_portA_r ); |
| 75 | 77 | WRITE8_HANDLER( gyruss_filter0_w ); |
| 76 | 78 | WRITE8_HANDLER( gyruss_filter1_w ); |
| r1877 | r1878 | |
| 78 | 80 | WRITE8_HANDLER( gyruss_i8039_irq_w ); |
| 79 | 81 | |
| 80 | 82 | |
| 81 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 82 | AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM) | |
| 83 | AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM) | |
| 84 | AM_RANGE(0x9000, 0x9fff) AM_READ(MRA8_RAM) | |
| 85 | AM_RANGE(0xa000, 0xa7ff) AM_READ(MRA8_RAM) AM_SHARE(1) | |
| 86 | AM_RANGE(0xc000, 0xc000) AM_READ(input_port_4_r) /* DSW1 */ | |
| 87 | AM_RANGE(0xc080, 0xc080) AM_READ(input_port_0_r) /* IN0 */ | |
| 88 | AM_RANGE(0xc0a0, 0xc0a0) AM_READ(input_port_1_r) /* IN1 */ | |
| 89 | AM_RANGE(0xc0c0, 0xc0c0) AM_READ(input_port_2_r) /* IN2 */ | |
| 90 | AM_RANGE(0xc0e0, 0xc0e0) AM_READ(input_port_3_r) /* DSW0 */ | |
| 91 | AM_RANGE(0xc100, 0xc100) AM_READ(input_port_5_r) /* DSW2 */ | |
| 83 | static ADDRESS_MAP_START( main_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 84 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 85 | AM_RANGE(0x8000, 0x83ff) AM_RAM AM_BASE(&gyruss_colorram) | |
| 86 | AM_RANGE(0x8400, 0x87ff) AM_RAM AM_BASE(&gyruss_videoram) | |
| 87 | AM_RANGE(0x9000, 0x9fff) AM_RAM | |
| 88 | AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_SHARE(1) | |
| 89 | AM_RANGE(0xc000, 0xc000) AM_READWRITE(input_port_4_r, MWA8_NOP) /* watchdog reset */ | |
| 90 | AM_RANGE(0xc080, 0xc080) AM_READWRITE(input_port_0_r, gyruss_sh_irqtrigger_w) | |
| 91 | AM_RANGE(0xc0a0, 0xc0a0) AM_READ(input_port_1_r) | |
| 92 | AM_RANGE(0xc0c0, 0xc0c0) AM_READ(input_port_2_r) | |
| 93 | AM_RANGE(0xc0e0, 0xc0e0) AM_READ(input_port_3_r) | |
| 94 | AM_RANGE(0xc100, 0xc100) AM_READWRITE(input_port_5_r, soundlatch_w) | |
| 95 | AM_RANGE(0xc180, 0xc180) AM_WRITE(interrupt_enable_w) | |
| 96 | AM_RANGE(0xc185, 0xc185) AM_WRITE(MWA8_RAM) AM_BASE(&gyruss_flipscreen) | |
| 92 | 97 | ADDRESS_MAP_END |
| 93 | 98 | |
| 94 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 95 | AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM) /* rom space+1 */ | |
| 96 | AM_RANGE(0x8000, 0x83ff) AM_WRITE(MWA8_RAM) AM_BASE(&colorram) | |
| 97 | AM_RANGE(0x8400, 0x87ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 98 | AM_RANGE(0x9000, 0x9fff) AM_WRITE(MWA8_RAM) | |
| 99 | AM_RANGE(0xa000, 0xa7ff) AM_WRITE(MWA8_RAM) AM_SHARE(1) | |
| 100 | AM_RANGE(0xc000, 0xc000) AM_WRITE(MWA8_NOP) /* watchdog reset */ | |
| 101 | AM_RANGE(0xc080, 0xc080) AM_WRITE(gyruss_sh_irqtrigger_w) | |
| 102 | AM_RANGE(0xc100, 0xc100) AM_WRITE(soundlatch_w) /* command to soundb */ | |
| 103 | AM_RANGE(0xc180, 0xc180) AM_WRITE(interrupt_enable_w) /* NMI enable */ | |
| 104 | AM_RANGE(0xc185, 0xc185) AM_WRITE(gyruss_flipscreen_w) | |
| 105 | ADDRESS_MAP_END | |
| 106 | ||
| 107 | static ADDRESS_MAP_START( m6809_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 99 | static ADDRESS_MAP_START( main_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 108 | 100 | AM_RANGE(0x0000, 0x0000) AM_READ(gyruss_scanline_r) |
| 109 | AM_RANGE(0x4000, 0x47ff) AM_READ(MRA8_RAM) | |
| 110 | AM_RANGE(0x6000, 0x67ff) AM_READ(MRA8_RAM) AM_SHARE(1) | |
| 111 | AM_RANGE(0xe000, 0xffff) AM_READ(MRA8_ROM) | |
| 112 | ADDRESS_MAP_END | |
| 113 | ||
| 114 | static ADDRESS_MAP_START( m6809_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 115 | 101 | AM_RANGE(0x2000, 0x2000) AM_WRITE(interrupt_enable_w) |
| 116 | AM_RANGE(0x4000, 0x47ff) AM_WRITE(MWA8_RAM) | |
| 117 | AM_RANGE(0x4040, 0x40ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 118 | AM_RANGE(0x6000, 0x67ff) AM_WRITE(MWA8_RAM) AM_SHARE(1) | |
| 119 | AM_RANGE(0xe000, 0xffff) AM_WRITE(MWA8_ROM) | |
| 102 | AM_RANGE(0x4000, 0x403f) AM_RAM | |
| 103 | AM_RANGE(0x4040, 0x40ff) AM_READWRITE(MRA8_RAM, gyruss_spriteram_w) AM_BASE(&gyruss_spriteram) | |
| 104 | AM_RANGE(0x4100, 0x47ff) AM_RAM | |
| 105 | AM_RANGE(0x6000, 0x67ff) AM_RAM AM_SHARE(1) | |
| 106 | AM_RANGE(0xe000, 0xffff) AM_ROM | |
| 120 | 107 | ADDRESS_MAP_END |
| 121 | 108 | |
| 122 | static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 123 | AM_RANGE(0x0000, 0x5fff) AM_READ(MRA8_ROM) /* rom soundboard */ | |
| 124 | AM_RANGE(0x6000, 0x63ff) AM_READ(MRA8_RAM) /* ram soundboard */ | |
| 109 | static ADDRESS_MAP_START( audio_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 110 | AM_RANGE(0x0000, 0x5fff) AM_ROM | |
| 111 | AM_RANGE(0x6000, 0x63ff) AM_RAM | |
| 125 | 112 | AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_r) |
| 126 | 113 | ADDRESS_MAP_END |
| 127 | 114 | |
| 128 | static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 129 | AM_RANGE(0x0000, 0x5fff) AM_WRITE(MWA8_ROM) /* rom soundboard */ | |
| 130 | AM_RANGE(0x6000, 0x63ff) AM_WRITE(MWA8_RAM) /* ram soundboard */ | |
| 131 | ADDRESS_MAP_END | |
| 132 | ||
| 133 | static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 ) | |
| 115 | static ADDRESS_MAP_START( audio_cpu1_io_map, ADDRESS_SPACE_IO, 8 ) | |
| 134 | 116 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 135 | AM_RANGE(0x01, 0x01) AM_READ(AY8910_read_port_0_r) | |
| 136 | AM_RANGE(0x05, 0x05) AM_READ(AY8910_read_port_1_r) | |
| 137 | AM_RANGE(0x09, 0x09) AM_READ(AY8910_read_port_2_r) | |
| 138 | AM_RANGE(0x0d, 0x0d) AM_READ(AY8910_read_port_3_r) | |
| 139 | AM_RANGE(0x11, 0x11) AM_READ(AY8910_read_port_4_r) | |
| 140 | ADDRESS_MAP_END | |
| 141 | ||
| 142 | static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 ) | |
| 143 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) | |
| 144 | 117 | AM_RANGE(0x00, 0x00) AM_WRITE(AY8910_control_port_0_w) |
| 118 | AM_RANGE(0x01, 0x01) AM_READ(AY8910_read_port_0_r) | |
| 145 | 119 | AM_RANGE(0x02, 0x02) AM_WRITE(AY8910_write_port_0_w) |
| 146 | 120 | AM_RANGE(0x04, 0x04) AM_WRITE(AY8910_control_port_1_w) |
| 121 | AM_RANGE(0x05, 0x05) AM_READ(AY8910_read_port_1_r) | |
| 147 | 122 | AM_RANGE(0x06, 0x06) AM_WRITE(AY8910_write_port_1_w) |
| 148 | 123 | AM_RANGE(0x08, 0x08) AM_WRITE(AY8910_control_port_2_w) |
| 124 | AM_RANGE(0x09, 0x09) AM_READ(AY8910_read_port_2_r) | |
| 149 | 125 | AM_RANGE(0x0a, 0x0a) AM_WRITE(AY8910_write_port_2_w) |
| 150 | 126 | AM_RANGE(0x0c, 0x0c) AM_WRITE(AY8910_control_port_3_w) |
| 127 | AM_RANGE(0x0d, 0x0d) AM_READ(AY8910_read_port_3_r) | |
| 151 | 128 | AM_RANGE(0x0e, 0x0e) AM_WRITE(AY8910_write_port_3_w) |
| 152 | 129 | AM_RANGE(0x10, 0x10) AM_WRITE(AY8910_control_port_4_w) |
| 130 | AM_RANGE(0x11, 0x11) AM_READ(AY8910_read_port_4_r) | |
| 153 | 131 | AM_RANGE(0x12, 0x12) AM_WRITE(AY8910_write_port_4_w) |
| 154 | 132 | AM_RANGE(0x14, 0x14) AM_WRITE(gyruss_i8039_irq_w) |
| 155 | 133 | AM_RANGE(0x18, 0x18) AM_WRITE(soundlatch2_w) |
| 156 | 134 | ADDRESS_MAP_END |
| 157 | 135 | |
| 158 | static ADDRESS_MAP_START( i8039_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 159 | AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_ROM) | |
| 136 | static ADDRESS_MAP_START( audio_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 137 | AM_RANGE(0x0000, 0x0fff) AM_ROM | |
| 160 | 138 | ADDRESS_MAP_END |
| 161 | 139 | |
| 162 | static ADDRESS_MAP_START( i8039_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 163 | AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_ROM) | |
| 164 | ADDRESS_MAP_END | |
| 165 | ||
| 166 | static ADDRESS_MAP_START( i8039_readport, ADDRESS_SPACE_IO, 8 ) | |
| 140 | static ADDRESS_MAP_START( audio_cpu2_io_map, ADDRESS_SPACE_IO, 8 ) | |
| 167 | 141 | AM_RANGE(0x00, 0xff) AM_READ(soundlatch2_r) |
| 168 | ADDRESS_MAP_END | |
| 169 | ||
| 170 | static ADDRESS_MAP_START( i8039_writeport, ADDRESS_SPACE_IO, 8 ) | |
| 171 | 142 | AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(DAC_0_data_w) |
| 172 | 143 | AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(MWA8_NOP) |
| 173 | 144 | ADDRESS_MAP_END |
| 174 | 145 | |
| 146 | ||
| 175 | 147 | #define GYRUSS_COMMON\ |
| 176 | 148 | PORT_START_TAG("IN0")\ |
| 177 | 149 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )\ |
| r1877 | r1878 | |
| 234 | 206 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) |
| 235 | 207 | |
| 236 | 208 | static INPUT_PORTS_START( gyruss ) |
| 237 | GYRUSS_COMMON | |
| 209 | GYRUSS_COMMON | |
| 238 | 210 | |
| 239 | 211 | PORT_START_TAG("DSW1") |
| 240 | 212 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| r1877 | r1878 | |
| 271 | 243 | /* This is identical to gyruss except for the bonus that has different |
| 272 | 244 | values */ |
| 273 | 245 | static INPUT_PORTS_START( gyrussce ) |
| 274 | GYRUSS_COMMON | |
| 246 | GYRUSS_COMMON | |
| 275 | 247 | |
| 276 | 248 | PORT_START_TAG("DSW1") |
| 277 | 249 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| r1877 | r1878 | |
| 316 | 288 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, |
| 317 | 289 | 16*8 /* every char takes 16 consecutive bytes */ |
| 318 | 290 | }; |
| 291 | ||
| 319 | 292 | static const gfx_layout spritelayout = |
| 320 | 293 | { |
| 321 | 294 | 8,16, /* 8*16 sprites */ |
| r1877 | r1878 | |
| 329 | 302 | }; |
| 330 | 303 | |
| 331 | 304 | |
| 332 | ||
| 333 | 305 | static GFXDECODE_START( gyruss ) |
| 334 | 306 | GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 0, 16 ) /* upper half */ |
| 335 | 307 | GFXDECODE_ENTRY( REGION_GFX1, 0x0010, spritelayout, 0, 16 ) /* lower half */ |
| r1877 | r1878 | |
| 337 | 309 | GFXDECODE_END |
| 338 | 310 | |
| 339 | 311 | |
| 340 | ||
| 341 | 312 | static const struct AY8910interface ay8910_interface_1 = |
| 342 | 313 | { |
| 343 | 314 | 0, |
| r1877 | r1878 | |
| 365 | 336 | |
| 366 | 337 | /* basic machine hardware */ |
| 367 | 338 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz (?) */ |
| 368 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 369 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,1) | |
| 339 | MDRV_CPU_PROGRAM_MAP(main_cpu1_map,0) | |
| 340 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse) | |
| 370 | 341 | |
| 371 | 342 | MDRV_CPU_ADD(M6809, 2000000) /* 2 MHz ??? */ |
| 372 | MDRV_CPU_PROGRAM_MAP(m6809_readmem,m6809_writemem) | |
| 373 | MDRV_CPU_VBLANK_INT(gyruss_6809_interrupt,256) | |
| 343 | MDRV_CPU_PROGRAM_MAP(main_cpu2_map,0) | |
| 344 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold) | |
| 374 | 345 | |
| 375 | 346 | MDRV_CPU_ADD(Z80,14318180/4) |
| 376 | 347 | /* audio CPU */ /* 3.579545 MHz */ |
| 377 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) | |
| 378 | MDRV_CPU_IO_MAP(sound_readport,sound_writeport) | |
| 348 | MDRV_CPU_PROGRAM_MAP(audio_cpu1_map,0) | |
| 349 | MDRV_CPU_IO_MAP(audio_cpu1_io_map,0) | |
| 379 | 350 | |
| 380 | 351 | MDRV_CPU_ADD(I8039,8000000) |
| 381 | 352 | /* audio CPU */ /* 8MHz crystal */ |
| 382 | MDRV_CPU_PROGRAM_MAP(i8039_readmem,i8039_writemem) | |
| 383 | MDRV_CPU_IO_MAP(i8039_readport,i8039_writeport) | |
| 353 | MDRV_CPU_PROGRAM_MAP(audio_cpu2_map,0) | |
| 354 | MDRV_CPU_IO_MAP(audio_cpu2_io_map,0) | |
| 384 | 355 | |
| 385 | 356 | /* video hardware */ |
| 386 | 357 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 164 | 164 | { |
| 165 | 165 | case 0x00: |
| 166 | 166 | { |
| 167 | return (input_port_0_word_r(0,0) << 16) | input_port_1_word_r(0,0) | | |
| 167 | return (input_port_0_word_r(machine,0,0) << 16) | input_port_1_word_r(machine,0,0) | | |
| 168 | 168 | (EEPROM_read_bit() << 7) | frame_counter; |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | case 0x01: |
| 172 | 172 | { |
| 173 | return input_port_2_word_r(0,0) | (coin_word << 16); | |
| 173 | return input_port_2_word_r(machine,0,0) | (coin_word << 16); | |
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
| r1877 | r1878 | |
| 185 | 185 | { |
| 186 | 186 | if (ACCESSING_MSB32) /* $500000 is watchdog */ |
| 187 | 187 | { |
| 188 | watchdog_reset | |
| 188 | watchdog_reset | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | if (ACCESSING_LSB32) |
| r1877 | r1878 | |
| 215 | 215 | |
| 216 | 216 | static READ32_HANDLER( groundfx_adc_r ) |
| 217 | 217 | { |
| 218 | return (input_port_3_word_r(0,0) << 8) | input_port_4_word_r(0,0); | |
| 218 | return (input_port_3_word_r(machine,0,0) << 8) | input_port_4_word_r(machine,0,0); | |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | static WRITE32_HANDLER( groundfx_adc_w ) |
| r1877 | r1878 | |
| 409 | 409 | /* basic machine hardware */ |
| 410 | 410 | MDRV_CPU_ADD(M68EC020, 16000000) /* 16 MHz */ |
| 411 | 411 | MDRV_CPU_PROGRAM_MAP(groundfx_readmem,groundfx_writemem) |
| 412 | MDRV_CPU_VBLANK_INT(groundfx_interrupt | |
| 412 | MDRV_CPU_VBLANK_INT("main", groundfx_interrupt | |
| 413 | 413 | |
| 414 | 414 | TAITO_F3_SOUND_SYSTEM_CPU(16000000) |
| 415 | 415 |
| r1877 | r1878 | |
|---|---|---|
| 42 | 42 | static WRITE8_HANDLER( k007121_registers_w ) |
| 43 | 43 | { |
| 44 | 44 | if (offset < 8) |
| 45 | K007121_ctrl_0_w(offset,data); | |
| 45 | K007121_ctrl_0_w(machine,offset,data); | |
| 46 | 46 | else /* scroll registers */ |
| 47 | 47 | fastlane_k007121_regs[offset] = data; |
| 48 | 48 | } |
| r1877 | r1878 | |
| 71 | 71 | |
| 72 | 72 | static READ8_HANDLER( fastlane_K007232_read_port_0_r ) |
| 73 | 73 | { |
| 74 | return K007232_read_port_0_r(offset ^ 1); | |
| 74 | return K007232_read_port_0_r(machine, offset ^ 1); | |
| 75 | 75 | } |
| 76 | 76 | static WRITE8_HANDLER( fastlane_K007232_write_port_0_w ) |
| 77 | 77 | { |
| 78 | K007232_write_port_0_w(offset ^ 1, data); | |
| 78 | K007232_write_port_0_w(machine, offset ^ 1, data); | |
| 79 | 79 | } |
| 80 | 80 | static READ8_HANDLER( fastlane_K007232_read_port_1_r ) |
| 81 | 81 | { |
| 82 | return K007232_read_port_1_r(offset ^ 1); | |
| 82 | return K007232_read_port_1_r(machine, offset ^ 1); | |
| 83 | 83 | } |
| 84 | 84 | static WRITE8_HANDLER( fastlane_K007232_write_port_1_w ) |
| 85 | 85 | { |
| 86 | K007232_write_port_1_w(offset ^ 1, data); | |
| 86 | K007232_write_port_1_w(machine, offset ^ 1, data); | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | |
| r1877 | r1878 | |
| 279 | 279 | /* basic machine hardware */ |
| 280 | 280 | MDRV_CPU_ADD(HD6309, 3000000*4) /* 24MHz/8? */ |
| 281 | 281 | MDRV_CPU_PROGRAM_MAP(fastlane_readmem,fastlane_writemem) |
| 282 | MDRV_CPU_VBLANK_INT(fastlane_interrupt,16) /* 1 IRQ + ??? NMI (generated by the 007121) */ | |
| 282 | MDRV_CPU_VBLANK_INT_HACK(fastlane_interrupt,16) /* 1 IRQ + ??? NMI (generated by the 007121) */ | |
| 283 | 283 | |
| 284 | 284 | /* video hardware */ |
| 285 | 285 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 70 | 70 | palette_set_color(machine, i, cga_palette[i]); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | static void draw_char(running_machine *machine, | |
| 73 | static void draw_char(running_machine *machine, | |
| 74 | 74 | { |
| 75 | 75 | int i,j; |
| 76 | 76 | UINT8 *dp; |
| r1877 | r1878 | |
| 120 | 120 | |
| 121 | 121 | static READ8_HANDLER(at_dma8237_1_r) |
| 122 | 122 | { |
| 123 | return dma8237_1_r(offset / 2); | |
| 123 | return dma8237_1_r(machine, offset / 2); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | static WRITE8_HANDLER(at_dma8237_1_w) |
| 127 | 127 | { |
| 128 | dma8237_1_w(offset / 2, data); | |
| 128 | dma8237_1_w(machine, offset / 2, data); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | static READ32_HANDLER(at32_dma8237_1_r) |
| 132 | 132 | { |
| 133 | return read32le_with_read8_handler(at_dma8237_1_r, offset, mem_mask); | |
| 133 | return read32le_with_read8_handler(at_dma8237_1_r, machine, offset, mem_mask); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | static WRITE32_HANDLER(at32_dma8237_1_w) |
| 137 | 137 | { |
| 138 | write32le_with_write8_handler(at_dma8237_1_w, offset, data, mem_mask); | |
| 138 | write32le_with_write8_handler(at_dma8237_1_w, machine, offset, data, mem_mask); | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | |
| r1877 | r1878 | |
| 303 | 303 | |
| 304 | 304 | static READ32_HANDLER( ide0_r ) |
| 305 | 305 | { |
| 306 | return ide_controller32_0_r(0x1f0/4 + offset, mem_mask); | |
| 306 | return ide_controller32_0_r(machine, 0x1f0/4 + offset, mem_mask); | |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | static WRITE32_HANDLER( ide0_w ) |
| 310 | 310 | { |
| 311 | ide_controller32_0_w(0x1f0/4 + offset, data, mem_mask); | |
| 311 | ide_controller32_0_w(machine, 0x1f0/4 + offset, data, mem_mask); | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | static READ32_HANDLER( fdc_r ) |
| 315 | 315 | { |
| 316 | return ide_controller32_0_r(0x3f0/4 + offset, mem_mask); | |
| 316 | return ide_controller32_0_r(machine, 0x3f0/4 + offset, mem_mask); | |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | static WRITE32_HANDLER( fdc_w ) |
| 320 | 320 | { |
| 321 | 321 | //mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask); |
| 322 | ide_controller32_0_w(0x3f0/4 + offset, data, mem_mask); | |
| 322 | ide_controller32_0_w(machine, 0x3f0/4 + offset, data, mem_mask); | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | |
| r1877 | r1878 | |
| 539 | 539 | |
| 540 | 540 | /*****************************************************************************/ |
| 541 | 541 | |
| 542 | GAME(2002, gamecstl, 0, gamecstl, gamecstl, gamecstl, ROT0, "Cristaltec", "GameCristal", GAME_NOT_WORKING | GAME_NO_SOUND) | |
| 542 | GAME(2002, gamecstl, 0, gamecstl, gamecstl, gamecstl, ROT0, "Cristaltec", "GameCristal", GAME_NOT_WORKING | GAME_NO_SOUND) | |
| 543 | 543 |
| r1877 | r1878 | |
|---|---|---|
| 35 | 35 | static UINT8 ldv1000_output_latch; |
| 36 | 36 | |
| 37 | 37 | /* VIDEO GOODS */ |
| 38 | static void astron_draw_characters(running_machine *machine, | |
| 38 | static void astron_draw_characters(running_machine *machine, | |
| 39 | 39 | { |
| 40 | 40 | UINT8 characterX, characterY; |
| 41 | 41 | |
| r1877 | r1878 | |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | static void astron_draw_sprites( | |
| 53 | static void astron_draw_sprites( | |
| 54 | 54 | { |
| 55 | 55 | /* Heisted from Daphne */ |
| 56 | 56 | const UINT8 SPR_Y_TOP = 0; |
| r1877 | r1878 | |
| 346 | 346 | MDRV_CPU_ADD(Z80, SCHEMATIC_CLOCK/4) |
| 347 | 347 | MDRV_CPU_PROGRAM_MAP(mainmem,0) |
| 348 | 348 | MDRV_CPU_IO_MAP(mainport,0) |
| 349 | MDRV_CPU_VBLANK_INT(vblank_callback_astron | |
| 349 | MDRV_CPU_VBLANK_INT("main", vblank_callback_astron | |
| 350 | 350 | MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 1000.0/59.94) |
| 351 | 351 | |
| 352 | 352 | MDRV_MACHINE_START(astron) |
| r1877 | r1878 | |
|---|---|---|
| 372 | 372 | /* basic machine hardware */ |
| 373 | 373 | MDRV_CPU_ADD(Z80, MASTER_CLOCK/4) |
| 374 | 374 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 375 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 375 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 376 | 376 | |
| 377 | 377 | MDRV_CPU_ADD(Z80, MASTER_CLOCK/8) |
| 378 | 378 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 379 | 379 | MDRV_CPU_IO_MAP(sound_portmap,0) |
| 380 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 380 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 381 | 381 | |
| 382 | 382 | MDRV_MACHINE_START(kangaroo) |
| 383 | 383 | MDRV_MACHINE_RESET(kangaroo) |
| r1877 | r1878 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | static WRITE16_HANDLER( cabal_sound_irq_trigger_word_w ) |
| 107 | 107 | { |
| 108 | seibu_main_word_w(4,data,mem_mask); | |
| 108 | seibu_main_word_w(machine,4,data,mem_mask); | |
| 109 | 109 | |
| 110 | 110 | /* spin for a while to let the Z80 read the command, otherwise coins "stick" */ |
| 111 | 111 | cpu_spinuntil_time(ATTOTIME_IN_USEC(50)); |
| r1877 | r1878 | |
| 540 | 540 | /* basic machine hardware */ |
| 541 | 541 | MDRV_CPU_ADD(M68000, 20000000/2) /* verified on pcb */ |
| 542 | 542 | MDRV_CPU_PROGRAM_MAP(readmem_cpu,writemem_cpu) |
| 543 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 543 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 544 | 544 | |
| 545 | 545 | MDRV_CPU_ADD(Z80, 3579580) /* verified on pcb */ |
| 546 | 546 | /* audio CPU */ |
| r1877 | r1878 | |
| 585 | 585 | /* basic machine hardware */ |
| 586 | 586 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz */ |
| 587 | 587 | MDRV_CPU_PROGRAM_MAP(cabalbl_readmem_cpu,cabalbl_writemem_cpu) |
| 588 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 588 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 589 | 589 | |
| 590 | 590 | MDRV_CPU_ADD(Z80, 4000000) |
| 591 | 591 | MDRV_CPU_PROGRAM_MAP(cabalbl_readmem_sound,cabalbl_writemem_sound) |
| r1877 | r1878 | |
|---|---|---|
| 89 | 89 | switch (data) |
| 90 | 90 | { |
| 91 | 91 | case 0x01: |
| 92 | AY8910_write_port_0_w(0, draco_ay_latch); | |
| 92 | AY8910_write_port_0_w(machine, 0, draco_ay_latch); | |
| 93 | 93 | break; |
| 94 | 94 | |
| 95 | 95 | case 0x02: |
| 96 | draco_ay_latch = AY8910_read_port_0_r(0); | |
| 96 | draco_ay_latch = AY8910_read_port_0_r(machine, 0); | |
| 97 | 97 | break; |
| 98 | 98 | |
| 99 | 99 | case 0x03: |
| 100 | AY8910_control_port_0_w(0, draco_ay_latch); | |
| 100 | AY8910_control_port_0_w(machine, 0, draco_ay_latch); | |
| 101 | 101 | break; |
| 102 | 102 | } |
| 103 | 103 | } |
| r1877 | r1878 | |
| 217 | 217 | { |
| 218 | 218 | int addr = cdp1869_get_cma(offset); |
| 219 | 219 | cidelsa_pcb[addr] = activecpu_get_reg(CDP1802_Q); |
| 220 | cdp1869_charram_w(offset, data); | |
| 220 | cdp1869_charram_w(machine, offset, data); | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | static READ8_HANDLER ( cidelsa_charram_r ) |
| 224 | 224 | { |
| 225 | 225 | int addr = cdp1869_get_cma(offset); |
| 226 | 226 | cdp1869_pcb = cidelsa_pcb[addr]; |
| 227 | return cdp1869_charram_r(offset); | |
| 227 | return cdp1869_charram_r(machine,offset); | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | /* Memory Maps */ |
| r1877 | r1878 | |
| 517 | 517 | MDRV_CPU_PROGRAM_MAP(destryer_map, 0) |
| 518 | 518 | MDRV_CPU_IO_MAP(destryer_io_map, 0) |
| 519 | 519 | MDRV_CPU_CONFIG(cidelsa_cdp1802_config) |
| 520 | MDRV_CPU_VBLANK_INT(altair_interrupt, CDP1869_TOTAL_SCANLINES_PAL) | |
| 520 | MDRV_CPU_VBLANK_INT_HACK(altair_interrupt, CDP1869_TOTAL_SCANLINES_PAL) | |
| 521 | 521 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 522 | 522 | MDRV_MACHINE_START(destryer) |
| 523 | 523 | MDRV_MACHINE_RESET(destryer) |
| r1877 | r1878 | |
| 550 | 550 | MDRV_CPU_PROGRAM_MAP(destryea_map, 0) |
| 551 | 551 | MDRV_CPU_IO_MAP(destryer_io_map, 0) |
| 552 | 552 | MDRV_CPU_CONFIG(cidelsa_cdp1802_config) |
| 553 | MDRV_CPU_VBLANK_INT(altair_interrupt, CDP1869_TOTAL_SCANLINES_PAL) | |
| 553 | MDRV_CPU_VBLANK_INT_HACK(altair_interrupt, CDP1869_TOTAL_SCANLINES_PAL) | |
| 554 | 554 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 555 | 555 | MDRV_MACHINE_START(destryer) |
| 556 | 556 | MDRV_MACHINE_RESET(destryer) |
| r1877 | r1878 | |
| 583 | 583 | MDRV_CPU_PROGRAM_MAP(altair_map, 0) |
| 584 | 584 | MDRV_CPU_IO_MAP(altair_io_map, 0) |
| 585 | 585 | MDRV_CPU_CONFIG(cidelsa_cdp1802_config) |
| 586 | MDRV_CPU_VBLANK_INT(altair_interrupt, CDP1869_TOTAL_SCANLINES_PAL) | |
| 586 | MDRV_CPU_VBLANK_INT_HACK(altair_interrupt, CDP1869_TOTAL_SCANLINES_PAL) | |
| 587 | 587 | MDRV_MACHINE_START(destryer) |
| 588 | 588 | MDRV_MACHINE_RESET(destryer) |
| 589 | 589 | |
| r1877 | r1878 | |
| 615 | 615 | MDRV_CPU_PROGRAM_MAP(draco_map, 0) |
| 616 | 616 | MDRV_CPU_IO_MAP(draco_io_map, 0) |
| 617 | 617 | MDRV_CPU_CONFIG(cidelsa_cdp1802_config) |
| 618 | MDRV_CPU_VBLANK_INT(draco_interrupt, CDP1869_TOTAL_SCANLINES_PAL) | |
| 618 | MDRV_CPU_VBLANK_INT_HACK(draco_interrupt, CDP1869_TOTAL_SCANLINES_PAL) | |
| 619 | 619 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 620 | 620 | MDRV_MACHINE_START(draco) |
| 621 | 621 | MDRV_MACHINE_RESET(destryer) |
| r1877 | r1878 | |
|---|---|---|
| 112 | 112 | * |
| 113 | 113 | *************************************/ |
| 114 | 114 | |
| 115 | static void scanline_update(running_machine *machine, int screen, | |
| 115 | static void scanline_update(running_machine *machine, int screen, | |
| 116 | 116 | { |
| 117 | 117 | UINT16 *src = &tickee_vram[(params->rowaddr << 8) & 0x3ff00]; |
| 118 | 118 | UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0); |
| r1877 | r1878 | |
| 159 | 159 | |
| 160 | 160 | static READ8_HANDLER( port1_r ) |
| 161 | 161 | { |
| 162 | return input_port_1_r(offset) | (ticket_dispenser_0_r(0) >> 5) | (ticket_dispenser_1_r(0) >> 6); | |
| 162 | return input_port_1_r(machine, offset) | (ticket_dispenser_0_r(machine, 0) >> 5) | (ticket_dispenser_1_r(machine, 0) >> 6); | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | static READ8_HANDLER( port2_r ) |
| 166 | 166 | { |
| 167 | return input_port_3_r(offset) | (ticket_dispenser_0_r(0) >> 5) | (ticket_dispenser_1_r(0) >> 6); | |
| 167 | return input_port_3_r(machine, offset) | (ticket_dispenser_0_r(machine, 0) >> 5) | (ticket_dispenser_1_r(machine, 0) >> 6); | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | |
| r1877 | r1878 | |
| 190 | 190 | |
| 191 | 191 | if (offset == 3) |
| 192 | 192 | { |
| 193 | ticket_dispenser_0_w(0, (data & 8) << 4); | |
| 194 | ticket_dispenser_1_w(0, (data & 4) << 5); | |
| 193 | ticket_dispenser_0_w(machine, 0, (data & 8) << 4); | |
| 194 | ticket_dispenser_1_w(machine, 0, (data & 4) << 5); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | if (olddata != tickee_control[offset]) |
| r1877 | r1878 | |
|---|---|---|
| 188 | 188 | MDRV_CPU_ADD(I8088, 10000000) |
| 189 | 189 | MDRV_CPU_PROGRAM_MAP(hotblock_map, 0) |
| 190 | 190 | MDRV_CPU_IO_MAP(hotblock_io,0) |
| 191 | MDRV_CPU_VBLANK_INT(hotblocks_irq | |
| 191 | MDRV_CPU_VBLANK_INT("main", hotblocks_irq | |
| 192 | 192 | |
| 193 | 193 | /* video hardware */ |
| 194 | 194 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 29 | 29 | */ |
| 30 | 30 | |
| 31 | 31 | #include "driver.h" |
| 32 | #include "deprecat.h" | |
| 32 | 33 | #include "cpu/mips/r3000.h" |
| 33 | 34 | #include "sound/st0016.h" |
| 34 | 35 | #include "st0016.h" |
| r1877 | r1878 | |
| 624 | 625 | MDRV_CPU_ADD_TAG("main",Z80,8000000) |
| 625 | 626 | MDRV_CPU_PROGRAM_MAP(st0016_mem,0) |
| 626 | 627 | MDRV_CPU_IO_MAP(st0016_io,0) |
| 627 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 628 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 628 | 629 | |
| 629 | ||
| 630 | | |
| 630 | 631 | MDRV_CPU_CONFIG(config) |
| 631 | MDRV_CPU_VBLANK_INT(irq4_line_hold,2) | |
| 632 | MDRV_CPU_VBLANK_INT_HACK(irq4_line_hold,2) | |
| 632 | 633 | MDRV_CPU_PROGRAM_MAP(srmp5_mem,0) |
| 633 | 634 | |
| 634 | 635 |
| r1877 | r1878 | |
|---|---|---|
| 32 | 32 | |
| 33 | 33 | static WRITE8_HANDLER( suprloco_soundport_w ) |
| 34 | 34 | { |
| 35 | soundlatch_w(0,data); | |
| 36 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 35 | soundlatch_w(machine,0,data); | |
| 36 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 37 | 37 | /* spin for a while to let the Z80 read the command (fixes hanging sound in Regulus) */ |
| 38 | 38 | cpu_spinuntil_time(ATTOTIME_IN_USEC(50)); |
| 39 | 39 | } |
| r1877 | r1878 | |
| 170 | 170 | /* basic machine hardware */ |
| 171 | 171 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz (?) */ |
| 172 | 172 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 173 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 173 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 174 | 174 | |
| 175 | 175 | MDRV_CPU_ADD(Z80, 4000000) |
| 176 | 176 | /* audio CPU */ |
| 177 | 177 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| 178 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) /* NMIs are caused by the main CPU */ | |
| 178 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* NMIs are caused by the main CPU */ | |
| 179 | 179 | |
| 180 | 180 | /* video hardware */ |
| 181 | 181 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 333 | 333 | static WRITE16_HANDLER( m92_soundlatch_w ) |
| 334 | 334 | { |
| 335 | 335 | timer_call_after_resynch(NULL, V30_ASSERT, setvector_callback); |
| 336 | soundlatch_w(0, data & 0xff); | |
| 336 | soundlatch_w(machine, 0, data & 0xff); | |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | static READ16_HANDLER( m92_sound_status_r ) |
| r1877 | r1878 | |
| 344 | 344 | |
| 345 | 345 | static READ16_HANDLER( m92_soundlatch_r ) |
| 346 | 346 | { |
| 347 | return soundlatch_r(offset) | 0xff00; | |
| 347 | return soundlatch_r(machine, offset) | 0xff00; | |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | static WRITE16_HANDLER( m92_sound_irq_ack_w ) |
| r1877 | r1878 | |
|---|---|---|
| 72 | 72 | aso_scroll_sync[offset] = data; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | static void hal21_sound_scheduler(int mode, int data) | |
| 75 | static void hal21_sound_scheduler(running_machine *machine, int mode, int data) | |
| 76 | 76 | { |
| 77 | 77 | static int busy, hold, ffcount, ffhead, fftail; |
| 78 | 78 | |
| r1877 | r1878 | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | snk_sound_busy_bit = 0x20; |
| 119 | soundlatch_w(0, data); | |
| 120 | cpunum_set_input_line(Machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 119 | soundlatch_w(machine, 0, data); | |
| 120 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE); | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /**************************************************************************/ |
| r1877 | r1878 | |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
| 183 | static void hal21_draw_background(running_machine *machine, | |
| 183 | static void hal21_draw_background(running_machine *machine, | |
| 184 | 184 | const gfx_element *gfx ) |
| 185 | 185 | { |
| 186 | 186 | static int color[2] = {8, 8}; |
| r1877 | r1878 | |
| 218 | 218 | } |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | static void hal21_draw_sprites( | |
| 221 | static void hal21_draw_sprites( | |
| 222 | 222 | const gfx_element *gfx ) |
| 223 | 223 | { |
| 224 | 224 | UINT8 *sprptr, *endptr; |
| r1877 | r1878 | |
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | static void aso_draw_background( | |
| 251 | static void aso_draw_background( | |
| 252 | 252 | const gfx_element *gfx ) |
| 253 | 253 | { |
| 254 | 254 | int bankbase, c, x, y, offsx, offsy, dx, dy, sx, sy, offs, tile_number; |
| r1877 | r1878 | |
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | static void aso_draw_sprites( | |
| 281 | static void aso_draw_sprites( | |
| 282 | 282 | const gfx_element *gfx ) |
| 283 | 283 | { |
| 284 | 284 | UINT8 *sprptr, *endptr; |
| r1877 | r1878 | |
| 551 | 551 | |
| 552 | 552 | static READ8_HANDLER( CPUC_ready_r ) { snk_sound_busy_bit = 0; return 0; } |
| 553 | 553 | |
| 554 | static READ8_HANDLER( hal21_input_port_0_r ) { return input_port_0_r(0) | snk_sound_busy_bit; } | |
| 554 | static READ8_HANDLER( hal21_input_port_0_r ) { return input_port_0_r(machine,0) | snk_sound_busy_bit; } | |
| 555 | 555 | |
| 556 | static WRITE8_HANDLER( hal21_soundcommand_w ) { hal21_sound_scheduler(1, data); } | |
| 557 | static WRITE8_HANDLER( hal21_soundack_w ) { hal21_sound_scheduler(2, data); } | |
| 556 | static WRITE8_HANDLER( hal21_soundcommand_w ) { hal21_sound_scheduler(machine, 1, data); } | |
| 557 | static WRITE8_HANDLER( hal21_soundack_w ) { hal21_sound_scheduler(machine,2, data); } | |
| 558 | 558 | |
| 559 | 559 | static READ8_HANDLER( hal21_soundcommand_r ) |
| 560 | 560 | { |
| 561 | int data = soundlatch_r(0); | |
| 562 | soundlatch_clear_w(0, 0); | |
| 561 | int data = soundlatch_r(machine, 0); | |
| 562 | soundlatch_clear_w(machine, 0, 0); | |
| 563 | 563 | return data; |
| 564 | 564 | } |
| 565 | 565 | |
| 566 | 566 | static WRITE8_HANDLER( aso_soundcommand_w ) |
| 567 | 567 | { |
| 568 | 568 | snk_sound_busy_bit = 0x20; |
| 569 | soundlatch_w(0, data); | |
| 570 | cpunum_set_input_line(Machine, 2, 0, HOLD_LINE ); | |
| 569 | soundlatch_w(machine, 0, data); | |
| 570 | cpunum_set_input_line(machine, 2, 0, HOLD_LINE ); | |
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 | static INTERRUPT_GEN( hal21_sound_interrupt ) |
| 574 | 574 | { |
| 575 | hal21_sound_scheduler(3, 0); | |
| 575 | hal21_sound_scheduler(machine, 3, 0); | |
| 576 | 576 | } |
| 577 | 577 | |
| 578 | 578 | /**************************************************************************/ |
| r1877 | r1878 | |
| 691 | 691 | static MACHINE_RESET( aso ) |
| 692 | 692 | { |
| 693 | 693 | memset(hal21_vreg, 0, 8); |
| 694 | hal21_sound_scheduler(0, 0); | |
| 694 | hal21_sound_scheduler(machine, 0, 0); | |
| 695 | 695 | snk_sound_busy_bit = 0; |
| 696 | 696 | } |
| 697 | 697 | |
| r1877 | r1878 | |
| 700 | 700 | /* basic machine hardware */ |
| 701 | 701 | MDRV_CPU_ADD(Z80, 4000000) |
| 702 | 702 | MDRV_CPU_PROGRAM_MAP(aso_cpuA_map,0) |
| 703 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 703 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 704 | 704 | |
| 705 | 705 | MDRV_CPU_ADD(Z80, 4000000) |
| 706 | 706 | MDRV_CPU_PROGRAM_MAP(aso_cpuB_map,0) |
| 707 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 707 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 708 | 708 | |
| 709 | 709 | MDRV_CPU_ADD(Z80, 4000000) |
| 710 | 710 | /* audio CPU */ |
| 711 | 711 | MDRV_CPU_PROGRAM_MAP(aso_sound_map,0) |
| 712 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 712 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 713 | 713 | |
| 714 | 714 | MDRV_INTERLEAVE(100) |
| 715 | 715 | |
| r1877 | r1878 | |
| 744 | 744 | /* basic machine hardware */ |
| 745 | 745 | MDRV_CPU_ADD(Z80, 4000000) |
| 746 | 746 | MDRV_CPU_PROGRAM_MAP(hal21_cpuA_map,0) |
| 747 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 747 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 748 | 748 | |
| 749 | 749 | MDRV_CPU_ADD(Z80, 4000000) |
| 750 | 750 | MDRV_CPU_PROGRAM_MAP(hal21_cpuB_map,0) |
| 751 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 751 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 752 | 752 | |
| 753 | 753 | MDRV_CPU_ADD(Z80, 4000000) |
| 754 | 754 | /* audio CPU */ |
| 755 | 755 | MDRV_CPU_PROGRAM_MAP(hal21_sound_map,0) |
| 756 | 756 | MDRV_CPU_IO_MAP(hal21_sound_portmap,0) |
| 757 | MDRV_CPU_VBLANK_INT(hal21_sound_interrupt | |
| 757 | MDRV_CPU_VBLANK_INT("main", hal21_sound_interrupt | |
| 758 | 758 | MDRV_CPU_PERIODIC_INT(irq0_line_hold, 220) // music tempo, hand tuned |
| 759 | 759 | |
| 760 | 760 | MDRV_INTERLEAVE(100) |
| r1877 | r1878 | |
|---|---|---|
| 192 | 192 | /* basic machine hardware */ |
| 193 | 193 | MDRV_CPU_ADD(Z80, MASTER_CLOCK/3/2) |
| 194 | 194 | MDRV_CPU_PROGRAM_MAP(yard_map, 0) |
| 195 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 195 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 196 | 196 | |
| 197 | 197 | /* video hardware */ |
| 198 | 198 | MDRV_GFXDECODE(yard) |
| r1877 | r1878 | |
|---|---|---|
| 188 | 188 | |
| 189 | 189 | /********************************************/ |
| 190 | 190 | |
| 191 | static READ8_HANDLER( vendetta_K052109_r ) { return K052109_r( offset + 0x2000 ); } | |
| 192 | //static WRITE8_HANDLER( vendetta_K052109_w ) { K052109_w( offset + 0x2000, data ); } | |
| 191 | static READ8_HANDLER( vendetta_K052109_r ) { return K052109_r( machine, offset + 0x2000 ); } | |
| 192 | //static WRITE8_HANDLER( vendetta_K052109_w ) { K052109_w( machine, offset + 0x2000, data ); } | |
| 193 | 193 | static WRITE8_HANDLER( vendetta_K052109_w ) { |
| 194 | 194 | // ************************************************************************************* |
| 195 | 195 | // * Escape Kids uses 052109's mirrored Tilemap ROM bank selector, but only during * |
| 196 | 196 | // * Tilemap MASK-ROM Test (0x1d80<->0x3d80, 0x1e00<->0x3e00, 0x1f00<->0x3f00) * |
| 197 | 197 | // ************************************************************************************* |
| 198 | if ( ( offset == 0x1d80 ) || ( offset == 0x1e00 ) || ( offset == 0x1f00 ) ) K052109_w( offset, data ); | |
| 199 | K052109_w( offset + 0x2000, data ); | |
| 198 | if ( ( offset == 0x1d80 ) || ( offset == 0x1e00 ) || ( offset == 0x1f00 ) ) K052109_w( machine, offset, data ); | |
| 199 | K052109_w( machine, offset + 0x2000, data ); | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | static offs_t video_banking_base; |
| r1877 | r1878 | |
| 240 | 240 | |
| 241 | 241 | static WRITE8_HANDLER( z80_arm_nmi_w ) |
| 242 | 242 | { |
| 243 | cpunum_set_input_line( | |
| 243 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE ); | |
| 244 | 244 | |
| 245 | 245 | timer_set( ATTOTIME_IN_USEC( 25 ), NULL, 0, z80_nmi_callback ); |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | static WRITE8_HANDLER( z80_irq_w ) |
| 249 | 249 | { |
| 250 | cpunum_set_input_line_and_vector( | |
| 250 | cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0xff ); | |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | static READ8_HANDLER( vendetta_sound_interrupt_r ) |
| 254 | 254 | { |
| 255 | cpunum_set_input_line_and_vector( | |
| 255 | cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0xff ); | |
| 256 | 256 | return 0x00; |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | static READ8_HANDLER( vendetta_sound_r ) |
| 260 | 260 | { |
| 261 | return K053260_0_r(2 + offset); | |
| 261 | return K053260_0_r(machine, 2 + offset); | |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | /********************************************/ |
| r1877 | r1878 | |
| 581 | 581 | MDRV_CPU_ADD_TAG("main", KONAMI, 6000000) /* this is strange, seems an overclock but */ |
| 582 | 582 | // MDRV_CPU_ADD_TAG("main", KONAMI, 3000000) /* is needed to have correct music speed */ |
| 583 | 583 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 584 | MDRV_CPU_VBLANK_INT(vendetta_irq | |
| 584 | MDRV_CPU_VBLANK_INT("main", vendetta_irq | |
| 585 | 585 | |
| 586 | 586 | MDRV_CPU_ADD(Z80, 3579545) /* verified with PCB */ |
| 587 | 587 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 57 | 57 | extern int fcombat_sh; |
| 58 | 58 | extern int fcombat_sv; |
| 59 | 59 | |
| 60 | ||
| 61 | static INPUT_CHANGED( coin_inserted ) | |
| 62 | { | |
| 63 | /* coin insertion causes an NMI */ | |
| 64 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); | |
| 65 | } | |
| 66 | ||
| 67 | ||
| 60 | 68 | static INPUT_PORTS_START( fcombat ) |
| 61 | 69 | PORT_START_TAG("IN0") /* player 1 inputs (muxed on 0xe000) */ |
| 62 | 70 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| r1877 | r1878 | |
| 113 | 121 | PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) ) |
| 114 | 122 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 115 | 123 | |
| 116 | PORT_START_TAG("FAKE") | |
| 117 | /* The coin slots are not memory mapped. */ | |
| 118 | /* This fake input port is used by the interrupt */ | |
| 119 | /* handler to be notified of coin insertions. We use IMPULSE to */ | |
| 120 | /* trigger exactly one interrupt, without having to check when the */ | |
| 121 | /* user releases the key. */ | |
| 122 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) | |
| 124 | PORT_START_TAG("COIN") | |
| 125 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 123 | 126 | INPUT_PORTS_END |
| 124 | 127 | |
| 125 | 128 | |
| r1877 | r1878 | |
| 143 | 146 | static READ8_HANDLER( fcombat_port01_r ) |
| 144 | 147 | { |
| 145 | 148 | /* the cocktail flip bit muxes between ports 0 and 1 */ |
| 146 | return fcombat_cocktail_flip ? input_port_1_r(offset) : input_port_0_r(offset); | |
| 149 | return fcombat_cocktail_flip ? input_port_1_r(machine,offset) : input_port_0_r(machine,offset); | |
| 147 | 150 | } |
| 148 | 151 | |
| 149 | 152 | |
| r1877 | r1878 | |
| 192 | 195 | |
| 193 | 196 | } |
| 194 | 197 | |
| 195 | static ADDRESS_MAP_START( fcombat_readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 196 | AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM) | |
| 198 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 199 | AM_RANGE(0x0000, 0x7fff) AM_ROM | |
| 200 | AM_RANGE(0xc000, 0xc7ff) AM_RAM | |
| 201 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 202 | AM_RANGE(0xd800, 0xd8ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 197 | 203 | AM_RANGE(0xe000, 0xe000) AM_READ(fcombat_port01_r) |
| 198 | 204 | AM_RANGE(0xe100, 0xe100) AM_READ(input_port_2_r) |
| 199 | 205 | AM_RANGE(0xe200, 0xe200) AM_READ(input_port_3_r) |
| 200 | 206 | AM_RANGE(0xe300, 0xe300) AM_READ(e300_r) |
| 201 | 207 | AM_RANGE(0xe400, 0xe400) AM_READ(fcombat_protection_r) // protection? |
| 202 | AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM) | |
| 203 | AM_RANGE(0xd000, 0xd7ff) AM_READ(MRA8_RAM) | |
| 204 | AM_RANGE(0xd800, 0xd8ff) AM_READ(MRA8_RAM) | |
| 205 | ADDRESS_MAP_END | |
| 206 | ||
| 207 | static ADDRESS_MAP_START( fcombat_writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 208 | AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM) | |
| 209 | AM_RANGE(0xc000, 0xc7ff) AM_WRITE(MWA8_RAM) | |
| 210 | AM_RANGE(0xd000, 0xd7ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size) | |
| 211 | AM_RANGE(0xd800, 0xd8ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) | |
| 212 | ||
| 213 | 208 | AM_RANGE(0xe800, 0xe800) AM_WRITE(fcombat_videoreg_w) // at least bit 0 for flip screen and joystick input multiplexor |
| 214 | ||
| 215 | 209 | AM_RANGE(0xe900, 0xe900) AM_WRITE(e900_w) |
| 216 | 210 | AM_RANGE(0xea00, 0xea00) AM_WRITE(ea00_w) |
| 217 | 211 | AM_RANGE(0xeb00, 0xeb00) AM_WRITE(eb00_w) |
| 218 | ||
| 219 | 212 | AM_RANGE(0xec00, 0xec00) AM_WRITE(ec00_w) |
| 220 | 213 | AM_RANGE(0xed00, 0xed00) AM_WRITE(ed00_w) |
| 221 | ||
| 222 | 214 | AM_RANGE(0xee00, 0xee00) AM_WRITE(ee00_w) // related to protection ? - doesn't seem to have any effect |
| 223 | ||
| 224 | /* erk ... */ | |
| 225 | 215 | AM_RANGE(0xef00, 0xef00) AM_WRITE(soundlatch_w) |
| 226 | 216 | ADDRESS_MAP_END |
| 227 | 217 | |
| 228 | /* sound cpu */ | |
| 229 | 218 | |
| 230 | static ADDRESS_MAP_START( fcombat_readmem2, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 231 | AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_ROM) | |
| 232 | AM_RANGE(0x4000, 0x47ff) AM_READ(MRA8_RAM) | |
| 219 | static ADDRESS_MAP_START( audio_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 220 | AM_RANGE(0x0000, 0x3fff) AM_ROM | |
| 221 | AM_RANGE(0x4000, 0x47ff) AM_RAM | |
| 233 | 222 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) |
| 234 | 223 | AM_RANGE(0x8001, 0x8001) AM_READ(AY8910_read_port_0_r) |
| 235 | AM_RANGE(0xa001, 0xa001) AM_READ(AY8910_read_port_1_r) | |
| 236 | AM_RANGE(0xc001, 0xc001) AM_READ(AY8910_read_port_2_r) | |
| 237 | ADDRESS_MAP_END | |
| 238 | ||
| 239 | static ADDRESS_MAP_START( fcombat_writemem2, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 240 | AM_RANGE(0x0000, 0x3fff) AM_WRITE(MWA8_ROM) | |
| 241 | AM_RANGE(0x4000, 0x47ff) AM_WRITE(MWA8_RAM) | |
| 242 | 224 | AM_RANGE(0x8002, 0x8002) AM_WRITE(AY8910_write_port_0_w) |
| 243 | 225 | AM_RANGE(0x8003, 0x8003) AM_WRITE(AY8910_control_port_0_w) |
| 226 | AM_RANGE(0xa001, 0xa001) AM_READ(AY8910_read_port_1_r) | |
| 244 | 227 | AM_RANGE(0xa002, 0xa002) AM_WRITE(AY8910_write_port_1_w) |
| 245 | 228 | AM_RANGE(0xa003, 0xa003) AM_WRITE(AY8910_control_port_1_w) |
| 229 | AM_RANGE(0xc001, 0xc001) AM_READ(AY8910_read_port_2_r) | |
| 246 | 230 | AM_RANGE(0xc002, 0xc002) AM_WRITE(AY8910_write_port_2_w) |
| 247 | 231 | AM_RANGE(0xc003, 0xc003) AM_WRITE(AY8910_control_port_2_w) |
| 248 | 232 | ADDRESS_MAP_END |
| 249 | 233 | |
| 234 | ||
| 235 | ||
| 250 | 236 | /************************************* |
| 251 | 237 | * |
| 252 | 238 | * Graphics layouts |
| r1877 | r1878 | |
| 286 | 272 | GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 512, 64 ) |
| 287 | 273 | GFXDECODE_END |
| 288 | 274 | |
| 289 | /************************************* | |
| 290 | * | |
| 291 | * Sound interfaces | |
| 292 | * | |
| 293 | *************************************/ | |
| 294 | 275 | |
| 295 | /* interrupt */ | |
| 296 | 276 | |
| 297 | ||
| 298 | static INTERRUPT_GEN( fcombat_interrupt ) | |
| 299 | { | |
| 300 | /* Exerion triggers NMIs on coin insertion */ | |
| 301 | if (readinputport(4) & 1) | |
| 302 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 303 | } | |
| 304 | ||
| 305 | 277 | /************************************* |
| 306 | 278 | * |
| 307 | 279 | * Machine drivers |
| r1877 | r1878 | |
| 311 | 283 | static MACHINE_DRIVER_START( fcombat ) |
| 312 | 284 | |
| 313 | 285 | MDRV_CPU_ADD(Z80, 10000000/3) |
| 314 | MDRV_CPU_PROGRAM_MAP(fcombat_readmem,fcombat_writemem) | |
| 315 | MDRV_CPU_VBLANK_INT(fcombat_interrupt,1) | |
| 286 | MDRV_CPU_PROGRAM_MAP(main_map,0) | |
| 316 | 287 | |
| 317 | 288 | MDRV_CPU_ADD(Z80, 10000000/3) |
| 318 | MDRV_CPU_PROGRAM_MAP( | |
| 289 | MDRV_CPU_PROGRAM_MAP( | |
| 319 | 290 | |
| 320 | 291 | /* video hardware */ |
| 321 | 292 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 329 | 300 | MDRV_VIDEO_START(fcombat) |
| 330 | 301 | MDRV_VIDEO_UPDATE(fcombat) |
| 331 | 302 | |
| 332 | /* | |
| 303 | /* a | |
| 333 | 304 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 334 | 305 | |
| 335 | 306 | MDRV_SOUND_ADD(AY8910, 1500000) |
| r1877 | r1878 | |
|---|---|---|
| 81 | 81 | { |
| 82 | 82 | destroyr_cursor = data; |
| 83 | 83 | |
| 84 | watchdog_reset_w(offset, data); | |
| 84 | watchdog_reset_w(machine, offset, data); | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | |
| r1877 | r1878 | |
| 122 | 122 | /* bit 0 => low explosion */ |
| 123 | 123 | break; |
| 124 | 124 | case 8: |
| 125 | destroyr_misc_w(offset, data); | |
| 125 | destroyr_misc_w(machine, offset, data); | |
| 126 | 126 | break; |
| 127 | 127 | default: |
| 128 | 128 | logerror("unmapped output port %d\n", offset); |
| r1877 | r1878 | |
| 341 | 341 | /* basic machine hardware */ |
| 342 | 342 | MDRV_CPU_ADD(M6800, 12096000 / 16) |
| 343 | 343 | MDRV_CPU_PROGRAM_MAP(destroyr_map, 0) |
| 344 | MDRV_CPU_VBLANK_INT(irq0_line_assert, 4) | |
| 344 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_assert, 4) | |
| 345 | 345 | |
| 346 | 346 | MDRV_MACHINE_RESET(destroyr) |
| 347 | 347 |
| r1877 | r1878 | |
|---|---|---|
| 893 | 893 | |
| 894 | 894 | static UINT8 has_sound_cpu; |
| 895 | 895 | |
| 896 | static read16_handler custom_io_r; | |
| 897 | static write16_handler custom_io_w; | |
| 896 | static read16_machine_func custom_io_r; | |
| 897 | static write16_machine_func custom_io_w; | |
| 898 | 898 | |
| 899 | 899 | static UINT8 disable_screen_blanking; |
| 900 | 900 | static UINT8 mj_input_num; |
| 901 | 901 | static UINT8 hwc_input_value; |
| 902 | 902 | |
| 903 | static void (*i8751_vblank_hook)( | |
| 903 | static void (*i8751_vblank_hook)(running_machine *machine); | |
| 904 | 904 | static const UINT8 *i8751_initial_config; |
| 905 | 905 | |
| 906 | 906 | |
| r1877 | r1878 | |
| 1022 | 1022 | { |
| 1023 | 1023 | if (has_sound_cpu) |
| 1024 | 1024 | { |
| 1025 | soundlatch_w(0, data & 0xff); | |
| 1025 | soundlatch_w(Machine, 0, data & 0xff); | |
| 1026 | 1026 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); |
| 1027 | 1027 | } |
| 1028 | 1028 | } |
| r1877 | r1878 | |
| 1126 | 1126 | return readinputport(4 + (offset & 1)); |
| 1127 | 1127 | } |
| 1128 | 1128 | logerror("%06X:standard_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2); |
| 1129 | return segaic16_open_bus_r(0,0); | |
| 1129 | return segaic16_open_bus_r(machine,0,0); | |
| 1130 | 1130 | } |
| 1131 | 1131 | |
| 1132 | 1132 | |
| r1877 | r1878 | |
| 1163 | 1163 | static READ16_HANDLER( misc_io_r ) |
| 1164 | 1164 | { |
| 1165 | 1165 | if (custom_io_r) |
| 1166 | return (*custom_io_r)(offset, mem_mask); | |
| 1166 | return (*custom_io_r)(machine, offset, mem_mask); | |
| 1167 | 1167 | else |
| 1168 | return standard_io_r(offset, mem_mask); | |
| 1168 | return standard_io_r(machine, offset, mem_mask); | |
| 1169 | 1169 | } |
| 1170 | 1170 | |
| 1171 | 1171 | |
| 1172 | 1172 | static WRITE16_HANDLER( misc_io_w ) |
| 1173 | 1173 | { |
| 1174 | 1174 | if (custom_io_w) |
| 1175 | (*custom_io_w)(offset, data, mem_mask); | |
| 1175 | (*custom_io_w)(machine, offset, data, mem_mask); | |
| 1176 | 1176 | else |
| 1177 | standard_io_w(offset, data, mem_mask); | |
| 1177 | standard_io_w(machine, offset, data, mem_mask); | |
| 1178 | 1178 | } |
| 1179 | 1179 | |
| 1180 | 1180 | |
| r1877 | r1878 | |
| 1199 | 1199 | { |
| 1200 | 1200 | case 0x0000/2: |
| 1201 | 1201 | /* multiply registers */ |
| 1202 | return segaic16_multiply_0_r(offset & 3, mem_mask); | |
| 1202 | return segaic16_multiply_0_r(machine, offset & 3, mem_mask); | |
| 1203 | 1203 | |
| 1204 | 1204 | case 0x1000/2: |
| 1205 | 1205 | /* compare registers */ |
| 1206 | return segaic16_compare_timer_0_r(offset & 7, mem_mask); | |
| 1206 | return segaic16_compare_timer_0_r(machine, offset & 7, mem_mask); | |
| 1207 | 1207 | } |
| 1208 | return segaic16_open_bus_r(0,0); | |
| 1208 | return segaic16_open_bus_r(machine,0,0); | |
| 1209 | 1209 | } |
| 1210 | 1210 | |
| 1211 | 1211 | |
| r1877 | r1878 | |
| 1216 | 1216 | { |
| 1217 | 1217 | case 0x0000/2: |
| 1218 | 1218 | /* multiply registers */ |
| 1219 | segaic16_multiply_0_w(offset & 3, data, mem_mask); | |
| 1219 | segaic16_multiply_0_w(machine, offset & 3, data, mem_mask); | |
| 1220 | 1220 | break; |
| 1221 | 1221 | |
| 1222 | 1222 | case 0x1000/2: |
| 1223 | 1223 | /* compare registers */ |
| 1224 | segaic16_compare_timer_0_w(offset & 7, data, mem_mask); | |
| 1224 | segaic16_compare_timer_0_w(machine, offset & 7, data, mem_mask); | |
| 1225 | 1225 | break; |
| 1226 | 1226 | |
| 1227 | 1227 | case 0x2000/2: |
| r1877 | r1878 | |
| 1235 | 1235 | static READ16_HANDLER( unknown_rgn2_r ) |
| 1236 | 1236 | { |
| 1237 | 1237 | logerror("Region 2: read from %04X\n", offset * 2); |
| 1238 | return segaic16_compare_timer_1_r(offset & 7, mem_mask); | |
| 1238 | return segaic16_compare_timer_1_r(machine, offset & 7, mem_mask); | |
| 1239 | 1239 | } |
| 1240 | 1240 | |
| 1241 | 1241 | |
| 1242 | 1242 | static WRITE16_HANDLER( unknown_rgn2_w ) |
| 1243 | 1243 | { |
| 1244 | 1244 | logerror("Region 2: write to %04X = %04X & %04X\n", offset * 2, data, mem_mask ^ 0xffff); |
| 1245 | segaic16_compare_timer_1_w(offset & 7, data, mem_mask); | |
| 1245 | segaic16_compare_timer_1_w(machine, offset & 7, data, mem_mask); | |
| 1246 | 1246 | } |
| 1247 | 1247 | |
| 1248 | 1248 | |
| r1877 | r1878 | |
| 1349 | 1349 | { |
| 1350 | 1350 | /* if we have a fake 8751 handler, call it on VBLANK */ |
| 1351 | 1351 | if (i8751_vblank_hook != NULL) |
| 1352 | (*i8751_vblank_hook)(); | |
| 1352 | (*i8751_vblank_hook)(machine); | |
| 1353 | 1353 | } |
| 1354 | 1354 | |
| 1355 | 1355 | |
| r1877 | r1878 | |
| 1360 | 1360 | * |
| 1361 | 1361 | *************************************/ |
| 1362 | 1362 | |
| 1363 | static void altbeast_common_i8751_sim(offs_t soundoffs, offs_t inputoffs) | |
| 1363 | static void altbeast_common_i8751_sim(running_machine *machine, offs_t soundoffs, offs_t inputoffs) | |
| 1364 | 1364 | { |
| 1365 | 1365 | UINT16 temp; |
| 1366 | 1366 | |
| 1367 | 1367 | /* signal a VBLANK to the main CPU */ |
| 1368 | cpunum_set_input_line( | |
| 1368 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 1369 | 1369 | |
| 1370 | 1370 | /* set tile banks */ |
| 1371 | rom_5704_bank_w(1, workram[0x3094/2] & 0x00ff, 0xff00); | |
| 1371 | rom_5704_bank_w(machine, 1, workram[0x3094/2] & 0x00ff, 0xff00); | |
| 1372 | 1372 | |
| 1373 | 1373 | /* process any new sound data */ |
| 1374 | 1374 | temp = workram[soundoffs]; |
| 1375 | 1375 | if ((temp & 0xff00) != 0x0000) |
| 1376 | 1376 | { |
| 1377 | segaic16_memory_mapper_w(0x03, temp >> 8); | |
| 1377 | segaic16_memory_mapper_w(machine, 0x03, temp >> 8); | |
| 1378 | 1378 | workram[soundoffs] = temp & 0x00ff; |
| 1379 | 1379 | } |
| 1380 | 1380 | |
| r1877 | r1878 | |
| 1382 | 1382 | workram[inputoffs] = ~readinputport(0) << 8; |
| 1383 | 1383 | } |
| 1384 | 1384 | |
| 1385 | static void altbeasj_i8751_sim( | |
| 1385 | static void altbeasj_i8751_sim(running_machine *machine) | |
| 1386 | 1386 | { |
| 1387 | altbeast_common_i8751_sim(0x30d4/2, 0x30d0/2); | |
| 1387 | altbeast_common_i8751_sim(machine, 0x30d4/2, 0x30d0/2); | |
| 1388 | 1388 | } |
| 1389 | 1389 | |
| 1390 | static void altbeas5_i8751_sim( | |
| 1390 | static void altbeas5_i8751_sim(running_machine *machine) | |
| 1391 | 1391 | { |
| 1392 | altbeast_common_i8751_sim(0x3098/2, 0x3096/2); | |
| 1392 | altbeast_common_i8751_sim(machine, 0x3098/2, 0x3096/2); | |
| 1393 | 1393 | } |
| 1394 | 1394 | |
| 1395 | static void altbeast_i8751_sim( | |
| 1395 | static void altbeast_i8751_sim(running_machine *machine) | |
| 1396 | 1396 | { |
| 1397 | altbeast_common_i8751_sim(0x30c4/2, 0x30c2/2); | |
| 1397 | altbeast_common_i8751_sim(machine, 0x30c4/2, 0x30c2/2); | |
| 1398 | 1398 | } |
| 1399 | 1399 | |
| 1400 | 1400 | |
| 1401 | static void ddux_i8751_sim( | |
| 1401 | static void ddux_i8751_sim(running_machine *machine) | |
| 1402 | 1402 | { |
| 1403 | 1403 | UINT16 temp; |
| 1404 | 1404 | |
| 1405 | 1405 | /* signal a VBLANK to the main CPU */ |
| 1406 | cpunum_set_input_line( | |
| 1406 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 1407 | 1407 | |
| 1408 | 1408 | /* process any new sound data */ |
| 1409 | 1409 | temp = workram[0x0bd0/2]; |
| 1410 | 1410 | if ((temp & 0xff00) != 0x0000) |
| 1411 | 1411 | { |
| 1412 | segaic16_memory_mapper_w(0x03, temp >> 8); | |
| 1412 | segaic16_memory_mapper_w(machine, 0x03, temp >> 8); | |
| 1413 | 1413 | workram[0x0bd0/2] = temp & 0x00ff; |
| 1414 | 1414 | } |
| 1415 | 1415 | } |
| 1416 | 1416 | |
| 1417 | 1417 | |
| 1418 | static void goldnaxe_i8751_init( | |
| 1418 | static void goldnaxe_i8751_init(running_machine *machine) | |
| 1419 | 1419 | { |
| 1420 | 1420 | static const UINT8 memory_control_5704[0x10] = |
| 1421 | 1421 | { 0x02,0x00, 0x02,0x08, 0x00,0x1f, 0x00,0xff, 0x00,0x20, 0x01,0x10, 0x00,0x14, 0x00,0xc4 }; |
| r1877 | r1878 | |
| 1433 | 1433 | } |
| 1434 | 1434 | } |
| 1435 | 1435 | |
| 1436 | static void goldnaxe_i8751_sim( | |
| 1436 | static void goldnaxe_i8751_sim(running_machine *machine) | |
| 1437 | 1437 | { |
| 1438 | 1438 | UINT16 temp; |
| 1439 | 1439 | |
| 1440 | 1440 | /* signal a VBLANK to the main CPU */ |
| 1441 | cpunum_set_input_line( | |
| 1441 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 1442 | 1442 | |
| 1443 | 1443 | /* they periodically clear the data at 2cd8,2cda,2cdc,2cde and expect the MCU to fill it in */ |
| 1444 | 1444 | if (workram[0x2cd8/2] == 0 && workram[0x2cda/2] == 0 && workram[0x2cdc/2] == 0 && workram[0x2cde/2] == 0) |
| r1877 | r1878 | |
| 1453 | 1453 | temp = workram[0x2cfc/2]; |
| 1454 | 1454 | if ((temp & 0xff00) != 0x0000) |
| 1455 | 1455 | { |
| 1456 | segaic16_memory_mapper_w(0x03, temp >> 8); | |
| 1456 | segaic16_memory_mapper_w(machine, 0x03, temp >> 8); | |
| 1457 | 1457 | workram[0x2cfc/2] = temp & 0x00ff; |
| 1458 | 1458 | } |
| 1459 | 1459 | |
| r1877 | r1878 | |
| 1463 | 1463 | } |
| 1464 | 1464 | |
| 1465 | 1465 | |
| 1466 | static void tturf_i8751_sim( | |
| 1466 | static void tturf_i8751_sim(running_machine *machine) | |
| 1467 | 1467 | { |
| 1468 | 1468 | UINT16 temp; |
| 1469 | 1469 | |
| 1470 | 1470 | /* signal a VBLANK to the main CPU */ |
| 1471 | cpunum_set_input_line( | |
| 1471 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 1472 | 1472 | |
| 1473 | 1473 | /* process any new sound data */ |
| 1474 | 1474 | temp = workram[0x01d0/2]; |
| 1475 | 1475 | if ((temp & 0xff00) != 0x0000) |
| 1476 | 1476 | { |
| 1477 | segaic16_memory_mapper_w(0x03, temp); | |
| 1477 | segaic16_memory_mapper_w(machine, 0x03, temp); | |
| 1478 | 1478 | workram[0x01d0/2] = temp & 0x00ff; |
| 1479 | 1479 | } |
| 1480 | 1480 | |
| r1877 | r1878 | |
| 1485 | 1485 | } |
| 1486 | 1486 | |
| 1487 | 1487 | |
| 1488 | static void wb3_i8751_sim( | |
| 1488 | static void wb3_i8751_sim(running_machine *machine) | |
| 1489 | 1489 | { |
| 1490 | 1490 | UINT16 temp; |
| 1491 | 1491 | |
| 1492 | 1492 | /* signal a VBLANK to the main CPU */ |
| 1493 | cpunum_set_input_line( | |
| 1493 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 1494 | 1494 | |
| 1495 | 1495 | /* process any new sound data */ |
| 1496 | 1496 | temp = workram[0x0008/2]; |
| 1497 | 1497 | if ((temp & 0x00ff) != 0x0000) |
| 1498 | 1498 | { |
| 1499 | segaic16_memory_mapper_w(0x03, temp >> 8); | |
| 1499 | segaic16_memory_mapper_w(machine, 0x03, temp >> 8); | |
| 1500 | 1500 | workram[0x0008/2] = temp & 0xff00; |
| 1501 | 1501 | } |
| 1502 | 1502 | } |
| 1503 | 1503 | |
| 1504 | 1504 | |
| 1505 | static void wrestwar_i8751_sim( | |
| 1505 | static void wrestwar_i8751_sim(running_machine *machine) | |
| 1506 | 1506 | { |
| 1507 | 1507 | UINT16 temp; |
| 1508 | 1508 | |
| 1509 | 1509 | /* signal a VBLANK to the main CPU */ |
| 1510 | cpunum_set_input_line( | |
| 1510 | cpunum_set_input_line(machine, 0, 4, HOLD_LINE); | |
| 1511 | 1511 | |
| 1512 | 1512 | /* process any new sound data */ |
| 1513 | 1513 | temp = workram[0x208e/2]; |
| 1514 | 1514 | if ((temp & 0xff00) != 0x0000) |
| 1515 | 1515 | { |
| 1516 | segaic16_memory_mapper_w(0x03, temp); | |
| 1516 | segaic16_memory_mapper_w(machine, 0x03, temp); | |
| 1517 | 1517 | workram[0x208e/2] = temp & 0x00ff; |
| 1518 | 1518 | } |
| 1519 | 1519 | |
| r1877 | r1878 | |
| 1534 | 1534 | if (ACCESSING_MSB) |
| 1535 | 1535 | switch (offset & 1) |
| 1536 | 1536 | { |
| 1537 | case 0: YM2413_register_port_0_w(0, data >> 8); break; | |
| 1538 | case 1: YM2413_data_port_0_w(0, data >> 8); break; | |
| 1537 | case 0: YM2413_register_port_0_w(machine, 0, data >> 8); break; | |
| 1538 | case 1: YM2413_data_port_0_w(machine, 0, data >> 8); break; | |
| 1539 | 1539 | } |
| 1540 | 1540 | } |
| 1541 | 1541 | |
| r1877 | r1878 | |
| 1565 | 1565 | } |
| 1566 | 1566 | break; |
| 1567 | 1567 | } |
| 1568 | return standard_io_r(offset, mem_mask); | |
| 1568 | return standard_io_r(machine, offset, mem_mask); | |
| 1569 | 1569 | } |
| 1570 | 1570 | |
| 1571 | 1571 | |
| r1877 | r1878 | |
| 1592 | 1592 | } |
| 1593 | 1593 | break; |
| 1594 | 1594 | } |
| 1595 | return standard_io_r(offset, mem_mask); | |
| 1595 | return standard_io_r(machine, offset, mem_mask); | |
| 1596 | 1596 | } |
| 1597 | 1597 | |
| 1598 | 1598 | |
| 1599 | 1599 | static WRITE16_HANDLER( hwchamp_custom_io_w ) |
| 1600 | 1600 | { |
| 1601 | 1601 | static const char *const portname[4] = { "MONITOR", "LEFT", "RIGHT", "DUMMY" }; |
| 1602 | ||
| 1603 | 1602 | switch (offset & (0x3000/2)) |
| 1604 | 1603 | { |
| 1605 | 1604 | case 0x3000/2: |
| r1877 | r1878 | |
| 1620 | 1619 | } |
| 1621 | 1620 | break; |
| 1622 | 1621 | } |
| 1623 | standard_io_w(offset, data, mem_mask); | |
| 1622 | standard_io_w(machine, offset, data, mem_mask); | |
| 1624 | 1623 | } |
| 1625 | 1624 | |
| 1626 | 1625 | |
| r1877 | r1878 | |
| 1645 | 1644 | } |
| 1646 | 1645 | break; |
| 1647 | 1646 | } |
| 1648 | return standard_io_r(offset, mem_mask); | |
| 1647 | return standard_io_r(machine, offset, mem_mask); | |
| 1649 | 1648 | } |
| 1650 | 1649 | |
| 1651 | 1650 | |
| r1877 | r1878 | |
| 1670 | 1669 | } |
| 1671 | 1670 | break; |
| 1672 | 1671 | } |
| 1673 | return standard_io_r(offset, mem_mask); | |
| 1672 | return standard_io_r(machine, offset, mem_mask); | |
| 1674 | 1673 | } |
| 1675 | 1674 | |
| 1676 | 1675 | |
| r1877 | r1878 | |
| 1684 | 1683 | static READ16_HANDLER( sjryuko_custom_io_r ) |
| 1685 | 1684 | { |
| 1686 | 1685 | static const char *const portname[] = { "MJ0", "MJ1", "MJ2", "MJ3", "MJ4", "MJ5" }; |
| 1687 | ||
| 1688 | 1686 | switch (offset & (0x3000/2)) |
| 1689 | 1687 | { |
| 1690 | 1688 | case 0x1000/2: |
| r1877 | r1878 | |
| 1700 | 1698 | } |
| 1701 | 1699 | break; |
| 1702 | 1700 | } |
| 1703 | return standard_io_r(offset, mem_mask); | |
| 1701 | return standard_io_r(machine, offset, mem_mask); | |
| 1704 | 1702 | } |
| 1705 | 1703 | |
| 1706 | 1704 | |
| 1707 | 1705 | static WRITE16_HANDLER( sjryuko_custom_io_w ) |
| 1708 | 1706 | { |
| 1709 | 1707 | static UINT8 last_val; |
| 1710 | ||
| 1711 | 1708 | switch (offset & (0x3000/2)) |
| 1712 | 1709 | { |
| 1713 | 1710 | case 0x0000/2: |
| r1877 | r1878 | |
| 1715 | 1712 | mj_input_num = (mj_input_num + 1) % 6; |
| 1716 | 1713 | break; |
| 1717 | 1714 | } |
| 1718 | standard_io_w(offset, data, mem_mask); | |
| 1715 | standard_io_w(machine, offset, data, mem_mask); | |
| 1719 | 1716 | } |
| 1720 | 1717 | |
| 1721 | 1718 | |
| r1877 | r1878 | |
| 1906 | 1903 | INPUT_PORTS_END |
| 1907 | 1904 | |
| 1908 | 1905 | |
| 1906 | #ifdef UNUSED_DEFINITION | |
| 1909 | 1907 | static INPUT_PORTS_START( generic ) |
| 1910 | 1908 | PORT_INCLUDE( system16b_generic ) |
| 1911 | 1909 | INPUT_PORTS_END |
| 1910 | #endif | |
| 1912 | 1911 | |
| 1913 | 1912 | |
| 1914 | ||
| 1915 | 1913 | /************************************* |
| 1916 | 1914 | * |
| 1917 | 1915 | * Game-specific port definitions |
| r1877 | r1878 | |
| 3217 | 3215 | /* basic machine hardware */ |
| 3218 | 3216 | MDRV_CPU_ADD_TAG("main", M68000, MASTER_CLOCK_10MHz) |
| 3219 | 3217 | MDRV_CPU_PROGRAM_MAP(system16b_map,0) |
| 3220 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 3218 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 3221 | 3219 | |
| 3222 | 3220 | MDRV_CPU_ADD_TAG("sound", Z80, MASTER_CLOCK_10MHz/2) |
| 3223 | 3221 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
| 3252 | 3250 | static MACHINE_DRIVER_START( system16b_8751 ) |
| 3253 | 3251 | MDRV_IMPORT_FROM(system16b) |
| 3254 | 3252 | MDRV_CPU_MODIFY("main") |
| 3255 | MDRV_CPU_VBLANK_INT(i8751_main_cpu_vblank | |
| 3253 | MDRV_CPU_VBLANK_INT("main", i8751_main_cpu_vblank | |
| 3256 | 3254 | |
| 3257 | 3255 | MDRV_CPU_ADD_TAG("mcu", I8751, MASTER_CLOCK_8MHz) |
| 3258 | 3256 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 3259 | 3257 | MDRV_CPU_DATA_MAP(mcu_data_map,0) |
| 3260 | MDRV_CPU_VBLANK_INT(irq0_line_pulse | |
| 3258 | MDRV_CPU_VBLANK_INT("main", irq0_line_pulse | |
| 3261 | 3259 | MACHINE_DRIVER_END |
| 3262 | 3260 | |
| 3263 | 3261 | |
| r1877 | r1878 | |
| 6165 | 6163 | static DRIVER_INIT( goldnaxe_5704 ) |
| 6166 | 6164 | { |
| 6167 | 6165 | DRIVER_INIT_CALL(generic_5704); |
| 6168 | goldnaxe_i8751_init(); | |
| 6166 | goldnaxe_i8751_init(machine); | |
| 6169 | 6167 | i8751_vblank_hook = goldnaxe_i8751_sim; |
| 6170 | 6168 | } |
| 6171 | 6169 | |
| r1877 | r1878 | |
| 6173 | 6171 | static DRIVER_INIT( goldnaxe_5797 ) |
| 6174 | 6172 | { |
| 6175 | 6173 | DRIVER_INIT_CALL(generic_5797); |
| 6176 | goldnaxe_i8751_init(); | |
| 6174 | goldnaxe_i8751_init(machine); | |
| 6177 | 6175 | i8751_vblank_hook = goldnaxe_i8751_sim; |
| 6178 | 6176 | } |
| 6179 | 6177 |
| r1877 | r1878 | |
|---|---|---|
| 198 | 198 | /* basic machine hardware */ |
| 199 | 199 | MDRV_CPU_ADD(M68000,24000000/2) /* 12 MHz */ |
| 200 | 200 | MDRV_CPU_PROGRAM_MAP(thoop2_readmem,thoop2_writemem) |
| 201 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 201 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 202 | 202 | |
| 203 | 203 | /* video hardware */ |
| 204 | 204 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 128 | 128 | static WRITE16_HANDLER( wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_w ) |
| 129 | 129 | { |
| 130 | 130 | offset = (offset & 0x000f) | (offset & 0x7fc0) >> 2; |
| 131 | paletteram16_xxxxBBBBGGGGRRRR_word_w (offset, data, mem_mask); | |
| 131 | paletteram16_xxxxBBBBGGGGRRRR_word_w (machine, offset, data, mem_mask); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | /*- Priority Control -*/ |
| r1877 | r1878 | |
| 199 | 199 | |
| 200 | 200 | static WRITE16_HANDLER ( wwfwfest_soundwrite ) |
| 201 | 201 | { |
| 202 | soundlatch_w(1,data & 0xff); | |
| 203 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 202 | soundlatch_w(machine,1,data & 0xff); | |
| 203 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE ); | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | /******************************************************************************* |
| r1877 | r1878 | |
| 393 | 393 | |
| 394 | 394 | static VIDEO_EOF( wwfwfest ) |
| 395 | 395 | { |
| 396 | buffer_spriteram16_w(0,0,0); | |
| 396 | buffer_spriteram16_w(machine,0,0,0); | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | /******************************************************************************* |
| r1877 | r1878 | |
| 405 | 405 | /* basic machine hardware */ |
| 406 | 406 | MDRV_CPU_ADD(M68000, 24000000/2) /* 24 crystal, 12 rated chip */ |
| 407 | 407 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 408 | MDRV_CPU_VBLANK_INT(wwfwfest_interrupt,2) | |
| 408 | MDRV_CPU_VBLANK_INT_HACK(wwfwfest_interrupt,2) | |
| 409 | 409 | |
| 410 | 410 | MDRV_CPU_ADD(Z80, 3579545) |
| 411 | 411 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 511 | 511 | MDRV_CPU_ADD_TAG("main", Z80, 3072000) /* 3.072 MHz */ |
| 512 | 512 | MDRV_CPU_PROGRAM_MAP(marineb_map,0) |
| 513 | 513 | MDRV_CPU_IO_MAP(marineb_io_map,0) |
| 514 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 514 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 515 | 515 | |
| 516 | 516 | MDRV_MACHINE_RESET(marineb) |
| 517 | 517 | |
| r1877 | r1878 | |
| 576 | 576 | MDRV_IMPORT_FROM(marineb) |
| 577 | 577 | MDRV_CPU_MODIFY("main") |
| 578 | 578 | MDRV_CPU_IO_MAP(wanted_io_map,0) |
| 579 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 579 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 580 | 580 | |
| 581 | 581 | /* video hardware */ |
| 582 | 582 | MDRV_GFXDECODE(wanted) |
| r1877 | r1878 | |
|---|---|---|
| 347 | 347 | /* basic machine hardware */ |
| 348 | 348 | MDRV_CPU_ADD(M68000, 14000000) |
| 349 | 349 | MDRV_CPU_PROGRAM_MAP(pktgaldx_map,0) |
| 350 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 350 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 351 | 351 | |
| 352 | 352 | /* video hardware */ |
| 353 | 353 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 382 | 382 | /* basic machine hardware */ |
| 383 | 383 | MDRV_CPU_ADD(M68000, 16000000) |
| 384 | 384 | MDRV_CPU_PROGRAM_MAP(pktgaldb_readmem,pktgaldb_writemem) |
| 385 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 385 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 386 | 386 | |
| 387 | 387 | /* video hardware */ |
| 388 | 388 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 323 | 323 | /* basic machine hardware */ |
| 324 | 324 | MDRV_CPU_ADD(Z80, MASTER_CLOCK/3/2) /* not confirmed, but common for Konami games of the era */ |
| 325 | 325 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 326 | MDRV_CPU_VBLANK_INT(timeplt_interrupt | |
| 326 | MDRV_CPU_VBLANK_INT("main", timeplt_interrupt | |
| 327 | 327 | |
| 328 | 328 | MDRV_MACHINE_START(timeplt) |
| 329 | 329 |
| r1877 | r1878 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | static READ8_HANDLER( psg_4015_r ) |
| 53 | 53 | { |
| 54 | return NESPSG_0_r(0x15); | |
| 54 | return NESPSG_0_r(machine, 0x15); | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | static WRITE8_HANDLER( psg_4015_w ) |
| 58 | 58 | { |
| 59 | NESPSG_0_w(0x15, data); | |
| 59 | NESPSG_0_w(machine, 0x15, data); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | static WRITE8_HANDLER( psg_4017_w ) |
| 63 | 63 | { |
| 64 | NESPSG_0_w(0x17, data); | |
| 64 | NESPSG_0_w(machine, 0x17, data); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /* Inputs */ |
| r1877 | r1878 | |
| 216 | 216 | { |
| 217 | 217 | /* reset the ppu */ |
| 218 | 218 | ppu2c0x_reset( 0, 1 ); |
| 219 | } | |
| 219 | } | |
| 220 | 220 | |
| 221 | 221 | static PALETTE_INIT( multigam ) |
| 222 | 222 | { |
| r1877 | r1878 | |
| 254 | 254 | |
| 255 | 255 | static DRIVER_INIT( multigam ) |
| 256 | 256 | { |
| 257 | multigam_mapper_w( 0x0fff, 0x01 ); | |
| 257 | multigam_mapper_w( machine, 0x0fff, 0x01 ); | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | static GFXDECODE_START( multigam ) |
| r1877 | r1878 | |
|---|---|---|
| 1433 | 1433 | /* basic machine hardware */ |
| 1434 | 1434 | MDRV_CPU_ADD(M68EC020, ATARI_CLOCK_14MHz) |
| 1435 | 1435 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 1436 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 1436 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 1437 | 1437 | |
| 1438 | 1438 | MDRV_MACHINE_RESET(atarigx2) |
| 1439 | 1439 | MDRV_NVRAM_HANDLER(atarigen) |
| r1877 | r1878 | |
| 1717 | 1717 | ROM_END |
| 1718 | 1718 | |
| 1719 | 1719 | |
| 1720 | #ifdef UNUSED_DEFINITION | |
| 1720 | 1721 | ROM_START( motofrei ) |
| 1721 | 1722 | ROM_REGION( 0x80000, REGION_CPU1, 0 ) /* 8*64k for 68000 code */ |
| 1722 | 1723 | ROM_LOAD32_BYTE( "motoi0.094", 0x000000, 0x020000, CRC(a2ed9656) SHA1(7473400ee26e72d8ca51dd1f84a6c3bf0c5a72e9) ) |
| r1877 | r1878 | |
| 1760 | 1761 | ROM_LOAD( "094-002a.bin", 0x0200, 0x0200, CRC(f4768b4d) SHA1(a506fa5386ab0ea2851ff1f8474d4bfc66deaa70) ) |
| 1761 | 1762 | ROM_LOAD( "094-003a.bin", 0x0400, 0x0200, CRC(22a76ad4) SHA1(ce840c283bbd3a5f19dc8d91b19d1571eff51ff4) ) |
| 1762 | 1763 | ROM_END |
| 1764 | #endif | |
| 1763 | 1765 | |
| 1764 | ||
| 1766 | #ifdef UNUSED_DEFINITION | |
| 1765 | 1767 | ROM_START( motofreg ) |
| 1766 | 1768 | ROM_REGION( 0x80000, REGION_CPU1, 0 ) /* 8*64k for 68000 code */ |
| 1767 | 1769 | ROM_LOAD32_BYTE( "motog0.094", 0x000000, 0x020000, CRC(1b205eed) SHA1(e5bcabd6b0b8e7f06e9be0f7f66c86d09840d876) ) |
| r1877 | r1878 | |
| 1805 | 1807 | ROM_LOAD( "094-002a.bin", 0x0200, 0x0200, CRC(f4768b4d) SHA1(a506fa5386ab0ea2851ff1f8474d4bfc66deaa70) ) |
| 1806 | 1808 | ROM_LOAD( "094-003a.bin", 0x0400, 0x0200, CRC(22a76ad4) SHA1(ce840c283bbd3a5f19dc8d91b19d1571eff51ff4) ) |
| 1807 | 1809 | ROM_END |
| 1810 | #endif | |
| 1808 | 1811 | |
| 1809 | ||
| 1812 | #ifdef UNUSED_DEFINITION | |
| 1810 | 1813 | ROM_START( motofmdg ) |
| 1811 | 1814 | ROM_REGION( 0x80000, REGION_CPU1, 0 ) /* 8*64k for 68000 code */ |
| 1812 | 1815 | ROM_LOAD32_BYTE( "mdg0.094", 0x000000, 0x020000, CRC(5839b940) SHA1(0b331869e938a7e344d4a514a8b70d26f5d1fc14) ) |
| r1877 | r1878 | |
| 1850 | 1853 | ROM_LOAD( "094-002a.bin", 0x0200, 0x0200, CRC(f4768b4d) SHA1(a506fa5386ab0ea2851ff1f8474d4bfc66deaa70) ) |
| 1851 | 1854 | ROM_LOAD( "094-003a.bin", 0x0400, 0x0200, CRC(22a76ad4) SHA1(ce840c283bbd3a5f19dc8d91b19d1571eff51ff4) ) |
| 1852 | 1855 | ROM_END |
| 1856 | #endif | |
| 1853 | 1857 | |
| 1854 | ||
| 1855 | 1858 | ROM_START( motofrft ) |
| 1856 | 1859 | ROM_REGION( 0x80000, REGION_CPU1, 0 ) /* 8*64k for 68000 code */ |
| 1857 | 1860 | ROM_LOAD32_BYTE( "ft0.094", 0x000000, 0x020000, CRC(99158754) SHA1(46e73a465aceb147e1ca1bd982448079880cc47e) ) |
| r1877 | r1878 | |
|---|---|---|
| 78 | 78 | { |
| 79 | 79 | if (ACCESSING_LSB) |
| 80 | 80 | { |
| 81 | soundlatch_w(0,data & 0xff); | |
| 82 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 81 | soundlatch_w(machine,0,data & 0xff); | |
| 82 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 83 | 83 | // cpu_spinuntil_time(ATTOTIME_IN_USEC(50)); // Allow the other CPU to reply |
| 84 | 84 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(50)); // Fixes glitching in rasters |
| 85 | 85 | } |
| r1877 | r1878 | |
|---|---|---|
| 329 | 329 | } |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | void K001604_draw_back_layer(int chip, | |
| 332 | void K001604_draw_back_layer(int chip, | |
| 333 | 333 | { |
| 334 | 334 | int layer; |
| 335 | 335 | int num_layers; |
| r1877 | r1878 | |
| 363 | 363 | } |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | void K001604_draw_front_layer(int chip, | |
| 366 | void K001604_draw_front_layer(int chip, | |
| 367 | 367 | { |
| 368 | 368 | //tilemap_draw(bitmap, cliprect, K001604_layer_8x8[chip][1], 0,0); |
| 369 | 369 | tilemap_draw(bitmap, cliprect, K001604_layer_8x8[chip][0], 0,0); |
| r1877 | r1878 | |
|---|---|---|
| 248 | 248 | /* basic machine hardware */ |
| 249 | 249 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz (?) */ |
| 250 | 250 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 251 | MDRV_CPU_VBLANK_INT(vulgus_interrupt,2) | |
| 251 | MDRV_CPU_VBLANK_INT_HACK(vulgus_interrupt,2) | |
| 252 | 252 | |
| 253 | 253 | MDRV_CPU_ADD(Z80, 3000000) |
| 254 | 254 | /* audio CPU */ /* 3 MHz ??? */ |
| 255 | 255 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 256 | MDRV_CPU_VBLANK_INT(irq0_line_hold,8) | |
| 256 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,8) | |
| 257 | 257 | |
| 258 | 258 | /* video hardware */ |
| 259 | 259 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 31 | 31 | ***************************************************************************/ |
| 32 | 32 | |
| 33 | 33 | #include "driver.h" |
| 34 | #include "deprecat.h" | |
| 34 | 35 | #include "sound/samples.h" |
| 35 | 36 | #include "circus.h" |
| 36 | 37 | |
| r1877 | r1878 | |
| 272 | 273 | /* basic machine hardware */ |
| 273 | 274 | MDRV_CPU_ADD(M6502,11289000/16) /* 705.562kHz */ |
| 274 | 275 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 275 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 276 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 276 | 277 | |
| 277 | 278 | /* video hardware */ |
| 278 | 279 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 307 | 308 | /* basic machine hardware */ |
| 308 | 309 | MDRV_CPU_ADD(M6502,11289000/16) /* 705.562kHz */ |
| 309 | 310 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 310 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 311 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 311 | 312 | |
| 312 | 313 | /* video hardware */ |
| 313 | 314 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 341 | 342 | /* basic machine hardware */ |
| 342 | 343 | MDRV_CPU_ADD(M6502,11289000/16) /* 705.562kHz */ |
| 343 | 344 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 344 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 345 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 345 | 346 | |
| 346 | 347 | /* video hardware */ |
| 347 | 348 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 375 | 376 | /* basic machine hardware */ |
| 376 | 377 | MDRV_CPU_ADD(M6502, 705562) /* 11.289MHz / 16 */ |
| 377 | 378 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 378 | //MDRV_CPU_VBLANK_INT(ripcord_interrupt | |
| 379 | //MDRV_CPU_VBLANK_INT("main", ripcord_interrupt | |
| 379 | 380 | |
| 380 | 381 | /* video hardware */ |
| 381 | 382 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 253 | 253 | static MACHINE_DRIVER_START( sderby ) |
| 254 | 254 | MDRV_CPU_ADD(M68000, 12000000) |
| 255 | 255 | MDRV_CPU_PROGRAM_MAP(sderby_readmem,sderby_writemem) |
| 256 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 256 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 257 | 257 | |
| 258 | 258 | MDRV_GFXDECODE(sderby) |
| 259 | 259 | |
| r1877 | r1878 | |
| 281 | 281 | static MACHINE_DRIVER_START( pmroulet ) |
| 282 | 282 | MDRV_CPU_ADD(M68000, 12000000) |
| 283 | 283 | MDRV_CPU_PROGRAM_MAP(roulette_map,0) |
| 284 | MDRV_CPU_VBLANK_INT(irq2_line_hold | |
| 284 | MDRV_CPU_VBLANK_INT("main", irq2_line_hold | |
| 285 | 285 | |
| 286 | 286 | MDRV_GFXDECODE(sderby) |
| 287 | 287 |
| r1877 | r1878 | |
|---|---|---|
| 23 | 23 | VIDEO_START( tinvader ); |
| 24 | 24 | VIDEO_UPDATE( tinvader ); |
| 25 | 25 | |
| 26 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 27 | AM_RANGE(0x0000, 0x17ff) AM_READ(MRA8_ROM) | |
| 28 | AM_RANGE(0x1800, 0x1bff) AM_READ(MRA8_RAM) | |
| 29 | AM_RANGE(0x1c00, 0x1cff) AM_READ(MRA8_RAM) | |
| 30 | AM_RANGE(0x1d00, 0x1dff) AM_READ(MRA8_RAM) | |
| 31 | AM_RANGE(0x1e80, 0x1e80) AM_READ(tinvader_port_0_r) | |
| 32 | AM_RANGE(0x1e81, 0x1e81) AM_READ(input_port_1_r) | |
| 26 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 27 | AM_RANGE(0x0000, 0x17ff) AM_ROM | |
| 28 | AM_RANGE(0x1800, 0x1bff) AM_READWRITE(MRA8_RAM, tinvader_videoram_w) AM_BASE(&videoram) | |
| 29 | AM_RANGE(0x1c00, 0x1cff) AM_RAM | |
| 30 | AM_RANGE(0x1d00, 0x1dff) AM_RAM | |
| 31 | AM_RANGE(0x1e80, 0x1e80) AM_READWRITE(tinvader_port_0_r, tinvader_sound_w) | |
| 32 | AM_RANGE(0x1e81, 0x1e81) AM_READ(input_port_1_r) | |
| 33 | 33 | AM_RANGE(0x1e82, 0x1e82) AM_READ(input_port_2_r) |
| 34 | AM_RANGE(0x1e85, 0x1e85) AM_READ(input_port_4_r) /* Dodgem Only */ | |
| 35 | AM_RANGE(0x1e86, 0x1e86) AM_READ(input_port_5_r) /* Dodgem Only */ | |
| 36 | AM_RANGE(0x1f00, 0x1fff) AM_READ(zac_s2636_r) /* S2636 Chip */ | |
| 34 | AM_RANGE(0x1e85, 0x1e85) AM_READ(input_port_4_r) /* Dodgem Only */ | |
| 35 | AM_RANGE(0x1e86, 0x1e86) AM_READWRITE(input_port_5_r, MWA8_NOP) /* Dodgem Only */ | |
| 36 | AM_RANGE(0x1f00, 0x1fff) AM_READWRITE(zac_s2636_r, MWA8_RAM) AM_BASE(&zac2650_s2636_0_ram) | |
| 37 | 37 | ADDRESS_MAP_END |
| 38 | 38 | |
| 39 | ||
| 40 | static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 41 | AM_RANGE(0x0000, 0x17ff) AM_WRITE(MWA8_ROM) | |
| 42 | AM_RANGE(0x1800, 0x1bff) AM_WRITE(tinvader_videoram_w) AM_BASE(&videoram) | |
| 43 | AM_RANGE(0x1c00, 0x1cff) AM_WRITE(MWA8_RAM) | |
| 44 | AM_RANGE(0x1d00, 0x1dff) AM_WRITE(MWA8_RAM) | |
| 45 | AM_RANGE(0x1e80, 0x1e80) AM_WRITE(tinvader_sound_w) | |
| 46 | AM_RANGE(0x1e86, 0x1e86) AM_WRITE(MWA8_NOP) /* Dodgem Only */ | |
| 47 | AM_RANGE(0x1f00, 0x1fff) AM_WRITE(MWA8_RAM) AM_BASE(&zac2650_s2636_0_ram) | |
| 48 | ADDRESS_MAP_END | |
| 49 | ||
| 50 | static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 ) | |
| 39 | static ADDRESS_MAP_START( port_map, ADDRESS_SPACE_IO, 8 ) | |
| 51 | 40 | AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(input_port_3_r) |
| 52 | 41 | ADDRESS_MAP_END |
| 53 | 42 | |
| r1877 | r1878 | |
| 320 | 309 | |
| 321 | 310 | /* basic machine hardware */ |
| 322 | 311 | MDRV_CPU_ADD(S2650, 3800000/4) |
| 323 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) | |
| 324 | MDRV_CPU_IO_MAP(readport,0) | |
| 312 | MDRV_CPU_PROGRAM_MAP(main_map, 0) | |
| 313 | MDRV_CPU_IO_MAP(port_map,0) | |
| 325 | 314 | |
| 326 | 315 | /* video hardware */ |
| 327 | 316 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 88 | 88 | static INPUT_PORTS_START( vcombat ) |
| 89 | 89 | INPUT_PORTS_END |
| 90 | 90 | |
| 91 | static VIDEO_UPDATE( vcombat ) | |
| 92 | { | |
| 93 | return 0; | |
| 94 | } | |
| 91 | 95 | |
| 92 | 96 | static MACHINE_DRIVER_START( vcombat ) |
| 93 | 97 | MDRV_CPU_ADD_TAG("main", M68000, XTAL_12MHz) |
| r1877 | r1878 | |
| 110 | 114 | |
| 111 | 115 | MDRV_PALETTE_LENGTH(0x100) |
| 112 | 116 | |
| 113 | MDRV_VIDEO_START(generic_bitmapped) | |
| 114 | MDRV_VIDEO_UPDATE(generic_bitmapped) | |
| 117 | MDRV_VIDEO_UPDATE(vcombat) | |
| 115 | 118 | MACHINE_DRIVER_END |
| 116 | 119 | |
| 117 | 120 |
| r1877 | r1878 | |
|---|---|---|
| 105 | 105 | { |
| 106 | 106 | if (ACCESSING_LSB) |
| 107 | 107 | { |
| 108 | soundlatch_w(0,data & 0xff); | |
| 109 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); /* RST 38h */ | |
| 108 | soundlatch_w(machine,0,data & 0xff); | |
| 109 | cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff); /* RST 38h */ | |
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | |
| r1877 | r1878 | |
| 499 | 499 | /* basic machine hardware */ |
| 500 | 500 | MDRV_CPU_ADD(M68000, 8000000) |
| 501 | 501 | MDRV_CPU_PROGRAM_MAP(shangha3_readmem,shangha3_writemem) |
| 502 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 502 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 503 | 503 | |
| 504 | 504 | /* video hardware */ |
| 505 | 505 | MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS ) |
| r1877 | r1878 | |
| 535 | 535 | /* basic machine hardware */ |
| 536 | 536 | MDRV_CPU_ADD(M68000, 8000000) |
| 537 | 537 | MDRV_CPU_PROGRAM_MAP(heberpop_readmem,heberpop_writemem) |
| 538 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 538 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 539 | 539 | |
| 540 | 540 | MDRV_CPU_ADD(Z80, 6000000) /* 6 MHz ??? */ |
| 541 | 541 | MDRV_CPU_PROGRAM_MAP(heberpop_sound_readmem,heberpop_sound_writemem) |
| r1877 | r1878 | |
| 577 | 577 | /* basic machine hardware */ |
| 578 | 578 | MDRV_CPU_ADD(M68000, 8000000) |
| 579 | 579 | MDRV_CPU_PROGRAM_MAP(blocken_readmem,blocken_writemem) |
| 580 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 580 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 581 | 581 | |
| 582 | 582 | MDRV_CPU_ADD(Z80, 6000000) /* 6 MHz ??? */ |
| 583 | 583 | MDRV_CPU_PROGRAM_MAP(heberpop_sound_readmem,heberpop_sound_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 49 | 49 | { |
| 50 | 50 | switch (offset) |
| 51 | 51 | { |
| 52 | case 0: YM2203_control_port_0_w(0,data & 0xff);break; | |
| 53 | case 1: YM2203_write_port_0_w(0,data & 0xff);break; | |
| 52 | case 0: YM2203_control_port_0_w(machine,0,data & 0xff);break; | |
| 53 | case 1: YM2203_write_port_0_w(machine,0,data & 0xff);break; | |
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | static READ16_HANDLER( pkscramble_YM2203_r ) |
| 58 | 58 | { |
| 59 | return YM2203_status_port_0_r(0); | |
| 59 | return YM2203_status_port_0_r(machine,0); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | // input bit 0x20 in port1 should stay low until bit 0x20 is written here, then |
| r1877 | r1878 | |
| 285 | 285 | /* basic machine hardware */ |
| 286 | 286 | MDRV_CPU_ADD(M68000, 8000000 ) |
| 287 | 287 | MDRV_CPU_PROGRAM_MAP(pkscramble_map,0) |
| 288 | //MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 288 | //MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 289 | 289 | |
| 290 | 290 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 291 | 291 |
| r1877 | r1878 | |
|---|---|---|
| 327 | 327 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz ???? */ |
| 328 | 328 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 329 | 329 | MDRV_CPU_IO_MAP(0,writeport) |
| 330 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 330 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 331 | 331 | |
| 332 | 332 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz ???? */ |
| 333 | 333 | MDRV_CPU_PROGRAM_MAP(cpu2_readmem,cpu2_writemem) |
| 334 | 334 | MDRV_CPU_IO_MAP(cpu2_readport,cpu2_writeport) |
| 335 | MDRV_CPU_VBLANK_INT(irq0_line_hold,4) /* ??? */ | |
| 335 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* ??? */ | |
| 336 | 336 | |
| 337 | 337 | MDRV_INTERLEAVE(10) /* 10 CPU slices per frame - seems enough to ensure proper */ |
| 338 | 338 | /* synchronization of the CPUs */ |
| r1877 | r1878 | |
|---|---|---|
| 28 | 28 | static INPUT_PORTS_START( 39in1 ) |
| 29 | 29 | INPUT_PORTS_END |
| 30 | 30 | |
| 31 | static VIDEO_UPDATE( 39in1 ) | |
| 32 | { | |
| 33 | return 0; | |
| 34 | } | |
| 35 | ||
| 31 | 36 | static MACHINE_DRIVER_START( 39in1 ) |
| 32 | 37 | MDRV_CPU_ADD(ARM7, 200000000) // actually Xscale PXA255, but ARM7 is a compatible subset |
| 33 | 38 | MDRV_CPU_PROGRAM_MAP(39in1_map,0) |
| r1877 | r1878 | |
| 38 | 43 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 39 | 44 | MDRV_SCREEN_RAW_PARAMS(16777216/4, 308, 0, 240, 228, 0, 160) // completely bogus for this h/w |
| 40 | 45 | |
| 41 | MDRV_VIDEO_START(generic_bitmapped) | |
| 42 | MDRV_VIDEO_UPDATE(generic_bitmapped) | |
| 46 | MDRV_VIDEO_UPDATE(39in1) | |
| 43 | 47 | |
| 44 | 48 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 45 | 49 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
|---|---|---|
| 94 | 94 | if (ACCESSING_LSB) |
| 95 | 95 | { |
| 96 | 96 | pending_command = 1; |
| 97 | soundlatch_w(offset,data & 0xff); | |
| 98 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 97 | soundlatch_w(machine,offset,data & 0xff); | |
| 98 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | static ADDRESS_MAP_START( taotaido_readmem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1877 | r1878 | |
| 360 | 360 | static MACHINE_DRIVER_START( taotaido ) |
| 361 | 361 | MDRV_CPU_ADD(M68000, 32000000/2) |
| 362 | 362 | MDRV_CPU_PROGRAM_MAP(taotaido_readmem,taotaido_writemem) |
| 363 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 363 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 364 | 364 | |
| 365 | 365 | MDRV_CPU_ADD(Z80,20000000/4) // ?? |
| 366 | 366 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 147 | 147 | MDRV_CPU_PROGRAM_MAP(fortecar_map,0) |
| 148 | 148 | MDRV_CPU_IO_MAP(fortecar_ports,0) |
| 149 | 149 | |
| 150 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 150 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 151 | 151 | |
| 152 | 152 | /* video hardware */ |
| 153 | 153 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 135 | 135 | |
| 136 | 136 | static READ16_HANDLER( adpcm_r ) |
| 137 | 137 | { |
| 138 | return OKIM6295_status_0_r(offset) | 0xff00; | |
| 138 | return OKIM6295_status_0_r(machine, offset) | 0xff00; | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | |
| 142 | 142 | static WRITE16_HANDLER( adpcm_w ) |
| 143 | 143 | { |
| 144 | 144 | if (ACCESSING_LSB) |
| 145 | OKIM6295_data_0_w(offset, data & 0xff); | |
| 145 | OKIM6295_data_0_w(machine, offset, data & 0xff); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | |
| r1877 | r1878 | |
| 158 | 158 | if (ACCESSING_LSB) |
| 159 | 159 | { |
| 160 | 160 | if (offset & 1) |
| 161 | YM2413_data_port_0_w(0, data & 0xff); | |
| 161 | YM2413_data_port_0_w(machine, 0, data & 0xff); | |
| 162 | 162 | else |
| 163 | YM2413_register_port_0_w(0, data & 0xff); | |
| 163 | YM2413_register_port_0_w(machine, 0, data & 0xff); | |
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 |
| r1877 | r1878 | |
|---|---|---|
| 124 | 124 | MDRV_CPU_ADD(V30, 57242400 / 4) |
| 125 | 125 | MDRV_CPU_PROGRAM_MAP(mem_map,0) |
| 126 | 126 | MDRV_CPU_IO_MAP(io_map,0) |
| 127 | MDRV_CPU_VBLANK_INT(gunpey_interrupt | |
| 127 | MDRV_CPU_VBLANK_INT("main", gunpey_interrupt | |
| 128 | 128 | |
| 129 | 129 | /* video hardware */ |
| 130 | 130 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 86 | 86 | switch (offset) |
| 87 | 87 | { |
| 88 | 88 | case 0x00: /* Watchdog */ |
| 89 | watchdog_reset | |
| 89 | watchdog_reset | |
| 90 | 90 | return; |
| 91 | 91 | case 0x01: /* Coin counters & lockouts */ |
| 92 | 92 | if (ACCESSING_MSB32) { |
| r1877 | r1878 | |
| 442 | 442 | /* basic machine hardware */ |
| 443 | 443 | MDRV_CPU_ADD(M68EC020, 16000000) |
| 444 | 444 | MDRV_CPU_PROGRAM_MAP(f3_readmem,f3_writemem) |
| 445 | MDRV_CPU_VBLANK_INT(f3_interrupt2 | |
| 445 | MDRV_CPU_VBLANK_INT("main", f3_interrupt2 | |
| 446 | 446 | |
| 447 | 447 | TAITO_F3_SOUND_SYSTEM_CPU(16000000) |
| 448 | 448 |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | { 0,1,2,3,4,5,6,7, 16*8+0,16*8+1,16*8+2,16*8+3,16*8+4,16*8+5,16*8+6,16*8+7 }, \ |
| 62 | 62 | { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8, 8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8 }, \ |
| 63 | 63 | 32*8 \ |
| 64 | } | |
| 64 | }; | |
| 65 | 65 | |
| 66 | 66 | #define GFXDECODEINFO(NUM,ENTRIES) \ |
| 67 | 67 | static GFXDECODE_START( NUM )\ |
| r1877 | r1878 | |
| 69 | 69 | GFXDECODE_END |
| 70 | 70 | |
| 71 | 71 | |
| 72 | TILELAYOUT16(0x0080000); | |
| 73 | GFXDECODEINFO(0x0080000, 128); | |
| 74 | TILELAYOUT16(0x0200000); | |
| 75 | GFXDECODEINFO(0x0200000, 128); | |
| 76 | TILELAYOUT16(0x0400000); | |
| 77 | GFXDECODEINFO(0x0400000, 128); | |
| 72 | TILELAYOUT16(0x0080000) | |
| 73 | GFXDECODEINFO(0x0080000, 128) | |
| 74 | TILELAYOUT16(0x0200000) | |
| 75 | GFXDECODEINFO(0x0200000, 128) | |
| 76 | TILELAYOUT16(0x0400000) | |
| 77 | GFXDECODEINFO(0x0400000, 128) | |
| 78 | 78 | |
| 79 | 79 | |
| 80 | 80 | /*============================================================================ |
| r1877 | r1878 | |
| 193 | 193 | /* basic machine hardware */ |
| 194 | 194 | MDRV_CPU_ADD(M68000, 26000000/2) /* 13 MHz? */ |
| 195 | 195 | MDRV_CPU_PROGRAM_MAP(maniacsq_readmem, maniacsq_writemem) |
| 196 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 196 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 197 | 197 | |
| 198 | 198 | /* video hardware */ |
| 199 | 199 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r1877 | r1878 | |
| 346 | 346 | /* basic machine hardware */ |
| 347 | 347 | MDRV_CPU_ADD(M68000, 30000000/2) /* 15 MHz */ |
| 348 | 348 | MDRV_CPU_PROGRAM_MAP(bang_readmem, bang_writemem) |
| 349 | MDRV_CPU_VBLANK_INT(bang_interrupt, 6) | |
| 349 | MDRV_CPU_VBLANK_INT_HACK(bang_interrupt, 6) | |
| 350 | 350 | |
| 351 | 351 | MDRV_NVRAM_HANDLER(gaelco2) |
| 352 | 352 | |
| r1877 | r1878 | |
| 551 | 551 | /* basic machine hardware */ |
| 552 | 552 | MDRV_CPU_ADD(M68000, 24000000/2) /* 12 MHz */ |
| 553 | 553 | MDRV_CPU_PROGRAM_MAP(alighunt_readmem, alighunt_writemem) |
| 554 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 554 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 555 | 555 | |
| 556 | 556 | /* video hardware */ |
| 557 | 557 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r1877 | r1878 | |
| 814 | 814 | /* basic machine hardware */ |
| 815 | 815 | MDRV_CPU_ADD(M68000, 32000000/2) /* 16 MHz */ |
| 816 | 816 | MDRV_CPU_PROGRAM_MAP(touchgo_readmem, touchgo_writemem) |
| 817 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 817 | MDRV_CPU_VBLANK_INT("left", irq6_line_hold | |
| 818 | 818 | |
| 819 | 819 | /* video hardware */ |
| 820 | 820 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r1877 | r1878 | |
| 1017 | 1017 | /* basic machine hardware */ |
| 1018 | 1018 | MDRV_CPU_ADD(M68000, 30000000/2) /* 15 MHz */ |
| 1019 | 1019 | MDRV_CPU_PROGRAM_MAP(snowboar_readmem, snowboar_writemem) |
| 1020 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 1020 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 1021 | 1021 | |
| 1022 | 1022 | MDRV_NVRAM_HANDLER(gaelco2) |
| 1023 | 1023 | |
| r1877 | r1878 | |
| 1262 | 1262 | /* basic machine hardware */ |
| 1263 | 1263 | MDRV_CPU_ADD(M68000, 26000000/2) /* 13 MHz */ |
| 1264 | 1264 | MDRV_CPU_PROGRAM_MAP(wrally2_readmem, wrally2_writemem) |
| 1265 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 1265 | MDRV_CPU_VBLANK_INT("left", irq6_line_hold | |
| 1266 | 1266 | |
| 1267 | 1267 | MDRV_NVRAM_HANDLER(gaelco2) |
| 1268 | 1268 |
| r1877 | r1878 | |
|---|---|---|
| 92 | 92 | static READ8_HANDLER(homerun_40_r) |
| 93 | 93 | { |
| 94 | 94 | if(video_screen_get_vpos(0)>116) |
| 95 | return input_port_0_r(0)|0x40; | |
| 95 | return input_port_0_r(machine,0)|0x40; | |
| 96 | 96 | else |
| 97 | return input_port_0_r(0); | |
| 97 | return input_port_0_r(machine,0); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | static ADDRESS_MAP_START( homerun_iomap, ADDRESS_SPACE_IO, 8 ) |
| r1877 | r1878 | |
| 189 | 189 | MDRV_CPU_ADD(Z80, 5000000) |
| 190 | 190 | MDRV_CPU_PROGRAM_MAP(homerun_memmap, 0) |
| 191 | 191 | MDRV_CPU_IO_MAP(homerun_iomap, 0) |
| 192 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 192 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 193 | 193 | |
| 194 | 194 | MDRV_MACHINE_RESET(homerun) |
| 195 | 195 |
| r1877 | r1878 | |
|---|---|---|
| 268 | 268 | /* main cpu */ |
| 269 | 269 | MDRV_CPU_ADD(Z80, 18432000/6) |
| 270 | 270 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 271 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 271 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 272 | 272 | |
| 273 | 273 | /* audio CPU */ |
| 274 | 274 | MDRV_CPU_ADD(Z80, 18432000/6) |
| r1877 | r1878 | |
|---|---|---|
| 438 | 438 | /* basic machine hardware */ |
| 439 | 439 | MDRV_CPU_ADD(M6809,49152000/32) |
| 440 | 440 | MDRV_CPU_PROGRAM_MAP(baraduke_map,0) |
| 441 | MDRV_CPU_VBLANK_INT(irq0_line_assert | |
| 441 | MDRV_CPU_VBLANK_INT("main", irq0_line_assert | |
| 442 | 442 | |
| 443 | 443 | MDRV_CPU_ADD(HD63701,49152000/8) |
| 444 | 444 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 445 | 445 | MDRV_CPU_IO_MAP(mcu_port_map,0) |
| 446 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 446 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 447 | 447 | |
| 448 | 448 | MDRV_INTERLEAVE(100) /* we need heavy synch */ |
| 449 | 449 |
| r1877 | r1878 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | static WRITE8_HANDLER( ssozumo_sh_command_w ) |
| 53 | 53 | { |
| 54 | soundlatch_w(offset, data); | |
| 55 | cpunum_set_input_line(Machine, 1, M6502_IRQ_LINE, HOLD_LINE); | |
| 54 | soundlatch_w(machine, offset, data); | |
| 55 | cpunum_set_input_line(machine, 1, M6502_IRQ_LINE, HOLD_LINE); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| r1877 | r1878 | |
| 235 | 235 | /* basic machine hardware */ |
| 236 | 236 | MDRV_CPU_ADD(M6502, 1200000) /* 1.2 MHz ???? */ |
| 237 | 237 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 238 | MDRV_CPU_VBLANK_INT(ssozumo_interrupt | |
| 238 | MDRV_CPU_VBLANK_INT("main", ssozumo_interrupt | |
| 239 | 239 | |
| 240 | 240 | MDRV_CPU_ADD(M6502, 975000) |
| 241 | 241 | /* audio CPU */ /* 975 kHz ?? */ |
| 242 | 242 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 243 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,16) /* IRQs are triggered by the main CPU */ | |
| 243 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,16) /* IRQs are triggered by the main CPU */ | |
| 244 | 244 | |
| 245 | 245 | /* video hardware */ |
| 246 | 246 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 283 | 283 | |
| 284 | 284 | |
| 285 | 285 | #include "driver.h" |
| 286 | #include "deprecat.h" | |
| 286 | 287 | #include "machine/z80ctc.h" |
| 287 | 288 | #include "machine/z80pio.h" |
| 288 | 289 | #include "machine/z80sio.h" |
| r1877 | r1878 | |
| 486 | 487 | |
| 487 | 488 | /* bit 4 = SEL0 (J1-8) on squawk n talk board */ |
| 488 | 489 | /* bits 3-0 = MD3-0 connected to squawk n talk (J1-4,3,2,1) */ |
| 489 | squawkntalk_data_w(offset, data); | |
| 490 | squawkntalk_data_w(machine, offset, data); | |
| 490 | 491 | } |
| 491 | 492 | |
| 492 | 493 | |
| r1877 | r1878 | |
| 567 | 568 | |
| 568 | 569 | /* bit 4 = SEL0 (J1-8) on squawk n talk board */ |
| 569 | 570 | /* bits 3-0 = MD3-0 connected to squawk n talk (J1-4,3,2,1) */ |
| 570 | squawkntalk_data_w(offset, data); | |
| 571 | squawkntalk_data_w(machine, offset, data); | |
| 571 | 572 | } |
| 572 | 573 | |
| 573 | 574 | |
| r1877 | r1878 | |
| 594 | 595 | { |
| 595 | 596 | if (data & 0x40) input_mux = 1; |
| 596 | 597 | if (data & 0x80) input_mux = 0; |
| 597 | turbocs_data_w(offset, data); | |
| 598 | turbocs_data_w(machine, offset, data); | |
| 598 | 599 | } |
| 599 | 600 | |
| 600 | 601 | |
| r1877 | r1878 | |
| 1507 | 1508 | MDRV_CPU_CONFIG(mcr_daisy_chain) |
| 1508 | 1509 | MDRV_CPU_PROGRAM_MAP(cpu_90009_map,0) |
| 1509 | 1510 | MDRV_CPU_IO_MAP(cpu_90009_portmap,0) |
| 1510 | MDRV_CPU_VBLANK_INT(mcr_interrupt,2) | |
| 1511 | MDRV_CPU_VBLANK_INT_HACK(mcr_interrupt,2) | |
| 1511 | 1512 | |
| 1512 | 1513 | MDRV_WATCHDOG_VBLANK_INIT(16) |
| 1513 | 1514 | MDRV_MACHINE_START(mcr) |
| r1877 | r1878 | |
| 1595 | 1596 | MDRV_CPU_CONFIG(mcr_ipu_daisy_chain) |
| 1596 | 1597 | MDRV_CPU_PROGRAM_MAP(ipu_91695_map,0) |
| 1597 | 1598 | MDRV_CPU_IO_MAP(ipu_91695_portmap,0) |
| 1598 | MDRV_CPU_VBLANK_INT(mcr_ipu_interrupt,2) | |
| 1599 | MDRV_CPU_VBLANK_INT_HACK(mcr_ipu_interrupt,2) | |
| 1599 | 1600 | MACHINE_DRIVER_END |
| 1600 | 1601 | |
| 1601 | 1602 |
| r1877 | r1878 | |
|---|---|---|
| 122 | 122 | static WRITE16_HANDLER( m107_soundlatch_w ) |
| 123 | 123 | { |
| 124 | 124 | timer_call_after_resynch(NULL, V30_ASSERT,setvector_callback); |
| 125 | soundlatch_w(0, data & 0xff); | |
| 125 | soundlatch_w(machine, 0, data & 0xff); | |
| 126 | 126 | // logerror("soundlatch_w %02x\n",data); |
| 127 | 127 | } |
| 128 | 128 | |
| r1877 | r1878 | |
| 135 | 135 | |
| 136 | 136 | static READ16_HANDLER( m107_soundlatch_r ) |
| 137 | 137 | { |
| 138 | return soundlatch_r(offset) | 0xff00; | |
| 138 | return soundlatch_r(machine, offset) | 0xff00; | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | static WRITE16_HANDLER( m107_sound_irq_ack_w ) |
| r1877 | r1878 | |
|---|---|---|
| 249 | 249 | static WRITE16_HANDLER( ninjaw_sound_w ) |
| 250 | 250 | { |
| 251 | 251 | if (offset == 0) |
| 252 | taitosound_port_w (0, data & 0xff); | |
| 252 | taitosound_port_w (machine, 0, data & 0xff); | |
| 253 | 253 | else if (offset == 1) |
| 254 | taitosound_comm_w (0, data & 0xff); | |
| 254 | taitosound_comm_w (machine, 0, data & 0xff); | |
| 255 | 255 | |
| 256 | 256 | #ifdef MAME_DEBUG |
| 257 | 257 | if (data & 0xff00) |
| r1877 | r1878 | |
| 262 | 262 | static READ16_HANDLER( ninjaw_sound_r ) |
| 263 | 263 | { |
| 264 | 264 | if (offset == 1) |
| 265 | return ((taitosound_comm_r (0) & 0xff)); | |
| 265 | return ((taitosound_comm_r (machine,0) & 0xff)); | |
| 266 | 266 | else return 0; |
| 267 | 267 | } |
| 268 | 268 | |
| r1877 | r1878 | |
| 625 | 625 | /* basic machine hardware */ |
| 626 | 626 | MDRV_CPU_ADD(M68000,16000000/2) /* 8 MHz ? */ |
| 627 | 627 | MDRV_CPU_PROGRAM_MAP(ninjaw_readmem,ninjaw_writemem) |
| 628 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 628 | MDRV_CPU_VBLANK_INT("left", irq4_line_hold | |
| 629 | 629 | |
| 630 | 630 | MDRV_CPU_ADD(Z80,16000000/4) |
| 631 | 631 | /* audio CPU */ /* 16/4 MHz ? */ |
| r1877 | r1878 | |
| 633 | 633 | |
| 634 | 634 | MDRV_CPU_ADD(M68000,16000000/2) /* 8 MHz ? */ |
| 635 | 635 | MDRV_CPU_PROGRAM_MAP(ninjaw_cpub_readmem,ninjaw_cpub_writemem) |
| 636 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 636 | MDRV_CPU_VBLANK_INT("left", irq4_line_hold | |
| 637 | 637 | |
| 638 | 638 | MDRV_INTERLEAVE(100) /* CPU slices */ |
| 639 | 639 | |
| r1877 | r1878 | |
| 699 | 699 | /* basic machine hardware */ |
| 700 | 700 | MDRV_CPU_ADD(M68000,16000000/2) /* 8 MHz ? */ |
| 701 | 701 | MDRV_CPU_PROGRAM_MAP(darius2_readmem,darius2_writemem) |
| 702 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 702 | MDRV_CPU_VBLANK_INT("left", irq4_line_hold | |
| 703 | 703 | |
| 704 | 704 | MDRV_CPU_ADD(Z80,16000000/4) |
| 705 | 705 | /* audio CPU */ /* 4 MHz ? */ |
| r1877 | r1878 | |
| 707 | 707 | |
| 708 | 708 | MDRV_CPU_ADD(M68000,16000000/2) /* 8 MHz ? */ |
| 709 | 709 | MDRV_CPU_PROGRAM_MAP(darius2_cpub_readmem,darius2_cpub_writemem) |
| 710 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 710 | MDRV_CPU_VBLANK_INT("left", irq4_line_hold | |
| 711 | 711 | |
| 712 | 712 | MDRV_INTERLEAVE(100) /* CPU slices */ |
| 713 | 713 |
| r1877 | r1878 | |
|---|---|---|
| 60 | 60 | |
| 61 | 61 | static WRITE8_HANDLER( matmania_sh_command_w ) |
| 62 | 62 | { |
| 63 | soundlatch_w(offset,data); | |
| 64 | cpunum_set_input_line(Machine, 1,M6502_IRQ_LINE,HOLD_LINE); | |
| 63 | soundlatch_w(machine,offset,data); | |
| 64 | cpunum_set_input_line(machine, 1,M6502_IRQ_LINE,HOLD_LINE); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | static WRITE8_HANDLER( matmania_dac_w ) |
| r1877 | r1878 | |
| 72 | 72 | |
| 73 | 73 | static WRITE8_HANDLER( maniach_sh_command_w ) |
| 74 | 74 | { |
| 75 | soundlatch_w(offset,data); | |
| 76 | cpunum_set_input_line(Machine, 1,M6809_IRQ_LINE,HOLD_LINE); | |
| 75 | soundlatch_w(machine,offset,data); | |
| 76 | cpunum_set_input_line(machine, 1,M6809_IRQ_LINE,HOLD_LINE); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
| r1877 | r1878 | |
| 338 | 338 | /* basic machine hardware */ |
| 339 | 339 | MDRV_CPU_ADD(M6502, 1500000) /* 1.5 MHz ???? */ |
| 340 | 340 | MDRV_CPU_PROGRAM_MAP(matmania_readmem,matmania_writemem) |
| 341 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 341 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 342 | 342 | |
| 343 | 343 | MDRV_CPU_ADD(M6502, 1200000) |
| 344 | 344 | /* audio CPU */ /* 1.2 MHz ???? */ |
| 345 | 345 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 346 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,15) /* ???? */ | |
| 346 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,15) /* ???? */ | |
| 347 | 347 | /* IRQs are caused by the main CPU */ |
| 348 | 348 | MDRV_INTERLEAVE(10) |
| 349 | 349 | |
| r1877 | r1878 | |
| 394 | 394 | /* basic machine hardware */ |
| 395 | 395 | MDRV_CPU_ADD(M6502, 1500000) /* 1.5 MHz ???? */ |
| 396 | 396 | MDRV_CPU_PROGRAM_MAP(maniach_readmem,maniach_writemem) |
| 397 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 397 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 398 | 398 | |
| 399 | 399 | MDRV_CPU_ADD(M6809, 1500000) |
| 400 | 400 | /* audio CPU */ /* 1.5 MHz ???? */ |
| r1877 | r1878 | |
|---|---|---|
| 746 | 746 | // basic machine hardware |
| 747 | 747 | MDRV_CPU_ADD_TAG("main", Z80, 6000000) /* 6 Mhz */ |
| 748 | 748 | MDRV_CPU_PROGRAM_MAP(arkanoid_map, 0) |
| 749 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 749 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 750 | 750 | |
| 751 | 751 | MDRV_CPU_ADD_TAG("mcu", M68705, 3000000) /* 3 Mhz */ |
| 752 | 752 | MDRV_CPU_PROGRAM_MAP(mcu_map, 0) |
| r1877 | r1878 | |
| 774 | 774 | // sound hardware |
| 775 | 775 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 776 | 776 | |
| 777 | MDRV_SOUND_ADD(AY8910, 1 | |
| 777 | MDRV_SOUND_ADD(AY8910, XTAL_12MHz/4/2) /* YM2149 clock is 3mhz, pin 26 is low so 3mhz/2 */ | |
| 778 | 778 | MDRV_SOUND_CONFIG(ay8910_interface) |
| 779 | 779 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) |
| 780 | 780 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
|---|---|---|
| 139 | 139 | static WRITE16_HANDLER( sound_command_w ) |
| 140 | 140 | { |
| 141 | 141 | COMBINE_DATA(&twin16_sound_command); |
| 142 | soundlatch_w( 0, twin16_sound_command&0xff ); | |
| 142 | soundlatch_w( machine, 0, twin16_sound_command&0xff ); | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | static READ16_HANDLER( twin16_sprite_status_r ) |
| r1877 | r1878 | |
| 960 | 960 | |
| 961 | 961 | MDRV_CPU_ADD(M68000, 10000000) |
| 962 | 962 | MDRV_CPU_PROGRAM_MAP(readmem_sub,writemem_sub) |
| 963 | MDRV_CPU_VBLANK_INT(CPUB_interrupt | |
| 963 | MDRV_CPU_VBLANK_INT("main", CPUB_interrupt | |
| 964 | 964 | |
| 965 | 965 | MDRV_CPU_ADD(M68000, 10000000) |
| 966 | 966 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 967 | MDRV_CPU_VBLANK_INT(CPUA_interrupt | |
| 967 | MDRV_CPU_VBLANK_INT("main", CPUA_interrupt | |
| 968 | 968 | |
| 969 | 969 | MDRV_INTERLEAVE(100) |
| 970 | 970 | |
| r1877 | r1878 | |
| 1018 | 1018 | |
| 1019 | 1019 | MDRV_CPU_ADD(M68000, 10000000) |
| 1020 | 1020 | MDRV_CPU_PROGRAM_MAP(fround_readmem,fround_writemem) |
| 1021 | MDRV_CPU_VBLANK_INT(CPUA_interrupt | |
| 1021 | MDRV_CPU_VBLANK_INT("main", CPUA_interrupt | |
| 1022 | 1022 | |
| 1023 | 1023 | MDRV_INTERLEAVE(100) |
| 1024 | 1024 |
| r1877 | r1878 | |
|---|---|---|
| 113 | 113 | #define SYS_A_CPU_CLOCK (XTAL_12MHz / 2) /* clock for main 68000 */ |
| 114 | 114 | #define SYS_B_CPU_CLOCK XTAL_8MHz /* clock for main 68000 */ |
| 115 | 115 | #define SYS_C_CPU_CLOCK (XTAL_24MHz / 2) /* clock for main 68000 */ |
| 116 | #define SYS_D_CPU_CLOCK XTAL_8MHz /* clock for main 68000 */ | |
| 116 | 117 | #define SOUND_CPU_CLOCK XTAL_7MHz /* clock for sound 68000 */ |
| 117 | 118 | #define OKI4_SOUND_CLOCK XTAL_4MHz |
| 118 | 119 | |
| r1877 | r1878 | |
| 273 | 274 | |
| 274 | 275 | switch (i) |
| 275 | 276 | { |
| 276 | case 0 : return coins_r(0,0); break; | |
| 277 | case 1 : return player1_r(0,0); break; | |
| 278 | case 2 : return player2_r(0,0); break; | |
| 279 | case 3 : return dsw1_r(0,0); break; | |
| 280 | case 4 : return dsw2_r(0,0); break; | |
| 277 | case 0 : return coins_r(machine,0,0); break; | |
| 278 | case 1 : return player1_r(machine,0,0); break; | |
| 279 | case 2 : return player2_r(machine,0,0); break; | |
| 280 | case 3 : return dsw1_r(machine,0,0); break; | |
| 281 | case 4 : return dsw2_r(machine,0,0); break; | |
| 281 | 282 | default : return 0x0006; |
| 282 | 283 | } |
| 283 | 284 | } |
| r1877 | r1878 | |
| 360 | 361 | [ Main CPU - System D ] |
| 361 | 362 | ***************************************************************************/ |
| 362 | 363 | |
| 363 | #define INTERRUPT_NUM_D 1 | |
| 364 | 364 | static INTERRUPT_GEN( interrupt_D ) |
| 365 | 365 | { |
| 366 | 366 | cpunum_set_input_line(machine, 0, 2, HOLD_LINE); |
| r1877 | r1878 | |
| 467 | 467 | if (megasys1_ignore_oki_status == 1) |
| 468 | 468 | return 0; |
| 469 | 469 | else |
| 470 | return OKIM6295_status_0_lsb_r(offset,mem_mask); | |
| 470 | return OKIM6295_status_0_lsb_r(machine,offset,mem_mask); | |
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | static READ16_HANDLER( oki_status_1_r ) |
| r1877 | r1878 | |
| 475 | 475 | if (megasys1_ignore_oki_status == 1) |
| 476 | 476 | return 0; |
| 477 | 477 | else |
| 478 | return OKIM6295_status_1_lsb_r(offset,mem_mask); | |
| 478 | return OKIM6295_status_1_lsb_r(machine,offset,mem_mask); | |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | /*************************************************************************** |
| r1877 | r1878 | |
| 636 | 636 | /* basic machine hardware */ |
| 637 | 637 | MDRV_CPU_ADD_TAG("main", M68000, SYS_A_CPU_CLOCK) /* 6MHz verified */ |
| 638 | 638 | MDRV_CPU_PROGRAM_MAP(readmem_A,writemem_A) |
| 639 | MDRV_CPU_VBLANK_INT(interrupt_A,INTERRUPT_NUM_A) | |
| 639 | MDRV_CPU_VBLANK_INT_HACK(interrupt_A,INTERRUPT_NUM_A) | |
| 640 | 640 | |
| 641 | 641 | MDRV_CPU_ADD_TAG("sound", M68000, SOUND_CPU_CLOCK) /* 7MHz verified */ |
| 642 | 642 | /* audio CPU */ |
| r1877 | r1878 | |
| 664 | 664 | /* sound hardware */ |
| 665 | 665 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 666 | 666 | |
| 667 | MDRV_SOUND_ADD(YM2151, SOUND_CPU_CLOCK/2) /* 3.5MHz verified */ | |
| 667 | MDRV_SOUND_ADD(YM2151, SOUND_CPU_CLOCK/2) /* 3.5MHz (7MHz / 2) verified */ | |
| 668 | 668 | MDRV_SOUND_CONFIG(ym2151_interface) |
| 669 | 669 | MDRV_SOUND_ROUTE(0, "left", 0.80) |
| 670 | 670 | MDRV_SOUND_ROUTE(1, "right", 0.80) |
| r1877 | r1878 | |
| 693 | 693 | MDRV_CPU_REPLACE("main", M68000, SYS_B_CPU_CLOCK) /* 8MHz */ |
| 694 | 694 | MDRV_CPU_MODIFY("main") |
| 695 | 695 | MDRV_CPU_PROGRAM_MAP(readmem_B,writemem_B) |
| 696 | MDRV_CPU_VBLANK_INT(interrupt_B,INTERRUPT_NUM_B) | |
| 696 | MDRV_CPU_VBLANK_INT_HACK(interrupt_B,INTERRUPT_NUM_B) | |
| 697 | 697 | |
| 698 | 698 | MDRV_CPU_MODIFY("sound") |
| 699 | 699 | MDRV_CPU_PROGRAM_MAP(sound_readmem_B,sound_writemem_B) |
| r1877 | r1878 | |
| 723 | 723 | MDRV_CPU_REPLACE("main", M68000, SYS_C_CPU_CLOCK) /* 12MHz */ |
| 724 | 724 | MDRV_CPU_MODIFY("main") |
| 725 | 725 | MDRV_CPU_PROGRAM_MAP(readmem_C,writemem_C) |
| 726 | MDRV_CPU_VBLANK_INT(interrupt_C,INTERRUPT_NUM_C) | |
| 726 | MDRV_CPU_VBLANK_INT_HACK(interrupt_C,INTERRUPT_NUM_C) | |
| 727 | 727 | |
| 728 | 728 | MDRV_CPU_MODIFY("sound") |
| 729 | 729 | MDRV_CPU_PROGRAM_MAP(sound_readmem_B,sound_writemem_B) |
| r1877 | r1878 | |
| 736 | 736 | |
| 737 | 737 | 1x68000 1xM6295 |
| 738 | 738 | |
| 739 | ||
| 739 | ||
| 740 | 740 | |
| 741 | 741 | ***************************************************************************/ |
| 742 | 742 | |
| r1877 | r1878 | |
| 744 | 744 | static MACHINE_DRIVER_START( system_D ) |
| 745 | 745 | |
| 746 | 746 | /* basic machine hardware */ |
| 747 | MDRV_CPU_ADD(M68000, | |
| 747 | MDRV_CPU_ADD(M68000, SYS_D_CPU_CLOCK) /* 8MHz | |
| 748 | 748 | MDRV_CPU_PROGRAM_MAP(readmem_D,writemem_D) |
| 749 | MDRV_CPU_VBLANK_INT(interrupt | |
| 749 | MDRV_CPU_VBLANK_INT("main", interrupt | |
| 750 | 750 | |
| 751 | 751 | MDRV_MACHINE_RESET(megasys1) |
| 752 | 752 | |
| r1877 | r1878 | |
| 768 | 768 | /* sound hardware */ |
| 769 | 769 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 770 | 770 | |
| 771 | MDRV_SOUND_ADD_TAG("OKI1",OKIM6295, 1980000) | |
| 772 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7low) // clock frequency & pin 7 not verified | |
| 771 | MDRV_SOUND_ADD_TAG("OKI1",OKIM6295, SYS_D_CPU_CLOCK/4) /* 2MHz (8MHz / 4) */ | |
| 772 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) | |
| 773 | 773 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 774 | 774 | MACHINE_DRIVER_END |
| 775 | 775 | |
| r1877 | r1878 | |
| 807 | 807 | /* basic machine hardware */ |
| 808 | 808 | MDRV_CPU_ADD(M68000, SYS_A_CPU_CLOCK) /* 6MHz (12MHz / 2) */ |
| 809 | 809 | MDRV_CPU_PROGRAM_MAP(readmem_A,writemem_A) |
| 810 | MDRV_CPU_VBLANK_INT(interrupt_A,INTERRUPT_NUM_A) | |
| 810 | MDRV_CPU_VBLANK_INT_HACK(interrupt_A,INTERRUPT_NUM_A) | |
| 811 | 811 | |
| 812 | 812 | MDRV_CPU_ADD(Z80, 3000000) /* OSC 12MHz divided by 4 ??? */ |
| 813 | 813 | /* audio CPU */ |
| r1877 | r1878 | |
| 2742 | 2742 | |
| 2743 | 2743 | [ Peek-a-Boo! ] |
| 2744 | 2744 | |
| 2745 | Jaleco board no. PB-92127A | |
| 2746 | ||
| 2747 | CPU: Motorola 68000P10 | |
| 2748 | Sound: OKI M6295 | |
| 2749 | OSC: 8Mhz | |
| 2750 | MCU: MO-90233 (unknown type with internal rom) | |
| 2751 | ||
| 2745 | 2752 | interrupts: |
| 2746 | 2753 | 1] 506> rte |
| 2747 | 2754 | 2] 50a> move.w #$ffff, $1f0006.l |
| r1877 | r1878 | |
| 2828 | 2835 | ROM_LOAD16_BYTE( "j2", 0x000001, 0x020000, CRC(7b3d430d) SHA1(8b48101929da4938a61dfd0eda845368c4184831) ) |
| 2829 | 2836 | |
| 2830 | 2837 | ROM_REGION( 0x40000, REGION_CPU2, 0 ) /* MCU Internal Code */ |
| 2831 | ROM_LOAD( " | |
| 2838 | ROM_LOAD( "m | |
| 2832 | 2839 | |
| 2833 | 2840 | ROM_REGION( 0x080000, REGION_GFX1, ROMREGION_DISPOSE ) /* Scroll 0 */ |
| 2834 | 2841 | ROM_LOAD( "5", 0x000000, 0x080000, CRC(34fa07bb) SHA1(0f688acf302fd56701ee4fcc1d692adb7bf86ce4) ) |
| r1877 | r1878 | |
| 2924 | 2931 | switch (protection_val) |
| 2925 | 2932 | { |
| 2926 | 2933 | case 0x02: return 0x03; |
| 2927 | case 0x51: return player1_r(0,0); | |
| 2928 | case 0x52: return player2_r(0,0); | |
| 2934 | case 0x51: return player1_r(machine,0,0); | |
| 2935 | case 0x52: return player2_r(machine,0,0); | |
| 2929 | 2936 | default: return protection_val; |
| 2930 | 2937 | } |
| 2931 | 2938 | } |
| r1877 | r1878 | |
| 3852 | 3859 | |
| 3853 | 3860 | static WRITE16_HANDLER( OKIM6295_data_0_both_w ) |
| 3854 | 3861 | { |
| 3855 | if (ACCESSING_LSB) OKIM6295_data_0_w(0, (data >> 0) & 0xff ); | |
| 3856 | else OKIM6295_data_0_w(0, (data >> 8) & 0xff ); | |
| 3862 | if (ACCESSING_LSB) OKIM6295_data_0_w(machine, 0, (data >> 0) & 0xff ); | |
| 3863 | else OKIM6295_data_0_w(machine, 0, (data >> 8) & 0xff ); | |
| 3857 | 3864 | } |
| 3858 | 3865 | static WRITE16_HANDLER( OKIM6295_data_1_both_w ) |
| 3859 | 3866 | { |
| 3860 | if (ACCESSING_LSB) OKIM6295_data_1_w(0, (data >> 0) & 0xff ); | |
| 3861 | else OKIM6295_data_1_w(0, (data >> 8) & 0xff ); | |
| 3867 | if (ACCESSING_LSB) OKIM6295_data_1_w(machine, 0, (data >> 0) & 0xff ); | |
| 3868 | else OKIM6295_data_1_w(machine, 0, (data >> 8) & 0xff ); | |
| 3862 | 3869 | } |
| 3863 | 3870 | |
| 3864 | 3871 | static DRIVER_INIT( jitsupro ) |
| r1877 | r1878 | |
|---|---|---|
| 166 | 166 | if (ACCESSING_LSB) |
| 167 | 167 | { |
| 168 | 168 | pending_command = 1; |
| 169 | soundlatch_w(offset,data & 0xff); | |
| 170 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 169 | soundlatch_w(machine,offset,data & 0xff); | |
| 170 | cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); | |
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | |
| r1877 | r1878 | |
| 625 | 625 | /* basic machine hardware */ |
| 626 | 626 | MDRV_CPU_ADD(M68000,16000000) /* 16 MHz ??? */ |
| 627 | 627 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 628 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 628 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 629 | 629 | |
| 630 | 630 | MDRV_CPU_ADD(Z80,4000000) /* 4 MHz ??? */ |
| 631 | 631 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 250 | 250 | that would reset the main cpu. We avoid this and patch |
| 251 | 251 | the rom instead (main cpu has to be reset once at startup) */ |
| 252 | 252 | case 0xfe0: |
| 253 | return watchdog_reset_r(0); | |
| 253 | return watchdog_reset_r(machine,0); | |
| 254 | 254 | |
| 255 | 255 | /* Reading a word at eff2 probably yelds the product |
| 256 | 256 | of the words written to eff0 and eff2 */ |
| r1877 | r1878 | |
| 319 | 319 | static READ8_HANDLER( soundcommand_r ) |
| 320 | 320 | { |
| 321 | 321 | soundlatch_status = 0; // soundlatch has been read |
| 322 | return soundlatch_r(0); | |
| 322 | return soundlatch_r(machine,0); | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | static READ8_HANDLER( soundcommand2_r ) |
| 326 | 326 | { |
| 327 | 327 | soundlatch2_status = 0; // soundlatch2 has been read |
| 328 | return soundlatch2_r(0); | |
| 328 | return soundlatch2_r(machine,0); | |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | static WRITE8_HANDLER( soundcommand_w ) |
| 332 | 332 | { |
| 333 | soundlatch_w(0, data); | |
| 333 | soundlatch_w(machine, 0, data); | |
| 334 | 334 | soundlatch_status = 1; // soundlatch has been written |
| 335 | cpunum_set_input_line( | |
| 335 | cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE); // cause a nmi to sub cpu | |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | static WRITE8_HANDLER( soundcommand2_w ) |
| 339 | 339 | { |
| 340 | soundlatch2_w(0, data); | |
| 340 | soundlatch2_w(machine, 0, data); | |
| 341 | 341 | soundlatch2_status = 1; // soundlatch2 has been written |
| 342 | 342 | } |
| 343 | 343 | |
| r1877 | r1878 | |
| 587 | 587 | static MACHINE_RESET( airbustr ) |
| 588 | 588 | { |
| 589 | 589 | soundlatch_status = soundlatch2_status = 0; |
| 590 | master_bankswitch_w(0, 0x02); | |
| 591 | slave_bankswitch_w(0, 0x02); | |
| 592 | sound_bankswitch_w(0, 0x02); | |
| 590 | master_bankswitch_w(machine, 0, 0x02); | |
| 591 | slave_bankswitch_w(machine, 0, 0x02); | |
| 592 | sound_bankswitch_w(machine, 0, 0x02); | |
| 593 | 593 | } |
| 594 | 594 | |
| 595 | 595 | /* Machine Driver */ |
| r1877 | r1878 | |
| 599 | 599 | MDRV_CPU_ADD(Z80, 6000000) // ??? |
| 600 | 600 | MDRV_CPU_PROGRAM_MAP(master_map, 0) |
| 601 | 601 | MDRV_CPU_IO_MAP(master_io_map, 0) |
| 602 | MDRV_CPU_VBLANK_INT(master_interrupt, 2) // nmi caused by sub cpu?, ? | |
| 602 | MDRV_CPU_VBLANK_INT_HACK(master_interrupt, 2) // nmi caused by sub cpu?, ? | |
| 603 | 603 | |
| 604 | 604 | MDRV_CPU_ADD(Z80, 6000000) // ??? |
| 605 | 605 | MDRV_CPU_PROGRAM_MAP(slave_map, 0) |
| 606 | 606 | MDRV_CPU_IO_MAP(slave_io_map, 0) |
| 607 | MDRV_CPU_VBLANK_INT(slave_interrupt, 2) // nmi caused by main cpu, ? | |
| 607 | MDRV_CPU_VBLANK_INT_HACK(slave_interrupt, 2) // nmi caused by main cpu, ? | |
| 608 | 608 | |
| 609 | 609 | MDRV_CPU_ADD(Z80, 6000000) // ??? |
| 610 | 610 | MDRV_CPU_PROGRAM_MAP(sound_map, 0) |
| 611 | 611 | MDRV_CPU_IO_MAP(sound_io_map, 0) |
| 612 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 612 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 613 | 613 | |
| 614 | 614 | MDRV_INTERLEAVE(100) // Palette RAM is filled by sub cpu with data supplied by main cpu |
| 615 | 615 | // Maybe a high value is safer in order to avoid glitches |
| r1877 | r1878 | |
|---|---|---|
| 306 | 306 | /* basic machine hardware */ |
| 307 | 307 | MDRV_CPU_ADD(Z80, 3000000) /* ? */ |
| 308 | 308 | MDRV_CPU_PROGRAM_MAP(clshroad_readmem,clshroad_writemem) |
| 309 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 309 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 310 | 310 | |
| 311 | 311 | MDRV_CPU_ADD(Z80, 3000000) /* ? */ |
| 312 | 312 | /* audio CPU */ |
| 313 | 313 | MDRV_CPU_PROGRAM_MAP(clshroad_sound_readmem,clshroad_sound_writemem) |
| 314 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 314 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 315 | 315 | |
| 316 | 316 | MDRV_MACHINE_RESET(clshroad) |
| 317 | 317 | |
| r1877 | r1878 | |
| 343 | 343 | /* basic machine hardware */ |
| 344 | 344 | MDRV_CPU_ADD(Z80, 18432000/6) /* ? */ |
| 345 | 345 | MDRV_CPU_PROGRAM_MAP(clshroad_readmem,clshroad_writemem) |
| 346 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 346 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 347 | 347 | |
| 348 | 348 | MDRV_CPU_ADD(Z80, 18432000/6) /* ? */ |
| 349 | 349 | /* audio CPU */ |
| 350 | 350 | MDRV_CPU_PROGRAM_MAP(clshroad_sound_readmem,clshroad_sound_writemem) |
| 351 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 351 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 352 | 352 | |
| 353 | 353 | MDRV_MACHINE_RESET(clshroad) |
| 354 | 354 |
| r1877 | r1878 | |
|---|---|---|
| 522 | 522 | /* since the sound region in Ali Baba is not contiguous, translate the |
| 523 | 523 | offset into the 0-0x1f range */ |
| 524 | 524 | if (offset < 0x10) |
| 525 | pacman_sound_w(offset, data); | |
| 525 | pacman_sound_w(machine, offset, data); | |
| 526 | 526 | else if (offset < 0x20) |
| 527 | 527 | spriteram_2[offset - 0x10] = data; |
| 528 | 528 | else |
| 529 | pacman_sound_w(offset - 0x10, data); | |
| 529 | pacman_sound_w(machine, offset - 0x10, data); | |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | |
| r1877 | r1878 | |
| 557 | 557 | |
| 558 | 558 | static READ8_HANDLER( maketrax_special_port2_r ) |
| 559 | 559 | { |
| 560 | int data = input_port_2_r(offset); | |
| 560 | int data = input_port_2_r(machine,offset); | |
| 561 | 561 | int pc = activecpu_get_previouspc(); |
| 562 | 562 | |
| 563 | 563 | if ((pc == 0x1973) || (pc == 0x2389)) return data | 0x40; |
| r1877 | r1878 | |
| 600 | 600 | |
| 601 | 601 | static READ8_HANDLER( korosuke_special_port2_r ) |
| 602 | 602 | { |
| 603 | int data = input_port_2_r(offset); | |
| 603 | int data = input_port_2_r(machine,offset); | |
| 604 | 604 | int pc = activecpu_get_previouspc(); |
| 605 | 605 | |
| 606 | 606 | if ((pc == 0x196e) || (pc == 0x2387)) return data | 0x40; |
| r1877 | r1878 | |
| 3075 | 3075 | MDRV_CPU_ADD_TAG("main", Z80, MASTER_CLOCK/6) |
| 3076 | 3076 | MDRV_CPU_PROGRAM_MAP(pacman_map,0) |
| 3077 | 3077 | MDRV_CPU_IO_MAP(0,writeport) |
| 3078 | MDRV_CPU_VBLANK_INT(pacman_interrupt,2) | |
| 3078 | MDRV_CPU_VBLANK_INT_HACK(pacman_interrupt,2) | |
| 3079 | 3079 | MDRV_WATCHDOG_VBLANK_INIT(16) |
| 3080 | 3080 | |
| 3081 | 3081 | /* video hardware */ |
| r1877 | r1878 | |
| 3149 | 3149 | |
| 3150 | 3150 | MDRV_CPU_MODIFY("main") |
| 3151 | 3151 | MDRV_CPU_PROGRAM_MAP(alibaba_map,0) |
| 3152 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 3152 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 3153 | 3153 | MACHINE_DRIVER_END |
| 3154 | 3154 | |
| 3155 | 3155 | |
| r1877 | r1878 | |
| 3161 | 3161 | MDRV_CPU_MODIFY("main") |
| 3162 | 3162 | MDRV_CPU_PROGRAM_MAP(dremshpr_map,0) |
| 3163 | 3163 | MDRV_CPU_IO_MAP(0,dremshpr_writeport) |
| 3164 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 3164 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 3165 | 3165 | |
| 3166 | 3166 | /* sound hardware */ |
| 3167 | 3167 | MDRV_SOUND_REPLACE("namco", AY8910, 14318000/8) |
| r1877 | r1878 | |
| 3203 | 3203 | MDRV_CPU_MODIFY("main") |
| 3204 | 3204 | MDRV_CPU_PROGRAM_MAP(vanvan_map,0) |
| 3205 | 3205 | MDRV_CPU_IO_MAP(0,vanvan_writeport) |
| 3206 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 3206 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 3207 | 3207 | |
| 3208 | 3208 | /* video hardware */ |
| 3209 | 3209 | MDRV_SCREEN_MODIFY("main") |
| r1877 | r1878 | |
| 3225 | 3225 | MDRV_CPU_MODIFY("main") |
| 3226 | 3226 | MDRV_CPU_PROGRAM_MAP(bigbucks_map,0) |
| 3227 | 3227 | MDRV_CPU_IO_MAP(bigbucks_readport,0) |
| 3228 | MDRV_CPU_VBLANK_INT(irq0_line_hold,20) | |
| 3228 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,20) | |
| 3229 | 3229 | |
| 3230 | 3230 | MDRV_SCREEN_MODIFY("main") |
| 3231 | 3231 | MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1) |
| r1877 | r1878 | |
| 3240 | 3240 | MDRV_CPU_REMOVE("main") |
| 3241 | 3241 | MDRV_CPU_ADD_TAG("main", S2650, MASTER_CLOCK/6/2) /* 2H */ |
| 3242 | 3242 | MDRV_CPU_PROGRAM_MAP(s2650games_map,0) |
| 3243 | MDRV_CPU_VBLANK_INT(s2650_interrupt | |
| 3243 | MDRV_CPU_VBLANK_INT("main", s2650_interrupt | |
| 3244 | 3244 | |
| 3245 | 3245 | MDRV_GFXDECODE(s2650games) |
| 3246 | 3246 | |
| r1877 | r1878 | |
| 3295 | 3295 | |
| 3296 | 3296 | MDRV_CPU_MODIFY("main") |
| 3297 | 3297 | MDRV_CPU_PROGRAM_MAP(rocktrv2_map,0) |
| 3298 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 3298 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 3299 | 3299 | |
| 3300 | 3300 | MDRV_SCREEN_MODIFY("main") |
| 3301 | 3301 | MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1) |
| r1877 | r1878 | |
| 3310 | 3310 | MDRV_CPU_MODIFY("main") |
| 3311 | 3311 | MDRV_CPU_PROGRAM_MAP(mschamp_map,0) |
| 3312 | 3312 | MDRV_CPU_IO_MAP(mschamp_readport,writeport) |
| 3313 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 3313 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 3314 | 3314 | |
| 3315 | 3315 | MDRV_MACHINE_RESET(mschamp) |
| 3316 | 3316 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
|---|---|---|
| 134 | 134 | |
| 135 | 135 | static READ16_HANDLER( port_2_r ) |
| 136 | 136 | { |
| 137 | return (readinputport(2) & 0xff1f) | (!soundlatch_full << 7) | (ticket_dispenser_r(0) >> 2); | |
| 137 | return (readinputport(2) & 0xff1f) | (!soundlatch_full << 7) | (ticket_dispenser_r(machine, 0) >> 2); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | |
| r1877 | r1878 | |
| 147 | 147 | EEPROM_set_cs_line(~data & 8); |
| 148 | 148 | EEPROM_write_bit(data & 2); |
| 149 | 149 | EEPROM_set_clock_line(data & 4); |
| 150 | ticket_dispenser_w(0, (data & 1) << 7); | |
| 150 | ticket_dispenser_w(machine, 0, (data & 1) << 7); | |
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
| r1877 | r1878 | |
| 158 | 158 | { |
| 159 | 159 | /* write the latch and set the IRQ */ |
| 160 | 160 | soundlatch_full = 1; |
| 161 | cpunum_set_input_line(Machine, 1, 0, ASSERT_LINE); | |
| 162 | soundlatch_w(0, data & 0xff); | |
| 161 | cpunum_set_input_line(machine, 1, 0, ASSERT_LINE); | |
| 162 | soundlatch_w(machine, 0, data & 0xff); | |
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | |
| r1877 | r1878 | |
| 175 | 175 | { |
| 176 | 176 | /* read the latch and clear the IRQ */ |
| 177 | 177 | soundlatch_full = 0; |
| 178 | cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE); | |
| 179 | return soundlatch_r(0); | |
| 178 | cpunum_set_input_line(machine, 1, 0, CLEAR_LINE); | |
| 179 | return soundlatch_r(machine, 0); | |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
| r1877 | r1878 | |
| 207 | 207 | if (offset % 2 == 0) |
| 208 | 208 | sound_msb_latch = data; |
| 209 | 209 | else |
| 210 | BSMT2000_data_0_w(offset/2, (sound_msb_latch << 8) | data, 0); | |
| 210 | BSMT2000_data_0_w(machine, offset/2, (sound_msb_latch << 8) | data, 0); | |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | |
| r1877 | r1878 | |
| 404 | 404 | /* basic machine hardware */ |
| 405 | 405 | MDRV_CPU_ADD(M68000, MAIN_OSC) |
| 406 | 406 | MDRV_CPU_PROGRAM_MAP(main_cpu_map,0) |
| 407 | MDRV_CPU_VBLANK_INT(dcheese_vblank | |
| 407 | MDRV_CPU_VBLANK_INT("main", dcheese_vblank | |
| 408 | 408 | |
| 409 | 409 | MDRV_CPU_ADD(M6809, SOUND_OSC/16) |
| 410 | 410 | MDRV_CPU_PROGRAM_MAP(sound_cpu_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 363 | 363 | /* basic machine hardware */ |
| 364 | 364 | MDRV_CPU_ADD(KONAMI,XTAL_24MHz/8) /* 052001 (verified on pcb) */ |
| 365 | 365 | MDRV_CPU_PROGRAM_MAP(chqflag_readmem,chqflag_writemem) |
| 366 | MDRV_CPU_VBLANK_INT(chqflag_interrupt,16) /* ? */ | |
| 366 | MDRV_CPU_VBLANK_INT_HACK(chqflag_interrupt,16) /* ? */ | |
| 367 | 367 | |
| 368 | 368 | MDRV_CPU_ADD(Z80, XTAL_3_579545MHz) /* verified on pcb */ |
| 369 | 369 | /* audio CPU */ /* ? */ |
| r1877 | r1878 | |
|---|---|---|
| 72 | 72 | ffcount--; |
| 73 | 73 | latch_data = sound_fifo[fftail]; |
| 74 | 74 | fftail = (fftail + 1) & (MAX_SOUNDS - 1); |
| 75 | soundlatch_w(0, latch_data); | |
| 75 | soundlatch_w(machine, 0, latch_data); | |
| 76 | 76 | cpunum_set_input_line(machine, 2, DECO16_IRQ_LINE, HOLD_LINE); // SNDREQ |
| 77 | 77 | } |
| 78 | 78 | break; |
| r1877 | r1878 | |
| 392 | 392 | // basic machine hardware |
| 393 | 393 | MDRV_CPU_ADD(M6809, 2000000) |
| 394 | 394 | MDRV_CPU_PROGRAM_MAP(bwp1_readmem, bwp1_writemem) |
| 395 | MDRV_CPU_VBLANK_INT(bwp1_interrupt, 3) | |
| 395 | MDRV_CPU_VBLANK_INT_HACK(bwp1_interrupt, 3) | |
| 396 | 396 | |
| 397 | 397 | MDRV_CPU_ADD(M6809, 2000000) |
| 398 | 398 | MDRV_CPU_PROGRAM_MAP(bwp2_readmem, bwp2_writemem) |
| 399 | // MDRV_CPU_VBLANK_INT(irq1_line_assert | |
| 399 | // MDRV_CPU_VBLANK_INT("main", irq1_line_assert | |
| 400 | 400 | |
| 401 | 401 | MDRV_CPU_ADD(DECO16, 2000000) |
| 402 | 402 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 535 | 535 | if (offset >= 0xfff00/2 && offset <= 0xfff1a/2 ) |
| 536 | 536 | { |
| 537 | 537 | offset &=0x1f; |
| 538 | srmp6_dma_w(offset,data,mem_mask); | |
| 538 | srmp6_dma_w(machine,offset,data,mem_mask); | |
| 539 | 539 | } |
| 540 | 540 | } |
| 541 | 541 | |
| r1877 | r1878 | |
| 544 | 544 | INT8 r, g, b; |
| 545 | 545 | int brg = brightness - 0x60; |
| 546 | 546 | |
| 547 | paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, data, mem_mask); | |
| 547 | paletteram16_xBBBBBGGGGGRRRRR_word_w(machine, offset, data, mem_mask); | |
| 548 | 548 | |
| 549 | 549 | if(brg) |
| 550 | 550 | { |
| r1877 | r1878 | |
| 709 | 709 | static MACHINE_DRIVER_START( srmp6 ) |
| 710 | 710 | MDRV_CPU_ADD(M68000, 16000000) |
| 711 | 711 | MDRV_CPU_PROGRAM_MAP(srmp6,0) |
| 712 | MDRV_CPU_VBLANK_INT(srmp6_interrupt,2) | |
| 712 | MDRV_CPU_VBLANK_INT_HACK(srmp6_interrupt,2) | |
| 713 | 713 | |
| 714 | 714 | |
| 715 | 715 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 53 | 53 | { |
| 54 | 54 | if (ACCESSING_LSB) |
| 55 | 55 | { |
| 56 | soundlatch_w(offset,data & 0xff); | |
| 57 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 56 | soundlatch_w(machine,offset,data & 0xff); | |
| 57 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
| r1877 | r1878 | |
| 123 | 123 | program_write_word(0xffc00c, 0xc0); |
| 124 | 124 | program_write_word(0xffc00e, 0); |
| 125 | 125 | |
| 126 | sf_fg_scroll_w(0, d1, 0); | |
| 127 | sf_bg_scroll_w(0, d2, 0); | |
| 126 | sf_fg_scroll_w(machine, 0, d1, 0); | |
| 127 | sf_fg_scroll_w(machine, 0, d2, 0); | |
| 128 | 128 | break; |
| 129 | 129 | } |
| 130 | 130 | case 4: |
| r1877 | r1878 | |
| 144 | 144 | } |
| 145 | 145 | program_write_word(0xffc682, d1); |
| 146 | 146 | program_write_word(0xffc00e, off); |
| 147 | sf_ | |
| 147 | sf_fg_scroll_w(machine, 0, d1, 0); | |
| 148 | 148 | } |
| 149 | 149 | break; |
| 150 | 150 | } |
| r1877 | r1878 | |
| 166 | 166 | |
| 167 | 167 | static READ16_HANDLER( button1_r ) |
| 168 | 168 | { |
| 169 | return (scale[input_port_7_r(0)]<<8)|scale[input_port_5_r(0)]; | |
| 169 | return (scale[input_port_7_r(machine,0)]<<8)|scale[input_port_5_r(machine,0)]; | |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | static READ16_HANDLER( button2_r ) |
| 173 | 173 | { |
| 174 | return (scale[input_port_8_r(0)]<<8)|scale[input_port_6_r(0)]; | |
| 174 | return (scale[input_port_8_r(machine,0)]<<8)|scale[input_port_6_r(machine,0)]; | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | |
| r1877 | r1878 | |
| 820 | 820 | /* basic machine hardware */ |
| 821 | 821 | MDRV_CPU_ADD_TAG("main", M68000, 8000000) /* 8 MHz ? (xtal is 16MHz) */ |
| 822 | 822 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 823 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 823 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 824 | 824 | |
| 825 | 825 | MDRV_CPU_ADD(Z80, 3579545) |
| 826 | 826 | /* audio CPU */ /* ? xtal is 3.579545MHz */ |
| r1877 | r1878 | |
| 889 | 889 | /* basic machine hardware */ |
| 890 | 890 | MDRV_IMPORT_FROM(sf) |
| 891 | 891 | MDRV_CPU_MODIFY("main") |
| 892 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 892 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 893 | 893 | MACHINE_DRIVER_END |
| 894 | 894 | |
| 895 | 895 |
| r1877 | r1878 | |
|---|---|---|
| 591 | 591 | /* basic machine hardware */ |
| 592 | 592 | MDRV_CPU_ADD(Z80, 6000000) /* 6 MHz? */ |
| 593 | 593 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 594 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 594 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 595 | 595 | |
| 596 | 596 | MDRV_CPU_ADD(Z80, 4000000) |
| 597 | 597 | /* audio CPU */ /* 4 MHz? */ |
| r1877 | r1878 | |
| 637 | 637 | /* basic machine hardware */ |
| 638 | 638 | MDRV_CPU_ADD(Z80, 6000000) |
| 639 | 639 | MDRV_CPU_PROGRAM_MAP(mem_daikaiju, 0) |
| 640 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 640 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 641 | 641 | |
| 642 | 642 | MDRV_CPU_ADD(Z80, 3000000) |
| 643 | 643 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 1048 | 1048 | MDRV_CPU_ADD(PPC602, 33000000) /* actually PPC602, 66MHz */ |
| 1049 | 1049 | MDRV_CPU_CONFIG(ppc602_config) |
| 1050 | 1050 | MDRV_CPU_PROGRAM_MAP(m2_main, 0) |
| 1051 | MDRV_CPU_VBLANK_INT(m | |
| 1051 | MDRV_CPU_VBLANK_INT("main", m2) | |
| 1052 | 1052 | |
| 1053 | 1053 | MDRV_CPU_ADD(PPC602, 33000000) /* actually PPC602, 66MHz */ |
| 1054 | 1054 | MDRV_CPU_CONFIG(ppc602_config) |
| r1877 | r1878 | |
|---|---|---|
| 289 | 289 | MDRV_CPU_ADD(V30, 16000000/2) /* V30-8 */ |
| 290 | 290 | MDRV_CPU_PROGRAM_MAP(sengokmj_map,0) |
| 291 | 291 | MDRV_CPU_IO_MAP(sengokmj_io_map,0) |
| 292 | MDRV_CPU_VBLANK_INT(sengokmj_interrupt | |
| 292 | MDRV_CPU_VBLANK_INT("main", sengokmj_interrupt | |
| 293 | 293 | |
| 294 | 294 | SEIBU_SOUND_SYSTEM_CPU(14318180/4) |
| 295 | 295 |
| r1877 | r1878 | |
|---|---|---|
| 68 | 68 | |
| 69 | 69 | static READ8_HANDLER( psg_4015_r ) |
| 70 | 70 | { |
| 71 | return NESPSG_0_r(0x15); | |
| 71 | return NESPSG_0_r(machine,0x15); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | static WRITE8_HANDLER( psg_4015_w ) |
| 75 | 75 | { |
| 76 | NESPSG_0_w(0x15, data); | |
| 76 | NESPSG_0_w(machine,0x15, data); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | static WRITE8_HANDLER( psg_4017_w ) |
| 80 | 80 | { |
| 81 | NESPSG_0_w(0x17, data); | |
| 81 | NESPSG_0_w(machine,0x17, data); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | static UINT32 in_0; |
| r1877 | r1878 | |
| 206 | 206 | |
| 207 | 207 | /* reset the ppu */ |
| 208 | 208 | ppu2c0x_reset( 0, 1 ); |
| 209 | } | |
| 209 | } | |
| 210 | 210 | |
| 211 | 211 | static PALETTE_INIT( cham24 ) |
| 212 | 212 | { |
| r1877 | r1878 | |
|---|---|---|
| 221 | 221 | { |
| 222 | 222 | // sound_flag1 = 1; |
| 223 | 223 | // sound_flag2 = 1; |
| 224 | soundlatch_word_w(offset,data,mem_mask); | |
| 224 | soundlatch_word_w(machine,offset,data,mem_mask); | |
| 225 | 225 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); |
| 226 | 226 | cpu_spinuntil_time(ATTOTIME_IN_USEC(50)); // Allow the other cpu to reply |
| 227 | 227 | } |
| r1877 | r1878 | |
| 230 | 230 | static READ8_HANDLER( soundlatch_lo_r ) |
| 231 | 231 | { |
| 232 | 232 | // sound_flag1 = 0; |
| 233 | return soundlatch_word_r(offset,0) & 0xff; | |
| 233 | return soundlatch_word_r(machine,offset,0) & 0xff; | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | /* Sound CPU: read the high 8 bits of the 16 bit sound latch */ |
| 237 | 237 | static READ8_HANDLER( soundlatch_hi_r ) |
| 238 | 238 | { |
| 239 | 239 | // sound_flag2 = 0; |
| 240 | return soundlatch_word_r(offset,0) >> 8; | |
| 240 | return soundlatch_word_r(machine,offset,0) >> 8; | |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | /* Main CPU: read the latch written by the sound CPU (acknowledge) */ |
| r1877 | r1878 | |
| 273 | 273 | { |
| 274 | 274 | if (ACCESSING_LSB) |
| 275 | 275 | { |
| 276 | if (offset) YMZ280B_data_0_w (offset, data & 0xff); | |
| 277 | else YMZ280B_register_0_w (offset, data & 0xff); | |
| 276 | if (offset) YMZ280B_data_0_w (machine, offset, data & 0xff); | |
| 277 | else YMZ280B_register_0_w (machine, offset, data & 0xff); | |
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | /* Handles reads from the YMZ280B */ |
| 282 | 282 | static READ16_HANDLER( cave_sound_r ) |
| 283 | 283 | { |
| 284 | return YMZ280B_status_0_r(offset); | |
| 284 | return YMZ280B_status_0_r(machine,offset); | |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | |
| r1877 | r1878 | |
| 350 | 350 | static WRITE16_HANDLER( sailormn_eeprom_msb_w ) |
| 351 | 351 | { |
| 352 | 352 | sailormn_tilebank_w ( data & 0x0100 ); |
| 353 | cave_eeprom_msb_w(offset,data & ~0x0100,mem_mask); | |
| 353 | cave_eeprom_msb_w(machine,offset,data & ~0x0100,mem_mask); | |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | static WRITE16_HANDLER( hotdogst_eeprom_msb_w ) |
| r1877 | r1878 | |
| 578 | 578 | case 0: |
| 579 | 579 | case 1: |
| 580 | 580 | case 2: |
| 581 | case 3: return cave_irq_cause_r(offset,0); | |
| 581 | case 3: return cave_irq_cause_r(machine,offset,0); | |
| 582 | 582 | |
| 583 | 583 | default: return 0x0000; |
| 584 | 584 | } |
| r1877 | r1878 | |
| 1082 | 1082 | |
| 1083 | 1083 | static READ16_HANDLER( agallet_irq_cause_r ) |
| 1084 | 1084 | { |
| 1085 | UINT16 irq_cause = cave_irq_cause_r(offset,mem_mask); | |
| 1085 | UINT16 irq_cause = cave_irq_cause_r(machine,offset,mem_mask); | |
| 1086 | 1086 | |
| 1087 | 1087 | if (offset == 0) |
| 1088 | 1088 | { |
| r1877 | r1878 | |
| 2018 | 2018 | /* basic machine hardware */ |
| 2019 | 2019 | MDRV_CPU_ADD(M68000, 16000000) |
| 2020 | 2020 | MDRV_CPU_PROGRAM_MAP(dfeveron_readmem,dfeveron_writemem) |
| 2021 | MDRV_CPU_VBLANK_INT(cave_interrupt | |
| 2021 | MDRV_CPU_VBLANK_INT("main", cave_interrupt | |
| 2022 | 2022 | |
| 2023 | 2023 | MDRV_MACHINE_RESET(cave) |
| 2024 | 2024 | MDRV_NVRAM_HANDLER(cave) |
| r1877 | r1878 | |
| 2057 | 2057 | /* basic machine hardware */ |
| 2058 | 2058 | MDRV_CPU_ADD(M68000, 16000000) |
| 2059 | 2059 | MDRV_CPU_PROGRAM_MAP(ddonpach_readmem,ddonpach_writemem) |
| 2060 | MDRV_CPU_VBLANK_INT(cave_interrupt | |
| 2060 | MDRV_CPU_VBLANK_INT("main", cave_interrupt | |
| 2061 | 2061 | |
| 2062 | 2062 | MDRV_MACHINE_RESET(cave) |
| 2063 | 2063 | MDRV_NVRAM_HANDLER(cave) |
| r1877 | r1878 | |
| 2096 | 2096 | /* basic machine hardware */ |
| 2097 | 2097 | MDRV_CPU_ADD(M68000, 16000000) |
| 2098 | 2098 | MDRV_CPU_PROGRAM_MAP(donpachi_readmem,donpachi_writemem) |
| 2099 | MDRV_CPU_VBLANK_INT(cave_interrupt | |
| 2099 | MDRV_CPU_VBLANK_INT("main", cave_interrupt | |
| 2100 | 2100 | |
| 2101 | 2101 | MDRV_MACHINE_RESET(cave) |
| 2102 | 2102 | MDRV_NVRAM_HANDLER(cave) |
| r1877 | r1878 | |
| 2140 | 2140 | /* basic machine hardware */ |
| 2141 | 2141 | MDRV_CPU_ADD(M68000, 16000000) |
| 2142 | 2142 | MDRV_CPU_PROGRAM_MAP(esprade_readmem,esprade_writemem) |
| 2143 | MDRV_CPU_VBLANK_INT(cave_interrupt | |
| 2143 | MDRV_CPU_VBLANK_INT("main", cave_interrupt | |
| 2144 | 2144 | |
| 2145 | 2145 | MDRV_MACHINE_RESET(cave) |
| 2146 | 2146 | MDRV_NVRAM_HANDLER(cave) |
| r1877 | r1878 | |
| 2178 | 2178 | /* basic machine hardware */ |
| 2179 | 2179 | MDRV_CPU_ADD(M68000, 16000000) |
| 2180 | 2180 | MDRV_CPU_PROGRAM_MAP(gaia_readmem,gaia_writemem) |
| 2181 | MDRV_CPU_VBLANK_INT(cave_interrupt | |
| 2181 | MDRV_CPU_VBLANK_INT("main", cave_interrupt | |
| 2182 | 2182 | |
| 2183 | 2183 | MDRV_MACHINE_RESET(cave) |
| 2184 | 2184 | |
| r1877 | r1878 | |
| 2215 | 2215 | /* basic machine hardware */ |
| 2216 | 2216 | MDRV_CPU_ADD(M68000, 16000000) |
| 2217 | 2217 | MDRV_CPU_PROGRAM_MAP(guwange_readmem,guwange_writemem) |
| 2218 | MDRV_CPU_VBLANK_INT(cave_interrupt | |
| 2218 | MDRV_CPU_VBLANK_INT("main", cave_interrupt | |
| 2219 | 2219 | |
| 2220 | 2220 | MDRV_MACHINE_RESET(cave) |
| 2221 | 2221 | MDRV_NVRAM_HANDLER(cave) |
| r1877 | r1878 | |
| 2252 | 2252 | /* basic machine hardware */ |
| 2253 | 2253 | MDRV_CPU_ADD(M68000, 16000000) |
| 2254 | 2254 | MDRV_CPU_PROGRAM_MAP(hotdogst_readmem,hotdogst_writemem) |
| 2255 | MDRV_CPU_VBLANK_INT(cave_interrupt | |
| 2255 | MDRV_CPU_VBLANK_INT("main", cave_interrupt | |
| 2256 | 2256 | |
| 2257 | 2257 | MDRV_CPU_ADD(Z80, 4000000) |
| 2258 | 2258 | /* audio CPU */ /* ? */ |
| r1877 | r1878 | |
| 2307 | 2307 | /* basic machine hardware */ |
| 2308 | 2308 | MDRV_CPU_ADD(M68000, 16000000) |
| 2309 | 2309 | MDRV_CPU_PROGRAM_MAP(korokoro_readmem,korokoro_writemem) |
| 2310 | MDRV_CPU_VBLANK_INT(cave_interrupt | |
| 2310 | MDRV_CPU_VBLANK_INT("main", cave_interrupt | |
| 2311 | 2311 | |
| 2312 | 2312 | MDRV_MACHINE_RESET(cave) |
| 2313 | 2313 | MDRV_NVRAM_HANDLER(korokoro) |
| r1877 | r1878 | |
| 2346 | 2346 | /* basic machine hardware */ |
| 2347 | 2347 | MDRV_CPU_ADD(M68000, 16000000) |
| 2348 | 2348 | MDRV_CPU_PROGRAM_MAP(mazinger_readmem,mazinger_writemem) |
| 2349 | MDRV_CPU_VBLANK_INT(cave_interrupt | |
| 2349 | MDRV_CPU_VBLANK_INT("main", cave_interrupt | |
| 2350 | 2350 | |
| 2351 | 2351 | MDRV_CPU_ADD(Z80, 4000000) |
| 2352 | 2352 | // /* audio CPU */ // Bidirectional communication |
| r1877 | r1878 | |
| 2403 | 2403 | /* basic machine hardware */ |
| 2404 | 2404 | MDRV_CPU_ADD(M68000,32000000 / 2) |
| 2405 | 2405 | MDRV_CPU_PROGRAM_MAP(metmqstr_readmem,metmqstr_writemem) |
| 2406 | MDRV_CPU_VBLANK_INT(cave_interrupt | |
| 2406 | MDRV_CPU_VBLANK_INT("main", cave_interrupt | |
| 2407 | 2407 | |
| 2408 | 2408 | MDRV_CPU_ADD(Z80,32000000 / 4) |
| 2409 | 2409 | /* audio CPU */ |
| r1877 | r1878 | |
| 2461 | 2461 | /* basic machine hardware */ |
| 2462 | 2462 | MDRV_CPU_ADD(M68000, 16000000) /* 16 MHz */ |
| 2463 | 2463 | MDRV_CPU_PROGRAM_MAP(pwrinst2_readmem,pwrinst2_writemem) |
| 2464 | MDRV_CPU_VBLANK_INT(cave_interrupt | |
| 2464 | MDRV_CPU_VBLANK_INT("main", cave_interrupt | |
| 2465 | 2465 | |
| 2466 | 2466 | MDRV_CPU_ADD(Z80,16000000 / 2) |
| 2467 | 2467 | /* audio CPU */ /* 8 MHz */ |
| r1877 | r1878 | |
| 2521 | 2521 | /* basic machine hardware */ |
| 2522 | 2522 | MDRV_CPU_ADD(M68000, 16000000) |
| 2523 | 2523 | MDRV_CPU_PROGRAM_MAP(sailormn_readmem,sailormn_writemem) |
| 2524 | MDRV_CPU_VBLANK_INT(cave_interrupt | |
| 2524 | MDRV_CPU_VBLANK_INT("main", cave_interrupt | |
| 2525 | 2525 | |
| 2526 | 2526 | MDRV_CPU_ADD(Z80, 8000000) |
| 2527 | 2527 | // /* audio CPU */ // Bidirectional Communication |
| r1877 | r1878 | |
| 2576 | 2576 | /* basic machine hardware */ |
| 2577 | 2577 | MDRV_CPU_ADD(M68000, 16000000) |
| 2578 | 2578 | MDRV_CPU_PROGRAM_MAP(uopoko_readmem,uopoko_writemem) |
| 2579 | MDRV_CPU_VBLANK_INT(cave_interrupt | |
| 2579 | MDRV_CPU_VBLANK_INT("main", cave_interrupt | |
| 2580 | 2580 | |
| 2581 | 2581 | MDRV_NVRAM_HANDLER(cave) |
| 2582 | 2582 |
| r1877 | r1878 | |
|---|---|---|
| 977 | 977 | /* basic machine hardware */ |
| 978 | 978 | MDRV_CPU_ADD(Z80, 8000000) /* ??? */ |
| 979 | 979 | MDRV_CPU_PROGRAM_MAP(lastday_readmem,lastday_writemem) |
| 980 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 980 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 981 | 981 | |
| 982 | 982 | MDRV_CPU_ADD(Z80, 4000000) |
| 983 | 983 | /* audio CPU */ /* ??? */ |
| r1877 | r1878 | |
| 1011 | 1011 | /* basic machine hardware */ |
| 1012 | 1012 | MDRV_CPU_ADD(Z80, 8000000) /* ??? */ |
| 1013 | 1013 | MDRV_CPU_PROGRAM_MAP(gulfstrm_readmem,pollux_writemem) |
| 1014 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1014 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1015 | 1015 | |
| 1016 | 1016 | MDRV_CPU_ADD(Z80, 4000000) |
| 1017 | 1017 | /* audio CPU */ /* ??? */ |
| r1877 | r1878 | |
| 1045 | 1045 | /* basic machine hardware */ |
| 1046 | 1046 | MDRV_CPU_ADD(Z80, 8000000) /* ??? */ |
| 1047 | 1047 | MDRV_CPU_PROGRAM_MAP(pollux_readmem,pollux_writemem) |
| 1048 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1048 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1049 | 1049 | |
| 1050 | 1050 | MDRV_CPU_ADD(Z80, 4000000) |
| 1051 | 1051 | /* audio CPU */ /* ??? */ |
| r1877 | r1878 | |
| 1079 | 1079 | /* basic machine hardware */ |
| 1080 | 1080 | MDRV_CPU_ADD(Z80, 8000000) /* ??? */ |
| 1081 | 1081 | MDRV_CPU_PROGRAM_MAP(bluehawk_readmem,bluehawk_writemem) |
| 1082 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1082 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1083 | 1083 | |
| 1084 | 1084 | MDRV_CPU_ADD(Z80, 4000000) |
| 1085 | 1085 | /* audio CPU */ /* ??? */ |
| r1877 | r1878 | |
| 1113 | 1113 | /* basic machine hardware */ |
| 1114 | 1114 | MDRV_CPU_ADD(Z80, 8000000) /* ??? */ |
| 1115 | 1115 | MDRV_CPU_PROGRAM_MAP(flytiger_readmem,flytiger_writemem) |
| 1116 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1116 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1117 | 1117 | |
| 1118 | 1118 | MDRV_CPU_ADD(Z80, 4000000) |
| 1119 | 1119 | /* audio CPU */ /* ??? */ |
| r1877 | r1878 | |
| 1147 | 1147 | /* basic machine hardware */ |
| 1148 | 1148 | MDRV_CPU_ADD(Z80, 8000000) /* ??? */ |
| 1149 | 1149 | MDRV_CPU_PROGRAM_MAP(primella_readmem,primella_writemem) |
| 1150 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 1150 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 1151 | 1151 | |
| 1152 | 1152 | MDRV_CPU_ADD(Z80, 4000000) |
| 1153 | 1153 | /* audio CPU */ /* ??? */ |
| r1877 | r1878 | |
| 1185 | 1185 | /* basic machine hardware */ |
| 1186 | 1186 | MDRV_CPU_ADD(M68000, 8000000) /* measured on super-x */ |
| 1187 | 1187 | MDRV_CPU_PROGRAM_MAP(rshark_readmem,rshark_writemem) |
| 1188 | MDRV_CPU_VBLANK_INT(rshark_interrupt,2) /* 5 and 6 */ | |
| 1188 | MDRV_CPU_VBLANK_INT_HACK(rshark_interrupt,2) /* 5 and 6 */ | |
| 1189 | 1189 | |
| 1190 | 1190 | MDRV_CPU_ADD(Z80, 4000000) |
| 1191 | 1191 | /* audio CPU */ /* measured on super-x */ |
| r1877 | r1878 | |
| 1217 | 1217 | /* basic machine hardware */ |
| 1218 | 1218 | MDRV_CPU_ADD(M68000, 8000000) /* measured on super-x */ |
| 1219 | 1219 | MDRV_CPU_PROGRAM_MAP(superx_readmem,superx_writemem) |
| 1220 | MDRV_CPU_VBLANK_INT(rshark_interrupt,2) /* 5 and 6 */ | |
| 1220 | MDRV_CPU_VBLANK_INT_HACK(rshark_interrupt,2) /* 5 and 6 */ | |
| 1221 | 1221 | |
| 1222 | 1222 | MDRV_CPU_ADD(Z80, 4000000) |
| 1223 | 1223 | /* audio CPU */ /* measured on super-x */ |
| r1877 | r1878 | |
| 1249 | 1249 | /* basic machine hardware */ |
| 1250 | 1250 | MDRV_CPU_ADD(M68000, 10000000) |
| 1251 | 1251 | MDRV_CPU_PROGRAM_MAP(popbingo_readmem,popbingo_writemem) |
| 1252 | MDRV_CPU_VBLANK_INT(rshark_interrupt,2) /* 5 and 6 */ | |
| 1252 | MDRV_CPU_VBLANK_INT_HACK(rshark_interrupt,2) /* 5 and 6 */ | |
| 1253 | 1253 | |
| 1254 | 1254 | MDRV_CPU_ADD(Z80, 4000000) |
| 1255 | 1255 | /* audio CPU */ /* measured on super-x */ |
| r1877 | r1878 | |
|---|---|---|
| 67 | 67 | VIDEO_UPDATE( brkthru ); |
| 68 | 68 | |
| 69 | 69 | |
| 70 | static int nmi_enable; | |
| 71 | ||
| 72 | 70 | static WRITE8_HANDLER( brkthru_1803_w ) |
| 73 | 71 | { |
| 74 | 72 | /* bit 0 = NMI enable */ |
| 75 | | |
| 73 | cpu_interrupt_enable(0, | |
| 76 | 74 | |
| 77 | 75 | /* bit 1 = ? maybe IRQ acknowledge */ |
| 78 | 76 | } |
| 79 | 77 | static WRITE8_HANDLER( darwin_0803_w ) |
| 80 | 78 | { |
| 81 | 79 | /* bit 0 = NMI enable */ |
| 82 | /* | |
| 80 | /*cpu_interrupt_enable(1, | |
| 83 | 81 | logerror("0803 %02X\n",data); |
| 84 | ||
| 82 | cpu_ | |
| 85 | 83 | /* bit 1 = ? maybe IRQ acknowledge */ |
| 86 | 84 | } |
| 87 | 85 | |
| 88 | 86 | static WRITE8_HANDLER( brkthru_soundlatch_w ) |
| 89 | 87 | { |
| 90 | soundlatch_w(offset,data); | |
| 91 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 88 | soundlatch_w(machine,offset,data); | |
| 89 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 92 | 90 | } |
| 93 | 91 | |
| 92 | static INPUT_CHANGED( coin_inserted ) | |
| 93 | { | |
| 94 | /* coin insertion causes an IRQ */ | |
| 95 | cpunum_set_input_line(machine, 0, 0, newval ? CLEAR_LINE : ASSERT_LINE); | |
| 96 | } | |
| 94 | 97 | |
| 95 | 98 | |
| 99 | ||
| 96 | 100 | static ADDRESS_MAP_START( brkthru_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 97 | 101 | AM_RANGE(0x0000, 0x03ff) AM_READWRITE(MRA8_RAM, brkthru_fgram_w) AM_BASE(&brkthru_videoram) AM_SIZE(&brkthru_videoram_size) |
| 98 | 102 | AM_RANGE(0x0400, 0x0bff) AM_RAM |
| r1877 | r1878 | |
| 143 | 147 | |
| 144 | 148 | |
| 145 | 149 | |
| 146 | static INTERRUPT_GEN( brkthru_interrupt ) | |
| 147 | { | |
| 148 | if (cpu_getiloops() == 0) | |
| 149 | { | |
| 150 | if (nmi_enable) | |
| 151 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 152 | } | |
| 153 | else | |
| 154 | { | |
| 155 | /* generate IRQ on coin insertion */ | |
| 156 | if ((readinputportbytag("IN2") & 0xe0) != 0xe0) | |
| 157 | cpunum_set_input_line(machine, 0, 0, HOLD_LINE); | |
| 158 | } | |
| 159 | } | |
| 160 | ||
| 161 | 150 | #define COMMON_IN0\ |
| 162 | 151 | PORT_START_TAG("IN0")\ |
| 163 | 152 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )\ |
| r1877 | r1878 | |
| 181 | 170 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) /* used only by the self test */ |
| 182 | 171 | |
| 183 | 172 | static INPUT_PORTS_START( brkthru ) |
| 184 | COMMON_IN0 | |
| 185 | COMMON_IN1 | |
| 173 | COMMON_IN0 | |
| 174 | COMMON_IN1 | |
| 186 | 175 | |
| 187 | 176 | PORT_START_TAG("IN2") |
| 188 | 177 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| r1877 | r1878 | |
| 198 | 187 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) ) |
| 199 | 188 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 200 | 189 | PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) |
| 201 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) /* Manual says Picture Flip=On, Normal=Off */ | |
| 202 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) | |
| 203 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_IMPULSE(2) | |
| 190 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) /* Manual says Picture Flip=On, Normal=Off */ | |
| 191 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 192 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_CHANGED(coin_inserted, 0) | |
| 204 | 193 | |
| 205 | 194 | PORT_START_TAG("DSW0") |
| 206 | 195 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) |
| r1877 | r1878 | |
| 228 | 217 | INPUT_PORTS_END |
| 229 | 218 | |
| 230 | 219 | static INPUT_PORTS_START( brkthruj ) |
| 231 | COMMON_IN0 | |
| 232 | COMMON_IN1 | |
| 220 | COMMON_IN0 | |
| 221 | COMMON_IN1 | |
| 233 | 222 | |
| 234 | 223 | PORT_START_TAG("IN2") |
| 235 | 224 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) |
| r1877 | r1878 | |
| 243 | 232 | PORT_DIPSETTING( 0x0c, "20000/30000 Points" ) |
| 244 | 233 | PORT_DIPSETTING( 0x08, "20000/40000 Points" ) |
| 245 | 234 | PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) |
| 246 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) /* Manual says Pitcure Flip=On, Normal=Off */ | |
| 247 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) | |
| 248 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_IMPULSE(2) | |
| 235 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) /* Manual says Pitcure Flip=On, Normal=Off */ | |
| 236 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 237 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_CHANGED(coin_inserted, 0) | |
| 249 | 238 | |
| 250 | 239 | PORT_START_TAG("DSW0") |
| 251 | 240 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) |
| r1877 | r1878 | |
| 273 | 262 | INPUT_PORTS_END |
| 274 | 263 | |
| 275 | 264 | static INPUT_PORTS_START( darwin ) |
| 276 | COMMON_IN0 | |
| 277 | COMMON_IN1 | |
| 265 | COMMON_IN0 | |
| 266 | COMMON_IN1 | |
| 278 | 267 | |
| 279 | 268 | PORT_START_TAG("IN2") /* modified by Shingo Suzuki 1999/11/02 */ |
| 280 | 269 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) |
| r1877 | r1878 | |
| 291 | 280 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) ) |
| 292 | 281 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 293 | 282 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 294 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) | |
| 295 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) | |
| 296 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_IMPULSE(2) | |
| 283 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 284 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0) | |
| 285 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_CHANGED(coin_inserted, 0) | |
| 297 | 286 | |
| 298 | 287 | PORT_START_TAG("DSW0") |
| 299 | 288 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) |
| r1877 | r1878 | |
| 402 | 391 | /* basic machine hardware */ |
| 403 | 392 | MDRV_CPU_ADD(M6809, MASTER_CLOCK/8) /* 1.5 MHz ? */ |
| 404 | 393 | MDRV_CPU_PROGRAM_MAP(brkthru_map,0) |
| 405 | MDRV_CPU_VBLANK_INT( | |
| 394 | MDRV_CPU_VBLANK_INT("main", nmi_lin | |
| 406 | 395 | |
| 407 | 396 | MDRV_CPU_ADD(M6809, MASTER_CLOCK/8) /* 1.5 MHz ? */ |
| 408 | 397 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
| 440 | 429 | /* basic machine hardware */ |
| 441 | 430 | MDRV_CPU_ADD(M6809, MASTER_CLOCK/8) /* 1.5 MHz ? */ |
| 442 | 431 | MDRV_CPU_PROGRAM_MAP(darwin_map,0) |
| 443 | MDRV_CPU_VBLANK_INT( | |
| 432 | MDRV_CPU_VBLANK_INT("main", nmi_lin | |
| 444 | 433 | |
| 445 | 434 | MDRV_CPU_ADD(M6809, MASTER_CLOCK/8) /* 1.5 MHz ? */ |
| 446 | 435 | MDRV_CPU_PROGRAM_MAP(sound_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 95 | 95 | /* Only used by ghostb, gondo, garyoret, other games can control buffering */ |
| 96 | 96 | static VIDEO_EOF( dec8 ) |
| 97 | 97 | { |
| 98 | buffer_spriteram_w(0,0); | |
| 98 | buffer_spriteram_w(machine,0,0); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | static READ8_HANDLER( i8751_h_r ) |
| r1877 | r1878 | |
| 426 | 426 | |
| 427 | 427 | static WRITE8_HANDLER( dec8_sound_w ) |
| 428 | 428 | { |
| 429 | soundlatch_w(0,data); | |
| 430 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 429 | soundlatch_w(machine,0,data); | |
| 430 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | static WRITE8_HANDLER( oscar_sound_w ) |
| 434 | 434 | { |
| 435 | soundlatch_w(0,data); | |
| 436 | cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 435 | soundlatch_w(machine,0,data); | |
| 436 | cpunum_set_input_line(machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | static void csilver_adpcm_int(int data) |
| r1877 | r1878 | |
| 2087 | 2087 | /* basic machine hardware */ |
| 2088 | 2088 | MDRV_CPU_ADD(M6809, 2000000) |
| 2089 | 2089 | MDRV_CPU_PROGRAM_MAP(cobra_readmem,cobra_writemem) |
| 2090 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 2090 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 2091 | 2091 | |
| 2092 | 2092 | MDRV_CPU_ADD(M6502, 1500000) |
| 2093 | 2093 | /* audio CPU */ |
| r1877 | r1878 | |
| 2129 | 2129 | /* basic machine hardware */ |
| 2130 | 2130 | MDRV_CPU_ADD(HD6309, 3000000*4) |
| 2131 | 2131 | MDRV_CPU_PROGRAM_MAP(ghostb_readmem,ghostb_writemem) |
| 2132 | MDRV_CPU_VBLANK_INT(ghostb_interrupt | |
| 2132 | MDRV_CPU_VBLANK_INT("main", ghostb_interrupt | |
| 2133 | 2133 | |
| 2134 | 2134 | MDRV_CPU_ADD(M6502, 1500000) |
| 2135 | 2135 | /* audio CPU */ |
| r1877 | r1878 | |
| 2173 | 2173 | /* basic machine hardware */ |
| 2174 | 2174 | MDRV_CPU_ADD(M6809,2000000) /* MC68A09EP */ |
| 2175 | 2175 | MDRV_CPU_PROGRAM_MAP(srdarwin_readmem,srdarwin_writemem) |
| 2176 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 2176 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 2177 | 2177 | |
| 2178 | 2178 | MDRV_CPU_ADD(M6502, 1500000) |
| 2179 | 2179 | /* audio CPU */ |
| r1877 | r1878 | |
| 2215 | 2215 | /* basic machine hardware */ |
| 2216 | 2216 | MDRV_CPU_ADD(HD6309,3000000*4) /* HD63C09EP */ |
| 2217 | 2217 | MDRV_CPU_PROGRAM_MAP(gondo_readmem,gondo_writemem) |
| 2218 | MDRV_CPU_VBLANK_INT(gondo_interrupt | |
| 2218 | MDRV_CPU_VBLANK_INT("main", gondo_interrupt | |
| 2219 | 2219 | |
| 2220 | 2220 | MDRV_CPU_ADD(M6502, 1500000) |
| 2221 | 2221 | /* audio CPU */ |
| r1877 | r1878 | |
| 2258 | 2258 | /* basic machine hardware */ |
| 2259 | 2259 | MDRV_CPU_ADD(HD6309, XTAL_12MHz/2) /* verified on pcb */ |
| 2260 | 2260 | MDRV_CPU_PROGRAM_MAP(oscar_readmem,oscar_writemem) |
| 2261 | MDRV_CPU_VBLANK_INT(oscar_interrupt | |
| 2261 | MDRV_CPU_VBLANK_INT("main", oscar_interrupt | |
| 2262 | 2262 | |
| 2263 | 2263 | MDRV_CPU_ADD(HD6309, XTAL_12MHz/2) /* verified on pcb */ |
| 2264 | 2264 | MDRV_CPU_PROGRAM_MAP(oscar_sub_readmem,oscar_sub_writemem) |
| r1877 | r1878 | |
| 2397 | 2397 | |
| 2398 | 2398 | MDRV_CPU_ADD(M6809, XTAL_12MHz/8) /* verified on pcb */ |
| 2399 | 2399 | MDRV_CPU_PROGRAM_MAP(csilver_sub_readmem,csilver_sub_writemem) |
| 2400 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 2400 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 2401 | 2401 | |
| 2402 | 2402 | MDRV_CPU_ADD(M6502, XTAL_12MHz/8) /* verified on pcb */ |
| 2403 | 2403 | /* audio CPU */ |
| r1877 | r1878 | |
| 2444 | 2444 | /* basic machine hardware */ |
| 2445 | 2445 | MDRV_CPU_ADD(HD6309,3000000*4) /* HD63C09EP */ |
| 2446 | 2446 | MDRV_CPU_PROGRAM_MAP(garyoret_readmem,garyoret_writemem) |
| 2447 | MDRV_CPU_VBLANK_INT(gondo_interrupt | |
| 2447 | MDRV_CPU_VBLANK_INT("main", gondo_interrupt | |
| 2448 | 2448 | |
| 2449 | 2449 | MDRV_CPU_ADD(M6502, 1500000) |
| 2450 | 2450 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 121 | 121 | |
| 122 | 122 | MDRV_CPU_ADD(8085A,8000000) /* Sound CPU? */ |
| 123 | 123 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 124 | // MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 124 | // MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 125 | 125 | |
| 126 | 126 | MDRV_SCREEN_ADD("main", RASTER) |
| 127 | 127 | MDRV_SCREEN_REFRESH_RATE(60) |
| r1877 | r1878 | |
|---|---|---|
| 86 | 86 | |
| 87 | 87 | static WRITE8_HANDLER( tbowl_sound_command_w ) |
| 88 | 88 | { |
| 89 | soundlatch_w(offset,data); | |
| 90 | cpunum_set_input_line(Machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 89 | soundlatch_w(machine,offset,data); | |
| 90 | cpunum_set_input_line(machine, 2,INPUT_LINE_NMI,PULSE_LINE); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
| r1877 | r1878 | |
| 589 | 589 | /* CPU on Board '6206B' */ |
| 590 | 590 | MDRV_CPU_ADD(Z80, 8000000) /* NEC D70008AC-8 (Z80 Clone) */ |
| 591 | 591 | MDRV_CPU_PROGRAM_MAP(readmem_6206B,writemem_6206B) |
| 592 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 592 | MDRV_CPU_VBLANK_INT("left", irq0_line_hold | |
| 593 | 593 | |
| 594 | 594 | /* CPU on Board '6206C' */ |
| 595 | 595 | MDRV_CPU_ADD(Z80, 8000000) /* NEC D70008AC-8 (Z80 Clone) */ |
| 596 | 596 | MDRV_CPU_PROGRAM_MAP(readmem_6206C,writemem_6206C) |
| 597 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 597 | MDRV_CPU_VBLANK_INT("left", irq0_line_hold | |
| 598 | 598 | |
| 599 | 599 | /* CPU on Board '6206A' */ |
| 600 | 600 | MDRV_CPU_ADD(Z80, 4000000) /* Actual Z80 */ |
| r1877 | r1878 | |
|---|---|---|
| 258 | 258 | /* basic machine hardware */ |
| 259 | 259 | MDRV_CPU_ADD(M6809, 1250000) /* 1.25 MHz ? */ |
| 260 | 260 | MDRV_CPU_PROGRAM_MAP(battlane_map, 0) |
| 261 | MDRV_CPU_VBLANK_INT(battlane_cpu1_interrupt | |
| 261 | MDRV_CPU_VBLANK_INT("main", battlane_cpu1_interrupt | |
| 262 | 262 | |
| 263 | 263 | MDRV_CPU_ADD(M6809, 1250000) /* 1.25 MHz ? */ |
| 264 | 264 | MDRV_CPU_PROGRAM_MAP(battlane_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 93 | 93 | if (reason) |
| 94 | 94 | atarigen_sound_int_gen(Machine, 0); |
| 95 | 95 | else |
| 96 | atarigen_sound_int_ack_w(0,0,0); | |
| 96 | atarigen_sound_int_ack_w(Machine,0,0,0); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
| r1877 | r1878 | |
| 807 | 807 | /* basic machine hardware */ |
| 808 | 808 | MDRV_CPU_ADD(M68EC020, ATARI_CLOCK_50MHz/2) |
| 809 | 809 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 810 | MDRV_CPU_VBLANK_INT(atarigen_video_int_gen | |
| 810 | MDRV_CPU_VBLANK_INT("main", atarigen_video_int_gen | |
| 811 | 811 | MDRV_CPU_PERIODIC_INT(atarigen_scanline_int_gen, 250) |
| 812 | 812 | |
| 813 | 813 | MDRV_MACHINE_RESET(atarigt) |
| r1877 | r1878 | |
| 1087 | 1087 | if (pc == 0x25834 || pc == 0x25860) |
| 1088 | 1088 | logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", activecpu_get_pc(), 0xd72000 + offset*4, data, ~mem_mask, (UINT32)activecpu_get_reg(M68K_A3) - 2); |
| 1089 | 1089 | |
| 1090 | atarigen_playfield32_w(offset, data, mem_mask); | |
| 1090 | atarigen_playfield32_w(machine, offset, data, mem_mask); | |
| 1091 | 1091 | } |
| 1092 | 1092 | |
| 1093 | 1093 | static DRIVER_INIT( tmek ) |
| r1877 | r1878 | |
|---|---|---|
| 354 | 354 | MDRV_CPU_ADD(Z80, 8000000/2) // ??? |
| 355 | 355 | MDRV_CPU_PROGRAM_MAP(cm_map, 0) |
| 356 | 356 | MDRV_CPU_IO_MAP(cm_io_map, 0) |
| 357 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 357 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 358 | 358 | |
| 359 | 359 | //MDRV_NVRAM_HANDLER(cmv801) |
| 360 | 360 |
| r1877 | r1878 | |
|---|---|---|
| 88 | 88 | |
| 89 | 89 | static READ16_HANDLER( eeprom_r ) |
| 90 | 90 | { |
| 91 | return (EEPROM_read_bit() << 15)|(input_port_3_word_r(0,0)&0x7fff); | |
| 91 | return (EEPROM_read_bit() << 15)|(input_port_3_word_r(machine,0,0)&0x7fff); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | static WRITE16_HANDLER( eeprom_w ) |
| r1877 | r1878 | |
| 501 | 501 | static MACHINE_DRIVER_START( rbmk ) |
| 502 | 502 | MDRV_CPU_ADD_TAG("main", M68000, 22000000 /2) |
| 503 | 503 | MDRV_CPU_PROGRAM_MAP(rbmk_mem,0) |
| 504 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 504 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 505 | 505 | |
| 506 | 506 | MDRV_GFXDECODE(rbmk) |
| 507 | 507 |
| r1877 | r1878 | |
|---|---|---|
| 214 | 214 | |
| 215 | 215 | |
| 216 | 216 | |
| 217 | static void draw_sprites(running_machine *machine, | |
| 217 | static void draw_sprites(running_machine *machine, | |
| 218 | 218 | { |
| 219 | 219 | int offs; |
| 220 | 220 | for (offs = 0;offs < spriteram_size/2;offs += 4) |
| r1877 | r1878 | |
| 272 | 272 | |
| 273 | 273 | static VIDEO_EOF( bigfghtr ) |
| 274 | 274 | { |
| 275 | buffer_spriteram16_w(0,0,0); | |
| 275 | buffer_spriteram16_w(machine,0,0,0); | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | |
| 279 | 279 | static WRITE16_HANDLER( sound_command_w ) |
| 280 | 280 | { |
| 281 | 281 | if (ACCESSING_LSB) |
| 282 | soundlatch_w(0,((data & 0x7f) << 1) | 1); | |
| 282 | soundlatch_w(machine,0,((data & 0x7f) << 1) | 1); | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | static WRITE16_HANDLER( io_w ) |
| r1877 | r1878 | |
| 317 | 317 | break; |
| 318 | 318 | |
| 319 | 319 | case 0x46/2: |
| 320 | return (input_port_0_word_r(0,0)&0xffff)^0xffff; | |
| 320 | return (input_port_0_word_r(machine,0,0)&0xffff)^0xffff; | |
| 321 | 321 | |
| 322 | 322 | |
| 323 | 323 | } |
| r1877 | r1878 | |
| 357 | 357 | |
| 358 | 358 | static READ8_HANDLER( soundlatch_clear_r ) |
| 359 | 359 | { |
| 360 | soundlatch_clear_w(0,0); | |
| 360 | soundlatch_clear_w(machine,0,0); | |
| 361 | 361 | return 0; |
| 362 | 362 | } |
| 363 | 363 | |
| r1877 | r1878 | |
| 421 | 421 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz?? */ |
| 422 | 422 | MDRV_CPU_PROGRAM_MAP(mainmem,0) |
| 423 | 423 | |
| 424 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 424 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 425 | 425 | |
| 426 | 426 | MDRV_CPU_ADD(Z80, 3072000) |
| 427 | 427 | /* audio CPU */ /* 3.072 MHz???? */ |
| 428 | 428 | MDRV_CPU_PROGRAM_MAP(soundmem,0) |
| 429 | 429 | MDRV_CPU_IO_MAP(soundport,0) |
| 430 | MDRV_CPU_VBLANK_INT(irq0_line_hold,128) | |
| 430 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128) | |
| 431 | 431 | |
| 432 | 432 | /* video hardware */ |
| 433 | 433 | MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM) |
| r1877 | r1878 | |
|---|---|---|
| 271 | 271 | switch (offset & 3) |
| 272 | 272 | { |
| 273 | 273 | case 0: |
| 274 | if (ACCESSING_MSB) return YM3438_status_port_0_A_r(0) << 8; | |
| 275 | else return YM3438_read_port_0_r(0); | |
| 274 | if (ACCESSING_MSB) return YM3438_status_port_0_A_r(machine, 0) << 8; | |
| 275 | else return YM3438_read_port_0_r(machine, 0); | |
| 276 | 276 | break; |
| 277 | 277 | case 2: |
| 278 | if (ACCESSING_MSB) return YM3438_status_port_0_B_r(0) << 8; | |
| 278 | if (ACCESSING_MSB) return YM3438_status_port_0_B_r(machine, 0) << 8; | |
| 279 | 279 | else return 0; |
| 280 | 280 | break; |
| 281 | 281 | } |
| r1877 | r1878 | |
| 331 | 331 | switch (offset & 3) |
| 332 | 332 | { |
| 333 | 333 | case 0: |
| 334 | if (ACCESSING_MSB) return YM3438_status_port_0_A_r(0) << 8; | |
| 335 | else return YM3438_read_port_0_r(0); | |
| 334 | if (ACCESSING_MSB) return YM3438_status_port_0_A_r(machine, 0) << 8; | |
| 335 | else return YM3438_read_port_0_r(machine, 0); | |
| 336 | 336 | break; |
| 337 | 337 | case 2: |
| 338 | if (ACCESSING_MSB) return YM3438_status_port_0_B_r(0) << 8; | |
| 338 | if (ACCESSING_MSB) return YM3438_status_port_0_B_r(machine, 0) << 8; | |
| 339 | 339 | else return 0; |
| 340 | 340 | break; |
| 341 | 341 | } |
| r1877 | r1878 | |
| 383 | 383 | switch (offset & 3) |
| 384 | 384 | { |
| 385 | 385 | case 0: |
| 386 | if (ACCESSING_MSB) YM3438_control_port_0_A_w (0, (data >> 8) & 0xff); | |
| 387 | else YM3438_data_port_0_A_w (0, (data >> 0) & 0xff); | |
| 386 | if (ACCESSING_MSB) YM3438_control_port_0_A_w (machine, 0, (data >> 8) & 0xff); | |
| 387 | else YM3438_data_port_0_A_w (machine, 0, (data >> 0) & 0xff); | |
| 388 | 388 | break; |
| 389 | 389 | case 2: |
| 390 | if (ACCESSING_MSB) YM3438_control_port_0_B_w (0, (data >> 8) & 0xff); | |
| 391 | else YM3438_data_port_0_B_w (0, (data >> 0) & 0xff); | |
| 390 | if (ACCESSING_MSB) YM3438_control_port_0_B_w (machine, 0, (data >> 8) & 0xff); | |
| 391 | else YM3438_data_port_0_B_w (machine, 0, (data >> 0) & 0xff); | |
| 392 | 392 | break; |
| 393 | 393 | } |
| 394 | 394 | } |
| r1877 | r1878 | |
| 412 | 412 | |
| 413 | 413 | if ( (offset >= 0x10) && (offset <=0x17) ) |
| 414 | 414 | { |
| 415 | if (ACCESSING_LSB) SN76496_0_w(0, data & 0xff); | |
| 416 | if (ACCESSING_MSB) SN76496_0_w(0, (data >>8) & 0xff); | |
| 415 | if (ACCESSING_LSB) SN76496_0_w(machine, 0, data & 0xff); | |
| 416 | if (ACCESSING_MSB) SN76496_0_w(machine, 0, (data >>8) & 0xff); | |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | } |
| r1877 | r1878 | |
| 677 | 677 | { |
| 678 | 678 | switch (offset & 3) |
| 679 | 679 | { |
| 680 | case 0: return YM3438_status_port_0_A_r(0); | |
| 681 | case 1: return YM3438_read_port_0_r(0); | |
| 682 | case 2: return YM3438_status_port_0_B_r(0); | |
| 680 | case 0: return YM3438_status_port_0_A_r(machine, 0); | |
| 681 | case 1: return YM3438_read_port_0_r(machine, 0); | |
| 682 | case 2: return YM3438_status_port_0_B_r(machine, 0); | |
| 683 | 683 | case 3: return 0; |
| 684 | 684 | } |
| 685 | 685 | } |
| r1877 | r1878 | |
| 714 | 714 | { |
| 715 | 715 | switch (offset & 3) |
| 716 | 716 | { |
| 717 | case 0: YM3438_control_port_0_A_w (0, data); | |
| 717 | case 0: YM3438_control_port_0_A_w (machine, 0, data); | |
| 718 | 718 | break; |
| 719 | case 1: YM3438_data_port_0_A_w (0, data); | |
| 719 | case 1: YM3438_data_port_0_A_w (machine, 0, data); | |
| 720 | 720 | break; |
| 721 | case 2: YM3438_control_port_0_B_w (0, data); | |
| 721 | case 2: YM3438_control_port_0_B_w (machine, 0, data); | |
| 722 | 722 | break; |
| 723 | case 3: YM3438_data_port_0_B_w (0, data); | |
| 723 | case 3: YM3438_data_port_0_B_w (machine, 0, data); | |
| 724 | 724 | break; |
| 725 | 725 | } |
| 726 | 726 | } |
| r1877 | r1878 | |
| 728 | 728 | /* Bank Register */ |
| 729 | 729 | if ((offset >= 0x6000) && (offset <= 0x60ff)) |
| 730 | 730 | { |
| 731 | genesis_bank_select_w(offset & 0xff, data); | |
| 731 | genesis_bank_select_w(machine, offset & 0xff, data); | |
| 732 | 732 | } |
| 733 | 733 | |
| 734 | 734 | /* Unused / Illegal */ |
| r1877 | r1878 | |
| 782 | 782 | /*basic machine hardware */ |
| 783 | 783 | MDRV_CPU_ADD_TAG("main", M68000, MASTER_CLOCK / 7) |
| 784 | 784 | MDRV_CPU_PROGRAM_MAP(genesis_readmem, genesis_writemem) |
| 785 | MDRV_CPU_VBLANK_INT(genesis_vblank_interrupt | |
| 785 | MDRV_CPU_VBLANK_INT("main", genesis_vblank_interrupt | |
| 786 | 786 | |
| 787 | 787 | MDRV_CPU_ADD_TAG("sound", Z80, MASTER_CLOCK / 15) |
| 788 | 788 | MDRV_CPU_PROGRAM_MAP(genesis_z80_readmem, genesis_z80_writemem) |
| 789 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 789 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 790 | 790 | |
| 791 | 791 | MDRV_INTERLEAVE(100) |
| 792 | 792 |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | |
| 62 | 62 | static READ8_HANDLER(amidar_ppi8255_0_r) |
| 63 | 63 | { |
| 64 | return ppi8255_0_r(offset >> 4); | |
| 64 | return ppi8255_0_r(machine, offset >> 4); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | static READ8_HANDLER(amidar_ppi8255_1_r) |
| 68 | 68 | { |
| 69 | return ppi8255_1_r(offset >> 4); | |
| 69 | return ppi8255_1_r(machine, offset >> 4); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | static WRITE8_HANDLER(amidar_ppi8255_0_w) |
| 73 | 73 | { |
| 74 | ppi8255_0_w(offset >> 4, data); | |
| 74 | ppi8255_0_w(machine, offset >> 4, data); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | static WRITE8_HANDLER(amidar_ppi8255_1_w) |
| 78 | 78 | { |
| 79 | ppi8255_1_w(offset >> 4, data); | |
| 79 | ppi8255_1_w(machine, offset >> 4, data); | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 |
| r1877 | r1878 | |
|---|---|---|
| 644 | 644 | /* basic machine hardware */ |
| 645 | 645 | MDRV_CPU_ADD_TAG("main", Z80, PIXEL_CLOCK/2) /* 3.072 MHz */ |
| 646 | 646 | MDRV_CPU_PROGRAM_MAP(thepit_main_map,0) |
| 647 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 647 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 648 | 648 | |
| 649 | 649 | MDRV_CPU_ADD(Z80, SOUND_CLOCK/4) /* 2.5 MHz */ |
| 650 | 650 | MDRV_CPU_PROGRAM_MAP(audio_map,0) |
| 651 | 651 | MDRV_CPU_IO_MAP(audio_io_map,0) |
| 652 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 652 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 653 | 653 | |
| 654 | 654 | /* video hardware */ |
| 655 | 655 | MDRV_GFXDECODE(thepit) |
| r1877 | r1878 | |
|---|---|---|
| 282 | 282 | MDRV_CPU_ADD(Z80,10000000/2) // ? |
| 283 | 283 | MDRV_CPU_PROGRAM_MAP(cpu_map,0) |
| 284 | 284 | MDRV_CPU_IO_MAP(io_map,0) |
| 285 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 285 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 286 | 286 | |
| 287 | 287 | /* video hardware */ |
| 288 | 288 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "deprecat.h" | |
| 12 | 13 | #include "cpu/z80/z80.h" |
| 13 | 14 | #include "cpu/m6805/m6805.h" |
| 14 | 15 | #include "sound/ay8910.h" |
| r1877 | r1878 | |
| 479 | 480 | |
| 480 | 481 | MDRV_CPU_ADD(Z80,5000000) |
| 481 | 482 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 482 | MDRV_CPU_VBLANK_INT(chl_interrupt,4) | |
| 483 | MDRV_CPU_VBLANK_INT_HACK(chl_interrupt,4) | |
| 483 | 484 | |
| 484 | 485 | MDRV_CPU_ADD(M68705,2500000) |
| 485 | 486 | MDRV_CPU_PROGRAM_MAP(mcu_readmem,mcu_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | static WRITE8_HANDLER( crimfght_sh_irqtrigger_w ) |
| 33 | 33 | { |
| 34 | soundlatch_w(offset,data); | |
| 35 | cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff); | |
| 34 | soundlatch_w(machine,offset,data); | |
| 35 | cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff); | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | static WRITE8_HANDLER( crimfght_snd_bankswitch_w ) |
| r1877 | r1878 | |
| 367 | 367 | /* basic machine hardware */ |
| 368 | 368 | MDRV_CPU_ADD(KONAMI, 3000000) /* ? */ |
| 369 | 369 | MDRV_CPU_PROGRAM_MAP(crimfght_readmem,crimfght_writemem) |
| 370 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 370 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 371 | 371 | |
| 372 | 372 | MDRV_CPU_ADD(Z80, 3579545) /* verified with PCB */ |
| 373 | 373 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 95 | 95 | static UINT32 *rabbit_tilemap_regs[4]; |
| 96 | 96 | static UINT32 *rabbit_spriteregs; |
| 97 | 97 | static UINT32 *rabbit_blitterregs; |
| 98 | static | |
| 98 | static | |
| 99 | 99 | static rectangle rabbit_sprite_clip; |
| 100 | 100 | |
| 101 | 101 | static int rabbit_vblirqlevel, rabbit_bltirqlevel, rabbit_banking; |
| r1877 | r1878 | |
| 214 | 214 | |
| 215 | 215 | */ |
| 216 | 216 | |
| 217 | static void draw_sprites(running_machine *machine, | |
| 217 | static void draw_sprites(running_machine *machine, | |
| 218 | 218 | { |
| 219 | 219 | int xpos,ypos,tileno,xflip,yflip, colr; |
| 220 | 220 | const gfx_element *gfx = machine->gfx[1]; |
| r1877 | r1878 | |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | /* the sprite bitmap can probably be handled better than this ... */ |
| 256 | static void rabbit_clearspritebitmap( | |
| 256 | static void rabbit_clearspritebitmap( | |
| 257 | 257 | { |
| 258 | 258 | int startx, starty; |
| 259 | 259 | int y; |
| r1877 | r1878 | |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | /* todo: fix zoom, its inaccurate and this code is ugly */ |
| 283 | static void draw_sprite_bitmap( | |
| 283 | static void draw_sprite_bitmap( | |
| 284 | 284 | { |
| 285 | 285 | |
| 286 | 286 | UINT32 x,y; |
| r1877 | r1878 | |
| 383 | 383 | |
| 384 | 384 | */ |
| 385 | 385 | |
| 386 | static void rabbit_drawtilemap( | |
| 386 | static void rabbit_drawtilemap( | |
| 387 | 387 | { |
| 388 | 388 | INT32 startx, starty, incxx, incxy, incyx, incyy, tran; |
| 389 | 389 | |
| r1877 | r1878 | |
| 1068 | 1068 | static MACHINE_DRIVER_START( rabbit ) |
| 1069 | 1069 | MDRV_CPU_ADD_TAG("main",M68EC020,24000000) /* 24 MHz */ |
| 1070 | 1070 | MDRV_CPU_PROGRAM_MAP(rabbit_readmem,rabbit_writemem) |
| 1071 | MDRV_CPU_VBLANK_INT(rabbit_interrupts,262) | |
| 1071 | MDRV_CPU_VBLANK_INT_HACK(rabbit_interrupts,262) | |
| 1072 | 1072 | /* (rabbit) */ |
| 1073 | 1073 | /* lev 1 : 0x64 : 0000 027c - |
| 1074 | 1074 | lev 2 : 0x68 : 0000 3106 - unused? |
| r1877 | r1878 | |
| 1197 | 1197 | MDRV_IMPORT_FROM(rabbit) |
| 1198 | 1198 | MDRV_CPU_MODIFY("main") |
| 1199 | 1199 | MDRV_CPU_PROGRAM_MAP(tmmjprd_readmem,tmmjprd_writemem) |
| 1200 | MDRV_CPU_VBLANK_INT(tmmjprd_interrupt,2) | |
| 1200 | MDRV_CPU_VBLANK_INT_HACK(tmmjprd_interrupt,2) | |
| 1201 | 1201 | |
| 1202 | 1202 | MDRV_VIDEO_START(tmmjprd) |
| 1203 | 1203 | MDRV_VIDEO_UPDATE(tmmjprd) |
| r1877 | r1878 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | |
| 8 | 8 | #include "driver.h" |
| 9 | #include "deprecat.h" | |
| 9 | 10 | |
| 10 | 11 | |
| 11 | 12 | #define NUM_PENS (8) |
| r1877 | r1878 | |
| 183 | 184 | MDRV_CPU_ADD_TAG("main",8080,1996800) /* clock is a guess, taken from mw8080bw */ |
| 184 | 185 | MDRV_CPU_PROGRAM_MAP(sstrangr_map,0) |
| 185 | 186 | MDRV_CPU_IO_MAP(sstrangr_io_map,0) |
| 186 | MDRV_CPU_VBLANK_INT(irq0_line_hold,2) | |
| 187 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2) | |
| 187 | 188 | |
| 188 | 189 | /* video hardware */ |
| 189 | 190 | MDRV_VIDEO_UPDATE(sstrangr) |
| r1877 | r1878 | |
|---|---|---|
| 783 | 783 | /* basic machine hardware */ |
| 784 | 784 | MDRV_CPU_ADD(M68000, 8000000) /* checked on PCB */ |
| 785 | 785 | MDRV_CPU_PROGRAM_MAP(bonzeadv_map,0) |
| 786 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 786 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 787 | 787 | |
| 788 | 788 | MDRV_CPU_ADD(Z80,4000000) /* sound CPU, also required for test mode */ |
| 789 | 789 | MDRV_CPU_PROGRAM_MAP(bonzeadv_z80_map,0) |
| r1877 | r1878 | |
| 819 | 819 | /* basic machine hardware */ |
| 820 | 820 | MDRV_CPU_ADD(M68000, XTAL_16MHz/2) /* verified on pcb */ |
| 821 | 821 | MDRV_CPU_PROGRAM_MAP(asuka_map,0) |
| 822 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 822 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 823 | 823 | |
| 824 | 824 | MDRV_CPU_ADD(Z80, XTAL_16MHz/4) /* verified on pcb */ |
| 825 | 825 | MDRV_CPU_PROGRAM_MAP(z80_map,0) |
| r1877 | r1878 | |
| 858 | 858 | /* basic machine hardware */ |
| 859 | 859 | MDRV_CPU_ADD(M68000, XTAL_32MHz/2) /* 68000p12 running at 16Mhz, verified on pcb */ |
| 860 | 860 | MDRV_CPU_PROGRAM_MAP(cadash_map,0) |
| 861 | MDRV_CPU_VBLANK_INT(cadash_interrupt | |
| 861 | MDRV_CPU_VBLANK_INT("main", cadash_interrupt | |
| 862 | 862 | |
| 863 | 863 | MDRV_CPU_ADD(Z80, XTAL_8MHz/2) /* verified on pcb */ |
| 864 | 864 | MDRV_CPU_PROGRAM_MAP(cadash_z80_map,0) |
| r1877 | r1878 | |
| 893 | 893 | /* basic machine hardware */ |
| 894 | 894 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz ??? */ |
| 895 | 895 | MDRV_CPU_PROGRAM_MAP(asuka_map,0) |
| 896 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 896 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 897 | 897 | |
| 898 | 898 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz ??? */ |
| 899 | 899 | MDRV_CPU_PROGRAM_MAP(z80_map,0) |
| r1877 | r1878 | |
| 932 | 932 | /* basic machine hardware */ |
| 933 | 933 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz ??? */ |
| 934 | 934 | MDRV_CPU_PROGRAM_MAP(asuka_map,0) |
| 935 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 935 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 936 | 936 | |
| 937 | 937 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz ??? */ |
| 938 | 938 | MDRV_CPU_PROGRAM_MAP(cadash_z80_map,0) |
| r1877 | r1878 | |
| 967 | 967 | /* basic machine hardware */ |
| 968 | 968 | MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz ??? */ |
| 969 | 969 | MDRV_CPU_PROGRAM_MAP(eto_map,0) |
| 970 | MDRV_CPU_VBLANK_INT(irq5_line_hold | |
| 970 | MDRV_CPU_VBLANK_INT("main", irq5_line_hold | |
| 971 | 971 | |
| 972 | 972 | MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz ??? */ |
| 973 | 973 | MDRV_CPU_PROGRAM_MAP(cadash_z80_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| 39 | static void triplhnt_update_misc(int offset) | |
| 39 | static void triplhnt_update_misc(running_machine *machine, int offset) | |
| 40 | 40 | { |
| 41 | 41 | UINT8 is_witch_hunt; |
| 42 | 42 | UINT8 bit = offset >> 1; |
| r1877 | r1878 | |
| 72 | 72 | coin_lockout_w(0, !(triplhnt_misc_flags & 0x08)); |
| 73 | 73 | coin_lockout_w(1, !(triplhnt_misc_flags & 0x08)); |
| 74 | 74 | |
| 75 | discrete_sound_w(TRIPLHNT_SCREECH_EN, triplhnt_misc_flags & 0x04); // screech | |
| 76 | discrete_sound_w(TRIPLHNT_LAMP_EN, triplhnt_misc_flags & 0x02); // Lamp is used to reset noise | |
| 77 | discrete_sound_w(TRIPLHNT_BEAR_EN, triplhnt_misc_flags & 0x80); // bear | |
| 75 | discrete_sound_w(machine, TRIPLHNT_SCREECH_EN, triplhnt_misc_flags & 0x04); // screech | |
| 76 | discrete_sound_w(machine, TRIPLHNT_LAMP_EN, triplhnt_misc_flags & 0x02); // Lamp is used to reset noise | |
| 77 | discrete_sound_w(machine, TRIPLHNT_BEAR_EN, triplhnt_misc_flags & 0x80); // bear | |
| 78 | 78 | |
| 79 | 79 | is_witch_hunt = readinputport(2) == 0x40; |
| 80 | 80 | bit = ~triplhnt_misc_flags & 0x40; |
| r1877 | r1878 | |
| 93 | 93 | |
| 94 | 94 | static WRITE8_HANDLER( triplhnt_misc_w ) |
| 95 | 95 | { |
| 96 | triplhnt_update_misc(offset); | |
| 96 | triplhnt_update_misc(machine, offset); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
| r1877 | r1878 | |
| 107 | 107 | |
| 108 | 108 | static READ8_HANDLER( triplhnt_input_port_4_r ) |
| 109 | 109 | { |
| 110 | watchdog_reset_w(0, 0); | |
| 111 | ||
| 110 | watchdog_reset_w(machine, 0, 0); | |
| 112 | 111 | return readinputport(4); |
| 113 | 112 | } |
| 114 | 113 | |
| 115 | 114 | |
| 116 | 115 | static READ8_HANDLER( triplhnt_misc_r ) |
| 117 | 116 | { |
| 118 | triplhnt_update_misc(offset); | |
| 119 | ||
| 117 | triplhnt_update_misc(machine, offset); | |
| 120 | 118 | return readinputport(7) | triplhnt_hit_code; |
| 121 | 119 | } |
| 122 | 120 | |
| r1877 | r1878 | |
| 321 | 319 | /* basic machine hardware */ |
| 322 | 320 | MDRV_CPU_ADD(M6800, 800000) |
| 323 | 321 | MDRV_CPU_PROGRAM_MAP(triplhnt_readmem, triplhnt_writemem) |
| 324 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 322 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 325 | 323 | |
| 326 | 324 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 327 | 325 |
| r1877 | r1878 | |
|---|---|---|
| 216 | 216 | /* basic machine hardware */ |
| 217 | 217 | MDRV_CPU_ADD(Z80, MASTER_CLOCK/3/2) |
| 218 | 218 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 219 | MDRV_CPU_VBLANK_INT(pooyan_interrupt | |
| 219 | MDRV_CPU_VBLANK_INT("main", pooyan_interrupt | |
| 220 | 220 | |
| 221 | 221 | MDRV_MACHINE_START(pooyan) |
| 222 | 222 |
| r1877 | r1878 | |
|---|---|---|
| 27 | 27 | static UINT32 *backfire_spriteram32_1; |
| 28 | 28 | static UINT32 *backfire_spriteram32_2; |
| 29 | 29 | static UINT32 *backfire_mainram; |
| 30 | static mame_bitmap * backfire_left; | |
| 31 | static mame_bitmap * backfire_right; | |
| 30 | static bitmap_t *backfire_left; | |
| 31 | static bitmap_t *backfire_right; | |
| 32 | 32 | |
| 33 | 33 | //UINT32 *backfire_180010, *backfire_188010; |
| 34 | 34 | static UINT32 *backfire_left_priority, *backfire_right_priority; |
| r1877 | r1878 | |
| 90 | 90 | backfire_right = auto_bitmap_alloc(80*8, 32*8, BITMAP_FORMAT_INDEXED16); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | static void draw_sprites(running_machine *machine, | |
| 93 | static void draw_sprites(running_machine *machine, | |
| 94 | 94 | { |
| 95 | 95 | int offs; |
| 96 | 96 | |
| r1877 | r1878 | |
| 104 | 104 | |
| 105 | 105 | y = backfire_spriteram32[offs]&0xffff; |
| 106 | 106 | flash=y&0x1000; |
| 107 | if (flash && ( | |
| 107 | if (flash && (vid | |
| 108 | 108 | |
| 109 | 109 | x = backfire_spriteram32[offs+2]&0xffff; |
| 110 | 110 | colour = (x >>9) & 0x1f; |
| r1877 | r1878 | |
| 264 | 264 | static WRITE32_HANDLER(wcvol95_nonbuffered_palette_w) |
| 265 | 265 | { |
| 266 | 266 | COMBINE_DATA(&paletteram32[offset]); |
| 267 | palette_set_color_rgb( | |
| 267 | palette_set_color_rgb(machine,offset,pal5bit(paletteram32[offset] >> 0),pal5bit(paletteram32[offset] >> 5),pal5bit(paletteram32[offset] >> 10)); | |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | |
| 271 | 271 | static READ32_HANDLER( deco156_snd_r ) |
| 272 | 272 | { |
| 273 | return YMZ280B_status_0_r(0); | |
| 273 | return YMZ280B_status_0_r(machine, 0); | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | static WRITE32_HANDLER( deco156_snd_w ) |
| 277 | 277 | { |
| 278 | 278 | if (offset) |
| 279 | YMZ280B_data_0_w(0, data); | |
| 279 | YMZ280B_data_0_w(machine, 0, data); | |
| 280 | 280 | else |
| 281 | YMZ280B_register_0_w(0, data); | |
| 281 | YMZ280B_register_0_w(machine, 0, data); | |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | /* map 32-bit writes to 16-bit */ |
| r1877 | r1878 | |
| 299 | 299 | static READ32_HANDLER( backfire_pf2_data_r ) { return deco16_pf2_data[offset]^0xffff0000; } |
| 300 | 300 | static READ32_HANDLER( backfire_pf3_data_r ) { return deco16_pf3_data[offset]^0xffff0000; } |
| 301 | 301 | static READ32_HANDLER( backfire_pf4_data_r ) { return deco16_pf4_data[offset]^0xffff0000; } |
| 302 | static WRITE32_HANDLER( backfire_pf1_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf1_data_w(offset,data,mem_mask); } | |
| 303 | static WRITE32_HANDLER( backfire_pf2_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf2_data_w(offset,data,mem_mask); } | |
| 304 | static WRITE32_HANDLER( backfire_pf3_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf3_data_w(offset,data,mem_mask); } | |
| 305 | static WRITE32_HANDLER( backfire_pf4_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf4_data_w(offset,data,mem_mask); } | |
| 302 | static WRITE32_HANDLER( backfire_pf1_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf1_data_w(machine,offset,data,mem_mask); } | |
| 303 | static WRITE32_HANDLER( backfire_pf2_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf2_data_w(machine,offset,data,mem_mask); } | |
| 304 | static WRITE32_HANDLER( backfire_pf3_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf3_data_w(machine,offset,data,mem_mask); } | |
| 305 | static WRITE32_HANDLER( backfire_pf4_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf4_data_w(machine,offset,data,mem_mask); } | |
| 306 | 306 | |
| 307 | 307 | #ifdef UNUSED_FUNCTION |
| 308 | 308 | READ32_HANDLER( backfire_unknown_wheel_r ) |
| r1877 | r1878 | |
| 489 | 489 | /* basic machine hardware */ |
| 490 | 490 | MDRV_CPU_ADD(ARM, 28000000/4) /* Unconfirmed */ |
| 491 | 491 | MDRV_CPU_PROGRAM_MAP(backfire_map,0) |
| 492 | MDRV_CPU_VBLANK_INT(deco32_vbl_interrupt | |
| 492 | MDRV_CPU_VBLANK_INT("left", deco32_vbl_interrupt | |
| 493 | 493 | |
| 494 | 494 | MDRV_NVRAM_HANDLER(93C46) |
| 495 | 495 |
| r1877 | r1878 | |
|---|---|---|
| 44 | 44 | |
| 45 | 45 | static READ8_HANDLER( rollerg_K051316_r ) |
| 46 | 46 | { |
| 47 | if (readzoomroms) return K051316_rom_0_r(offset); | |
| 48 | else return K051316_0_r(offset); | |
| 47 | if (readzoomroms) return K051316_rom_0_r(machine, offset); | |
| 48 | else return K051316_0_r(machine, offset); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | static READ8_HANDLER( rollerg_sound_r ) |
| 52 | 52 | { |
| 53 | 53 | /* If the sound CPU is running, read the status, otherwise |
| 54 | 54 | just make it pass the test */ |
| 55 | return K053260_0_r(2 + offset); | |
| 55 | return K053260_0_r(machine, 2 + offset); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | static WRITE8_HANDLER( soundirq_w ) |
| r1877 | r1878 | |
| 247 | 247 | /* basic machine hardware */ |
| 248 | 248 | MDRV_CPU_ADD(KONAMI, 3000000) /* ? */ |
| 249 | 249 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 250 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 250 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 251 | 251 | |
| 252 | 252 | MDRV_CPU_ADD(Z80, 3579545) |
| 253 | 253 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | static WRITE8_HANDLER( sound_cpu_command_w ) |
| 35 | 35 | { |
| 36 | soundlatch_w(offset,data); | |
| 37 | cpunum_set_input_line(Machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 36 | soundlatch_w(machine,offset,data); | |
| 37 | cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | static READ8_HANDLER( sidepckt_i8751_r ) |
| r1877 | r1878 | |
| 295 | 295 | /* basic machine hardware */ |
| 296 | 296 | MDRV_CPU_ADD(M6809, 2000000) /* 2 MHz */ |
| 297 | 297 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 298 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 298 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 299 | 299 | |
| 300 | 300 | MDRV_CPU_ADD(M6502, 1500000) |
| 301 | 301 | /* audio CPU */ /* 1.5 MHz */ |
| r1877 | r1878 | |
| 334 | 334 | /* basic machine hardware */ |
| 335 | 335 | MDRV_CPU_ADD(M6809, 2000000) /* 2 MHz */ |
| 336 | 336 | MDRV_CPU_PROGRAM_MAP(readmem,j_writemem) |
| 337 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 337 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 338 | 338 | |
| 339 | 339 | MDRV_CPU_ADD(M6502, 1500000) |
| 340 | 340 | /* audio CPU */ /* 1.5 MHz */ |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | memcpy(slapstic_base, &slapstic_source[current_bank * 0x2000], 0x2000); |
| 62 | 62 | |
| 63 | 63 | /* reset all the banks */ |
| 64 | starwars_out_w(4, 0); | |
| 64 | starwars_out_w(machine, 4, 0); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /* reset the matrix processor */ |
| r1877 | r1878 | |
| 136 | 136 | /* if we're jumping into the slapstic region, tweak the new PC */ |
| 137 | 137 | if ((address & 0xe000) == 0x8000) |
| 138 | 138 | { |
| 139 | esb_slapstic_r(address & 0x1fff); | |
| 139 | esb_slapstic_r(machine, address & 0x1fff); | |
| 140 | 140 | |
| 141 | 141 | /* make sure we catch the next branch as well */ |
| 142 | 142 | catch_nextBranch(); |
| r1877 | r1878 | |
| 147 | 147 | else if ((prevpc & 0xe000) == 0x8000) |
| 148 | 148 | { |
| 149 | 149 | if (prevpc != 0x8080 && prevpc != 0x8090 && prevpc != 0x80a0 && prevpc != 0x80b0) |
| 150 | esb_slapstic_r(prevpc & 0x1fff); | |
| 150 | esb_slapstic_r(machine, prevpc & 0x1fff); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | return address; |
| r1877 | r1878 | |
|---|---|---|
| 170 | 170 | bit = 1; |
| 171 | 171 | |
| 172 | 172 | /* bit 4 is EEPROM data, bit 7 is protection */ |
| 173 | return input_port_1_word_r(0,0) | (EEPROM_read_bit() << 4) | (bit << 7); | |
| 173 | return input_port_1_word_r(machine,0,0) | (EEPROM_read_bit() << 4) | (bit << 7); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | |
| r1877 | r1878 | |
| 287 | 287 | static MACHINE_DRIVER_START( pirates ) |
| 288 | 288 | MDRV_CPU_ADD(M68000, 16000000) /* 16mhz */ |
| 289 | 289 | MDRV_CPU_PROGRAM_MAP(pirates_readmem,pirates_writemem) |
| 290 | MDRV_CPU_VBLANK_INT(irq1_line_hold | |
| 290 | MDRV_CPU_VBLANK_INT("main", irq1_line_hold | |
| 291 | 291 | |
| 292 | 292 | MDRV_NVRAM_HANDLER(pirates) |
| 293 | 293 |
| r1877 | r1878 | |
|---|---|---|
| 281 | 281 | /* basic machine hardware */ |
| 282 | 282 | MDRV_CPU_ADD(M6502, 1000000) /* 1 MHz ???? */ |
| 283 | 283 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 284 | MDRV_CPU_VBLANK_INT(tankbatt_interrupt | |
| 284 | MDRV_CPU_VBLANK_INT("main", tankbatt_interrupt | |
| 285 | 285 | |
| 286 | 286 | /* video hardware */ |
| 287 | 287 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | #if 0 |
| 74 | static void draw_sprites(running_machine *machine, | |
| 74 | static void draw_sprites(running_machine *machine, | |
| 75 | 75 | { |
| 76 | 76 | // THIS IS COMPLETELY WRONG AND ONLY A PLACEHOLDER, IT HAS BEEN DISABLED TO KEEP THE COMPILER HAPPY |
| 77 | 77 | int offs; |
| r1877 | r1878 | |
| 374 | 374 | MDRV_CPU_ADD(Z80, 8000000/2) // ??? |
| 375 | 375 | MDRV_CPU_PROGRAM_MAP(cm_map, 0) |
| 376 | 376 | MDRV_CPU_IO_MAP(cm_io_map, 0) |
| 377 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 377 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 378 | 378 | |
| 379 | 379 | //MDRV_NVRAM_HANDLER(cmv801) |
| 380 | 380 |
| r1877 | r1878 | |
|---|---|---|
| 17 | 17 | #include "exerion.h" |
| 18 | 18 | #include "sound/ay8910.h" |
| 19 | 19 | |
| 20 | ||
| 20 | 21 | static UINT8 *exerion_ram; |
| 21 | 22 | |
| 23 | ||
| 24 | ||
| 22 | 25 | /************************************* |
| 23 | 26 | * |
| 24 | 27 | * Interrupts & inputs |
| r1877 | r1878 | |
| 28 | 31 | static READ8_HANDLER( exerion_port01_r ) |
| 29 | 32 | { |
| 30 | 33 | /* the cocktail flip bit muxes between ports 0 and 1 */ |
| 31 | return exerion_cocktail_flip ? input_port_1_r(offset) : input_port_0_r(offset); | |
| 34 | return exerion_cocktail_flip ? input_port_1_r(machine,offset) : input_port_0_r(machine,offset); | |
| 32 | 35 | } |
| 33 | 36 | |
| 34 | 37 | |
| 35 | static IN | |
| 38 | static IN | |
| 36 | 39 | { |
| 37 | /* Exerion triggers NMIs on coin insertion */ | |
| 38 | if (readinputport(4) & 1) | |
| 39 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 40 | /* coin insertion causes an NMI */ | |
| 41 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); | |
| 40 | 42 | } |
| 41 | 43 | |
| 42 | 44 | |
| r1877 | r1878 | |
| 184 | 186 | PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) ) |
| 185 | 187 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 186 | 188 | |
| 187 | PORT_START_TAG("FAKE") /* FAKE */ | |
| 188 | /* The coin slots are not memory mapped. */ | |
| 189 | /* This fake input port is used by the interrupt */ | |
| 190 | /* handler to be notified of coin insertions. We use IMPULSE to */ | |
| 191 | /* trigger exactly one interrupt, without having to check when the */ | |
| 192 | /* user releases the key. */ | |
| 193 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) | |
| 189 | PORT_START_TAG("COIN") | |
| 190 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0) | |
| 194 | 191 | INPUT_PORTS_END |
| 195 | 192 | |
| 196 | 193 | |
| r1877 | r1878 | |
| 281 | 278 | |
| 282 | 279 | MDRV_CPU_ADD(Z80, EXERION_CPU_CLOCK) |
| 283 | 280 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 284 | MDRV_CPU_VBLANK_INT(exerion_interrupt,1) | |
| 285 | 281 | |
| 286 | 282 | MDRV_CPU_ADD(Z80, EXERION_CPU_CLOCK) |
| 287 | 283 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| r1877 | r1878 | |
| 298 | 294 | MDRV_VIDEO_START(exerion) |
| 299 | 295 | MDRV_VIDEO_UPDATE(exerion) |
| 300 | 296 | |
| 301 | /* | |
| 297 | /* a | |
| 302 | 298 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 303 | 299 | |
| 304 | 300 | MDRV_SOUND_ADD(AY8910, EXERION_AY8910_CLOCK) |
| r1877 | r1878 | |
|---|---|---|
| 229 | 229 | |
| 230 | 230 | static MACHINE_DRIVER_START( wrally ) |
| 231 | 231 | /* basic machine hardware */ |
| 232 | MDRV_CPU_ADD(M68000,24 | |
| 232 | MDRV_CPU_ADD(M68000,XTAL_24MHz | |
| 233 | 233 | MDRV_CPU_PROGRAM_MAP(wrally_readmem,wrally_writemem) |
| 234 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 234 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 235 | 235 | |
| 236 | 236 | /* video hardware */ |
| 237 | 237 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 251 | 251 | /* sound hardware */ |
| 252 | 252 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 253 | 253 | |
| 254 | MDRV_SOUND_ADD(OKIM6295, 1056000) | |
| 255 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified | |
| 254 | MDRV_SOUND_ADD(OKIM6295, XTAL_1MHz) /* verified on pcb */ | |
| 255 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) /* verified on pcb */ | |
| 256 | 256 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 257 | 257 | MACHINE_DRIVER_END |
| 258 | 258 | |
| 259 | 259 | |
| 260 | ||
| 261 | 260 | ROM_START( wrally ) |
| 262 | 261 | ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68000 code */ |
| 263 | 262 | ROM_LOAD16_BYTE( "worldr17.c23", 0x000000, 0x080000, CRC(050f5629) SHA1(74fc2cd5114f3bc4b2429f1d8d7eeb1658f9f179) ) |
| r1877 | r1878 | |
|---|---|---|
| 285 | 285 | MDRV_CPU_ADD_TAG("main", Z180, 7000000) /* ??? */ |
| 286 | 286 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 287 | 287 | MDRV_CPU_IO_MAP(readport,writeport) |
| 288 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 288 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 289 | 289 | |
| 290 | 290 | /* video hardware */ |
| 291 | 291 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | static UINT8 misc_io_data[0x10]; |
| 62 | 62 | static UINT8 mcu_data; |
| 63 | 63 | |
| 64 | static read16_handler custom_io_r; | |
| 65 | static write16_handler custom_io_w; | |
| 64 | static read16_machine_func custom_io_r; | |
| 65 | static write16_machine_func custom_io_w; | |
| 66 | 66 | |
| 67 | 67 | static UINT8 wwally_last_x[3], wwally_last_y[3]; |
| 68 | 68 | static UINT8 lghost_value, lghost_select; |
| r1877 | r1878 | |
| 149 | 149 | |
| 150 | 150 | static void sound_w(UINT8 data) |
| 151 | 151 | { |
| 152 | soundlatch_w(0, data & 0xff); | |
| 152 | soundlatch_w(Machine, 0, data & 0xff); | |
| 153 | 153 | cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE); |
| 154 | 154 | } |
| 155 | 155 | |
| r1877 | r1878 | |
| 326 | 326 | /* I/O chip */ |
| 327 | 327 | case 0x0000/2: |
| 328 | 328 | case 0x1000/2: |
| 329 | return io_chip_r(offset, mem_mask); | |
| 329 | return io_chip_r(machine, offset, mem_mask); | |
| 330 | 330 | |
| 331 | 331 | /* video control latch */ |
| 332 | 332 | case 0x2000/2: |
| 333 | 333 | return readinputport(4 + (offset & 1)); |
| 334 | 334 | } |
| 335 | 335 | if (custom_io_r) |
| 336 | return custom_io_r(offset, mem_mask); | |
| 336 | return custom_io_r(machine, offset, mem_mask); | |
| 337 | 337 | logerror("%06X:misc_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2); |
| 338 | return segaic16_open_bus_r(0,0); | |
| 338 | return segaic16_open_bus_r(machine,0,0); | |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | |
| r1877 | r1878 | |
| 349 | 349 | case 0x1000/2: |
| 350 | 350 | if (ACCESSING_LSB) |
| 351 | 351 | { |
| 352 | io_chip_w(offset, data, mem_mask); | |
| 352 | io_chip_w(machine, offset, data, mem_mask); | |
| 353 | 353 | return; |
| 354 | 354 | } |
| 355 | 355 | break; |
| r1877 | r1878 | |
| 365 | 365 | } |
| 366 | 366 | if (custom_io_w) |
| 367 | 367 | { |
| 368 | custom_io_w(offset, data, mem_mask); | |
| 368 | custom_io_w(machine, offset, data, mem_mask); | |
| 369 | 369 | return; |
| 370 | 370 | } |
| 371 | 371 | logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask ^ 0xffff); |
| r1877 | r1878 | |
| 427 | 427 | case 0x3024/2: |
| 428 | 428 | return readinputportbytag("P34START"); |
| 429 | 429 | } |
| 430 | return segaic16_open_bus_r(0,0); | |
| 430 | return segaic16_open_bus_r(machine,0,0); | |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | |
| r1877 | r1878 | |
| 451 | 451 | lghost_value <<= 1; |
| 452 | 452 | return result; |
| 453 | 453 | } |
| 454 | return segaic16_open_bus_r(0,0); | |
| 454 | return segaic16_open_bus_r(machine,0,0); | |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | |
| r1877 | r1878 | |
| 511 | 511 | case 0x3014/2: |
| 512 | 512 | return (readinputportbytag("TRACKY3") - wwally_last_y[2]) & 0xff; |
| 513 | 513 | } |
| 514 | return segaic16_open_bus_r(0,0); | |
| 514 | return segaic16_open_bus_r(machine,0,0); | |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | |
| r1877 | r1878 | |
| 1258 | 1258 | /* basic machine hardware */ |
| 1259 | 1259 | MDRV_CPU_ADD_TAG("main", M68000, 10000000) |
| 1260 | 1260 | MDRV_CPU_PROGRAM_MAP(system18_map,0) |
| 1261 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 1261 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 1262 | 1262 | |
| 1263 | 1263 | MDRV_CPU_ADD_TAG("sound", Z80, 8000000) |
| 1264 | 1264 | /* audio CPU */ |
| r1877 | r1878 | |
| 1298 | 1298 | static MACHINE_DRIVER_START( system18_8751 ) |
| 1299 | 1299 | MDRV_IMPORT_FROM(system18) |
| 1300 | 1300 | MDRV_CPU_MODIFY("main") |
| 1301 | MDRV_CPU_VBLANK_INT | |
| 1301 | MDRV_CPU_VBLANK_INT | |
| 1302 | 1302 | |
| 1303 | 1303 | MDRV_CPU_ADD(I8751, 8000000) |
| 1304 | 1304 | MDRV_CPU_PROGRAM_MAP(mcu_map,0) |
| 1305 | 1305 | MDRV_CPU_DATA_MAP(mcu_data_map,0) |
| 1306 | MDRV_CPU_VBLANK_INT(irq0_line_pulse | |
| 1306 | MDRV_CPU_VBLANK_INT("main", irq0_line_pulse | |
| 1307 | 1307 | MACHINE_DRIVER_END |
| 1308 | 1308 | |
| 1309 | 1309 |
| r1877 | r1878 | |
|---|---|---|
| 69 | 69 | static WRITE16_HANDLER( sound_w ) |
| 70 | 70 | { |
| 71 | 71 | if(ACCESSING_LSB) |
| 72 | soundlatch_w(0, data&0xff); | |
| 72 | soundlatch_w(machine, 0, data&0xff); | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | static READ16_HANDLER( alpha_mcu_r ) |
| r1877 | r1878 | |
| 305 | 305 | static MACHINE_DRIVER_START( meijinsn ) |
| 306 | 306 | MDRV_CPU_ADD_TAG("main", M68000, 9000000 ) |
| 307 | 307 | MDRV_CPU_PROGRAM_MAP(meijinsn_map, 0) |
| 308 | MDRV_CPU_VBLANK_INT(meijinsn_interrupt,2) | |
| 308 | MDRV_CPU_VBLANK_INT_HACK(meijinsn_interrupt,2) | |
| 309 | 309 | |
| 310 | 310 | MDRV_CPU_ADD(Z80, 4000000) |
| 311 | 311 | MDRV_CPU_PROGRAM_MAP(meijinsn_sound_map,0) |
| 312 | 312 | MDRV_CPU_IO_MAP(meijinsn_sound_io_map,0) |
| 313 | MDRV_CPU_VBLANK_INT(irq0_line_hold, 160) | |
| 313 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 160) | |
| 314 | 314 | |
| 315 | 315 | MDRV_MACHINE_RESET(meijinsn) |
| 316 | 316 |
| r1877 | r1878 | |
|---|---|---|
| 649 | 649 | /* basic machine hardware */ |
| 650 | 650 | MDRV_CPU_ADD(M6502,2000000) /* ? MHz */ |
| 651 | 651 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 652 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 652 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 653 | 653 | |
| 654 | 654 | /* video hardware */ |
| 655 | 655 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | { |
| 55 | 55 | if(ACCESSING_LSB) |
| 56 | 56 | { |
| 57 | soundlatch_w(0,data & 0xff); | |
| 57 | soundlatch_w(machine,0,data & 0xff); | |
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
| r1877 | r1878 | |
| 406 | 406 | /* basic machine hardware */ |
| 407 | 407 | MDRV_CPU_ADD(M68000, 14318180/2) |
| 408 | 408 | MDRV_CPU_PROGRAM_MAP(crospang_readmem,crospang_writemem) |
| 409 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 409 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 410 | 410 | |
| 411 | 411 | MDRV_CPU_ADD(Z80, 14318180/4) |
| 412 | 412 | /* audio CPU */ |
| r1877 | r1878 | |
| 444 | 444 | /* basic machine hardware */ |
| 445 | 445 | MDRV_CPU_ADD(M68000, 14318180/2) |
| 446 | 446 | MDRV_CPU_PROGRAM_MAP(bestri_readmem,bestri_writemem) |
| 447 | MDRV_CPU_VBLANK_INT(irq6_line_hold | |
| 447 | MDRV_CPU_VBLANK_INT("main", irq6_line_hold | |
| 448 | 448 | |
| 449 | 449 | MDRV_CPU_ADD(Z80, 14318180/4) |
| 450 | 450 | /* audio CPU */ |
| r1877 | r1878 | |
|---|---|---|
| 221 | 221 | |
| 222 | 222 | static READ8_HANDLER( royalmah_player_1_port_r ) |
| 223 | 223 | { |
| 224 | int ret = (input_port_0_r(offset) & 0xc0) | 0x3f; | |
| 224 | int ret = (input_port_0_r(machine,offset) & 0xc0) | 0x3f; | |
| 225 | 225 | |
| 226 | if ((input_port_select & 0x01) == 0) ret &= input_port_0_r(offset); | |
| 227 | if ((input_port_select & 0x02) == 0) ret &= input_port_1_r(offset); | |
| 228 | if ((input_port_select & 0x04) == 0) ret &= input_port_2_r(offset); | |
| 229 | if ((input_port_select & 0x08) == 0) ret &= input_port_3_r(offset); | |
| 230 | if ((input_port_select & 0x10) == 0) ret &= input_port_4_r(offset); | |
| 226 | if ((input_port_select & 0x01) == 0) ret &= input_port_0_r(machine,offset); | |
| 227 | if ((input_port_select & 0x02) == 0) ret &= input_port_1_r(machine,offset); | |
| 228 | if ((input_port_select & 0x04) == 0) ret &= input_port_2_r(machine,offset); | |
| 229 | if ((input_port_select & 0x08) == 0) ret &= input_port_3_r(machine,offset); | |
| 230 | if ((input_port_select & 0x10) == 0) ret &= input_port_4_r(machine,offset); | |
| 231 | 231 | |
| 232 | 232 | return ret; |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | static READ8_HANDLER( royalmah_player_2_port_r ) |
| 236 | 236 | { |
| 237 | int ret = (input_port_5_r(offset) & 0xc0) | 0x3f; | |
| 237 | int ret = (input_port_5_r(machine,offset) & 0xc0) | 0x3f; | |
| 238 | 238 | |
| 239 | if ((input_port_select & 0x01) == 0) ret &= input_port_5_r(offset); | |
| 240 | if ((input_port_select & 0x02) == 0) ret &= input_port_6_r(offset); | |
| 241 | if ((input_port_select & 0x04) == 0) ret &= input_port_7_r(offset); | |
| 242 | if ((input_port_select & 0x08) == 0) ret &= input_port_8_r(offset); | |
| 243 | if ((input_port_select & 0x10) == 0) ret &= input_port_9_r(offset); | |
| 239 | if ((input_port_select & 0x01) == 0) ret &= input_port_5_r(machine,offset); | |
| 240 | if ((input_port_select & 0x02) == 0) ret &= input_port_6_r(machine,offset); | |
| 241 | if ((input_port_select & 0x04) == 0) ret &= input_port_7_r(machine,offset); | |
| 242 | if ((input_port_select & 0x08) == 0) ret &= input_port_8_r(machine,offset); | |
| 243 | if ((input_port_select & 0x10) == 0) ret &= input_port_9_r(machine,offset); | |
| 244 | 244 | |
| 245 | 245 | return ret; |
| 246 | 246 | } |
| r1877 | r1878 | |
| 574 | 574 | { |
| 575 | 575 | case 0x8000: return readinputport(14); // dsw 4 |
| 576 | 576 | case 0x8200: return readinputport(13); // dsw 3 |
| 577 | case 0x9001: return AY8910_read_port_0_r(0); // inputs | |
| 577 | case 0x9001: return AY8910_read_port_0_r(machine,0); // inputs | |
| 578 | 578 | case 0x9011: return readinputport(10); |
| 579 | 579 | } |
| 580 | 580 | |
| r1877 | r1878 | |
| 595 | 595 | switch(offset) |
| 596 | 596 | { |
| 597 | 597 | case 0x8e00: palette_base = data & 0x1f; return; |
| 598 | case 0x9002: AY8910_write_port_0_w(0,data); return; | |
| 599 | case 0x9003: AY8910_control_port_0_w(0,data); return; | |
| 598 | case 0x9002: AY8910_write_port_0_w(machine,0,data); return; | |
| 599 | case 0x9003: AY8910_control_port_0_w(machine,0,data); return; | |
| 600 | 600 | case 0x9010: |
| 601 | mjifb_coin_counter_w(0,data); | |
| 601 | mjifb_coin_counter_w(machine,0,data); | |
| 602 | 602 | return; |
| 603 | case 0x9011: input_port_select_w(0,data); return; | |
| 603 | case 0x9011: input_port_select_w(machine,0,data); return; | |
| 604 | 604 | case 0x9013: |
| 605 | 605 | // if (data) popmessage("%02x",data); |
| 606 | 606 | return; |
| r1877 | r1878 | |
| 681 | 681 | { |
| 682 | 682 | case 0x8000: return readinputport(14); // dsw 2 |
| 683 | 683 | case 0x8001: return readinputport(13); // dsw 1 |
| 684 | case 0x9001: return AY8910_read_port_0_r(0); // inputs | |
| 684 | case 0x9001: return AY8910_read_port_0_r(machine,0); // inputs | |
| 685 | 685 | case 0x9011: return readinputport(10); |
| 686 | 686 | } |
| 687 | 687 | |
| r1877 | r1878 | |
| 700 | 700 | offset += 0x8000; |
| 701 | 701 | switch(offset) |
| 702 | 702 | { |
| 703 | case 0x8802: palette_base = data & 0x1f; return; | |
| 704 | case 0x9002: AY8910_write_port_0_w(0,data); return; | |
| 705 | case 0x9003: AY8910_control_port_0_w(0,data); return; | |
| 706 | case 0x9010: mjifb_coin_counter_w(0,data); return; | |
| 707 | case 0x9011: input_port_select_w(0,data); return; | |
| 703 | case 0x8802: palette_base = data & 0x1f; return; | |
| 704 | case 0x9002: AY8910_write_port_0_w(machine,0,data); return; | |
| 705 | case 0x9003: AY8910_control_port_0_w(machine,0,data); return; | |
| 706 | case 0x9010: mjifb_coin_counter_w(machine,0,data); return; | |
| 707 | case 0x9011: input_port_select_w(machine,0,data); return; | |
| 708 | 708 | case 0x9013: |
| 709 | 709 | // if (data) popmessage("%02x",data); |
| 710 | 710 | return; |
| r1877 | r1878 | |
| 3315 | 3315 | MDRV_CPU_ADD_TAG("main", Z80, 3000000) /* 3.00 MHz ? */ |
| 3316 | 3316 | MDRV_CPU_PROGRAM_MAP(royalmah_map,0) |
| 3317 | 3317 | MDRV_CPU_IO_MAP(royalmah_iomap,0) |
| 3318 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 3318 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 3319 | 3319 | |
| 3320 | 3320 | MDRV_NVRAM_HANDLER(generic_0fill) |
| 3321 | 3321 | |
| r1877 | r1878 | |
| 3361 | 3361 | MDRV_IMPORT_FROM(dondenmj) |
| 3362 | 3362 | MDRV_CPU_MODIFY("main") |
| 3363 | 3363 | MDRV_CPU_IO_MAP(suzume_iomap,0) |
| 3364 | MDRV_CPU_VBLANK_INT(suzume_irq | |
| 3364 | MDRV_CPU_VBLANK_INT("main", suzume_irq | |
| 3365 | 3365 | MACHINE_DRIVER_END |
| 3366 | 3366 | |
| 3367 | 3367 | static MACHINE_DRIVER_START( tontonb ) |
| r1877 | r1878 | |
| 3415 | 3415 | MDRV_CPU_REPLACE("main",Z80,24000000/4) /* 6 MHz? */ |
| 3416 | 3416 | MDRV_CPU_PROGRAM_MAP(janptr96_map,0) |
| 3417 | 3417 | MDRV_CPU_IO_MAP(janptr96_iomap,0) |
| 3418 | MDRV_CPU_VBLANK_INT(janptr96_interrupt,3) /* IM 2 needs a vector on the data bus */ | |
| 3418 | MDRV_CPU_VBLANK_INT_HACK(janptr96_interrupt,3) /* IM 2 needs a vector on the data bus */ | |
| 3419 | 3419 | |
| 3420 | 3420 | MDRV_SCREEN_MODIFY("main") |
| 3421 | 3421 | MDRV_SCREEN_VISIBLE_AREA(0, 255, 9, 255-8) |
| r1877 | r1878 | |
| 3427 | 3427 | MDRV_CPU_REPLACE("main",TMP90841, 8000000) /* ? */ |
| 3428 | 3428 | MDRV_CPU_PROGRAM_MAP(mjifb_map,0) |
| 3429 | 3429 | MDRV_CPU_IO_MAP(mjifb_iomap,0) |
| 3430 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 3430 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 3431 | 3431 | |
| 3432 | 3432 | MDRV_SCREEN_MODIFY("main") |
| 3433 | 3433 | MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8) |
| r1877 | r1878 | |
| 3439 | 3439 | MDRV_CPU_REPLACE("main",TMP90841, 8000000) /* ? */ |
| 3440 | 3440 | MDRV_CPU_PROGRAM_MAP(mjdejavu_map,0) |
| 3441 | 3441 | MDRV_CPU_IO_MAP(mjifb_iomap,0) |
| 3442 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 3442 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 3443 | 3443 | |
| 3444 | 3444 | MDRV_SCREEN_MODIFY("main") |
| 3445 | 3445 | MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8) |
| r1877 | r1878 | |
| 3460 | 3460 | MDRV_CPU_REPLACE("main",TMP90841, 12000000) /* ? */ |
| 3461 | 3461 | MDRV_CPU_PROGRAM_MAP(mjtensin_map,0) |
| 3462 | 3462 | MDRV_CPU_IO_MAP(mjtensin_iomap,0) |
| 3463 | MDRV_CPU_VBLANK_INT( mjtensin_interrupt,2 ) | |
| 3463 | MDRV_CPU_VBLANK_INT_HACK( mjtensin_interrupt,2 ) | |
| 3464 | 3464 | |
| 3465 | 3465 | MDRV_SCREEN_MODIFY("main") |
| 3466 | 3466 | MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8) |
| r1877 | r1878 | |
| 3471 | 3471 | MDRV_CPU_REPLACE("main",TMP90841, 12000000) /* ? */ |
| 3472 | 3472 | MDRV_CPU_PROGRAM_MAP(cafetime_map,0) |
| 3473 | 3473 | MDRV_CPU_IO_MAP(cafetime_iomap,0) |
| 3474 | MDRV_CPU_VBLANK_INT(mjtensin_interrupt,2) | |
| 3474 | MDRV_CPU_VBLANK_INT_HACK(mjtensin_interrupt,2) | |
| 3475 | 3475 | |
| 3476 | 3476 | MDRV_SCREEN_MODIFY("main") |
| 3477 | 3477 | MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8) |
| r1877 | r1878 | |
|---|---|---|
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "deprecat.h" | |
| 21 | 22 | #include "subs.h" |
| 22 | 23 | #include "sound/discrete.h" |
| 23 | 24 | #include "rendlay.h" |
| r1877 | r1878 | |
| 185 | 186 | /* basic machine hardware */ |
| 186 | 187 | MDRV_CPU_ADD(M6502,12096000/16) /* clock input is the "4H" signal */ |
| 187 | 188 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 188 | MDRV_CPU_VBLANK_INT(subs_interrupt,4) | |
| 189 | MDRV_CPU_VBLANK_INT_HACK(subs_interrupt,4) | |
| 189 | 190 | |
| 190 | 191 | MDRV_MACHINE_RESET(subs) |
| 191 | 192 |
| r1877 | r1878 | |
|---|---|---|
| 178 | 178 | static MACHINE_DRIVER_START( coolridr ) |
| 179 | 179 | MDRV_CPU_ADD_TAG("main", SH2, 28000000) // ?? mhz |
| 180 | 180 | MDRV_CPU_PROGRAM_MAP(system_h1_map,0) |
| 181 | MDRV_CPU_VBLANK_INT(system_h1, 2) | |
| 181 | MDRV_CPU_VBLANK_INT_HACK(system_h1, 2) | |
| 182 | 182 | |
| 183 | 183 | MDRV_CPU_ADD_TAG("sound", M68000, 12000000) // ?? mhz |
| 184 | 184 | MDRV_CPU_PROGRAM_MAP(system_h1_sound_map,0) |
| 185 | 185 | |
| 186 | 186 | MDRV_CPU_ADD_TAG("sub", SH2, 8000000) // SH7032 HD6417032F20!! ?? mhz |
| 187 | 187 | MDRV_CPU_PROGRAM_MAP(coolridr_submap,0) |
| 188 | MDRV_CPU_VBLANK_INT(system_h1_sub, 2) | |
| 188 | MDRV_CPU_VBLANK_INT_HACK(system_h1_sub, 2) | |
| 189 | 189 | |
| 190 | 190 | MDRV_GFXDECODE(coolridr) |
| 191 | 191 |
| r1877 | r1878 | |
|---|---|---|
| 249 | 249 | /* basic machine hardware */ |
| 250 | 250 | MDRV_CPU_ADD(Z80,4000000) /* ? MHz */ |
| 251 | 251 | MDRV_CPU_PROGRAM_MAP(memmap, 0) |
| 252 | MDRV_CPU_VBLANK_INT(darkmist_interrupt,2) | |
| 252 | MDRV_CPU_VBLANK_INT_HACK(darkmist_interrupt,2) | |
| 253 | 253 | |
| 254 | 254 | MDRV_CPU_ADD_TAG(CPUTAG_T5182,Z80,14318180/4) /* 3.579545 MHz */ |
| 255 | 255 | MDRV_CPU_PROGRAM_MAP(t5182_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 383 | 383 | /* basic machine hardware */ |
| 384 | 384 | MDRV_CPU_ADD(Z80, 4000000) /* 4.0 MHz (?) */ |
| 385 | 385 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 386 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 386 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 387 | 387 | |
| 388 | 388 | MDRV_CPU_ADD(Z80, 4123456) /* ??? with 4 MHz, nested NMIs might happen */ |
| 389 | 389 | MDRV_CPU_PROGRAM_MAP(sub_map,0) |
| r1877 | r1878 | |
| 440 | 440 | /* basic machine hardware */ |
| 441 | 441 | MDRV_CPU_ADD(Z80, 4000000) /* 4.0 MHz (?) */ |
| 442 | 442 | MDRV_CPU_PROGRAM_MAP(bl_readmem,bl_writemem) |
| 443 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 443 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 444 | 444 | |
| 445 | 445 | MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz ? */ |
| 446 | 446 | MDRV_CPU_PROGRAM_MAP(bl_sound_readmem,bl_sound_writemem) |
| r1877 | r1878 | |
|---|---|---|
| 240 | 240 | /* basic machine hardware */ |
| 241 | 241 | MDRV_CPU_ADD(KONAMI, 3000000) /* 12/4 MHz*/ |
| 242 | 242 | MDRV_CPU_PROGRAM_MAP(ajax_main_map,0) |
| 243 | MDRV_CPU_VBLANK_INT(ajax_interrupt | |
| 243 | MDRV_CPU_VBLANK_INT("main", ajax_interrupt | |
| 244 | 244 | |
| 245 | 245 | MDRV_CPU_ADD(M6809, 3000000) /* ? */ |
| 246 | 246 | MDRV_CPU_PROGRAM_MAP(ajax_sub_map,0) |
| r1877 | r1878 | |
|---|---|---|
| 88 | 88 | |
| 89 | 89 | static READ16_HANDLER( es5503_word_lsb_r ) |
| 90 | 90 | { |
| 91 | return (ACCESSING_LSB) ? (ES5503_reg_0_r(offset) | 0xff00) : 0xffff; | |
| 91 | return (ACCESSING_LSB) ? (ES5503_reg_0_r(machine, offset) | 0xff00) : 0xffff; | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | static WRITE16_HANDLER( es5503_word_lsb_w ) |
| r1877 | r1878 | |
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | ES5503_reg_0_w(offset, data); | |
| 112 | ES5503_reg_0_w(machine, offset, data); | |
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
| r1877 | r1878 | |
| 352 | 352 | /* basic machine hardware */ |
| 353 | 353 | MDRV_CPU_ADD(M68000, AMIGA_68000_NTSC_CLOCK) |
| 354 | 354 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 355 | MDRV_CPU_VBLANK_INT(amiga_scanline_callback, 262) | |
| 356 | 355 | |
| 357 | 356 | MDRV_MACHINE_RESET(mquake) |
| 358 | 357 | MDRV_NVRAM_HANDLER(generic_0fill) |
| r1877 | r1878 | |
| 371 | 370 | MDRV_PALETTE_INIT(amiga) |
| 372 | 371 | |
| 373 | 372 | MDRV_VIDEO_START(amiga) |
| 374 | MDRV_VIDEO_UPDATE( | |
| 373 | MDRV_VIDEO_UPDATE(a | |
| 375 | 374 | |
| 376 | 375 | /* sound hardware */ |
| 377 | 376 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| r1877 | r1878 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | static WRITE8_HANDLER( funybubl_soundcommand_w ) |
| 82 | 82 | { |
| 83 | soundlatch_w(0,data); | |
| 84 | cpunum_set_input_line(Machine, 1,0, HOLD_LINE); | |
| 83 | soundlatch_w(machine,0,data); | |
| 84 | cpunum_set_input_line(machine, 1,0, HOLD_LINE); | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | static WRITE8_HANDLER( funybubl_oki_bank_sw ) |
| r1877 | r1878 | |
| 248 | 248 | MDRV_CPU_ADD(Z80,12000000/2) /* 6 MHz?? */ |
| 249 | 249 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 250 | 250 | MDRV_CPU_IO_MAP(readport,writeport) |
| 251 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 251 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 252 | 252 | |
| 253 | 253 | MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz?? */ |
| 254 | 254 | MDRV_CPU_PROGRAM_MAP(soundreadmem,soundwritemem) |
| r1877 | r1878 | |
|---|---|---|
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| 14 | #include "deprecat.h" | |
| 14 | 15 | #include "cpu/i8085/i8085.h" |
| 15 | 16 | |
| 16 | 17 | |
| r1877 | r1878 | |
| 151 | 152 | MDRV_CPU_ADD_TAG("main",8085A,4000000) /* 8080? */ /* 2 MHz? */ |
| 152 | 153 | MDRV_CPU_PROGRAM_MAP(rotaryf_map,0) |
| 153 | 154 | MDRV_CPU_IO_MAP(rotaryf_io_map,0) |
| 154 | MDRV_CPU_VBLANK_INT(rotaryf_interrupt,5) | |
| 155 | MDRV_CPU_VBLANK_INT_HACK(rotaryf_interrupt,5) | |
| 155 | 156 | |
| 156 | 157 | /* video hardware */ |
| 157 | 158 | MDRV_VIDEO_UPDATE(rotaryf) |
| r1877 | r1878 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | #include "driver.h" |
| 9 | #include "deprecat.h" | |
| 9 | 10 | #include "audio/m72.h" |
| 10 | 11 | #include "sound/dac.h" |
| 11 | 12 | #include "sound/2151intf.h" |
| r1877 | r1878 | |
| 19 | 20 | |
| 20 | 21 | static READ8_HANDLER( sichuan2_dsw1_r ) |
| 21 | 22 | { |
| 22 | int ret = input_port_3_r(0); | |
| 23 | int ret = input_port_3_r(machine, 0); | |
| 23 | 24 | |
| 24 | 25 | /* Based on the coin mode fill in the upper bits */ |
| 25 | if (input_port_4_r(0) & 0x04) | |
| 26 | if (input_port_4_r(machine, 0) & 0x04) | |
| 26 | 27 | { |
| 27 | 28 | /* Mode 1 */ |
| 28 | ret |= (input_port_5_r(0) << 4); | |
| 29 | ret |= (input_port_5_r(machine, 0) << 4); | |
| 29 | 30 | } |
| 30 | 31 | else |
| 31 | 32 | { |
| 32 | 33 | /* Mode 2 */ |
| 33 | ret |= (input_port_5_r(0) & 0xf0); | |
| 34 | ret |= (input_port_5_r(machine, 0) & 0xf0); | |
| 34 | 35 | } |
| 35 | 36 | |
| 36 | 37 | return ret; |
| r1877 | r1878 | |
| 243 | 244 | MDRV_CPU_ADD(Z80, 6000000) /* 6 MHz ? */ |
| 244 | 245 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 245 | 246 | MDRV_CPU_IO_MAP(readport,writeport) |
| 246 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 247 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 247 | 248 | |
| 248 | 249 | MDRV_CPU_ADD(Z80, 3579645) |
| 249 | 250 | /* audio CPU */ |
| 250 | 251 | MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem) |
| 251 | 252 | MDRV_CPU_IO_MAP(sound_readport,sound_writeport) |
| 252 | MDRV_CPU_VBLANK_INT(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 253 | MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128) /* clocked by V1? (Vigilante) */ | |
| 253 | 254 | /* IRQs are generated by main Z80 and YM2151 */ |
| 254 | 255 | |
| 255 | 256 | MDRV_MACHINE_RESET(m72_sound) |
| r1877 | r1878 | |
|---|---|---|
| 232 | 232 | /* basic machine hardware */ |
| 233 | 233 | MDRV_CPU_ADD(M6809, 1500000) /* 1.5 MHz ??? */ |
| 234 | 234 | MDRV_CPU_PROGRAM_MAP(main_map,0) |
| 235 | MDRV_CPU_VBLANK_INT(tutankhm_interrupt | |
| 235 | MDRV_CPU_VBLANK_INT("main", tutankhm_interrupt | |
| 236 | 236 | |
| 237 | 237 | MDRV_MACHINE_START(tutankhm) |
| 238 | 238 |
| r1877 | r1878 | |
|---|---|---|
| 277 | 277 | { |
| 278 | 278 | if (ACCESSING_LSB) |
| 279 | 279 | { |
| 280 | soundlatch_w(0,data & 0xff); | |
| 281 | cpunum_set_input_line(Machine, 1,0, HOLD_LINE); | |
| 280 | soundlatch_w(machine,0,data & 0xff); | |
| 281 | cpunum_set_input_line(machine, 1,0, HOLD_LINE); | |
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | 284 | |
| r1877 | r1878 | |
| 330 | 330 | return res << 8; |
| 331 | 331 | } |
| 332 | 332 | else |
| 333 | return ~input_port_1_word_r(0,0); | |
| 333 | return ~input_port_1_word_r(machine,0,0); | |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | static WRITE16_HANDLER( macross2_sound_command_w ) |
| 337 | 337 | { |
| 338 | 338 | if (ACCESSING_LSB) |
| 339 | soundlatch_w(0,data & 0xff); | |
| 339 | soundlatch_w(machine,0,data & 0xff); | |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | static READ16_HANDLER( macross2_sound_result_r ) |
| 343 | 343 | { |
| 344 | return soundlatch2_r(0); | |
| 344 | return soundlatch2_r(machine,0); | |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | static WRITE8_HANDLER( macross2_sound_bank_w ) |
| r1877 | r1878 | |
| 373 | 373 | { |
| 374 | 374 | if (ACCESSING_LSB) |
| 375 | 375 | { |
| 376 | soundlatch_w(0,data&0xff); | |
| 377 | cpunum_set_input_line(Machine, 1, 0, HOLD_LINE); | |
| 376 | soundlatch_w(machine,0,data&0xff); | |
| 377 | cpunum_set_input_line(machine, 1, 0, HOLD_LINE); | |
| 378 | 378 | } |
| 379 | 379 | } |
| 380 | 380 | |
| r1877 | r1878 | |
| 3696 | 3696 | /* basic machine hardware */ |
| 3697 | 3697 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz */ |
| 3698 | 3698 | MDRV_CPU_PROGRAM_MAP(tharrier_readmem,tharrier_writemem) |
| 3699 | MDRV_CPU_VBLANK_INT(nmk_interrupt,2) | |
| 3699 | MDRV_CPU_VBLANK_INT_HACK(nmk_interrupt,2) | |
| 3700 | 3700 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */ |
| 3701 | 3701 | |
| 3702 | 3702 | MDRV_CPU_ADD(Z80, 3000000) |
| r1877 | r1878 | |
| 3746 | 3746 | /* basic machine hardware */ |
| 3747 | 3747 | MDRV_CPU_ADD(M68000, 10000000) /* 10? MHz - check */ |
| 3748 | 3748 | MDRV_CPU_PROGRAM_MAP(manybloc_readmem,manybloc_writemem) |
| 3749 | MDRV_CPU_VBLANK_INT(nmk_interrupt,2) | |
| 3749 | MDRV_CPU_VBLANK_INT_HACK(nmk_interrupt,2) | |
| 3750 | 3750 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,56)/* this needs to equal the framerate on this, rather than being double it .. */ |
| 3751 | 3751 | |
| 3752 | 3752 | MDRV_CPU_ADD(Z80, 3000000) |
| r1877 | r1878 | |
| 3793 | 3793 | /* basic machine hardware */ |
| 3794 | 3794 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz ? */ |
| 3795 | 3795 | MDRV_CPU_PROGRAM_MAP(mustang_map,0) |
| 3796 | MDRV_CPU_VBLANK_INT(nmk_interrupt,2) | |
| 3796 | MDRV_CPU_VBLANK_INT_HACK(nmk_interrupt,2) | |
| 3797 | 3797 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */ |
| 3798 | 3798 | |
| 3799 | 3799 | MDRV_MACHINE_RESET(NMK004) |
| r1877 | r1878 | |
| 3838 | 3838 | /* basic machine hardware */ |
| 3839 | 3839 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz ? */ |
| 3840 | 3840 | MDRV_CPU_PROGRAM_MAP(mustangb_map,0) |
| 3841 | MDRV_CPU_VBLANK_INT(nmk_interrupt,2) | |
| 3841 | MDRV_CPU_VBLANK_INT_HACK(nmk_interrupt,2) | |
| 3842 | 3842 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */ |
| 3843 | 3843 | |
| 3844 | 3844 | SEIBU_SOUND_SYSTEM_CPU(14318180/4) |
| r1877 | r1878 | |
| 3920 | 3920 | /* basic machine hardware */ |
| 3921 | 3921 | MDRV_CPU_ADD(M68000, BIOSHIP_CRYSTAL1 ) /* 10.0 MHz (verified) */ |
| 3922 | 3922 | MDRV_CPU_PROGRAM_MAP(bioship_readmem,bioship_writemem) |
| 3923 | MDRV_CPU_VBLANK_INT(nmk_interrupt,2) | |
| 3923 | MDRV_CPU_VBLANK_INT_HACK(nmk_interrupt,2) | |
| 3924 | 3924 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */ |
| 3925 | 3925 | |
| 3926 | 3926 | MDRV_MACHINE_RESET(NMK004) |
| r1877 | r1878 | |
| 3964 | 3964 | /* basic machine hardware */ |
| 3965 | 3965 | MDRV_CPU_ADD(M68000, XTAL_10MHz) /* 68000p12 running at 10Mhz, verified on pcb */ |
| 3966 | 3966 | MDRV_CPU_PROGRAM_MAP(vandyke_readmem,vandyke_writemem) |
| 3967 | MDRV_CPU_VBLANK_INT(nmk_interrupt,2) | |
| 3967 | MDRV_CPU_VBLANK_INT_HACK(nmk_interrupt,2) | |
| 3968 | 3968 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */ |
| 3969 | 3969 | |
| 3970 | 3970 | MDRV_MACHINE_RESET(NMK004) |
| r1877 | r1878 | |
| 4008 | 4008 | /* basic machine hardware */ |
| 4009 | 4009 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz ? */ |
| 4010 | 4010 | MDRV_CPU_PROGRAM_MAP(vandyke_readmem,vandyke_writemem) |
| 4011 | MDRV_CPU_VBLANK_INT(nmk_interrupt,2) | |
| 4011 | MDRV_CPU_VBLANK_INT_HACK(nmk_interrupt,2) | |
| 4012 | 4012 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */ |
| 4013 | 4013 | |
| 4014 | 4014 | MDRV_CPU_ADD(PIC16C57, 12000000) /* 3MHz */ |
| r1877 | r1878 | |
| 4044 | 4044 | /* basic machine hardware */ |
| 4045 | 4045 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz (verified on pcb) */ |
| 4046 | 4046 | MDRV_CPU_PROGRAM_MAP(acrobatm_readmem,acrobatm_writemem) |
| 4047 | MDRV_CPU_VBLANK_INT(nmk_interrupt,2) | |
| 4047 | MDRV_CPU_VBLANK_INT_HACK(nmk_interrupt,2) | |
| 4048 | 4048 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */ |
| 4049 | 4049 | |
| 4050 | 4050 | MDRV_MACHINE_RESET(NMK004) |
| r1877 | r1878 | |
| 4090 | 4090 | /* basic machine hardware */ |
| 4091 | 4091 | MDRV_CPU_ADD(M68000, 10000000) |
| 4092 | 4092 | MDRV_CPU_PROGRAM_MAP(tdragon_readmem,tdragonb_writemem) |
| 4093 | //MDRV_CPU_VBLANK_INT(irq4_line_hold,1) | |
| 4094 | MDRV_CPU_VBLANK_INT(nmk_interrupt,2) | |
| 4093 | //MDRV_CPU_VBLANK_INT("main", irq4_line_hold) | |
| 4094 | MDRV_CPU_VBLANK_INT_HACK(nmk_interrupt,2) | |
| 4095 | 4095 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ?? drives music */ |
| 4096 | 4096 | |
| 4097 | 4097 | SEIBU_SOUND_SYSTEM_CPU(14318180/4) |
| r1877 | r1878 | |
| 4122 | 4122 | /* basic machine hardware */ |
| 4123 | 4123 | MDRV_CPU_ADD(M68000, 10000000) |
| 4124 | 4124 | MDRV_CPU_PROGRAM_MAP(tdragon_readmem,tdragon_writemem) |
| 4125 | MDRV_CPU_VBLANK_INT(nmk_interrupt,2) | |
| 4126 | //MDRV_CPU_VBLANK_INT(irq4_line_hold,1) | |
| 4125 | MDRV_CPU_VBLANK_INT_HACK(nmk_interrupt,2) | |
| 4126 | //MDRV_CPU_VBLANK_INT("main", irq4_line_hold) | |
| 4127 | 4127 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ?? drives music */ |
| 4128 | 4128 | |
| 4129 | 4129 | MDRV_MACHINE_RESET(NMK004) |
| r1877 | r1878 | |
| 4167 | 4167 | /* basic machine hardware */ |
| 4168 | 4168 | MDRV_CPU_ADD(M68000, 8000000) /* 8 Mhz */ |
| 4169 | 4169 | MDRV_CPU_PROGRAM_MAP(ssmissin_readmem,ssmissin_writemem) |
| 4170 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 4170 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 4171 | 4171 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112) /* input related */ |
| 4172 | 4172 | |
| 4173 | 4173 | MDRV_CPU_ADD(Z80, 8000000/2) /* 4 Mhz */ |
| r1877 | r1878 | |
| 4204 | 4204 | /* basic machine hardware */ |
| 4205 | 4205 | MDRV_CPU_ADD(M68000, 12000000) /* 12 MHz ? */ |
| 4206 | 4206 | MDRV_CPU_PROGRAM_MAP(strahl_readmem,strahl_writemem) |
| 4207 | MDRV_CPU_VBLANK_INT(nmk_interrupt,2) | |
| 4207 | MDRV_CPU_VBLANK_INT_HACK(nmk_interrupt,2) | |
| 4208 | 4208 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */ |
| 4209 | 4209 | |
| 4210 | 4210 | MDRV_MACHINE_RESET(NMK004) |
| r1877 | r1878 | |
| 4249 | 4249 | /* basic machine hardware */ |
| 4250 | 4250 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz ? */ |
| 4251 | 4251 | MDRV_CPU_PROGRAM_MAP(hachamf_map,0) |
| 4252 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 4252 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 4253 | 4253 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */ |
| 4254 | 4254 | |
| 4255 | 4255 | MDRV_MACHINE_RESET(NMK004) |
| r1877 | r1878 | |
| 4294 | 4294 | /* basic machine hardware */ |
| 4295 | 4295 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz ? */ |
| 4296 | 4296 | MDRV_CPU_PROGRAM_MAP(macross_readmem,macross_writemem) |
| 4297 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 4297 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 4298 | 4298 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */ |
| 4299 | 4299 | |
| 4300 | 4300 | MDRV_MACHINE_RESET(NMK004) |
| r1877 | r1878 | |
| 4339 | 4339 | /* basic machine hardware */ |
| 4340 | 4340 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz? */ |
| 4341 | 4341 | MDRV_CPU_PROGRAM_MAP(gunnail_readmem,gunnail_writemem) |
| 4342 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 4342 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 4343 | 4343 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112) |
| 4344 | 4344 | |
| 4345 | 4345 | MDRV_MACHINE_RESET(NMK004) |
| r1877 | r1878 | |
| 4384 | 4384 | /* basic machine hardware */ |
| 4385 | 4385 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz ? */ |
| 4386 | 4386 | MDRV_CPU_PROGRAM_MAP(macross2_readmem,macross2_writemem) |
| 4387 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 4387 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 4388 | 4388 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */ |
| 4389 | 4389 | |
| 4390 | 4390 | MDRV_CPU_ADD(Z80, 4000000) |
| r1877 | r1878 | |
| 4430 | 4430 | /* basic machine hardware */ |
| 4431 | 4431 | MDRV_CPU_ADD(M68000, 10000000) /* 10 MHz */ |
| 4432 | 4432 | MDRV_CPU_PROGRAM_MAP(macross2_readmem,macross2_writemem) |
| 4433 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 4433 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 4434 | 4434 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */ |
| 4435 | 4435 | |
| 4436 | 4436 | MDRV_CPU_ADD(Z80, 4000000) |
| r1877 | r1878 | |
| 4476 | 4476 | /* basic machine hardware */ |
| 4477 | 4477 | MDRV_CPU_ADD(M68000, 14000000) /* 14 MHz measured */ |
| 4478 | 4478 | MDRV_CPU_PROGRAM_MAP(macross2_readmem,raphero_writemem) |
| 4479 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 4479 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 4480 | 4480 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */ |
| 4481 | 4481 | |
| 4482 | 4482 | MDRV_CPU_ADD_TAG("sound",TMP90841, 8000000) |
| r1877 | r1878 | |
| 4520 | 4520 | /* basic machine hardware */ |
| 4521 | 4521 | MDRV_CPU_ADD(M68000, 10000000) /* verified on pcb */ |
| 4522 | 4522 | MDRV_CPU_PROGRAM_MAP(bjtwin_readmem,bjtwin_writemem) |
| 4523 | MDRV_CPU_VBLANK_INT(irq4_line_hold | |
| 4523 | MDRV_CPU_VBLANK_INT("main", irq4_line_hold | |
| 4524 | 4524 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ?? drives music */ |
| 4525 | 4525 | |
| 4526 | 4526 | MDRV_MACHINE_RESET(nmk16) |
| r1877 | r1878 | |
| 4780 | 4780 | } |
| 4781 | 4781 | |
| 4782 | 4782 | /* NO NMK004, it has a PIC instead */ |
| 4783 | static READ16_HANDLER( vandykeb_r ) { return 0x0000; } | |
| 4783 | static READ16_HANDLER( vandykeb_r ) { return 0x0000; } | |
| 4784 | 4784 | static DRIVER_INIT (vandykeb) |
| 4785 | 4785 | { |
| 4786 | 4786 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x08000e, 0x08000f, 0, 0, vandykeb_r ); |
| r1877 | r1878 | |
| 5023 | 5023 | /* basic machine hardware */ |
| 5024 | 5024 | MDRV_CPU_ADD(M68000,12000000) |
| 5025 | 5025 | MDRV_CPU_PROGRAM_MAP(afega,0) |
| 5026 | MDRV_CPU_VBLANK_INT(nmk_interrupt,2) | |
| 5026 | MDRV_CPU_VBLANK_INT_HACK(nmk_interrupt,2) | |
| 5027 | 5027 | |
| 5028 | 5028 | MDRV_CPU_ADD(Z80, 4000000) |
| 5029 | 5029 | /* audio CPU */ /* ? */ |
| r1877 | r1878 | |
| 5047 | 5047 | /* sound hardware */ |
| 5048 | 5048 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 5049 | 5049 | |
| 5050 | MDRV_SOUND_ADD(YM2151, 4 | |
| 5050 | MDRV_SOUND_ADD(YM2151, XTAL_4MHz | |
| 5051 | 5051 | MDRV_SOUND_CONFIG(afega_ym2151_intf) |
| 5052 | 5052 | MDRV_SOUND_ROUTE(0, "left", 0.30) |
| 5053 | 5053 | MDRV_SOUND_ROUTE(1, "right", 0.30) |
| 5054 | 5054 | |
| 5055 | MDRV_SOUND_ADD(OKIM6295, 1000000) | |
| 5056 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) | |
| 5055 | MDRV_SOUND_ADD(OKIM6295, XTAL_4MHz/4) /* verified on pcb */ | |
| 5056 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) /* verified on pcb */ | |
| 5057 | 5057 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.70) |
| 5058 | 5058 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.70) |
| 5059 | 5059 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
| 5091 | 5091 | /* basic machine hardware */ |
| 5092 | 5092 | MDRV_CPU_ADD(M68000,12000000) |
| 5093 | 5093 | MDRV_CPU_PROGRAM_MAP(afega,0) |
| 5094 | MDRV_CPU_VBLANK_INT(nmk_interrupt,2) | |
| 5094 | MDRV_CPU_VBLANK_INT_HACK(nmk_interrupt,2) | |
| 5095 | 5095 | |
| 5096 | 5096 | MDRV_CPU_ADD(Z80,4000000) |
| 5097 | 5097 | /* audio CPU */ |
| r1877 | r1878 | |
| 5131 | 5131 | /* basic machine hardware */ |
| 5132 | 5132 | MDRV_CPU_ADD(M68000,12000000) |
| 5133 | 5133 | MDRV_CPU_PROGRAM_MAP(twinactn_map,0) |
| 5134 | MDRV_CPU_VBLANK_INT(nmk_interrupt,2) | |
| 5134 | MDRV_CPU_VBLANK_INT_HACK(nmk_interrupt,2) | |
| 5135 | 5135 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */ |
| 5136 | 5136 | |
| 5137 | 5137 | MDRV_CPU_ADD(Z80, 4000000) |
| r1877 | r1878 | |
|---|---|---|
| 146 | 146 | tilemap_mark_tile_dirty(bg_tilemap, offset); |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | static WRITE8_HANDLER( miniboy7_mc6845_address_w ) | |
| 150 | { | |
| 151 | mc6845_address_w(mc6845, data); | |
| 152 | } | |
| 153 | ||
| 154 | static READ8_HANDLER( miniboy7_mc6845_register_r ) | |
| 155 | { | |
| 156 | return mc6845_register_r(mc6845); | |
| 157 | } | |
| 158 | ||
| 159 | static WRITE8_HANDLER( miniboy7_mc6845_register_w ) | |
| 160 | { | |
| 161 | mc6845_register_w(mc6845, data); | |
| 162 | } | |
| 163 | ||
| 164 | 149 | static TILE_GET_INFO( get_bg_tile_info ) |
| 165 | 150 | { |
| 166 | 151 | /* - bits - |
| r1877 | r1878 | |
| 203 | 188 | AM_RANGE(0x1000, 0x17ff) AM_RAM AM_WRITE(miniboy7_colorram_w) AM_BASE(&colorram) |
| 204 | 189 | AM_RANGE(0x1800, 0x25ff) AM_RAM /* looks like videoram */ |
| 205 | 190 | AM_RANGE(0x2600, 0x27ff) AM_RAM |
| 206 | AM_RANGE(0x2800, 0x2800) AM_WRITE(miniboy7_mc6845_address_w) | |
| 207 | AM_RANGE(0x2801, 0x2801) AM_READWRITE(miniboy7_mc6845_register_r, miniboy7_mc6845_register_w) | |
| 191 | AM_RANGE(0x2800, 0x2800) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 192 | AM_RANGE(0x2801, 0x2801) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 208 | 193 | // AM_RANGE(0x3000, 0x3001) ????? R/W |
| 209 | 194 | // AM_RANGE(0x3080, 0x3083) AM_READWRITE(pia_0_r, pia_0_w) |
| 210 | 195 | // AM_RANGE(0x3800, 0x3800) ????? R |
| r1877 | r1878 | |
| 273 | 258 | /* basic machine hardware */ |
| 274 | 259 | MDRV_CPU_ADD_TAG("main", M6502, MASTER_CLOCK/16) /* guess */ |
| 275 | 260 | MDRV_CPU_PROGRAM_MAP(miniboy7_map, 0) |
| 276 | MDRV_CPU_VBLANK_INT(nmi_line_pulse | |
| 261 | MDRV_CPU_VBLANK_INT("main", nmi_line_pulse | |
| 277 | 262 | |
| 278 | 263 | /* video hardware */ |
| 279 | 264 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 427 | 427 | * |
| 428 | 428 | *************************************/ |
| 429 | 429 | |
| 430 | static INPUT_CHANGED( coin_inserted ) | |
| 431 | { | |
| 432 | /* coin insertion causes an NMI */ | |
| 433 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE); | |
| 434 | } | |
| 435 | ||
| 436 | ||
| 430 | 437 | static TIMER_CALLBACK( interrupt_callback ) |
| 431 | 438 | { |
| 432 | 439 | if (param==0) |
| r1877 | r1878 | |
| 446 | 453 | |
| 447 | 454 | static INTERRUPT_GEN( m11_interrupt ) |
| 448 | 455 | { |
| 449 | if (readinputport(2) & 1) /* Left Coin */ | |
| 450 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 451 | else | |
| 452 | { | |
| 453 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 454 | timer_set(video_screen_get_time_until_pos(0, IREMM10_VBEND, 0), NULL, -1,interrupt_callback); | |
| 455 | } | |
| 456 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 457 | timer_set(video_screen_get_time_until_pos(0, IREMM10_VBEND, 0), NULL, -1,interrupt_callback); | |
| 456 | 458 | } |
| 457 | 459 | |
| 458 | 460 | static INTERRUPT_GEN( m10_interrupt ) |
| 459 | 461 | { |
| 460 | if (readinputport(2) & 1) /* Left Coin */ | |
| 461 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 462 | else | |
| 463 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 462 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 464 | 463 | } |
| 465 | 464 | |
| 466 | 465 | static INTERRUPT_GEN( m15_interrupt ) |
| 467 | 466 | { |
| 468 | if (readinputport(2) & 1) /* Left Coin */ | |
| 469 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); | |
| 470 | else | |
| 471 | { | |
| 472 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 473 | timer_set(video_screen_get_time_until_pos(0, IREMM10_VBSTART+1, 80), NULL, -1,interrupt_callback); | |
| 474 | } | |
| 467 | cpunum_set_input_line(machine, 0, 0, ASSERT_LINE); | |
| 468 | timer_set(video_screen_get_time_until_pos(0, IREMM10_VBSTART+1, 80), NULL, -1,interrupt_callback); | |
| 475 | 469 | } |
| 476 | 470 | |
| 477 | 471 | /************************************* |
| r1877 | r1878 | |
| 576 | 570 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 577 | 571 | |
| 578 | 572 | PORT_START /* FAKE */ |
| 579 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_ | |
| 573 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANG | |
| 580 | 574 | |
| 581 | 575 | CAB_PORTENV |
| 582 | 576 | INPUT_PORTS_END |
| r1877 | r1878 | |
| 617 | 611 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 618 | 612 | |
| 619 | 613 | PORT_START /* FAKE */ |
| 620 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_ | |
| 614 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANG | |
| 621 | 615 | |
| 622 | 616 | CAB_PORTENV |
| 623 | 617 | INPUT_PORTS_END |
| r1877 | r1878 | |
| 645 | 639 | PORT_DIPSETTING ( 0x20, "1 Coin 2 Plays" ) |
| 646 | 640 | |
| 647 | 641 | PORT_START /* FAKE */ |
| 648 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_ | |
| 642 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANG | |
| 649 | 643 | |
| 650 | 644 | PORT_START /* IN3 */ |
| 651 | 645 | PORT_BIT( 0x03, 0, IPT_UNUSED ) |
| r1877 | r1878 | |
| 682 | 676 | PORT_DIPSETTING ( 0x20, "1 Coin 2 Plays" ) |
| 683 | 677 | |
| 684 | 678 | PORT_START /* FAKE */ |
| 685 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_ | |
| 679 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANG | |
| 686 | 680 | |
| 687 | 681 | PORT_START /* IN3 */ |
| 688 | 682 | PORT_BIT( 0x03, 0, IPT_UNUSED ) |
| r1877 | r1878 | |
| 762 | 756 | |
| 763 | 757 | MDRV_MACHINE_RESET(irem) |
| 764 | 758 | |
| 765 | MDRV_CPU_VBLANK_INT(m10_interrupt | |
| 759 | MDRV_CPU_VBLANK_INT("main", m10_interrupt | |
| 766 | 760 | |
| 767 | 761 | /* video hardware */ |
| 768 | 762 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
| 794 | 788 | MDRV_CPU_REPLACE("main", M6502,IREMM10_CPU_CLOCK / 2) |
| 795 | 789 | //MDRV_CPU_MODIFY("main") |
| 796 | 790 | MDRV_CPU_PROGRAM_MAP(m11_main,0) |
| 797 | MDRV_CPU_VBLANK_INT(m11_interrupt | |
| 791 | MDRV_CPU_VBLANK_INT("main", m11_interrupt | |
| 798 | 792 | |
| 799 | 793 | /* sound hardware */ |
| 800 | 794 | MACHINE_DRIVER_END |
| r1877 | r1878 | |
| 809 | 803 | |
| 810 | 804 | MDRV_MACHINE_RESET(irem) |
| 811 | 805 | |
| 812 | MDRV_CPU_VBLANK_INT(m15_interrupt | |
| 806 | MDRV_CPU_VBLANK_INT("main", m15_interrupt | |
| 813 | 807 | |
| 814 | 808 | /* video hardware */ |
| 815 | 809 | MDRV_SCREEN_ADD("main", RASTER) |
| r1877 | r1878 | |
|---|---|---|
| 164 | 164 | // basic machine hardware |
| 165 | 165 | MDRV_CPU_ADD(M6502, 12096000/12) // 1 MHz |
| 166 | 166 | MDRV_CPU_PROGRAM_MAP(nitedrvr_map, 0) |
| 167 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 167 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 168 | 168 | MDRV_WATCHDOG_VBLANK_INIT(3) |
| 169 | 169 | |
| 170 | 170 | MDRV_MACHINE_RESET(nitedrvr) |
| r1877 | r1878 | |
|---|---|---|
| 454 | 454 | |
| 455 | 455 | /* bail if we passed the end */ |
| 456 | 456 | if (framenum > patcount) |
| 457 | re | |
| 457 | break | |
| 458 | 458 | |
| 459 | 459 | /* if we don't have a white flag, the previous frame must match us */ |
| 460 | 460 | if (!curpat->white) flags |= 0x01; |
| r1877 | r1878 | |
| 470 | 470 | /* output the result */ |
| 471 | 471 | output_meta(flags, curpat->white, line16, line17, line18, bcdframenum, 0); |
| 472 | 472 | } |
| 473 | ||
| 474 | 473 | return 0; |
| 475 | 474 | } |
| 476 | 475 |
| r1877 | r1878 | |
|---|---|---|
| 98 | 98 | put_bigendian_uint32 - write a UINT32 in big-endian order to memory |
| 99 | 99 | -------------------------------------------------*/ |
| 100 | 100 | |
| 101 | #ifdef UNUSED_FUNCTON | |
| 101 | 102 | INLINE void put_bigendian_uint32(UINT8 *base, UINT32 value) |
| 102 | 103 | { |
| 103 | 104 | base[0] = value >> 24; |
| r1877 | r1878 | |
| 105 | 106 | base[2] = value >> 8; |
| 106 | 107 | base[3] = value; |
| 107 | 108 | } |
| 109 | #endif | |
| 108 | 110 | |
| 109 | ||
| 110 | 111 | /*------------------------------------------------- |
| 111 | 112 | print_big_int - 64-bit int printing with commas |
| 112 | 113 | -------------------------------------------------*/ |
| r1877 | r1878 | |
|---|---|---|
| 39 | 39 | #define ATTR_MALLOC __attribute__((malloc)) |
| 40 | 40 | #define ATTR_PURE __attribute__((pure)) |
| 41 | 41 | #define ATTR_CONST __attribute__((const)) |
| 42 | #define ATTR_FORCE_INLINE __attribute__((always_inline)) | |
| 43 | #define ATTR_NONNULL __attribute__((nonnull(1))) | |
| 42 | 44 | #define UNEXPECTED(exp) __builtin_expect((exp), 0) |
| 43 | 45 | #define TYPES_COMPATIBLE(a,b) __builtin_types_compatible_p(a, b) |
| 44 | 46 | #define RESTRICT __restrict__ |
| 47 | #define SETJMP_GNUC_PROTECT() (void)__builtin_return_address(1) | |
| 45 | 48 | #else |
| 46 | 49 | #define ATTR_UNUSED |
| 47 | 50 | #define ATTR_NORETURN |
| r1877 | r1878 | |
| 49 | 52 | #define ATTR_MALLOC |
| 50 | 53 | #define ATTR_PURE |
| 51 | 54 | #define ATTR_CONST |
| 55 | #define ATTR_FORCE_INLINE | |
| 56 | #define ATTR_NONNULL | |
| 52 | 57 | #define UNEXPECTED(exp) (exp) |
| 53 | 58 | #define TYPES_COMPATIBLE(a,b) 1 |
| 54 | 59 | #define RESTRICT |
| 60 | #define SETJMP_GNUC_PROTECT() do {} while (0) | |
| 55 | 61 | #endif |
| 56 | 62 | |
| 57 | 63 | |
| r1877 | r1878 | |
| 130 | 136 | #endif |
| 131 | 137 | |
| 132 | 138 | |
| 139 | /* U64 and S64 are used to wrap long integer constants. */ | |
| 140 | #ifdef __GNUC__ | |
| 141 | #define U64(val) val##ULL | |
| 142 | #define S64(val) val##LL | |
| 143 | #else | |
| 144 | #define U64(val) val | |
| 145 | #define S64(val) val | |
| 146 | #endif | |
| 147 | ||
| 148 | ||
| 133 | 149 | /* Highly useful macro for compile-time knowledge of an array size */ |
| 134 | 150 | #define ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0])) |
| 135 | 151 |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | win_monitor_info *win_monitor_list; |
| 62 | 62 | static win_monitor_info *primary_monitor; |
| 63 | 63 | |
| 64 | static | |
| 64 | static | |
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 |
| r1877 | r1878 | |
|---|---|---|
| 167 | 167 | int last_wrap; // previous wrap state |
| 168 | 168 | DWORD last_modmode; // previous texture modulation |
| 169 | 169 | |
| 170 | | |
| 170 | | |
| 171 | 171 | texture_info * vector_texture; // experimental: texture for vectors |
| 172 | 172 | }; |
| 173 | 173 |
| r1877 | r1878 | |
|---|---|---|
| 160 | 160 | |
| 161 | 161 | static int ProcessAuditResults(int game, audit_record *audit, int audit_records) |
| 162 | 162 | { |
| 163 | output_callback prevcb; | |
| 163 | output_callback_func prevcb; | |
| 164 | 164 | void *prevparam; |
| 165 | 165 | int res; |
| 166 | 166 |
| r1877 | r1878 | |
|---|---|---|
| 35 | 35 | { |
| 36 | 36 | struct _config_type * next; /* next in line */ |
| 37 | 37 | const char * name; /* node name */ |
| 38 | config_callback load; /* load callback */ | |
| 39 | config_callback save; /* save callback */ | |
| 38 | config_callback_func load; /* load callback */ | |
| 39 | config_callback_func save; /* save callback */ | |
| 40 | 40 | }; |
| 41 | 41 | |
| 42 | 42 | |
| r1877 | r1878 | |
| 86 | 86 | * |
| 87 | 87 | *************************************/ |
| 88 | 88 | |
| 89 | void config_register(const char *nodename, config_callback load, config_callback save) | |
| 89 | void config_register(const char *nodename, config_callback_func load, config_callback_func save) | |
| 90 | 90 | { |
| 91 | 91 | config_type *newtype; |
| 92 | 92 | config_type **ptype; |
| r1877 | r1878 | |
|---|---|---|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | |
| 143 | /*------------------------------------------------- | |
| 144 | on_vblank - called when a VBLANK hits | |
| 145 | -------------------------------------------------*/ | |
| 146 | ||
| 147 | static void on_vblank(running_machine *machine, screen_state *screen, int vblank_state) | |
| 148 | { | |
| 149 | /* if we're configured to stop on VBLANK, break */ | |
| 150 | if (vblank_state && break_on_vblank) | |
| 151 | { | |
| 152 | execution_state = EXECUTION_STATE_STOPPED; | |
| 153 | debug_console_printf("Stopped at VBLANK\n"); | |
| 154 | break_on_vblank = 0; | |
| 155 | } | |
| 156 | } | |
| 157 | ||
| 158 | ||
| 143 | 159 | /*************************************************************************** |
| 144 | 160 | INITIALIZATION |
| 145 | 161 | ***************************************************************************/ |
| r1877 | r1878 | |
| 279 | 295 | } |
| 280 | 296 | } |
| 281 | 297 | |
| 298 | /* add callback for breaking on VBLANK */ | |
| 299 | video_screen_register_vbl_cb(machine, NULL, on_vblank); | |
| 300 | ||
| 282 | 301 | add_exit_callback(machine, debug_cpu_exit); |
| 283 | 302 | } |
| 284 | 303 | |
| r1877 | r1878 | |
| 1028 | 1047 | |
| 1029 | 1048 | |
| 1030 | 1049 | /*------------------------------------------------- |
| 1031 | debug_vblank_hook - called when the real | |
| 1032 | VBLANK hits | |
| 1033 | -------------------------------------------------*/ | |
| 1034 | ||
| 1035 | void debug_vblank_hook(void) | |
| 1036 | { | |
| 1037 | /* if we're configured to stop on VBLANK, break */ | |
| 1038 | if (break_on_vblank) | |
| 1039 | { | |
| 1040 | execution_state = EXECUTION_STATE_STOPPED; | |
| 1041 | debug_console_printf("Stopped at VBLANK\n"); | |
| 1042 | break_on_vblank = 0; | |
| 1043 | } | |
| 1044 | } | |
| 1045 | ||
| 1046 | ||
| 1047 | /*------------------------------------------------- | |
| 1048 | 1050 | debug_vblank_hook - called when an interrupt |
| 1049 | 1051 | is acknowledged |
| 1050 | 1052 | -------------------------------------------------*/ |
| r1877 | r1878 | |
| 1097 | 1099 | for the specified CPU |
| 1098 | 1100 | -------------------------------------------------*/ |
| 1099 | 1101 | |
| 1100 | void debug_get_memory_hooks(int cpunum, debug_hook_read_ | |
| 1102 | void debug_get_memory_hooks(int cpunum, debug_hook_read_func *read, debug_hook_write_func *write) | |
| 1101 | 1103 | { |
| 1102 | 1104 | memory_hook_cpunum = cpunum; |
| 1103 | 1105 |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | TYPE DEFINITIONS |
| 55 | 55 | ***************************************************************************/ |
| 56 | 56 | |
| 57 | typedef void (*debug_hook_read_ptr)(int spacenum, int size, offs_t address); | |
| 58 | typedef void (*debug_hook_write_ptr)(int spacenum, int size, offs_t address, UINT64 data); | |
| 57 | typedef void (*debug_hook_read_func)(int spacenum, int size, offs_t address); | |
| 58 | typedef void (*debug_hook_write_func)(int spacenum, int size, offs_t address, UINT64 data); | |
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | typedef struct _debug_trace_info debug_trace_info; |
| r1877 | r1878 | |
| 182 | 182 | void debug_flush_traces(void); |
| 183 | 183 | |
| 184 | 184 | /* debugging hooks */ |
| 185 | void debug_vblank_hook(void); | |
| 186 | 185 | void debug_interrupt_hook(int cpunum, int irqline); |
| 187 | void debug_get_memory_hooks(int cpunum, debug_hook_read_ | |
| 186 | void debug_get_memory_hooks(int cpunum, debug_hook_read_func *read, debug_hook_write_func *write); | |
| 188 | 187 | void debug_set_instruction_hook(int cpunum, int (*hook)(offs_t pc)); |
| 189 | 188 | |
| 190 | 189 | /* execution control */ |
| r1877 | r1878 | |
|---|---|---|
| 263 | 263 | p->b.l = RM(Addr); |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | #ifdef UNUSED_FUNCTION | |
| 266 | 267 | INLINE void WM16( UINT32 Addr, PAIR *p ) |
| 267 | 268 | { |
| 268 | 269 | WM( Addr, p->b.h ); |
| r1877 | r1878 | |
| 270 | 271 | // if( ++Addr > AMASK ) Addr = 0; |
| 271 | 272 | WM( Addr, p->b.l ); |
| 272 | 273 | } |
| 274 | #endif | |
| 273 | 275 | |
| 274 | 276 | #if (HAS_M68705) |
| 275 | 277 |
| r1877 | r1878 | |
|---|---|---|
| 575 | 575 | return M68K_CPU_TYPE_INVALID; |
| 576 | 576 | default: return 0; |
| 577 | 577 | } |
| 578 | return 0; | |
| 579 | 578 | } |
| 580 | 579 | |
| 581 | 580 | void m68k_set_reg(m68k_register_t regnum, unsigned int value) |
| r1877 | r1878 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | #include "cpuintrf.h" |
| 15 | 15 | |
| 16 | ||
| 16 | 17 | /*************************************************************************** |
| 17 | 18 | REGISTER ENUMERATION |
| 18 | 19 | ***************************************************************************/ |
| r1877 | r1878 | |
| 32 | 33 | }; |
| 33 | 34 | |
| 34 | 35 | |
| 36 | ||
| 35 | 37 | /*************************************************************************** |
| 36 | 38 | CONFIG STRUCTURE |
| 37 | 39 | ***************************************************************************/ |
| r1877 | r1878 | |
| 44 | 46 | }; |
| 45 | 47 | |
| 46 | 48 | |
| 49 | ||
| 47 | 50 | /*************************************************************************** |
| 48 | 51 | PUBLIC FUNCTIONS |
| 49 | 52 | ***************************************************************************/ |
| 50 | 53 | |
| 51 | 54 | void ccpu_get_info(UINT32 state, cpuinfo *info); |
| 55 | void ccpu_wdt_timer_trigger(void); | |
| 52 | 56 | |
| 53 | 57 | #ifdef ENABLE_DEBUGGER |
| 54 | 58 | offs_t ccpu_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); |
| r1877 | r1878 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | typedef struct |
| 21 | 21 | { |
| 22 | UINT16 PC; | |
| 23 | UINT16 A; | |
| 24 | UINT16 B; | |
| 25 | UINT8 I; | |
| 26 | UINT16 J; | |
| 27 | UINT8 P; | |
| 28 | UINT16 X; | |
| 29 | UINT16 Y; | |
| 30 | UINT16 T; | |
| 31 | UINT16 *acc; | |
| 22 | UINT16 PC; | |
| 23 | UINT16 A; | |
| 24 | UINT16 B; | |
| 25 | UINT8 I; | |
| 26 | UINT16 J; | |
| 27 | UINT8 P; | |
| 28 | UINT16 X; | |
| 29 | UINT16 Y; | |
| 30 | UINT16 T; | |
| 31 | UINT16 * acc; | |
| 32 | 32 | |
| 33 | UINT16 a0flag, ncflag, cmpacc, cmpval; | |
| 34 | UINT16 miflag, nextmiflag, nextnextmiflag; | |
| 35 | UINT16 drflag; | |
| 33 | UINT16 a0flag, ncflag, cmpacc, cmpval; | |
| 34 | UINT16 miflag, nextmiflag, nextnextmiflag; | |
| 35 | UINT16 drflag; | |
| 36 | 36 | |
| 37 | UINT8 (*external_input)(void); | |
| 38 | void (*vector_callback)(INT16 sx, INT16 sy, INT16 ex, INT16 ey, UINT8 shift); | |
| 39 | UINT8 scrnum; | |
| 37 | UINT8 (*external_input)(void); | |
| 38 | void (*vector_callback)(INT16 sx, INT16 sy, INT16 ex, INT16 ey, UINT8 shift); | |
| 39 | ||
| 40 | UINT8 waiting; | |
| 41 | UINT8 watchdog; | |
| 40 | 42 | } ccpuRegs; |
| 41 | 43 | |
| 42 | 44 | |
| r1877 | r1878 | |
| 123 | 125 | } |
| 124 | 126 | |
| 125 | 127 | |
| 128 | void ccpu_wdt_timer_trigger(void) | |
| 129 | { | |
| 130 | ccpu.waiting = FALSE; | |
| 131 | ccpu.watchdog++; | |
| 132 | if (ccpu.watchdog >= 3) | |
| 133 | ccpu.PC = 0; | |
| 134 | } | |
| 135 | ||
| 136 | ||
| 126 | 137 | static void ccpu_init(int index, int clock, const void *_config, int (*irqcallback)(int)) |
| 127 | 138 | { |
| 128 | 139 | const struct CCPUConfig *config = _config; |
| r1877 | r1878 | |
| 140 | 151 | state_save_register_item("ccpu", clock, ccpu.X); |
| 141 | 152 | state_save_register_item("ccpu", clock, ccpu.Y); |
| 142 | 153 | state_save_register_item("ccpu", clock, ccpu.T); |
| 143 | state_save_register_item("ccpu", clock, ccpu.scrnum); | |
| 154 | state_save_register_item("ccpu", clock, ccpu.a0flag); | |
| 155 | state_save_register_item("ccpu", clock, ccpu.ncflag); | |
| 156 | state_save_register_item("ccpu", clock, ccpu.cmpacc); | |
| 157 | state_save_register_item("ccpu", clock, ccpu.cmpval); | |
| 158 | state_save_register_item("ccpu", clock, ccpu.miflag); | |
| 159 | state_save_register_item("ccpu", clock, ccpu.nextmiflag); | |
| 160 | state_save_register_item("ccpu", clock, ccpu.nextnextmiflag); | |
| 161 | state_save_register_item("ccpu", clock, ccpu.drflag); | |
| 162 | state_save_register_item("ccpu", clock, ccpu.waiting); | |
| 163 | state_save_register_item("ccpu", clock, ccpu.watchdog); | |
| 144 | 164 | } |
| 145 | 165 | |
| 146 | 166 | |
| r1877 | r1878 | |
| 165 | 185 | ccpu.cmpval = 1; |
| 166 | 186 | ccpu.miflag = ccpu.nextmiflag = ccpu.nextnextmiflag = 0; |
| 167 | 187 | ccpu.drflag = 0; |
| 188 | ||
| 189 | ccpu.waiting = FALSE; | |
| 190 | ccpu.watchdog = 0; | |
| 168 | 191 | } |
| 169 | 192 | |
| 170 | 193 | |
| r1877 | r1878 | |
| 175 | 198 | |
| 176 | 199 | static int ccpu_execute(int cycles) |
| 177 | 200 | { |
| 201 | if (ccpu.waiting) | |
| 202 | return cycles; | |
| 203 | ||
| 178 | 204 | ccpu_icount = cycles; |
| 179 | 205 | |
| 180 | 206 | while (ccpu_icount >= 0) |
| r1877 | r1878 | |
| 545 | 571 | /* FRM */ |
| 546 | 572 | case 0xe5: |
| 547 | 573 | case 0xf5: |
| 548 | /* FIXME: once vector game video system configuration is fixed, | |
| 549 | remove section in brackets and uncomment line below. | |
| 550 | Speed Freak should run nice and smooth, with no flickering. */ | |
| 551 | { | |
| 552 | attotime scantime, abstime; | |
| 553 | extern emu_timer *refresh_timer; | |
| 554 | scantime = timer_starttime(refresh_timer); | |
| 555 | abstime = timer_get_time(); | |
| 556 | while (attotime_compare(abstime, scantime) >= 0) | |
| 557 | scantime = attotime_add(scantime, video_screen_get_frame_period(ccpu.scrnum)); | |
| 558 | cpu_spinuntil_time(attotime_sub(scantime, abstime)); | |
| 559 | } | |
| 560 | /* cpu_spinuntil_time(video_screen_get_time_until_pos(ccpu.scrnum, Machine->screen[ccpu.scrnum].visarea.max_y + 1, 0)); */ | |
| 561 | NEXT_ACC_A(); CYCLES(1); | |
| 574 | ccpu.waiting = TRUE; | |
| 575 | NEXT_ACC_A(); | |
| 576 | ccpu_icount = -1; | |
| 577 | ||
| 578 | /* some games repeat the FRM opcode twice; it apparently does not cause | |
| 579 | a second wait, so we make sure we skip any duplicate opcode at this | |
| 580 | point */ | |
| 581 | if (READOP(ccpu.PC) == opcode) | |
| 582 | ccpu.PC++; | |
| 562 | 583 | break; |
| 563 | 584 | |
| 564 | 585 | /* STAP */ |
| r1877 | r1878 | |
| 570 | 591 | |
| 571 | 592 | /* CST */ |
| 572 | 593 | case 0xf7: |
| 573 | watchdog | |
| 594 | ccpu.watchdog = 0 | |
| 574 | 595 | /* ADDP */ |
| 575 | 596 | case 0xe7: |
| 576 | 597 | tempval = RDMEM(ccpu.I); |
| r1877 | r1878 | |
|---|---|---|
| 6 | 6 | typedef struct { |
| 7 | 7 | const UINT16 *regs; |
| 8 | 8 | UINT8 features; |
| 9 | void (*timer_c | |
| 9 | void (*timer_fired_func | |
| 10 | 10 | } Z80GB_CONFIG; |
| 11 | 11 | |
| 12 | 12 | enum { |
| r1877 | r1878 | |
|---|---|---|
| 46 | 46 | #define FLAG_C 0x10 |
| 47 | 47 | |
| 48 | 48 | #define CYCLES_PASSED(X) z80gb_ICount -= ((X) / (Regs.w.gb_speed)); \ |
| 49 | if ( Regs.w.timer_callback ) { \ | |
| 50 | Regs.w.timer_callback( X ); \ | |
| 49 | if ( Regs.w.timer_fired_func ) { \ | |
| 50 | Regs.w.timer_fired_func( X ); \ | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | typedef struct { |
| r1877 | r1878 | |
| 65 | 65 | int ei_delay; |
| 66 | 66 | int (*irq_callback)(int irqline); |
| 67 | 67 | /* Timer stuff */ |
| 68 | void (*timer_c | |
| 68 | void (*timer_fired_func | |
| 69 | 69 | /* Fetch & execute related */ |
| 70 | 70 | int execution_state; |
| 71 | 71 | UINT8 op; |
| r1877 | r1878 | |
| 197 | 197 | Regs.w.HL = 0x0000; |
| 198 | 198 | Regs.w.SP = 0x0000; |
| 199 | 199 | Regs.w.PC = 0x0000; |
| 200 | Regs.w.timer_c | |
| 200 | Regs.w.timer_fired_func | |
| 201 | 201 | Regs.w.features = Z80GB_FEATURE_HALT_BUG; |
| 202 | 202 | if (Regs.w.config) |
| 203 | 203 | { |
| r1877 | r1878 | |
| 209 | 209 | Regs.w.SP = Regs.w.config->regs[4]; |
| 210 | 210 | Regs.w.PC = Regs.w.config->regs[5]; |
| 211 | 211 | } |
| 212 | Regs.w.timer_c | |
| 212 | Regs.w.timer_fired_func | |
| 213 | 213 | Regs.w.features = Regs.w.config->features; |
| 214 | 214 | } |
| 215 | 215 | Regs.w.enable = 0; |
| r1877 | r1878 | |
|---|---|---|
| 73 | 73 | UINT8 scrnum; /* the screen operated on */ |
| 74 | 74 | UINT32 pixclock; /* the pixel clock (0 means don't adjust screen size) */ |
| 75 | 75 | int pixperclock; /* pixels per clock */ |
| 76 | void (*scanline_callback)(running_machine *machine, int screen, | |
| 76 | void (*scanline_callback)(running_machine *machine, int screen, | |
| 77 | 77 | void (*output_int)(int state); /* output interrupt callback */ |
| 78 | 78 | void (*to_shiftreg)(offs_t, UINT16 *); /* shift register write */ |
| 79 | 79 | void (*from_shiftreg)(offs_t, UINT16 *); /* shift register read */ |
| r1877 | r1878 | |
|---|---|---|
| 692 | 692 | /* the first time we are run */ |
| 693 | 693 | state.reset_deferred = state.config->halt_on_reset; |
| 694 | 694 | if (state.config->halt_on_reset) |
| 695 | tms34010_io_register_w(REG_HSTCTLH, 0x8000, 0); | |
| 695 | tms34010_io_register_w(Machine, REG_HSTCTLH, 0x8000, 0); | |
| 696 | 696 | } |
| 697 | 697 | |
| 698 | 698 | #if (HAS_TMS34020) |
| r1877 | r1878 | |
| 1653 | 1653 | /* control register */ |
| 1654 | 1654 | case TMS34010_HOST_CONTROL: |
| 1655 | 1655 | external_host_access = TRUE; |
| 1656 | tms34010_io_register_w(REG_HSTCTLH, data & 0xff00, 0); | |
| 1657 | tms34010_io_register_w(REG_HSTCTLL, data & 0x00ff, 0); | |
| 1656 | tms34010_io_register_w(Machine, REG_HSTCTLH, data & 0xff00, 0); | |
| 1657 | tms34010_io_register_w(Machine, REG_HSTCTLL, data & 0x00ff, 0); | |
| 1658 | 1658 | external_host_access = FALSE; |
| 1659 | 1659 | break; |
| 1660 | 1660 |
| r1877 | r1878 | |
|---|---|---|
| 183 | 183 | case 20: return CONDITION_ZUF; |
| 184 | 184 | default: illegal(); return 1; |
| 185 | 185 | } |
| 186 | return 0; | |
| 187 | 186 | } |
| 188 | 187 | |
| 189 | 188 |
| r1877 | r1878 | |
|---|---|---|
| 297 | 297 | EXECEPTION HANDLING |
| 298 | 298 | ***************************************************************************/ |
| 299 | 299 | |
| 300 | #ifdef UNUSED_FUNCTION | |
| 300 | 301 | INLINE void generate_exception(int exception) |
| 301 | 302 | { |
| 302 | 303 | } |
| 303 | 304 | |
| 304 | ||
| 305 | 305 | INLINE void invalid_instruction(UINT32 op) |
| 306 | 306 | { |
| 307 | 307 | } |
| 308 | #endif | |
| 308 | 309 | |
| 309 | 310 | |
| 310 | 311 | |
| r1877 | r1878 | |
| 634 | 635 | WMEM(offs++, data); |
| 635 | 636 | } |
| 636 | 637 | } |
| 637 | ||
| 638 | /* keep the compiler happy */ | |
| 639 | return 0; | |
| 640 | 638 | } |
| 641 | 639 | |
| 642 | 640 |
| r1877 | r1878 | |
|---|---|---|
| 1001 | 1001 | { |
| 1002 | 1002 | UINT32 shift = REG(ry); |
| 1003 | 1003 | REG(rn) = REG(rx); |
| 1004 | if (shift | |
| 1004 | if (shift | |
| 1005 | 1005 | { |
| 1006 | 1006 | REG(rn) |= (1 << shift); |
| 1007 | 1007 | } |
| r1877 | r1878 | |
| 1017 | 1017 | { |
| 1018 | 1018 | UINT32 shift = REG(ry); |
| 1019 | 1019 | REG(rn) = REG(rx); |
| 1020 | if (shift | |
| 1020 | if (shift | |
| 1021 | 1021 | { |
| 1022 | 1022 | REG(rn) &= ~(1 << shift); |
| 1023 | 1023 | } |
| r1877 | r1878 | |
|---|---|---|
| 44 | 44 | UINT32 window_end; /* code window end offset = startpc + window_end */ |
| 45 | 45 | UINT32 max_sequence; /* maximum instructions to include in a sequence */ |
| 46 | 46 | |
| 47 | drcfe_describe describe; /* callback to describe a single instruction */ | |
| 47 | drcfe_describe_func describe; /* callback to describe a single instruction */ | |
| 48 | 48 | void * param; /* parameter for the callback */ |
| 49 | 49 | |
| 50 | 50 | /* CPU parameters */ |
| 51 | 51 | offs_t pageshift; /* shift to convert address to a page index */ |
| 52 | cpu | |
| 52 | cpu | |
| 53 | 53 | |
| 54 | 54 | /* opcode descriptor arrays */ |
| 55 | 55 | opcode_desc * desc_live_list; /* head of list of live descriptions */ |
| r1877 | r1878 | |
| 135 | 135 | |
| 136 | 136 | /* initialize the state */ |
| 137 | 137 | drcfe->pageshift = activecpu_page_shift(ADDRESS_SPACE_PROGRAM); |
| 138 | drcfe->translate = (cpu | |
| 138 | drcfe->translate = (cpu | |
| 139 | 139 | |
| 140 | 140 | return drcfe; |
| 141 | 141 | } |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | /* 26.March 2000 PeT changed set_irq_line */ |
| 6 | 6 | |
| 7 | 7 | #include "debugger.h" |
| 8 | #include "cpuintrf.h" | |
| 8 | 9 | #include "deprecat.h" |
| 9 | 10 | |
| 10 | 11 | #include "host.h" |
| r1877 | r1878 | |
|---|---|---|
| 150 | 150 | (void *)-1 /* marker to make sure we line up */ |
| 151 | 151 | }; |
| 152 | 152 | |
| 153 | ||
| 154 | 153 | /* these come from the Intel 80186 datasheet */ |
| 155 | 154 | static const struct i80x86_timing i80186_cycles = |
| 156 | 155 | { |
| r1877 | r1878 | |
| 230 | 229 | (void *)-1 /* marker to make sure we line up */ |
| 231 | 230 | }; |
| 232 | 231 | |
| 233 | ||
| 234 | 232 | /* these come from the 80286 timings in OPCODE.LST */ |
| 235 | 233 | /* many of these numbers are suspect */ |
| 236 | 234 | static const struct i80x86_timing i80286_cycles = |
| r1877 | r1878 | |
|---|---|---|
| 146 | 146 | |
| 147 | 147 | |
| 148 | 148 | /* callback function that is used to describe a single opcode */ |
| 149 | typedef int (*drcfe_describe)(void *param, opcode_desc *desc); | |
| 149 | typedef int (*drcfe_describe_func)(void *param, opcode_desc *desc); | |
| 150 | 150 | |
| 151 | 151 | |
| 152 | 152 | /* description of a given opcode */ |
| r1877 | r1878 | |
| 156 | 156 | UINT32 window_start; /* code window start offset = startpc - window_start */ |
| 157 | 157 | UINT32 window_end; /* code window end offset = startpc + window_end */ |
| 158 | 158 | UINT32 max_sequence; /* maximum instructions to include in a sequence */ |
| 159 | drcfe_describe describe; /* callback to describe a single instruction */ | |
| 159 | drcfe_describe_func describe; /* callback to describe a single instruction */ | |
| 160 | 160 | }; |
| 161 | 161 | |
| 162 | 162 | /* |
| r1877 | r1878 | |
|---|---|---|
| 278 | 278 | return spc700_read_8_immediate(address); |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | #ifdef UNUSED_FUNCTION | |
| 281 | 282 | INLINE uint read_8_instruction(uint address) |
| 282 | 283 | { |
| 283 | 284 | address = MAKE_UINT_16(address); |
| 284 | 285 | return spc700_read_instruction(address); |
| 285 | 286 | } |
| 287 | #endif | |
| 286 | 288 | |
| 287 | 289 | INLINE uint read_8_direct(uint address) |
| 288 | 290 | { |
| r1877 | r1878 | |
| 432 | 434 | INLINE uint EA_DP(void) {return OPER_8_IMM();} |
| 433 | 435 | INLINE uint EA_DPX(void) {return (EA_DP() + REG_X)&0xff;} |
| 434 | 436 | INLINE uint EA_DPY(void) {return (EA_DP() + REG_Y)&0xff;} |
| 437 | #ifdef UNUSED_FUNCTION | |
| 435 | 438 | INLINE uint EA_DPI(void) {return OPER_16_DP();} |
| 439 | #endif | |
| 436 | 440 | INLINE uint EA_DXI(void) {return OPER_16_DPX();} |
| 437 | 441 | INLINE uint EA_DIY(void) {uint addr = OPER_16_DP(); if((addr&0xff00) != ((addr+REG_Y)&0xff00)) CLK(1); return addr + REG_Y;} |
| 438 | 442 | INLINE uint EA_XI(void) {return REG_X;} |
| r1877 | r1878 | |
| 535 | 539 | return value | (PULL_8()<<8); |
| 536 | 540 | } |
| 537 | 541 | |
| 542 | #ifdef UNUSED_FUNCTION | |
| 538 | 543 | INLINE void SERVICE_IRQ(void) |
| 539 | 544 | { |
| 540 | 545 | CLK(7); |
| r1877 | r1878 | |
| 545 | 550 | INT_ACK(0); |
| 546 | 551 | JUMP(read_16_VEC(VECTOR_IRQ)); |
| 547 | 552 | } |
| 553 | #endif | |
| 548 | 554 | |
| 549 | 555 | #if !SPC700_OPTIMIZE_SNES |
| 550 | 556 | INLINE void CHECK_IRQ(void) |
| r1877 | r1878 | |
|---|---|---|
| 821 | 821 | // if (hrdfBIT) |
| 822 | 822 | return HTXHRX; |
| 823 | 823 | |
| 824 | /* FIXME: Following code never reached due to commented if above */ | |
| 825 | #if 0 | |
| 824 | 826 | // Reading HRX clears HRDF. |
| 825 | 827 | CLEAR_hrdfBIT(); |
| 826 | 828 | |
| 827 | 829 | // The DSP may program the HRIE bit to cause a Host Receive Data interrupt when HRDF is set. |
| 828 | 830 | |
| 829 | 831 | return 0x0000; |
| 832 | #endif | |
| 830 | 833 | break; |
| 831 | 834 | } |
| 832 | 835 |
| r1877 | r1878 | |
|---|---|---|
| 92 | 92 | { |
| 93 | 93 | return io_read_byte((hc11.adctl & 0x7) + MC68HC11_IO_AD0); |
| 94 | 94 | } |
| 95 | break; | |
| 96 | 95 | } |
| 97 | 96 | case 0x32: /* ADR2 */ |
| 98 | 97 | { |
| r1877 | r1878 | |
| 104 | 103 | { |
| 105 | 104 | return io_read_byte((hc11.adctl & 0x7) + MC68HC11_IO_AD0); |
| 106 | 105 | } |
| 107 | break; | |
| 108 | 106 | } |
| 109 | 107 | case 0x33: /* ADR3 */ |
| 110 | 108 | { |
| r1877 | r1878 | |
| 116 | 114 | { |
| 117 | 115 | return io_read_byte((hc11.adctl & 0x7) + MC68HC11_IO_AD0); |
| 118 | 116 | } |
| 119 | break; | |
| 120 | 117 | } |
| 121 | 118 | case 0x34: /* ADR4 */ |
| 122 | 119 | { |
| r1877 | r1878 | |
| 128 | 125 | { |
| 129 | 126 | return io_read_byte((hc11.adctl & 0x7) + MC68HC11_IO_AD0); |
| 130 | 127 | } |
| 131 | break; | |
| 132 | 128 | } |
| 133 | 129 | case 0x38: /* OPT2 */ |
| 134 | 130 | return 0; |
| r1877 | r1878 | |
|---|---|---|
| 90 | 90 | adsp2100.alt = temp; |
| 91 | 91 | } |
| 92 | 92 | if ((new_value ^ adsp2100.mstat) & MSTAT_TIMER) |
| 93 | if (adsp2100.timer_callback) | |
| 94 | (*adsp2100.timer_callback)((new_value & MSTAT_TIMER) != 0); | |
| 93 | if (adsp2100.timer_fired_func) | |
| 94 | (*adsp2100.timer_fired_func)((new_value & MSTAT_TIMER) != 0); | |
| 95 | 95 | if (new_value & MSTAT_STICKYV) |
| 96 | 96 | adsp2100.astat_clear = ~(CFLAG | NFLAG | ZFLAG); |
| 97 | 97 | else |
| r1877 | r1878 | |
|---|---|---|
| 246 | 246 | /* other callbacks */ |
| 247 | 247 | RX_CALLBACK sport_rx_callback; |
| 248 | 248 | TX_CALLBACK sport_tx_callback; |
| 249 | ADSP2100_TIMER_CALLBACK timer_c | |
| 249 | ADSP2100_TIMER_CALLBACK timer_fired_func | |
| 250 | 250 | } adsp2100_Regs; |
| 251 | 251 | |
| 252 | 252 | |
| r1877 | r1878 | |
| 2174 | 2174 | /* --- the following bits of info are set as pointers to data or functions --- */ |
| 2175 | 2175 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: adsp2100.sport_rx_callback = (RX_CALLBACK)info->f; break; |
| 2176 | 2176 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: adsp2100.sport_tx_callback = (TX_CALLBACK)info->f; break; |
| 2177 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp2100.timer_c | |
| 2177 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp2100.timer_fired_func | |
| 2178 | 2178 | |
| 2179 | 2179 | default: |
| 2180 | 2180 | adsp21xx_set_info(state, info); |
| r1877 | r1878 | |
| 2202 | 2202 | |
| 2203 | 2203 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: info->f = (genf *)adsp2100.sport_rx_callback; break; |
| 2204 | 2204 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: info->f = (genf *)adsp2100.sport_tx_callback; break; |
| 2205 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp2100.timer_c | |
| 2205 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp2100.timer_fired_func | |
| 2206 | 2206 | |
| 2207 | 2207 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2208 | 2208 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2101"); break; |
| r1877 | r1878 | |
| 2262 | 2262 | /* --- the following bits of info are set as pointers to data or functions --- */ |
| 2263 | 2263 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: adsp2100.sport_rx_callback = (RX_CALLBACK)info->f; break; |
| 2264 | 2264 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: adsp2100.sport_tx_callback = (TX_CALLBACK)info->f; break; |
| 2265 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp2100.timer_c | |
| 2265 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp2100.timer_fired_func | |
| 2266 | 2266 | |
| 2267 | 2267 | default: |
| 2268 | 2268 | adsp21xx_set_info(state, info); |
| r1877 | r1878 | |
| 2290 | 2290 | |
| 2291 | 2291 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: info->f = (genf *)adsp2100.sport_rx_callback; break; |
| 2292 | 2292 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: info->f = (genf *)adsp2100.sport_tx_callback; break; |
| 2293 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp2100.timer_c | |
| 2293 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp2100.timer_fired_func | |
| 2294 | 2294 | |
| 2295 | 2295 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2296 | 2296 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2104"); break; |
| r1877 | r1878 | |
| 2347 | 2347 | /* --- the following bits of info are set as pointers to data or functions --- */ |
| 2348 | 2348 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: adsp2100.sport_rx_callback = (RX_CALLBACK)info->f; break; |
| 2349 | 2349 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: adsp2100.sport_tx_callback = (TX_CALLBACK)info->f; break; |
| 2350 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp2100.timer_c | |
| 2350 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp2100.timer_fired_func | |
| 2351 | 2351 | |
| 2352 | 2352 | default: |
| 2353 | 2353 | adsp21xx_set_info(state, info); |
| r1877 | r1878 | |
| 2372 | 2372 | |
| 2373 | 2373 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: info->f = (genf *)adsp2100.sport_rx_callback; break; |
| 2374 | 2374 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: info->f = (genf *)adsp2100.sport_tx_callback; break; |
| 2375 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp2100.timer_c | |
| 2375 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp2100.timer_fired_func | |
| 2376 | 2376 | |
| 2377 | 2377 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2378 | 2378 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2105"); break; |
| r1877 | r1878 | |
| 2432 | 2432 | /* --- the following bits of info are set as pointers to data or functions --- */ |
| 2433 | 2433 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: adsp2100.sport_rx_callback = (RX_CALLBACK)info->f; break; |
| 2434 | 2434 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: adsp2100.sport_tx_callback = (TX_CALLBACK)info->f; break; |
| 2435 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp2100.timer_c | |
| 2435 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp2100.timer_fired_func | |
| 2436 | 2436 | |
| 2437 | 2437 | default: |
| 2438 | 2438 | adsp21xx_set_info(state, info); |
| r1877 | r1878 | |
| 2460 | 2460 | |
| 2461 | 2461 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: info->f = (genf *)adsp2100.sport_rx_callback; break; |
| 2462 | 2462 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: info->f = (genf *)adsp2100.sport_tx_callback; break; |
| 2463 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp2100.timer_c | |
| 2463 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp2100.timer_fired_func | |
| 2464 | 2464 | |
| 2465 | 2465 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2466 | 2466 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2115"); break; |
| r1877 | r1878 | |
| 2523 | 2523 | /* --- the following bits of info are set as pointers to data or functions --- */ |
| 2524 | 2524 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: adsp2100.sport_rx_callback = (RX_CALLBACK)info->f; break; |
| 2525 | 2525 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: adsp2100.sport_tx_callback = (TX_CALLBACK)info->f; break; |
| 2526 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp2100.timer_c | |
| 2526 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp2100.timer_fired_func | |
| 2527 | 2527 | |
| 2528 | 2528 | default: |
| 2529 | 2529 | adsp21xx_set_info(state, info); |
| r1877 | r1878 | |
| 2558 | 2558 | |
| 2559 | 2559 | case CPUINFO_PTR_ADSP2100_RX_HANDLER: info->f = (genf *)adsp2100.sport_rx_callback; break; |
| 2560 | 2560 | case CPUINFO_PTR_ADSP2100_TX_HANDLER: info->f = (genf *)adsp2100.sport_tx_callback; break; |
| 2561 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp2100.timer_c | |
| 2561 | case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp2100.timer_fired_func | |
| 2562 | 2562 | |
| 2563 | 2563 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2564 | 2564 | case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2181"); break; |
| r1877 | r1878 | |
|---|---|---|
| 260 | 260 | EXECEPTION HANDLING |
| 261 | 261 | ***************************************************************************/ |
| 262 | 262 | |
| 263 | #ifdef UNUSED_FUNCTION | |
| 263 | 264 | INLINE void generate_exception(int exception) |
| 264 | 265 | { |
| 265 | 266 | } |
| 267 | #endif | |
| 266 | 268 | |
| 267 | ||
| 269 | #ifdef UNUSED_FUNCTION | |
| 268 | 270 | INLINE void invalid_instruction(UINT32 op) |
| 269 | 271 | { |
| 270 | 272 | } |
| 273 | #endif | |
| 271 | 274 | |
| 272 | 275 | |
| 273 | ||
| 274 | 276 | /*************************************************************************** |
| 275 | 277 | IRQ HANDLING |
| 276 | 278 | ***************************************************************************/ |
| r1877 | r1878 | |
| 450 | 452 | ***************************************************************************/ |
| 451 | 453 | |
| 452 | 454 | /* context finder */ |
| 455 | #ifdef UNUSED_FUNCTION | |
| 453 | 456 | INLINE dsp32_regs *FINDCONTEXT(int cpu) |
| 454 | 457 | { |
| 455 | 458 | dsp32_regs *context = cpunum_get_context_ptr(cpu); |
| r1877 | r1878 | |
| 457 | 460 | context = &dsp32; |
| 458 | 461 | return context; |
| 459 | 462 | } |
| 463 | #endif | |
| 460 | 464 | |
| 461 | 465 | static const UINT32 regmap[4][16] = |
| 462 | 466 | { |
| r1877 | r1878 | |
|---|---|---|
| 232 | 232 | { |
| 233 | 233 | if (reg >= 0 && reg < 8) |
| 234 | 234 | { |
| 235 | return (config->sp_reg_r)(reg, 0x00000000); | |
| 235 | return (config->sp_reg_r)(Machine, reg, 0x00000000); | |
| 236 | 236 | } |
| 237 | 237 | else if (reg >= 8 && reg < 16) |
| 238 | 238 | { |
| 239 | return (config->dp_reg_r)(reg - 8, 0x00000000); | |
| 239 | return (config->dp_reg_r)(Machine, reg - 8, 0x00000000); | |
| 240 | 240 | } |
| 241 | 241 | else |
| 242 | 242 | { |
| r1877 | r1878 | |
| 248 | 248 | { |
| 249 | 249 | if (reg >= 0 && reg < 8) |
| 250 | 250 | { |
| 251 | (config->sp_reg_w)(reg, data, 0x00000000); | |
| 251 | (config->sp_reg_w)(Machine, reg, data, 0x00000000); | |
| 252 | 252 | } |
| 253 | 253 | else if (reg >= 8 && reg < 16) |
| 254 | 254 | { |
| 255 | (config->dp_reg_w)(reg - 8, data, 0x00000000); | |
| 255 | (config->dp_reg_w)(Machine, reg - 8, data, 0x00000000); | |
| 256 | 256 | } |
| 257 | 257 | else |
| 258 | 258 | { |
| r1877 | r1878 | |
|---|---|---|
| 3 | 3 | |
| 4 | 4 | struct _rsp_config |
| 5 | 5 | { |
| 6 | read32_handler dp_reg_r; | |
| 7 | write32_handler dp_reg_w; | |
| 8 | read32_handler sp_reg_r; | |
| 9 | write32_handler sp_reg_w; | |
| 6 | read32_machine_func dp_reg_r; | |
| 7 | write32_machine_func dp_reg_w; | |
| 8 | read32_machine_func sp_reg_r; | |
| 9 | write32_machine_func sp_reg_w; | |
| 10 | 10 | void (*sp_set_status)(UINT32 status); |
| 11 | 11 | }; |
| 12 | 12 | typedef struct _rsp_config rsp_config; |
| r1877 | r1878 | |
|---|---|---|
| 141 | 141 | UINT16 low, high; |
| 142 | 142 | UINT32 mem[8]; |
| 143 | 143 | int (*irq_callback)(int irqline); /* IRQ callback */ |
| 144 | read8_handler rdmem_id; /* readmem callback for indexed instructions */ | |
| 145 | write8_handler wrmem_id; /* writemem callback for indexed instructions */ | |
| 144 | read8_machine_func rdmem_id; /* readmem callback for indexed instructions */ | |
| 145 | write8_machine_func wrmem_id; /* writemem callback for indexed instructions */ | |
| 146 | 146 | |
| 147 | 147 | UINT8 ddr; |
| 148 | 148 | UINT8 port; |
| r1877 | r1878 | |
| 173 | 173 | #define M4510 |
| 174 | 174 | #include "t65ce02.c" |
| 175 | 175 | |
| 176 | static READ8_HANDLER( default_rdmem_id ) { return program_read_byte_8(offset); } | |
| 177 | static WRITE8_HANDLER( default_wrmem_id ) { program_write_byte_8(offset, data); } | |
| 178 | ||
| 176 | 179 | static void m4510_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 177 | 180 | { |
| 178 | m4510.rdmem_id = program_read_byte_8; | |
| 179 | m4510.wrmem_id = program_write_byte_8; | |
| 181 | m4510.rdmem_id = default_rdmem_id; | |
| 182 | m4510.wrmem_id = default_wrmem_id; | |
| 180 | 183 | m4510.irq_callback = irqcallback; |
| 181 | 184 | } |
| 182 | 185 | |
| r1877 | r1878 | |
| 412 | 415 | case CPUINFO_INT_REGISTER + M4510_MEM7: m4510.mem[7] = info->i; break; |
| 413 | 416 | |
| 414 | 417 | /* --- the following bits of info are set as pointers to data or functions --- */ |
| 415 | case CPUINFO_PTR_M6502_READINDEXED_CALLBACK: m4510.rdmem_id = (read8_handler) info->f; break; | |
| 416 | case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK: m4510.wrmem_id = (write8_handler) info->f; break; | |
| 418 | case CPUINFO_PTR_M6502_READINDEXED_CALLBACK: m4510.rdmem_id = (read8_machine_func) info->f; break; | |
| 419 | case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK: m4510.wrmem_id = (write8_machine_func) info->f; break; | |
| 417 | 420 | case CPUINFO_PTR_M6510_PORTREAD: m4510.port_read = (UINT8 (*)(void)) info->f; break; |
| 418 | 421 | case CPUINFO_PTR_M6510_PORTWRITE: m4510.port_write = (void (*)(UINT8)) info->f; break; |
| 419 | 422 | } |
| r1877 | r1878 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | #define PPC m6502.ppc.d |
| 65 | 65 | |
| 66 | #define RDMEM_ID m6502.rdmem_id | |
| 67 | #define WRMEM_ID m6502.wrmem_id | |
| 66 | #define RDMEM_ID(a) m6502.rdmem_id(Machine,a) | |
| 67 | #define WRMEM_ID(a,d) m6502.wrmem_id(Machine,a,d) | |
| 68 | 68 | |
| 69 | 69 | #define CHANGE_PC change_pc(PCD) |
| 70 | 70 |
| r1877 | r1878 | |
|---|---|---|
| 72 | 72 | UINT8 irq_state; |
| 73 | 73 | UINT8 so_state; |
| 74 | 74 | int (*irq_callback)(int irqline); /* IRQ callback */ |
| 75 | read8_handler rdmem_id; /* readmem callback for indexed instructions */ | |
| 76 | write8_handler wrmem_id; /* writemem callback for indexed instructions */ | |
| 75 | read8_machine_func rdmem_id; /* readmem callback for indexed instructions */ | |
| 76 | write8_machine_func wrmem_id; /* writemem callback for indexed instructions */ | |
| 77 | 77 | |
| 78 | 78 | #if (HAS_M6510) || (HAS_M6510T) || (HAS_M8502) || (HAS_M7501) |
| 79 | 79 | UINT8 ddr; |
| r1877 | r1878 | |
| 89 | 89 | |
| 90 | 90 | static m6502_Regs m6502; |
| 91 | 91 | |
| 92 | static READ8_HANDLER( default_rdmem_id ) { return program_read_byte_8(offset); } | |
| 93 | static WRITE8_HANDLER( default_wdmem_id ) { program_write_byte_8(offset, data); } | |
| 94 | ||
| 92 | 95 | /*************************************************************** |
| 93 | 96 | * include the opcode macros, functions and tables |
| 94 | 97 | ***************************************************************/ |
| r1877 | r1878 | |
| 130 | 133 | m6502.irq_callback = irqcallback; |
| 131 | 134 | m6502.subtype = subtype; |
| 132 | 135 | m6502.insn = insn; |
| 133 | m6502.rdmem_id = program_read_byte_8; | |
| 134 | m6502.wrmem_id = program_write_byte_8; | |
| 136 | m6502.rdmem_id = default_rdmem_id; | |
| 137 | m6502.wrmem_id = default_wdmem_id; | |
| 135 | 138 | |
| 136 | 139 | state_save_register_item(type, index, m6502.pc.w.l); |
| 137 | 140 | state_save_register_item(type, index, m6502.sp.w.l); |
| r1877 | r1878 | |
| 680 | 683 | case CPUINFO_INT_REGISTER + M6502_ZP: m6502.zp.w.l = info->i; break; |
| 681 | 684 | |
| 682 | 685 | /* --- the following bits of info are set as pointers to data or functions --- */ |
| 683 | case CPUINFO_PTR_M6502_READINDEXED_CALLBACK: m6502.rdmem_id = (read8_handler) info->f; break; | |
| 684 | case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK: m6502.wrmem_id = (write8_handler) info->f; break; | |
| 686 | case CPUINFO_PTR_M6502_READINDEXED_CALLBACK: m6502.rdmem_id = (read8_machine_func) info->f; break; | |
| 687 | case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK: m6502.wrmem_id = (write8_machine_func) info->f; break; | |
| 685 | 688 | } |
| 686 | 689 | } |
| 687 | 690 |
| r1877 | r1878 | |
|---|---|---|
| 78 | 78 | UINT8 irq_state; |
| 79 | 79 | UINT8 so_state; |
| 80 | 80 | int (*irq_callback)(int irqline); /* IRQ callback */ |
| 81 | read8_handler rdmem_id; /* readmem callback for indexed instructions */ | |
| 82 | write8_handler wrmem_id; /* readmem callback for indexed instructions */ | |
| 81 | read8_machine_func rdmem_id; /* readmem callback for indexed instructions */ | |
| 82 | write8_machine_func wrmem_id; /* readmem callback for indexed instructions */ | |
| 83 | 83 | } m6509_Regs; |
| 84 | 84 | |
| 85 | 85 | static int m6502_ICount = 0; |
| r1877 | r1878 | |
| 119 | 119 | AM_RANGE(0x00001, 0x00001) AM_MIRROR(0xF0000) AM_READWRITE(m6509_read_00001, m6509_write_00001) |
| 120 | 120 | ADDRESS_MAP_END |
| 121 | 121 | |
| 122 | static READ8_HANDLER( default_rdmem_id ) { return program_read_byte_8(offset); } | |
| 123 | static WRITE8_HANDLER( default_wdmem_id ) { program_write_byte_8(offset, data); } | |
| 124 | ||
| 122 | 125 | static void m6509_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 123 | 126 | { |
| 124 | m6509.rdmem_id = program_read_byte_8; | |
| 125 | m6509.wrmem_id = program_write_byte_8; | |
| 127 | m6509.rdmem_id = default_rdmem_id; | |
| 128 | m6509.wrmem_id = default_wdmem_id; | |
| 126 | 129 | m6509.irq_callback = irqcallback; |
| 127 | 130 | } |
| 128 | 131 | |
| r1877 | r1878 | |
| 304 | 307 | case CPUINFO_INT_REGISTER + M6509_ZP: m6509.zp.w.l = info->i; break; |
| 305 | 308 | |
| 306 | 309 | /* --- the following bits of info are set as pointers to data or functions --- */ |
| 307 | case CPUINFO_PTR_M6502_READINDEXED_CALLBACK: m6509.rdmem_id = (read8_handler) info->f; break; | |
| 308 | case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK: m6509.wrmem_id = (write8_handler) info->f; break; | |
| 310 | case CPUINFO_PTR_M6502_READINDEXED_CALLBACK: m6509.rdmem_id = (read8_machine_func) info->f; break; | |
| 311 | case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK: m6509.wrmem_id = (write8_machine_func) info->f; break; | |
| 309 | 312 | } |
| 310 | 313 | } |
| 311 | 314 |
| r1877 | r1878 | |
|---|---|---|
| 74 | 74 | UINT8 nmi_state; |
| 75 | 75 | UINT8 irq_state; |
| 76 | 76 | int (*irq_callback)(int irqline); /* IRQ callback */ |
| 77 | read8_handler rdmem_id; /* readmem callback for indexed instructions */ | |
| 78 | write8_handler wrmem_id; /* writemem callback for indexed instructions */ | |
| 77 | read8_machine_func rdmem_id; /* readmem callback for indexed instructions */ | |
| 78 | write8_machine_func wrmem_id; /* writemem callback for indexed instructions */ | |
| 79 | 79 | } m65ce02_Regs; |
| 80 | 80 | |
| 81 | 81 | |
| r1877 | r1878 | |
| 260 | 260 | case CPUINFO_INT_REGISTER + M65CE02_ZP: m65ce02.zp.b.l = info->i; break; |
| 261 | 261 | |
| 262 | 262 | /* --- the following bits of info are set as pointers to data or functions --- */ |
| 263 | case CPUINFO_PTR_M6502_READINDEXED_CALLBACK: m65ce02.rdmem_id = (read8_handler) info->f; break; | |
| 264 | case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK: m65ce02.wrmem_id = (write8_handler) info->f; break; | |
| 263 | case CPUINFO_PTR_M6502_READINDEXED_CALLBACK: m65ce02.rdmem_id = (read8_machine_func) info->f; break; | |
| 264 | case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK: m65ce02.wrmem_id = (write8_machine_func) info->f; break; | |
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 |
| r1877 | r1878 | |
|---|---|---|
| 1122 | 1122 | I.IREQ &= ~I.ISRV; |
| 1123 | 1123 | /* reset serviced IRQ */ |
| 1124 | 1124 | I.ISRV = 0; |
| 1125 | if( I.irq_state[0] != CLEAR_LINE ) { | |
| 1125 | if( I.irq_state[I8085_INTR_LINE] != CLEAR_LINE ) { | |
| 1126 | 1126 | LOG(("i8085 EI sets INTR\n")); |
| 1127 | 1127 | I.IREQ |= IM_INTR; |
| 1128 | 1128 | I.INTR = I8085_INTR; |
| 1129 | 1129 | } |
| 1130 | 1130 | if( I.cputype ) { |
| 1131 | if( I.irq_state[ | |
| 1131 | if( I.irq_state[I8085_RST55_LINE] != CLEAR_LINE ) { | |
| 1132 | 1132 | LOG(("i8085 EI sets RST5.5\n")); |
| 1133 | 1133 | I.IREQ |= IM_RST55; |
| 1134 | 1134 | } |
| 1135 | if( I.irq_state[ | |
| 1135 | if( I.irq_state[I8085_RST65_LINE] != CLEAR_LINE ) { | |
| 1136 | 1136 | LOG(("i8085 EI sets RST6.5\n")); |
| 1137 | 1137 | I.IREQ |= IM_RST65; |
| 1138 | 1138 | } |
| 1139 | if( I.irq_state[ | |
| 1139 | if( I.irq_state[I8085_RST75_LINE] != CLEAR_LINE ) { | |
| 1140 | 1140 | LOG(("i8085 EI sets RST7.5\n")); |
| 1141 | 1141 | I.IREQ |= IM_RST75; |
| 1142 | I.irq_state[I8085_RST75_LINE] = CLEAR_LINE; /* clear latch */ | |
| 1142 | 1143 | } |
| 1143 | 1144 | /* find highest priority IREQ flag with |
| 1144 | 1145 | IM enabled and schedule for execution */ |
| r1877 | r1878 | |
| 1419 | 1420 | { |
| 1420 | 1421 | |
| 1421 | 1422 | I.IREQ |= IM_RST75; /* request RST7.5 */ |
| 1423 | I.irq_state[I8085_RST75_LINE] = CLEAR_LINE; /* clear latch */ | |
| 1422 | 1424 | if( I.IM & IM_RST75 ) return; /* if masked, ignore it for now */ |
| 1423 | 1425 | if( !I.ISRV ) /* if no higher priority IREQ is serviced */ |
| 1424 | 1426 | { |
| r1877 | r1878 | |
| 1506 | 1508 | } |
| 1507 | 1509 | else if (irqline < 4) |
| 1508 | 1510 | { |
| 1509 | I.irq_state[irqline] = state; | |
| 1511 | if (irqline == I8085_RST75_LINE) /* RST7.5 is latched on rising edge, the others are sampled */ | |
| 1512 | { | |
| 1513 | if( state != CLEAR_LINE ) | |
| 1514 | I.irq_state[irqline] = state; | |
| 1515 | } | |
| 1516 | else | |
| 1517 | I.irq_state[irqline] = state; | |
| 1518 | ||
| 1510 | 1519 | if (state == CLEAR_LINE) |
| 1511 | 1520 | { |
| 1512 | 1521 | if( !(I.IM & IM_IEN) ) |
| r1877 | r1878 | |
|---|---|---|
| 6 | 6 | #include "deprecat.h" |
| 7 | 7 | |
| 8 | 8 | #if (HAS_PPC603 || HAS_PPC601 || HAS_PPC604) |
| 9 | void ppc603_exception(int exception); | |
| 9 | static void ppc603_exception(int exception); | |
| 10 | 10 | #endif |
| 11 | 11 | #if (HAS_PPC602) |
| 12 | void ppc602_exception(int exception); | |
| 12 | static void ppc602_exception(int exception); | |
| 13 | 13 | #endif |
| 14 | 14 | #if (HAS_PPC403) |
| 15 | void ppc403_exception(int exception); | |
| 15 | static void ppc403_exception(int exception); | |
| 16 | 16 | static UINT8 ppc403_spu_r(UINT32 a); |
| 17 | 17 | static void ppc403_spu_w(UINT32 a, UINT8 d); |
| 18 | 18 | #endif |
| r1877 | r1878 | |
| 817 | 817 | return CR(0) << 28 | CR(1) << 24 | CR(2) << 20 | CR(3) << 16 | CR(4) << 12 | CR(5) << 8 | CR(6) << 4 | CR(7); |
| 818 | 818 | } |
| 819 | 819 | |
| 820 | #ifdef UNUSED_FUNCTION | |
| 820 | 821 | INLINE void ppc_exception(int exception_type) |
| 821 | 822 | { |
| 822 | 823 | longjmp(ppc.exception_jmpbuf, exception_type); |
| 823 | 824 | } |
| 825 | #endif | |
| 824 | 826 | |
| 825 | 827 | /***********************************************************************/ |
| 826 | 828 | |
| r1877 | r1878 | |
| 845 | 847 | |
| 846 | 848 | /* Initialization and shutdown */ |
| 847 | 849 | |
| 848 | void ppc_init(void) | |
| 850 | static void ppc_init(void) | |
| 849 | 851 | { |
| 850 | 852 | int i,j; |
| 851 | 853 | |
| r1877 | r1878 | |
| 1732 | 1734 | } |
| 1733 | 1735 | #endif |
| 1734 | 1736 | |
| 1735 | void ppc_get_info(UINT32 state, cpuinfo *info) | |
| 1737 | static void ppc_get_info(UINT32 state, cpuinfo *info) | |
| 1736 | 1738 | { |
| 1737 | 1739 | switch(state) |
| 1738 | 1740 | { |
| r1877 | r1878 | |
|---|---|---|
| 239 | 239 | |
| 240 | 240 | change_pc(ppc.npc); |
| 241 | 241 | |
| 242 | #ifdef __GNUC__ | |
| 243 | 242 | // MinGW's optimizer kills setjmp()/longjmp() |
| 244 | (void)__builtin_return_address(1); | |
| 245 | #endif | |
| 243 | SETJMP_GNUC_PROTECT(); | |
| 246 | 244 | |
| 247 | 245 | exception_type = setjmp(ppc.exception_jmpbuf); |
| 248 | 246 | if (exception_type) |
| r1877 | r1878 | |
|---|---|---|
| 247 | 247 | |
| 248 | 248 | change_pc(ppc.npc); |
| 249 | 249 | |
| 250 | #ifdef __GNUC__ | |
| 251 | 250 | // MinGW's optimizer kills setjmp()/longjmp() |
| 252 | (void)__builtin_return_address(1); | |
| 253 | #endif | |
| 251 | SETJMP_GNUC_PROTECT(); | |
| 254 | 252 | |
| 255 | 253 | exception_type = setjmp(ppc.exception_jmpbuf); |
| 256 | 254 | if (exception_type) |
| r1877 | r1878 | |
|---|---|---|
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | #ifdef UNUSED_FUNCTION | |
| 259 | 260 | INLINE UINT32 RDPORT_L(int mode, UINT16 addr) |
| 260 | 261 | { |
| 261 | 262 | if( mode == 0 ) |
| r1877 | r1878 | |
| 271 | 272 | return 0x00000000; |
| 272 | 273 | } |
| 273 | 274 | } |
| 275 | #endif | |
| 274 | 276 | |
| 275 | 277 | INLINE void WRPORT_B(int mode, UINT16 addr, UINT8 value) |
| 276 | 278 | { |
| r1877 | r1878 | |
| 297 | 299 | } |
| 298 | 300 | } |
| 299 | 301 | |
| 302 | #ifdef UNUSED_FUNCTION | |
| 300 | 303 | INLINE void WRPORT_L(int mode, UINT16 addr, UINT32 value) |
| 301 | 304 | { |
| 302 | 305 | if( mode == 0 ) |
| r1877 | r1878 | |
| 311 | 314 | /* how to handle MMU writes? */ |
| 312 | 315 | } |
| 313 | 316 | } |
| 317 | #endif | |
| 314 | 318 | |
| 315 | 319 | #include "z8000ops.c" |
| 316 | 320 | #include "z8000tbl.c" |
| r1877 | r1878 | |
|---|---|---|
| 189 | 189 | INLINE UINT8 RB(offs_t A) |
| 190 | 190 | { |
| 191 | 191 | if (A >= 0xe0000000) |
| 192 | return sh2_internal_r((A & 0x1fc)>>2, ~(0xff << (((~A) & 3)*8))) >> (((~A) & 3)*8); | |
| 192 | return sh2_internal_r(Machine, (A & 0x1fc)>>2, ~(0xff << (((~A) & 3)*8))) >> (((~A) & 3)*8); | |
| 193 | 193 | |
| 194 | 194 | if (A >= 0xc0000000) |
| 195 | 195 | return program_read_byte_32be(A); |
| r1877 | r1878 | |
| 203 | 203 | INLINE UINT16 RW(offs_t A) |
| 204 | 204 | { |
| 205 | 205 | if (A >= 0xe0000000) |
| 206 | return sh2_internal_r((A & 0x1fc)>>2, ~(0xffff << (((~A) & 2)*8))) >> (((~A) & 2)*8); | |
| 206 | return sh2_internal_r(Machine, (A & 0x1fc)>>2, ~(0xffff << (((~A) & 2)*8))) >> (((~A) & 2)*8); | |
| 207 | 207 | |
| 208 | 208 | if (A >= 0xc0000000) |
| 209 | 209 | return program_read_word_32be(A); |
| r1877 | r1878 | |
| 217 | 217 | INLINE UINT32 RL(offs_t A) |
| 218 | 218 | { |
| 219 | 219 | if (A >= 0xe0000000) |
| 220 | return sh2_internal_r((A & 0x1fc)>>2, 0); | |
| 220 | return sh2_internal_r(Machine, (A & 0x1fc)>>2, 0); | |
| 221 | 221 | |
| 222 | 222 | if (A >= 0xc0000000) |
| 223 | 223 | return program_read_dword_32be(A); |
| r1877 | r1878 | |
| 233 | 233 | |
| 234 | 234 | if (A >= 0xe0000000) |
| 235 | 235 | { |
| 236 | sh2_internal_w((A & 0x1fc)>>2, V << (((~A) & 3)*8), ~(0xff << (((~A) & 3)*8))); | |
| 236 | sh2_internal_w(Machine, (A & 0x1fc)>>2, V << (((~A) & 3)*8), ~(0xff << (((~A) & 3)*8))); | |
| 237 | 237 | return; |
| 238 | 238 | } |
| 239 | 239 | |
| r1877 | r1878 | |
| 253 | 253 | { |
| 254 | 254 | if (A >= 0xe0000000) |
| 255 | 255 | { |
| 256 | sh2_internal_w((A & 0x1fc)>>2, V << (((~A) & 2)*8), ~(0xffff << (((~A) & 2)*8))); | |
| 256 | sh2_internal_w(Machine, (A & 0x1fc)>>2, V << (((~A) & 2)*8), ~(0xffff << (((~A) & 2)*8))); | |
| 257 | 257 | return; |
| 258 | 258 | } |
| 259 | 259 | |
| r1877 | r1878 | |
| 273 | 273 | { |
| 274 | 274 | if (A >= 0xe0000000) |
| 275 | 275 | { |
| 276 | sh2_internal_w((A & 0x1fc)>>2, V, 0); | |
| 276 | sh2_internal_w(Machine, (A & 0x1fc)>>2, V, 0); | |
| 277 | 277 | return; |
| 278 | 278 | } |
| 279 | 279 |
| r1877 | r1878 | |
|---|---|---|
| 239 | 239 | INLINE UINT8 RB(offs_t A) |
| 240 | 240 | { |
| 241 | 241 | if (A >= 0xfe000000) |
| 242 | return sh4_internal_r(((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), ~(0xff << ((A & 3)*8))) >> ((A & 3)*8); | |
| 242 | return sh4_internal_r(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), ~(0xff << ((A & 3)*8))) >> ((A & 3)*8); | |
| 243 | 243 | |
| 244 | 244 | if (A >= 0xe0000000) |
| 245 | 245 | return program_read_byte_64le(A); |
| r1877 | r1878 | |
| 253 | 253 | INLINE UINT16 RW(offs_t A) |
| 254 | 254 | { |
| 255 | 255 | if (A >= 0xfe000000) |
| 256 | return sh4_internal_r(((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), ~(0xffff << ((A & 2)*8))) >> ((A & 2)*8); | |
| 256 | return sh4_internal_r(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), ~(0xffff << ((A & 2)*8))) >> ((A & 2)*8); | |
| 257 | 257 | |
| 258 | 258 | if (A >= 0xe0000000) |
| 259 | 259 | return program_read_word_64le(A); |
| r1877 | r1878 | |
| 267 | 267 | INLINE UINT32 RL(offs_t A) |
| 268 | 268 | { |
| 269 | 269 | if (A >= 0xfe000000) |
| 270 | return sh4_internal_r(((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), 0); | |
| 270 | return sh4_internal_r(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), 0); | |
| 271 | 271 | |
| 272 | 272 | if (A >= 0xe0000000) |
| 273 | 273 | return program_read_dword_64le(A); |
| r1877 | r1878 | |
| 283 | 283 | |
| 284 | 284 | if (A >= 0xfe000000) |
| 285 | 285 | { |
| 286 | sh4_internal_w(((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), V << ((A & 3)*8), ~(0xff << ((A & 3)*8))); | |
| 286 | sh4_internal_w(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), V << ((A & 3)*8), ~(0xff << ((A & 3)*8))); | |
| 287 | 287 | return; |
| 288 | 288 | } |
| 289 | 289 | |
| r1877 | r1878 | |
| 303 | 303 | { |
| 304 | 304 | if (A >= 0xfe000000) |
| 305 | 305 | { |
| 306 | sh4_internal_w(((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), V << ((A & 2)*8), ~(0xffff << ((A & 2)*8))); | |
| 306 | sh4_internal_w(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), V << ((A & 2)*8), ~(0xffff << ((A & 2)*8))); | |
| 307 | 307 | return; |
| 308 | 308 | } |
| 309 | 309 | |
| r1877 | r1878 | |
| 323 | 323 | { |
| 324 | 324 | if (A >= 0xfe000000) |
| 325 | 325 | { |
| 326 | sh4_internal_w(((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), V, 0); | |
| 326 | sh4_internal_w(Machine, ((A & 0x0fc) >> 2) | ((A & 0x1fe0000) >> 11), V, 0); | |
| 327 | 327 | return; |
| 328 | 328 | } |
| 329 | 329 | |
| r1877 | r1878 | |
| 3711 | 3711 | //if rtcnt < rtcor then rtcor-rtcnt |
| 3712 | 3712 | //if rtcnt >= rtcor then 256-rtcnt+rtcor=256+rtcor-rtcnt |
| 3713 | 3713 | ticks = sh4.m[RTCOR]-sh4.m[RTCNT]; |
| 3714 | if (ticks < 0) | |
| 3714 | if (ticks <= 0) | |
| 3715 | 3715 | ticks = 256 + ticks; |
| 3716 | //((double)rtcnt_div[(sh4.m[RTCSR] >> 3) & 7] / (double)100000000)*ticks | |
| 3717 | 3716 | timer_adjust_oneshot(sh4.refresh_timer, attotime_mul(attotime_mul(ATTOTIME_IN_HZ(sh4.bus_clock), rtcnt_div[(sh4.m[RTCSR] >> 3) & 7]), ticks), sh4.cpu_number); |
| 3718 | 3717 | sh4.refresh_timer_base = sh4.m[RTCNT]; |
| 3719 | 3718 | } |
| r1877 | r1878 | |
|---|---|---|
| 308 | 308 | static void rlca(void) { CF = (R.A>>7)&1; R.A = (R.A<<1) | (R.A>>7); ZF = (R.A==0); } |
| 309 | 309 | static void rrca(void) { CF = R.A &1; R.A = (R.A>>1) | (R.A<<7); ZF = (R.A==0); } |
| 310 | 310 | static void inc_b(void) { M_ADDB(1); } |
| 311 | static void dec_b(void) { M_SUBB(1); } | |
| 311 | static void dec_b(void) { M_SUBB(1); } | |
| 312 | 312 | static void inc_a(void) { M_ADD(1); } |
| 313 | 313 | static void dec_a(void) { M_SUB(1); } |
| 314 | static void cpl(void) { R.A = R.A^0xff; ZF = (R.A==0); } | |
| 314 | static void cpl(void) { R.A = R.A^0xff; ZF = (R.A==0); } | |
| 315 | 315 | |
| 316 | 316 | static void ld_a_ix0_0(void) { R.A = M_RDMEM(BIX0+0); } |
| 317 | 317 | static void ld_a_ix0_1(void) { R.A = M_RDMEM(BIX0+1); } |
| r1877 | r1878 | |
| 611 | 611 | static void tst_a(void) { ZF = (R.A==0); } /* maybe OK */ |
| 612 | 612 | static void clr_a(void) { R.A = 0; ZF = (R.A==0); } /* maybe OK */ |
| 613 | 613 | static void cmp_a_n(void) { UINT8 i=M_RDMEM_OPCODE(); ZF = (R.A==i); CF = (R.A<i); } |
| 614 | static void call(void) { UINT8 i=M_RDMEM_OPCODE(); R.retptr.w.l = PC; M_JMP(i); } | |
| 614 | static void call(void) { UINT8 i=M_RDMEM_OPCODE(); R.retptr.w.l = PC; M_JMP(i); } | |
| 615 | 615 | static void ld_a_ix0_a(void) { R.A = M_RDMEM(BIX0+R.A); } /* maybe OK */ |
| 616 | static void ret(void) { R.mb = R.retptr.b.h; M_JMP( R.retptr.b.l ); } | |
| 616 | static void ret(void) { R.mb = R.retptr.b.h; M_JMP( R.retptr.b.l ); } /* OK , but stack is unknown */ | |
| 617 | 617 | |
| 618 | 618 | static const s_opcode opcode_8301[256]= |
| 619 | 619 | { |
| r1877 | r1878 | |
|---|---|---|
| 360 | 360 | case CPUINFO_INT_REGISTER + G65816_IRQ_STATE: g65816_set_reg(G65816_IRQ_STATE, info->i); break; |
| 361 | 361 | |
| 362 | 362 | /* --- the following bits of info are set as pointers to data or functions --- */ |
| 363 | case CPUINFO_PTR_G65816_READVECTOR_CALLBACK: READ_VECTOR = (read8_ | |
| 363 | case CPUINFO_PTR_G65816_READVECTOR_CALLBACK: READ_VECTOR = (read8_machin | |
| 364 | 364 | } |
| 365 | 365 | } |
| 366 | 366 |
| r1877 | r1878 | |
|---|---|---|
| 81 | 81 | INLINE uint g65816i_read_8_vector(uint address) |
| 82 | 82 | { |
| 83 | 83 | if (READ_VECTOR) |
| 84 | return READ_VECTOR(address); | |
| 84 | return READ_VECTOR(Machine, address); | |
| 85 | 85 | else |
| 86 | 86 | return g65816i_read_8_normal(address); |
| 87 | 87 | } |
| r1877 | r1878 | |
|---|---|---|
| 87 | 87 | uint ir; /* Instruction Register */ |
| 88 | 88 | uint irq_delay; /* delay 1 instruction before checking irq */ |
| 89 | 89 | int (*int_ack)(int); /* Interrupt Acknowledge */ |
| 90 | read8_ | |
| 90 | read8_machin | |
| 91 | 91 | uint stopped; /* Sets how the CPU is stopped */ |
| 92 | 92 | void (*const *opcodes)(void); |
| 93 | 93 | uint (*get_reg)(int regnum); |
| r1877 | r1878 | |
|---|---|---|
| 208 | 208 | /*************************************************************** |
| 209 | 209 | * Read/Write a byte from/to the Internal RAM |
| 210 | 210 | ***************************************************************/ |
| 211 | #define IRAM_R(a) internal_ram_read(a) | |
| 212 | #define IRAM_W(a,v) internal_ram_write(a,v) | |
| 211 | #define IRAM_R(a) internal_ram_read(Machine,a) | |
| 212 | #define IRAM_W(a,v) internal_ram_write(Machine,a,v) | |
| 213 | 213 | /*************************************************************** |
| 214 | 214 | * Read/Write a byte from/to the Internal RAM indirectly (called from indirect addressing) |
| 215 | 215 | ***************************************************************/ |
| 216 | #define IRAM_IR(a) internal_ram_iread(a) | |
| 217 | #define IRAM_IW(a,v) internal_ram_iwrite(a,v) | |
| 216 | #define IRAM_IR(a) internal_ram_iread(Machine,a) | |
| 217 | #define IRAM_IW(a,v) internal_ram_iwrite(Machine,a,v) | |
| 218 | 218 | /*************************************************************** |
| 219 | 219 | * Form an Address to Read/Write to External RAM indirectly (called from indirect addressing) |
| 220 | 220 | ***************************************************************/ |
| 221 | #define ERAM_ADDR(a,m) | |
| 221 | #define ERAM_ADDR(a,m) | |
| 222 | 222 | /*************************************************************** |
| 223 | 223 | * Read/Write a byte from/to the SFR Registers |
| 224 | 224 | ***************************************************************/ |
| 225 | #define SFR_R(a) sfr_read(a) | |
| 226 | #define SFR_W(a,v) sfr_write(a,v) | |
| 225 | #define SFR_R(a) sfr_read(Machine,a) | |
| 226 | #define SFR_W(a,v) sfr_write(Machine,a,v) | |
| 227 | 227 | /*************************************************************** |
| 228 | 228 | * Read/Write a bit from Bit Addressable Memory |
| 229 | 229 | ***************************************************************/ |
| 230 | #define BIT_R(a) bit_address_r(a) | |
| 231 | #define BIT_W(a,v) bit_address_w(a,v) | |
| 230 | #define BIT_R(a) bit_address_r(Machine,a) | |
| 231 | #define BIT_W(a,v) bit_address_w(Machine,a,v) | |
| 232 | 232 | /*************************************************************** |
| 233 | 233 | * Input/Output a byte from given I/O port |
| 234 | 234 | ***************************************************************/ |
| 235 | 235 | #define IN(port) ((UINT8)io_read_byte(port)) |
| 236 | #define OUT(port,value) | |
| 236 | #define OUT(port,value) | |
| 237 | 237 | /*************************************************************** |
| 238 | 238 | * Access the 4 banks of R registers (R0...R7) |
| 239 | 239 | ***************************************************************/ |
| r1877 | r1878 | |
| 1350 | 1350 | default: |
| 1351 | 1351 | return 0; |
| 1352 | 1352 | } |
| 1353 | return 0; | |
| 1354 | 1353 | } |
| 1355 | 1354 | |
| 1356 | 1355 | /*NOTE: These are not used by the opcode functions, they are here only for MAME requirements*/ |
| r1877 | r1878 | |
| 1786 | 1785 | /* Different chip types handle differently, for speed, simply call the chip's handler */ |
| 1787 | 1786 | static READ8_HANDLER(internal_ram_iread) |
| 1788 | 1787 | { |
| 1789 | return i8051.iram_iread(offset); | |
| 1788 | return i8051.iram_iread(Machine,offset); | |
| 1790 | 1789 | } |
| 1791 | 1790 | |
| 1792 | 1791 | /* Writes the contents of the Internal RAM memory (BUT CALLED FROM AN INDIRECT ADDRESSING MODE) */ |
| 1793 | 1792 | /* Different chip types handle differently, for speed, simply call the chip's handler */ |
| 1794 | 1793 | static WRITE8_HANDLER(internal_ram_iwrite) |
| 1795 | 1794 | { |
| 1796 | i8051.iram_iwrite(offset,data); | |
| 1795 | i8051.iram_iwrite(Machine,offset,data); | |
| 1797 | 1796 | } |
| 1798 | 1797 | |
| 1799 | 1798 | /*Generate an external ram address for read/writing using indirect addressing mode */ |
| r1877 | r1878 | |
| 1805 | 1804 | static READ32_HANDLER(external_ram_iaddr) |
| 1806 | 1805 | { |
| 1807 | 1806 | if(i8051.eram_iaddr_callback) |
| 1808 | return i8051.eram_iaddr_callback(offset,mem_mask); | |
| 1807 | return i8051.eram_iaddr_callback(Machine,offset,mem_mask); | |
| 1809 | 1808 | else |
| 1810 | 1809 | LOG(("i8051 #%d: external ram address requested (8 bit offset=%02x), but no callback available! at PC:%04x\n", cpu_getactivecpu(), offset, PC)); |
| 1811 | 1810 | |
| r1877 | r1878 | |
| 2133 | 2132 | #if (HAS_I8052 || HAS_I8752) |
| 2134 | 2133 | //Update Timer 2 |
| 2135 | 2134 | if(GET_TR2) { |
| 2136 | int timerinc, overflow | |
| 2135 | int timerinc, overflow | |
| 2137 | 2136 | UINT16 count = ((R_TH2<<8) | R_TL2); |
| 2138 | timerinc = overflow = | |
| 2137 | timerinc = overflow = | |
| 2139 | 2138 | |
| 2140 | 2139 | //Are we in counter mode? |
| 2141 | 2140 | if(GET_CT2) { |
| r1877 | r1878 | |
|---|---|---|
| 210 | 210 | |
| 211 | 211 | typedef struct _oob_handler oob_handler; |
| 212 | 212 | |
| 213 | typedef void (*oob_callback)(drc_core *drc, oob_handler *oob, void *param); | |
| 213 | typedef void (*oob_callback_func)(drc_core *drc, oob_handler *oob, void *param); | |
| 214 | 214 | |
| 215 | 215 | struct _oob_handler |
| 216 | 216 | { |
| 217 | oob_callback callback; /* pointer to callback function */ | |
| 217 | oob_callback_func callback; /* pointer to callback function */ | |
| 218 | 218 | void * param; /* callback parameter */ |
| 219 | 219 | const opcode_desc * desc; /* pointer to description of relevant instruction */ |
| 220 | 220 | emit_link link; /* link to source of the branch */ |
| r1877 | r1878 | |
| 365 | 365 | bounds callback for later |
| 366 | 366 | -------------------------------------------------*/ |
| 367 | 367 | |
| 368 | INLINE void oob_request_callback(drc_core *drc, UINT8 condition, oob_callback callback, const compiler_state *compiler, const opcode_desc *desc, void *param) | |
| 368 | INLINE void oob_request_callback(drc_core *drc, UINT8 condition, oob_callback_func callback, const compiler_state *compiler, const opcode_desc *desc, void *param) | |
| 369 | 369 | { |
| 370 | 370 | oob_handler *oob = &mips3.drcdata->ooblist[mips3.drcdata->oobcount++]; |
| 371 | 371 | |
| r1877 | r1878 | |
| 3081 | 3081 | emit_mov_m32_r32(DRCTOP, CPR0ADDR(reg), REG_EAX); // mov cpr0[reg],eax |
| 3082 | 3082 | return TRUE; |
| 3083 | 3083 | } |
| 3084 | return FALSE; | |
| 3085 | 3084 | } |
| 3086 | 3085 | |
| 3087 | 3086 | |
| r1877 | r1878 | |
| 3134 | 3133 | emit_movsxd_r64_m32(DRCTOP, REG_RAX, CPR0ADDR(reg)); // movsxd rax,cpr0[reg] |
| 3135 | 3134 | return TRUE; |
| 3136 | 3135 | } |
| 3137 | return FALSE; | |
| 3138 | 3136 | } |
| 3139 | 3137 | |
| 3140 | 3138 |
| r1877 | r1878 | |
|---|---|---|
| 66 | 66 | return result | RM((mAddr+1)&0xffff); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | #ifdef UNUSED_FUNCTION | |
| 69 | 70 | INLINE void WM16( UINT32 mAddr, PAIR p ) /*Write memory file (16 bit) */ |
| 70 | 71 | { |
| 71 | 72 | WM( mAddr, p.b.h ); |
| 72 | 73 | WM( (mAddr+1)&0xffff, p.b.l ); |
| 73 | 74 | } |
| 75 | #endif | |
| 74 | 76 | |
| 75 | 77 | INLINE UINT16 RRF16( UINT32 mAddr ) /*Read register file (16 bit) */ |
| 76 | 78 | { |
| r1877 | r1878 | |
|---|---|---|
| 294 | 294 | INLINE void MODIFY_PM (int data) { R.STR1 &= ~PM_REG; R.STR1 |= (data & PM_REG); R.STR1 |= 0x0180; } |
| 295 | 295 | INLINE void MODIFY_ARP(int data) { R.STR1 &= ~ARB_REG; R.STR1 |= (R.STR0 & ARP_REG); R.STR1 |= 0x0180; \ |
| 296 | 296 | R.STR0 &= ~ARP_REG; R.STR0 |= ((data << 13) & ARP_REG); R.STR0 |= 0x0400; } |
| 297 | #ifdef UNUSED_FUNCTION | |
| 297 | 298 | INLINE void MODIFY_ARB(int data) { R.STR1 &= ~ARB_REG; R.STR1 |= ((data << 13) & ARB_REG); R.STR1 |= 0x0180; } |
| 299 | #endif | |
| 298 | 300 | |
| 299 | 301 | static int mHackIgnoreARP; /* special handling for lst, lst1 instructions */ |
| 300 | 302 |
| r1877 | r1878 | |
|---|---|---|
| 78 | 78 | *****************************************************************************/ |
| 79 | 79 | |
| 80 | 80 | #include <stdarg.h> |
| 81 | #include "deprecat.h" | |
| 81 | 82 | |
| 82 | 83 | #define ARM7_DEBUG_CORE 0 |
| 83 | 84 | |
| r1877 | r1878 | |
| 674 | 675 | { |
| 675 | 676 | // This instruction simply instructs the co-processor to do something, no data is returned to ARM7 core |
| 676 | 677 | if (arm7_coproc_do_callback) |
| 677 | arm7_coproc_do_callback(insn, 0, 0); // simply pass entire opcode to callback - since data format is actually dependent on co-proc implementation | |
| 678 | arm7_coproc_do_callback(Machine, insn, 0, 0); // simply pass entire opcode to callback - since data format is actually dependent on co-proc implementation | |
| 678 | 679 | else |
| 679 | 680 | LOG(("%08x: Co-Processor Data Operation executed, but no callback defined!\n", R15)); |
| 680 | 681 | } |
| r1877 | r1878 | |
| 690 | 691 | { |
| 691 | 692 | if (arm7_coproc_rt_r_callback) |
| 692 | 693 | { |
| 693 | UINT32 res = arm7_coproc_rt_r_callback(insn, 0); // RT Read handler must parse opcode & return appropriate result | |
| 694 | UINT32 res = arm7_coproc_rt_r_callback(Machine, insn, 0); // RT Read handler must parse opcode & return appropriate result | |
| 694 | 695 | SET_REGISTER((insn >> 12) & 0xf, res); |
| 695 | 696 | } |
| 696 | 697 | else |
| r1877 | r1878 | |
| 700 | 701 | else |
| 701 | 702 | { |
| 702 | 703 | if (arm7_coproc_rt_r_callback) |
| 703 | arm7_coproc_rt_w_callback(insn, GET_REGISTER((insn >> 12) & 0xf), 0); | |
| 704 | arm7_coproc_rt_w_callback(Machine, insn, GET_REGISTER((insn >> 12) & 0xf), 0); | |
| 704 | 705 | else |
| 705 | 706 | LOG(("%08x: Co-Processor Register Transfer executed, but no RT Write callback defined!\n", R15)); |
| 706 | 707 | } |
| r1877 | r1878 | |
|---|---|---|
| 140 | 140 | /* 17 processor registers are visible at any given time, |
| 141 | 141 | * banked depending on processor mode. |
| 142 | 142 | */ |
| 143 | ||
| 143 | 144 | static const int sRegisterTable[ARM7_NUM_MODES][18] = |
| 144 | 145 | { |
| 145 | 146 | { /* USR */ |
| r1877 | r1878 | |
|---|---|---|
| 333 | 333 | if(h6280.irq_state[1]!=CLEAR_LINE) status|=1; /* IRQ 2 */ |
| 334 | 334 | if(h6280.irq_state[0]!=CLEAR_LINE) status|=2; /* IRQ 1 */ |
| 335 | 335 | if(h6280.irq_state[2]!=CLEAR_LINE) status|=4; /* TIMER */ |
| 336 | return status|(h6280.io_buffer&(~H6280_IRQ_MASK)); | |
| 336 | return status|(h6280.io_buffer&(~H6280_IRQ_MASK)); | |
| 337 | 337 | } |
| 338 | 338 | case 2: return h6280.irq_mask|(h6280.io_buffer&(~H6280_IRQ_MASK));break; |
| 339 | 339 | } |
| r1877 | r1878 | |
|---|---|---|
| 1965 | 1965 | |
| 1966 | 1966 | READ8_HANDLER( hd63701_internal_registers_r ) |
| 1967 | 1967 | { |
| 1968 | return m6803_internal_registers_r(offset); | |
| 1968 | return m6803_internal_registers_r(Machine, offset); | |
| 1969 | 1969 | } |
| 1970 | 1970 | |
| 1971 | 1971 | WRITE8_HANDLER( hd63701_internal_registers_w ) |
| 1972 | 1972 | { |
| 1973 | m6803_internal_registers_w(offset,data); | |
| 1973 | m6803_internal_registers_w(Machine, offset,data); | |
| 1974 | 1974 | } |
| 1975 | 1975 | #endif |
| 1976 | 1976 |
| r1877 | r1878 | |
|---|---|---|
| 85 | 85 | * |
| 86 | 86 | *************************************/ |
| 87 | 87 | |
| 88 | INLINE UINT16 read16be_with_read8_handler(read8_ | |
| 88 | INLINE UINT16 read16be_with_read8_handler(read8_machin | |
| 89 | 89 | { |
| 90 | 90 | UINT16 result = 0; |
| 91 | 91 | if ((mem_mask & 0xff00) != 0xff00) |
| 92 | result |= ((UINT16)(*handler)(offset * 2 + 0)) << 8; | |
| 92 | result |= ((UINT16)(*handler)(param, offset * 2 + 0)) << 8; | |
| 93 | 93 | if ((mem_mask & 0x00ff) != 0x00ff) |
| 94 | result |= ((UINT16)(*handler)(offset * 2 + 1)) << 0; | |
| 94 | result |= ((UINT16)(*handler)(param, offset * 2 + 1)) << 0; | |
| 95 | 95 | return result; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
| 99 | INLINE void write16be_with_write8_handler(write8_ | |
| 99 | INLINE void write16be_with_write8_handler(write8_machin | |
| 100 | 100 | { |
| 101 | 101 | if ((mem_mask & 0xff00) != 0xff00) |
| 102 | (*handler)(offset * 2 + 0, data >> 8); | |
| 102 | (*handler)(param, offset * 2 + 0, data >> 8); | |
| 103 | 103 | if ((mem_mask & 0x00ff) != 0x00ff) |
| 104 | (*handler)(offset * 2 + 1, data >> 0); | |
| 104 | (*handler)(param, offset * 2 + 1, data >> 0); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| r1877 | r1878 | |
| 111 | 111 | * |
| 112 | 112 | *************************************/ |
| 113 | 113 | |
| 114 | INLINE UINT16 read16le_with_read8_handler(read8_ | |
| 114 | INLINE UINT16 read16le_with_read8_handler(read8_machin | |
| 115 | 115 | { |
| 116 | 116 | UINT16 result = 0; |
| 117 | 117 | if ((mem_mask & 0x00ff) != 0x00ff) |
| 118 | result |= ((UINT16) (*handler)(offset * 2 + 0)) << 0; | |
| 118 | result |= ((UINT16) (*handler)(param, offset * 2 + 0)) << 0; | |
| 119 | 119 | if ((mem_mask & 0xff00) != 0xff00) |
| 120 | result |= ((UINT16) (*handler)(offset * 2 + 1)) << 8; | |
| 120 | result |= ((UINT16) (*handler)(param, offset * 2 + 1)) << 8; | |
| 121 | 121 | return result; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
| 125 | INLINE void write16le_with_write8_handler(write8_ | |
| 125 | INLINE void write16le_with_write8_handler(write8_machin | |
| 126 | 126 | { |
| 127 | 127 | if ((mem_mask & 0x00ff) != 0x00ff) |
| 128 | (*handler)(offset * 2 + 0, data >> 0); | |
| 128 | (*handler)(param, offset * 2 + 0, data >> 0); | |
| 129 | 129 | if ((mem_mask & 0xff00) != 0xff00) |
| 130 | (*handler)(offset * 2 + 1, data >> 8); | |
| 130 | (*handler)(param, offset * 2 + 1, data >> 8); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
| r1877 | r1878 | |
| 137 | 137 | * |
| 138 | 138 | *************************************/ |
| 139 | 139 | |
| 140 | INLINE UINT32 read32be_with_read8_handler(read8_ | |
| 140 | INLINE UINT32 read32be_with_read8_handler(read8_machin | |
| 141 | 141 | { |
| 142 | 142 | UINT32 result = 0; |
| 143 | 143 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 144 | result |= read16be_with_read8_handler(handler, offset * 2 + 0, mem_mask >> 16) << 16; | |
| 144 | result |= read16be_with_read8_handler(handler, param, offset * 2 + 0, mem_mask >> 16) << 16; | |
| 145 | 145 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 146 | result |= read16be_with_read8_handler(handler, offset * 2 + 1, mem_mask) << 0; | |
| 146 | result |= read16be_with_read8_handler(handler, param, offset * 2 + 1, mem_mask) << 0; | |
| 147 | 147 | return result; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | |
| 151 | INLINE void write32be_with_write8_handler(write8_ | |
| 151 | INLINE void write32be_with_write8_handler(write8_machin | |
| 152 | 152 | { |
| 153 | 153 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 154 | write16be_with_write8_handler(handler, offset * 2 + 0, data >> 16, mem_mask >> 16); | |
| 154 | write16be_with_write8_handler(handler, param, offset * 2 + 0, data >> 16, mem_mask >> 16); | |
| 155 | 155 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 156 | write16be_with_write8_handler(handler, offset * 2 + 1, data, mem_mask); | |
| 156 | write16be_with_write8_handler(handler, param, offset * 2 + 1, data, mem_mask); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | |
| r1877 | r1878 | |
| 163 | 163 | * |
| 164 | 164 | *************************************/ |
| 165 | 165 | |
| 166 | INLINE UINT32 read32le_with_read8_handler(read8_ | |
| 166 | INLINE UINT32 read32le_with_read8_handler(read8_machin | |
| 167 | 167 | { |
| 168 | 168 | UINT32 result = 0; |
| 169 | 169 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 170 | result |= read16le_with_read8_handler(handler, offset * 2 + 0, mem_mask) << 0; | |
| 170 | result |= read16le_with_read8_handler(handler, param, offset * 2 + 0, mem_mask) << 0; | |
| 171 | 171 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 172 | result |= read16le_with_read8_handler(handler, offset * 2 + 1, mem_mask >> 16) << 16; | |
| 172 | result |= read16le_with_read8_handler(handler, param, offset * 2 + 1, mem_mask >> 16) << 16; | |
| 173 | 173 | return result; |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | |
| 177 | INLINE void write32le_with_write8_handler(write8_ | |
| 177 | INLINE void write32le_with_write8_handler(write8_machin | |
| 178 | 178 | { |
| 179 | 179 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 180 | write16le_with_write8_handler(handler, offset * 2 + 0, data, mem_mask); | |
| 180 | write16le_with_write8_handler(handler, param, offset * 2 + 0, data, mem_mask); | |
| 181 | 181 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 182 | write16le_with_write8_handler(handler, offset * 2 + 1, data >> 16, mem_mask >> 16); | |
| 182 | write16le_with_write8_handler(handler, param, offset * 2 + 1, data >> 16, mem_mask >> 16); | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
| r1877 | r1878 | |
| 189 | 189 | * |
| 190 | 190 | *************************************/ |
| 191 | 191 | |
| 192 | INLINE UINT32 read32be_with_16be_handler(read16_ | |
| 192 | INLINE UINT32 read32be_with_16be_handler(read16_machin | |
| 193 | 193 | { |
| 194 | 194 | UINT32 result = 0; |
| 195 | 195 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 196 | result |= (*handler)(offset * 2 + 0, mem_mask >> 16) << 16; | |
| 196 | result |= (*handler)(param, offset * 2 + 0, mem_mask >> 16) << 16; | |
| 197 | 197 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 198 | result |= (*handler)(offset * 2 + 1, mem_mask) << 0; | |
| 198 | result |= (*handler)(param, offset * 2 + 1, mem_mask) << 0; | |
| 199 | 199 | return result; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | |
| 203 | INLINE void write32be_with_16be_handler(write16_ | |
| 203 | INLINE void write32be_with_16be_handler(write16_machin | |
| 204 | 204 | { |
| 205 | 205 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 206 | (*handler)(offset * 2 + 0, data >> 16, mem_mask >> 16); | |
| 206 | (*handler)(param, offset * 2 + 0, data >> 16, mem_mask >> 16); | |
| 207 | 207 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 208 | (*handler)(offset * 2 + 1, data, mem_mask); | |
| 208 | (*handler)(param, offset * 2 + 1, data, mem_mask); | |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | |
| r1877 | r1878 | |
| 215 | 215 | * |
| 216 | 216 | *************************************/ |
| 217 | 217 | |
| 218 | INLINE UINT32 read32le_with_16le_handler(read16_ | |
| 218 | INLINE UINT32 read32le_with_16le_handler(read16_machin | |
| 219 | 219 | { |
| 220 | 220 | UINT32 result = 0; |
| 221 | 221 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 222 | result |= (*handler)(offset * 2 + 0, mem_mask) << 0; | |
| 222 | result |= (*handler)(param, offset * 2 + 0, mem_mask) << 0; | |
| 223 | 223 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 224 | result |= (*handler)(offset * 2 + 1, mem_mask >> 16) << 16; | |
| 224 | result |= (*handler)(param, offset * 2 + 1, mem_mask >> 16) << 16; | |
| 225 | 225 | return result; |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | |
| 229 | INLINE void write32le_with_16le_handler(write16_ | |
| 229 | INLINE void write32le_with_16le_handler(write16_machin | |
| 230 | 230 | { |
| 231 | 231 | if ((mem_mask & 0x0000ffff) != 0x0000ffff) |
| 232 | (*handler)(offset * 2 + 0, data, mem_mask); | |
| 232 | (*handler)(param, offset * 2 + 0, data, mem_mask); | |
| 233 | 233 | if ((mem_mask & 0xffff0000) != 0xffff0000) |
| 234 | (*handler)(offset * 2 + 1, data >> 16, mem_mask >> 16); | |
| 234 | (*handler)(param, offset * 2 + 1, data >> 16, mem_mask >> 16); | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | |
| r1877 | r1878 | |
| 241 | 241 | * |
| 242 | 242 | *************************************/ |
| 243 | 243 | |
| 244 | INLINE UINT32 read32be_with_16le_handler(read16_ | |
| 244 | INLINE UINT32 read32be_with_16le_handler(read16_machin | |
| 245 | 245 | { |
| 246 | 246 | UINT32 result = 0; |
| 247 | 247 | mem_mask = FLIPENDIAN_INT32(mem_mask); |
| 248 | result = read32le_with_16le_handler(handler, offset, mem_mask); | |
| 248 | result = read32le_with_16le_handler(handler, param, offset, mem_mask); | |
| 249 | 249 | return FLIPENDIAN_INT32(result); |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | |
| 253 | INLINE void write32be_with_16le_handler(write16_ | |
| 253 | INLINE void write32be_with_16le_handler(write16_machin | |
| 254 | 254 | { |
| 255 | 255 | data = FLIPENDIAN_INT32(data); |
| 256 | 256 | mem_mask = FLIPENDIAN_INT32(mem_mask); |
| 257 | write32le_with_16le_handler(handler, offset, data, mem_mask); | |
| 257 | write32le_with_16le_handler(handler, param, offset, data, mem_mask); | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | |
| r1877 | r1878 | |
| 264 | 264 | * |
| 265 | 265 | *************************************/ |
| 266 | 266 | |
| 267 | INLINE UINT32 read32le_with_16be_handler(read16_ | |
| 267 | INLINE UINT32 read32le_with_16be_handler(read16_machin | |
| 268 | 268 | { |
| 269 | 269 | UINT32 result = 0; |
| 270 | 270 | mem_mask = FLIPENDIAN_INT32(mem_mask); |
| 271 | result = read32be_with_16be_handler(handler, offset, mem_mask); | |
| 271 | result = read32be_with_16be_handler(handler, param, offset, mem_mask); | |
| 272 | 272 | return FLIPENDIAN_INT32(result); |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | |
| 276 | INLINE void write32le_with_16be_handler(write16_ | |
| 276 | INLINE void write32le_with_16be_handler(write16_machin | |
| 277 | 277 | { |
| 278 | 278 | data = FLIPENDIAN_INT32(data); |
| 279 | 279 | mem_mask = FLIPENDIAN_INT32(mem_mask); |
| 280 | write32be_with_16be_handler(handler, offset, data, mem_mask); | |
| 280 | write32be_with_16be_handler(handler, param, offset, data, mem_mask); | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | |
| r1877 | r1878 | |
| 287 | 287 | * |
| 288 | 288 | *************************************/ |
| 289 | 289 | |
| 290 | INLINE UINT64 read64be_with_read8_handler(read8_ | |
| 290 | INLINE UINT64 read64be_with_read8_handler(read8_machin | |
| 291 | 291 | { |
| 292 | 292 | UINT64 result = 0; |
| 293 | 293 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 294 | result |= (UINT64)read32be_with_read8_handler(handler, offset * 2 + 0, mem_mask >> 32) << 32; | |
| 294 | result |= (UINT64)read32be_with_read8_handler(handler, param, offset * 2 + 0, mem_mask >> 32) << 32; | |
| 295 | 295 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 296 | result |= (UINT64)read32be_with_read8_handler(handler, offset * 2 + 1, mem_mask) << 0; | |
| 296 | result |= (UINT64)read32be_with_read8_handler(handler, param, offset * 2 + 1, mem_mask) << 0; | |
| 297 | 297 | return result; |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | |
| 301 | INLINE void write64be_with_write8_handler(write8_ | |
| 301 | INLINE void write64be_with_write8_handler(write8_machin | |
| 302 | 302 | { |
| 303 | 303 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 304 | write32be_with_write8_handler(handler, offset * 2 + 0, data >> 32, mem_mask >> 32); | |
| 304 | write32be_with_write8_handler(handler, param, offset * 2 + 0, data >> 32, mem_mask >> 32); | |
| 305 | 305 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 306 | write32be_with_write8_handler(handler, offset * 2 + 1, data, mem_mask); | |
| 306 | write32be_with_write8_handler(handler, param, offset * 2 + 1, data, mem_mask); | |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | |
| r1877 | r1878 | |
| 313 | 313 | * |
| 314 | 314 | *************************************/ |
| 315 | 315 | |
| 316 | INLINE UINT64 read64le_with_read8_handler(read8_ | |
| 316 | INLINE UINT64 read64le_with_read8_handler(read8_machin | |
| 317 | 317 | { |
| 318 | 318 | UINT64 result = 0; |
| 319 | 319 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 320 | result |= (UINT64)read32le_with_read8_handler(handler, offset * 2 + 0, mem_mask >> 0) << 0; | |
| 320 | result |= (UINT64)read32le_with_read8_handler(handler, param, offset * 2 + 0, mem_mask >> 0) << 0; | |
| 321 | 321 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 322 | result |= (UINT64)read32le_with_read8_handler(handler, offset * 2 + 1, mem_mask >> 32) << 32; | |
| 322 | result |= (UINT64)read32le_with_read8_handler(handler, param, offset * 2 + 1, mem_mask >> 32) << 32; | |
| 323 | 323 | return result; |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | |
| 327 | INLINE void write64le_with_write8_handler(write8_ | |
| 327 | INLINE void write64le_with_write8_handler(write8_machin | |
| 328 | 328 | { |
| 329 | 329 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 330 | write32le_with_write8_handler(handler, offset * 2 + 0, data >> 0, mem_mask >> 0); | |
| 330 | write32le_with_write8_handler(handler, param, offset * 2 + 0, data >> 0, mem_mask >> 0); | |
| 331 | 331 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 332 | write32le_with_write8_handler(handler, offset * 2 + 1, data >> 32, mem_mask >> 32); | |
| 332 | write32le_with_write8_handler(handler, param, offset * 2 + 1, data >> 32, mem_mask >> 32); | |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | |
| r1877 | r1878 | |
| 339 | 339 | * |
| 340 | 340 | *************************************/ |
| 341 | 341 | |
| 342 | INLINE UINT32 read64be_with_16be_handler(read16_ | |
| 342 | INLINE UINT32 read64be_with_16be_handler(read16_machin | |
| 343 | 343 | { |
| 344 | 344 | UINT64 result = 0; |
| 345 | 345 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 346 | result |= (UINT64)read32be_with_16be_handler(handler, offset * 2 + 0, mem_mask >> 32) << 32; | |
| 346 | result |= (UINT64)read32be_with_16be_handler(handler, param, offset * 2 + 0, mem_mask >> 32) << 32; | |
| 347 | 347 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 348 | result |= (UINT64)read32be_with_16be_handler(handler, offset * 2 + 1, mem_mask >> 0) << 0; | |
| 348 | result |= (UINT64)read32be_with_16be_handler(handler, param, offset * 2 + 1, mem_mask >> 0) << 0; | |
| 349 | 349 | return result; |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | |
| 353 | INLINE void write64be_with_16be_handler(write16_ | |
| 353 | INLINE void write64be_with_16be_handler(write16_machin | |
| 354 | 354 | { |
| 355 | 355 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 356 | write32be_with_16be_handler(handler, offset * 2 + 0, data >> 32, mem_mask >> 32); | |
| 356 | write32be_with_16be_handler(handler, param, offset * 2 + 0, data >> 32, mem_mask >> 32); | |
| 357 | 357 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 358 | write32be_with_16be_handler(handler, offset * 2 + 1, data >> 0, mem_mask >> 0); | |
| 358 | write32be_with_16be_handler(handler, param, offset * 2 + 1, data >> 0, mem_mask >> 0); | |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | |
| r1877 | r1878 | |
| 365 | 365 | * |
| 366 | 366 | *************************************/ |
| 367 | 367 | |
| 368 | INLINE UINT32 read64le_with_16le_handler(read16_ | |
| 368 | INLINE UINT32 read64le_with_16le_handler(read16_machin | |
| 369 | 369 | { |
| 370 | 370 | UINT64 result = 0; |
| 371 | 371 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 372 | result |= (UINT64)read32le_with_16le_handler(handler, offset * 2 + 0, mem_mask >> 0) << 0; | |
| 372 | result |= (UINT64)read32le_with_16le_handler(handler, param, offset * 2 + 0, mem_mask >> 0) << 0; | |
| 373 | 373 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 374 | result |= (UINT64)read32le_with_16le_handler(handler, offset * 2 + 1, mem_mask >> 32) << 32; | |
| 374 | result |= (UINT64)read32le_with_16le_handler(handler, param, offset * 2 + 1, mem_mask >> 32) << 32; | |
| 375 | 375 | return result; |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | |
| 379 | INLINE void write64le_with_16le_handler(write16_ | |
| 379 | INLINE void write64le_with_16le_handler(write16_machin | |
| 380 | 380 | { |
| 381 | 381 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 382 | write32le_with_16le_handler(handler, offset * 2 + 0, data >> 0, mem_mask >> 0); | |
| 382 | write32le_with_16le_handler(handler, param, offset * 2 + 0, data >> 0, mem_mask >> 0); | |
| 383 | 383 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 384 | write32le_with_16le_handler(handler, offset * 2 + 1, data >> 32, mem_mask >> 32); | |
| 384 | write32le_with_16le_handler(handler, param, offset * 2 + 1, data >> 32, mem_mask >> 32); | |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | |
| r1877 | r1878 | |
| 391 | 391 | * |
| 392 | 392 | *************************************/ |
| 393 | 393 | |
| 394 | INLINE UINT32 read64be_with_16le_handler(read16_ | |
| 394 | INLINE UINT32 read64be_with_16le_handler(read16_machin | |
| 395 | 395 | { |
| 396 | 396 | UINT64 result = 0; |
| 397 | 397 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 398 | result |= (UINT64)read32be_with_16le_handler(handler, offset * 2 + 0, mem_mask >> 32) << 32; | |
| 398 | result |= (UINT64)read32be_with_16le_handler(handler, param, offset * 2 + 0, mem_mask >> 32) << 32; | |
| 399 | 399 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 400 | result |= (UINT64)read32be_with_16le_handler(handler, offset * 2 + 1, mem_mask >> 0) << 0; | |
| 400 | result |= (UINT64)read32be_with_16le_handler(handler, param, offset * 2 + 1, mem_mask >> 0) << 0; | |
| 401 | 401 | return result; |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | |
| 405 | INLINE void write64be_with_16le_handler(write16_ | |
| 405 | INLINE void write64be_with_16le_handler(write16_machin | |
| 406 | 406 | { |
| 407 | 407 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 408 | write32be_with_16le_handler(handler, offset * 2 + 0, data >> 32, mem_mask >> 32); | |
| 408 | write32be_with_16le_handler(handler, param, offset * 2 + 0, data >> 32, mem_mask >> 32); | |
| 409 | 409 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 410 | write32be_with_16le_handler(handler, offset * 2 + 1, data >> 0, mem_mask >> 0); | |
| 410 | write32be_with_16le_handler(handler, param, offset * 2 + 1, data >> 0, mem_mask >> 0); | |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | |
| r1877 | r1878 | |
| 417 | 417 | * |
| 418 | 418 | *************************************/ |
| 419 | 419 | |
| 420 | INLINE UINT32 read64le_with_16be_handler(read16_ | |
| 420 | INLINE UINT32 read64le_with_16be_handler(read16_machin | |
| 421 | 421 | { |
| 422 | 422 | UINT64 result = 0; |
| 423 | 423 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 424 | result |= (UINT64)read32le_with_16be_handler(handler, offset * 2 + 0, mem_mask >> 0) << 0; | |
| 424 | result |= (UINT64)read32le_with_16be_handler(handler, param, offset * 2 + 0, mem_mask >> 0) << 0; | |
| 425 | 425 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 426 | result |= (UINT64)read32le_with_16be_handler(handler, offset * 2 + 1, mem_mask >> 32) << 32; | |
| 426 | result |= (UINT64)read32le_with_16be_handler(handler, param, offset * 2 + 1, mem_mask >> 32) << 32; | |
| 427 | 427 | return result; |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | |
| 431 | INLINE void write64le_with_16be_handler(write16_ | |
| 431 | INLINE void write64le_with_16be_handler(write16_machin | |
| 432 | 432 | { |
| 433 | 433 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 434 | write32le_with_16be_handler(handler, offset * 2 + 0, data >> 0, mem_mask >> 0); | |
| 434 | write32le_with_16be_handler(handler, param, offset * 2 + 0, data >> 0, mem_mask >> 0); | |
| 435 | 435 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 436 | write32le_with_16be_handler(handler, offset * 2 + 1, data >> 32, mem_mask >> 32); | |
| 436 | write32le_with_16be_handler(handler, param, offset * 2 + 1, data >> 32, mem_mask >> 32); | |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | |
| r1877 | r1878 | |
| 443 | 443 | * |
| 444 | 444 | *************************************/ |
| 445 | 445 | |
| 446 | INLINE UINT64 read64be_with_32be_handler(read32_ | |
| 446 | INLINE UINT64 read64be_with_32be_handler(read32_machin | |
| 447 | 447 | { |
| 448 | 448 | UINT64 result = 0; |
| 449 | 449 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 450 | result |= (UINT64)(*handler)(offset * 2 + 0, mem_mask >> 32) << 32; | |
| 450 | result |= (UINT64)(*handler)(param, offset * 2 + 0, mem_mask >> 32) << 32; | |
| 451 | 451 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 452 | result |= (UINT64)(*handler)(offset * 2 + 1, mem_mask >> 0) << 0; | |
| 452 | result |= (UINT64)(*handler)(param, offset * 2 + 1, mem_mask >> 0) << 0; | |
| 453 | 453 | return result; |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | |
| 457 | INLINE void write64be_with_32be_handler(write32_ | |
| 457 | INLINE void write64be_with_32be_handler(write32_machin | |
| 458 | 458 | { |
| 459 | 459 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 460 | (*handler)(offset * 2 + 0, data >> 32, mem_mask >> 32); | |
| 460 | (*handler)(param, offset * 2 + 0, data >> 32, mem_mask >> 32); | |
| 461 | 461 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 462 | (*handler)(offset * 2 + 1, data >> 0, mem_mask >> 0); | |
| 462 | (*handler)(param, offset * 2 + 1, data >> 0, mem_mask >> 0); | |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | |
| r1877 | r1878 | |
| 469 | 469 | * |
| 470 | 470 | *************************************/ |
| 471 | 471 | |
| 472 | INLINE UINT64 read64le_with_32le_handler(read32_ | |
| 472 | INLINE UINT64 read64le_with_32le_handler(read32_machin | |
| 473 | 473 | { |
| 474 | 474 | UINT64 result = 0; |
| 475 | 475 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 476 | result |= (UINT64)(*handler)(offset * 2 + 0, mem_mask >> 0) << 0; | |
| 476 | result |= (UINT64)(*handler)(param, offset * 2 + 0, mem_mask >> 0) << 0; | |
| 477 | 477 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 478 | result |= (UINT64)(*handler)(offset * 2 + 1, mem_mask >> 32) << 32; | |
| 478 | result |= (UINT64)(*handler)(param, offset * 2 + 1, mem_mask >> 32) << 32; | |
| 479 | 479 | return result; |
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | |
| 483 | INLINE void write64le_with_32le_handler(write32_ | |
| 483 | INLINE void write64le_with_32le_handler(write32_machin | |
| 484 | 484 | { |
| 485 | 485 | if ((mem_mask & U64(0x00000000ffffffff)) != U64(0x00000000ffffffff)) |
| 486 | (*handler)(offset * 2 + 0, data >> 0, mem_mask >> 0); | |
| 486 | (*handler)(param, offset * 2 + 0, data >> 0, mem_mask >> 0); | |
| 487 | 487 | if ((mem_mask & U64(0xffffffff00000000)) != U64(0xffffffff00000000)) |
| 488 | (*handler)(offset * 2 + 1, data >> 32, mem_mask >> 32); | |
| 488 | (*handler)(param, offset * 2 + 1, data >> 32, mem_mask >> 32); | |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | |
| r1877 | r1878 | |
| 495 | 495 | * |
| 496 | 496 | *************************************/ |
| 497 | 497 | |
| 498 | INLINE UINT64 read64be_with_32le_handler(read32_ | |
| 498 | INLINE UINT64 read64be_with_32le_handler(read32_machin | |
| 499 | 499 | { |
| 500 | 500 | UINT64 result; |
| 501 | 501 | mem_mask = FLIPENDIAN_INT64(mem_mask); |
| 502 | result = read64le_with_32le_handler(handler, offset, mem_mask); | |
| 502 | result = read64le_with_32le_handler(handler, param, offset, mem_mask); | |
| 503 | 503 | return FLIPENDIAN_INT64(result); |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | 506 | |
| 507 | INLINE void write64be_with_32le_handler(write32_ | |
| 507 | INLINE void write64be_with_32le_handler(write32_machin | |
| 508 | 508 | { |
| 509 | 509 | data = FLIPENDIAN_INT64(data); |
| 510 | 510 | mem_mask = FLIPENDIAN_INT64(mem_mask); |
| 511 | write64le_with_32le_handler(handler, offset, data, mem_mask); | |
| 511 | write64le_with_32le_handler(handler, param, offset, data, mem_mask); | |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | |
| r1877 | r1878 | |
| 518 | 518 | * |
| 519 | 519 | *************************************/ |
| 520 | 520 | |
| 521 | INLINE UINT64 read64le_with_32be_handler(read32_ | |
| 521 | INLINE UINT64 read64le_with_32be_handler(read32_machin | |
| 522 | 522 | { |
| 523 | 523 | UINT64 result; |
| 524 | 524 | mem_mask = FLIPENDIAN_INT64(mem_mask); |
| 525 | result = read64be_with_32be_handler(handler, offset, mem_mask); | |
| 525 | result = read64be_with_32be_handler(handler, param, offset, mem_mask); | |
| 526 | 526 | return FLIPENDIAN_INT64(result); |
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | |
| 530 | INLINE void write64le_with_32be_handler(write32_ | |
| 530 | INLINE void write64le_with_32be_handler(write32_machin | |
| 531 | 531 | { |
| 532 | 532 | data = FLIPENDIAN_INT64(data); |
| 533 | 533 | mem_mask = FLIPENDIAN_INT64(mem_mask); |
| 534 | write64be_with_32be_handler(handler, offset, data, mem_mask); | |
| 534 | write64be_with_32be_handler(handler, param, offset, data, mem_mask); | |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | |
| r1877 | r1878 | |
| 542 | 542 | |
| 543 | 543 | **************************************************************************/ |
| 544 | 544 | |
| 545 | #define READ_TEMPLATE(bits, name, handler, func) \ | |
| 546 | READ##bits##_HANDLER( name##_r ) \ | |
| 547 | { \ | |
| 548 | return func(handler, offset, mem_mask); \ | |
| 545 | #define READ_TEMPLATE(bits, name, handler, func) \ | |
| 546 | READ##bits##_HANDLER( name##_r ) \ | |
| 547 | { \ | |
| 548 | return func(handler, param, offset, mem_mask); \ | |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | #define READ_TEMPLATE_COND(bits, name, handler, func, cond) \ |
| 552 | 552 | READ##bits##_HANDLER( name##_r ) \ |
| 553 | 553 | { \ |
| 554 | 554 | if (cond) \ |
| 555 | return func(handler, offset, mem_mask); | |
| 555 | return func(handler, param, offset, mem_mask); | |
| 556 | 556 | return 0; \ |
| 557 | 557 | } |
| 558 | 558 | |
| 559 | #define WRITE_TEMPLATE(bits, name, handler, func) \ | |
| 560 | WRITE##bits##_HANDLER( name##_w ) \ | |
| 561 | { \ | |
| 562 | func(handler, offset, data, mem_mask); \ | |
| 559 | #define WRITE_TEMPLATE(bits, name, handler, func) \ | |
| 560 | WRITE##bits##_HANDLER( name##_w ) \ | |
| 561 | { \ | |
| 562 | func(handler, param, offset, data, mem_mask); \ | |
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | #define WRITE_TEMPLATE_COND(bits, name, handler, func, cond) \ |
| 566 | 566 | WRITE##bits##_HANDLER( name##_w ) \ |
| 567 | 567 | { \ |
| 568 | 568 | if (cond) \ |
| 569 | return func(handler, offset, data, mem_mask); | |
| 569 | return func(handler, param, offset, data, mem_mask); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 |
| r1877 | r1878 | |
|---|---|---|
| 43 | 43 | * |
| 44 | 44 | *************************************/ |
| 45 | 45 | |
| 46 | typedef void (*config_callback)(int config_type, xml_data_node *parentnode); | |
| 46 | typedef void (*config_callback_func)(int config_type, xml_data_node *parentnode); | |
| 47 | 47 | |
| 48 | 48 | |
| 49 | 49 | |
| r1877 | r1878 | |
| 54 | 54 | *************************************/ |
| 55 | 55 | |
| 56 | 56 | void config_init(running_machine *machine); |
| 57 | void config_register(const char *nodename, config_callback load, config_callback save); | |
| 57 | void config_register(const char *nodename, config_callback_func load, config_callback_func save); | |
| 58 | 58 | int config_load_settings(running_machine *machine); |
| 59 | 59 | void config_save_settings(running_machine *machine); |
| 60 | 60 |
| r1877 | r1878 | |
|---|---|---|
| 145 | 145 | INT32 output_base_sampindex; /* sample at base of buffer, relative to the current emulated second */ |
| 146 | 146 | |
| 147 | 147 | /* callback information */ |
| 148 | stream_ | |
| 148 | stream_update_func | |
| 149 | 149 | void * param; /* callback function parameter */ |
| 150 | 150 | }; |
| 151 | 151 | |
| r1877 | r1878 | |
| 348 | 348 | stream_create - create a new stream |
| 349 | 349 | -------------------------------------------------*/ |
| 350 | 350 | |
| 351 | sound_stream *stream_create(int inputs, int outputs, int sample_rate, void *param, stream_ | |
| 351 | sound_stream *stream_create(int inputs, int outputs, int sample_rate, void *param, stream_update_func | |
| 352 | 352 | { |
| 353 | 353 | streams_private *strdata = Machine->streams_data; |
| 354 | 354 | int inputnum, outputnum; |
| r1877 | r1878 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | /* intermediate bitmaps */ |
| 31 | 31 | UINT8 bitmap_dirty; /* is the bitmap dirty? */ |
| 32 | | |
| 32 | | |
| 33 | 33 | render_texture *texture; /* texture for rendering the above bitmap */ |
| 34 | 34 | |
| 35 | 35 | /* palette-specific data */ |
| r1877 | r1878 | |
| 83 | 83 | |
| 84 | 84 | /* graphics set handling */ |
| 85 | 85 | static void gfxset_handle_keys(ui_gfx_state *state, int xcells, int ycells); |
| 86 | static void gfxset_draw_item(const gfx_element *gfx, int index, | |
| 86 | static void gfxset_draw_item(const gfx_element *gfx, int index, | |
| 87 | 87 | static void gfxset_update_bitmap(ui_gfx_state *state, int xcells, int ycells, gfx_element *gfx); |
| 88 | 88 | static void gfxset_handler(ui_gfx_state *state); |
| 89 | 89 | |
| r1877 | r1878 | |
| 761 | 761 | the view |
| 762 | 762 | -------------------------------------------------*/ |
| 763 | 763 | |
| 764 | static void gfxset_draw_item(const gfx_element *gfx, int index, | |
| 764 | static void gfxset_draw_item(const gfx_element *gfx, int index, | |
| 765 | 765 | { |
| 766 | 766 | static const pen_t default_palette[] = |
| 767 | 767 | { |
| r1877 | r1878 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | typedef struct _sound_stream sound_stream; |
| 23 | 23 | |
| 24 | typedef void (*stream_ | |
| 24 | typedef void (*stream_update_func | |
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | |
| r1877 | r1878 | |
| 46 | 46 | /* ----- stream configuration and setup ----- */ |
| 47 | 47 | |
| 48 | 48 | /* create a new stream */ |
| 49 | sound_stream *stream_create(int inputs, int outputs, int sample_rate, void *param, stream_ | |
| 49 | sound_stream *stream_create(int inputs, int outputs, int sample_rate, void *param, stream_update_func | |
| 50 | 50 | |
| 51 | 51 | /* configure a stream's input */ |
| 52 | 52 | void stream_set_input(sound_stream *stream, int index, sound_stream *input_stream, int output_index, float gain); |
| r1877 | r1878 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | #ifndef __x86_64__ |
| 35 | 35 | #define mul_32x32 _mul_32x32 |
| 36 | INLINE INT64 _ | |
| 36 | INLINE INT64 ATTR_CONST | |
| 37 | 37 | _mul_32x32(INT32 a, INT32 b) |
| 38 | 38 | { |
| 39 | 39 | register INT64 result; |
| r1877 | r1878 | |
| 59 | 59 | |
| 60 | 60 | #ifndef __x86_64__ |
| 61 | 61 | #define mulu_32x32 _mulu_32x32 |
| 62 | INLINE UINT64 _ | |
| 62 | INLINE UINT64 ATTR_CONST | |
| 63 | 63 | _mulu_32x32(UINT32 a, UINT32 b) |
| 64 | 64 | { |
| 65 | 65 | register UINT64 result; |
| r1877 | r1878 | |
| 84 | 84 | -------------------------------------------------*/ |
| 85 | 85 | |
| 86 | 86 | #define mul_32x32_hi _mul_32x32_hi |
| 87 | INLINE INT32 _ | |
| 87 | INLINE INT32 ATTR_CONST | |
| 88 | 88 | _mul_32x32_hi(INT32 a, INT32 b) |
| 89 | 89 | { |
| 90 | 90 | register INT32 result, temp; |
| r1877 | r1878 | |
| 93 | 93 | " imull %[b] ;" |
| 94 | 94 | : [result] "=d" (result) /* result in edx */ |
| 95 | 95 | , [temp] "=a" (temp) /* This is effectively a clobber */ |
| 96 | : [a] " | |
| 96 | : [a] "a | |
| 97 | 97 | , [b] "rm" (b) /* 'b' can be memory or register */ |
| 98 | 98 | : "%cc" /* Clobbers condition codes */ |
| 99 | 99 | ); |
| r1877 | r1878 | |
| 109 | 109 | -------------------------------------------------*/ |
| 110 | 110 | |
| 111 | 111 | #define mulu_32x32_hi _mulu_32x32_hi |
| 112 | INLINE UINT32 _ | |
| 112 | INLINE UINT32 ATTR_CONST | |
| 113 | 113 | _mulu_32x32_hi(UINT32 a, UINT32 b) |
| 114 | 114 | { |
| 115 | 115 | register UINT32 result, temp; |
| r1877 | r1878 | |
| 118 | 118 | " mull %[b] ;" |
| 119 | 119 | : [result] "=d" (result) /* result in edx */ |
| 120 | 120 | , [temp] "=a" (temp) /* This is effectively a clobber */ |
| 121 | : [a] " | |
| 121 | : [a] "a | |
| 122 | 122 | , [b] "rm" (b) /* 'b' can be memory or register */ |
| 123 | 123 | : "%cc" /* Clobbers condition codes */ |
| 124 | 124 | ); |
| r1877 | r1878 | |
| 136 | 136 | |
| 137 | 137 | #ifndef __x86_64__ |
| 138 | 138 | #define mul_32x32_shift _mul_32x32_shift |
| 139 | INLINE INT32 _ | |
| 139 | INLINE INT32 ATTR_CONST | |
| 140 | 140 | _mul_32x32_shift(INT32 a, INT32 b, UINT8 shift) |
| 141 | 141 | { |
| 142 | 142 | register INT32 result; |
| r1877 | r1878 | |
| 166 | 166 | |
| 167 | 167 | #ifndef __x86_64__ |
| 168 | 168 | #define mulu_32x32_shift _mulu_32x32_shift |
| 169 | INLINE UINT32 _ | |
| 169 | INLINE UINT32 ATTR_CONST | |
| 170 | 170 | _mulu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) |
| 171 | 171 | { |
| 172 | 172 | register UINT32 result; |
| r1877 | r1878 | |
| 194 | 194 | |
| 195 | 195 | #ifndef __x86_64__ |
| 196 | 196 | #define div_64x32 _div_64x32 |
| 197 | INLINE INT32 _ | |
| 197 | INLINE INT32 ATTR_CONST | |
| 198 | 198 | _div_64x32(INT64 a, INT32 b) |
| 199 | 199 | { |
| 200 | 200 | register INT32 result, temp; |
| r1877 | r1878 | |
| 221 | 221 | |
| 222 | 222 | #ifndef __x86_64__ |
| 223 | 223 | #define divu_64x32 _divu_64x32 |
| 224 | INLINE UINT32 _ | |
| 224 | INLINE UINT32 ATTR_CONST | |
| 225 | 225 | _divu_64x32(UINT64 a, UINT32 b) |
| 226 | 226 | { |
| 227 | 227 | register UINT32 result, temp; |
| r1877 | r1878 | |
| 249 | 249 | |
| 250 | 250 | #ifndef __x86_64__ |
| 251 | 251 | #define div_64x32_rem _div_64x32_rem |
| 252 | INLINE INT32 __ | |
| 252 | INLINE INT32 ATTR_FORCE_INLINE | |
| 253 | 253 | _div_64x32_rem(INT64 dividend, INT32 divisor, INT32 *remainder) |
| 254 | 254 | { |
| 255 | 255 | register INT32 quotient; |
| r1877 | r1878 | |
| 277 | 277 | |
| 278 | 278 | #ifndef __x86_64__ |
| 279 | 279 | #define divu_64x32_rem _divu_64x32_rem |
| 280 | INLINE UINT32 __ | |
| 280 | INLINE UINT32 ATTR_FORCE_INLINE | |
| 281 | 281 | _divu_64x32_rem(UINT64 dividend, UINT32 divisor, UINT32 *remainder) |
| 282 | 282 | { |
| 283 | 283 | register UINT32 quotient; |
| r1877 | r1878 | |
| 305 | 305 | |
| 306 | 306 | #ifndef __x86_64__ |
| 307 | 307 | #define div_32x32_shift _div_32x32_shift |
| 308 | INLINE INT32 _ | |
| 308 | INLINE INT32 ATTR_CONST | |
| 309 | 309 | _div_32x32_shift(INT32 a, INT32 b, UINT8 shift) |
| 310 | 310 | { |
| 311 | 311 | register INT32 result; |
| r1877 | r1878 | |
| 337 | 337 | |
| 338 | 338 | #ifndef __x86_64__ |
| 339 | 339 | #define divu_32x32_shift _divu_32x32_shift |
| 340 | INLINE UINT32 _ | |
| 340 | INLINE UINT32 ATTR_CONST | |
| 341 | 341 | _divu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) |
| 342 | 342 | { |
| 343 | 343 | register INT32 result; |
| r1877 | r1878 | |
| 368 | 368 | |
| 369 | 369 | #ifndef __x86_64__ |
| 370 | 370 | #define mod_64x32 _mod_64x32 |
| 371 | INLINE INT32 _ | |
| 371 | INLINE INT32 ATTR_CONST | |
| 372 | 372 | _mod_64x32(INT64 a, INT32 b) |
| 373 | 373 | { |
| 374 | 374 | register INT32 result, temp; |
| r1877 | r1878 | |
| 395 | 395 | |
| 396 | 396 | #ifndef __x86_64__ |
| 397 | 397 | #define modu_64x32 _modu_64x32 |
| 398 | INLINE UINT32 _ | |
| 398 | INLINE UINT32 ATTR_CONST | |
| 399 | 399 | _modu_64x32(UINT64 a, UINT32 b) |
| 400 | 400 | { |
| 401 | 401 | register UINT32 result, temp; |
| r1877 | r1878 | |
| 422 | 422 | |
| 423 | 423 | #ifdef __SSE2__ |
| 424 | 424 | #define recip_approx _recip_approx |
| 425 | INLINE float _ | |
| 425 | INLINE float ATTR_CONST | |
| 426 | 426 | _recip_approx(float value) |
| 427 | 427 | { |
| 428 | 428 | __m128 value_xmm = _mm_set_ss(value); |
| r1877 | r1878 | |
| 445 | 445 | -------------------------------------------------*/ |
| 446 | 446 | |
| 447 | 447 | #define count_leading_zeros _count_leading_zeros |
| 448 | INLINE UINT8 _ | |
| 448 | INLINE UINT8 ATTR_CONST | |
| 449 | 449 | _count_leading_zeros(UINT32 value) |
| 450 | 450 | { |
| 451 | 451 | register UINT32 result; |
| r1877 | r1878 | |
| 470 | 470 | -------------------------------------------------*/ |
| 471 | 471 | |
| 472 | 472 | #define count_leading_ones _count_leading_ones |
| 473 | INLINE UINT8 _ | |
| 473 | INLINE UINT8 ATTR_CONST | |
| 474 | 474 | _count_leading_ones(UINT32 value) |
| 475 | 475 | { |
| 476 | 476 | register UINT32 result; |
| r1877 | r1878 | |
| 504 | 504 | -------------------------------------------------*/ |
| 505 | 505 | |
| 506 | 506 | #define compare_exchange32 _compare_exchange32 |
| 507 | INLINE INT32 _ | |
| 507 | INLINE INT32 ATTR_NONNULL | |
| 508 | 508 | _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange) |
| 509 | 509 | { |
| 510 | 510 | register INT32 result; |
| r1877 | r1878 | |
| 531 | 531 | |
| 532 | 532 | #ifdef __x86_64__ |
| 533 | 533 | #define compare_exchange64 _compare_exchange64 |
| 534 | INLINE INT64 _ | |
| 534 | INLINE INT64 ATTR_NONNULL | |
| 535 | 535 | _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange) |
| 536 | 536 | { |
| 537 | 537 | register INT64 result; |
| r1877 | r1878 | |
| 557 | 557 | -------------------------------------------------*/ |
| 558 | 558 | |
| 559 | 559 | #define atomic_exchange32 _atomic_exchange32 |
| 560 | INLINE INT32 _ | |
| 560 | INLINE INT32 ATTR_NONNULL | |
| 561 | 561 | _atomic_exchange32(INT32 volatile *ptr, INT32 exchange) |
| 562 | 562 | { |
| 563 | 563 | register INT32 result; |
| r1877 | r1878 | |
| 580 | 580 | -------------------------------------------------*/ |
| 581 | 581 | |
| 582 | 582 | #define atomic_add32 _atomic_add32 |
| 583 | INLINE INT32 _ | |
| 583 | INLINE INT32 ATTR_NONNULL | |
| 584 | 584 | _atomic_add32(INT32 volatile *ptr, INT32 delta) |
| 585 | 585 | { |
| 586 | 586 | register INT32 result = delta; |
| r1877 | r1878 | |
| 604 | 604 | -------------------------------------------------*/ |
| 605 | 605 | |
| 606 | 606 | #define atomic_increment32 _atomic_increment32 |
| 607 | INLINE INT32 _ | |
| 607 | INLINE INT32 ATTR_NONNULL | |
| 608 | 608 | _atomic_increment32(INT32 volatile *ptr) |
| 609 | 609 | { |
| 610 | 610 | register INT32 result = 1; |
| r1877 | r1878 | |
| 628 | 628 | -------------------------------------------------*/ |
| 629 | 629 | |
| 630 | 630 | #define atomic_decrement32 _atomic_decrement32 |
| 631 | INLINE INT32 _ | |
| 631 | INLINE INT32 ATTR_NONNULL | |
| 632 | 632 | _atomic_decrement32(INT32 volatile *ptr) |
| 633 | 633 | { |
| 634 | 634 | register INT32 result = -1; |
| r1877 | r1878 | |
|---|---|---|
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | static void cdp1869_draw_line(running_machine *machine, | |
| 384 | static void cdp1869_draw_line(running_machine *machine, | |
| 385 | 385 | { |
| 386 | 386 | int i; |
| 387 | 387 | |
| r1877 | r1878 | |
| 420 | 420 | } |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | static void cdp1869_draw_char(running_machine *machine, | |
| 423 | static void cdp1869_draw_char(running_machine *machine, | |
| 424 | 424 | { |
| 425 | 425 | int i; |
| 426 | 426 | UINT8 code = cdp1869_read_pageram(pramaddr); |
| r1877 | r1878 | |
|---|---|---|
| 100 | 100 | /* |
| 101 | 101 | ** Forward declarations of internal functions. |
| 102 | 102 | */ |
| 103 | static void draw_mode0 (running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 104 | static void draw_mode1 (running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 105 | static void draw_mode2 (running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 106 | static void draw_mode12 (running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 107 | static void draw_mode3 (running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 108 | static void draw_mode23 (running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 109 | static void draw_modebogus (running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 110 | static void draw_sprites (running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect); | |
| 103 | static void draw_mode0 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 104 | static void draw_mode1 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 105 | static void draw_mode2 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 106 | static void draw_mode12 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 107 | static void draw_mode3 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 108 | static void draw_mode23 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 109 | static void draw_modebogus (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 110 | static void draw_sprites (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 111 | 111 | static void change_register (int reg, UINT8 data); |
| 112 | 112 | |
| 113 | static void (*const ModeHandlers[])(running_machine *machine, | |
| 113 | static void (*const ModeHandlers[])(running_machine *machine, | |
| 114 | 114 | draw_mode0, draw_mode1, draw_mode2, draw_mode12, |
| 115 | 115 | draw_mode3, draw_modebogus, draw_mode23, |
| 116 | 116 | draw_modebogus }; |
| r1877 | r1878 | |
| 141 | 141 | void (*INTCallback)(int); |
| 142 | 142 | /* memory */ |
| 143 | 143 | UINT8 *vMem, *dBackMem; |
| 144 | | |
| 144 | | |
| 145 | 145 | int vramsize, model; |
| 146 | 146 | /* emulation settings */ |
| 147 | 147 | int LimitSprites; /* max 4 sprites on a row, like original TMS9918A */ |
| r1877 | r1878 | |
| 292 | 292 | tms.Addr = ((UINT16)data << 8 | tms.FirstByte) & (tms.vramsize - 1); |
| 293 | 293 | if ( !(data & 0x40) ) { |
| 294 | 294 | /* read ahead */ |
| 295 | TMS9928A_vram_r (0); | |
| 295 | TMS9928A_vram_r (machine,0); | |
| 296 | 296 | } |
| 297 | 297 | } |
| 298 | 298 | tms.latch = 0; |
| r1877 | r1878 | |
| 442 | 442 | return b; |
| 443 | 443 | } |
| 444 | 444 | |
| 445 | static void draw_mode1 (running_machine *machine, | |
| 445 | static void draw_mode1 (running_machine *machine, | |
| 446 | 446 | int pattern,x,y,yy,xx,name,charcode; |
| 447 | 447 | UINT8 fg,bg,*patternptr; |
| 448 | 448 | rectangle rt; |
| r1877 | r1878 | |
| 475 | 475 | } |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | static void draw_mode12 (running_machine *machine, | |
| 478 | static void draw_mode12 (running_machine *machine, | |
| 479 | 479 | int pattern,x,y,yy,xx,name,charcode; |
| 480 | 480 | UINT8 fg,bg,*patternptr; |
| 481 | 481 | rectangle rt; |
| r1877 | r1878 | |
| 508 | 508 | } |
| 509 | 509 | } |
| 510 | 510 | |
| 511 | static void draw_mode0 (running_machine *machine, | |
| 511 | static void draw_mode0 (running_machine *machine, | |
| 512 | 512 | int pattern,x,y,yy,xx,name,charcode,colour; |
| 513 | 513 | UINT8 fg,bg,*patternptr; |
| 514 | 514 | |
| r1877 | r1878 | |
| 532 | 532 | } |
| 533 | 533 | } |
| 534 | 534 | |
| 535 | static void draw_mode2 (running_machine *machine, | |
| 535 | static void draw_mode2 (running_machine *machine, | |
| 536 | 536 | int colour,name,x,y,yy,pattern,xx,charcode; |
| 537 | 537 | UINT8 fg,bg; |
| 538 | 538 | UINT8 *colourptr,*patternptr; |
| r1877 | r1878 | |
| 560 | 560 | } |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | static void draw_mode3 (running_machine *machine, | |
| 563 | static void draw_mode3 (running_machine *machine, | |
| 564 | 564 | int x,y,yy,yyy,name,charcode; |
| 565 | 565 | UINT8 fg,bg,*patternptr; |
| 566 | 566 | |
| r1877 | r1878 | |
| 588 | 588 | } |
| 589 | 589 | } |
| 590 | 590 | |
| 591 | static void draw_mode23 (running_machine *machine, | |
| 591 | static void draw_mode23 (running_machine *machine, | |
| 592 | 592 | int x,y,yy,yyy,name,charcode; |
| 593 | 593 | UINT8 fg,bg,*patternptr; |
| 594 | 594 | |
| r1877 | r1878 | |
| 617 | 617 | } |
| 618 | 618 | } |
| 619 | 619 | |
| 620 | static void draw_modebogus (running_machine *machine, | |
| 620 | static void draw_modebogus (running_machine *machine, | |
| 621 | 621 | UINT8 fg,bg; |
| 622 | 622 | int x,y,n,xx; |
| 623 | 623 | |
| r1877 | r1878 | |
| 644 | 644 | ** |
| 645 | 645 | ** This code should be optimized. One day. |
| 646 | 646 | */ |
| 647 | static void draw_sprites (running_machine *machine, | |
| 647 | static void draw_sprites (running_machine *machine, | |
| 648 | 648 | UINT8 *attributeptr,*patternptr,c; |
| 649 | 649 | int p,x,y,size,i,j,large,yy,xx,limit[192], |
| 650 | 650 | illegalsprite,illegalspriteline; |
| r1877 | r1878 | |
|---|---|---|
| 395 | 395 | * |
| 396 | 396 | *************************************/ |
| 397 | 397 | |
| 398 | void tms34061_w(int col, int row, int func, UINT8 data) | |
| 398 | void tms34061_w(running_machine *machine, int col, int row, int func, UINT8 data) | |
| 399 | 399 | { |
| 400 | 400 | offs_t offs; |
| 401 | 401 | |
| r1877 | r1878 | |
| 405 | 405 | /* both 0 and 2 map to register access */ |
| 406 | 406 | case 0: |
| 407 | 407 | case 2: |
| 408 | register_w(col, data); | |
| 408 | register_w(machine, col, data); | |
| 409 | 409 | break; |
| 410 | 410 | |
| 411 | 411 | /* function 1 maps to XY access; col is the address adjustment */ |
| 412 | 412 | case 1: |
| 413 | xypixel_w(col, data); | |
| 413 | xypixel_w(machine, col, data); | |
| 414 | 414 | break; |
| 415 | 415 | |
| 416 | 416 | /* function 3 maps to direct access */ |
| r1877 | r1878 | |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | |
| 457 | UINT8 tms34061_r(int col, int row, int func) | |
| 457 | UINT8 tms34061_r(running_machine *machine, int col, int row, int func) | |
| 458 | 458 | { |
| 459 | 459 | int result = 0; |
| 460 | 460 | offs_t offs; |
| r1877 | r1878 | |
| 465 | 465 | /* both 0 and 2 map to register access */ |
| 466 | 466 | case 0: |
| 467 | 467 | case 2: |
| 468 | result = register_r(col); | |
| 468 | result = register_r(machine, col); | |
| 469 | 469 | break; |
| 470 | 470 | |
| 471 | 471 | /* function 1 maps to XY access; col is the address adjustment */ |
| 472 | 472 | case 1: |
| 473 | result = xypixel_r(col); | |
| 473 | result = xypixel_r(machine, col); | |
| 474 | 474 | break; |
| 475 | 475 | |
| 476 | 476 | /* funtion 3 maps to direct access */ |
| r1877 | r1878 | |
|---|---|---|
| 74 | 74 | static UINT8 v9938_command_unit_w (UINT8 Op); |
| 75 | 75 | static UINT8 v9938_vdp_to_cpu (void); |
| 76 | 76 | static void v9938_set_mode (void); |
| 77 | static void v9938_refresh_line ( | |
| 77 | static void v9938_refresh_line ( | |
| 78 | 78 | |
| 79 | 79 | /*************************************************************************** |
| 80 | 80 | |
| r1877 | r1878 | |
| 386 | 386 | { |
| 387 | 387 | vdp.address_latch = |
| 388 | 388 | (((UINT16)data << 8) | vdp.cmd_write) & 0x3fff; |
| 389 | if ( !(data & 0x40) ) v9938_vram_r (0); /* read ahead! */ | |
| 389 | if ( !(data & 0x40) ) v9938_vram_r (machine,0); /* read ahead! */ | |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | vdp.cmd_write_first = 0; |
| r1877 | r1878 | |
| 1052 | 1052 | vdp.mode = i; |
| 1053 | 1053 | } |
| 1054 | 1054 | |
| 1055 | static void v9938_refresh_16 ( | |
| 1055 | static void v9938_refresh_16 ( | |
| 1056 | 1056 | { |
| 1057 | 1057 | int i, double_lines; |
| 1058 | 1058 | UINT8 col[256]; |
| r1877 | r1878 | |
| 1111 | 1111 | memcpy (ln2, ln, (512 + 32) * 2); |
| 1112 | 1112 | } |
| 1113 | 1113 | |
| 1114 | static void v9938_refresh_line ( | |
| 1114 | static void v9938_refresh_line ( | |
| 1115 | 1115 | { |
| 1116 | 1116 | int ind16, ind256; |
| 1117 | 1117 |
| r1877 | r1878 | |
|---|---|---|
| 69 | 69 | struct _vector_texture |
| 70 | 70 | { |
| 71 | 71 | render_texture * texture; |
| 72 | | |
| 72 | | |
| 73 | 73 | }; |
| 74 | 74 | |
| 75 | 75 | static vector_texture *vectortex[TEXTURE_INTENSITY_BUCKETS][TEXTURE_LENGTH_BUCKETS]; |
| r1877 | r1878 | |
|---|---|---|
| 456 | 456 | * |
| 457 | 457 | *************************************/ |
| 458 | 458 | |
| 459 | int voodoo_update(int which, | |
| 459 | int voodoo_update(int which, | |
| 460 | 460 | { |
| 461 | 461 | voodoo_state *v = voodoo[which]; |
| 462 | 462 | int changed = v->fbi.video_changed; |
| r1877 | r1878 | |
| 1713 | 1713 | mame_printf_debug("UNKNOWN PACKET TYPE %d\n", command & 7); |
| 1714 | 1714 | return 1; |
| 1715 | 1715 | } |
| 1716 | return 1; | |
| 1717 | 1716 | } |
| 1718 | 1717 | |
| 1719 | 1718 |
| r1877 | r1878 | |
|---|---|---|
| 59 | 59 | void tms34061_start(running_machine *machine, const struct tms34061_interface *interface); |
| 60 | 60 | |
| 61 | 61 | /* reads/writes to the 34061 */ |
| 62 | UINT8 tms34061_r(int col, int row, int func); | |
| 63 | void tms34061_w(int col, int row, int func, UINT8 data); | |
| 62 | UINT8 tms34061_r(running_machine *machine, int col, int row, int func); | |
| 63 | void tms34061_w(running_machine *machine, int col, int row, int func, UINT8 data); | |
| 64 | 64 | |
| 65 | 65 | /* latch settings */ |
| 66 | 66 | READ8_HANDLER( tms34061_latch_r ); |
| r1877 | r1878 | |
|---|---|---|
| 18 | 18 | }; |
| 19 | 19 | |
| 20 | 20 | void voodoo_start(int which, int scrnum, int type, int fbmem_in_mb, int tmem0_in_mb, int tmem1_in_mb); |
| 21 | int voodoo_update(int which, | |
| 21 | int voodoo_update(int which, | |
| 22 | 22 | void voodoo_reset(int which); |
| 23 | 23 | void voodoo_exit(int which); |
| 24 | 24 | int voodoo_get_type(int which); |
| r1877 | r1878 | |
|---|---|---|
| 59 | 59 | UINT8 *paletteram_2; /* use when palette RAM is split in two parts */ |
| 60 | 60 | UINT16 *paletteram16_2; |
| 61 | 61 | |
| 62 | ||
| 62 | ||
| 63 | 63 | static int flip_screen_x, flip_screen_y; |
| 64 | 64 | |
| 65 | 65 |
| r1877 | r1878 | |
|---|---|---|
| 1603 | 1603 | struct _raster_info |
| 1604 | 1604 | { |
| 1605 | 1605 | struct _raster_info *next; /* pointer to next entry with the same hash */ |
| 1606 | poly_draw_scanline callback; /* callback pointer */ | |
| 1606 | poly_draw_scanline_func callback; /* callback pointer */ | |
| 1607 | 1607 | UINT8 is_generic; /* TRUE if this is one of the generic rasterizers */ |
| 1608 | 1608 | UINT8 display; /* display index */ |
| 1609 | 1609 | UINT32 hits; /* how many hits (pixels) we've used this for */ |
| r1877 | r1878 | |
|---|---|---|
| 62 | 62 | extern UINT8 *paletteram_2; /* use when palette RAM is split in two parts */ |
| 63 | 63 | extern UINT16 *paletteram16_2; |
| 64 | 64 | |
| 65 | extern | |
| 65 | extern | |
| 66 | 66 | |
| 67 | 67 | |
| 68 | 68 |
| r1877 | r1878 | |
|---|---|---|
| 105 | 105 | int y_offset; |
| 106 | 106 | int x_offset; |
| 107 | 107 | |
| 108 | mame_bitmap *bitmap; | |
| 109 | mame_bitmap *collision_bitmap; | |
| 108 | bitmap_t *bitmap; | |
| 109 | bitmap_t *collision_bitmap; | |
| 110 | 110 | }; |
| 111 | 111 | |
| 112 | 112 | |
| r1877 | r1878 | |
| 143 | 143 | *************************************/ |
| 144 | 144 | |
| 145 | 145 | static void draw_sprite(UINT8 *gfx, int color, int y, int x, int expand, |
| 146 | int or_mode, | |
| 146 | int or_mode, | |
| 147 | 147 | { |
| 148 | 148 | int sy; |
| 149 | 149 | |
| r1877 | r1878 | |
| 264 | 264 | * |
| 265 | 265 | *************************************/ |
| 266 | 266 | |
| 267 | ||
| 267 | ||
| 268 | 268 | { |
| 269 | 269 | UINT8 collision = 0; |
| 270 | 270 | int spriteno; |
| r1877 | r1878 | |
|---|---|---|
| 139 | 139 | void * extra; /* extra data pointer */ |
| 140 | 140 | UINT8 numparams; /* number of parameters for this polygon */ |
| 141 | 141 | UINT8 numverts; /* number of vertices in this polygon */ |
| 142 | poly_draw_scanline callback; /* callback to handle a scanline's worth of work */ | |
| 142 | poly_draw_scanline_func callback; /* callback to handle a scanline's worth of work */ | |
| 143 | 143 | INT32 xorigin; /* X origin for all parameters */ |
| 144 | 144 | INT32 yorigin; /* Y origin for all parameters */ |
| 145 | 145 | poly_param param[MAX_VERTEX_PARAMS];/* array of parameter data */ |
| r1877 | r1878 | |
| 489 | 489 | triangle given 3 vertexes |
| 490 | 490 | -------------------------------------------------*/ |
| 491 | 491 | |
| 492 | UINT32 poly_render_triangle(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3) | |
| 492 | UINT32 poly_render_triangle(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3) | |
| 493 | 493 | { |
| 494 | 494 | float dxdy_v1v2, dxdy_v1v3, dxdy_v2v3; |
| 495 | 495 | const poly_vertex *tv; |
| r1877 | r1878 | |
| 672 | 672 | triangles in a fan |
| 673 | 673 | -------------------------------------------------*/ |
| 674 | 674 | |
| 675 | UINT32 poly_render_triangle_fan(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline callback, int paramcount, int numverts, const poly_vertex *v) | |
| 675 | UINT32 poly_render_triangle_fan(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v) | |
| 676 | 676 | { |
| 677 | 677 | UINT32 pixels = 0; |
| 678 | 678 | int vertnum; |
| r1877 | r1878 | |
| 689 | 689 | render of an object, given specific extents |
| 690 | 690 | -------------------------------------------------*/ |
| 691 | 691 | |
| 692 | UINT32 poly_render_triangle_custom(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline callback, int startscanline, int numscanlines, const poly_extent *extents) | |
| 692 | UINT32 poly_render_triangle_custom(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int startscanline, int numscanlines, const poly_extent *extents) | |
| 693 | 693 | { |
| 694 | 694 | INT32 curscan, scaninc; |
| 695 | 695 | polygon_info *polygon; |
| r1877 | r1878 | |
| 796 | 796 | given 4 vertexes |
| 797 | 797 | -------------------------------------------------*/ |
| 798 | 798 | |
| 799 | UINT32 poly_render_quad(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3, const poly_vertex *v4) | |
| 799 | UINT32 poly_render_quad(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3, const poly_vertex *v4) | |
| 800 | 800 | { |
| 801 | 801 | poly_edge fedgelist[3], bedgelist[3]; |
| 802 | 802 | const poly_edge *ledge, *redge; |
| r1877 | r1878 | |
| 1022 | 1022 | quads in a fan |
| 1023 | 1023 | -------------------------------------------------*/ |
| 1024 | 1024 | |
| 1025 | UINT32 poly_render_quad_fan(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline callback, int paramcount, int numverts, const poly_vertex *v) | |
| 1025 | UINT32 poly_render_quad_fan(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v) | |
| 1026 | 1026 | { |
| 1027 | 1027 | UINT32 pixels = 0; |
| 1028 | 1028 | int vertnum; |
| r1877 | r1878 | |
| 1044 | 1044 | to 32 vertices |
| 1045 | 1045 | -------------------------------------------------*/ |
| 1046 | 1046 | |
| 1047 | UINT32 poly_render_polygon(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline callback, int paramcount, int numverts, const poly_vertex *v) | |
| 1047 | UINT32 poly_render_polygon(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v) | |
| 1048 | 1048 | { |
| 1049 | 1049 | poly_edge fedgelist[MAX_POLYGON_VERTS - 1], bedgelist[MAX_POLYGON_VERTS - 1]; |
| 1050 | 1050 | const poly_edge *ledge, *redge; |
| r1877 | r1878 | |
|---|---|---|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
| 116 | ||
| 116 | WRITE8_DEVICE_HANDLER( mc6845_address_w | |
| 117 | 117 | { |
| 118 | mc6845_t *mc6845 = device->token; | |
| 119 | ||
| 118 | 120 | assert(mc6845 != NULL); |
| 119 | 121 | |
| 120 | 122 | mc6845->register_address_latch = data & 0x1f; |
| 121 | 123 | } |
| 122 | 124 | |
| 123 | 125 | |
| 124 | ||
| 126 | READ8_DEVICE_HANDLER( mc6845_status_r | |
| 125 | 127 | { |
| 128 | mc6845_t *mc6845 = device->token; | |
| 126 | 129 | UINT8 ret = 0; |
| 127 | 130 | |
| 128 | 131 | assert(mc6845 != NULL); |
| r1877 | r1878 | |
| 140 | 143 | } |
| 141 | 144 | |
| 142 | 145 | |
| 143 | ||
| 146 | READ8_DEVICE_HANDLER( mc6845_register_r | |
| 144 | 147 | { |
| 148 | mc6845_t *mc6845 = device->token; | |
| 145 | 149 | UINT8 ret = 0; |
| 146 | 150 | |
| 147 | 151 | assert(mc6845 != NULL); |
| r1877 | r1878 | |
| 163 | 167 | } |
| 164 | 168 | |
| 165 | 169 | |
| 166 | ||
| 170 | WRITE8_DEVICE_HANDLER( mc6845_register_w | |
| 167 | 171 | { |
| 172 | mc6845_t *mc6845 = device->token; | |
| 173 | ||
| 168 | 174 | assert(mc6845 != NULL); |
| 169 | 175 | |
| 170 | 176 | if (LOG) logerror("M6845 PC %04x: reg 0x%02x = 0x%02x\n", activecpu_get_pc(), mc6845->register_address_latch, data); |
| r1877 | r1878 | |
|---|---|---|
| 244 | 244 | |
| 245 | 245 | READ16_HANDLER( tlc34076_lsb_r ) |
| 246 | 246 | { |
| 247 | return tlc34076_r(offset); | |
| 247 | return tlc34076_r(machine, offset); | |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | WRITE16_HANDLER( tlc34076_lsb_w ) |
| 251 | 251 | { |
| 252 | 252 | if (ACCESSING_LSB) |
| 253 | tlc34076_w(offset, data); | |
| 253 | tlc34076_w(machine, offset, data); | |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | READ16_HANDLER( tlc34076_msb_r ) |
| 257 | 257 | { |
| 258 | return tlc34076_r(offset) << 8; | |
| 258 | return tlc34076_r(machine, offset) << 8; | |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | WRITE16_HANDLER( tlc34076_msb_w ) |
| 262 | 262 | { |
| 263 | 263 | if (ACCESSING_MSB) |
| 264 | tlc34076_w(offset, data >> 8); | |
| 264 | tlc34076_w(machine, offset, data >> 8); | |
| 265 | 265 | } |
| 266 | 266 |
| r1877 | r1878 | |
|---|---|---|
| 19 | 19 | /* returns a BITMAP_FORMAT_INDEXED16 bitmap the size of the screen |
| 20 | 20 | D0-D2 of each pixel is the pixel color |
| 21 | 21 | D3 indicates whether the S2636 drew this pixel - 0 = not drawn, 1 = drawn */ |
| 22 | ||
| 22 | ||
| 23 | 23 | |
| 24 | 24 | #endif |
| r1877 | r1878 | |
|---|---|---|
| 90 | 90 | |
| 91 | 91 | |
| 92 | 92 | /* callback routine to process a batch of scanlines in a triangle */ |
| 93 | typedef void (*poly_draw_scanline)(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid); | |
| 93 | typedef void (*poly_draw_scanline_func)(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid); | |
| 94 | 94 | |
| 95 | 95 | |
| 96 | 96 | |
| r1877 | r1878 | |
| 122 | 122 | /* ----- core triangle rendering ----- */ |
| 123 | 123 | |
| 124 | 124 | /* render a single triangle given 3 vertexes */ |
| 125 | UINT32 poly_render_triangle(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3); | |
| 125 | UINT32 poly_render_triangle(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3); | |
| 126 | 126 | |
| 127 | 127 | /* render a set of triangles in a fan */ |
| 128 | UINT32 poly_render_triangle_fan(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline callback, int paramcount, int numverts, const poly_vertex *v); | |
| 128 | UINT32 poly_render_triangle_fan(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v); | |
| 129 | 129 | |
| 130 | 130 | /* perform a custom render of an object, given specific extents */ |
| 131 | UINT32 poly_render_triangle_custom(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline callback, int startscanline, int numscanlines, const poly_extent *extents); | |
| 131 | UINT32 poly_render_triangle_custom(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int startscanline, int numscanlines, const poly_extent *extents); | |
| 132 | 132 | |
| 133 | 133 | |
| 134 | 134 | |
| 135 | 135 | /* ----- core quad rendering ----- */ |
| 136 | 136 | |
| 137 | 137 | /* render a single quad given 4 vertexes */ |
| 138 | UINT32 poly_render_quad(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3, const poly_vertex *v4); | |
| 138 | UINT32 poly_render_quad(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3, const poly_vertex *v4); | |
| 139 | 139 | |
| 140 | 140 | /* render a set of quads in a fan */ |
| 141 | UINT32 poly_render_quad_fan(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline callback, int paramcount, int numverts, const poly_vertex *v); | |
| 141 | UINT32 poly_render_quad_fan(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v); | |
| 142 | 142 | |
| 143 | 143 | |
| 144 | 144 | |
| 145 | 145 | /* ----- core polygon rendering ----- */ |
| 146 | 146 | |
| 147 | 147 | /* render a single polygon up to 32 vertices */ |
| 148 | UINT32 poly_render_polygon(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline callback, int paramcount, int numverts, const poly_vertex *v); | |
| 148 | UINT32 poly_render_polygon(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v); | |
| 149 | 149 | |
| 150 | 150 | |
| 151 | 151 |
| r1877 | r1878 | |
|---|---|---|
| 83 | 83 | DEVICE_GET_INFO( c6545_1 ); |
| 84 | 84 | |
| 85 | 85 | /* select one of the registers for reading or writing */ |
| 86 | ||
| 86 | WRITE8_DEVICE_HANDLER( mc6845_address_w | |
| 87 | 87 | |
| 88 | 88 | /* read from the status register */ |
| 89 | ||
| 89 | READ8_DEVICE_HANDLER( mc6845_status_r | |
| 90 | 90 | |
| 91 | 91 | /* read from the currently selected register */ |
| 92 | ||
| 92 | READ8_DEVICE_HANDLER( mc6845_register_r | |
| 93 | 93 | |
| 94 | 94 | /* write to the currently selected register */ |
| 95 | ||
| 95 | WRITE8_DEVICE_HANDLER( mc6845_register_w | |
| 96 | 96 | |
| 97 | 97 | /* return the current value on the MA0-MA13 pins */ |
| 98 | 98 | UINT16 mc6845_get_ma(mc6845_t *mc6845); |
| r1877 | r1878 | |
|---|---|---|
| 998 | 998 | "\t\t\t<!ATTLIST chip type (cpu|audio) #REQUIRED>\n" |
| 999 | 999 | "\t\t\t<!ATTLIST chip clock CDATA #IMPLIED>\n" |
| 1000 | 1000 | "\t\t<!ELEMENT display EMPTY>\n" |
| 1001 | "\t\t\t<!ATTLIST display type (raster|vector) #REQUIRED>\n" | |
| 1001 | "\t\t\t<!ATTLIST display type (raster|vector|lcd|unknown) #REQUIRED>\n" | |
| 1002 | 1002 | "\t\t\t<!ATTLIST display rotate (0|90|180|270) #REQUIRED>\n" |
| 1003 | 1003 | "\t\t\t<!ATTLIST display flipx (yes|no) \"no\">\n" |
| 1004 | 1004 | "\t\t\t<!ATTLIST display width CDATA #IMPLIED>\n" |
| r1877 | r1878 | |
|---|---|---|
| 47 | 47 | |
| 48 | 48 | |
| 49 | 49 | /* internal blitting callbacks */ |
| 50 | typedef void (*blitmask_t)(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode); | |
| 51 | typedef void (*blitopaque_t)(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode); | |
| 50 | typedef void (*blitmask_func)(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode); | |
| 51 | typedef void (*blitopaque_func)(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode); | |
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | /* blitting parameters for rendering */ |
| 55 | 55 | typedef struct _blit_parameters blit_parameters; |
| 56 | 56 | struct _blit_parameters |
| 57 | 57 | { |
| 58 | | |
| 58 | | |
| 59 | 59 | rectangle cliprect; |
| 60 | blitmask_t draw_masked; | |
| 61 | blitopaque_t draw_opaque; | |
| 60 | blitmask_func draw_masked; | |
| 61 | blitopaque_func draw_opaque; | |
| 62 | 62 | UINT32 tilemap_priority_code; |
| 63 | 63 | UINT8 mask; |
| 64 | 64 | UINT8 value; |
| r1877 | r1878 | |
| 79 | 79 | UINT32 height; /* height of the full tilemap in pixels */ |
| 80 | 80 | |
| 81 | 81 | /* logical <-> memory mappings */ |
| 82 | tilemap_mapper_c | |
| 82 | tilemap_mapper_func | |
| 83 | 83 | tilemap_logical_index * memory_to_logical; /* map from memory index to logical index */ |
| 84 | 84 | tilemap_logical_index max_logical_index; /* maximum valid logical index */ |
| 85 | 85 | tilemap_memory_index * logical_to_memory; /* map from logical index to memory index */ |
| 86 | 86 | tilemap_memory_index max_memory_index; /* maximum valid memory index */ |
| 87 | 87 | |
| 88 | 88 | /* callback to interpret video RAM for the tilemap */ |
| 89 | tile_get_info_c | |
| 89 | tile_get_info_func | |
| 90 | 90 | tile_data tileinfo; /* structure to hold the data for a tile */ |
| 91 | 91 | void * user_data; /* user data value passed to the callback */ |
| 92 | 92 | |
| r1877 | r1878 | |
| 108 | 108 | INT32 dy_flipped; /* global vertical scroll offset when flipped */ |
| 109 | 109 | |
| 110 | 110 | /* pixel data */ |
| 111 | | |
| 111 | | |
| 112 | 112 | |
| 113 | 113 | /* transparency mapping */ |
| 114 | | |
| 114 | | |
| 115 | 115 | UINT8 * tileflags; /* per-tile flags */ |
| 116 | 116 | UINT8 * pen_to_flags; /* mapping of pens to flags */ |
| 117 | 117 | }; |
| r1877 | r1878 | |
| 122 | 122 | GLOBAL VARIABLES |
| 123 | 123 | ***************************************************************************/ |
| 124 | 124 | |
| 125 | ||
| 125 | ||
| 126 | 126 | |
| 127 | 127 | static tilemap * tilemap_list; |
| 128 | 128 | static tilemap ** tilemap_tailptr; |
| r1877 | r1878 | |
| 152 | 152 | static UINT8 tile_apply_bitmask(tilemap *tmap, const UINT8 *maskdata, UINT32 x0, UINT32 y0, UINT8 category, UINT8 flags); |
| 153 | 153 | |
| 154 | 154 | /* drawing helpers */ |
| 155 | static void configure_blit_parameters(blit_parameters *blit, tilemap *tmap, | |
| 155 | static void configure_blit_parameters(blit_parameters *blit, tilemap *tmap, | |
| 156 | 156 | static void tilemap_draw_instance(tilemap *tmap, const blit_parameters *blit, int xpos, int ypos); |
| 157 | 157 | static void tilemap_draw_roz_core(tilemap *tmap, const blit_parameters *blit, |
| 158 | 158 | UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound); |
| r1877 | r1878 | |
| 287 | 287 | tilemap_create - allocate a new tilemap |
| 288 | 288 | -------------------------------------------------*/ |
| 289 | 289 | |
| 290 | tilemap *tilemap_create(tile_get_info_c | |
| 290 | tilemap *tilemap_create(tile_get_info_func | |
| 291 | 291 | { |
| 292 | 292 | tilemap *tmap; |
| 293 | 293 | int group; |
| r1877 | r1878 | |
| 693 | 693 | (updated) internal pixmap for a tilemap |
| 694 | 694 | -------------------------------------------------*/ |
| 695 | 695 | |
| 696 | ||
| 696 | ||
| 697 | 697 | { |
| 698 | 698 | /* ensure all the tiles are up-to-date and then return the pixmap */ |
| 699 | 699 | pixmap_update(tmap, NULL); |
| r1877 | r1878 | |
| 706 | 706 | (updated) internal flagsmap for a tilemap |
| 707 | 707 | -------------------------------------------------*/ |
| 708 | 708 | |
| 709 | ||
| 709 | ||
| 710 | 710 | { |
| 711 | 711 | /* ensure all the tiles are up-to-date and then return the pixmap */ |
| 712 | 712 | pixmap_update(tmap, NULL); |
| r1877 | r1878 | |
| 738 | 738 | priority/priority_mask to the priority bitmap |
| 739 | 739 | -------------------------------------------------*/ |
| 740 | 740 | |
| 741 | void tilemap_draw_primask( | |
| 741 | void tilemap_draw_primask( | |
| 742 | 742 | { |
| 743 | 743 | rectangle original_cliprect; |
| 744 | 744 | blit_parameters blit; |
| r1877 | r1878 | |
| 856 | 856 | priority_mask to the priority bitmap |
| 857 | 857 | -------------------------------------------------*/ |
| 858 | 858 | |
| 859 | void tilemap_draw_roz_primask( | |
| 859 | void tilemap_draw_roz_primask( | |
| 860 | 860 | UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, |
| 861 | 861 | int wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask) |
| 862 | 862 | { |
| r1877 | r1878 | |
| 933 | 933 | priority) |
| 934 | 934 | -------------------------------------------------*/ |
| 935 | 935 | |
| 936 | void tilemap_draw_by_index( | |
| 936 | void tilemap_draw_by_index( | |
| 937 | 937 | { |
| 938 | 938 | tilemap *tmap = indexed_tilemap(number); |
| 939 | 939 | blit_parameters blit; |
| r1877 | r1878 | |
| 1266 | 1266 | static UINT8 tile_draw(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags) |
| 1267 | 1267 | { |
| 1268 | 1268 | const UINT8 *penmap = tmap->pen_to_flags + group * MAX_PEN_TO_FLAGS; |
| 1269 | mame_bitmap *flagsmap = tmap->flagsmap; | |
| 1270 | mame_bitmap *pixmap = tmap->pixmap; | |
| 1269 | bitmap_t *flagsmap = tmap->flagsmap; | |
| 1270 | bitmap_t *pixmap = tmap->pixmap; | |
| 1271 | 1271 | int height = tmap->tileheight; |
| 1272 | 1272 | int width = tmap->tilewidth; |
| 1273 | 1273 | UINT8 andmask = ~0, ormask = 0; |
| r1877 | r1878 | |
| 1361 | 1361 | |
| 1362 | 1362 | static UINT8 tile_apply_bitmask(tilemap *tmap, const UINT8 *maskdata, UINT32 x0, UINT32 y0, UINT8 category, UINT8 flags) |
| 1363 | 1363 | { |
| 1364 | | |
| 1364 | | |
| 1365 | 1365 | int height = tmap->tileheight; |
| 1366 | 1366 | int width = tmap->tilewidth; |
| 1367 | 1367 | UINT8 andmask = ~0, ormask = 0; |
| r1877 | r1878 | |
| 1421 | 1421 | and indexed drawing code |
| 1422 | 1422 | -------------------------------------------------*/ |
| 1423 | 1423 | |
| 1424 | static void configure_blit_parameters(blit_parameters *blit, tilemap *tmap, | |
| 1424 | static void configure_blit_parameters(blit_parameters *blit, tilemap *tmap, | |
| 1425 | 1425 | { |
| 1426 | 1426 | /* start with nothing */ |
| 1427 | 1427 | memset(blit, 0, sizeof(*blit)); |
| r1877 | r1878 | |
| 1506 | 1506 | |
| 1507 | 1507 | static void tilemap_draw_instance(tilemap *tmap, const blit_parameters *blit, int xpos, int ypos) |
| 1508 | 1508 | { |
| 1509 | | |
| 1509 | | |
| 1510 | 1510 | const UINT16 *source_baseaddr; |
| 1511 | 1511 | const UINT8 *mask_baseaddr; |
| 1512 | 1512 | void *dest_baseaddr = NULL; |
| r1877 | r1878 | |
| 1685 | 1685 | UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound) |
| 1686 | 1686 | { |
| 1687 | 1687 | const pen_t *clut = &Machine->pens[blit->tilemap_priority_code >> 16]; |
| 1688 | mame_bitmap *destbitmap = blit->bitmap; | |
| 1689 | mame_bitmap *srcbitmap = tmap->pixmap; | |
| 1690 | mame_bitmap *flagsmap = tmap->flagsmap; | |
| 1688 | bitmap_t *destbitmap = blit->bitmap; | |
| 1689 | bitmap_t *srcbitmap = tmap->pixmap; | |
| 1690 | bitmap_t *flagsmap = tmap->flagsmap; | |
| 1691 | 1691 | const int xmask = srcbitmap->width-1; |
| 1692 | 1692 | const int ymask = srcbitmap->height-1; |
| 1693 | 1693 | const int widthshifted = srcbitmap->width << 16; |
| r1877 | r1878 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | /************************************* |
| 36 | 36 | * |
| 37 | * Video timing | |
| 37 | * Old way of allowing "VBLANK" | |
| 38 | * interrupts to fire more than once | |
| 39 | * a frame. | |
| 38 | 40 | * |
| 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. | |
| 41 | * These should be replaced with | |
| 42 | * scanline based interrupts as | |
| 43 | * it makes no sense to have more | |
| 44 | * than one VBLANK interrupt | |
| 45 | * per frame. | |
| 43 | 46 | * |
| 44 | 47 | *************************************/ |
| 45 | 48 | |
| 46 | /* Returns the number of the video frame we are currently playing */ | |
| 47 | int cpu_getcurrentframe(void); | |
| 49 | #define MDRV_CPU_VBLANK_INT_HACK(_func, _rate) \ | |
| 50 | TOKEN_UINT32_PACK2(MCONFIG_TOKEN_CPU_VBLANK_INT_HACK, 8, _rate, 24), \ | |
| 51 | TOKEN_PTR(interrupt, _func), | |
| 48 | 52 | |
| 49 | 53 | |
| 50 | 54 |
| r1877 | r1878 | |
|---|---|---|
| 148 | 148 | 6. In your VIDEO_UPDATE callback, render the tiles by calling |
| 149 | 149 | tilemap_draw() or tilemap_draw_roz(). If you need to do custom |
| 150 | 150 | rendering and want access to the raw pixels, call |
| 151 | tilemap_get_pixmap() to get a pointer to the updated | |
| 151 | tilemap_get_pixmap() to get a pointer to the updated | |
| 152 | 152 | containing the tilemap graphics. |
| 153 | 153 | |
| 154 | 154 | **************************************************************************** |
| r1877 | r1878 | |
| 366 | 366 | /* Macros for setting tile attributes in the TILE_GET_INFO callback: */ |
| 367 | 367 | /* TILE_FLIP_YX assumes that flipy is in bit 1 and flipx is in bit 0 */ |
| 368 | 368 | /* TILE_FLIP_XY assumes that flipy is in bit 0 and flipx is in bit 1 */ |
| 369 | /* TILE_GROUP shifts a split group number appropriately to OR into the tile flags */ | |
| 370 | 369 | #define TILE_FLIPYX(YX) ((YX) & 3) |
| 371 | 370 | #define TILE_FLIPXY(XY) ((((XY) & 2) >> 1) | (((XY) & 1) << 1)) |
| 372 | 371 | |
| r1877 | r1878 | |
| 397 | 396 | |
| 398 | 397 | |
| 399 | 398 | /* callback function to get info about a tile */ |
| 400 | typedef void (*tile_get_info_c | |
| 399 | typedef void (*tile_get_info_func | |
| 401 | 400 | |
| 402 | 401 | /* callback function to map a column,row pair to a memory index */ |
| 403 | typedef tilemap_memory_index (*tilemap_mapper_c | |
| 402 | typedef tilemap_memory_index (*tilemap_mapper_func | |
| 404 | 403 | |
| 405 | 404 | |
| 406 | 405 | |
| r1877 | r1878 | |
| 408 | 407 | GLOBAL VARIABLES |
| 409 | 408 | ***************************************************************************/ |
| 410 | 409 | |
| 411 | extern | |
| 410 | extern | |
| 412 | 411 | |
| 413 | 412 | |
| 414 | 413 | |
| r1877 | r1878 | |
| 427 | 426 | /* ----- tilemap creation and configuration ----- */ |
| 428 | 427 | |
| 429 | 428 | /* create a new tilemap; note that tilemaps are tracked by the core so there is no dispose */ |
| 430 | tilemap *tilemap_create(tile_get_info_c | |
| 429 | tilemap *tilemap_create(tile_get_info_func | |
| 431 | 430 | |
| 432 | 431 | /* specify a parameter to be passed into the tile_get_info callback */ |
| 433 | 432 | void tilemap_set_user_data(tilemap *tmap, void *user_data); |
| r1877 | r1878 | |
| 495 | 494 | /* ----- internal map access ----- */ |
| 496 | 495 | |
| 497 | 496 | /* return a pointer to the (updated) internal pixmap for a tilemap */ |
| 498 | ||
| 497 | ||
| 499 | 498 | |
| 500 | 499 | /* return a pointer to the (updated) internal flagsmap for a tilemap */ |
| 501 | ||
| 500 | ||
| 502 | 501 | |
| 503 | 502 | /* return a pointer to the (updated) internal per-tile flags for a tilemap */ |
| 504 | 503 | UINT8 *tilemap_get_tile_flags(tilemap *tmap); |
| r1877 | r1878 | |
| 508 | 507 | /* ----- tilemap rendering ----- */ |
| 509 | 508 | |
| 510 | 509 | /* draw a tilemap to the destination with clipping; pixels apply priority/priority_mask to the priority bitmap */ |
| 511 | void tilemap_draw_primask( | |
| 510 | void tilemap_draw_primask( | |
| 512 | 511 | |
| 513 | 512 | /* draw a tilemap to the destination with clipping and arbitrary rotate/zoom; */ |
| 514 | 513 | /* pixels apply priority/priority_mask to the priority bitmap */ |
| 515 | void tilemap_draw_roz_primask( | |
| 514 | void tilemap_draw_roz_primask( | |
| 516 | 515 | UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, |
| 517 | 516 | int wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask); |
| 518 | 517 | |
| r1877 | r1878 | |
| 527 | 526 | void tilemap_size_by_index(int number, UINT32 *width, UINT32 *height); |
| 528 | 527 | |
| 529 | 528 | /* render an indexed tilemap with fixed characteristics (no priority) */ |
| 530 | void tilemap_draw_by_index( | |
| 529 | void tilemap_draw_by_index( | |
| 531 | 530 | |
| 532 | 531 | |
| 533 | 532 | |
| r1877 | r1878 | |
| 584 | 583 | tilemap_draw_primask |
| 585 | 584 | -------------------------------------------------*/ |
| 586 | 585 | |
| 587 | INLINE void tilemap_draw( | |
| 586 | INLINE void tilemap_draw( | |
| 588 | 587 | { |
| 589 | 588 | tilemap_draw_primask(dest, cliprect, tmap, flags, priority, 0xff); |
| 590 | 589 | } |
| r1877 | r1878 | |
| 595 | 594 | tilemap_draw_roz_primask |
| 596 | 595 | -------------------------------------------------*/ |
| 597 | 596 | |
| 598 | INLINE void tilemap_draw_roz( | |
| 597 | INLINE void tilemap_draw_roz( | |
| 599 | 598 | UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, |
| 600 | 599 | int wraparound, UINT32 flags, UINT8 priority) |
| 601 | 600 | { |
| r0 | r1878 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | watchdog.h | |
| 4 | ||
| 5 | Watchdog handling | |
| 6 | ||
| 7 | Copyright Nicola Salmoria and the MAME Team. | |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #include "driver.h" | |
| 13 | ||
| 14 | ||
| 15 | ||
| 16 | ||
| 17 | /*************************************************************************** | |
| 18 | GLOBAL VARIABLES | |
| 19 | ***************************************************************************/ | |
| 20 | ||
| 21 | static UINT8 watchdog_enabled; | |
| 22 | static INT32 watchdog_counter; | |
| 23 | static emu_timer *watchdog_timer; | |
| 24 | ||
| 25 | ||
| 26 | ||
| 27 | /*************************************************************************** | |
| 28 | FUNCTION PROTOTYPES | |
| 29 | ***************************************************************************/ | |
| 30 | ||
| 31 | static void watchdog_internal_reset(running_machine *machine); | |
| 32 | static TIMER_CALLBACK( watchdog_callback ); | |
| 33 | ||
| 34 | ||
| 35 | ||
| 36 | /*------------------------------------------------- | |
| 37 | watchdog_init - one time initialization | |
| 38 | -------------------------------------------------*/ | |
| 39 | ||
| 40 | void watchdog_init(running_machine *machine) | |
| 41 | { | |
| 42 | /* allocate a timer for the watchdog */ | |
| 43 | watchdog_timer = timer_alloc(watchdog_callback, NULL); | |
| 44 | ||
| 45 | add_reset_callback(machine, watchdog_internal_reset); | |
| 46 | ||
| 47 | /* save some stuff in the default tag */ | |
| 48 | state_save_push_tag(0); | |
| 49 | state_save_register_item("watchdog", 0, watchdog_enabled); | |
| 50 | state_save_register_item("watchdog", 0, watchdog_counter); | |
| 51 | state_save_pop_tag(); | |
| 52 | } | |
| 53 | ||
| 54 | ||
| 55 | /*------------------------------------------------- | |
| 56 | watchdog_internal_reset - reset the watchdog | |
| 57 | system | |
| 58 | -------------------------------------------------*/ | |
| 59 | ||
| 60 | static void watchdog_internal_reset(running_machine *machine) | |
| 61 | { | |
| 62 | /* set up the watchdog timer; only start off enabled if explicitly configured */ | |
| 63 | watchdog_enabled = (machine->config->watchdog_vblank_count != 0 || attotime_compare(machine->config->watchdog_time, attotime_zero) != 0); | |
| 64 | watchdog_reset(machine); | |
| 65 | watchdog_enabled = TRUE; | |
| 66 | } | |
| 67 | ||
| 68 | ||
| 69 | /*------------------------------------------------- | |
| 70 | watchdog_callback - watchdog timer callback | |
| 71 | -------------------------------------------------*/ | |
| 72 | ||
| 73 | static TIMER_CALLBACK( watchdog_callback ) | |
| 74 | { | |
| 75 | logerror("Reset caused by the watchdog!!!\n"); | |
| 76 | popmessage("Reset caused by the watchdog!!!\n"); | |
| 77 | mame_schedule_soft_reset(machine); | |
| 78 | } | |
| 79 | ||
| 80 | ||
| 81 | /*------------------------------------------------- | |
| 82 | on_vblank - updates VBLANK based watchdog | |
| 83 | timers | |
| 84 | -------------------------------------------------*/ | |
| 85 | ||
| 86 | static void on_vblank(running_machine *machine, screen_state *screen, int vblank_state) | |
| 87 | { | |
| 88 | /* VBLANK starting */ | |
| 89 | if (vblank_state && watchdog_enabled) | |
| 90 | { | |
| 91 | /* check the watchdog */ | |
| 92 | if (machine->config->watchdog_vblank_count != 0 && --watchdog_counter == 0) | |
| 93 | watchdog_callback(machine, NULL, 0); | |
| 94 | } | |
| 95 | } | |
| 96 | ||
| 97 | ||
| 98 | /*------------------------------------------------- | |
| 99 | watchdog_reset - reset the watchdog timer | |
| 100 | -------------------------------------------------*/ | |
| 101 | ||
| 102 | void watchdog_reset(running_machine *machine) | |
| 103 | { | |
| 104 | /* if we're not enabled, skip it */ | |
| 105 | if (!watchdog_enabled) | |
| 106 | timer_adjust_oneshot(watchdog_timer, attotime_never, 0); | |
| 107 | ||
| 108 | /* VBLANK-based watchdog? */ | |
| 109 | else if (machine->config->watchdog_vblank_count != 0) | |
| 110 | { | |
| 111 | watchdog_counter = machine->config->watchdog_vblank_count; | |
| 112 | ||
| 113 | /* register a global VBLANK callback */ | |
| 114 | video_screen_register_vbl_cb(machine, NULL, on_vblank); | |
| 115 | } | |
| 116 | ||
| 117 | /* timer-based watchdog? */ | |
| 118 | else if (attotime_compare(machine->config->watchdog_time, attotime_zero) != 0) | |
| 119 | timer_adjust_oneshot(watchdog_timer, machine->config->watchdog_time, 0); | |
| 120 | ||
| 121 | /* default to an obscene amount of time (3 seconds) */ | |
| 122 | else | |
| 123 | timer_adjust_oneshot(watchdog_timer, ATTOTIME_IN_SEC(3), 0); | |
| 124 | } | |
| 125 | ||
| 126 | ||
| 127 | /*------------------------------------------------- | |
| 128 | watchdog_enable - reset the watchdog timer | |
| 129 | -------------------------------------------------*/ | |
| 130 | ||
| 131 | void watchdog_enable(running_machine *machine, int enable) | |
| 132 | { | |
| 133 | /* when re-enabled, we reset our state */ | |
| 134 | if (watchdog_enabled != enable) | |
| 135 | { | |
| 136 | watchdog_enabled = enable; | |
| 137 | watchdog_reset(machine); | |
| 138 | } | |
| 139 | } |
| r1877 | r1878 | |
|---|---|---|
| 76 | 76 | typedef struct _menu_state menu_state; |
| 77 | 77 | struct _menu_state |
| 78 | 78 | { |
| 79 | ui_menu_handler handler; /* handler callback */ | |
| 79 | ui_menu_handler_func handler; /* handler callback */ | |
| 80 | 80 | UINT32 state; /* state value */ |
| 81 | 81 | }; |
| 82 | 82 | |
| r1877 | r1878 | |
| 125 | 125 | |
| 126 | 126 | static dip_descriptor dip_switch_model[MAX_PHYSICAL_DIPS]; |
| 127 | 127 | |
| 128 | static | |
| 128 | static | |
| 129 | 129 | static render_texture *hilight_texture; |
| 130 | 130 | |
| 131 | 131 | static render_texture *arrow_texture; |
| r1877 | r1878 | |
| 174 | 174 | #endif /* MESS */ |
| 175 | 175 | |
| 176 | 176 | /* menu helpers */ |
| 177 | static void menu_render_triangle( | |
| 177 | static void menu_render_triangle( | |
| 178 | 178 | |
| 179 | 179 | static int input_menu_get_items(input_item_data *itemlist, int group); |
| 180 | 180 | static int input_menu_get_game_items(input_item_data *itemlist); |
| r1877 | r1878 | |
| 658 | 658 | stack |
| 659 | 659 | -------------------------------------------------*/ |
| 660 | 660 | |
| 661 | UINT32 ui_menu_stack_push(ui_menu_handler new_handler, UINT32 new_state) | |
| 661 | UINT32 ui_menu_stack_push(ui_menu_handler_func new_handler, UINT32 new_state) | |
| 662 | 662 | { |
| 663 | 663 | menu_state *state = &menu_stack[++menu_stack_index]; |
| 664 | 664 | assert(menu_stack_index < MENU_STACK_DEPTH); |
| r1877 | r1878 | |
| 1756 | 1756 | indicators |
| 1757 | 1757 | -------------------------------------------------*/ |
| 1758 | 1758 | |
| 1759 | static void menu_render_triangle( | |
| 1759 | static void menu_render_triangle( | |
| 1760 | 1760 | { |
| 1761 | 1761 | int halfwidth = dest->width / 2; |
| 1762 | 1762 | int height = dest->height; |
| r1877 | r1878 | |
| 1887 | 1887 | const char *name = input_port_name(in); |
| 1888 | 1888 | |
| 1889 | 1889 | /* add if we match the group and we have a valid name */ |
| 1890 | if (name != NULL && | |
| 1890 | if ((name != NULL) && (input_port_condition(in)) && | |
| 1891 | 1891 | #ifdef MESS |
| 1892 | 1892 | (in->category == 0 || input_category_active(in->category)) && |
| 1893 | 1893 | #endif /* MESS */ |
| r0 | r1878 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | watchdog.h | |
| 4 | ||
| 5 | Watchdog handling | |
| 6 | ||
| 7 | Copyright Nicola Salmoria and the MAME Team. | |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #pragma once | |
| 13 | ||
| 14 | #ifndef __WATCHDOG_H__ | |
| 15 | #define __WATCHDOG_H__ | |
| 16 | ||
| 17 | ||
| 18 | /* startup */ | |
| 19 | void watchdog_init(running_machine *machine); | |
| 20 | ||
| 21 | /* reset the watchdog */ | |
| 22 | void watchdog_reset(running_machine *machine); | |
| 23 | ||
| 24 | /* enable/disable the watchdog */ | |
| 25 | void watchdog_enable(running_machine *machine, int enable); | |
| 26 | ||
| 27 | ||
| 28 | #endif /* __WATCHDOG_H__ */ |
| r1877 | r1878 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| 12 | #include "osdepend.h" | |
| 13 | 12 | #include "driver.h" |
| 13 | #include "deprecat.h" | |
| 14 | 14 | #include "profiler.h" |
| 15 | 15 | #include "png.h" |
| 16 | 16 | #include "debugger.h" |
| 17 | #include "render.h" | |
| 18 | 17 | #include "rendutil.h" |
| 19 | 18 | #include "ui.h" |
| 20 | #include "deprecat.h" | |
| 21 | #include "video/vector.h" | |
| 22 | 19 | |
| 23 | 20 | #include "snap.lh" |
| 24 | 21 | |
| r1877 | r1878 | |
| 39 | 36 | ***************************************************************************/ |
| 40 | 37 | |
| 41 | 38 | #define SUBSECONDS_PER_SPEED_UPDATE (ATTOSECONDS_PER_SECOND / 4) |
| 42 | #define PAUSED_REFRESH_RATE 30 | |
| 39 | #define PAUSED_REFRESH_RATE (30) | |
| 40 | #define MAX_VBL_CB (10) | |
| 43 | 41 | |
| 44 | 42 | |
| 45 | 43 | |
| r1877 | r1878 | |
| 51 | 49 | struct _internal_screen_info |
| 52 | 50 | { |
| 53 | 51 | /* pointers to screen configuration and state */ |
| 54 | const screen_config * config; /* pointer to the configuration in the Machine->config */ | |
| 55 | screen_state * state; /* pointer to visible state in Machine structure */ | |
| 52 | int scrnum; /* the screen index */ | |
| 53 | const screen_config * config; /* pointer to the configuration in the Machine->config */ | |
| 54 | screen_state * state; /* pointer to visible state in Machine structure */ | |
| 56 | 55 | |
| 57 | 56 | /* textures and bitmaps */ |
| 58 | render_texture * texture[2]; /* 2x textures for the screen bitmap */ | |
| 59 | mame_bitmap * bitmap[2]; /* 2x bitmaps for rendering */ | |
| 60 | UINT8 curbitmap; /* current bitmap index */ | |
| 61 | UINT8 curtexture; /* current texture index */ | |
| 62 | bitmap_format format; /* format of bitmap for this screen */ | |
| 63 | UINT8 changed; /* has this bitmap changed? */ | |
| 64 | INT32 last_partial_scan; /* scanline of last partial update */ | |
| 57 | render_texture * texture[2]; /* 2x textures for the screen bitmap */ | |
| 58 | bitmap_t * bitmap[2]; /* 2x bitmaps for rendering */ | |
| 59 | UINT8 curbitmap; /* current bitmap index */ | |
| 60 | UINT8 curtexture; /* current texture index */ | |
| 61 | bitmap_format format; /* format of bitmap for this screen */ | |
| 62 | UINT8 changed; /* has this bitmap changed? */ | |
| 63 | INT32 last_partial_scan; /* scanline of last partial update */ | |
| 64 | UINT8 vblank_state; /* 1 = in VBLANK region, 0 = outside */ | |
| 65 | 65 | |
| 66 | 66 | /* screen timing */ |
| 67 | attoseconds_t scantime; /* attoseconds per scanline */ | |
| 68 | attoseconds_t pixeltime; /* attoseconds per pixel */ | |
| 69 | attotime vblank_time; /* time of last VBLANK start */ | |
| 70 | emu_timer * scanline0_timer; /* scanline 0 timer */ | |
| 71 | emu_timer * scanline_timer; /* scanline timer */ | |
| 67 | attoseconds_t scantime; /* attoseconds per scanline */ | |
| 68 | attoseconds_t pixeltime; /* attoseconds per pixel */ | |
| 69 | attotime vblank_time; /* time of last VBLANK start */ | |
| 70 | emu_timer * vblank_begin_timer; /* timer to signal VBLANK start */ | |
| 71 | emu_timer * vblank_end_timer; /* timer to signal VBLANK end */ | |
| 72 | emu_timer * scanline0_timer; /* scanline 0 timer */ | |
| 73 | emu_timer * scanline_timer; /* scanline timer */ | |
| 74 | UINT64 frame_number; /* the current frame number */ | |
| 72 | 75 | |
| 76 | /* VBLANK callbacks */ | |
| 77 | int vbl_cb_count; /* # of callbacks installed */ | |
| 78 | vblank_state_changed_func vbl_cbs[MAX_VBL_CB]; /* the array of callbacks */ | |
| 79 | ||
| 73 | 80 | /* movie recording */ |
| 74 | mame_file * movie_file; /* handle to the open movie file */ | |
| 75 | UINT32 movie_frame; /* current movie frame number */ | |
| 81 | mame_file * movie_file; /* handle to the open movie file */ | |
| 82 | UINT32 movie_frame; /* current movie frame number */ | |
| 76 | 83 | }; |
| 77 | 84 | |
| 78 | 85 | |
| 79 | 86 | struct _video_private |
| 80 | 87 | { |
| 81 | 88 | /* per-screen information */ |
| 82 | internal_screen_info scrinfo[MAX_SCREENS]; /* per-screen info | |
| 89 | internal_screen_info scrinfo[MAX_SCREENS]; /* per-screen info | |
| 83 | 90 | |
| 84 | 91 | /* snapshot stuff */ |
| 85 | 92 | render_target * snap_target; /* screen shapshot target */ |
| 86 | | |
| 93 | | |
| 87 | 94 | |
| 88 | 95 | /* crosshair bits */ |
| 89 | | |
| 96 | | |
| 90 | 97 | render_texture * crosshair_texture[MAX_PLAYERS]; /* crosshair texture per player */ |
| 91 | 98 | UINT8 crosshair_animate; /* animation frame index */ |
| 92 | 99 | UINT8 crosshair_visible; /* crosshair visible mask */ |
| r1877 | r1878 | |
| 177 | 184 | static void decode_graphics(running_machine *machine, const gfx_decode_entry *gfxdecodeinfo); |
| 178 | 185 | |
| 179 | 186 | /* global rendering */ |
| 187 | static TIMER_CALLBACK( vblank_begin_callback ); | |
| 188 | static TIMER_CALLBACK( vblank_end_callback ); | |
| 180 | 189 | static TIMER_CALLBACK( scanline0_callback ); |
| 181 | 190 | static TIMER_CALLBACK( scanline_update_callback ); |
| 182 | 191 | static int finish_screen_updates(running_machine *machine); |
| r1877 | r1878 | |
| 188 | 197 | static void recompute_speed(attotime emutime); |
| 189 | 198 | |
| 190 | 199 | /* screen snapshots */ |
| 191 | static | |
| 200 | static | |
| 192 | 201 | static file_error mame_fopen_next(const char *pathoption, const char *extension, mame_file **file); |
| 193 | 202 | |
| 194 | 203 | /* movie recording */ |
| r1877 | r1878 | |
| 306 | 315 | render_container *container = render_container_get_screen(scrnum); |
| 307 | 316 | internal_screen_info *info = &viddata->scrinfo[scrnum]; |
| 308 | 317 | |
| 318 | /* allocate the VBLANK timers */ | |
| 319 | info->vblank_begin_timer = timer_alloc(vblank_begin_callback, info); | |
| 320 | info->vblank_end_timer = timer_alloc(vblank_end_callback, info); | |
| 321 | ||
| 309 | 322 | /* allocate a timer to reset partial updates */ |
| 310 | 323 | info->scanline0_timer = timer_alloc(scanline0_callback, NULL); |
| 311 | 324 | |
| 312 | 325 | /* make pointers back to the config and state */ |
| 326 | info->scrnum = scrnum; | |
| 313 | 327 | info->config = device->inline_config; |
| 314 | 328 | info->state = &machine->screen[scrnum]; |
| 315 | 329 | |
| r1877 | r1878 | |
| 327 | 341 | render_container_set_yscale(container, info->config->yscale); |
| 328 | 342 | |
| 329 | 343 | /* reset VBLANK timing */ |
| 330 | info->vblank_time = attotime_ | |
| 344 | info->vblank_time = attotime_ | |
| 331 | 345 | |
| 332 | 346 | /* allocate a timer to generate per-scanline updates */ |
| 333 | 347 | if (machine->config->video_attributes & VIDEO_UPDATE_SCANLINE) |
| r1877 | r1878 | |
| 339 | 353 | /* register for save states */ |
| 340 | 354 | state_save_register_item("video", scrnum, info->vblank_time.seconds); |
| 341 | 355 | state_save_register_item("video", scrnum, info->vblank_time.attoseconds); |
| 356 | state_save_register_item("video", scrnum, info->frame_number); | |
| 342 | 357 | } |
| 343 | 358 | |
| 344 | 359 | /* create spriteram buffers if necessary */ |
| r1877 | r1878 | |
| 435 | 450 | |
| 436 | 451 | |
| 437 | 452 | /*------------------------------------------------- |
| 438 | video_vblank_start - called at the start of | |
| 439 | VBLANK, which is driven by the CPU scheduler | |
| 440 | -------------------------------------------------*/ | |
| 441 | ||
| 442 | void video_vblank_start(running_machine *machine) | |
| 443 | { | |
| 444 | video_private *viddata = machine->video_data; | |
| 445 | attotime curtime = timer_get_time(); | |
| 446 | int scrnum; | |
| 447 | ||
| 448 | /* kludge: we get called at time 0 to reset, but at that point, | |
| 449 | the time of last VBLANK is actually -vblank_duration */ | |
| 450 | if (curtime.seconds == 0 && curtime.attoseconds == 0) | |
| 451 | curtime = attotime_sub_attoseconds(attotime_zero, machine->screen[0].vblank); | |
| 452 | ||
| 453 | /* reset VBLANK timers for each screen -- fix me */ | |
| 454 | for (scrnum = 0; scrnum < MAX_SCREENS; scrnum++) | |
| 455 | viddata->scrinfo[scrnum].vblank_time = curtime; | |
| 456 | } | |
| 457 | ||
| 458 | ||
| 459 | /*------------------------------------------------- | |
| 460 | 453 | init_buffered_spriteram - initialize the |
| 461 | 454 | double-buffered spriteram |
| 462 | 455 | -------------------------------------------------*/ |
| r1877 | r1878 | |
| 766 | 759 | } |
| 767 | 760 | } |
| 768 | 761 | |
| 769 | /* recompute the VBLANK timing */ | |
| 770 | { | |
| 771 | extern void cpu_compute_vblank_timing(running_machine *machine); | |
| 772 | cpu_compute_vblank_timing(Machine); | |
| 773 | } | |
| 774 | ||
| 775 | 762 | /* if we are on scanline 0 already, reset the update timer immediately */ |
| 776 | 763 | /* otherwise, defer until the next scanline 0 */ |
| 777 | 764 | if (video_screen_get_vpos(scrnum) == 0) |
| 778 | 765 | timer_adjust_oneshot(info->scanline0_timer, attotime_zero, scrnum); |
| 779 | 766 | else |
| 780 | 767 | timer_adjust_oneshot(info->scanline0_timer, video_screen_get_time_until_pos(scrnum, 0, 0), scrnum); |
| 768 | ||
| 769 | /* start the VBLANK timer */ | |
| 770 | timer_adjust_oneshot(info->vblank_begin_timer, video_screen_get_time_until_vblank_start(scrnum), 0); | |
| 781 | 771 | } |
| 782 | 772 | |
| 783 | 773 | |
| r1877 | r1878 | |
| 974 | 964 | int video_screen_get_vblank(int scrnum) |
| 975 | 965 | { |
| 976 | 966 | internal_screen_info *info = get_screen_info(Machine, scrnum); |
| 977 | int vpos = video_screen_get_vpos(scrnum); | |
| 978 | return (vpos < info->state->visarea.min_y || vpos > info->state->visarea.max_y); | |
| 967 | return info->vblank_state; | |
| 979 | 968 | } |
| 980 | 969 | |
| 981 | 970 | |
| r1877 | r1878 | |
| 1023 | 1012 | |
| 1024 | 1013 | |
| 1025 | 1014 | /*------------------------------------------------- |
| 1015 | video_screen_get_time_until_vblank_start - | |
| 1016 | returns the amount of time remaining until | |
| 1017 | the next VBLANK period start | |
| 1018 | -------------------------------------------------*/ | |
| 1019 | ||
| 1020 | attotime video_screen_get_time_until_vblank_start(int scrnum) | |
| 1021 | { | |
| 1022 | return video_screen_get_time_until_pos(scrnum, Machine->screen[scrnum].visarea.max_y + 1, 0); | |
| 1023 | } | |
| 1024 | ||
| 1025 | ||
| 1026 | /*------------------------------------------------- | |
| 1027 | video_screen_get_time_until_vblank_end - | |
| 1028 | returns the amount of time remaining until | |
| 1029 | the end of the current VBLANK (if in progress) | |
| 1030 | or the end of the next VBLANK | |
| 1031 | -------------------------------------------------*/ | |
| 1032 | ||
| 1033 | attotime video_screen_get_time_until_vblank_end(int scrnum) | |
| 1034 | { | |
| 1035 | return video_screen_get_time_until_pos(scrnum, Machine->screen[scrnum].visarea.min_y, 0); | |
| 1036 | } | |
| 1037 | ||
| 1038 | ||
| 1039 | /*------------------------------------------------- | |
| 1040 | video_screen_get_time_until_update - | |
| 1041 | returns the amount of time remaining until | |
| 1042 | the next VBLANK period start | |
| 1043 | -------------------------------------------------*/ | |
| 1044 | ||
| 1045 | attotime video_screen_get_time_until_update(int scrnum) | |
| 1046 | { | |
| 1047 | if (Machine->config->video_attributes & VIDEO_UPDATE_AFTER_VBLANK) | |
| 1048 | return video_screen_get_time_until_vblank_end(scrnum); | |
| 1049 | else | |
| 1050 | return video_screen_get_time_until_vblank_start(scrnum); | |
| 1051 | } | |
| 1052 | ||
| 1053 | ||
| 1054 | /*------------------------------------------------- | |
| 1026 | 1055 | video_screen_get_scan_period - return the |
| 1027 | 1056 | amount of time the beam takes to draw one |
| 1028 | 1057 | scanline |
| r1877 | r1878 | |
| 1047 | 1076 | } |
| 1048 | 1077 | |
| 1049 | 1078 | |
| 1079 | /*------------------------------------------------- | |
| 1080 | video_screen_get_frame_number - return the | |
| 1081 | current frame number since the start of the | |
| 1082 | emulated machine | |
| 1083 | -------------------------------------------------*/ | |
| 1050 | 1084 | |
| 1085 | UINT64 video_screen_get_frame_number(int scrnum) | |
| 1086 | { | |
| 1087 | internal_screen_info *info = get_screen_info(Machine, scrnum); | |
| 1088 | return info->frame_number; | |
| 1089 | } | |
| 1090 | ||
| 1091 | ||
| 1092 | /*------------------------------------------------- | |
| 1093 | video_screen_register_vbl_cb - registers a | |
| 1094 | VBLANK callback | |
| 1095 | -------------------------------------------------*/ | |
| 1096 | ||
| 1097 | void video_screen_register_vbl_cb(running_machine *machine, void *screen, vblank_state_changed_func vbl_cb) | |
| 1098 | { | |
| 1099 | int i, found; | |
| 1100 | internal_screen_info *scrinfo = NULL; | |
| 1101 | ||
| 1102 | /* validate arguments */ | |
| 1103 | assert(machine != NULL); | |
| 1104 | assert(machine->config != NULL); | |
| 1105 | assert(machine->config->devicelist != NULL); | |
| 1106 | assert(machine->video_data != NULL); | |
| 1107 | assert(machine->video_data->scrinfo != NULL); | |
| 1108 | assert(vbl_cb != NULL); | |
| 1109 | ||
| 1110 | /* if the screen is NULL, grab the first screen -- we are installing a "global" handler */ | |
| 1111 | if (screen == NULL) | |
| 1112 | { | |
| 1113 | if (video_screen_count(machine->config) > 0) | |
| 1114 | { | |
| 1115 | const char *screen_tag = video_screen_first(machine->config)->tag; | |
| 1116 | screen = devtag_get_token(machine, VIDEO_SCREEN, screen_tag); | |
| 1117 | } | |
| 1118 | else | |
| 1119 | { | |
| 1120 | /* we need to do something for screenless games */ | |
| 1121 | assert(screen != NULL); | |
| 1122 | } | |
| 1123 | } | |
| 1124 | ||
| 1125 | /* find the screen info structure for the given token - there should only be one */ | |
| 1126 | for (i = 0; i < MAX_SCREENS; i++) | |
| 1127 | if (machine->video_data->scrinfo[i].state == screen) | |
| 1128 | scrinfo = machine->video_data->scrinfo + i; | |
| 1129 | ||
| 1130 | /* make sure we still have room for the callback */ | |
| 1131 | assert(scrinfo != NULL); | |
| 1132 | assert(scrinfo->vbl_cb_count != MAX_VBL_CB); | |
| 1133 | ||
| 1134 | /* check if we already have this callback registered */ | |
| 1135 | found = FALSE; | |
| 1136 | for (i = 0; i < scrinfo->vbl_cb_count; i++) | |
| 1137 | if (scrinfo->vbl_cbs[i] == vbl_cb) | |
| 1138 | found = TRUE; | |
| 1139 | ||
| 1140 | /* if not found, register and increment count */ | |
| 1141 | if (!found) | |
| 1142 | { | |
| 1143 | scrinfo->vbl_cbs[scrinfo->vbl_cb_count] = vbl_cb; | |
| 1144 | scrinfo->vbl_cb_count++; | |
| 1145 | } | |
| 1146 | } | |
| 1147 | ||
| 1148 | ||
| 1149 | ||
| 1051 | 1150 | /*************************************************************************** |
| 1052 | 1151 | VIDEO SCREEN DEVICE INTERFACE |
| 1053 | 1152 | ***************************************************************************/ |
| r1877 | r1878 | |
| 1057 | 1156 | for a video screen |
| 1058 | 1157 | -------------------------------------------------*/ |
| 1059 | 1158 | |
| 1060 | static | |
| 1159 | static DEVICE_START( | |
| 1061 | 1160 | { |
| 1062 | 1161 | int scrindex = device_list_index(machine->config->devicelist, VIDEO_SCREEN, tag); |
| 1063 | 1162 | return &machine->screen[scrindex]; |
| r1877 | r1878 | |
| 1069 | 1168 | callback |
| 1070 | 1169 | -------------------------------------------------*/ |
| 1071 | 1170 | |
| 1072 | static | |
| 1171 | static DEVICE_SET_INFO( video_screen | |
| 1073 | 1172 | { |
| 1074 | 1173 | switch (state) |
| 1075 | 1174 | { |
| r1877 | r1878 | |
| 1083 | 1182 | callback |
| 1084 | 1183 | -------------------------------------------------*/ |
| 1085 | 1184 | |
| 1086 | ||
| 1185 | DEVICE_GET_INFO( video_screen | |
| 1087 | 1186 | { |
| 1088 | 1187 | switch (state) |
| 1089 | 1188 | { |
| 1090 | 1189 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1091 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(screen_config); break; | |
| 1190 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(screen_config); break; | |
| 1191 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_VIDEO; break; | |
| 1092 | 1192 | |
| 1093 | 1193 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1094 | case DEVINFO_FCT_SET_INFO: info->set_info = video_screen_set_info;break; | |
| 1095 | case DEVINFO_FCT_START: info->start = video_screen_start; break; | |
| 1096 | case DEVINFO_FCT_STOP: /* Nothing */ break; | |
| 1097 | case DEVINFO_FCT_RESET: /* Nothing */ break; | |
| 1194 | case DEVINFO_FCT_SET_INFO: info->set_info = DEVICE_SET_INFO_NAME(video_screen); break; | |
| 1195 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(video_screen); break; | |
| 1196 | case DEVINFO_FCT_STOP: /* Nothing */ break; | |
| 1197 | case DEVINFO_FCT_RESET: /* Nothing */ break; | |
| 1098 | 1198 | |
| 1099 | 1199 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1100 | case DEVINFO_STR_NAME: info->s = "Raster"; break; | |
| 1101 | case DEVINFO_STR_FAMILY: info->s = "Video Screen"; break; | |
| 1102 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 1103 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 1104 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 1200 | case DEVINFO_STR_NAME: info->s = "Raster"; break; | |
| 1201 | case DEVINFO_STR_FAMILY: info->s = "Video Screen"; break; | |
| 1202 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 1203 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 1204 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 1105 | 1205 | } |
| 1106 | 1206 | } |
| 1107 | 1207 | |
| r1877 | r1878 | |
| 1112 | 1212 | ***************************************************************************/ |
| 1113 | 1213 | |
| 1114 | 1214 | /*------------------------------------------------- |
| 1215 | call_vb_callbacks - call any external VBLANK | |
| 1216 | callsbacks with the given state | |
| 1217 | -------------------------------------------------*/ | |
| 1218 | ||
| 1219 | static void call_vb_callbacks(running_machine *machine, internal_screen_info *scrinfo, int vblank_state) | |
| 1220 | { | |
| 1221 | int i; | |
| 1222 | ||
| 1223 | /* set it in the state structure */ | |
| 1224 | scrinfo->vblank_state = vblank_state; | |
| 1225 | ||
| 1226 | for (i = 0; i < scrinfo->vbl_cb_count; i++) | |
| 1227 | scrinfo->vbl_cbs[i](machine, scrinfo->state, vblank_state); | |
| 1228 | } | |
| 1229 | ||
| 1230 | ||
| 1231 | /*------------------------------------------------- | |
| 1232 | vblank_begin_callback - call any external | |
| 1233 | callbacks to signal the VBLANK period has begun | |
| 1234 | -------------------------------------------------*/ | |
| 1235 | ||
| 1236 | static TIMER_CALLBACK( vblank_begin_callback ) | |
| 1237 | { | |
| 1238 | attoseconds_t vblank_period; | |
| 1239 | internal_screen_info *scrinfo = ptr; | |
| 1240 | ||
| 1241 | /* reset the starting VBLANK time */ | |
| 1242 | scrinfo->vblank_time = timer_get_time(); | |
| 1243 | ||
| 1244 | /* call the external callbacks */ | |
| 1245 | call_vb_callbacks(machine, scrinfo, TRUE); | |
| 1246 | ||
| 1247 | /* do we update the screen now? - only do it for the first screen */ | |
| 1248 | if (!(machine->config->video_attributes & VIDEO_UPDATE_AFTER_VBLANK) && (scrinfo->scrnum == 0)) | |
| 1249 | video_frame_update(machine, FALSE); | |
| 1250 | ||
| 1251 | /* if there has been no VBLANK time specified in the MACHINE_DRIVER, compute it now | |
| 1252 | from the visible area, otherwise just used the supplied value */ | |
| 1253 | if ((scrinfo->state->vblank == 0) && !scrinfo->state->oldstyle_vblank_supplied) | |
| 1254 | vblank_period = (scrinfo->state->refresh / scrinfo->state->height) * (scrinfo->state->height - (scrinfo->state->visarea.max_y + 1 - scrinfo->state->visarea.min_y)); | |
| 1255 | else | |
| 1256 | vblank_period = scrinfo->state->vblank; | |
| 1257 | ||
| 1258 | /* reset the timers */ | |
| 1259 | timer_adjust_oneshot(scrinfo->vblank_begin_timer, attotime_make(0, scrinfo->state->refresh), 0); | |
| 1260 | timer_adjust_oneshot(scrinfo->vblank_end_timer, attotime_make(0, vblank_period), 0); | |
| 1261 | } | |
| 1262 | ||
| 1263 | ||
| 1264 | /*------------------------------------------------- | |
| 1265 | vblank_end_callback - call any external | |
| 1266 | callbacks to signal the VBLANK period has ended | |
| 1267 | -------------------------------------------------*/ | |
| 1268 | ||
| 1269 | static TIMER_CALLBACK( vblank_end_callback ) | |
| 1270 | { | |
| 1271 | internal_screen_info *scrinfo = ptr; | |
| 1272 | ||
| 1273 | /* update the first screen if we didn't before */ | |
| 1274 | if ((machine->config->video_attributes & VIDEO_UPDATE_AFTER_VBLANK) && (scrinfo->scrnum == 0)) | |
| 1275 | video_frame_update(machine, FALSE); | |
| 1276 | ||
| 1277 | /* let any external parties know that the VBLANK is over */ | |
| 1278 | call_vb_callbacks(machine, scrinfo, FALSE); | |
| 1279 | ||
| 1280 | /* increment the frame number counter */ | |
| 1281 | scrinfo->frame_number++; | |
| 1282 | } | |
| 1283 | ||
| 1284 | ||
| 1285 | /*------------------------------------------------- | |
| 1115 | 1286 | scanline0_callback - reset partial updates |
| 1116 | 1287 | for a screen |
| 1117 | 1288 | -------------------------------------------------*/ |
| r1877 | r1878 | |
| 1256 | 1427 | /* if we're not skipping the frame and if the screen actually changed, then update the texture */ |
| 1257 | 1428 | if (!global.skipping_this_frame && screen->changed) |
| 1258 | 1429 | { |
| 1259 | | |
| 1430 | | |
| 1260 | 1431 | rectangle fixedvis = machine->screen[scrnum].visarea; |
| 1261 | 1432 | fixedvis.max_x++; |
| 1262 | 1433 | fixedvis.max_y++; |
| r1877 | r1878 | |
| 1803 | 1974 | { |
| 1804 | 1975 | const rgb_t *palette = (machine->palette != NULL) ? palette_entry_list_adjusted(machine->palette) : NULL; |
| 1805 | 1976 | png_info pnginfo = { 0 }; |
| 1806 | | |
| 1977 | | |
| 1807 | 1978 | png_error error; |
| 1808 | 1979 | char text[256]; |
| 1809 | 1980 | |
| r1877 | r1878 | |
| 1857 | 2028 | given screen number |
| 1858 | 2029 | -------------------------------------------------*/ |
| 1859 | 2030 | |
| 1860 | static | |
| 2031 | static | |
| 1861 | 2032 | { |
| 1862 | 2033 | video_private *viddata = machine->video_data; |
| 1863 | 2034 | const render_primitive_list *primlist; |
| r1877 | r1878 | |
| 2008 | 2179 | if (info->movie_file != NULL) |
| 2009 | 2180 | { |
| 2010 | 2181 | png_info pnginfo = { 0 }; |
| 2011 | | |
| 2182 | | |
| 2012 | 2183 | png_error error; |
| 2013 | 2184 | |
| 2014 | 2185 | profiler_mark(PROFILER_MOVIE_REC); |
| r1877 | r1878 | |
|---|---|---|
| 32 | 32 | TYPE DEFINITIONS |
| 33 | 33 | ***************************************************************************/ |
| 34 | 34 | |
| 35 | typedef UINT32 (*ui_menu_handler)(UINT32 state); | |
| 35 | typedef UINT32 (*ui_menu_handler_func)(UINT32 state); | |
| 36 | 36 | |
| 37 | 37 | typedef struct _ui_menu_item ui_menu_item; |
| 38 | 38 | struct _ui_menu_item |
| r1877 | r1878 | |
| 73 | 73 | |
| 74 | 74 | /* menu stack management */ |
| 75 | 75 | void ui_menu_stack_reset(void); |
| 76 | UINT32 ui_menu_stack_push(ui_menu_handler new_handler, UINT32 new_state); | |
| 76 | UINT32 ui_menu_stack_push(ui_menu_handler_func new_handler, UINT32 new_state); | |
| 77 | 77 | UINT32 ui_menu_stack_pop(void); |
| 78 | 78 | |
| 79 | 79 | /* force game select menu */ |
| r1877 | r1878 | |
|---|---|---|
| 34 | 34 | ending with 'end' inclusive. An address hits in this bucket if the |
| 35 | 35 | 'address' >= 'start' and 'address' <= 'end'. |
| 36 | 36 | |
| 37 | AM_SPACE(match, mask) | |
| 38 | Specifies at the bit level (closer to real hardware) how to determine | |
| 39 | if an address matches a given bit pattern. An address hits in this | |
| 40 | bucket if 'address' & 'mask' == 'match' | |
| 41 | ||
| 42 | 37 | AM_MASK(mask) |
| 43 | 38 | Specifies a mask for the addresses in the current bucket. This mask |
| 44 | 39 | is applied after a positive hit in the bucket specified by AM_RANGE |
| 45 | 40 | or AM_SPACE, and is computed before accessing the RAM or calling |
| 46 | through to the read/write handler. If you use AM_SPACE, the mask | |
| 47 | is implicitly set equal to the logical NOT of the mask specified in | |
| 48 | the AM_SPACE macro. If you use AM_MIRROR, below, the mask is ANDed | |
| 49 | implicitly with the logical NOT of the mirror. The mask specified | |
| 50 | by this macro is ANDed against any implicit masks. | |
| 41 | through to the read/write handler. If you use AM_MIRROR, below, the | |
| 42 | mask is ANDed implicitly with the logical NOT of the mirror. The | |
| 43 | mask specified by this macro is ANDed against any implicit masks. | |
| 51 | 44 | |
| 52 | 45 | AM_MIRROR(mirror) |
| 53 | 46 | Specifies mirror addresses for the given bucket. The current bucket |
| r1877 | r1878 | |
| 171 | 164 | UINT8 cpunum; /* which CPU are we associated with? */ |
| 172 | 165 | UINT8 spacenum; /* which address space are we associated with? */ |
| 173 | 166 | UINT8 isallocated; /* did we allocate this ourselves? */ |
| 174 | offs_t start, end; /* start/end | |
| 167 | offs_t start, end; /* start/end | |
| 175 | 168 | UINT8 * data; /* pointer to the data for this block */ |
| 176 | 169 | }; |
| 177 | 170 | |
| r1877 | r1878 | |
| 206 | 199 | offs_t offset; /* base offset for handler */ |
| 207 | 200 | offs_t top; /* maximum offset for handler */ |
| 208 | 201 | offs_t mask; /* mask against the final address */ |
| 202 | void * object; /* object associated with the handler */ | |
| 209 | 203 | const char * name; /* name of the handler */ |
| 210 | 204 | }; |
| 211 | 205 | |
| r1877 | r1878 | |
| 247 | 241 | typedef struct _cpu_data cpu_data; |
| 248 | 242 | struct _cpu_data |
| 249 | 243 | { |
| 250 | opbase_handler opbase; /* opcode base handler */ | |
| 244 | opbase_handler_func opbase; /* opcode base handler */ | |
| 251 | 245 | |
| 252 | 246 | void * op_ram; /* dynamic RAM base pointer */ |
| 253 | 247 | void * op_rom; /* dynamic ROM base pointer */ |
| r1877 | r1878 | |
| 283 | 277 | |
| 284 | 278 | static int cur_context; /* current CPU context */ |
| 285 | 279 | |
| 286 | static opbase_handler opbasefunc; /* opcode base override */ | |
| 280 | static opbase_handler_func opbasefunc; /* opcode base override */ | |
| 287 | 281 | |
| 288 | 282 | static int debugger_access; /* treat accesses as coming from the debugger */ |
| 289 | 283 | static int log_unmap[ADDRESS_SPACES]; /* log unmapped memory accesses */ |
| r1877 | r1878 | |
| 292 | 286 | static bank_data bankdata[STATIC_COUNT]; /* data gathered for each bank */ |
| 293 | 287 | |
| 294 | 288 | #ifdef ENABLE_DEBUGGER |
| 295 | static debug_hook_read_ptr debug_hook_read; /* pointer to debugger callback for memory reads */ | |
| 296 | static debug_hook_write_ptr debug_hook_write; /* pointer to debugger callback for memory writes */ | |
| 289 | static debug_hook_read_func debug_hook_read; /* pointer to debugger callback for memory reads */ | |
| 290 | static debug_hook_write_func debug_hook_write; /* pointer to debugger callback for memory writes */ | |
| 297 | 291 | #endif |
| 298 | 292 | |
| 299 | 293 | static const data_accessors memory_accessors[ADDRESS_SPACES][4][2] = |
| r1877 | r1878 | |
| 381 | 375 | static void init_addrspace(UINT8 cpunum, UINT8 spacenum); |
| 382 | 376 | static void preflight_memory(void); |
| 383 | 377 | static void populate_memory(void); |
| 384 | static void install_mem_handler_private(addrspace_data *space, int iswrite, int databits, int ismatchmask, offs_t start, offs_t end, offs_t mask, offs_t mirror, genf *handler, int isfixed, const char *handler_name); | |
| 385 | static void install_mem_handler(addrspace_data *space, int iswrite, int databits, int ismatchmask, offs_t start, offs_t end, offs_t mask, offs_t mirror, genf *handler, int isfixed, const char *handler_name); | |
| 378 | static void install_mem_handler_private(addrspace_data *space, int iswrite, int databits, offs_t start, offs_t end, offs_t mask, offs_t mirror, genf *handler, int isfixed, void *object, const char *handler_name); | |
| 379 | static void install_mem_handler(addrspace_data *space, int iswrite, int databits, offs_t start, offs_t end, offs_t mask, offs_t mirror, genf *handler, int isfixed, void *object, const char *handler_name); | |
| 386 | 380 | static genf *assign_dynamic_bank(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mirror, int isfixed, int ismasked); |
| 387 | static UINT8 get_handler_index(handler_data *table, genf *handler, const char *handler_name, offs_t start, offs_t end, offs_t mask); | |
| 381 | static UINT8 get_handler_index(handler_data *table, void *object, genf *handler, const char *handler_name, offs_t start, offs_t end, offs_t mask); | |
| 388 | 382 | static void populate_table_range(addrspace_data *space, int iswrite, offs_t start, offs_t stop, UINT8 handler); |
| 389 | static void populate_table_match(addrspace_data *space, int iswrite, offs_t matchval, offs_t matchmask, UINT8 handler); | |
| 390 | 383 | static UINT8 allocate_subtable(table_data *tabledata); |
| 391 | 384 | static void reallocate_subtable(table_data *tabledata, UINT8 subentry); |
| 392 | 385 | static int merge_subtables(table_data *tabledata); |
| r1877 | r1878 | |
| 568 | 561 | memory base |
| 569 | 562 | -------------------------------------------------*/ |
| 570 | 563 | |
| 571 | opbase_handler memory_set_opbase_handler(int cpunum, opbase_handler function) | |
| 564 | opbase_handler_func memory_set_opbase_handler(int cpunum, opbase_handler_func function) | |
| 572 | 565 | { |
| 573 | opbase_handler old = cpudata[cpunum].opbase; | |
| 566 | opbase_handler_func old = cpudata[cpunum].opbase; | |
| 574 | 567 | cpudata[cpunum].opbase = function; |
| 575 | 568 | if (cpunum == cpu_getactivecpu()) |
| 576 | 569 | opbasefunc = function; |
| r1877 | r1878 | |
| 592 | 585 | /* allow overrides */ |
| 593 | 586 | if (opbasefunc != NULL) |
| 594 | 587 | { |
| 595 | pc = (*opbasefunc)(pc); | |
| 588 | pc = (*opbasefunc)(Machine, pc); | |
| 596 | 589 | if (pc == ~0) |
| 597 | 590 | return; |
| 598 | 591 | } |
| r1877 | r1878 | |
| 751 | 744 | UINT8 saved_opcode_entry = opcode_entry; |
| 752 | 745 | |
| 753 | 746 | /* query the handler */ |
| 754 | offs_t new_offset = (*cpudata[cpunum].opbase)(offset); | |
| 747 | offs_t new_offset = (*cpudata[cpunum].opbase)(Machine, offset); | |
| 755 | 748 | |
| 756 | 749 | /* if it returns ~0, we use whatever data the handler set */ |
| 757 | 750 | if (new_offset == ~0) |
| r1877 | r1878 | |
| 952 | 945 | void *_memory_install_read_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, FPTR handler, const char *handler_name) |
| 953 | 946 | { |
| 954 | 947 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 955 | if (handler | |
| 948 | if (handler | |
| 956 | 949 | fatalerror("fatal: can only use static banks with memory_install_read_handler()"); |
| 957 | install_mem_handler(space, 0, space->dbits, | |
| 950 | install_mem_handler(space, 0, space->dbits, | |
| 958 | 951 | mem_dump(); |
| 959 | 952 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, start)); |
| 960 | 953 | } |
| 961 | 954 | |
| 962 | UINT8 *_memory_install_read8_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_ | |
| 955 | UINT8 *_memory_install_read8_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_machin | |
| 963 | 956 | { |
| 964 | 957 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 965 | install_mem_handler(space, 0, 8, | |
| 958 | install_mem_handler(space, 0, 8, | |
| 966 | 959 | mem_dump(); |
| 967 | 960 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, start)); |
| 968 | 961 | } |
| 969 | 962 | |
| 970 | UINT16 *_memory_install_read16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_ | |
| 963 | UINT16 *_memory_install_read16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_machin | |
| 971 | 964 | { |
| 972 | 965 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 973 | install_mem_handler(space, 0, 16, | |
| 966 | install_mem_handler(space, 0, 16, | |
| 974 | 967 | mem_dump(); |
| 975 | 968 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, start)); |
| 976 | 969 | } |
| 977 | 970 | |
| 978 | UINT32 *_memory_install_read32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read32_ | |
| 971 | UINT32 *_memory_install_read32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read32_machin | |
| 979 | 972 | { |
| 980 | 973 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 981 | install_mem_handler(space, 0, 32, | |
| 974 | install_mem_handler(space, 0, 32, | |
| 982 | 975 | mem_dump(); |
| 983 | 976 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, start)); |
| 984 | 977 | } |
| 985 | 978 | |
| 986 | UINT64 *_memory_install_read64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read64_ | |
| 979 | UINT64 *_memory_install_read64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read64_machin | |
| 987 | 980 | { |
| 988 | 981 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 989 | install_mem_handler(space, 0, 64, | |
| 982 | install_mem_handler(space, 0, 64, | |
| 990 | 983 | mem_dump(); |
| 991 | 984 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, start)); |
| 992 | 985 | } |
| r1877 | r1878 | |
| 1000 | 993 | void *_memory_install_write_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, FPTR handler, const char *handler_name) |
| 1001 | 994 | { |
| 1002 | 995 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1003 | if (handler | |
| 996 | if (handler | |
| 1004 | 997 | fatalerror("fatal: can only use static banks with memory_install_write_handler()"); |
| 1005 | install_mem_handler(space, 1, space->dbits, | |
| 998 | install_mem_handler(space, 1, space->dbits, | |
| 1006 | 999 | mem_dump(); |
| 1007 | 1000 | return memory_find_base(cpunum, spacenum, 1, SPACE_SHIFT(space, start)); |
| 1008 | 1001 | } |
| 1009 | 1002 | |
| 1010 | UINT8 *_memory_install_write8_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write8_ | |
| 1003 | UINT8 *_memory_install_write8_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write8_machin | |
| 1011 | 1004 | { |
| 1012 | 1005 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1013 | install_mem_handler(space, 1, 8, | |
| 1006 | install_mem_handler(space, 1, 8, | |
| 1014 | 1007 | mem_dump(); |
| 1015 | 1008 | return memory_find_base(cpunum, spacenum, 1, SPACE_SHIFT(space, start)); |
| 1016 | 1009 | } |
| 1017 | 1010 | |
| 1018 | UINT16 *_memory_install_write16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write16_ | |
| 1011 | UINT16 *_memory_install_write16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write16_machin | |
| 1019 | 1012 | { |
| 1020 | 1013 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1021 | install_mem_handler(space, 1, 16, | |
| 1014 | install_mem_handler(space, 1, 16, | |
| 1022 | 1015 | mem_dump(); |
| 1023 | 1016 | return memory_find_base(cpunum, spacenum, 1, SPACE_SHIFT(space, start)); |
| 1024 | 1017 | } |
| 1025 | 1018 | |
| 1026 | UINT32 *_memory_install_write32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write32_ | |
| 1019 | UINT32 *_memory_install_write32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write32_machin | |
| 1027 | 1020 | { |
| 1028 | 1021 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1029 | install_mem_handler(space, 1, 32, | |
| 1022 | install_mem_handler(space, 1, 32, | |
| 1030 | 1023 | mem_dump(); |
| 1031 | 1024 | return memory_find_base(cpunum, spacenum, 1, SPACE_SHIFT(space, start)); |
| 1032 | 1025 | } |
| 1033 | 1026 | |
| 1034 | UINT64 *_memory_install_write64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write64_ | |
| 1027 | UINT64 *_memory_install_write64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write64_machin | |
| 1035 | 1028 | { |
| 1036 | 1029 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1037 | install_mem_handler(space, 1, 64, | |
| 1030 | install_mem_handler(space, 1, 64, | |
| 1038 | 1031 | mem_dump(); |
| 1039 | 1032 | return memory_find_base(cpunum, spacenum, 1, SPACE_SHIFT(space, start)); |
| 1040 | 1033 | } |
| r1877 | r1878 | |
| 1048 | 1041 | void *_memory_install_readwrite_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name) |
| 1049 | 1042 | { |
| 1050 | 1043 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1051 | if (rhandler | |
| 1044 | if (rhandler | |
| 1052 | 1045 | fatalerror("fatal: can only use static banks with memory_install_readwrite_handler()"); |
| 1053 | install_mem_handler(space, 0, space->dbits, 0, start, end, mask, mirror, (genf *)(FPTR)rhandler, 0, rhandler_name); | |
| 1054 | install_mem_handler(space, 1, space->dbits, 0, start, end, mask, mirror, (genf *)(FPTR)whandler, 0, whandler_name); | |
| 1046 | install_mem_handler(space, 0, space->dbits, start, end, mask, mirror, (genf *)(FPTR)rhandler, 0, Machine, rhandler_name); | |
| 1047 | install_mem_handler(space, 1, space->dbits, start, end, mask, mirror, (genf *)(FPTR)whandler, 0, Machine, whandler_name); | |
| 1055 | 1048 | mem_dump(); |
| 1056 | 1049 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, start)); |
| 1057 | 1050 | } |
| 1058 | 1051 | |
| 1059 | UINT8 *_memory_install_readwrite8_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_ | |
| 1052 | UINT8 *_memory_install_readwrite8_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_machin | |
| 1060 | 1053 | { |
| 1061 | 1054 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1062 | install_mem_handler(space, 0, 8, 0, start, end, mask, mirror, (genf *)rhandler, 0, rhandler_name); | |
| 1063 | install_mem_handler(space, 1, 8, 0, start, end, mask, mirror, (genf *)whandler, 0, whandler_name); | |
| 1055 | install_mem_handler(space, 0, 8, start, end, mask, mirror, (genf *)rhandler, 0, Machine, rhandler_name); | |
| 1056 | install_mem_handler(space, 1, 8, start, end, mask, mirror, (genf *)whandler, 0, Machine, whandler_name); | |
| 1064 | 1057 | mem_dump(); |
| 1065 | 1058 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, start)); |
| 1066 | 1059 | } |
| 1067 | 1060 | |
| 1068 | UINT16 *_memory_install_readwrite16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_ | |
| 1061 | UINT16 *_memory_install_readwrite16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_machin | |
| 1069 | 1062 | { |
| 1070 | 1063 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1071 | install_mem_handler(space, 0, 16, 0, start, end, mask, mirror, (genf *)rhandler, 0, rhandler_name); | |
| 1072 | install_mem_handler(space, 1, 16, 0, start, end, mask, mirror, (genf *)whandler, 0, whandler_name); | |
| 1064 | install_mem_handler(space, 0, 16, start, end, mask, mirror, (genf *)rhandler, 0, Machine, rhandler_name); | |
| 1065 | install_mem_handler(space, 1, 16, start, end, mask, mirror, (genf *)whandler, 0, Machine, whandler_name); | |
| 1073 | 1066 | mem_dump(); |
| 1074 | 1067 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, start)); |
| 1075 | 1068 | } |
| 1076 | 1069 | |
| 1077 | UINT32 *_memory_install_readwrite32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read32_ | |
| 1070 | UINT32 *_memory_install_readwrite32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read32_machin | |
| 1078 | 1071 | { |
| 1079 | 1072 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1080 | install_mem_handler(space, 0, 32, 0, start, end, mask, mirror, (genf *)rhandler, 0, rhandler_name); | |
| 1081 | install_mem_handler(space, 1, 32, 0, start, end, mask, mirror, (genf *)whandler, 0, whandler_name); | |
| 1073 | install_mem_handler(space, 0, 32, start, end, mask, mirror, (genf *)rhandler, 0, Machine, rhandler_name); | |
| 1074 | install_mem_handler(space, 1, 32, start, end, mask, mirror, (genf *)whandler, 0, Machine, whandler_name); | |
| 1082 | 1075 | mem_dump(); |
| 1083 | 1076 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, start)); |
| 1084 | 1077 | } |
| 1085 | 1078 | |
| 1086 | UINT64 *_memory_install_readwrite64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read64_ | |
| 1079 | UINT64 *_memory_install_readwrite64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read64_machin | |
| 1087 | 1080 | { |
| 1088 | 1081 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; |
| 1089 | install_mem_handler(space, 0, 64, 0, start, end, mask, mirror, (genf *)rhandler, 0, rhandler_name); | |
| 1090 | install_mem_handler(space, 1, 64, 0, start, end, mask, mirror, (genf *)whandler, 0, whandler_name); | |
| 1082 | install_mem_handler(space, 0, 64, start, end, mask, mirror, (genf *)rhandler, 0, Machine, rhandler_name); | |
| 1083 | install_mem_handler(space, 1, 64, start, end, mask, mirror, (genf *)whandler, 0, Machine, whandler_name); | |
| 1091 | 1084 | mem_dump(); |
| 1092 | 1085 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, start)); |
| 1093 | 1086 | } |
| 1094 | 1087 | |
| 1095 | 1088 | |
| 1096 | 1089 | /*------------------------------------------------- |
| 1097 | memory_install_readX_matchmask_handler - | |
| 1098 | install dynamic match/mask read handler for | |
| 1099 | X-bit case | |
| 1100 | -------------------------------------------------*/ | |
| 1101 | ||
| 1102 | void *_memory_install_read_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, FPTR handler, const char *handler_name) | |
| 1103 | { | |
| 1104 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1105 | if (handler < 0 || handler >= STATIC_COUNT) | |
| 1106 | fatalerror("fatal: can only use static banks with memory_install_read_matchmask_handler()"); | |
| 1107 | install_mem_handler(space, 0, space->dbits, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); | |
| 1108 | mem_dump(); | |
| 1109 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, matchval)); | |
| 1110 | } | |
| 1111 | ||
| 1112 | UINT8 *_memory_install_read8_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read8_handler handler, const char *handler_name) | |
| 1113 | { | |
| 1114 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1115 | install_mem_handler(space, 0, 8, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); | |
| 1116 | mem_dump(); | |
| 1117 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, matchval)); | |
| 1118 | } | |
| 1119 | ||
| 1120 | UINT16 *_memory_install_read16_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read16_handler handler, const char *handler_name) | |
| 1121 | { | |
| 1122 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1123 | install_mem_handler(space, 0, 16, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); | |
| 1124 | mem_dump(); | |
| 1125 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, matchval)); | |
| 1126 | } | |
| 1127 | ||
| 1128 | UINT32 *_memory_install_read32_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read32_handler handler, const char *handler_name) | |
| 1129 | { | |
| 1130 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1131 | install_mem_handler(space, 0, 32, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); | |
| 1132 | mem_dump(); | |
| 1133 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, matchval)); | |
| 1134 | } | |
| 1135 | ||
| 1136 | UINT64 *_memory_install_read64_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read64_handler handler, const char *handler_name) | |
| 1137 | { | |
| 1138 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1139 | install_mem_handler(space, 0, 64, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); | |
| 1140 | mem_dump(); | |
| 1141 | return memory_find_base(cpunum, spacenum, 0, SPACE_SHIFT(space, matchval)); | |
| 1142 | } | |
| 1143 | ||
| 1144 | ||
| 1145 | /*------------------------------------------------- | |
| 1146 | memory_install_writeX_matchmask_handler - | |
| 1147 | install dynamic match/mask write handler for | |
| 1148 | X-bit case | |
| 1149 | -------------------------------------------------*/ | |
| 1150 | ||
| 1151 | void *_memory_install_write_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, FPTR handler, const char *handler_name) | |
| 1152 | { | |
| 1153 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1154 | if (handler < 0 || handler >= STATIC_COUNT) | |
| 1155 | fatalerror("fatal: can only use static banks with memory_install_write_matchmask_handler()"); | |
| 1156 | install_mem_handler(space, 1, space->dbits, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); | |
| 1157 | mem_dump(); | |
| 1158 | return memory_find_base(cpunum, spacenum, 1, SPACE_SHIFT(space, matchval)); | |
| 1159 | } | |
| 1160 | ||
| 1161 | UINT8 *_memory_install_write8_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write8_handler handler, const char *handler_name) | |
| 1162 | { | |
| 1163 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1164 | install_mem_handler(space, 1, 8, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); | |
| 1165 | mem_dump(); | |
| 1166 | return memory_find_base(cpunum, spacenum, 1, SPACE_SHIFT(space, matchval)); | |
| 1167 | } | |
| 1168 | ||
| 1169 | UINT16 *_memory_install_write16_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write16_handler handler, const char *handler_name) | |
| 1170 | { | |
| 1171 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1172 | install_mem_handler(space, 1, 16, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); | |
| 1173 | mem_dump(); | |
| 1174 | return memory_find_base(cpunum, spacenum, 1, SPACE_SHIFT(space, matchval)); | |
| 1175 | } | |
| 1176 | ||
| 1177 | UINT32 *_memory_install_write32_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write32_handler handler, const char *handler_name) | |
| 1178 | { | |
| 1179 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1180 | install_mem_handler(space, 1, 32, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); | |
| 1181 | mem_dump(); | |
| 1182 | return memory_find_base(cpunum, spacenum, 1, SPACE_SHIFT(space, matchval)); | |
| 1183 | } | |
| 1184 | ||
| 1185 | UINT64 *_memory_install_write64_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write64_handler handler, const char *handler_name) | |
| 1186 | { | |
| 1187 | addrspace_data *space = &cpudata[cpunum].space[spacenum]; | |
| 1188 | install_mem_handler(space, 1, 64, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); | |
| 1189 | mem_dump(); | |
| 1190 | return memory_find_base(cpunum, spacenum, 1, SPACE_SHIFT(space, matchval)); | |
| 1191 | } | |
| 1192 | ||
| 1193 | ||
| 1194 | /*------------------------------------------------- | |
| 1195 | 1090 | construct_address_map - build address map |
| 1196 | 1091 | -------------------------------------------------*/ |
| 1197 | 1092 | |
| r1877 | r1878 | |
| 1204 | 1099 | |
| 1205 | 1100 | /* start by constructing the internal CPU map */ |
| 1206 | 1101 | if (internal_map) |
| 1207 | map = (*internal_map)(map); | |
| 1102 | map = (*internal_map)(Machine, map); | |
| 1208 | 1103 | |
| 1209 | 1104 | /* construct the standard map */ |
| 1210 | 1105 | if (drv->cpu[cpunum].construct_map[spacenum][0]) |
| 1211 | map = (*drv->cpu[cpunum].construct_map[spacenum][0])(map); | |
| 1106 | map = (*drv->cpu[cpunum].construct_map[spacenum][0])(Machine, map); | |
| 1212 | 1107 | if (drv->cpu[cpunum].construct_map[spacenum][1]) |
| 1213 | map = (*drv->cpu[cpunum].construct_map[spacenum][1])(map); | |
| 1108 | map = (*drv->cpu[cpunum].construct_map[spacenum][1])(Machine, map); | |
| 1214 | 1109 | } |
| 1215 | 1110 | |
| 1216 | 1111 | |
| r1877 | r1878 | |
| 1250 | 1145 | given address space in a standard fashion |
| 1251 | 1146 | -------------------------------------------------*/ |
| 1252 | 1147 | |
| 1253 | INLINE void adjust_addresses(addrspace_data *space, | |
| 1148 | INLINE void adjust_addresses(addrspace_data *space, | |
| 1254 | 1149 | { |
| 1255 | 1150 | /* adjust start/end/mask values */ |
| 1256 | 1151 | if (*mask == 0) |
| r1877 | r1878 | |
| 1263 | 1158 | /* adjust to byte values */ |
| 1264 | 1159 | *mask = SPACE_SHIFT(space, *mask); |
| 1265 | 1160 | *start = SPACE_SHIFT(space, *start); |
| 1266 | *end = | |
| 1161 | *end = | |
| 1267 | 1162 | *mirror = SPACE_SHIFT(space, *mirror); |
| 1268 | 1163 | } |
| 1269 | 1164 | |
| r1877 | r1878 | |
| 1335 | 1230 | memcpy(space->adjmap, space->map, sizeof(space->map[0]) * MAX_ADDRESS_MAP_SIZE * 2); |
| 1336 | 1231 | for (map = space->adjmap; !IS_AMENTRY_END(map); map++) |
| 1337 | 1232 | if (!IS_AMENTRY_EXTENDED(map)) |
| 1338 | adjust_addresses(space, | |
| 1233 | adjust_addresses(space, | |
| 1339 | 1234 | |
| 1340 | 1235 | /* validate adjusted addresses against implicit regions */ |
| 1341 | 1236 | for (map = space->adjmap; !IS_AMENTRY_END(map); map++) |
| r1877 | r1878 | |
| 1503 | 1398 | for (map--; map >= space->map; map--) |
| 1504 | 1399 | if (!IS_AMENTRY_EXTENDED(map)) |
| 1505 | 1400 | { |
| 1506 | int ismatchmask = ((map->flags & AM_FLAGS_MATCH_MASK) != 0); | |
| 1507 | 1401 | int isfixed = (map->memory != NULL) || (map->share != 0); |
| 1402 | ||
| 1508 | 1403 | if (map->read.handler != NULL) |
| 1509 | install_mem_handler_private(space, 0, space->dbits, ismatchmask, map->start, map->end, map->mask, map->mirror, map->read.handler, isfixed, map->read_name); | |
| 1404 | { | |
| 1405 | void *object = Machine; | |
| 1406 | if (map->read_devtype != NULL) | |
| 1407 | { | |
| 1408 | object = (void *)device_list_find_by_tag(Machine->config->devicelist, map->read_devtype, map->read_devtag); | |
| 1409 | if (object == NULL) | |
| 1410 | fatalerror("Unidentified object in memory map: type=%s tag=%s\n", devtype_name(map->read_devtype), map->read_devtag); | |
| 1411 | } | |
| 1412 | install_mem_handler_private(space, 0, space->dbits, map->start, map->end, map->mask, map->mirror, map->read.handler, isfixed, object, map->read_name); | |
| 1413 | } | |
| 1510 | 1414 | if (map->write.handler != NULL) |
| 1511 | install_mem_handler_private(space, 1, space->dbits, ismatchmask, map->start, map->end, map->mask, map->mirror, map->write.handler, isfixed, map->write_name); | |
| 1415 | { | |
| 1416 | void *object = Machine; | |
| 1417 | if (map->write_devtype != NULL) | |
| 1418 | { | |
| 1419 | object = (void *)device_list_find_by_tag(Machine->config->devicelist, map->write_devtype, map->write_devtag); | |
| 1420 | if (object == NULL) | |
| 1421 | fatalerror("Unidentified object in memory map: type=%s tag=%s\n", devtype_name(map->write_devtype), map->write_devtag); | |
| 1422 | } | |
| 1423 | install_mem_handler_private(space, 1, space->dbits, map->start, map->end, map->mask, map->mirror, map->write.handler, isfixed, object, map->write_name); | |
| 1424 | } | |
| 1512 | 1425 | } |
| 1513 | 1426 | } |
| 1514 | 1427 | } |
| r1877 | r1878 | |
| 1522 | 1435 | banks to dynamically assigned banks |
| 1523 | 1436 | -------------------------------------------------*/ |
| 1524 | 1437 | |
| 1525 | static void install_mem_handler_private(addrspace_data *space, int iswrite, int databits, | |
| 1438 | static void install_mem_handler_private(addrspace_data *space, int iswrite, int databits, | |
| 1526 | 1439 | { |
| 1527 | 1440 | /* translate ROM to RAM/UNMAP here */ |
| 1528 | 1441 | if (HANDLER_IS_ROM(handler)) |
| r1877 | r1878 | |
| 1538 | 1451 | offs_t temp_mirror = mirror; |
| 1539 | 1452 | |
| 1540 | 1453 | /* adjust the incoming addresses (temporarily) */ |
| 1541 | adjust_addresses(space, | |
| 1454 | adjust_addresses(space, | |
| 1542 | 1455 | |
| 1543 | 1456 | /* assign a bank to the adjusted addresses */ |
| 1544 | 1457 | handler = (genf *)assign_dynamic_bank(space->cpunum, space->spacenum, temp_start, temp_end, temp_mirror, isfixed, ismasked); |
| r1877 | r1878 | |
| 1547 | 1460 | } |
| 1548 | 1461 | |
| 1549 | 1462 | /* then do a normal installation */ |
| 1550 | install_mem_handler(space, iswrite, databits, | |
| 1463 | install_mem_handler(space, iswrite, databits, | |
| 1551 | 1464 | } |
| 1552 | 1465 | |
| 1553 | 1466 | |
| r1877 | r1878 | |
| 1556 | 1469 | memory operations |
| 1557 | 1470 | -------------------------------------------------*/ |
| 1558 | 1471 | |
| 1559 | static void install_mem_handler(addrspace_data *space, int iswrite, int databits, | |
| 1472 | static void install_mem_handler(addrspace_data *space, int iswrite, int databits, | |
| 1560 | 1473 | { |
| 1561 | 1474 | offs_t lmirrorbit[LEVEL2_BITS], lmirrorbits, hmirrorbit[32 - LEVEL2_BITS], hmirrorbits, lmirrorcount, hmirrorcount; |
| 1562 | 1475 | table_data *tabledata = iswrite ? &space->write : &space->read; |
| r1877 | r1878 | |
| 1597 | 1510 | } |
| 1598 | 1511 | |
| 1599 | 1512 | /* adjust the incoming addresses */ |
| 1600 | adjust_addresses(space, | |
| 1513 | adjust_addresses(space, | |
| 1601 | 1514 | |
| 1602 | 1515 | /* if this ended up a bank handler, tag it for reads or writes */ |
| 1603 | 1516 | if (HANDLER_IS_BANK(handler)) |
| r1877 | r1878 | |
| 1621 | 1534 | hmirrorbit[hmirrorbits++] = 1 << i; |
| 1622 | 1535 | |
| 1623 | 1536 | /* get the final handler index */ |
| 1624 | idx = get_handler_index(tabledata->handlers, handler, handler_name, start, end, mask); | |
| 1537 | idx = get_handler_index(tabledata->handlers, object, handler, handler_name, start, end, mask); | |
| 1625 | 1538 | |
| 1626 | 1539 | /* loop over mirrors in the level 2 table */ |
| 1627 | 1540 | for (hmirrorcount = 0; hmirrorcount < (1 << hmirrorbits); hmirrorcount++) |
| r1877 | r1878 | |
| 1668 | 1581 | lmirrorbase |= lmirrorbit[i]; |
| 1669 | 1582 | |
| 1670 | 1583 | /* populate the tables */ |
| 1671 | if (!ismatchmask) | |
| 1672 | populate_table_range(space, iswrite, start + lmirrorbase, end + lmirrorbase, idx); | |
| 1673 | else | |
| 1674 | populate_table_match(space, iswrite, start + lmirrorbase, end + lmirrorbase, idx); | |
| 1584 | populate_table_range(space, iswrite, start + lmirrorbase, end + lmirrorbase, idx); | |
| 1675 | 1585 | } |
| 1676 | 1586 | } |
| 1677 | 1587 | |
| r1877 | r1878 | |
| 1715 | 1625 | handler, or allocates a new one as necessary |
| 1716 | 1626 | -------------------------------------------------*/ |
| 1717 | 1627 | |
| 1718 | static UINT8 get_handler_index(handler_data *table, genf *handler, const char *handler_name, offs_t start, offs_t end, offs_t mask) | |
| 1628 | static UINT8 get_handler_index(handler_data *table, void *object, genf *handler, const char *handler_name, offs_t start, offs_t end, offs_t mask) | |
| 1719 | 1629 | { |
| 1720 | 1630 | int i; |
| 1721 | 1631 | |
| r1877 | r1878 | |
| 1731 | 1641 | table[i].top = end; |
| 1732 | 1642 | table[i].mask = mask; |
| 1733 | 1643 | table[i].name = handler_name; |
| 1644 | table[i].object = object; | |
| 1734 | 1645 | } |
| 1735 | 1646 | return i; |
| 1736 | 1647 | } |
| r1877 | r1878 | |
| 1745 | 1656 | table[i].top = end; |
| 1746 | 1657 | table[i].mask = mask; |
| 1747 | 1658 | table[i].name = handler_name; |
| 1659 | table[i].object = object; | |
| 1748 | 1660 | return i; |
| 1749 | 1661 | } |
| 1750 | if (table[i].handler.generic == handler && table[i].offset == start && table[i].mask == mask) | |
| 1662 | if (table[i].handler.generic == handler && table[i].offset == start && table[i].mask == mask && table[i].object == object) | |
| 1751 | 1663 | return i; |
| 1752 | 1664 | } |
| 1753 | 1665 | return 0; |
| r1877 | r1878 | |
| 1819 | 1731 | |
| 1820 | 1732 | |
| 1821 | 1733 | /*------------------------------------------------- |
| 1822 | populate_table_match - assign a memory handler | |
| 1823 | to a range of addresses | |
| 1824 | -------------------------------------------------*/ | |
| 1825 | ||
| 1826 | static void populate_table_match(addrspace_data *space, int iswrite, offs_t matchval, offs_t matchmask, UINT8 handler) | |
| 1827 | { | |
| 1828 | table_data *tabledata = iswrite ? &space->write : &space->read; | |
| 1829 | int lowermask, lowermatch; | |
| 1830 | int uppermask, uppermatch; | |
| 1831 | int l1index, l2index; | |
| 1832 | ||
| 1833 | /* clear out any ignored bits in the matchval */ | |
| 1834 | matchval &= matchmask; | |
| 1835 | ||
| 1836 | /* compute the lower half of the match/mask pair */ | |
| 1837 | lowermask = matchmask & ((1<<LEVEL2_BITS)-1); | |
| 1838 | lowermatch = matchval & ((1<<LEVEL2_BITS)-1); | |
| 1839 | ||
| 1840 | /* compute the upper half of the match/mask pair */ | |
| 1841 | uppermask = matchmask >> LEVEL2_BITS; | |
| 1842 | uppermatch = matchval >> LEVEL2_BITS; | |
| 1843 | ||
| 1844 | /* if the lower bits of the mask are all 0, we can work exclusively at the top level */ | |
| 1845 | if (lowermask == 0) | |
| 1846 | { | |
| 1847 | /* loop over top level matches */ | |
| 1848 | for (l1index = 0; l1index <= (space->mask >> LEVEL2_BITS); l1index++) | |
| 1849 | if ((l1index & uppermatch) == uppermask) | |
| 1850 | { | |
| 1851 | /* if we have a subtable here, release it */ | |
| 1852 | if (tabledata->table[l1index] >= SUBTABLE_BASE) | |
| 1853 | release_subtable(tabledata, tabledata->table[l1index]); | |
| 1854 | tabledata->table[l1index] = handler; | |
| 1855 | } | |
| 1856 | } | |
| 1857 | ||
| 1858 | /* okay, we need to work at both levels */ | |
| 1859 | else | |
| 1860 | { | |
| 1861 | /* loop over top level matches */ | |
| 1862 | for (l1index = 0; l1index <= (space->mask >> LEVEL2_BITS); l1index++) | |
| 1863 | if ((l1index & uppermatch) == uppermask) | |
| 1864 | { | |
| 1865 | UINT8 *subtable = open_subtable(tabledata, l1index); | |
| 1866 | ||
| 1867 | /* now loop over lower level matches */ | |
| 1868 | for (l2index = 0; l2index < (1 << LEVEL2_BITS); l2index++) | |
| 1869 | if ((l2index & lowermask) == lowermatch) | |
| 1870 | subtable[l2index] = handler; | |
| 1871 | close_subtable(tabledata, l1index); | |
| 1872 | } | |
| 1873 | } | |
| 1874 | } | |
| 1875 | ||
| 1876 | ||
| 1877 | /*------------------------------------------------- | |
| 1878 | 1734 | allocate_subtable - allocate a fresh subtable |
| 1879 | 1735 | and set its usecount to 1 |
| 1880 | 1736 | -------------------------------------------------*/ |
| r1877 | r1878 | |
| 1909 | 1765 | fatalerror("Ran out of subtables!"); |
| 1910 | 1766 | } |
| 1911 | 1767 | |
| 1912 | /* hopefully this never happens */ | |
| 1913 | return 0; | |
| 1914 | 1768 | } |
| 1915 | 1769 | |
| 1916 | 1770 | |
| r1877 | r1878 | |
| 2082 | 1936 | return 1; |
| 2083 | 1937 | |
| 2084 | 1938 | handler = (FPTR)map->write.handler; |
| 2085 | if (handler | |
| 1939 | if (handler | |
| 2086 | 1940 | { |
| 2087 | 1941 | if (handler != STATIC_INVALID && |
| 2088 | 1942 | handler != STATIC_ROM && |
| r1877 | r1878 | |
| 2092 | 1946 | } |
| 2093 | 1947 | |
| 2094 | 1948 | handler = (FPTR)map->read.handler; |
| 2095 | if (handler | |
| 1949 | if (handler | |
| 2096 | 1950 | { |
| 2097 | 1951 | if (handler != STATIC_INVALID && |
| 2098 | 1952 | (handler < STATIC_BANK1 || handler > STATIC_BANK1 + MAX_BANKS - 1) && |
| r1877 | r1878 | |
| 2129 | 1983 | /* we do this to make sure they are found by memory_find_base first */ |
| 2130 | 1984 | for (map = space->adjmap; map && !IS_AMENTRY_END(map); map++) |
| 2131 | 1985 | if (!IS_AMENTRY_EXTENDED(map) && map->memory != NULL) |
| 2132 | { | |
| 2133 | if (!IS_AMENTRY_MATCH_MASK(map)) | |
| 2134 | allocate_memory_block(cpunum, spacenum, map->start, map->end, map->memory); | |
| 2135 | else | |
| 2136 | allocate_memory_block(cpunum, spacenum, map->start, map->start + map->mask, map->memory); | |
| 2137 | } | |
| 1986 | allocate_memory_block(cpunum, spacenum, map->start, map->end, map->memory); | |
| 2138 | 1987 | |
| 2139 | 1988 | /* loop over all blocks just allocated and assign pointers from them */ |
| 2140 | 1989 | for (i = start_count; i < memory_block_count; i++) |
| r1877 | r1878 | |
| 2153 | 2002 | |
| 2154 | 2003 | /* work in MEMORY_BLOCK_SIZE-sized chunks */ |
| 2155 | 2004 | curstart = unassigned->start / MEMORY_BLOCK_SIZE; |
| 2156 | if (!IS_AMENTRY_MATCH_MASK(unassigned)) | |
| 2157 | curend = unassigned->end / MEMORY_BLOCK_SIZE; | |
| 2158 | else | |
| 2159 | curend = (unassigned->start + unassigned->mask) / MEMORY_BLOCK_SIZE; | |
| 2005 | curend = unassigned->end / MEMORY_BLOCK_SIZE; | |
| 2160 | 2006 | |
| 2161 | 2007 | /* loop while we keep finding unassigned blocks in neighboring MEMORY_BLOCK_SIZE chunks */ |
| 2162 | 2008 | do |
| r1877 | r1878 | |
| 2171 | 2017 | |
| 2172 | 2018 | /* get block start/end blocks for this block */ |
| 2173 | 2019 | blockstart = map->start / MEMORY_BLOCK_SIZE; |
| 2174 | if (!IS_AMENTRY_MATCH_MASK(map)) | |
| 2175 | blockend = map->end / MEMORY_BLOCK_SIZE; | |
| 2176 | else | |
| 2177 | blockend = (map->start + map->mask) / MEMORY_BLOCK_SIZE; | |
| 2020 | blockend = map->end / MEMORY_BLOCK_SIZE; | |
| 2178 | 2021 | |
| 2179 | 2022 | /* if we intersect or are adjacent, adjust the start/end */ |
| 2180 | 2023 | if (blockstart <= curend + 1 && blockend >= curstart - 1) |
| r1877 | r1878 | |
| 2284 | 2127 | } |
| 2285 | 2128 | |
| 2286 | 2129 | /* otherwise, look for a match in this block */ |
| 2287 | else | |
| 2130 | else if (map->start >= start && map->end <= end) | |
| 2288 | 2131 | { |
| 2289 | if (!IS_AMENTRY_MATCH_MASK(map)) | |
| 2290 | { | |
| 2291 | if (map->start >= start && map->end <= end) | |
| 2292 | { | |
| 2293 | map->memory = base + (map->start - start); | |
| 2294 | VPRINTF(("memory range %08X-%08X -> found in block from %08X-%08X [%p]\n", map->start, map->end, start, end, map->memory)); | |
| 2295 | } | |
| 2296 | } | |
| 2297 | else | |
| 2298 | { | |
| 2299 | if (map->start >= start && map->start + map->mask <= end) | |
| 2300 | { | |
| 2301 | map->memory = base + (map->start - start); | |
| 2302 | VPRINTF(("memory range %08X-%08X -> found in block from %08X-%08X [%p]\n", map->start, map->end, start, end, map->memory)); | |
| 2303 | } | |
| 2304 | } | |
| 2132 | map->memory = base + (map->start - start); | |
| 2133 | VPRINTF(("memory range %08X-%08X -> found in block from %08X-%08X [%p]\n", map->start, map->end, start, end, map->memory)); | |
| 2305 | 2134 | } |
| 2306 | 2135 | } |
| 2307 | 2136 | |
| r1877 | r1878 | |
| 2361 | 2190 | /* assign base/size values */ |
| 2362 | 2191 | if (map->base != NULL) |
| 2363 | 2192 | *map->base = map->memory; |
| 2364 | if (map->size) | |
| 2365 | { | |
| 2366 | if (!IS_AMENTRY_MATCH_MASK(map)) | |
| 2367 | *map->size = map->end - map->start + 1; | |
| 2368 | else | |
| 2369 | *map->size = map->mask + 1; | |
| 2370 | } | |
| 2193 | if (map->size != NULL) | |
| 2194 | *map->size = map->end - map->start + 1; | |
| 2371 | 2195 | } |
| 2372 | 2196 | } |
| 2373 | 2197 | |
| r1877 | r1878 | |
| 2416 | 2240 | if (!IS_AMENTRY_EXTENDED(map)) |
| 2417 | 2241 | { |
| 2418 | 2242 | offs_t maskoffs = offset & map->mask; |
| 2419 | if ( | |
| 2243 | if ( | |
| 2420 | 2244 | { |
| 2421 | if (maskoffs >= map->start && maskoffs <= map->end) | |
| 2422 | { | |
| 2423 | VPRINTF(("found in entry %08X-%08X [%p]\n", map->start, map->end, (UINT8 *)map->memory + (maskoffs - map->start))); | |
| 2424 | return (UINT8 *)map->memory + (maskoffs - map->start); | |
| 2425 | } | |
| 2245 | VPRINTF(("found in entry %08X-%08X [%p]\n", map->start, map->end, (UINT8 *)map->memory + (maskoffs - map->start))); | |
| 2246 | return (UINT8 *)map->memory + (maskoffs - map->start); | |
| 2426 | 2247 | } |
| 2427 | else | |
| 2428 | { | |
| 2429 | if ((maskoffs & map->end) == map->start) | |
| 2430 | { | |
| 2431 | VPRINTF(("found in entry %08X-%08X [%p]\n", map->start, map->end, (UINT8 *)map->memory + (maskoffs - map->start))); | |
| 2432 | return (UINT8 *)map->memory + (maskoffs - map->start); | |
| 2433 | } | |
| 2434 | } | |
| 2435 | 2248 | } |
| 2436 | 2249 | |
| 2437 | 2250 | /* if not found there, look in the allocated blocks */ |
| r1877 | r1878 | |
| 2451 | 2264 | PERFORM_LOOKUP - common lookup procedure |
| 2452 | 2265 | -------------------------------------------------*/ |
| 2453 | 2266 | |
| 2454 | #define PERFORM_LOOKUP(lookup,space,extraand) | |
| 2267 | #define PERFORM_LOOKUP(lookup,handlers,spacenum,extraand) | |
| 2455 | 2268 | /* perform lookup */ \ |
| 2456 | address &= space.addrmask & extraand; \ | |
| 2457 | entry = space.lookup[LEVEL1_INDEX(address)]; \ | |
| 2269 | address &= active_address_space[spacenum].addrmask & extraand; \ | |
| 2270 | entry = active_address_space[spacenum].lookup[LEVEL1_INDEX(address)]; \ | |
| 2458 | 2271 | if (entry >= SUBTABLE_BASE) \ |
| 2459 | entry = space.lookup[LEVEL2_INDEX(entry,address)]; \ | |
| 2272 | entry = active_address_space[spacenum].lookup[LEVEL2_INDEX(entry,address)]; \ | |
| 2273 | handler = &active_address_space[spacenum].handlers[entry]; \ | |
| 2460 | 2274 | |
| 2461 | 2275 | |
| 2462 | 2276 | /*------------------------------------------------- |
| r1877 | r1878 | |
| 2467 | 2281 | UINT8 name(offs_t original_address) \ |
| 2468 | 2282 | { \ |
| 2469 | 2283 | offs_t address = original_address; \ |
| 2284 | const handler_data *handler; \ | |
| 2470 | 2285 | UINT32 entry; \ |
| 2471 | 2286 | MEMREADSTART(); \ |
| 2472 | PERFORM_LOOKUP(readlookup, | |
| 2287 | PERFORM_LOOKUP(readlookup,r | |
| 2473 | 2288 | DEBUG_HOOK_READ(spacenum, 1, address); \ |
| 2474 | 2289 | \ |
| 2475 | 2290 | /* handle banks inline */ \ |
| 2476 | address = (address - | |
| 2291 | address = (address - | |
| 2477 | 2292 | if (entry < STATIC_RAM) \ |
| 2478 | 2293 | MEMREADEND(bank_ptr[entry][address]); \ |
| 2479 | 2294 | \ |
| 2480 | 2295 | /* fall back to the handler */ \ |
| 2481 | 2296 | else \ |
| 2482 | MEMREADEND((*active_address_space[spacenum].readhandlers[entry].handler.read.handler8)(address));\ | |
| 2483 | return 0; \ | |
| 2297 | MEMREADEND((*handler->handler.read.handler8)(handler->object, address)); \ | |
| 2484 | 2298 | } \ |
| 2485 | 2299 | |
| 2486 | 2300 | #define READBYTE(name,spacenum,xormacro,handlertype,ignorebits,shiftbytes,masktype) \ |
| 2487 | 2301 | UINT8 name(offs_t original_address) \ |
| 2488 | 2302 | { \ |
| 2489 | 2303 | offs_t address = original_address; \ |
| 2304 | const handler_data *handler; \ | |
| 2490 | 2305 | UINT32 entry; \ |
| 2491 | 2306 | MEMREADSTART(); \ |
| 2492 | PERFORM_LOOKUP(readlookup, | |
| 2307 | PERFORM_LOOKUP(readlookup,r | |
| 2493 | 2308 | DEBUG_HOOK_READ(spacenum, 1, address); \ |
| 2494 | 2309 | \ |
| 2495 | 2310 | /* handle banks inline */ \ |
| 2496 | address = (address - | |
| 2311 | address = (address - | |
| 2497 | 2312 | if (entry < STATIC_RAM) \ |
| 2498 | 2313 | MEMREADEND(bank_ptr[entry][xormacro(address)]); \ |
| 2499 | 2314 | \ |
| r1877 | r1878 | |
| 2501 | 2316 | else \ |
| 2502 | 2317 | { \ |
| 2503 | 2318 | int shift = 8 * (shiftbytes); \ |
| 2504 | MEMREADEND((* | |
| 2319 | MEMREADEND((* | |
| 2505 | 2320 | } \ |
| 2506 | return 0; \ | |
| 2507 | 2321 | } \ |
| 2508 | 2322 | |
| 2509 | 2323 | #define READBYTE16BE(name,space) READBYTE(name,space,BYTE_XOR_BE, handler16,1,~address & 1,UINT16) |
| r1877 | r1878 | |
| 2523 | 2337 | UINT16 name(offs_t original_address) \ |
| 2524 | 2338 | { \ |
| 2525 | 2339 | offs_t address = original_address; \ |
| 2340 | const handler_data *handler; \ | |
| 2526 | 2341 | UINT32 entry; \ |
| 2527 | 2342 | MEMREADSTART(); \ |
| 2528 | PERFORM_LOOKUP(readlookup, | |
| 2343 | PERFORM_LOOKUP(readlookup,r | |
| 2529 | 2344 | DEBUG_HOOK_READ(spacenum, 2, address); \ |
| 2530 | 2345 | \ |
| 2531 | 2346 | /* handle banks inline */ \ |
| 2532 | address = (address - | |
| 2347 | address = (address - | |
| 2533 | 2348 | if (entry < STATIC_RAM) \ |
| 2534 | 2349 | MEMREADEND(*(UINT16 *)&bank_ptr[entry][address]); \ |
| 2535 | 2350 | \ |
| 2536 | 2351 | /* fall back to the handler */ \ |
| 2537 | 2352 | else \ |
| 2538 | MEMREADEND((*active_address_space[spacenum].readhandlers[entry].handler.read.handler16)(address >> 1,0));\ | |
| 2539 | return 0; \ | |
| 2353 | MEMREADEND((*handler->handler.read.handler16)(handler->object, address >> 1, 0));\ | |
| 2540 | 2354 | } \ |
| 2541 | 2355 | |
| 2542 | 2356 | #define READWORD(name,spacenum,xormacro,handlertype,ignorebits,shiftbytes,masktype) \ |
| 2543 | 2357 | UINT16 name(offs_t original_address) \ |
| 2544 | 2358 | { \ |
| 2545 | 2359 | offs_t address = original_address; \ |
| 2360 | const handler_data *handler; \ | |
| 2546 | 2361 | UINT32 entry; \ |
| 2547 | 2362 | MEMREADSTART(); \ |
| 2548 | PERFORM_LOOKUP(readlookup, | |
| 2363 | PERFORM_LOOKUP(readlookup,r | |
| 2549 | 2364 | DEBUG_HOOK_READ(spacenum, 2, address); \ |
| 2550 | 2365 | \ |
| 2551 | 2366 | /* handle banks inline */ \ |
| 2552 | address = (address - | |
| 2367 | address = (address - | |
| 2553 | 2368 | if (entry < STATIC_RAM) \ |
| 2554 | 2369 | MEMREADEND(*(UINT16 *)&bank_ptr[entry][xormacro(address)]); \ |
| 2555 | 2370 | \ |
| r1877 | r1878 | |
| 2557 | 2372 | else \ |
| 2558 | 2373 | { \ |
| 2559 | 2374 | int shift = 8 * (shiftbytes); \ |
| 2560 | MEMREADEND((* | |
| 2375 | MEMREADEND((* | |
| 2561 | 2376 | } \ |
| 2562 | return 0; \ | |
| 2563 | 2377 | } \ |
| 2564 | 2378 | |
| 2565 | 2379 | #define READWORD32BE(name,space) READWORD(name,space,WORD_XOR_BE, handler32,2,~address & 2,UINT32) |
| r1877 | r1878 | |
| 2577 | 2391 | UINT32 name(offs_t original_address) \ |
| 2578 | 2392 | { \ |
| 2579 | 2393 | offs_t address = original_address; \ |
| 2394 | const handler_data *handler; \ | |
| 2580 | 2395 | UINT32 entry; \ |
| 2581 | 2396 | MEMREADSTART(); \ |
| 2582 | PERFORM_LOOKUP(readlookup, | |
| 2397 | PERFORM_LOOKUP(readlookup,r | |
| 2583 | 2398 | DEBUG_HOOK_READ(spacenum, 4, address); \ |
| 2584 | 2399 | \ |
| 2585 | 2400 | /* handle banks inline */ \ |
| 2586 | address = (address - | |
| 2401 | address = (address - | |
| 2587 | 2402 | if (entry < STATIC_RAM) \ |
| 2588 | 2403 | MEMREADEND(*(UINT32 *)&bank_ptr[entry][address]); \ |
| 2589 | 2404 | \ |
| 2590 | 2405 | /* fall back to the handler */ \ |
| 2591 | 2406 | else \ |
| 2592 | MEMREADEND((*active_address_space[spacenum].readhandlers[entry].handler.read.handler32)(address >> 2,0));\ | |
| 2593 | return 0; \ | |
| 2407 | MEMREADEND((*handler->handler.read.handler32)(handler->object, address >> 2, 0));\ | |
| 2594 | 2408 | } \ |
| 2595 | 2409 | |
| 2596 | 2410 | #define READMASKED32(name,spacenum) \ |
| 2597 | 2411 | UINT32 name(offs_t original_address, UINT32 mem_mask) \ |
| 2598 | 2412 | { \ |
| 2599 | 2413 | offs_t address = original_address; \ |
| 2414 | const handler_data *handler; \ | |
| 2600 | 2415 | UINT32 entry; \ |
| 2601 | 2416 | MEMREADSTART(); \ |
| 2602 | PERFORM_LOOKUP(readlookup, | |
| 2417 | PERFORM_LOOKUP(readlookup,r | |
| 2603 | 2418 | DEBUG_HOOK_READ(spacenum, 4, address); \ |
| 2604 | 2419 | \ |
| 2605 | 2420 | /* handle banks inline */ \ |
| 2606 | address = (address - | |
| 2421 | address = (address - | |
| 2607 | 2422 | if (entry < STATIC_RAM) \ |
| 2608 | 2423 | MEMREADEND(*(UINT32 *)&bank_ptr[entry][address]); \ |
| 2609 | 2424 | \ |
| 2610 | 2425 | /* fall back to the handler */ \ |
| 2611 | 2426 | else \ |
| 2612 | MEMREADEND((*active_address_space[spacenum].readhandlers[entry].handler.read.handler32)(address >> 2, mem_mask));\ | |
| 2613 | return 0; \ | |
| 2427 | MEMREADEND((*handler->handler.read.handler32)(handler->object, address >> 2, mem_mask));\ | |
| 2614 | 2428 | } \ |
| 2615 | 2429 | |
| 2616 | 2430 | #define READDWORD(name,spacenum,xormacro,handlertype,ignorebits,shiftbytes,masktype) \ |
| 2617 | 2431 | UINT32 name(offs_t original_address) \ |
| 2618 | 2432 | { \ |
| 2619 | 2433 | offs_t address = original_address; \ |
| 2434 | const handler_data *handler; \ | |
| 2620 | 2435 | UINT32 entry; \ |
| 2621 | 2436 | MEMREADSTART(); \ |
| 2622 | PERFORM_LOOKUP(readlookup, | |
| 2437 | PERFORM_LOOKUP(readlookup,r | |
| 2623 | 2438 | DEBUG_HOOK_READ(spacenum, 4, address); \ |
| 2624 | 2439 | \ |
| 2625 | 2440 | /* handle banks inline */ \ |
| 2626 | address = (address - | |
| 2441 | address = (address - | |
| 2627 | 2442 | if (entry < STATIC_RAM) \ |
| 2628 | 2443 | MEMREADEND(*(UINT32 *)&bank_ptr[entry][xormacro(address)]); \ |
| 2629 | 2444 | \ |
| r1877 | r1878 | |
| 2631 | 2446 | else \ |
| 2632 | 2447 | { \ |
| 2633 | 2448 | int shift = 8 * (shiftbytes); \ |
| 2634 | MEMREADEND((* | |
| 2449 | MEMREADEND((* | |
| 2635 | 2450 | } \ |
| 2636 | return 0; \ | |
| 2637 | 2451 | } \ |
| 2638 | 2452 | |
| 2639 | 2453 | #define READDWORD64BE(name,space) READDWORD(name,space,DWORD_XOR_BE,handler64,3,~address & 4,UINT64) |
| r1877 | r1878 | |
| 2649 | 2463 | UINT64 name(offs_t original_address) \ |
| 2650 | 2464 | { \ |
| 2651 | 2465 | offs_t address = original_address; \ |
| 2466 | const handler_data *handler; \ | |
| 2652 | 2467 | UINT32 entry; \ |
| 2653 | 2468 | MEMREADSTART(); \ |
| 2654 | PERFORM_LOOKUP(readlookup, | |
| 2469 | PERFORM_LOOKUP(readlookup,r | |
| 2655 | 2470 | DEBUG_HOOK_READ(spacenum, 8, address); \ |
| 2656 | 2471 | \ |
| 2657 | 2472 | /* handle banks inline */ \ |
| 2658 | address = (address - | |
| 2473 | address = (address - | |
| 2659 | 2474 | if (entry < STATIC_RAM) \ |
| 2660 | 2475 | MEMREADEND(*(UINT64 *)&bank_ptr[entry][address]); \ |
| 2661 | 2476 | \ |
| 2662 | 2477 | /* fall back to the handler */ \ |
| 2663 | 2478 | else \ |
| 2664 | MEMREADEND((*active_address_space[spacenum].readhandlers[entry].handler.read.handler64)(address >> 3,0));\ | |
| 2665 | return 0; \ | |
| 2479 | MEMREADEND((*handler->handler.read.handler64)(handler->object, address >> 3, 0));\ | |
| 2666 | 2480 | } \ |
| 2667 | 2481 | |
| 2668 | 2482 | #define READMASKED64(name,spacenum) \ |
| 2669 | 2483 | UINT64 name(offs_t original_address, UINT64 mem_mask) \ |
| 2670 | 2484 | { \ |
| 2671 | 2485 | offs_t address = original_address; \ |
| 2486 | const handler_data *handler; \ | |
| 2672 | 2487 | UINT32 entry; \ |
| 2673 | 2488 | MEMREADSTART(); \ |
| 2674 | PERFORM_LOOKUP(readlookup, | |
| 2489 | PERFORM_LOOKUP(readlookup,r | |
| 2675 | 2490 | DEBUG_HOOK_READ(spacenum, 8, address); \ |
| 2676 | 2491 | \ |
| 2677 | 2492 | /* handle banks inline */ \ |
| 2678 | address = (address - | |
| 2493 | address = (address - | |
| 2679 | 2494 | if (entry < STATIC_RAM) \ |
| 2680 | 2495 | MEMREADEND(*(UINT64 *)&bank_ptr[entry][address]); \ |
| 2681 | 2496 | \ |
| 2682 | 2497 | /* fall back to the handler */ \ |
| 2683 | 2498 | else \ |
| 2684 | MEMREADEND((*active_address_space[spacenum].readhandlers[entry].handler.read.handler64)(address >> 3, mem_mask));\ | |
| 2685 | return 0; \ | |
| 2499 | MEMREADEND((*handler->handler.read.handler64)(handler->object, address >> 3, mem_mask));\ | |
| 2686 | 2500 | } \ |
| 2687 | 2501 | |
| 2688 | 2502 | |
| r1877 | r1878 | |
| 2694 | 2508 | void name(offs_t original_address, UINT8 data) \ |
| 2695 | 2509 | { \ |
| 2696 | 2510 | offs_t address = original_address; \ |
| 2511 | const handler_data *handler; \ | |
| 2697 | 2512 | UINT32 entry; \ |
| 2698 | 2513 | MEMWRITESTART(); \ |
| 2699 | PERFORM_LOOKUP(writelookup, | |
| 2514 | PERFORM_LOOKUP(writelookup,wr | |
| 2700 | 2515 | DEBUG_HOOK_WRITE(spacenum, 1, address, data); \ |
| 2701 | 2516 | \ |
| 2702 | 2517 | /* handle banks inline */ \ |
| 2703 | address = (address - | |
| 2518 | address = (address - | |
| 2704 | 2519 | if (entry < STATIC_RAM) \ |
| 2705 | 2520 | MEMWRITEEND(bank_ptr[entry][address] = data); \ |
| 2706 | 2521 | \ |
| 2707 | 2522 | /* fall back to the handler */ \ |
| 2708 | 2523 | else \ |
| 2709 | MEMWRITEEND((* | |
| 2524 | MEMWRITEEND((* | |
| 2710 | 2525 | } \ |
| 2711 | 2526 | |
| 2712 | 2527 | #define WRITEBYTE(name,spacenum,xormacro,handlertype,ignorebits,shiftbytes,masktype) \ |
| 2713 | 2528 | void name(offs_t original_address, UINT8 data) \ |
| 2714 | 2529 | { \ |
| 2715 | 2530 | offs_t address = original_address; \ |
| 2531 | const handler_data *handler; \ | |
| 2716 | 2532 | UINT32 entry; \ |
| 2717 | 2533 | MEMWRITESTART(); \ |
| 2718 | PERFORM_LOOKUP(writelookup, | |
| 2534 | PERFORM_LOOKUP(writelookup,wr | |
| 2719 | 2535 | DEBUG_HOOK_WRITE(spacenum, 1, address, data); \ |
| 2720 | 2536 | \ |
| 2721 | 2537 | /* handle banks inline */ \ |
| 2722 | address = (address - | |
| 2538 | address = (address - | |
| 2723 | 2539 | if (entry < STATIC_RAM) \ |
| 2724 | 2540 | MEMWRITEEND(bank_ptr[entry][xormacro(address)] = data); \ |
| 2725 | 2541 | \ |
| r1877 | r1878 | |
| 2727 | 2543 | else \ |
| 2728 | 2544 | { \ |
| 2729 | 2545 | int shift = 8 * (shiftbytes); \ |
| 2730 | MEMWRITEEND((* | |
| 2546 | MEMWRITEEND((* | |
| 2731 | 2547 | } \ |
| 2732 | 2548 | } \ |
| 2733 | 2549 | |
| r1877 | r1878 | |
| 2748 | 2564 | void name(offs_t original_address, UINT16 data) \ |
| 2749 | 2565 | { \ |
| 2750 | 2566 | offs_t address = original_address; \ |
| 2567 | const handler_data *handler; \ | |
| 2751 | 2568 | UINT32 entry; \ |
| 2752 | 2569 | MEMWRITESTART(); \ |
| 2753 | PERFORM_LOOKUP(writelookup, | |
| 2570 | PERFORM_LOOKUP(writelookup,wr | |
| 2754 | 2571 | DEBUG_HOOK_WRITE(spacenum, 2, address, data); \ |
| 2755 | 2572 | \ |
| 2756 | 2573 | /* handle banks inline */ \ |
| 2757 | address = (address - | |
| 2574 | address = (address - | |
| 2758 | 2575 | if (entry < STATIC_RAM) \ |
| 2759 | 2576 | MEMWRITEEND(*(UINT16 *)&bank_ptr[entry][address] = data); \ |
| 2760 | 2577 | \ |
| 2761 | 2578 | /* fall back to the handler */ \ |
| 2762 | 2579 | else \ |
| 2763 | MEMWRITEEND((* | |
| 2580 | MEMWRITEEND((* | |
| 2764 | 2581 | } \ |
| 2765 | 2582 | |
| 2766 | 2583 | #define WRITEWORD(name,spacenum,xormacro,handlertype,ignorebits,shiftbytes,masktype) \ |
| 2767 | 2584 | void name(offs_t original_address, UINT16 data) \ |
| 2768 | 2585 | { \ |
| 2769 | 2586 | offs_t address = original_address; \ |
| 2587 | const handler_data *handler; \ | |
| 2770 | 2588 | UINT32 entry; \ |
| 2771 | 2589 | MEMWRITESTART(); \ |
| 2772 | PERFORM_LOOKUP(writelookup, | |
| 2590 | PERFORM_LOOKUP(writelookup,wr | |
| 2773 | 2591 | DEBUG_HOOK_WRITE(spacenum, 2, address, data); \ |
| 2774 | 2592 | \ |
| 2775 | 2593 | /* handle banks inline */ \ |
| 2776 | address = (address - | |
| 2594 | address = (address - | |
| 2777 | 2595 | if (entry < STATIC_RAM) \ |
| 2778 | 2596 | MEMWRITEEND(*(UINT16 *)&bank_ptr[entry][xormacro(address)] = data); \ |
| 2779 | 2597 | \ |
| r1877 | r1878 | |
| 2781 | 2599 | else \ |
| 2782 | 2600 | { \ |
| 2783 | 2601 | int shift = 8 * (shiftbytes); \ |
| 2784 | MEMWRITEEND((* | |
| 2602 | MEMWRITEEND((* | |
| 2785 | 2603 | } \ |
| 2786 | 2604 | } \ |
| 2787 | 2605 | |
| r1877 | r1878 | |
| 2800 | 2618 | void name(offs_t original_address, UINT32 data) \ |
| 2801 | 2619 | { \ |
| 2802 | 2620 | offs_t address = original_address; \ |
| 2621 | const handler_data *handler; \ | |
| 2803 | 2622 | UINT32 entry; \ |
| 2804 | 2623 | MEMWRITESTART(); \ |
| 2805 | PERFORM_LOOKUP(writelookup, | |
| 2624 | PERFORM_LOOKUP(writelookup,wr | |
| 2806 | 2625 | DEBUG_HOOK_WRITE(spacenum, 4, address, data); \ |
| 2807 | 2626 | \ |
| 2808 | 2627 | /* handle banks inline */ \ |
| 2809 | address = (address - | |
| 2628 | address = (address - | |
| 2810 | 2629 | if (entry < STATIC_RAM) \ |
| 2811 | 2630 | MEMWRITEEND(*(UINT32 *)&bank_ptr[entry][address] = data); \ |
| 2812 | 2631 | \ |
| 2813 | 2632 | /* fall back to the handler */ \ |
| 2814 | 2633 | else \ |
| 2815 | MEMWRITEEND((* | |
| 2634 | MEMWRITEEND((* | |
| 2816 | 2635 | } \ |
| 2817 | 2636 | |
| 2818 | 2637 | #define WRITEMASKED32(name,spacenum) \ |
| 2819 | 2638 | void name(offs_t original_address, UINT32 data, UINT32 mem_mask) \ |
| 2820 | 2639 | { \ |
| 2821 | 2640 | offs_t address = original_address; \ |
| 2641 | const handler_data *handler; \ | |
| 2822 | 2642 | UINT32 entry; \ |
| 2823 | 2643 | MEMWRITESTART(); \ |
| 2824 | PERFORM_LOOKUP(writelookup, | |
| 2644 | PERFORM_LOOKUP(writelookup,wr | |
| 2825 | 2645 | DEBUG_HOOK_WRITE(spacenum, 4, address, data); \ |
| 2826 | 2646 | \ |
| 2827 | 2647 | /* handle banks inline */ \ |
| 2828 | address = (address - | |
| 2648 | address = (address - | |
| 2829 | 2649 | if (entry < STATIC_RAM) \ |
| 2830 | 2650 | { \ |
| 2831 | 2651 | UINT32 *dest = (UINT32 *)&bank_ptr[entry][address]; \ |
| r1877 | r1878 | |
| 2834 | 2654 | \ |
| 2835 | 2655 | /* fall back to the handler */ \ |
| 2836 | 2656 | else \ |
| 2837 | MEMWRITEEND((* | |
| 2657 | MEMWRITEEND((* | |
| 2838 | 2658 | } \ |
| 2839 | 2659 | |
| 2840 | 2660 | #define WRITEDWORD(name,spacenum,xormacro,handlertype,ignorebits,shiftbytes,masktype) \ |
| 2841 | 2661 | void name(offs_t original_address, UINT32 data) \ |
| 2842 | 2662 | { \ |
| 2843 | 2663 | offs_t address = original_address; \ |
| 2664 | const handler_data *handler; \ | |
| 2844 | 2665 | UINT32 entry; \ |
| 2845 | 2666 | MEMWRITESTART(); \ |
| 2846 | PERFORM_LOOKUP(writelookup, | |
| 2667 | PERFORM_LOOKUP(writelookup,wr | |
| 2847 | 2668 | DEBUG_HOOK_WRITE(spacenum, 4, address, data); \ |
| 2848 | 2669 | \ |
| 2849 | 2670 | /* handle banks inline */ \ |
| 2850 | address = (address - | |
| 2671 | address = (address - | |
| 2851 | 2672 | if (entry < STATIC_RAM) \ |
| 2852 | 2673 | MEMWRITEEND(*(UINT32 *)&bank_ptr[entry][xormacro(address)] = data); \ |
| 2853 | 2674 | \ |
| r1877 | r1878 | |
| 2855 | 2676 | else \ |
| 2856 | 2677 | { \ |
| 2857 | 2678 | int shift = 8 * (shiftbytes); \ |
| 2858 | MEMWRITEEND((* | |
| 2679 | MEMWRITEEND((* | |
| 2859 | 2680 | } \ |
| 2860 | 2681 | } \ |
| 2861 | 2682 | |
| r1877 | r1878 | |
| 2872 | 2693 | void name(offs_t original_address, UINT64 data) \ |
| 2873 | 2694 | { \ |
| 2874 | 2695 | offs_t address = original_address; \ |
| 2696 | const handler_data *handler; \ | |
| 2875 | 2697 | UINT32 entry; \ |
| 2876 | 2698 | MEMWRITESTART(); \ |
| 2877 | PERFORM_LOOKUP(writelookup, | |
| 2699 | PERFORM_LOOKUP(writelookup,wr | |
| 2878 | 2700 | DEBUG_HOOK_WRITE(spacenum, 8, address, data); \ |
| 2879 | 2701 | \ |
| 2880 | 2702 | /* handle banks inline */ \ |
| 2881 | address = (address - | |
| 2703 | address = (address - | |
| 2882 | 2704 | if (entry < STATIC_RAM) \ |
| 2883 | 2705 | MEMWRITEEND(*(UINT64 *)&bank_ptr[entry][address] = data); \ |
| 2884 | 2706 | \ |
| 2885 | 2707 | /* fall back to the handler */ \ |
| 2886 | 2708 | else \ |
| 2887 | MEMWRITEEND((* | |
| 2709 | MEMWRITEEND((* | |
| 2888 | 2710 | } \ |
| 2889 | 2711 | |
| 2890 | 2712 | #define WRITEMASKED64(name,spacenum) \ |
| 2891 | 2713 | void name(offs_t original_address, UINT64 data, UINT64 mem_mask) \ |
| 2892 | 2714 | { \ |
| 2893 | 2715 | offs_t address = original_address; \ |
| 2716 | const handler_data *handler; \ | |
| 2894 | 2717 | UINT32 entry; \ |
| 2895 | 2718 | MEMWRITESTART(); \ |
| 2896 | PERFORM_LOOKUP(writelookup, | |
| 2719 | PERFORM_LOOKUP(writelookup,wr | |
| 2897 | 2720 | DEBUG_HOOK_WRITE(spacenum, 8, address, data); \ |
| 2898 | 2721 | \ |
| 2899 | 2722 | /* handle banks inline */ \ |
| 2900 | address = (address - | |
| 2723 | address = (address - | |
| 2901 | 2724 | if (entry < STATIC_RAM) \ |
| 2902 | 2725 | { \ |
| 2903 | 2726 | UINT64 *dest = (UINT64 *)&bank_ptr[entry][address]; \ |
| r1877 | r1878 | |
| 2906 | 2729 | \ |
| 2907 | 2730 | /* fall back to the handler */ \ |
| 2908 | 2731 | else \ |
| 2909 | MEMWRITEEND((* | |
| 2732 | MEMWRITEEND((* | |
| 2910 | 2733 | } \ |
| 2911 | 2734 | |
| 2912 | 2735 |
| r1877 | r1878 | |
|---|---|---|
| 88 | 88 | }; |
| 89 | 89 | |
| 90 | 90 | |
| 91 | /*------------------------------------------------- | |
| 92 | vblank_state_changed_func - callback that a | |
| 93 | screen calls to notify of a change of | |
| 94 | the VBLANK state | |
| 95 | -------------------------------------------------*/ | |
| 91 | 96 | |
| 97 | typedef void (*vblank_state_changed_func)(running_machine *machine, screen_state *screen, int vblank_state); | |
| 98 | ||
| 99 | ||
| 100 | ||
| 92 | 101 | /*************************************************************************** |
| 93 | 102 | FUNCTION PROTOTYPES |
| 94 | 103 | ***************************************************************************/ |
| r1877 | r1878 | |
| 98 | 107 | /* core initialization */ |
| 99 | 108 | void video_init(running_machine *machine); |
| 100 | 109 | |
| 101 | /* core VBLANK callback */ | |
| 102 | void video_vblank_start(running_machine *machine); | |
| 103 | 110 | |
| 104 | ||
| 105 | 111 | /* ----- screen management ----- */ |
| 106 | 112 | |
| 107 | 113 | /* set the resolution of a screen */ |
| r1877 | r1878 | |
| 127 | 133 | /* return the time when the beam will reach a particular H,V position */ |
| 128 | 134 | attotime video_screen_get_time_until_pos(int scrnum, int vpos, int hpos); |
| 129 | 135 | |
| 136 | /* return the time when the beam will reach the start of VBLANK */ | |
| 137 | attotime video_screen_get_time_until_vblank_start(int scrnum); | |
| 138 | ||
| 139 | /* return the time when the beam will reach the end of VBLANK */ | |
| 140 | attotime video_screen_get_time_until_vblank_end(int scrnum); | |
| 141 | ||
| 142 | /* return the time when the VIDEO_UPDATE function will be called */ | |
| 143 | attotime video_screen_get_time_until_update(int scrnum); | |
| 144 | ||
| 130 | 145 | /* return the amount of time the beam takes to draw one scan line */ |
| 131 | 146 | attotime video_screen_get_scan_period(int scrnum); |
| 132 | 147 | |
| 133 | 148 | /* return the amount of time the beam takes to draw one complete frame */ |
| 134 | 149 | attotime video_screen_get_frame_period(int scrnum); |
| 135 | 150 | |
| 151 | /* return the current frame number -- this is always increasing */ | |
| 152 | UINT64 video_screen_get_frame_number(int scrnum); | |
| 153 | ||
| 136 | 154 | /* returns whether a given screen exists */ |
| 137 | 155 | int video_screen_exists(int scrnum); |
| 138 | 156 | |
| 157 | /* registers a VBLANK callback for the given screen*/ | |
| 158 | void video_screen_register_vbl_cb(running_machine *machine, void *screen, vblank_state_changed_func vbl_cb); | |
| 139 | 159 | |
| 140 | 160 | |
| 141 | 161 | /* ----- video screen device interface ----- */ |
| 142 | 162 | |
| 143 | 163 | /* device get info callback */ |
| 144 | #define VIDEO_SCREEN video_screen_get_info | |
| 145 | void video_screen_get_info(running_machine *machine, void *token, UINT32 state, deviceinfo *info); | |
| 164 | #define VIDEO_SCREEN DEVICE_GET_INFO_NAME(video_screen) | |
| 165 | DEVICE_GET_INFO( video_screen ); | |
| 146 | 166 | |
| 147 | 167 | |
| 148 | 168 |
| r1877 | r1878 | |
|---|---|---|
| 77 | 77 | $(EMUOBJ)/uimenu.o \ |
| 78 | 78 | $(EMUOBJ)/validity.o \ |
| 79 | 79 | $(EMUOBJ)/video.o \ |
| 80 | $(EMUOBJ)/watchdog.o | |
| 80 | 81 | |
| 81 | 82 | ifdef PROFILER |
| 82 | 83 | EMUOBJS += \ |
| r1877 | r1878 | |
|---|---|---|
| 15 | 15 | #define __MEMORY_H__ |
| 16 | 16 | |
| 17 | 17 | #include "mamecore.h" |
| 18 | #include "devintrf.h" | |
| 18 | 19 | |
| 19 | 20 | |
| 20 | 21 | |
| r1877 | r1878 | |
| 26 | 27 | typedef UINT32 offs_t; |
| 27 | 28 | |
| 28 | 29 | /* ----- typedefs for the various common data access handlers ----- */ |
| 29 | typedef UINT8 (*read8_handler) (ATTR_UNUSED offs_t offset); | |
| 30 | typedef void (*write8_handler) (ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data); | |
| 31 | typedef UINT16 (*read16_handler) (ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask); | |
| 32 | typedef void (*write16_handler)(ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask); | |
| 33 | typedef UINT32 (*read32_handler) (ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask); | |
| 34 | typedef void (*write32_handler)(ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask); | |
| 35 | typedef UINT64 (*read64_handler) (ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask); | |
| 36 | typedef void (*write64_handler)(ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask); | |
| 37 | typedef offs_t (*opbase_handler) (ATTR_UNUSED offs_t address); | |
| 30 | typedef UINT8 (*read8_machine_func) (ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset); | |
| 31 | typedef void (*write8_machine_func) (ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data); | |
| 32 | typedef UINT16 (*read16_machine_func) (ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask); | |
| 33 | typedef void (*write16_machine_func)(ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask); | |
| 34 | typedef UINT32 (*read32_machine_func) (ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask); | |
| 35 | typedef void (*write32_machine_func)(ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask); | |
| 36 | typedef UINT64 (*read64_machine_func) (ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask); | |
| 37 | typedef void (*write64_machine_func)(ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask); | |
| 38 | 38 | |
| 39 | typedef UINT8 (*read8_device_func) (ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset); | |
| 40 | typedef void (*write8_device_func) (ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data); | |
| 41 | typedef UINT16 (*read16_device_func) (ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask); | |
| 42 | typedef void (*write16_device_func)(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask); | |
| 43 | typedef UINT32 (*read32_device_func) (ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask); | |
| 44 | typedef void (*write32_device_func)(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask); | |
| 45 | typedef UINT64 (*read64_device_func) (ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask); | |
| 46 | typedef void (*write64_device_func)(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask); | |
| 47 | ||
| 48 | typedef offs_t (*opbase_handler_func) (ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t address); | |
| 49 | ||
| 39 | 50 | /* ----- this struct contains pointers to the live read/write routines ----- */ |
| 40 | 51 | typedef struct _data_accessors data_accessors; |
| 41 | 52 | struct _data_accessors |
| r1877 | r1878 | |
| 58 | 69 | ***************************************************************************/ |
| 59 | 70 | |
| 60 | 71 | /* ----- macros for declaring the various common data access handlers ----- */ |
| 61 | #define READ8_HANDLER(name) UINT8 name(ATTR_UNUSED offs_t offset) | |
| 62 | #define WRITE8_HANDLER(name) void name(ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data) | |
| 63 | #define READ16_HANDLER(name) UINT16 name(ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask) | |
| 64 | #define WRITE16_HANDLER(name) void name(ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask) | |
| 65 | #define READ32_HANDLER(name) UINT32 name(ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask) | |
| 66 | #define WRITE32_HANDLER(name) void name(ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask) | |
| 67 | #define READ64_HANDLER(name) UINT64 name(ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask) | |
| 68 | #define WRITE64_HANDLER(name) void name(ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask) | |
| 69 | #define OPBASE_HANDLER(name) offs_t name(ATTR_UNUSED offs_t address) | |
| 72 | #define READ8_HANDLER(name) UINT8 name(ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset) | |
| 73 | #define WRITE8_HANDLER(name) void name(ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data) | |
| 74 | #define READ16_HANDLER(name) UINT16 name(ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask) | |
| 75 | #define WRITE16_HANDLER(name) void name(ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask) | |
| 76 | #define READ32_HANDLER(name) UINT32 name(ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask) | |
| 77 | #define WRITE32_HANDLER(name) void name(ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask) | |
| 78 | #define READ64_HANDLER(name) UINT64 name(ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask) | |
| 79 | #define WRITE64_HANDLER(name) void name(ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask) | |
| 70 | 80 | |
| 81 | #define READ8_DEVICE_HANDLER(name) UINT8 name(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset) | |
| 82 | #define WRITE8_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data) | |
| 83 | #define READ16_DEVICE_HANDLER(name) UINT16 name(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask) | |
| 84 | #define WRITE16_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask) | |
| 85 | #define READ32_DEVICE_HANDLER(name) UINT32 name(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask) | |
| 86 | #define WRITE32_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask) | |
| 87 | #define READ64_DEVICE_HANDLER(name) UINT64 name(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask) | |
| 88 | #define WRITE64_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask) | |
| 89 | ||
| 90 | #define OPBASE_HANDLER(name) offs_t name(ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t address) | |
| 91 | ||
| 71 | 92 | /* ----- macros for accessing bytes and words within larger chunks ----- */ |
| 72 | 93 | #ifdef LSB_FIRST |
| 73 | 94 | #define BYTE_XOR_BE(a) ((a) ^ 1) /* read/write a byte to a 16-bit space */ |
| r1877 | r1878 | |
| 108 | 129 | |
| 109 | 130 | /* ----- definitions for the flags in the address maps ----- */ |
| 110 | 131 | #define AM_FLAGS_EXTENDED 0x01 /* this is an extended entry with the below flags in the start field */ |
| 111 | #define AM_FLAGS_MATCH_MASK 0x02 /* this entry should have the start/end pair treated as a match/mask pair */ | |
| 112 | #define AM_FLAGS_END 0x04 /* this is the terminating entry in the array */ | |
| 132 | #define AM_FLAGS_END 0x02 /* this is the terminating entry in the array */ | |
| 113 | 133 | |
| 114 | 134 | /* ----- definitions for the extended flags in the address maps ----- */ |
| 115 | 135 | #define AMEF_SPECIFIES_SPACE 0x00000001 /* set if the address space is specified */ |
| r1877 | r1878 | |
| 199 | 219 | ***************************************************************************/ |
| 200 | 220 | |
| 201 | 221 | /* 8-bit reads */ |
| 202 | #define MRA8_BANK1 ((read8_handler)STATIC_BANK1) | |
| 203 | #define MRA8_BANK2 ((read8_handler)STATIC_BANK2) | |
| 204 | #define MRA8_BANK3 ((read8_handler)STATIC_BANK3) | |
| 205 | #define MRA8_BANK4 ((read8_handler)STATIC_BANK4) | |
| 206 | #define MRA8_BANK5 ((read8_handler)STATIC_BANK5) | |
| 207 | #define MRA8_BANK6 ((read8_handler)STATIC_BANK6) | |
| 208 | #define MRA8_BANK7 ((read8_handler)STATIC_BANK7) | |
| 209 | #define MRA8_BANK8 ((read8_handler)STATIC_BANK8) | |
| 210 | #define MRA8_BANK9 ((read8_handler)STATIC_BANK9) | |
| 211 | #define MRA8_BANK10 ((read8_handler)STATIC_BANK10) | |
| 212 | #define MRA8_BANK11 ((read8_handler)STATIC_BANK11) | |
| 213 | #define MRA8_BANK12 ((read8_handler)STATIC_BANK12) | |
| 214 | #define MRA8_BANK13 ((read8_handler)STATIC_BANK13) | |
| 215 | #define MRA8_BANK14 ((read8_handler)STATIC_BANK14) | |
| 216 | #define MRA8_BANK15 ((read8_handler)STATIC_BANK15) | |
| 217 | #define MRA8_BANK16 ((read8_handler)STATIC_BANK16) | |
| 218 | #define MRA8_BANK17 ((read8_handler)STATIC_BANK17) | |
| 219 | #define MRA8_BANK18 ((read8_handler)STATIC_BANK18) | |
| 220 | #define MRA8_BANK19 ((read8_handler)STATIC_BANK19) | |
| 221 | #define MRA8_BANK20 ((read8_handler)STATIC_BANK20) | |
| 222 | #define MRA8_BANK21 ((read8_handler)STATIC_BANK21) | |
| 223 | #define MRA8_BANK22 ((read8_handler)STATIC_BANK22) | |
| 224 | #define MRA8_BANK23 ((read8_handler)STATIC_BANK23) | |
| 225 | #define MRA8_BANK24 ((read8_handler)STATIC_BANK24) | |
| 226 | #define MRA8_BANK25 ((read8_handler)STATIC_BANK25) | |
| 227 | #define MRA8_BANK26 ((read8_handler)STATIC_BANK26) | |
| 228 | #define MRA8_BANK27 ((read8_handler)STATIC_BANK27) | |
| 229 | #define MRA8_BANK28 ((read8_handler)STATIC_BANK28) | |
| 230 | #define MRA8_BANK29 ((read8_handler)STATIC_BANK29) | |
| 231 | #define MRA8_BANK30 ((read8_handler)STATIC_BANK30) | |
| 232 | #define MRA8_BANK31 ((read8_handler)STATIC_BANK31) | |
| 233 | #define MRA8_BANK32 ((read8_handler)STATIC_BANK32) | |
| 234 | #define MRA8_RAM ((read8_handler)STATIC_RAM) | |
| 235 | #define MRA8_ROM ((read8_handler)STATIC_ROM) | |
| 236 | #define MRA8_NOP ((read8_handler)STATIC_NOP) | |
| 237 | #define MRA8_UNMAP ((read8_handler)STATIC_UNMAP) | |
| 222 | #define MRA8_BANK1 ((read8_machine_func)STATIC_BANK1) | |
| 223 | #define MRA8_BANK2 ((read8_machine_func)STATIC_BANK2) | |
| 224 | #define MRA8_BANK3 ((read8_machine_func)STATIC_BANK3) | |
| 225 | #define MRA8_BANK4 ((read8_machine_func)STATIC_BANK4) | |
| 226 | #define MRA8_BANK5 ((read8_machine_func)STATIC_BANK5) | |
| 227 | #define MRA8_BANK6 ((read8_machine_func)STATIC_BANK6) | |
| 228 | #define MRA8_BANK7 ((read8_machine_func)STATIC_BANK7) | |
| 229 | #define MRA8_BANK8 ((read8_machine_func)STATIC_BANK8) | |
| 230 | #define MRA8_BANK9 ((read8_machine_func)STATIC_BANK9) | |
| 231 | #define MRA8_BANK10 ((read8_machine_func)STATIC_BANK10) | |
| 232 | #define MRA8_BANK11 ((read8_machine_func)STATIC_BANK11) | |
| 233 | #define MRA8_BANK12 ((read8_machine_func)STATIC_BANK12) | |
| 234 | #define MRA8_BANK13 ((read8_machine_func)STATIC_BANK13) | |
| 235 | #define MRA8_BANK14 ((read8_machine_func)STATIC_BANK14) | |
| 236 | #define MRA8_BANK15 ((read8_machine_func)STATIC_BANK15) | |
| 237 | #define MRA8_BANK16 ((read8_machine_func)STATIC_BANK16) | |
| 238 | #define MRA8_BANK17 ((read8_machine_func)STATIC_BANK17) | |
| 239 | #define MRA8_BANK18 ((read8_machine_func)STATIC_BANK18) | |
| 240 | #define MRA8_BANK19 ((read8_machine_func)STATIC_BANK19) | |
| 241 | #define MRA8_BANK20 ((read8_machine_func)STATIC_BANK20) | |
| 242 | #define MRA8_BANK21 ((read8_machine_func)STATIC_BANK21) | |
| 243 | #define MRA8_BANK22 ((read8_machine_func)STATIC_BANK22) | |
| 244 | #define MRA8_BANK23 ((read8_machine_func)STATIC_BANK23) | |
| 245 | #define MRA8_BANK24 ((read8_machine_func)STATIC_BANK24) | |
| 246 | #define MRA8_BANK25 ((read8_machine_func)STATIC_BANK25) | |
| 247 | #define MRA8_BANK26 ((read8_machine_func)STATIC_BANK26) | |
| 248 | #define MRA8_BANK27 ((read8_machine_func)STATIC_BANK27) | |
| 249 | #define MRA8_BANK28 ((read8_machine_func)STATIC_BANK28) | |
| 250 | #define MRA8_BANK29 ((read8_machine_func)STATIC_BANK29) | |
| 251 | #define MRA8_BANK30 ((read8_machine_func)STATIC_BANK30) | |
| 252 | #define MRA8_BANK31 ((read8_machine_func)STATIC_BANK31) | |
| 253 | #define MRA8_BANK32 ((read8_machine_func)STATIC_BANK32) | |
| 254 | #define MRA8_RAM ((read8_machine_func)STATIC_RAM) | |
| 255 | #define MRA8_ROM ((read8_machine_func)STATIC_ROM) | |
| 256 | #define MRA8_NOP ((read8_machine_func)STATIC_NOP) | |
| 257 | #define MRA8_UNMAP ((read8_machine_func)STATIC_UNMAP) | |
| 238 | 258 | |
| 239 | 259 | /* 8-bit writes */ |
| 240 | #define MWA8_BANK1 ((write8_handler)STATIC_BANK1) | |
| 241 | #define MWA8_BANK2 ((write8_handler)STATIC_BANK2) | |
| 242 | #define MWA8_BANK3 ((write8_handler)STATIC_BANK3) | |
| 243 | #define MWA8_BANK4 ((write8_handler)STATIC_BANK4) | |
| 244 | #define MWA8_BANK5 ((write8_handler)STATIC_BANK5) | |
| 245 | #define MWA8_BANK6 ((write8_handler)STATIC_BANK6) | |
| 246 | #define MWA8_BANK7 ((write8_handler)STATIC_BANK7) | |
| 247 | #define MWA8_BANK8 ((write8_handler)STATIC_BANK8) | |
| 248 | #define MWA8_BANK9 ((write8_handler)STATIC_BANK9) | |
| 249 | #define MWA8_BANK10 ((write8_handler)STATIC_BANK10) | |
| 250 | #define MWA8_BANK11 ((write8_handler)STATIC_BANK11) | |
| 251 | #define MWA8_BANK12 ((write8_handler)STATIC_BANK12) | |
| 252 | #define MWA8_BANK13 ((write8_handler)STATIC_BANK13) | |
| 253 | #define MWA8_BANK14 ((write8_handler)STATIC_BANK14) | |
| 254 | #define MWA8_BANK15 ((write8_handler)STATIC_BANK15) | |
| 255 | #define MWA8_BANK16 ((write8_handler)STATIC_BANK16) | |
| 256 | #define MWA8_BANK17 ((write8_handler)STATIC_BANK17) | |
| 257 | #define MWA8_BANK18 ((write8_handler)STATIC_BANK18) | |
| 258 | #define MWA8_BANK19 ((write8_handler)STATIC_BANK19) | |
| 259 | #define MWA8_BANK20 ((write8_handler)STATIC_BANK20) | |
| 260 | #define MWA8_BANK21 ((write8_handler)STATIC_BANK21) | |
| 261 | #define MWA8_BANK22 ((write8_handler)STATIC_BANK22) | |
| 262 | #define MWA8_BANK23 ((write8_handler)STATIC_BANK23) | |
| 263 | #define MWA8_BANK24 ((write8_handler)STATIC_BANK24) | |
| 264 | #define MWA8_BANK25 ((write8_handler)STATIC_BANK25) | |
| 265 | #define MWA8_BANK26 ((write8_handler)STATIC_BANK26) | |
| 266 | #define MWA8_BANK27 ((write8_handler)STATIC_BANK27) | |
| 267 | #define MWA8_BANK28 ((write8_handler)STATIC_BANK28) | |
| 268 | #define MWA8_BANK29 ((write8_handler)STATIC_BANK29) | |
| 269 | #define MWA8_BANK30 ((write8_handler)STATIC_BANK30) | |
| 270 | #define MWA8_BANK31 ((write8_handler)STATIC_BANK31) | |
| 271 | #define MWA8_BANK32 ((write8_handler)STATIC_BANK32) | |
| 272 | #define MWA8_RAM ((write8_handler)STATIC_RAM) | |
| 273 | #define MWA8_ROM ((write8_handler)STATIC_ROM) | |
| 274 | #define MWA8_NOP ((write8_handler)STATIC_NOP) | |
| 275 | #define MWA8_UNMAP ((write8_handler)STATIC_UNMAP) | |
| 260 | #define MWA8_BANK1 ((write8_machine_func)STATIC_BANK1) | |
| 261 | #define MWA8_BANK2 ((write8_machine_func)STATIC_BANK2) | |
| 262 | #define MWA8_BANK3 ((write8_machine_func)STATIC_BANK3) | |
| 263 | #define MWA8_BANK4 ((write8_machine_func)STATIC_BANK4) | |
| 264 | #define MWA8_BANK5 ((write8_machine_func)STATIC_BANK5) | |
| 265 | #define MWA8_BANK6 ((write8_machine_func)STATIC_BANK6) | |
| 266 | #define MWA8_BANK7 ((write8_machine_func)STATIC_BANK7) | |
| 267 | #define MWA8_BANK8 ((write8_machine_func)STATIC_BANK8) | |
| 268 | #define MWA8_BANK9 ((write8_machine_func)STATIC_BANK9) | |
| 269 | #define MWA8_BANK10 ((write8_machine_func)STATIC_BANK10) | |
| 270 | #define MWA8_BANK11 ((write8_machine_func)STATIC_BANK11) | |
| 271 | #define MWA8_BANK12 ((write8_machine_func)STATIC_BANK12) | |
| 272 | #define MWA8_BANK13 ((write8_machine_func)STATIC_BANK13) | |
| 273 | #define MWA8_BANK14 ((write8_machine_func)STATIC_BANK14) | |
| 274 | #define MWA8_BANK15 ((write8_machine_func)STATIC_BANK15) | |
| 275 | #define MWA8_BANK16 ((write8_machine_func)STATIC_BANK16) | |
| 276 | #define MWA8_BANK17 ((write8_machine_func)STATIC_BANK17) | |
| 277 | #define MWA8_BANK18 ((write8_machine_func)STATIC_BANK18) | |
| 278 | #define MWA8_BANK19 ((write8_machine_func)STATIC_BANK19) | |
| 279 | #define MWA8_BANK20 ((write8_machine_func)STATIC_BANK20) | |
| 280 | #define MWA8_BANK21 ((write8_machine_func)STATIC_BANK21) | |
| 281 | #define MWA8_BANK22 ((write8_machine_func)STATIC_BANK22) | |
| 282 | #define MWA8_BANK23 ((write8_machine_func)STATIC_BANK23) | |
| 283 | #define MWA8_BANK24 ((write8_machine_func)STATIC_BANK24) | |
| 284 | #define MWA8_BANK25 ((write8_machine_func)STATIC_BANK25) | |
| 285 | #define MWA8_BANK26 ((write8_machine_func)STATIC_BANK26) | |
| 286 | #define MWA8_BANK27 ((write8_machine_func)STATIC_BANK27) | |
| 287 | #define MWA8_BANK28 ((write8_machine_func)STATIC_BANK28) | |
| 288 | #define MWA8_BANK29 ((write8_machine_func)STATIC_BANK29) | |
| 289 | #define MWA8_BANK30 ((write8_machine_func)STATIC_BANK30) | |
| 290 | #define MWA8_BANK31 ((write8_machine_func)STATIC_BANK31) | |
| 291 | #define MWA8_BANK32 ((write8_machine_func)STATIC_BANK32) | |
| 292 | #define MWA8_RAM ((write8_machine_func)STATIC_RAM) | |
| 293 | #define MWA8_ROM ((write8_machine_func)STATIC_ROM) | |
| 294 | #define MWA8_NOP ((write8_machine_func)STATIC_NOP) | |
| 295 | #define MWA8_UNMAP ((write8_machine_func)STATIC_UNMAP) | |
| 276 | 296 | |
| 277 | 297 | /* 16-bit reads */ |
| 278 | #define MRA16_BANK1 ((read16_handler)STATIC_BANK1) | |
| 279 | #define MRA16_BANK2 ((read16_handler)STATIC_BANK2) | |
| 280 | #define MRA16_BANK3 ((read16_handler)STATIC_BANK3) | |
| 281 | #define MRA16_BANK4 ((read16_handler)STATIC_BANK4) | |
| 282 | #define MRA16_BANK5 ((read16_handler)STATIC_BANK5) | |
| 283 | #define MRA16_BANK6 ((read16_handler)STATIC_BANK6) | |
| 284 | #define MRA16_BANK7 ((read16_handler)STATIC_BANK7) | |
| 285 | #define MRA16_BANK8 ((read16_handler)STATIC_BANK8) | |
| 286 | #define MRA16_BANK9 ((read16_handler)STATIC_BANK9) | |
| 287 | #define MRA16_BANK10 ((read16_handler)STATIC_BANK10) | |
| 288 | #define MRA16_BANK11 ((read16_handler)STATIC_BANK11) | |
| 289 | #define MRA16_BANK12 ((read16_handler)STATIC_BANK12) | |
| 290 | #define MRA16_BANK13 ((read16_handler)STATIC_BANK13) | |
| 291 | #define MRA16_BANK14 ((read16_handler)STATIC_BANK14) | |
| 292 | #define MRA16_BANK15 ((read16_handler)STATIC_BANK15) | |
| 293 | #define MRA16_BANK16 ((read16_handler)STATIC_BANK16) | |
| 294 | #define MRA16_BANK17 ((read16_handler)STATIC_BANK17) | |
| 295 | #define MRA16_BANK18 ((read16_handler)STATIC_BANK18) | |
| 296 | #define MRA16_BANK19 ((read16_handler)STATIC_BANK19) | |
| 297 | #define MRA16_BANK20 ((read16_handler)STATIC_BANK20) | |
| 298 | #define MRA16_BANK21 ((read16_handler)STATIC_BANK21) | |
| 299 | #define MRA16_BANK22 ((read16_handler)STATIC_BANK22) | |
| 300 | #define MRA16_BANK23 ((read16_handler)STATIC_BANK23) | |
| 301 | #define MRA16_BANK24 ((read16_handler)STATIC_BANK24) | |
| 302 | #define MRA16_BANK25 ((read16_handler)STATIC_BANK25) | |
| 303 | #define MRA16_BANK26 ((read16_handler)STATIC_BANK26) | |
| 304 | #define MRA16_BANK27 ((read16_handler)STATIC_BANK27) | |
| 305 | #define MRA16_BANK28 ((read16_handler)STATIC_BANK28) | |
| 306 | #define MRA16_BANK29 ((read16_handler)STATIC_BANK29) | |
| 307 | #define MRA16_BANK30 ((read16_handler)STATIC_BANK30) | |
| 308 | #define MRA16_BANK31 ((read16_handler)STATIC_BANK31) | |
| 309 | #define MRA16_BANK32 ((read16_handler)STATIC_BANK32) | |
| 310 | #define MRA16_RAM ((read16_handler)STATIC_RAM) | |
| 311 | #define MRA16_ROM ((read16_handler)STATIC_ROM) | |
| 312 | #define MRA16_NOP ((read16_handler)STATIC_NOP) | |
| 313 | #define MRA16_UNMAP ((read16_handler)STATIC_UNMAP) | |
| 298 | #define MRA16_BANK1 ((read16_machine_func)STATIC_BANK1) | |
| 299 | #define MRA16_BANK2 ((read16_machine_func)STATIC_BANK2) | |
| 300 | #define MRA16_BANK3 ((read16_machine_func)STATIC_BANK3) | |
| 301 | #define MRA16_BANK4 ((read16_machine_func)STATIC_BANK4) | |
| 302 | #define MRA16_BANK5 ((read16_machine_func)STATIC_BANK5) | |
| 303 | #define MRA16_BANK6 ((read16_machine_func)STATIC_BANK6) | |
| 304 | #define MRA16_BANK7 ((read16_machine_func)STATIC_BANK7) | |
| 305 | #define MRA16_BANK8 ((read16_machine_func)STATIC_BANK8) | |
| 306 | #define MRA16_BANK9 ((read16_machine_func)STATIC_BANK9) | |
| 307 | #define MRA16_BANK10 ((read16_machine_func)STATIC_BANK10) | |
| 308 | #define MRA16_BANK11 ((read16_machine_func)STATIC_BANK11) | |
| 309 | #define MRA16_BANK12 ((read16_machine_func)STATIC_BANK12) | |
| 310 | #define MRA16_BANK13 ((read16_machine_func)STATIC_BANK13) | |
| 311 | #define MRA16_BANK14 ((read16_machine_func)STATIC_BANK14) | |
| 312 | #define MRA16_BANK15 ((read16_machine_func)STATIC_BANK15) | |
| 313 | #define MRA16_BANK16 ((read16_machine_func)STATIC_BANK16) | |
| 314 | #define MRA16_BANK17 ((read16_machine_func)STATIC_BANK17) | |
| 315 | #define MRA16_BANK18 ((read16_machine_func)STATIC_BANK18) | |
| 316 | #define MRA16_BANK19 ((read16_machine_func)STATIC_BANK19) | |
| 317 | #define MRA16_BANK20 ((read16_machine_func)STATIC_BANK20) | |
| 318 | #define MRA16_BANK21 ((read16_machine_func)STATIC_BANK21) | |
| 319 | #define MRA16_BANK22 ((read16_machine_func)STATIC_BANK22) | |
| 320 | #define MRA16_BANK23 ((read16_machine_func)STATIC_BANK23) | |
| 321 | #define MRA16_BANK24 ((read16_machine_func)STATIC_BANK24) | |
| 322 | #define MRA16_BANK25 ((read16_machine_func)STATIC_BANK25) | |
| 323 | #define MRA16_BANK26 ((read16_machine_func)STATIC_BANK26) | |
| 324 | #define MRA16_BANK27 ((read16_machine_func)STATIC_BANK27) | |
| 325 | #define MRA16_BANK28 ((read16_machine_func)STATIC_BANK28) | |
| 326 | #define MRA16_BANK29 ((read16_machine_func)STATIC_BANK29) | |
| 327 | #define MRA16_BANK30 ((read16_machine_func)STATIC_BANK30) | |
| 328 | #define MRA16_BANK31 ((read16_machine_func)STATIC_BANK31) | |
| 329 | #define MRA16_BANK32 ((read16_machine_func)STATIC_BANK32) | |
| 330 | #define MRA16_RAM ((read16_machine_func)STATIC_RAM) | |
| 331 | #define MRA16_ROM ((read16_machine_func)STATIC_ROM) | |
| 332 | #define MRA16_NOP ((read16_machine_func)STATIC_NOP) | |
| 333 | #define MRA16_UNMAP ((read16_machine_func)STATIC_UNMAP) | |
| 314 | 334 | |
| 315 | 335 | /* 16-bit writes */ |
| 316 | #define MWA16_BANK1 ((write16_handler)STATIC_BANK1) | |
| 317 | #define MWA16_BANK2 ((write16_handler)STATIC_BANK2) | |
| 318 | #define MWA16_BANK3 ((write16_handler)STATIC_BANK3) | |
| 319 | #define MWA16_BANK4 ((write16_handler)STATIC_BANK4) | |
| 320 | #define MWA16_BANK5 ((write16_handler)STATIC_BANK5) | |
| 321 | #define MWA16_BANK6 ((write16_handler)STATIC_BANK6) | |
| 322 | #define MWA16_BANK7 ((write16_handler)STATIC_BANK7) | |
| 323 | #define MWA16_BANK8 ((write16_handler)STATIC_BANK8) | |
| 324 | #define MWA16_BANK9 ((write16_handler)STATIC_BANK9) | |
| 325 | #define MWA16_BANK10 ((write16_handler)STATIC_BANK10) | |
| 326 | #define MWA16_BANK11 ((write16_handler)STATIC_BANK11) | |
| 327 | #define MWA16_BANK12 ((write16_handler)STATIC_BANK12) | |
| 328 | #define MWA16_BANK13 ((write16_handler)STATIC_BANK13) | |
| 329 | #define MWA16_BANK14 ((write16_handler)STATIC_BANK14) | |
| 330 | #define MWA16_BANK15 ((write16_handler)STATIC_BANK15) | |
| 331 | #define MWA16_BANK16 ((write16_handler)STATIC_BANK16) | |
| 332 | #define MWA16_BANK17 ((write16_handler)STATIC_BANK17) | |
| 333 | #define MWA16_BANK18 ((write16_handler)STATIC_BANK18) | |
| 334 | #define MWA16_BANK19 ((write16_handler)STATIC_BANK19) | |
| 335 | #define MWA16_BANK20 ((write16_handler)STATIC_BANK20) | |
| 336 | #define MWA16_BANK21 ((write16_handler)STATIC_BANK21) | |
| 337 | #define MWA16_BANK22 ((write16_handler)STATIC_BANK22) | |
| 338 | #define MWA16_BANK23 ((write16_handler)STATIC_BANK23) | |
| 339 | #define MWA16_BANK24 ((write16_handler)STATIC_BANK24) | |
| 340 | #define MWA16_BANK25 ((write16_handler)STATIC_BANK25) | |
| 341 | #define MWA16_BANK26 ((write16_handler)STATIC_BANK26) | |
| 342 | #define MWA16_BANK27 ((write16_handler)STATIC_BANK27) | |
| 343 | #define MWA16_BANK28 ((write16_handler)STATIC_BANK28) | |
| 344 | #define MWA16_BANK29 ((write16_handler)STATIC_BANK29) | |
| 345 | #define MWA16_BANK30 ((write16_handler)STATIC_BANK30) | |
| 346 | #define MWA16_BANK31 ((write16_handler)STATIC_BANK31) | |
| 347 | #define MWA16_BANK32 ((write16_handler)STATIC_BANK32) | |
| 348 | #define MWA16_RAM ((write16_handler)STATIC_RAM) | |
| 349 | #define MWA16_ROM ((write16_handler)STATIC_ROM) | |
| 350 | #define MWA16_NOP ((write16_handler)STATIC_NOP) | |
| 351 | #define MWA16_UNMAP ((write16_handler)STATIC_UNMAP) | |
| 336 | #define MWA16_BANK1 ((write16_machine_func)STATIC_BANK1) | |
| 337 | #define MWA16_BANK2 ((write16_machine_func)STATIC_BANK2) | |
| 338 | #define MWA16_BANK3 ((write16_machine_func)STATIC_BANK3) | |
| 339 | #define MWA16_BANK4 ((write16_machine_func)STATIC_BANK4) | |
| 340 | #define MWA16_BANK5 ((write16_machine_func)STATIC_BANK5) | |
| 341 | #define MWA16_BANK6 ((write16_machine_func)STATIC_BANK6) | |
| 342 | #define MWA16_BANK7 ((write16_machine_func)STATIC_BANK7) | |
| 343 | #define MWA16_BANK8 ((write16_machine_func)STATIC_BANK8) | |
| 344 | #define MWA16_BANK9 ((write16_machine_func)STATIC_BANK9) | |
| 345 | #define MWA16_BANK10 ((write16_machine_func)STATIC_BANK10) | |
| 346 | #define MWA16_BANK11 ((write16_machine_func)STATIC_BANK11) | |
| 347 | #define MWA16_BANK12 ((write16_machine_func)STATIC_BANK12) | |
| 348 | #define MWA16_BANK13 ((write16_machine_func)STATIC_BANK13) | |
| 349 | #define MWA16_BANK14 ((write16_machine_func)STATIC_BANK14) | |
| 350 | #define MWA16_BANK15 ((write16_machine_func)STATIC_BANK15) | |
| 351 | #define MWA16_BANK16 ((write16_machine_func)STATIC_BANK16) | |
| 352 | #define MWA16_BANK17 ((write16_machine_func)STATIC_BANK17) | |
| 353 | #define MWA16_BANK18 ((write16_machine_func)STATIC_BANK18) | |
| 354 | #define MWA16_BANK19 ((write16_machine_func)STATIC_BANK19) | |
| 355 | #define MWA16_BANK20 ((write16_machine_func)STATIC_BANK20) | |
| 356 | #define MWA16_BANK21 ((write16_machine_func)STATIC_BANK21) | |
| 357 | #define MWA16_BANK22 ((write16_machine_func)STATIC_BANK22) | |
| 358 | #define MWA16_BANK23 ((write16_machine_func)STATIC_BANK23) | |
| 359 | #define MWA16_BANK24 ((write16_machine_func)STATIC_BANK24) | |
| 360 | #define MWA16_BANK25 ((write16_machine_func)STATIC_BANK25) | |
| 361 | #define MWA16_BANK26 ((write16_machine_func)STATIC_BANK26) | |
| 362 | #define MWA16_BANK27 ((write16_machine_func)STATIC_BANK27) | |
| 363 | #define MWA16_BANK28 ((write16_machine_func)STATIC_BANK28) | |
| 364 | #define MWA16_BANK29 ((write16_machine_func)STATIC_BANK29) | |
| 365 | #define MWA16_BANK30 ((write16_machine_func)STATIC_BANK30) | |
| 366 | #define MWA16_BANK31 ((write16_machine_func)STATIC_BANK31) | |
| 367 | #define MWA16_BANK32 ((write16_machine_func)STATIC_BANK32) | |
| 368 | #define MWA16_RAM ((write16_machine_func)STATIC_RAM) | |
| 369 | #define MWA16_ROM ((write16_machine_func)STATIC_ROM) | |
| 370 | #define MWA16_NOP ((write16_machine_func)STATIC_NOP) | |
| 371 | #define MWA16_UNMAP ((write16_machine_func)STATIC_UNMAP) | |
| 352 | 372 | |
| 353 | 373 | /* 32-bit reads */ |
| 354 | #define MRA32_BANK1 ((read32_handler)STATIC_BANK1) | |
| 355 | #define MRA32_BANK2 ((read32_handler)STATIC_BANK2) | |
| 356 | #define MRA32_BANK3 ((read32_handler)STATIC_BANK3) | |
| 357 | #define MRA32_BANK4 ((read32_handler)STATIC_BANK4) | |
| 358 | #define MRA32_BANK5 ((read32_handler)STATIC_BANK5) | |
| 359 | #define MRA32_BANK6 ((read32_handler)STATIC_BANK6) | |
| 360 | #define MRA32_BANK7 ((read32_handler)STATIC_BANK7) | |
| 361 | #define MRA32_BANK8 ((read32_handler)STATIC_BANK8) | |
| 362 | #define MRA32_BANK9 ((read32_handler)STATIC_BANK9) | |
| 363 | #define MRA32_BANK10 ((read32_handler)STATIC_BANK10) | |
| 364 | #define MRA32_BANK11 ((read32_handler)STATIC_BANK11) | |
| 365 | #define MRA32_BANK12 ((read32_handler)STATIC_BANK12) | |
| 366 | #define MRA32_BANK13 ((read32_handler)STATIC_BANK13) | |
| 367 | #define MRA32_BANK14 ((read32_handler)STATIC_BANK14) | |
| 368 | #define MRA32_BANK15 ((read32_handler)STATIC_BANK15) | |
| 369 | #define MRA32_BANK16 ((read32_handler)STATIC_BANK16) | |
| 370 | #define MRA32_BANK17 ((read32_handler)STATIC_BANK17) | |
| 371 | #define MRA32_BANK18 ((read32_handler)STATIC_BANK18) | |
| 372 | #define MRA32_BANK19 ((read32_handler)STATIC_BANK19) | |
| 373 | #define MRA32_BANK20 ((read32_handler)STATIC_BANK20) | |
| 374 | #define MRA32_BANK21 ((read32_handler)STATIC_BANK21) | |
| 375 | #define MRA32_BANK22 ((read32_handler)STATIC_BANK22) | |
| 376 | #define MRA32_BANK23 ((read32_handler)STATIC_BANK23) | |
| 377 | #define MRA32_BANK24 ((read32_handler)STATIC_BANK24) | |
| 378 | #define MRA32_BANK25 ((read32_handler)STATIC_BANK25) | |
| 379 | #define MRA32_BANK26 ((read32_handler)STATIC_BANK26) | |
| 380 | #define MRA32_BANK27 ((read32_handler)STATIC_BANK27) | |
| 381 | #define MRA32_BANK28 ((read32_handler)STATIC_BANK28) | |
| 382 | #define MRA32_BANK29 ((read32_handler)STATIC_BANK29) | |
| 383 | #define MRA32_BANK30 ((read32_handler)STATIC_BANK30) | |
| 384 | #define MRA32_BANK31 ((read32_handler)STATIC_BANK31) | |
| 385 | #define MRA32_BANK32 ((read32_handler)STATIC_BANK32) | |
| 386 | #define MRA32_RAM ((read32_handler)STATIC_RAM) | |
| 387 | #define MRA32_ROM ((read32_handler)STATIC_ROM) | |
| 388 | #define MRA32_NOP ((read32_handler)STATIC_NOP) | |
| 389 | #define MRA32_UNMAP ((read32_handler)STATIC_UNMAP) | |
| 374 | #define MRA32_BANK1 ((read32_machine_func)STATIC_BANK1) | |
| 375 | #define MRA32_BANK2 ((read32_machine_func)STATIC_BANK2) | |
| 376 | #define MRA32_BANK3 ((read32_machine_func)STATIC_BANK3) | |
| 377 | #define MRA32_BANK4 ((read32_machine_func)STATIC_BANK4) | |
| 378 | #define MRA32_BANK5 ((read32_machine_func)STATIC_BANK5) | |
| 379 | #define MRA32_BANK6 ((read32_machine_func)STATIC_BANK6) | |
| 380 | #define MRA32_BANK7 ((read32_machine_func)STATIC_BANK7) | |
| 381 | #define MRA32_BANK8 ((read32_machine_func)STATIC_BANK8) | |
| 382 | #define MRA32_BANK9 ((read32_machine_func)STATIC_BANK9) | |
| 383 | #define MRA32_BANK10 ((read32_machine_func)STATIC_BANK10) | |
| 384 | #define MRA32_BANK11 ((read32_machine_func)STATIC_BANK11) | |
| 385 | #define MRA32_BANK12 ((read32_machine_func)STATIC_BANK12) | |
| 386 | #define MRA32_BANK13 ((read32_machine_func)STATIC_BANK13) | |
| 387 | #define MRA32_BANK14 ((read32_machine_func)STATIC_BANK14) | |
| 388 | #define MRA32_BANK15 ((read32_machine_func)STATIC_BANK15) | |
| 389 | #define MRA32_BANK16 ((read32_machine_func)STATIC_BANK16) | |
| 390 | #define MRA32_BANK17 ((read32_machine_func)STATIC_BANK17) | |
| 391 | #define MRA32_BANK18 ((read32_machine_func)STATIC_BANK18) | |
| 392 | #define MRA32_BANK19 ((read32_machine_func)STATIC_BANK19) | |
| 393 | #define MRA32_BANK20 ((read32_machine_func)STATIC_BANK20) | |
| 394 | #define MRA32_BANK21 ((read32_machine_func)STATIC_BANK21) | |
| 395 | #define MRA32_BANK22 ((read32_machine_func)STATIC_BANK22) | |
| 396 | #define MRA32_BANK23 ((read32_machine_func)STATIC_BANK23) | |
| 397 | #define MRA32_BANK24 ((read32_machine_func)STATIC_BANK24) | |
| 398 | #define MRA32_BANK25 ((read32_machine_func)STATIC_BANK25) | |
| 399 | #define MRA32_BANK26 ((read32_machine_func)STATIC_BANK26) | |
| 400 | #define MRA32_BANK27 ((read32_machine_func)STATIC_BANK27) | |
| 401 | #define MRA32_BANK28 ((read32_machine_func)STATIC_BANK28) | |
| 402 | #define MRA32_BANK29 ((read32_machine_func)STATIC_BANK29) | |
| 403 | #define MRA32_BANK30 ((read32_machine_func)STATIC_BANK30) | |
| 404 | #define MRA32_BANK31 ((read32_machine_func)STATIC_BANK31) | |
| 405 | #define MRA32_BANK32 ((read32_machine_func)STATIC_BANK32) | |
| 406 | #define MRA32_RAM ((read32_machine_func)STATIC_RAM) | |
| 407 | #define MRA32_ROM ((read32_machine_func)STATIC_ROM) | |
| 408 | #define MRA32_NOP ((read32_machine_func)STATIC_NOP) | |
| 409 | #define MRA32_UNMAP ((read32_machine_func)STATIC_UNMAP) | |
| 390 | 410 | |
| 391 | 411 | /* 32-bit writes */ |
| 392 | #define MWA32_BANK1 ((write32_handler)STATIC_BANK1) | |
| 393 | #define MWA32_BANK2 ((write32_handler)STATIC_BANK2) | |
| 394 | #define MWA32_BANK3 ((write32_handler)STATIC_BANK3) | |
| 395 | #define MWA32_BANK4 ((write32_handler)STATIC_BANK4) | |
| 396 | #define MWA32_BANK5 ((write32_handler)STATIC_BANK5) | |
| 397 | #define MWA32_BANK6 ((write32_handler)STATIC_BANK6) | |
| 398 | #define MWA32_BANK7 ((write32_handler)STATIC_BANK7) | |
| 399 | #define MWA32_BANK8 ((write32_handler)STATIC_BANK8) | |
| 400 | #define MWA32_BANK9 ((write32_handler)STATIC_BANK9) | |
| 401 | #define MWA32_BANK10 ((write32_handler)STATIC_BANK10) | |
| 402 | #define MWA32_BANK11 ((write32_handler)STATIC_BANK11) | |
| 403 | #define MWA32_BANK12 ((write32_handler)STATIC_BANK12) | |
| 404 | #define MWA32_BANK13 ((write32_handler)STATIC_BANK13) | |
| 405 | #define MWA32_BANK14 ((write32_handler)STATIC_BANK14) | |
| 406 | #define MWA32_BANK15 ((write32_handler)STATIC_BANK15) | |
| 407 | #define MWA32_BANK16 ((write32_handler)STATIC_BANK16) | |
| 408 | #define MWA32_BANK17 ((write32_handler)STATIC_BANK17) | |
| 409 | #define MWA32_BANK18 ((write32_handler)STATIC_BANK18) | |
| 410 | #define MWA32_BANK19 ((write32_handler)STATIC_BANK19) | |
| 411 | #define MWA32_BANK20 ((write32_handler)STATIC_BANK20) | |
| 412 | #define MWA32_BANK21 ((write32_handler)STATIC_BANK21) | |
| 413 | #define MWA32_BANK22 ((write32_handler)STATIC_BANK22) | |
| 414 | #define MWA32_BANK23 ((write32_handler)STATIC_BANK23) | |
| 415 | #define MWA32_BANK24 ((write32_handler)STATIC_BANK24) | |
| 416 | #define MWA32_BANK25 ((write32_handler)STATIC_BANK25) | |
| 417 | #define MWA32_BANK26 ((write32_handler)STATIC_BANK26) | |
| 418 | #define MWA32_BANK27 ((write32_handler)STATIC_BANK27) | |
| 419 | #define MWA32_BANK28 ((write32_handler)STATIC_BANK28) | |
| 420 | #define MWA32_BANK29 ((write32_handler)STATIC_BANK29) | |
| 421 | #define MWA32_BANK30 ((write32_handler)STATIC_BANK30) | |
| 422 | #define MWA32_BANK31 ((write32_handler)STATIC_BANK31) | |
| 423 | #define MWA32_BANK32 ((write32_handler)STATIC_BANK32) | |
| 424 | #define MWA32_RAM ((write32_handler)STATIC_RAM) | |
| 425 | #define MWA32_ROM ((write32_handler)STATIC_ROM) | |
| 426 | #define MWA32_NOP ((write32_handler)STATIC_NOP) | |
| 427 | #define MWA32_UNMAP ((write32_handler)STATIC_UNMAP) | |
| 412 | #define MWA32_BANK1 ((write32_machine_func)STATIC_BANK1) | |
| 413 | #define MWA32_BANK2 ((write32_machine_func)STATIC_BANK2) | |
| 414 | #define MWA32_BANK3 ((write32_machine_func)STATIC_BANK3) | |
| 415 | #define MWA32_BANK4 ((write32_machine_func)STATIC_BANK4) | |
| 416 | #define MWA32_BANK5 ((write32_machine_func)STATIC_BANK5) | |
| 417 | #define MWA32_BANK6 ((write32_machine_func)STATIC_BANK6) | |
| 418 | #define MWA32_BANK7 ((write32_machine_func)STATIC_BANK7) | |
| 419 | #define MWA32_BANK8 ((write32_machine_func)STATIC_BANK8) | |
| 420 | #define MWA32_BANK9 ((write32_machine_func)STATIC_BANK9) | |
| 421 | #define MWA32_BANK10 ((write32_machine_func)STATIC_BANK10) | |
| 422 | #define MWA32_BANK11 ((write32_machine_func)STATIC_BANK11) | |
| 423 | #define MWA32_BANK12 ((write32_machine_func)STATIC_BANK12) | |
| 424 | #define MWA32_BANK13 ((write32_machine_func)STATIC_BANK13) | |
| 425 | #define MWA32_BANK14 ((write32_machine_func)STATIC_BANK14) | |
| 426 | #define MWA32_BANK15 ((write32_machine_func)STATIC_BANK15) | |
| 427 | #define MWA32_BANK16 ((write32_machine_func)STATIC_BANK16) | |
| 428 | #define MWA32_BANK17 ((write32_machine_func)STATIC_BANK17) | |
| 429 | #define MWA32_BANK18 ((write32_machine_func)STATIC_BANK18) | |
| 430 | #define MWA32_BANK19 ((write32_machine_func)STATIC_BANK19) | |
| 431 | #define MWA32_BANK20 ((write32_machine_func)STATIC_BANK20) | |
| 432 | #define MWA32_BANK21 ((write32_machine_func)STATIC_BANK21) | |
| 433 | #define MWA32_BANK22 ((write32_machine_func)STATIC_BANK22) | |
| 434 | #define MWA32_BANK23 ((write32_machine_func)STATIC_BANK23) | |
| 435 | #define MWA32_BANK24 ((write32_machine_func)STATIC_BANK24) | |
| 436 | #define MWA32_BANK25 ((write32_machine_func)STATIC_BANK25) | |
| 437 | #define MWA32_BANK26 ((write32_machine_func)STATIC_BANK26) | |
| 438 | #define MWA32_BANK27 ((write32_machine_func)STATIC_BANK27) | |
| 439 | #define MWA32_BANK28 ((write32_machine_func)STATIC_BANK28) | |
| 440 | #define MWA32_BANK29 ((write32_machine_func)STATIC_BANK29) | |
| 441 | #define MWA32_BANK30 ((write32_machine_func)STATIC_BANK30) | |
| 442 | #define MWA32_BANK31 ((write32_machine_func)STATIC_BANK31) | |
| 443 | #define MWA32_BANK32 ((write32_machine_func)STATIC_BANK32) | |
| 444 | #define MWA32_RAM ((write32_machine_func)STATIC_RAM) | |
| 445 | #define MWA32_ROM ((write32_machine_func)STATIC_ROM) | |
| 446 | #define MWA32_NOP ((write32_machine_func)STATIC_NOP) | |
| 447 | #define MWA32_UNMAP ((write32_machine_func)STATIC_UNMAP) | |
| 428 | 448 | |
| 429 | 449 | /* 64-bit reads */ |
| 430 | #define MRA64_BANK1 ((read64_handler)STATIC_BANK1) | |
| 431 | #define MRA64_BANK2 ((read64_handler)STATIC_BANK2) | |
| 432 | #define MRA64_BANK3 ((read64_handler)STATIC_BANK3) | |
| 433 | #define MRA64_BANK4 ((read64_handler)STATIC_BANK4) | |
| 434 | #define MRA64_BANK5 ((read64_handler)STATIC_BANK5) | |
| 435 | #define MRA64_BANK6 ((read64_handler)STATIC_BANK6) | |
| 436 | #define MRA64_BANK7 ((read64_handler)STATIC_BANK7) | |
| 437 | #define MRA64_BANK8 ((read64_handler)STATIC_BANK8) | |
| 438 | #define MRA64_BANK9 ((read64_handler)STATIC_BANK9) | |
| 439 | #define MRA64_BANK10 ((read64_handler)STATIC_BANK10) | |
| 440 | #define MRA64_BANK11 ((read64_handler)STATIC_BANK11) | |
| 441 | #define MRA64_BANK12 ((read64_handler)STATIC_BANK12) | |
| 442 | #define MRA64_BANK13 ((read64_handler)STATIC_BANK13) | |
| 443 | #define MRA64_BANK14 ((read64_handler)STATIC_BANK14) | |
| 444 | #define MRA64_BANK15 ((read64_handler)STATIC_BANK15) | |
| 445 | #define MRA64_BANK16 ((read64_handler)STATIC_BANK16) | |
| 446 | #define MRA64_BANK17 ((read64_handler)STATIC_BANK17) | |
| 447 | #define MRA64_BANK18 ((read64_handler)STATIC_BANK18) | |
| 448 | #define MRA64_BANK19 ((read64_handler)STATIC_BANK19) | |
| 449 | #define MRA64_BANK20 ((read64_handler)STATIC_BANK20) | |
| 450 | #define MRA64_BANK21 ((read64_handler)STATIC_BANK21) | |
| 451 | #define MRA64_BANK22 ((read64_handler)STATIC_BANK22) | |
| 452 | #define MRA64_BANK23 ((read64_handler)STATIC_BANK23) | |
| 453 | #define MRA64_BANK24 ((read64_handler)STATIC_BANK24) | |
| 454 | #define MRA64_BANK25 ((read64_handler)STATIC_BANK25) | |
| 455 | #define MRA64_BANK26 ((read64_handler)STATIC_BANK26) | |
| 456 | #define MRA64_BANK27 ((read64_handler)STATIC_BANK27) | |
| 457 | #define MRA64_BANK28 ((read64_handler)STATIC_BANK28) | |
| 458 | #define MRA64_BANK29 ((read64_handler)STATIC_BANK29) | |
| 459 | #define MRA64_BANK30 ((read64_handler)STATIC_BANK30) | |
| 460 | #define MRA64_BANK31 ((read64_handler)STATIC_BANK31) | |
| 461 | #define MRA64_BANK32 ((read64_handler)STATIC_BANK32) | |
| 462 | #define MRA64_RAM ((read64_handler)STATIC_RAM) | |
| 463 | #define MRA64_ROM ((read64_handler)STATIC_ROM) | |
| 464 | #define MRA64_NOP ((read64_handler)STATIC_NOP) | |
| 465 | #define MRA64_UNMAP ((read64_handler)STATIC_UNMAP) | |
| 450 | #define MRA64_BANK1 ((read64_machine_func)STATIC_BANK1) | |
| 451 | #define MRA64_BANK2 ((read64_machine_func)STATIC_BANK2) | |
| 452 | #define MRA64_BANK3 ((read64_machine_func)STATIC_BANK3) | |
| 453 | #define MRA64_BANK4 ((read64_machine_func)STATIC_BANK4) | |
| 454 | #define MRA64_BANK5 ((read64_machine_func)STATIC_BANK5) | |
| 455 | #define MRA64_BANK6 ((read64_machine_func)STATIC_BANK6) | |
| 456 | #define MRA64_BANK7 ((read64_machine_func)STATIC_BANK7) | |
| 457 | #define MRA64_BANK8 ((read64_machine_func)STATIC_BANK8) | |
| 458 | #define MRA64_BANK9 ((read64_machine_func)STATIC_BANK9) | |
| 459 | #define MRA64_BANK10 ((read64_machine_func)STATIC_BANK10) | |
| 460 | #define MRA64_BANK11 ((read64_machine_func)STATIC_BANK11) | |
| 461 | #define MRA64_BANK12 ((read64_machine_func)STATIC_BANK12) | |
| 462 | #define MRA64_BANK13 ((read64_machine_func)STATIC_BANK13) | |
| 463 | #define MRA64_BANK14 ((read64_machine_func)STATIC_BANK14) | |
| 464 | #define MRA64_BANK15 ((read64_machine_func)STATIC_BANK15) | |
| 465 | #define MRA64_BANK16 ((read64_machine_func)STATIC_BANK16) | |
| 466 | #define MRA64_BANK17 ((read64_machine_func)STATIC_BANK17) | |
| 467 | #define MRA64_BANK18 ((read64_machine_func)STATIC_BANK18) | |
| 468 | #define MRA64_BANK19 ((read64_machine_func)STATIC_BANK19) | |
| 469 | #define MRA64_BANK20 ((read64_machine_func)STATIC_BANK20) | |
| 470 | #define MRA64_BANK21 ((read64_machine_func)STATIC_BANK21) | |
| 471 | #define MRA64_BANK22 ((read64_machine_func)STATIC_BANK22) | |
| 472 | #define MRA64_BANK23 ((read64_machine_func)STATIC_BANK23) | |
| 473 | #define MRA64_BANK24 ((read64_machine_func)STATIC_BANK24) | |
| 474 | #define MRA64_BANK25 ((read64_machine_func)STATIC_BANK25) | |
| 475 | #define MRA64_BANK26 ((read64_machine_func)STATIC_BANK26) | |
| 476 | #define MRA64_BANK27 ((read64_machine_func)STATIC_BANK27) | |
| 477 | #define MRA64_BANK28 ((read64_machine_func)STATIC_BANK28) | |
| 478 | #define MRA64_BANK29 ((read64_machine_func)STATIC_BANK29) | |
| 479 | #define MRA64_BANK30 ((read64_machine_func)STATIC_BANK30) | |
| 480 | #define MRA64_BANK31 ((read64_machine_func)STATIC_BANK31) | |
| 481 | #define MRA64_BANK32 ((read64_machine_func)STATIC_BANK32) | |
| 482 | #define MRA64_RAM ((read64_machine_func)STATIC_RAM) | |
| 483 | #define MRA64_ROM ((read64_machine_func)STATIC_ROM) | |
| 484 | #define MRA64_NOP ((read64_machine_func)STATIC_NOP) | |
| 485 | #define MRA64_UNMAP ((read64_machine_func)STATIC_UNMAP) | |
| 466 | 486 | |
| 467 | 487 | /* 64-bit writes */ |
| 468 | #define MWA64_BANK1 ((write64_handler)STATIC_BANK1) | |
| 469 | #define MWA64_BANK2 ((write64_handler)STATIC_BANK2) | |
| 470 | #define MWA64_BANK3 ((write64_handler)STATIC_BANK3) | |
| 471 | #define MWA64_BANK4 ((write64_handler)STATIC_BANK4) | |
| 472 | #define MWA64_BANK5 ((write64_handler)STATIC_BANK5) | |
| 473 | #define MWA64_BANK6 ((write64_handler)STATIC_BANK6) | |
| 474 | #define MWA64_BANK7 ((write64_handler)STATIC_BANK7) | |
| 475 | #define MWA64_BANK8 ((write64_handler)STATIC_BANK8) | |
| 476 | #define MWA64_BANK9 ((write64_handler)STATIC_BANK9) | |
| 477 | #define MWA64_BANK10 ((write64_handler)STATIC_BANK10) | |
| 478 | #define MWA64_BANK11 ((write64_handler)STATIC_BANK11) | |
| 479 | #define MWA64_BANK12 ((write64_handler)STATIC_BANK12) | |
| 480 | #define MWA64_BANK13 ((write64_handler)STATIC_BANK13) | |
| 481 | #define MWA64_BANK14 ((write64_handler)STATIC_BANK14) | |
| 482 | #define MWA64_BANK15 ((write64_handler)STATIC_BANK15) | |
| 483 | #define MWA64_BANK16 ((write64_handler)STATIC_BANK16) | |
| 484 | #define MWA64_BANK17 ((write64_handler)STATIC_BANK17) | |
| 485 | #define MWA64_BANK18 ((write64_handler)STATIC_BANK18) | |
| 486 | #define MWA64_BANK19 ((write64_handler)STATIC_BANK19) | |
| 487 | #define MWA64_BANK20 ((write64_handler)STATIC_BANK20) | |
| 488 | #define MWA64_BANK21 ((write64_handler)STATIC_BANK21) | |
| 489 | #define MWA64_BANK22 ((write64_handler)STATIC_BANK22) | |
| 490 | #define MWA64_BANK23 ((write64_handler)STATIC_BANK23) | |
| 491 | #define MWA64_BANK24 ((write64_handler)STATIC_BANK24) | |
| 492 | #define MWA64_BANK25 ((write64_handler)STATIC_BANK25) | |
| 493 | #define MWA64_BANK26 ((write64_handler)STATIC_BANK26) | |
| 494 | #define MWA64_BANK27 ((write64_handler)STATIC_BANK27) | |
| 495 | #define MWA64_BANK28 ((write64_handler)STATIC_BANK28) | |
| 496 | #define MWA64_BANK29 ((write64_handler)STATIC_BANK29) | |
| 497 | #define MWA64_BANK30 ((write64_handler)STATIC_BANK30) | |
| 498 | #define MWA64_BANK31 ((write64_handler)STATIC_BANK31) | |
| 499 | #define MWA64_BANK32 ((write64_handler)STATIC_BANK32) | |
| 500 | #define MWA64_RAM ((write64_handler)STATIC_RAM) | |
| 501 | #define MWA64_ROM ((write64_handler)STATIC_ROM) | |
| 502 | #define MWA64_NOP ((write64_handler)STATIC_NOP) | |
| 503 | #define MWA64_UNMAP ((write64_handler)STATIC_UNMAP) | |
| 488 | #define MWA64_BANK1 ((write64_machine_func)STATIC_BANK1) | |
| 489 | #define MWA64_BANK2 ((write64_machine_func)STATIC_BANK2) | |
| 490 | #define MWA64_BANK3 ((write64_machine_func)STATIC_BANK3) | |
| 491 | #define MWA64_BANK4 ((write64_machine_func)STATIC_BANK4) | |
| 492 | #define MWA64_BANK5 ((write64_machine_func)STATIC_BANK5) | |
| 493 | #define MWA64_BANK6 ((write64_machine_func)STATIC_BANK6) | |
| 494 | #define MWA64_BANK7 ((write64_machine_func)STATIC_BANK7) | |
| 495 | #define MWA64_BANK8 ((write64_machine_func)STATIC_BANK8) | |
| 496 | #define MWA64_BANK9 ((write64_machine_func)STATIC_BANK9) | |
| 497 | #define MWA64_BANK10 ((write64_machine_func)STATIC_BANK10) | |
| 498 | #define MWA64_BANK11 ((write64_machine_func)STATIC_BANK11) | |
| 499 | #define MWA64_BANK12 ((write64_machine_func)STATIC_BANK12) | |
| 500 | #define MWA64_BANK13 ((write64_machine_func)STATIC_BANK13) | |
| 501 | #define MWA64_BANK14 ((write64_machine_func)STATIC_BANK14) | |
| 502 | #define MWA64_BANK15 ((write64_machine_func)STATIC_BANK15) | |
| 503 | #define MWA64_BANK16 ((write64_machine_func)STATIC_BANK16) | |
| 504 | #define MWA64_BANK17 ((write64_machine_func)STATIC_BANK17) | |
| 505 | #define MWA64_BANK18 ((write64_machine_func)STATIC_BANK18) | |
| 506 | #define MWA64_BANK19 ((write64_machine_func)STATIC_BANK19) | |
| 507 | #define MWA64_BANK20 ((write64_machine_func)STATIC_BANK20) | |
| 508 | #define MWA64_BANK21 ((write64_machine_func)STATIC_BANK21) | |
| 509 | #define MWA64_BANK22 ((write64_machine_func)STATIC_BANK22) | |
| 510 | #define MWA64_BANK23 ((write64_machine_func)STATIC_BANK23) | |
| 511 | #define MWA64_BANK24 ((write64_machine_func)STATIC_BANK24) | |
| 512 | #define MWA64_BANK25 ((write64_machine_func)STATIC_BANK25) | |
| 513 | #define MWA64_BANK26 ((write64_machine_func)STATIC_BANK26) | |
| 514 | #define MWA64_BANK27 ((write64_machine_func)STATIC_BANK27) | |
| 515 | #define MWA64_BANK28 ((write64_machine_func)STATIC_BANK28) | |
| 516 | #define MWA64_BANK29 ((write64_machine_func)STATIC_BANK29) | |
| 517 | #define MWA64_BANK30 ((write64_machine_func)STATIC_BANK30) | |
| 518 | #define MWA64_BANK31 ((write64_machine_func)STATIC_BANK31) | |
| 519 | #define MWA64_BANK32 ((write64_machine_func)STATIC_BANK32) | |
| 520 | #define MWA64_RAM ((write64_machine_func)STATIC_RAM) | |
| 521 | #define MWA64_ROM ((write64_machine_func)STATIC_ROM) | |
| 522 | #define MWA64_NOP ((write64_machine_func)STATIC_NOP) | |
| 523 | #define MWA64_UNMAP ((write64_machine_func)STATIC_UNMAP) | |
| 504 | 524 | |
| 505 | 525 | |
| 506 | 526 | |
| r1877 | r1878 | |
| 524 | 544 | typedef union _read_handlers read_handlers; |
| 525 | 545 | union _read_handlers |
| 526 | 546 | { |
| 527 | genf * handler; | |
| 528 | read8_handler handler8; | |
| 529 | read16_handler handler16; | |
| 530 | read32_handler handler32; | |
| 531 | read64_handler handler64; | |
| 547 | genf * handler; | |
| 548 | read8_machine_func handler8; | |
| 549 | read16_machine_func handler16; | |
| 550 | read32_machine_func handler32; | |
| 551 | read64_machine_func handler64; | |
| 532 | 552 | }; |
| 533 | 553 | |
| 534 | 554 | /* ----- a union of all the different write handler types ----- */ |
| 535 | 555 | typedef union _write_handlers write_handlers; |
| 536 | 556 | union _write_handlers |
| 537 | 557 | { |
| 538 | genf * handler; | |
| 539 | write8_handler handler8; | |
| 540 | write16_handler handler16; | |
| 541 | write32_handler handler32; | |
| 542 | write64_handler handler64; | |
| 558 | genf * handler; | |
| 559 | write8_machine_func handler8; | |
| 560 | write16_machine_func handler16; | |
| 561 | write32_machine_func handler32; | |
| 562 | write64_machine_func handler64; | |
| 543 | 563 | }; |
| 544 | 564 | |
| 545 | 565 | /* ----- a generic address map type ----- */ |
| r1877 | r1878 | |
| 547 | 567 | struct _address_map |
| 548 | 568 | { |
| 549 | 569 | UINT32 flags; /* flags and additional info about this entry */ |
| 550 | offs_t start, end; /* start/end | |
| 570 | offs_t start, end; /* start/end | |
| 551 | 571 | offs_t mirror; /* mirror bits */ |
| 552 | 572 | offs_t mask; /* mask bits */ |
| 553 | 573 | read_handlers read; /* read handler callback */ |
| 554 | 574 | const char * read_name; /* read handler callback name */ |
| 575 | device_type read_devtype; /* read device type for device references */ | |
| 576 | const char * read_devtag; /* read tag for the relevant device */ | |
| 555 | 577 | write_handlers write; /* write handler callback */ |
| 556 | 578 | const char * write_name; /* write handler callback name */ |
| 579 | device_type write_devtype; /* read device type for device references */ | |
| 580 | const char * write_devtag; /* read tag for the relevant device */ | |
| 557 | 581 | void * memory; /* pointer to memory backing this entry */ |
| 558 | 582 | UINT32 share; /* index of a shared memory block */ |
| 559 | 583 | void ** base; /* receives pointer to memory (optional) */ |
| r1877 | r1878 | |
| 583 | 607 | void construct_address_map(address_map *map, const machine_config *drv, int cpunum, int spacenum); |
| 584 | 608 | |
| 585 | 609 | /* ----- a typedef for pointers to these functions ----- */ |
| 586 | typedef address_map *(*construct_map_t)(address_map *map); | |
| 610 | typedef address_map *(*construct_map_t)(running_machine *machine, address_map *map); | |
| 587 | 611 | |
| 588 | 612 | /* use this to declare external references to a machine driver */ |
| 589 | 613 | #define ADDRESS_MAP_EXTERN(_name) \ |
| 590 | address_map *construct_map_##_name(address_map *map) \ | |
| 614 | address_map *construct_map_##_name(running_machine *machine, address_map *map) \ | |
| 591 | 615 | |
| 592 | 616 | /* ----- macros for starting, ending, and setting map flags ----- */ |
| 593 | 617 | #define ADDRESS_MAP_START(_name,_space,_bits) \ |
| 594 | address_map *construct_map_##_name(address_map *map) \ | |
| 618 | address_map *construct_map_##_name(running_machine *machine, address_map *map) \ | |
| 595 | 619 | { \ |
| 596 | extern read##_bits##_handler port_tag_to_handler##_bits(const char *); \ | |
| 597 | typedef read##_bits##_handler _rh_t; \ | |
| 598 | typedef write##_bits##_handler _wh_t; \ | |
| 599 | _rh_t read; \ | |
| 600 | _wh_t write; \ | |
| 601 | _rh_t (*port_tag_to_handler)(const char *) = port_tag_to_handler##_bits; \ | |
| 620 | extern read##_bits##_machine_func port_tag_to_handler##_bits(const char *); \ | |
| 621 | typedef read##_bits##_machine_func _rmf_t; \ | |
| 622 | typedef write##_bits##_machine_func _wmf_t; \ | |
| 623 | typedef read##_bits##_device_func _rdf_t; \ | |
| 624 | typedef write##_bits##_device_func _wdf_t; \ | |
| 625 | _rmf_t readm; \ | |
| 626 | _wmf_t writem; \ | |
| 627 | _rdf_t readd; \ | |
| 628 | _wdf_t writed; \ | |
| 629 | _rmf_t (*port_tag_to_handler)(const char *) = port_tag_to_handler##_bits; \ | |
| 602 | 630 | UINT##_bits **base; \ |
| 603 | 631 | \ |
| 604 | (void)read; (void)write; (void)base; \ | |
| 605 | (void)port_tag_to_handler; \ | |
| 632 | (void)readm; (void)writem; (void)readd; (void)writed; (void)base; \ | |
| 633 | (void)port_tag_to_handler; \ | |
| 606 | 634 | map->flags = AM_FLAGS_EXTENDED; \ |
| 607 | 635 | map->start = AMEF_DBITS(_bits) | AMEF_SPACE(_space); \ |
| 608 | 636 | |
| r1877 | r1878 | |
| 624 | 652 | map->start = (_start); \ |
| 625 | 653 | map->end = (_end); \ |
| 626 | 654 | |
| 627 | #define AM_SPACE(_match,_mask) \ | |
| 628 | map++; \ | |
| 629 | map->flags = AM_FLAGS_MATCH_MASK; \ | |
| 630 | map->start = (_match); \ | |
| 631 | map->end = (_mask); \ | |
| 632 | ||
| 633 | 655 | /* ----- these are optional entries after each map entry ----- */ |
| 634 | 656 | #define AM_MASK(_mask) \ |
| 635 | 657 | map->mask = (_mask); \ |
| r1877 | r1878 | |
| 638 | 660 | map->mirror = (_mirror); \ |
| 639 | 661 | |
| 640 | 662 | #define AM_READ(_handler) \ |
| 641 | map->read.handler = (genf *)(read = _handler); \ | |
| 663 | map->read.handler = (genf *)(readm = _handler); \ | |
| 642 | 664 | map->read_name = #_handler; \ |
| 643 | 665 | |
| 644 | #define AM_READ_PORT(_tag) \ | |
| 645 | AM_READ((*port_tag_to_handler)(_tag)) | |
| 666 | #define AM_READ_PORT(_tag) \ | |
| 667 | AM_READ((*port_tag_to_handler)(_tag)) \ | |
| 646 | 668 | |
| 669 | #define AM_DEVREAD(_type, _tag, _handler) \ | |
| 670 | map->read.handler = (genf *)(readd = _handler); \ | |
| 671 | map->read_name = #_handler; \ | |
| 672 | map->read_devtype = _type; \ | |
| 673 | map->read_devtag = _tag; \ | |
| 674 | ||
| 647 | 675 | #define AM_WRITE(_handler) \ |
| 648 | map->write.handler = (genf *)(write = _handler); \ | |
| 676 | map->write.handler = (genf *)(writem = _handler); \ | |
| 649 | 677 | map->write_name = #_handler; \ |
| 650 | 678 | |
| 679 | #define AM_DEVWRITE(_type, _tag, _handler) \ | |
| 680 | map->write.handler = (genf *)(writed = _handler); \ | |
| 681 | map->write_name = #_handler; \ | |
| 682 | map->write_devtype = _type; \ | |
| 683 | map->write_devtag = _tag; \ | |
| 684 | ||
| 651 | 685 | #define AM_REGION(_region, _offs) \ |
| 652 | 686 | map->region = (_region); \ |
| 653 | 687 | map->region_offs = (_offs); \ |
| r1877 | r1878 | |
| 659 | 693 | map->base = (void **)(base = _base); \ |
| 660 | 694 | |
| 661 | 695 | #define AM_BASE_MEMBER(_struct, _member) \ |
| 662 | if (Machine != NULL && Machine->driver_data != NULL) \ | |
| 663 | map->base = (void **)(base = &((_struct *)Machine->driver_data)->_member);\ | |
| 696 | if (machine != NULL && machine->driver_data != NULL) \ | |
| 697 | map->base = (void **)(base = &((_struct *)machine->driver_data)->_member);\ | |
| 664 | 698 | |
| 665 | 699 | #define AM_SIZE(_size) \ |
| 666 | 700 | map->size = _size; \ |
| 667 | 701 | |
| 668 | 702 | #define AM_SIZE_MEMBER(_struct, _member) \ |
| 669 | if (Machine != NULL && Machine->driver_data != NULL) \ | |
| 670 | map->size = &((_struct *)Machine->driver_data)->_member; \ | |
| 703 | if (machine != NULL && machine->driver_data != NULL) \ | |
| 704 | map->size = &((_struct *)machine->driver_data)->_member; \ | |
| 671 | 705 | |
| 672 | 706 | /* ----- common shortcuts ----- */ |
| 673 | 707 | #define AM_READWRITE(_read,_write) AM_READ(_read) AM_WRITE(_write) |
| 674 | #define AM_ROM AM_READ((_rh_t)STATIC_ROM) | |
| 675 | #define AM_RAM AM_READWRITE((_rh_t)STATIC_RAM, (_wh_t)STATIC_RAM) | |
| 676 | #define AM_WRITEONLY AM_WRITE((_wh_t)STATIC_RAM) | |
| 677 | #define AM_UNMAP AM_READWRITE((_rh_t)STATIC_UNMAP, (_wh_t)STATIC_UNMAP) | |
| 678 | #define AM_ROMBANK(_bank) AM_READ((_rh_t)(STATIC_BANK1 + (_bank) - 1)) | |
| 679 | #define AM_RAMBANK(_bank) AM_READWRITE((_rh_t)(STATIC_BANK1 + (_bank) - 1), (_wh_t)(STATIC_BANK1 + (_bank) - 1)) | |
| 680 | #define AM_NOP AM_READWRITE((_rh_t)STATIC_NOP, (_wh_t)STATIC_NOP) | |
| 681 | #define AM_READNOP AM_READ((_rh_t)STATIC_NOP) | |
| 682 | #define AM_WRITENOP AM_WRITE((_wh_t)STATIC_NOP) | |
| 708 | #define AM_DEVREADWRITE(_type,_tag,_read,_write) AM_DEVREAD(_type,_tag,_read) AM_DEVWRITE(_type,_tag,_write) | |
| 709 | #define AM_ROM AM_READ((_rmf_t)STATIC_ROM) | |
| 710 | #define AM_RAM AM_READWRITE((_rmf_t)STATIC_RAM, (_wmf_t)STATIC_RAM) | |
| 711 | #define AM_WRITEONLY AM_WRITE((_wmf_t)STATIC_RAM) | |
| 712 | #define AM_UNMAP AM_READWRITE((_rmf_t)STATIC_UNMAP, (_wmf_t)STATIC_UNMAP) | |
| 713 | #define AM_ROMBANK(_bank) AM_READ((_rmf_t)(STATIC_BANK1 + (_bank) - 1)) | |
| 714 | #define AM_RAMBANK(_bank) AM_READWRITE((_rmf_t)(STATIC_BANK1 + (_bank) - 1), (_wmf_t)(STATIC_BANK1 + (_bank) - 1)) | |
| 715 | #define AM_NOP AM_READWRITE((_rmf_t)STATIC_NOP, (_wmf_t)STATIC_NOP) | |
| 716 | #define AM_READNOP AM_READ((_rmf_t)STATIC_NOP) | |
| 717 | #define AM_WRITENOP AM_WRITE((_wmf_t)STATIC_NOP) | |
| 683 | 718 | |
| 684 | 719 | |
| 685 | 720 | |
| r1877 | r1878 | |
| 689 | 724 | |
| 690 | 725 | /* ----- macros for identifying address map struct markers ----- */ |
| 691 | 726 | #define IS_AMENTRY_EXTENDED(ma) (((ma)->flags & AM_FLAGS_EXTENDED) != 0) |
| 692 | #define IS_AMENTRY_MATCH_MASK(ma) (((ma)->flags & AM_FLAGS_MATCH_MASK) != 0) | |
| 693 | 727 | #define IS_AMENTRY_END(ma) (((ma)->flags & AM_FLAGS_END) != 0) |
| 694 | 728 | |
| 695 | 729 | #define AM_EXTENDED_FLAGS(ma) ((ma)->start) |
| r1877 | r1878 | |
| 919 | 953 | const address_map *memory_get_map(int cpunum, int spacenum); |
| 920 | 954 | |
| 921 | 955 | /* ----- opcode base control ---- */ |
| 922 | opbase_handler memory_set_opbase_handler(int cpunum, opbase_handler function); | |
| 956 | opbase_handler_func memory_set_opbase_handler(int cpunum, opbase_handler_func function); | |
| 923 | 957 | void memory_set_opbase(offs_t offset); |
| 924 | 958 | |
| 925 | 959 | /* ----- separate opcode/data encryption helper ---- */ |
| r1877 | r1878 | |
| 944 | 978 | |
| 945 | 979 | /* ----- dynamic address space mapping ----- */ |
| 946 | 980 | void * _memory_install_read_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, FPTR handler, const char *handler_name); |
| 947 | UINT8 * _memory_install_read8_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_handler handler, const char *handler_name); | |
| 948 | UINT16 * _memory_install_read16_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_handler handler, const char *handler_name); | |
| 949 | UINT32 * _memory_install_read32_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read32_handler handler, const char *handler_name); | |
| 950 | UINT64 * _memory_install_read64_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read64_handler handler, const char *handler_name); | |
| 981 | UINT8 * _memory_install_read8_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_machine_func handler, const char *handler_name); | |
| 982 | UINT16 * _memory_install_read16_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_machine_func handler, const char *handler_name); | |
| 983 | UINT32 * _memory_install_read32_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read32_machine_func handler, const char *handler_name); | |
| 984 | UINT64 * _memory_install_read64_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read64_machine_func handler, const char *handler_name); | |
| 951 | 985 | void * _memory_install_write_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, FPTR handler, const char *handler_name); |
| 952 | UINT8 * _memory_install_write8_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write8_handler handler, const char *handler_name); | |
| 953 | UINT16 * _memory_install_write16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write16_handler handler, const char *handler_name); | |
| 954 | UINT32 * _memory_install_write32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write32_handler handler, const char *handler_name); | |
| 955 | UINT64 * _memory_install_write64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write64_handler handler, const char *handler_name); | |
| 986 | UINT8 * _memory_install_write8_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write8_machine_func handler, const char *handler_name); | |
| 987 | UINT16 * _memory_install_write16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write16_machine_func handler, const char *handler_name); | |
| 988 | UINT32 * _memory_install_write32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write32_machine_func handler, const char *handler_name); | |
| 989 | UINT64 * _memory_install_write64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write64_machine_func handler, const char *handler_name); | |
| 956 | 990 | void * _memory_install_readwrite_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name); |
| 957 | UINT8 * _memory_install_readwrite8_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_handler rhandler, write8_handler whandler, const char *rhandler_name, const char *whandler_name); | |
| 958 | UINT16 * _memory_install_readwrite16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_handler rhandler, write16_handler whandler, const char *rhandler_name, const char *whandler_name); | |
| 959 | UINT32 * _memory_install_readwrite32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read32_handler rhandler, write32_handler whandler, const char *rhandler_name, const char *whandler_name); | |
| 960 | UINT64 * _memory_install_readwrite64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read64_handler rhandler, write64_handler whandler, const char *rhandler_name, const char *whandler_name); | |
| 991 | UINT8 * _memory_install_readwrite8_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_machine_func rhandler, write8_machine_func whandler, const char *rhandler_name, const char *whandler_name); | |
| 992 | UINT16 * _memory_install_readwrite16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_machine_func rhandler, write16_machine_func whandler, const char *rhandler_name, const char *whandler_name); | |
| 993 | UINT32 * _memory_install_readwrite32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read32_machine_func rhandler, write32_machine_func whandler, const char *rhandler_name, const char *whandler_name); | |
| 994 | UINT64 * _memory_install_readwrite64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read64_machine_func rhandler, write64_machine_func whandler, const char *rhandler_name, const char *whandler_name); | |
| 961 | 995 | |
| 962 | void * _memory_install_read_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, FPTR handler, const char *handler_name); | |
| 963 | UINT8 * _memory_install_read8_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read8_handler handler, const char *handler_name); | |
| 964 | UINT16 * _memory_install_read16_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read16_handler handler, const char *handler_name); | |
| 965 | UINT32 * _memory_install_read32_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read32_handler handler, const char *handler_name); | |
| 966 | UINT64 * _memory_install_read64_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read64_handler handler, const char *handler_name); | |
| 967 | void * _memory_install_write_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, FPTR handler, const char *handler_name); | |
| 968 | UINT8 * _memory_install_write8_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write8_handler handler, const char *handler_name); | |
| 969 | UINT16 * _memory_install_write16_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write16_handler handler, const char *handler_name); | |
| 970 | UINT32 * _memory_install_write32_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write32_handler handler, const char *handler_name); | |
| 971 | UINT64 * _memory_install_write64_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write64_handler handler, const char *handler_name); | |
| 972 | ||
| 973 | 996 | /* ----- memory debugging ----- */ |
| 974 | 997 | void memory_dump(FILE *file); |
| 975 | 998 | const char *memory_get_handler_string(int read0_or_write1, int cpunum, int spacenum, offs_t offset); |
| r1877 | r1878 | |
| 1047 | 1070 | #define memory_install_readwrite64_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \ |
| 1048 | 1071 | _memory_install_readwrite64_handler(cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler) |
| 1049 | 1072 | |
| 1050 | #define memory_install_read_matchmask_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1051 | _memory_install_read_matchmask_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 1052 | #define memory_install_read8_matchmask_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1053 | _memory_install_read8_matchmask_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 1054 | #define memory_install_read16_matchmask_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1055 | _memory_install_read16_matchmask_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 1056 | #define memory_install_read32_matchmask_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1057 | _memory_install_read32_matchmask_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 1058 | #define memory_install_read64_matchmask_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1059 | _memory_install_read64_matchmask_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 1060 | ||
| 1061 | #define memory_install_write_matchmask_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1062 | _memory_install_write_matchmask_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 1063 | #define memory_install_write8_matchmask_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1064 | _memory_install_write8_matchmask_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 1065 | #define memory_install_write16_matchmask_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1066 | _memory_install_write16_matchmask_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 1067 | #define memory_install_write32_matchmask_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1068 | _memory_install_write32_matchmask_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 1069 | #define memory_install_write64_matchmask_handler(cpu, space, start, end, mask, mirror, handler) \ | |
| 1070 | _memory_install_write64_matchmask_handler(cpu, space, start, end, mask, mirror, handler, #handler) | |
| 1071 | ||
| 1072 | 1073 | /* ----- generic memory access ----- */ |
| 1073 | 1074 | INLINE UINT8 program_read_byte (offs_t offset) { return (*active_address_space[ADDRESS_SPACE_PROGRAM].accessors->read_byte)(offset); } |
| 1074 | 1075 | INLINE UINT16 program_read_word (offs_t offset) { return (*active_address_space[ADDRESS_SPACE_PROGRAM].accessors->read_word)(offset); } |
| r1877 | r1878 | |
|---|---|---|
| 46 | 46 | - calls rom_init() [romload.c] to load the game's ROMs |
| 47 | 47 | - calls memory_init() [memory.c] to process the game's memory maps |
| 48 | 48 | - calls cpuexec_init() [cpuexec.c] to initialize the CPUs |
| 49 | - calls watchdog_init() [watchdog.c] to initialize the watchdog system | |
| 49 | 50 | - calls cpuint_init() [cpuint.c] to initialize the CPU interrupts |
| 50 | - calls mame_debug_init() [debugcpu.c] to set up the debugger | |
| 51 | 51 | - calls the driver's DRIVER_INIT callback |
| 52 | 52 | - calls video_init() [video.c] to start the video system |
| 53 | 53 | - calls sound_init() [sound.c] to start the audio system |
| 54 | - calls mame_debug_init() [debugcpu.c] to set up the debugger | |
| 54 | 55 | - calls the driver's MACHINE_START, SOUND_START, and VIDEO_START callbacks |
| 55 | 56 | - disposes of regions marked as disposable |
| 56 | 57 | - calls saveload_init() [mame.c] to set up for save/load |
| r1877 | r1878 | |
| 188 | 189 | static UINT8 started_empty; |
| 189 | 190 | |
| 190 | 191 | /* output channels */ |
| 191 | static output_callback output_cb[OUTPUT_CHANNEL_COUNT]; | |
| 192 | static output_callback_func output_cb[OUTPUT_CHANNEL_COUNT]; | |
| 192 | 193 | static void *output_cb_param[OUTPUT_CHANNEL_COUNT]; |
| 193 | 194 | |
| 194 | 195 | /* the "disclaimer" that should be printed when run with no parameters */ |
| r1877 | r1878 | |
| 930 | 931 | channel |
| 931 | 932 | -------------------------------------------------*/ |
| 932 | 933 | |
| 933 | void mame_set_output_channel(output_channel channel, output_callback callback, void *param, output_callback *prevcb, void **prevparam) | |
| 934 | void mame_set_output_channel(output_channel channel, output_callback_func callback, void *param, output_callback_func *prevcb, void **prevparam) | |
| 934 | 935 | { |
| 935 | 936 | assert(channel < OUTPUT_CHANNEL_COUNT); |
| 936 | 937 | assert(callback != NULL); |
| r1877 | r1878 | |
| 1566 | 1567 | rom_init(machine, machine->gamedrv->rom); |
| 1567 | 1568 | memory_init(machine); |
| 1568 | 1569 | cpuexec_init(machine); |
| 1570 | watchdog_init(machine); | |
| 1569 | 1571 | cpuint_init(machine); |
| 1570 | 1572 | |
| 1571 | 1573 | #ifdef MESS |
| r1877 | r1878 | |
| 1573 | 1575 | devices_init(machine); |
| 1574 | 1576 | #endif |
| 1575 | 1577 | |
| 1576 | #ifdef ENABLE_DEBUGGER | |
| 1577 | /* initialize the debugger */ | |
| 1578 | if (machine->debug_mode) | |
| 1579 | mame_debug_init(machine); | |
| 1580 | #endif | |
| 1581 | ||
| 1582 | 1578 | /* call the game driver's init function */ |
| 1583 | 1579 | /* this is where decryption is done and memory maps are altered */ |
| 1584 | 1580 | /* so this location in the init order is important */ |
| r1877 | r1878 | |
| 1593 | 1589 | device_list_start(machine); |
| 1594 | 1590 | |
| 1595 | 1591 | sound_init(machine); |
| 1592 | input_port_post_init(machine); | |
| 1596 | 1593 | |
| 1594 | #ifdef ENABLE_DEBUGGER | |
| 1595 | /* initialize the debugger */ | |
| 1596 | if (machine->debug_mode) | |
| 1597 | mame_debug_init(machine); | |
| 1598 | #endif | |
| 1599 | ||
| 1597 | 1600 | /* call the driver's _START callbacks */ |
| 1598 | 1601 | if (machine->config->machine_start != NULL) (*machine->config->machine_start)(machine); |
| 1599 | 1602 | if (machine->config->sound_start != NULL) (*machine->config->sound_start)(machine); |
| r1877 | r1878 | |
|---|---|---|
| 169 | 169 | }; |
| 170 | 170 | |
| 171 | 171 | |
| 172 | typedef struct _changed_port_info changed_port_info; | |
| 173 | struct _changed_port_info | |
| 174 | { | |
| 175 | changed_port_info * next; /* linked list */ | |
| 176 | input_port_entry * port; /* pointer to the input port referenced */ | |
| 177 | UINT8 shift; /* right shift to apply before calling callback */ | |
| 178 | }; | |
| 179 | ||
| 180 | ||
| 172 | 181 | typedef struct _input_bit_info input_bit_info; |
| 173 | 182 | struct _input_bit_info |
| 174 | 183 | { |
| r1877 | r1878 | |
| 178 | 187 | }; |
| 179 | 188 | |
| 180 | 189 | |
| 181 | typedef struct _changed_callback_info changed_callback_info; | |
| 182 | struct _changed_callback_info | |
| 183 | { | |
| 184 | changed_callback_info *next; /* linked list */ | |
| 185 | UINT32 mask; /* mask we care about */ | |
| 186 | input_port_changed_func callback;/* callback */ | |
| 187 | void * param; /* parameter */ | |
| 188 | }; | |
| 189 | ||
| 190 | ||
| 191 | 190 | typedef struct _input_port_info input_port_info; |
| 192 | 191 | struct _input_port_info |
| 193 | 192 | { |
| r1877 | r1878 | |
| 202 | 201 | input_bit_info bit[MAX_BITS_PER_PORT]; /* info about each bit in the port */ |
| 203 | 202 | analog_port_info * analoginfo; /* pointer to linked list of analog port info */ |
| 204 | 203 | custom_port_info * custominfo; /* pointer to linked list of custom port info */ |
| 205 | changed_callback_info *change_notify;/* list of people to notify if things change */ | |
| 206 | UINT32 changed_last_value; | |
| 204 | changed_port_info * changedinfo;/* pointer to linked list of changed port info */ | |
| 207 | 205 | }; |
| 208 | 206 | |
| 209 | 207 | |
| r1877 | r1878 | |
| 276 | 274 | PORT HANDLER TABLES |
| 277 | 275 | ***************************************************************************/ |
| 278 | 276 | |
| 279 | static const read8_ | |
| 277 | static const read8_machin | |
| 280 | 278 | { |
| 281 | 279 | input_port_0_r, input_port_1_r, input_port_2_r, input_port_3_r, |
| 282 | 280 | input_port_4_r, input_port_5_r, input_port_6_r, input_port_7_r, |
| r1877 | r1878 | |
| 289 | 287 | }; |
| 290 | 288 | |
| 291 | 289 | |
| 292 | static const read16_ | |
| 290 | static const read16_machin | |
| 293 | 291 | { |
| 294 | 292 | input_port_0_word_r, input_port_1_word_r, input_port_2_word_r, input_port_3_word_r, |
| 295 | 293 | input_port_4_word_r, input_port_5_word_r, input_port_6_word_r, input_port_7_word_r, |
| r1877 | r1878 | |
| 302 | 300 | }; |
| 303 | 301 | |
| 304 | 302 | |
| 305 | static const read32_ | |
| 303 | static const read32_machin | |
| 306 | 304 | { |
| 307 | 305 | input_port_0_dword_r, input_port_1_dword_r, input_port_2_dword_r, input_port_3_dword_r, |
| 308 | 306 | input_port_4_dword_r, input_port_5_dword_r, input_port_6_dword_r, input_port_7_dword_r, |
| r1877 | r1878 | |
| 1034 | 1032 | FUNCTION PROTOTYPES |
| 1035 | 1033 | ***************************************************************************/ |
| 1036 | 1034 | |
| 1035 | static void on_vblank(running_machine *machine, screen_state *screen, int vblank_state); | |
| 1037 | 1036 | static void setup_playback(running_machine *machine); |
| 1038 | 1037 | static void setup_record(running_machine *machine); |
| 1039 | 1038 | static void input_port_exit(running_machine *machine); |
| 1040 | 1039 | static void input_port_load(int config_type, xml_data_node *parentnode); |
| 1041 | 1040 | static void input_port_save(int config_type, xml_data_node *parentnode); |
| 1041 | static void input_port_vblank_start(running_machine *machine); | |
| 1042 | static void input_port_vblank_end(void); | |
| 1042 | 1043 | static void update_digital_joysticks(void); |
| 1043 | 1044 | static void update_analog_port(int port); |
| 1044 | 1045 | static void interpolate_analog_port(int port); |
| r1877 | r1878 | |
| 1138 | 1139 | } |
| 1139 | 1140 | |
| 1140 | 1141 | |
| 1142 | void input_port_post_init(running_machine *machine) | |
| 1143 | { | |
| 1144 | /* set up callback for updating the ports */ | |
| 1145 | video_screen_register_vbl_cb(machine, NULL, on_vblank); | |
| 1146 | } | |
| 1147 | ||
| 1148 | ||
| 1149 | ||
| 1141 | 1150 | /************************************* |
| 1142 | 1151 | * |
| 1152 | * VBLANK handler | |
| 1153 | * | |
| 1154 | *************************************/ | |
| 1155 | ||
| 1156 | static void on_vblank(running_machine *machine, screen_state *screen, int vblank_state) | |
| 1157 | { | |
| 1158 | /* VBLANK starting - read keyboard & update the status of the input ports */ | |
| 1159 | if (vblank_state) | |
| 1160 | input_port_vblank_start(machine); | |
| 1161 | ||
| 1162 | /* VBLANK ending - update IPT_VBLANK input ports */ | |
| 1163 | else | |
| 1164 | input_port_vblank_end(); | |
| 1165 | } | |
| 1166 | ||
| 1167 | ||
| 1168 | ||
| 1169 | /************************************* | |
| 1170 | * | |
| 1143 | 1171 | * Set up for playback |
| 1144 | 1172 | * |
| 1145 | 1173 | *************************************/ |
| r1877 | r1878 | |
| 1311 | 1339 | port_info[portnum].custominfo = info; |
| 1312 | 1340 | } |
| 1313 | 1341 | |
| 1342 | /* if this is a changed input, add it to the list */ | |
| 1343 | else if (port->changed != NULL) | |
| 1344 | { | |
| 1345 | changed_port_info *info; | |
| 1346 | ||
| 1347 | /* allocate memory */ | |
| 1348 | info = auto_malloc(sizeof(*info)); | |
| 1349 | memset(info, 0, sizeof(*info)); | |
| 1350 | ||
| 1351 | /* fill in the data */ | |
| 1352 | info->port = port; | |
| 1353 | for (mask = port->mask; !(mask & 1); mask >>= 1) | |
| 1354 | info->shift++; | |
| 1355 | ||
| 1356 | /* hook in the list */ | |
| 1357 | info->next = port_info[portnum].changedinfo; | |
| 1358 | port_info[portnum].changedinfo = info; | |
| 1359 | } | |
| 1360 | ||
| 1314 | 1361 | /* if this is an analog port, create an info struct for it */ |
| 1315 | 1362 | else if (IS_ANALOG(port)) |
| 1316 | 1363 | { |
| r1877 | r1878 | |
| 1492 | 1539 | } |
| 1493 | 1540 | |
| 1494 | 1541 | /* run an initial update */ |
| 1495 | input_port_vblank_start(); | |
| 1542 | input_port_vblank_start(Machine); | |
| 1496 | 1543 | } |
| 1497 | 1544 | |
| 1498 | 1545 | |
| r1877 | r1878 | |
| 1529 | 1576 | * |
| 1530 | 1577 | *************************************/ |
| 1531 | 1578 | |
| 1579 | #ifdef UNUSED_FUNCTION | |
| 1532 | 1580 | INLINE input_code get_default_code(int config_type, int type) |
| 1533 | 1581 | { |
| 1534 | 1582 | switch (type) |
| r1877 | r1878 | |
| 1545 | 1593 | } |
| 1546 | 1594 | return SEQCODE_END; |
| 1547 | 1595 | } |
| 1596 | #endif | |
| 1548 | 1597 | |
| 1549 | 1598 | |
| 1550 | 1599 | INLINE int string_to_seq_index(const char *string) |
| r1877 | r1878 | |
| 2109 | 2158 | port->custom_param = (void *)TOKEN_GET_PTR(ipt, voidptr); |
| 2110 | 2159 | break; |
| 2111 | 2160 | |
| 2161 | /* changed callbacks */ | |
| 2162 | case INPUT_TOKEN_CHANGED: | |
| 2163 | port->changed = TOKEN_GET_PTR(ipt, changedptr); | |
| 2164 | port->changed_param = (void *)TOKEN_GET_PTR(ipt, voidptr); | |
| 2165 | break; | |
| 2166 | ||
| 2112 | 2167 | /* dip switch definition */ |
| 2113 | 2168 | case INPUT_TOKEN_DIPNAME: |
| 2114 | 2169 | TOKEN_GET_UINT64_UNPACK2(ipt, mask, 32, defval, 32); |
| r1877 | r1878 | |
| 2520 | 2575 | } |
| 2521 | 2576 | |
| 2522 | 2577 | |
| 2523 | read8_ | |
| 2578 | read8_machin | |
| 2524 | 2579 | { |
| 2525 | 2580 | int port = port_tag_to_index(tag); |
| 2526 | 2581 | return (port == -1) ? MRA8_NOP : port_handler8[port]; |
| 2527 | 2582 | } |
| 2528 | 2583 | |
| 2529 | 2584 | |
| 2530 | read16_ | |
| 2585 | read16_machin | |
| 2531 | 2586 | { |
| 2532 | 2587 | int port = port_tag_to_index(tag); |
| 2533 | 2588 | return (port == -1) ? MRA16_NOP : port_handler16[port]; |
| 2534 | 2589 | } |
| 2535 | 2590 | |
| 2536 | 2591 | |
| 2537 | read32_ | |
| 2592 | read32_machin | |
| 2538 | 2593 | { |
| 2539 | 2594 | int port = port_tag_to_index(tag); |
| 2540 | 2595 | return (port == -1) ? MRA32_NOP : port_handler32[port]; |
| 2541 | 2596 | } |
| 2542 | 2597 | |
| 2543 | 2598 | |
| 2544 | read64_ | |
| 2599 | read64_machin | |
| 2545 | 2600 | { |
| 2546 | 2601 | return MRA64_NOP; |
| 2547 | 2602 | } |
| r1877 | r1878 | |
| 2825 | 2880 | * |
| 2826 | 2881 | *************************************/ |
| 2827 | 2882 | |
| 2828 | void input_port_vblank_start( | |
| 2883 | static void input_port_vblank_start(running_machine *machine) | |
| 2829 | 2884 | { |
| 2830 | 2885 | int ui_visible = ui_is_menu_active() || ui_is_slider_active(); |
| 2831 | 2886 | int portnum, bitnum; |
| r1877 | r1878 | |
| 2843 | 2898 | { |
| 2844 | 2899 | input_port_info *portinfo = &port_info[portnum]; |
| 2845 | 2900 | input_bit_info *info; |
| 2901 | changed_port_info *changed; | |
| 2846 | 2902 | |
| 2847 | 2903 | /* compute the VBLANK mask */ |
| 2848 | 2904 | portinfo->vblank = 0; |
| r1877 | r1878 | |
| 2850 | 2906 | if (info->port->type == IPT_VBLANK) |
| 2851 | 2907 | { |
| 2852 | 2908 | portinfo->vblank ^= info->port->mask; |
| 2853 | if ( | |
| 2909 | if (machine->screen[0].vblank == 0) | |
| 2854 | 2910 | logerror("Warning: you are using IPT_VBLANK with vblank_time = 0. You need to increase vblank_time for IPT_VBLANK to work.\n"); |
| 2855 | 2911 | } |
| 2856 | 2912 | |
| r1877 | r1878 | |
| 2937 | 2993 | |
| 2938 | 2994 | /* note that analog ports are handled instantaneously at port read time */ |
| 2939 | 2995 | } |
| 2996 | ||
| 2997 | /* call changed handlers */ | |
| 2998 | for (changed = portinfo->changedinfo; changed; changed = changed->next) | |
| 2999 | if (input_port_condition(changed->port)) | |
| 3000 | { | |
| 3001 | input_port_entry *port = changed->port; | |
| 3002 | ||
| 3003 | UINT32 new_unmasked_value = readinputport(portnum); | |
| 3004 | UINT32 newval = (new_unmasked_value & port->mask) >> changed->shift; | |
| 3005 | UINT32 oldval = (port->changed_last_value & port->mask) >> changed->shift; | |
| 3006 | ||
| 3007 | if (newval != oldval) | |
| 3008 | (*port->changed)(machine, port->changed_param, oldval, newval); | |
| 3009 | ||
| 3010 | port->changed_last_value = new_unmasked_value; | |
| 3011 | } | |
| 2940 | 3012 | } |
| 2941 | 3013 | |
| 2942 | 3014 | #ifdef MESS |
| r1877 | r1878 | |
| 2944 | 3016 | inputx_update(); |
| 2945 | 3017 | #endif |
| 2946 | 3018 | |
| 2947 | /* call changed handlers */ | |
| 2948 | for (portnum = 0; portnum < MAX_INPUT_PORTS; portnum++) | |
| 2949 | if (port_info[portnum].change_notify != NULL) | |
| 2950 | { | |
| 2951 | changed_callback_info *cbinfo; | |
| 2952 | UINT32 newvalue = readinputport(portnum); | |
| 2953 | UINT32 oldvalue = port_info[portnum].changed_last_value; | |
| 2954 | UINT32 delta = newvalue ^ oldvalue; | |
| 2955 | ||
| 2956 | /* call all the callbacks whose mask matches the requested mask */ | |
| 2957 | for (cbinfo = port_info[portnum].change_notify; cbinfo; cbinfo = cbinfo->next) | |
| 2958 | if (delta & cbinfo->mask) | |
| 2959 | (*cbinfo->callback)(cbinfo->param, oldvalue & cbinfo->mask, newvalue & cbinfo->mask); | |
| 2960 | ||
| 2961 | port_info[portnum].changed_last_value = newvalue; | |
| 2962 | } | |
| 2963 | ||
| 2964 | 3019 | /* handle playback/record */ |
| 2965 | 3020 | for (portnum = 0; portnum < MAX_INPUT_PORTS; portnum++) |
| 2966 | 3021 | { |
| r1877 | r1878 | |
| 2974 | 3029 | } |
| 2975 | 3030 | |
| 2976 | 3031 | /* store speed read from INP file, if extended INP */ |
| 2977 | if ( | |
| 3032 | if (machine->playback_file != NULL && extended_inp) | |
| 2978 | 3033 | { |
| 2979 | 3034 | UINT32 dummy; |
| 2980 | mame_fread(Machine->playback_file, &rec_speed, sizeof(rec_speed)); | |
| 2981 | mame_fread(Machine->playback_file, &dummy, sizeof(dummy)); | |
| 3035 | mame_fread(machine->playback_file, &rec_speed, sizeof(rec_speed)); | |
| 3036 | mame_fread(machine->playback_file, &dummy, sizeof(dummy)); | |
| 2982 | 3037 | framecount++; |
| 2983 | 3038 | rec_speed *= 100; |
| 2984 | 3039 | totalspeed += rec_speed; |
| r1877 | r1878 | |
| 2995 | 3050 | * |
| 2996 | 3051 | *************************************/ |
| 2997 | 3052 | |
| 2998 | void input_port_vblank_end(void) | |
| 3053 | static void input_port_vblank_end(void) | |
| 2999 | 3054 | { |
| 3000 | 3055 | int ui_visible = ui_is_menu_active() || ui_is_slider_active(); |
| 3001 | 3056 | int port; |
| r1877 | r1878 | |
| 3394 | 3449 | /* replace the bits with bits from the custom routine */ |
| 3395 | 3450 | input_port_entry *port = custom->port; |
| 3396 | 3451 | portinfo->digital &= ~port->mask; |
| 3397 | portinfo->digital |= ((*port->custom)(port->custom_param) << custom->shift) & port->mask; | |
| 3452 | portinfo->digital |= ((*port->custom)(Machine, port->custom_param) << custom->shift) & port->mask; | |
| 3398 | 3453 | } |
| 3399 | 3454 | |
| 3400 | 3455 | /* compute the current result: default value XOR the digital, merged with the analog */ |
| r1877 | r1878 | |
| 3415 | 3470 | result = (result & ~portinfo->vblank) | (portinfo->defvalue & portinfo->vblank); |
| 3416 | 3471 | |
| 3417 | 3472 | /* toggle VBLANK if we're in a VBLANK state */ |
| 3418 | if (Machine->screen[0].oldstyle_vblank_supplied) | |
| 3419 | { | |
| 3420 | int cpu_getvblank(void); | |
| 3421 | ||
| 3422 | if (cpu_getvblank()) | |
| 3423 | result ^= portinfo->vblank; | |
| 3424 | } | |
| 3425 | else | |
| 3426 | { | |
| 3427 | if (video_screen_get_vblank(0)) | |
| 3428 | result ^= portinfo->vblank; | |
| 3429 | } | |
| 3473 | if (video_screen_get_vblank(0)) | |
| 3474 | result ^= portinfo->vblank; | |
| 3430 | 3475 | } |
| 3431 | 3476 | return result; |
| 3432 | 3477 | } |
| r1877 | r1878 | |
| 3471 | 3516 | |
| 3472 | 3517 | /************************************* |
| 3473 | 3518 | * |
| 3474 | * Input port callbacks | |
| 3475 | * | |
| 3476 | *************************************/ | |
| 3477 | ||
| 3478 | void input_port_set_changed_callback(int port, UINT32 mask, void (*callback)(void *, UINT32, UINT32), void *param) | |
| 3479 | { | |
| 3480 | input_port_info *portinfo = &port_info[port]; | |
| 3481 | changed_callback_info *cbinfo; | |
| 3482 | ||
| 3483 | assert_always(mame_get_phase(Machine) == MAME_PHASE_INIT, "Can only call input_port_set_changed_callback() at init time!"); | |
| 3484 | assert_always((port >= 0) && (port < MAX_INPUT_PORTS), "Invalid port number passed to input_port_set_changed_callback()!"); | |
| 3485 | ||
| 3486 | cbinfo = auto_malloc(sizeof(*cbinfo)); | |
| 3487 | cbinfo->next = portinfo->change_notify; | |
| 3488 | cbinfo->mask = mask; | |
| 3489 | cbinfo->callback = callback; | |
| 3490 | cbinfo->param = param; | |
| 3491 | ||
| 3492 | portinfo->change_notify = cbinfo; | |
| 3493 | } | |
| 3494 | ||
| 3495 | ||
| 3496 | ||
| 3497 | /************************************* | |
| 3498 | * | |
| 3499 | 3519 | * Return position of crosshair axis |
| 3500 | 3520 | * |
| 3501 | 3521 | *************************************/ |
| r1877 | r1878 | |
|---|---|---|
| 41 | 41 | INT32 xoffs, yoffs; /* X and Y offset from baseline to top,left of bitmap */ |
| 42 | 42 | INT32 bmwidth, bmheight; /* width and height of bitmap */ |
| 43 | 43 | const char * rawdata; /* pointer to the raw data for this one */ |
| 44 | | |
| 44 | | |
| 45 | 45 | render_texture * texture; /* pointer to a texture for rendering and sizing */ |
| 46 | 46 | }; |
| 47 | 47 | |
| r1877 | r1878 | |
| 320 | 320 | string to a bitmap |
| 321 | 321 | -------------------------------------------------*/ |
| 322 | 322 | |
| 323 | void render_font_get_scaled_bitmap_and_bounds(render_font *font, | |
| 323 | void render_font_get_scaled_bitmap_and_bounds(render_font *font, | |
| 324 | 324 | { |
| 325 | 325 | render_font_char *ch = get_char(font, chnum); |
| 326 | 326 | float scale = font->scale * height; |
| r1877 | r1878 | |
|---|---|---|
| 319 | 319 | |
| 320 | 320 | |
| 321 | 321 | /*------------------------------------------------- |
| 322 | device_list_class_first - return the first | |
| 322 | device_list_class_first - return the first | |
| 323 | 323 | device in the list of a given class |
| 324 | 324 | -------------------------------------------------*/ |
| 325 | 325 | |
| r1877 | r1878 | |
| 337 | 337 | |
| 338 | 338 | |
| 339 | 339 | /*------------------------------------------------- |
| 340 | device_list_class_next - return the next | |
| 340 | device_list_class_next - return the next | |
| 341 | 341 | device in the list of a given class |
| 342 | 342 | -------------------------------------------------*/ |
| 343 | 343 | |
| r1877 | r1878 | |
| 357 | 357 | |
| 358 | 358 | |
| 359 | 359 | /*------------------------------------------------- |
| 360 | device_list_class_find_by_tag - retrieve a | |
| 360 | device_list_class_find_by_tag - retrieve a | |
| 361 | 361 | device configuration based on a class and tag |
| 362 | 362 | -------------------------------------------------*/ |
| 363 | 363 | |
| r1877 | r1878 | |
| 401 | 401 | |
| 402 | 402 | |
| 403 | 403 | /*------------------------------------------------- |
| 404 | device_list_class_find_by_index - retrieve a | |
| 405 | device configuration based on a class and | |
| 404 | device_list_class_find_by_index - retrieve a | |
| 405 | device configuration based on a class and | |
| 406 | 406 | index |
| 407 | 407 | -------------------------------------------------*/ |
| 408 | 408 | |
| r1877 | r1878 | |
| 446 | 446 | assert(config->start != NULL); |
| 447 | 447 | |
| 448 | 448 | /* call the start function */ |
| 449 | config->machine = machine; | |
| 449 | 450 | config->token = (*config->start)(machine, config->tag, config->static_config, config->inline_config); |
| 450 | 451 | assert(config->token != NULL); |
| 451 | 452 | |
| r1877 | r1878 | |
| 477 | 478 | |
| 478 | 479 | /* clear the token to indicate we are finished */ |
| 479 | 480 | config->token = NULL; |
| 481 | config->machine = NULL; | |
| 480 | 482 | } |
| 481 | 483 | } |
| 482 | 484 |
| r1877 | r1878 | |
|---|---|---|
| 42 | 42 | -------------------------------------------------*/ |
| 43 | 43 | |
| 44 | 44 | #define mul_32x32_hi _mul_32x32_hi |
| 45 | INLINE INT32 _ | |
| 45 | INLINE INT32 ATTR_CONST | |
| 46 | 46 | _mul_32x32_hi(INT32 val1, INT32 val2) |
| 47 | 47 | { |
| 48 | 48 | register INT32 result; |
| r1877 | r1878 | |
| 65 | 65 | -------------------------------------------------*/ |
| 66 | 66 | |
| 67 | 67 | #define mulu_32x32_hi _mulu_32x32_hi |
| 68 | INLINE UINT32 _ | |
| 68 | INLINE UINT32 ATTR_CONST | |
| 69 | 69 | _mulu_32x32_hi(UINT32 val1, UINT32 val2) |
| 70 | 70 | { |
| 71 | 71 | register UINT32 result; |
| r1877 | r1878 | |
| 90 | 90 | |
| 91 | 91 | #if !defined(__ppc64__) && !defined(__PPC64__) && !defined(_ARCH_PPC64) |
| 92 | 92 | #define mul_32x32_shift _mul_32x32_shift |
| 93 | INLINE INT32 _ | |
| 93 | INLINE INT32 ATTR_CONST | |
| 94 | 94 | _mul_32x32_shift(INT32 val1, INT32 val2, UINT8 shift) |
| 95 | 95 | { |
| 96 | 96 | register INT32 result; |
| r1877 | r1878 | |
| 124 | 124 | |
| 125 | 125 | #if !defined(__ppc64__) && !defined(__PPC64__) && !defined(_ARCH_PPC64) |
| 126 | 126 | #define mulu_32x32_shift _mulu_32x32_shift |
| 127 | INLINE UINT32 _ | |
| 127 | INLINE UINT32 ATTR_CONST | |
| 128 | 128 | _mulu_32x32_shift(UINT32 val1, UINT32 val2, UINT8 shift) |
| 129 | 129 | { |
| 130 | 130 | register UINT32 result; |
| r1877 | r1878 | |
| 223 | 223 | -------------------------------------------------*/ |
| 224 | 224 | |
| 225 | 225 | #define recip_approx _recip_approx |
| 226 | INLINE float _ | |
| 226 | INLINE float ATTR_CONST | |
| 227 | 227 | _recip_approx(float value) |
| 228 | 228 | { |
| 229 | 229 | register float result; |
| r1877 | r1878 | |
| 249 | 249 | -------------------------------------------------*/ |
| 250 | 250 | |
| 251 | 251 | #define count_leading_zeros _count_leading_zeros |
| 252 | INLINE UINT8 _ | |
| 252 | INLINE UINT8 ATTR_CONST | |
| 253 | 253 | _count_leading_zeros(UINT32 value) |
| 254 | 254 | { |
| 255 | 255 | register UINT32 result; |
| r1877 | r1878 | |
| 270 | 270 | -------------------------------------------------*/ |
| 271 | 271 | |
| 272 | 272 | #define count_leading_ones _count_leading_ones |
| 273 | INLINE UINT8 _ | |
| 273 | INLINE UINT8 ATTR_CONST | |
| 274 | 274 | _count_leading_ones(UINT32 value) |
| 275 | 275 | { |
| 276 | 276 | register UINT32 result; |
| r1877 | r1878 | |
| 299 | 299 | -------------------------------------------------*/ |
| 300 | 300 | |
| 301 | 301 | #define compare_exchange32 _compare_exchange32 |
| 302 | INLINE INT32 _ | |
| 302 | INLINE INT32 ATTR_NONNULL | |
| 303 | 303 | _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange) |
| 304 | 304 | { |
| 305 | 305 | register INT32 result; |
| r1877 | r1878 | |
| 333 | 333 | |
| 334 | 334 | #if defined(__ppc64__) || defined(__PPC64__) |
| 335 | 335 | #define compare_exchange64 _compare_exchange64 |
| 336 | INLINE INT64 _ | |
| 336 | INLINE INT64 ATTR_NONNULL | |
| 337 | 337 | _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange) |
| 338 | 338 | { |
| 339 | 339 | register INT64 result; |
| r1877 | r1878 | |
| 365 | 365 | -------------------------------------------------*/ |
| 366 | 366 | |
| 367 | 367 | #define atomic_exchange32 _atomic_exchange32 |
| 368 | INLINE INT32 _ | |
| 368 | INLINE INT32 ATTR_NONNULL | |
| 369 | 369 | _atomic_exchange32(INT32 volatile *ptr, INT32 exchange) |
| 370 | 370 | { |
| 371 | 371 | register INT32 result; |
| r1877 | r1878 | |
| 393 | 393 | -------------------------------------------------*/ |
| 394 | 394 | |
| 395 | 395 | #define atomic_add32 _atomic_add32 |
| 396 | INLINE INT32 _ | |
| 396 | INLINE INT32 ATTR_NONNULL | |
| 397 | 397 | _atomic_add32(INT32 volatile *ptr, INT32 delta) |
| 398 | 398 | { |
| 399 | 399 | register INT32 result; |
| r1877 | r1878 | |
| 422 | 422 | -------------------------------------------------*/ |
| 423 | 423 | |
| 424 | 424 | #define atomic_increment32 _atomic_increment32 |
| 425 | INLINE INT32 _ | |
| 425 | INLINE INT32 ATTR_NONNULL | |
| 426 | 426 | _atomic_increment32(INT32 volatile *ptr) |
| 427 | 427 | { |
| 428 | 428 | register INT32 result; |
| r1877 | r1878 | |
| 450 | 450 | -------------------------------------------------*/ |
| 451 | 451 | |
| 452 | 452 | #define atomic_decrement32 _atomic_decrement32 |
| 453 | INLINE INT32 _ | |
| 453 | INLINE INT32 ATTR_NONNULL | |
| 454 | 454 | _atomic_decrement32(INT32 volatile *ptr) |
| 455 | 455 | { |
| 456 | 456 | register INT32 result; |
| r1877 | r1878 | |
|---|---|---|
| 130 | 130 | |
| 131 | 131 | READ16_HANDLER( msm6242_lsb_r ) |
| 132 | 132 | { |
| 133 | return msm6242_r(offset); | |
| 133 | return msm6242_r(machine, offset); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | WRITE16_HANDLER( msm6242_lsb_w ) |
| 137 | 137 | { |
| 138 | 138 | if (ACCESSING_LSB) |
| 139 | msm6242_w(offset,data); | |
| 139 | msm6242_w(machine, offset, data); | |
| 140 | 140 | } |
| r1877 | r1878 | |
|---|---|---|
| 249 | 249 | |
| 250 | 250 | /* update the input */ |
| 251 | 251 | if (p->intf->in_a_func) |
| 252 | port_a_data = p->intf->in_a_func(0); | |
| 252 | port_a_data = p->intf->in_a_func(Machine, 0); | |
| 253 | 253 | else |
| 254 | 254 | { |
| 255 | 255 | if (p->in_a_pushed) |
| r1877 | r1878 | |
| 292 | 292 | |
| 293 | 293 | /* update the input */ |
| 294 | 294 | if (p->intf->in_b_func) |
| 295 | port_b_data = p->intf->in_b_func(0); | |
| 295 | port_b_data = p->intf->in_b_func(Machine, 0); | |
| 296 | 296 | else |
| 297 | 297 | { |
| 298 | 298 | if (p->in_b_pushed) |
| r1877 | r1878 | |
| 368 | 368 | |
| 369 | 369 | /* send to output function */ |
| 370 | 370 | if (p->intf->out_ca2_func) |
| 371 | p->intf->out_ca2_func(0, p->out_ca2); | |
| 371 | p->intf->out_ca2_func(Machine, 0, p->out_ca2); | |
| 372 | 372 | else |
| 373 | 373 | { |
| 374 | 374 | if (p->out_ca2_needs_pulled) |
| r1877 | r1878 | |
| 393 | 393 | |
| 394 | 394 | /* send to output function */ |
| 395 | 395 | if (p->intf->out_cb2_func) |
| 396 | p->intf->out_cb2_func(0, p->out_cb2); | |
| 396 | p->intf->out_cb2_func(Machine, 0, p->out_cb2); | |
| 397 | 397 | else |
| 398 | 398 | { |
| 399 | 399 | if (p->out_cb2_needs_pulled) |
| r1877 | r1878 | |
| 495 | 495 | |
| 496 | 496 | /* update CA1 & CA2 if callback exists, these in turn may update IRQ's */ |
| 497 | 497 | if (p->intf->in_ca1_func) |
| 498 | pia_set_input_ca1(which, p->intf->in_ca1_func(0)); | |
| 498 | pia_set_input_ca1(which, p->intf->in_ca1_func(Machine, 0)); | |
| 499 | 499 | else if (!p->logged_ca1_not_connected && (!p->in_ca1_pushed)) |
| 500 | 500 | { |
| 501 | 501 | logerror("cpu #%d (PC=%08X): PIA #%d: Warning! No CA1 read handler. Assuming pin not connected\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which); |
| r1877 | r1878 | |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | if (p->intf->in_ca2_func) |
| 506 | pia_set_input_ca2(which, p->intf->in_ca2_func(0)); | |
| 506 | pia_set_input_ca2(which, p->intf->in_ca2_func(Machine, 0)); | |
| 507 | 507 | else if ( !p->logged_ca2_not_connected && C2_INPUT(p->ctl_a) && !p->in_ca2_pushed) |
| 508 | 508 | { |
| 509 | 509 | logerror("cpu #%d (PC=%08X): PIA #%d: Warning! No CA2 read handler. Assuming pin not connected\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which); |
| r1877 | r1878 | |
| 533 | 533 | |
| 534 | 534 | /* update CB1 & CB2 if callback exists, these in turn may update IRQ's */ |
| 535 | 535 | if (p->intf->in_cb1_func) |
| 536 | pia_set_input_cb1(which, p->intf->in_cb1_func(0)); | |
| 536 | pia_set_input_cb1(which, p->intf->in_cb1_func(Machine, 0)); | |
| 537 | 537 | else if (!p->logged_cb1_not_connected && !p->in_cb1_pushed) |
| 538 | 538 | { |
| 539 | 539 | logerror("cpu #%d (PC=%08X): PIA #%d: Error! no CB1 read handler. Three-state pin is undefined\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which); |
| r1877 | r1878 | |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | if (p->intf->in_cb2_func) |
| 544 | pia_set_input_cb2(which, p->intf->in_cb2_func(0)); | |
| 544 | pia_set_input_cb2(which, p->intf->in_cb2_func(Machine, 0)); | |
| 545 | 545 | else if (!p->logged_cb2_not_connected && C2_INPUT(p->ctl_b) && !p->in_cb2_pushed) |
| 546 | 546 | { |
| 547 | 547 | logerror("cpu #%d (PC=%08X): PIA #%d: Error! No CB2 read handler. Three-state pin is undefined\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which); |
| r1877 | r1878 | |
| 630 | 630 | LOG(("cpu #%d (PC=%08X): PIA #%d: %s = %02X\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, message, data)); |
| 631 | 631 | |
| 632 | 632 | if (p->intf->out_a_func) |
| 633 | p->intf->out_a_func(0, data); | |
| 633 | p->intf->out_a_func(Machine, 0, data); | |
| 634 | 634 | else |
| 635 | 635 | { |
| 636 | 636 | if (p->out_a_needs_pulled) |
| r1877 | r1878 | |
| 651 | 651 | LOG(("cpu #%d (PC=%08X): PIA #%d: %s = %02X\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, message, data)); |
| 652 | 652 | |
| 653 | 653 | if (p->intf->out_b_func) |
| 654 | p->intf->out_b_func(0, data); | |
| 654 | p->intf->out_b_func(Machine, 0, data); | |
| 655 | 655 | else |
| 656 | 656 | { |
| 657 | 657 | if (p->out_b_needs_pulled) |
| r1877 | r1878 | |
|---|---|---|
| 124 | 124 | { |
| 125 | 125 | UINT8 write_data = ( r6532[which].ddr_a & r6532[which].out_a ) | ( ~r6532[which].ddr_a & 0xFF ); |
| 126 | 126 | if (r6532[which].intf->out_a_func) |
| 127 | r6532[which].intf->out_a_func(0, write_data); | |
| 127 | r6532[which].intf->out_a_func(Machine, 0, write_data); | |
| 128 | 128 | else |
| 129 | 129 | logerror("6532RIOT chip #%d: Port A is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); |
| 130 | 130 | /* Check for PA7 change */ |
| r1877 | r1878 | |
| 141 | 141 | { |
| 142 | 142 | UINT8 write_data = ( r6532[which].ddr_b & r6532[which].out_b ) | ( ~r6532[which].ddr_b & 0xFF ); |
| 143 | 143 | if (r6532[which].intf->out_b_func) |
| 144 | r6532[which].intf->out_b_func(0, write_data); | |
| 144 | r6532[which].intf->out_b_func(Machine, 0, write_data); | |
| 145 | 145 | else |
| 146 | 146 | logerror("6532RIOT chip #%d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); |
| 147 | 147 | } |
| r1877 | r1878 | |
| 236 | 236 | { |
| 237 | 237 | case 0: |
| 238 | 238 | if (r6532[which].intf->in_a_func) |
| 239 | r6532[which].in_a = r6532[which].intf->in_a_func(0); | |
| 239 | r6532[which].in_a = r6532[which].intf->in_a_func(Machine, 0); | |
| 240 | 240 | else |
| 241 | 241 | logerror("6532RIOT chip #%d: Port A is being read but has no handler. PC: %08X\n", which, safe_activecpu_get_pc()); |
| 242 | 242 | val = ( r6532[which].ddr_a & r6532[which].out_a ) | ( ~r6532[which].ddr_a & r6532[which].in_a ); |
| r1877 | r1878 | |
| 248 | 248 | break; |
| 249 | 249 | case 2: |
| 250 | 250 | if (r6532[which].intf->in_b_func) |
| 251 | r6532[which].in_b = r6532[which].intf->in_b_func(0); | |
| 251 | r6532[which].in_b = r6532[which].intf->in_b_func(Machine, 0); | |
| 252 | 252 | else |
| 253 | 253 | logerror("6532RIOT chip #%d: Port B is being read but has no handler. PC: %08X\n", which, safe_activecpu_get_pc()); |
| 254 | 254 |
| r1877 | r1878 | |
|---|---|---|
| 23 | 23 | */ |
| 24 | 24 | |
| 25 | 25 | #include "driver.h" |
| 26 | #include "deprecat.h" | |
| 26 | 27 | #include "6522via.h" |
| 27 | 28 | |
| 28 | 29 | //#define TRACE_VIA |
| r1877 | r1878 | |
| 250 | 251 | v->sr = (v->sr << 1) | v->out_cb2; |
| 251 | 252 | |
| 252 | 253 | if (v->intf->out_cb2_func) |
| 253 | v->intf->out_cb2_func(0, v->out_cb2); | |
| 254 | v->intf->out_cb2_func(Machine, 0, v->out_cb2); | |
| 254 | 255 | |
| 255 | 256 | v->in_cb1=1; |
| 256 | 257 | if (v->intf->out_cb1_func) |
| 257 | 258 | { |
| 258 | 259 | /* this should be one cycle wide */ |
| 259 | v->intf->out_cb1_func(0, 0); | |
| 260 | v->intf->out_cb1_func(0, 1); | |
| 260 | v->intf->out_cb1_func(Machine, 0, 0); | |
| 261 | v->intf->out_cb1_func(Machine, 0, 1); | |
| 261 | 262 | } |
| 262 | 263 | |
| 263 | 264 | v->shift_counter = (v->shift_counter + 1) % 8; |
| r1877 | r1878 | |
| 276 | 277 | v->sr = (v->sr << 1) | v->out_cb2; |
| 277 | 278 | |
| 278 | 279 | if (v->intf->out_cb2_func) |
| 279 | v->intf->out_cb2_func(0, v->out_cb2); | |
| 280 | v->intf->out_cb2_func(Machine, 0, v->out_cb2); | |
| 280 | 281 | |
| 281 | 282 | v->shift_counter = (v->shift_counter + 1) % 8; |
| 282 | 283 | |
| r1877 | r1878 | |
| 289 | 290 | if (SI_EXT_CONTROL(v->acr)) |
| 290 | 291 | { |
| 291 | 292 | if (v->intf->in_cb2_func) |
| 292 | v->in_cb2 = v->intf->in_cb2_func(0); | |
| 293 | v->in_cb2 = v->intf->in_cb2_func(Machine, 0); | |
| 293 | 294 | |
| 294 | 295 | v->sr = (v->sr << 1) | (v->in_cb2 & 1); |
| 295 | 296 | |
| r1877 | r1878 | |
| 336 | 337 | UINT8 write_data = (v->out_b & v->ddr_b) | (v->ddr_b ^ 0xff); |
| 337 | 338 | |
| 338 | 339 | if (v->intf->out_b_func) |
| 339 | v->intf->out_b_func(0, write_data); | |
| 340 | v->intf->out_b_func(Machine, 0, write_data); | |
| 340 | 341 | else |
| 341 | 342 | logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); |
| 342 | 343 | } |
| r1877 | r1878 | |
| 402 | 403 | if (PB_LATCH_ENABLE(v->acr) == 0) |
| 403 | 404 | { |
| 404 | 405 | if (v->intf->in_b_func) |
| 405 | v->in_b = v->intf->in_b_func(0); | |
| 406 | v->in_b = v->intf->in_b_func(Machine, 0); | |
| 406 | 407 | else |
| 407 | 408 | logerror("6522VIA chip %d: Port B is being read but has no handler. PC: %08X\n", which, safe_activecpu_get_pc()); |
| 408 | 409 | } |
| r1877 | r1878 | |
| 421 | 422 | if (PA_LATCH_ENABLE(v->acr) == 0) |
| 422 | 423 | { |
| 423 | 424 | if (v->intf->in_a_func) |
| 424 | v->in_a = v->intf->in_a_func(0); | |
| 425 | v->in_a = v->intf->in_a_func(Machine, 0); | |
| 425 | 426 | else |
| 426 | 427 | logerror("6522VIA chip %d: Port A is being read but has no handler. PC: %08X\n", which, safe_activecpu_get_pc()); |
| 427 | 428 | } |
| r1877 | r1878 | |
| 442 | 443 | |
| 443 | 444 | /* call the CA2 output function */ |
| 444 | 445 | if (v->intf->out_ca2_func) |
| 445 | v->intf->out_ca2_func(0, 0); | |
| 446 | v->intf->out_ca2_func(Machine, 0, 0); | |
| 446 | 447 | else |
| 447 | 448 | logerror("6522VIA chip %d: Port CA2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), 0); |
| 448 | 449 | } |
| r1877 | r1878 | |
| 455 | 456 | if (PA_LATCH_ENABLE(v->acr) == 0) |
| 456 | 457 | { |
| 457 | 458 | if (v->intf->in_a_func) |
| 458 | v->in_a = v->intf->in_a_func(0); | |
| 459 | v->in_a = v->intf->in_a_func(Machine, 0); | |
| 459 | 460 | else |
| 460 | 461 | logerror("6522VIA chip %d: Port A is being read but has no handler. PC: %08X\n", which, safe_activecpu_get_pc()); |
| 461 | 462 | } |
| r1877 | r1878 | |
| 565 | 566 | UINT8 write_data = (v->out_b & v->ddr_b) | (v->ddr_b ^ 0xff); |
| 566 | 567 | |
| 567 | 568 | if (v->intf->out_b_func) |
| 568 | v->intf->out_b_func(0, write_data); | |
| 569 | v->intf->out_b_func(Machine, 0, write_data); | |
| 569 | 570 | else |
| 570 | 571 | logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); |
| 571 | 572 | } |
| r1877 | r1878 | |
| 583 | 584 | |
| 584 | 585 | /* call the CB2 output function */ |
| 585 | 586 | if (v->intf->out_cb2_func) |
| 586 | v->intf->out_cb2_func(0, 0); | |
| 587 | v->intf->out_cb2_func(Machine, 0, 0); | |
| 587 | 588 | else |
| 588 | 589 | logerror("6522VIA chip %d: Port CB2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), 0); |
| 589 | 590 | } |
| r1877 | r1878 | |
| 598 | 599 | UINT8 write_data = (v->out_a & v->ddr_a) | (v->ddr_a ^ 0xff); |
| 599 | 600 | |
| 600 | 601 | if (v->intf->out_a_func) |
| 601 | v->intf->out_a_func(0, write_data); | |
| 602 | v->intf->out_a_func(Machine, 0, write_data); | |
| 602 | 603 | else |
| 603 | 604 | logerror("6522VIA chip %d: Port A is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); |
| 604 | 605 | } |
| r1877 | r1878 | |
| 612 | 613 | /* call the CA2 output function */ |
| 613 | 614 | if (v->intf->out_ca2_func) |
| 614 | 615 | { |
| 615 | v->intf->out_ca2_func(0, 0); | |
| 616 | v->intf->out_ca2_func(0, 1); | |
| 616 | v->intf->out_ca2_func(Machine, 0, 0); | |
| 617 | v->intf->out_ca2_func(Machine, 0, 1); | |
| 617 | 618 | } |
| 618 | 619 | else |
| 619 | 620 | logerror("6522VIA chip %d: Port CA2 is being pulsed but has no handler. PC: %08X\n", which, safe_activecpu_get_pc()); |
| r1877 | r1878 | |
| 630 | 631 | |
| 631 | 632 | /* call the CA2 output function */ |
| 632 | 633 | if (v->intf->out_ca2_func) |
| 633 | v->intf->out_ca2_func(0, 0); | |
| 634 | v->intf->out_ca2_func(Machine, 0, 0); | |
| 634 | 635 | else |
| 635 | 636 | logerror("6522VIA chip %d: Port CA2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), 0); |
| 636 | 637 | } |
| r1877 | r1878 | |
| 646 | 647 | UINT8 write_data = (v->out_a & v->ddr_a) | (v->ddr_a ^ 0xff); |
| 647 | 648 | |
| 648 | 649 | if (v->intf->out_a_func) |
| 649 | v->intf->out_a_func(0, write_data); | |
| 650 | v->intf->out_a_func(Machine, 0, write_data); | |
| 650 | 651 | else |
| 651 | 652 | logerror("6522VIA chip %d: Port A is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); |
| 652 | 653 | } |
| r1877 | r1878 | |
| 664 | 665 | UINT8 write_data = (v->out_b & v->ddr_b) | (v->ddr_b ^ 0xff); |
| 665 | 666 | |
| 666 | 667 | if (v->intf->out_b_func) |
| 667 | v->intf->out_b_func(0, write_data); | |
| 668 | v->intf->out_b_func(Machine, 0, write_data); | |
| 668 | 669 | else |
| 669 | 670 | logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); |
| 670 | 671 | } |
| r1877 | r1878 | |
| 682 | 683 | UINT8 write_data = (v->out_a & v->ddr_a) | (v->ddr_a ^ 0xff); |
| 683 | 684 | |
| 684 | 685 | if (v->intf->out_a_func) |
| 685 | v->intf->out_a_func(0, write_data); | |
| 686 | v->intf->out_a_func(Machine, 0, write_data); | |
| 686 | 687 | else |
| 687 | 688 | logerror("6522VIA chip %d: Port A is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); |
| 688 | 689 | } |
| r1877 | r1878 | |
| 714 | 715 | UINT8 write_data = (v->out_b & v->ddr_b) | (v->ddr_b ^ 0xff); |
| 715 | 716 | |
| 716 | 717 | if (v->intf->out_b_func) |
| 717 | v->intf->out_b_func(0, write_data); | |
| 718 | v->intf->out_b_func(Machine, 0, write_data); | |
| 718 | 719 | else |
| 719 | 720 | logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); |
| 720 | 721 | } |
| r1877 | r1878 | |
| 764 | 765 | { |
| 765 | 766 | v->out_ca2 = CA2_OUTPUT_LEVEL(data); |
| 766 | 767 | if (v->intf->out_ca2_func) |
| 767 | v->intf->out_ca2_func(0, v->out_ca2); | |
| 768 | v->intf->out_ca2_func(Machine, 0, v->out_ca2); | |
| 768 | 769 | else |
| 769 | 770 | logerror("6522VIA chip %d: Port CA2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), v->out_ca2); |
| 770 | 771 | } |
| r1877 | r1878 | |
| 773 | 774 | { |
| 774 | 775 | v->out_cb2 = CB2_OUTPUT_LEVEL(data); |
| 775 | 776 | if (v->intf->out_cb2_func) |
| 776 | v->intf->out_cb2_func(0, v->out_cb2); | |
| 777 | v->intf->out_cb2_func(Machine, 0, v->out_cb2); | |
| 777 | 778 | else |
| 778 | 779 | logerror("6522VIA chip %d: Port CB2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), v->out_cb2); |
| 779 | 780 | } |
| r1877 | r1878 | |
| 795 | 796 | UINT8 write_data = (v->out_b & v->ddr_b) | (v->ddr_b ^ 0xff); |
| 796 | 797 | |
| 797 | 798 | if (v->intf->out_b_func) |
| 798 | v->intf->out_b_func(0, write_data); | |
| 799 | v->intf->out_b_func(Machine, 0, write_data); | |
| 799 | 800 | else |
| 800 | 801 | logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); |
| 801 | 802 | } |
| r1877 | r1878 | |
| 876 | 877 | if (PA_LATCH_ENABLE(v->acr)) |
| 877 | 878 | { |
| 878 | 879 | if (v->intf->in_a_func) |
| 879 | v->in_a = v->intf->in_a_func(0); | |
| 880 | v->in_a = v->intf->in_a_func(Machine, 0); | |
| 880 | 881 | else |
| 881 | 882 | logerror("6522VIA chip %d: Port A is being read but has no handler. PC: %08X\n", which, safe_activecpu_get_pc()); |
| 882 | 883 | } |
| r1877 | r1878 | |
| 894 | 895 | |
| 895 | 896 | /* call the CA2 output function */ |
| 896 | 897 | if (v->intf->out_ca2_func) |
| 897 | v->intf->out_ca2_func(0, 1); | |
| 898 | v->intf->out_ca2_func(Machine, 0, 1); | |
| 898 | 899 | else |
| 899 | 900 | logerror("6522VIA chip %d: Port CA2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), 1); |
| 900 | 901 | } |
| r1877 | r1878 | |
| 963 | 964 | if (PB_LATCH_ENABLE(v->acr)) |
| 964 | 965 | { |
| 965 | 966 | if (v->intf->in_b_func) |
| 966 | v->in_b = v->intf->in_b_func(0); | |
| 967 | v->in_b = v->intf->in_b_func(Machine, 0); | |
| 967 | 968 | else |
| 968 | 969 | logerror("6522VIA chip %d: Port B is being read but has no handler. PC: %08X\n", which, safe_activecpu_get_pc()); |
| 969 | 970 | } |
| r1877 | r1878 | |
| 983 | 984 | |
| 984 | 985 | /* call the CB2 output function */ |
| 985 | 986 | if (v->intf->out_cb2_func) |
| 986 | v->intf->out_cb2_func(0, 1); | |
| 987 | v->intf->out_cb2_func(Machine, 0, 1); | |
| 987 | 988 | else |
| 988 | 989 | logerror("6522VIA chip %d: Port CB2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), 1); |
| 989 | 990 | } |
| r1877 | r1878 | |
|---|---|---|
| 30 | 30 | typedef struct _pia6821_interface pia6821_interface; |
| 31 | 31 | struct _pia6821_interface |
| 32 | 32 | { |
| 33 | read8_handler in_a_func; | |
| 34 | read8_handler in_b_func; | |
| 35 | read8_handler in_ca1_func; | |
| 36 | read8_handler in_cb1_func; | |
| 37 | read8_handler in_ca2_func; | |
| 38 | read8_handler in_cb2_func; | |
| 39 | write8_handler out_a_func; | |
| 40 | write8_handler out_b_func; | |
| 41 | write8_handler out_ca2_func; | |
| 42 | write8_handler out_cb2_func; | |
| 33 | read8_machine_func in_a_func; | |
| 34 | read8_machine_func in_b_func; | |
| 35 | read8_machine_func in_ca1_func; | |
| 36 | read8_machine_func in_cb1_func; | |
| 37 | read8_machine_func in_ca2_func; | |
| 38 | read8_machine_func in_cb2_func; | |
| 39 | write8_machine_func out_a_func; | |
| 40 | write8_machine_func out_b_func; | |
| 41 | write8_machine_func out_ca2_func; | |
| 42 | write8_machine_func out_cb2_func; | |
| 43 | 43 | void (*irq_a_func)(int state); |
| 44 | 44 | void (*irq_b_func)(int state); |
| 45 | 45 | }; |
| r1877 | r1878 | |
|---|---|---|
| 224 | 224 | UINT32 fieldnum; /* field number (0 or 1) */ |
| 225 | 225 | |
| 226 | 226 | /* video data */ |
| 227 | | |
| 227 | | |
| 228 | 228 | UINT8 videofields[2]; /* number of fields in each frame */ |
| 229 | 229 | UINT32 videoframenum[2]; /* frame number contained in each frame */ |
| 230 | 230 | UINT8 videoindex; /* index of the current video buffer */ |
| 231 | | |
| 231 | | |
| 232 | 232 | |
| 233 | 233 | /* audio data */ |
| 234 | 234 | INT16 * audiobuffer[2]; /* buffer for audio samples */ |
| r1877 | r1878 | |
| 642 | 642 | given color pattern |
| 643 | 643 | -------------------------------------------------*/ |
| 644 | 644 | |
| 645 | INLINE void fillbitmap_yuy16( | |
| 645 | INLINE void fillbitmap_yuy16( | |
| 646 | 646 | { |
| 647 | 647 | UINT16 color0 = (yval << 8) | cb; |
| 648 | 648 | UINT16 color1 = (yval << 8) | cr; |
| r1877 | r1878 | |
| 1059 | 1059 | video frame |
| 1060 | 1060 | -------------------------------------------------*/ |
| 1061 | 1061 | |
| 1062 | UINT32 laserdisc_get_video(laserdisc_info *info, | |
| 1062 | UINT32 laserdisc_get_video(laserdisc_info *info, | |
| 1063 | 1063 | { |
| 1064 | 1064 | int frameindex; |
| 1065 | 1065 |
| r1877 | r1878 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | struct riot6532_interface |
| 13 | 13 | { |
| 14 | read8_handler in_a_func; | |
| 15 | read8_handler in_b_func; | |
| 16 | write8_handler out_a_func; | |
| 17 | write8_handler out_b_func; | |
| 14 | read8_machine_func in_a_func; | |
| 15 | read8_machine_func in_b_func; | |
| 16 | write8_machine_func out_a_func; | |
| 17 | write8_machine_func out_b_func; | |
| 18 | 18 | void (*irq_func)(int state); |
| 19 | 19 | }; |
| 20 | 20 |
| r1877 | r1878 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | struct via6522_interface |
| 38 | 38 | { |
| 39 | read8_handler in_a_func; | |
| 40 | read8_handler in_b_func; | |
| 41 | read8_handler in_ca1_func; | |
| 42 | read8_handler in_cb1_func; | |
| 43 | read8_handler in_ca2_func; | |
| 44 | read8_handler in_cb2_func; | |
| 45 | write8_handler out_a_func; | |
| 46 | write8_handler out_b_func; | |
| 47 | write8_handler out_ca1_func; | |
| 48 | write8_handler out_cb1_func; | |
| 49 | write8_handler out_ca2_func; | |
| 50 | write8_handler out_cb2_func; | |
| 39 | read8_machine_func in_a_func; | |
| 40 | read8_machine_func in_b_func; | |
| 41 | read8_machine_func in_ca1_func; | |
| 42 | read8_machine_func in_cb1_func; | |
| 43 | read8_machine_func in_ca2_func; | |
| 44 | read8_machine_func in_cb2_func; | |
| 45 | write8_machine_func out_a_func; | |
| 46 | write8_machine_func out_b_func; | |
| 47 | write8_machine_func out_ca1_func; | |
| 48 | write8_machine_func out_cb1_func; | |
| 49 | write8_machine_func out_ca2_func; | |
| 50 | write8_machine_func out_cb2_func; | |
| 51 | 51 | void (*irq_func)(int state); |
| 52 | 52 | }; |
| 53 | 53 |
| r1877 | r1878 | |
|---|---|---|
| 381 | 381 | WRITE8_HANDLER ( pic8259_0_w ) { pic8259_write(0, offset, data); } |
| 382 | 382 | WRITE8_HANDLER ( pic8259_1_w ) { pic8259_write(1, offset, data); } |
| 383 | 383 | |
| 384 | READ16_HANDLER ( pic8259_16le_0_r ) { return read16le_with_read8_handler(pic8259_0_r, offset, mem_mask); } | |
| 385 | READ16_HANDLER ( pic8259_16le_1_r ) { return read16le_with_read8_handler(pic8259_1_r, offset, mem_mask); } | |
| 386 | WRITE16_HANDLER ( pic8259_16le_0_w ) { write16le_with_write8_handler(pic8259_0_w, offset, data, mem_mask); } | |
| 387 | WRITE16_HANDLER ( pic8259_16le_1_w ) { write16le_with_write8_handler(pic8259_1_w, offset, data, mem_mask); } | |
| 384 | READ16_HANDLER ( pic8259_16le_0_r ) { return read16le_with_read8_handler(pic8259_0_r, machine, offset, mem_mask); } | |
| 385 | READ16_HANDLER ( pic8259_16le_1_r ) { return read16le_with_read8_handler(pic8259_1_r, machine, offset, mem_mask); } | |
| 386 | WRITE16_HANDLER ( pic8259_16le_0_w ) { write16le_with_write8_handler(pic8259_0_w, machine, offset, data, mem_mask); } | |
| 387 | WRITE16_HANDLER ( pic8259_16le_1_w ) { write16le_with_write8_handler(pic8259_1_w, machine, offset, data, mem_mask); } | |
| 388 | 388 | |
| 389 | READ32_HANDLER ( pic8259_32le_0_r ) { return read32le_with_read8_handler(pic8259_0_r, offset, mem_mask); } | |
| 390 | READ32_HANDLER ( pic8259_32le_1_r ) { return read32le_with_read8_handler(pic8259_1_r, offset, mem_mask); } | |
| 391 | WRITE32_HANDLER ( pic8259_32le_0_w ) { write32le_with_write8_handler(pic8259_0_w, offset, data, mem_mask); } | |
| 392 | WRITE32_HANDLER ( pic8259_32le_1_w ) { write32le_with_write8_handler(pic8259_1_w, offset, data, mem_mask); } | |
| 389 | READ32_HANDLER ( pic8259_32le_0_r ) { return read32le_with_read8_handler(pic8259_0_r, machine, offset, mem_mask); } | |
| 390 | READ32_HANDLER ( pic8259_32le_1_r ) { return read32le_with_read8_handler(pic8259_1_r, machine, offset, mem_mask); } | |
| 391 | WRITE32_HANDLER ( pic8259_32le_0_w ) { write32le_with_write8_handler(pic8259_0_w, machine, offset, data, mem_mask); } | |
| 392 | WRITE32_HANDLER ( pic8259_32le_1_w ) { write32le_with_write8_handler(pic8259_1_w, machine, offset, data, mem_mask); } | |
| 393 | 393 | |
| 394 | READ64_HANDLER ( pic8259_64be_0_r ) { return read64be_with_read8_handler(pic8259_0_r, offset, mem_mask); } | |
| 395 | READ64_HANDLER ( pic8259_64be_1_r ) { return read64be_with_read8_handler(pic8259_1_r, offset, mem_mask); } | |
| 396 | WRITE64_HANDLER ( pic8259_64be_0_w ) { write64be_with_write8_handler(pic8259_0_w, offset, data, mem_mask); } | |
| 397 | WRITE64_HANDLER ( pic8259_64be_1_w ) { write64be_with_write8_handler(pic8259_1_w, offset, data, mem_mask); } | |
| 394 | READ64_HANDLER ( pic8259_64be_0_r ) { return read64be_with_read8_handler(pic8259_0_r, machine, offset, mem_mask); } | |
| 395 | READ64_HANDLER ( pic8259_64be_1_r ) { return read64be_with_read8_handler(pic8259_1_r, machine, offset, mem_mask); } | |
| 396 | WRITE64_HANDLER ( pic8259_64be_0_w ) { write64be_with_write8_handler(pic8259_0_w, machine, offset, data, mem_mask); } | |
| 397 | WRITE64_HANDLER ( pic8259_64be_1_w ) { write64be_with_write8_handler(pic8259_1_w, machine, offset, data, mem_mask); } |
| r1877 | r1878 | |
|---|---|---|
| 73 | 73 | void laserdisc_exit(laserdisc_info *info); |
| 74 | 74 | void laserdisc_vsync(laserdisc_info *info); |
| 75 | 75 | const char *laserdisc_describe_state(laserdisc_info *info); |
| 76 | UINT32 laserdisc_get_video(laserdisc_info *info, | |
| 76 | UINT32 laserdisc_get_video(laserdisc_info *info, | |
| 77 | 77 | UINT32 laserdisc_get_field_code(laserdisc_info *info, UINT8 code); |
| 78 | 78 | |
| 79 | 79 | void laserdisc_data_w(laserdisc_info *info, UINT8 data); |
| r1877 | r1878 | |
|---|---|---|
| 340 | 340 | if ((currptr->mode[idx] == 4)||(currptr->mode[idx] == 6)) |
| 341 | 341 | { |
| 342 | 342 | currptr->output[idx] = 1; |
| 343 | if ( currptr->intf->out_func[idx] ) currptr->intf->out_func[idx](0, currptr->output[idx]); | |
| 343 | if ( currptr->intf->out_func[idx] ) currptr->intf->out_func[idx](Machine, 0, currptr->output[idx]); | |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | /* set the timer */ |
| r1877 | r1878 | |
| 549 | 549 | { // output cleared |
| 550 | 550 | if ( currptr->intf ) |
| 551 | 551 | { |
| 552 | if ( currptr->intf->out_func[idx] ) currptr->intf->out_func[idx](0, 0); | |
| 552 | if ( currptr->intf->out_func[idx] ) currptr->intf->out_func[idx](Machine, 0, 0); | |
| 553 | 553 | } |
| 554 | 554 | } |
| 555 | 555 | /* reset? */ |
| r1877 | r1878 | |
| 644 | 644 | { |
| 645 | 645 | p->output[idx] = p->output[idx]?0:1; |
| 646 | 646 | PLOG(("**ptm6840 %d t%d output %d **\n", which, idx+1, p->output[idx])); |
| 647 | if ( p->intf->out_func[idx] ) p->intf->out_func[idx](0, p->output[idx]); | |
| 647 | if ( p->intf->out_func[idx] ) p->intf->out_func[idx](Machine, 0, p->output[idx]); | |
| 648 | 648 | } |
| 649 | 649 | if ((p->mode[idx] == 4)||(p->mode[idx] == 6)) |
| 650 | 650 | { |
| r1877 | r1878 | |
| 652 | 652 | { |
| 653 | 653 | p->output[idx] = 1; |
| 654 | 654 | PLOG(("**ptm6840 %d t%d output %d **\n", which, idx+1, p->output[idx])); |
| 655 | if ( p->intf->out_func[idx] ) p->intf->out_func[idx](0, p->output[idx]); | |
| 655 | if ( p->intf->out_func[idx] ) p->intf->out_func[idx](Machine, 0, p->output[idx]); | |
| 656 | 656 | p->fired[idx]=1;//no changes in output until reinit |
| 657 | 657 | } |
| 658 | 658 | } |
| r1877 | r1878 | |
|---|---|---|
| 18 | 18 | int internal_clock; |
| 19 | 19 | int external_clock[3]; |
| 20 | 20 | |
| 21 | write8_ | |
| 21 | write8_machin | |
| 22 | 22 | |
| 23 | 23 | void (*irq_func)(int state); // function called if IRQ line changes |
| 24 | 24 | }; |
| r1877 | r1878 | |
|---|---|---|
| 86 | 86 | |
| 87 | 87 | #define READY_ACTIVE_HIGH(_c) ((WR5(_c)>>3) & 0x01) |
| 88 | 88 | |
| 89 | struct z80dma | |
| 89 | struct _z80dma_t | |
| 90 | 90 | { |
| 91 | const struct z80dma_interface *intf; | |
| 91 | running_machine *machine; | |
| 92 | const z80dma_interface *intf; | |
| 92 | 93 | emu_timer *timer; |
| 93 | 94 | |
| 94 | 95 | UINT16 regs[REGNUM(6,1)+1]; |
| r1877 | r1878 | |
| 109 | 110 | UINT8 latch; |
| 110 | 111 | }; |
| 111 | 112 | |
| 112 | static struct z80dma *dma; | |
| 113 | static int dma_count; | |
| 114 | ||
| 115 | 113 | static TIMER_CALLBACK( z80dma_timerproc ); |
| 116 | static void z80dma_update_status( | |
| 114 | static void z80dma_update_status(z80dma_t *z80dma); | |
| 117 | 115 | |
| 118 | 116 | /* ----------------------------------------------------------------------- */ |
| 119 | 117 | |
| 120 | ||
| 118 | s | |
| 121 | 119 | { |
| 122 | int which; | |
| 123 | ||
| 124 | dma = auto_malloc(count * sizeof(struct z80dma)); | |
| 125 | memset(dma, 0, count * sizeof(struct z80dma)); | |
| 126 | dma_count = count; | |
| 127 | ||
| 128 | for (which = 0; which < dma_count; which++) | |
| 129 | { | |
| 130 | dma[which].timer = timer_alloc(z80dma_timerproc, NULL); | |
| 131 | ||
| 132 | state_save_register_item_array("Z80DMA", which, dma[which].regs); | |
| 133 | state_save_register_item_array("Z80DMA", which, dma[which].regs_follow); | |
| 134 | ||
| 135 | state_save_register_item("Z80DMA", which, dma[which].num_follow); | |
| 136 | state_save_register_item("Z80DMA", which, dma[which].cur_follow); | |
| 137 | state_save_register_item("Z80DMA", which, dma[which].status); | |
| 138 | state_save_register_item("Z80DMA", which, dma[which].dma_enabled); | |
| 139 | ||
| 140 | state_save_register_item("Z80DMA", which, dma[which].addressA); | |
| 141 | state_save_register_item("Z80DMA", which, dma[which].addressB); | |
| 142 | state_save_register_item("Z80DMA", which, dma[which].count); | |
| 143 | state_save_register_item("Z80DMA", which, dma[which].rdy); | |
| 144 | state_save_register_item("Z80DMA", which, dma[which].is_read); | |
| 145 | state_save_register_item("Z80DMA", which, dma[which].cur_cycle); | |
| 146 | state_save_register_item("Z80DMA", which, dma[which].latch); | |
| 147 | ||
| 148 | } | |
| 149 | ||
| 150 | return 0; | |
| 151 | } | |
| 152 | ||
| 153 | ||
| 154 | ||
| 155 | void z80dma_config(int which, const struct z80dma_interface *intf) | |
| 156 | { | |
| 157 | dma[which].intf = intf; | |
| 158 | } | |
| 159 | ||
| 160 | ||
| 161 | ||
| 162 | void z80dma_reset(void) | |
| 163 | { | |
| 164 | int which; | |
| 165 | ||
| 166 | for (which = 0; which < dma_count; which++) | |
| 167 | { | |
| 168 | dma[which].status = 0; | |
| 169 | dma[which].rdy = 0; | |
| 170 | dma[which].num_follow = 0; | |
| 171 | dma[which].dma_enabled = 0; | |
| 172 | z80dma_update_status(which); | |
| 173 | } | |
| 174 | } | |
| 175 | ||
| 176 | ||
| 177 | ||
| 178 | /* ----------------------------------------------------------------------- */ | |
| 179 | ||
| 180 | static void z80dma_do_read(int which) | |
| 181 | { | |
| 182 | struct z80dma *cntx = &dma[which]; | |
| 183 | 120 | UINT8 mode; |
| 184 | 121 | |
| 185 | 122 | mode = TRANSFER_MODE(cntx); |
| r1877 | r1878 | |
| 188 | 125 | if (PORTA_IS_SOURCE(cntx)) |
| 189 | 126 | { |
| 190 | 127 | if (PORTA_MEMORY(cntx)) |
| 191 | cntx->latch = cntx->intf->memory_read | |
| 128 | cntx->latch = cntx->intf->memory_read(c | |
| 192 | 129 | else |
| 193 | cntx->latch = cntx->intf->portA_read | |
| 130 | cntx->latch = cntx->intf->portA_read(c | |
| 194 | 131 | cntx->addressA += PORTA_STEP(cntx); |
| 195 | 132 | } |
| 196 | 133 | else |
| 197 | 134 | { |
| 198 | 135 | if (PORTB_MEMORY(cntx)) |
| 199 | cntx->latch = cntx->intf->memory_read | |
| 136 | cntx->latch = cntx->intf->memory_read(c | |
| 200 | 137 | else |
| 201 | cntx->latch = cntx->intf->portB_read | |
| 138 | cntx->latch = cntx->intf->portB_read(c | |
| 202 | 139 | cntx->addressB += PORTB_STEP(cntx); |
| 203 | 140 | } |
| 204 | 141 | break; |
| r1877 | r1878 | |
| 209 | 146 | } |
| 210 | 147 | } |
| 211 | 148 | |
| 212 | static int z80dma_do_write( | |
| 149 | static int z80dma_do_write(z80dma_t * | |
| 213 | 150 | { |
| 214 | struct z80dma *cntx = &dma[which]; | |
| 215 | 151 | int done; |
| 216 | 152 | UINT8 mode; |
| 217 | 153 | |
| r1877 | r1878 | |
| 225 | 161 | if (PORTA_IS_SOURCE(cntx)) |
| 226 | 162 | { |
| 227 | 163 | if (PORTB_MEMORY(cntx)) |
| 228 | cntx->intf->memory_write | |
| 164 | cntx->intf->memory_write(c | |
| 229 | 165 | else |
| 230 | cntx->intf->portB_write | |
| 166 | cntx->intf->portB_write(c | |
| 231 | 167 | cntx->addressB += PORTB_STEP(cntx); |
| 232 | 168 | } |
| 233 | 169 | else |
| 234 | 170 | { |
| 235 | 171 | if (PORTA_MEMORY(cntx)) |
| 236 | cntx->intf->memory_write | |
| 172 | cntx->intf->memory_write(c | |
| 237 | 173 | else |
| 238 | cntx->intf->portB_write | |
| 174 | cntx->intf->portB_write(c | |
| 239 | 175 | cntx->addressA += PORTA_STEP(cntx); |
| 240 | 176 | } |
| 241 | 177 | cntx->count--; |
| r1877 | r1878 | |
| 255 | 191 | |
| 256 | 192 | static TIMER_CALLBACK( z80dma_timerproc ) |
| 257 | 193 | { |
| 258 | int which = param; | |
| 259 | struct z80dma *cntx = &dma[which]; | |
| 194 | z80dma_t *cntx = ptr; | |
| 260 | 195 | int done; |
| 261 | 196 | |
| 262 | 197 | if (--cntx->cur_cycle) |
| r1877 | r1878 | |
| 265 | 200 | } |
| 266 | 201 | if (cntx->is_read) |
| 267 | 202 | { |
| 268 | z80dma_do_read( | |
| 203 | z80dma_do_read( | |
| 269 | 204 | done = 0; |
| 270 | 205 | cntx->is_read = 0; |
| 271 | 206 | cntx->cur_cycle = (PORTA_IS_SOURCE(cntx) ? PORTA_CYCLE_LEN(cntx) : PORTB_CYCLE_LEN(cntx)); |
| 272 | 207 | } |
| 273 | 208 | else |
| 274 | 209 | { |
| 275 | done = z80dma_do_write( | |
| 210 | done = z80dma_do_write( | |
| 276 | 211 | cntx->is_read = 1; |
| 277 | 212 | cntx->cur_cycle = (PORTB_IS_SOURCE(cntx) ? PORTA_CYCLE_LEN(cntx) : PORTB_CYCLE_LEN(cntx)); |
| 278 | 213 | } |
| 279 | 214 | if (done) |
| 280 | 215 | { |
| 281 | 216 | cntx->dma_enabled = 0; //FIXME: Correct? |
| 282 | z80dma_update_status( | |
| 217 | z80dma_update_status( | |
| 283 | 218 | } |
| 284 | 219 | } |
| 285 | 220 | |
| 286 | static void z80dma_update_status( | |
| 221 | static void z80dma_update_status(z80dma_t *z80dma) | |
| 287 | 222 | { |
| 288 | struct z80dma *cntx = &dma[which]; | |
| 289 | 223 | UINT16 pending_transfer; |
| 290 | 224 | attotime next; |
| 291 | 225 | |
| 292 | 226 | /* no transfer is active right now; is there a transfer pending right now? */ |
| 293 | pending_transfer = dma | |
| 227 | pending_transfer = z80dma-> | |
| 294 | 228 | |
| 295 | 229 | if (pending_transfer) |
| 296 | 230 | { |
| 297 | dma[which].is_read = 1; | |
| 298 | dma[which].cur_cycle = (PORTA_IS_SOURCE(cntx) ? PORTA_CYCLE_LEN(cntx) : PORTB_CYCLE_LEN(cntx)); | |
| 299 | next = ATTOTIME_IN_HZ(dma[which].intf->clockhz); | |
| 300 | timer_adjust_periodic(dma[which].timer, | |
| 231 | z80dma->is_read = 1; | |
| 232 | z80dma->cur_cycle = (PORTA_IS_SOURCE(z80dma) ? PORTA_CYCLE_LEN(z80dma) : PORTB_CYCLE_LEN(z80dma)); | |
| 233 | next = ATTOTIME_IN_HZ(z80dma->intf->clockhz); | |
| 234 | timer_adjust_periodic(z80dma->timer, | |
| 301 | 235 | attotime_zero, |
| 302 | | |
| 236 | 0 | |
| 303 | 237 | /* 1 byte transferred in 4 clock cycles */ |
| 304 | 238 | next); |
| 305 | 239 | } |
| 306 | 240 | else |
| 307 | 241 | { |
| 308 | 242 | /* no transfers active right now */ |
| 309 | timer_reset(dma | |
| 243 | timer_reset(z80dma-> | |
| 310 | 244 | } |
| 311 | 245 | |
| 312 | 246 | /* set the halt line */ |
| 313 | if (dma | |
| 247 | if (z80dma-> | |
| 314 | 248 | { |
| 315 | 249 | //FIXME: Synchronization is done by BUSREQ! |
| 316 | cpunum_set_input_line(Machine, dma | |
| 250 | cpunum_set_input_line(Machine, z80dma-> | |
| 317 | 251 | pending_transfer ? ASSERT_LINE : CLEAR_LINE); |
| 318 | 252 | } |
| 319 | 253 | } |
| 320 | 254 | |
| 321 | 255 | /* ----------------------------------------------------------------------- */ |
| 322 | 256 | |
| 323 | ||
| 257 | ||
| 324 | 258 | { |
| 325 | 259 | fatalerror("z80dma_read: not implemented"); |
| 326 | 260 | return 0; |
| r1877 | r1878 | |
| 328 | 262 | |
| 329 | 263 | |
| 330 | 264 | |
| 331 | ||
| 265 | ||
| 332 | 266 | { |
| 333 | | |
| 267 | | |
| 334 | 268 | |
| 335 | 269 | if (cntx->num_follow == 0) |
| 336 | 270 | { |
| r1877 | r1878 | |
| 406 | 340 | break; |
| 407 | 341 | case 0x83: /* Disable dma */ |
| 408 | 342 | cntx->dma_enabled = 0; |
| 409 | z80dma_rdy_write( | |
| 343 | z80dma_rdy_write( | |
| 410 | 344 | break; |
| 411 | 345 | case 0x87: /* Enable dma */ |
| 412 | 346 | cntx->dma_enabled = 1; |
| 413 | z80dma_rdy_write( | |
| 347 | z80dma_rdy_write( | |
| 414 | 348 | break; |
| 415 | 349 | case 0xBB: |
| 416 | 350 | cntx->regs_follow[cntx->num_follow++] = GET_REGNUM(cntx, READ_MASK(cntx)); |
| r1877 | r1878 | |
| 446 | 380 | |
| 447 | 381 | static TIMER_CALLBACK( z80dma_rdy_write_callback ) |
| 448 | 382 | { |
| 449 | int which = param >> 1; | |
| 450 | 383 | int state = param & 0x01; |
| 451 | | |
| 384 | | |
| 452 | 385 | |
| 453 | 386 | /* normalize state */ |
| 454 | 387 | cntx->rdy = 1 ^ state ^ READY_ACTIVE_HIGH(cntx); |
| 455 | 388 | cntx->status = (cntx->status & 0xFD) | (cntx->rdy<<1); |
| 456 | 389 | |
| 457 | z80dma_update_status( | |
| 390 | z80dma_update_status( | |
| 458 | 391 | } |
| 459 | 392 | |
| 460 | 393 | |
| 461 | 394 | |
| 462 | void z80dma_rdy_write( | |
| 395 | void z80dma_rdy_write(z80dma_t *z80dma, int state) | |
| 463 | 396 | { |
| 464 | 397 | int param; |
| 465 | 398 | |
| 466 | param = (which << 1) | (state ? 1 : 0); | |
| 467 | LOG(("RDY: %d Active High: %d\n", state, READY_ACTIVE_HIGH(&dma[which]))); | |
| 468 | timer_call_after_resynch(NULL, param, z80dma_rdy_write_callback); | |
| 399 | param = (state ? 1 : 0); | |
| 400 | LOG(("RDY: %d Active High: %d\n", state, READY_ACTIVE_HIGH(z80dma))); | |
| 401 | timer_call_after_resynch(z80dma, param, z80dma_rdy_write_callback); | |
| 469 | 402 | } |
| 470 | 403 | |
| 404 | /* ----------------------------------------------------------------------- */ | |
| 471 | 405 | |
| 472 | /* | |
| 406 | /* | |
| 473 | 407 | |
| 474 | READ8_HANDLER( z80dma_0_r ) { return z80dma_read(0, offset); } | |
| 475 | READ8_HANDLER( z80dma_1_r ) { return z80dma_read(1, offset); } | |
| 476 | WRITE8_HANDLER( z80dma_0_w ) { z80dma_write(0, offset, data); } | |
| 477 | WRITE8_HANDLER( z80dma_1_w ) { z80dma_write(1, offset, data); } | |
| 408 | static DEVICE_START( z80dma ) | |
| 409 | { | |
| 410 | z80dma_t *z80dma; | |
| 411 | char unique_tag[30]; | |
| 478 | 412 | |
| 479 | WRITE8_HANDLER( z80dma_0_rdy_w ) { z80dma_rdy_write(0, data); } | |
| 480 | WRITE8_HANDLER( z80dma_1_rdy_w ) { z80dma_rdy_write(1, data); } | |
| 413 | /* validate arguments */ | |
| 414 | assert(machine != NULL); | |
| 415 | assert(tag != NULL); | |
| 416 | assert(strlen(tag) < 20); | |
| 481 | 417 | |
| 482 | READ16_HANDLER( z80dma_16le_0_r ) { return read16le_with_read8_handler(z80dma_0_r, offset, mem_mask); } | |
| 483 | READ16_HANDLER( z80dma_16le_1_r ) { return read16le_with_read8_handler(z80dma_1_r, offset, mem_mask); } | |
| 484 | WRITE16_HANDLER( z80dma_16le_0_w ) { write16le_with_write8_handler(z80dma_0_w, offset, data, mem_mask); } | |
| 485 | WRITE16_HANDLER( z80dma_16le_1_w ) { write16le_with_write8_handler(z80dma_1_w, offset, data, mem_mask); } | |
| 418 | /* allocate the object that holds the state */ | |
| 419 | z80dma = auto_malloc(sizeof(*z80dma)); | |
| 420 | memset(z80dma, 0, sizeof(*z80dma)); | |
| 486 | 421 | |
| 487 | READ32_HANDLER( z80dma_32le_0_r ) { return read32le_with_read8_handler(z80dma_0_r, offset, mem_mask); } | |
| 488 | READ32_HANDLER( z80dma_32le_1_r ) { return read32le_with_read8_handler(z80dma_1_r, offset, mem_mask); } | |
| 489 | WRITE32_HANDLER( z80dma_32le_0_w ) { write32le_with_write8_handler(z80dma_0_w, offset, data, mem_mask); } | |
| 490 | WRITE32_HANDLER( z80dma_32le_1_w ) { write32le_with_write8_handler(z80dma_1_w, offset, data, mem_mask); } | |
| 422 | //z80dma->device_type = device_type; | |
| 423 | z80dma->machine = machine; | |
| 424 | z80dma->intf = static_config; | |
| 491 | 425 | |
| 492 | READ64_HANDLER( z80dma_64be_0_r ) { return read64be_with_read8_handler(z80dma_0_r, offset, mem_mask); } | |
| 493 | READ64_HANDLER( z80dma_64be_1_r ) { return read64be_with_read8_handler(z80dma_1_r, offset, mem_mask); } | |
| 494 | WRITE64_HANDLER( z80dma_64be_0_w ) { write64be_with_write8_handler(z80dma_0_w, offset, data, mem_mask); } | |
| 495 | WRITE64_HANDLER( z80dma_64be_1_w ) { write64be_with_write8_handler(z80dma_1_w, offset, data, mem_mask); } | |
| 426 | z80dma->timer = timer_alloc(z80dma_timerproc, z80dma); | |
| 427 | ||
| 428 | state_save_combine_module_and_tag(unique_tag, "z80dma", tag); | |
| 429 | ||
| 430 | state_save_register_item_array(unique_tag, 0, z80dma->regs); | |
| 431 | state_save_register_item_array(unique_tag, 0, z80dma->regs_follow); | |
| 432 | ||
| 433 | state_save_register_item(unique_tag, 0, z80dma->num_follow); | |
| 434 | state_save_register_item(unique_tag, 0, z80dma->cur_follow); | |
| 435 | state_save_register_item(unique_tag, 0, z80dma->status); | |
| 436 | state_save_register_item(unique_tag, 0, z80dma->dma_enabled); | |
| 437 | ||
| 438 | state_save_register_item(unique_tag, 0, z80dma->addressA); | |
| 439 | state_save_register_item(unique_tag, 0, z80dma->addressB); | |
| 440 | state_save_register_item(unique_tag, 0, z80dma->count); | |
| 441 | state_save_register_item(unique_tag, 0, z80dma->rdy); | |
| 442 | state_save_register_item(unique_tag, 0, z80dma->is_read); | |
| 443 | state_save_register_item(unique_tag, 0, z80dma->cur_cycle); | |
| 444 | state_save_register_item(unique_tag, 0, z80dma->latch); | |
| 445 | ||
| 446 | return z80dma; | |
| 447 | } | |
| 448 | ||
| 449 | static DEVICE_RESET( z80dma ) | |
| 450 | { | |
| 451 | z80dma_t *z80dma = token; | |
| 452 | ||
| 453 | z80dma->status = 0; | |
| 454 | z80dma->rdy = 0; | |
| 455 | z80dma->num_follow = 0; | |
| 456 | z80dma->dma_enabled = 0; | |
| 457 | z80dma_update_status(z80dma); | |
| 458 | } | |
| 459 | ||
| 460 | ||
| 461 | static DEVICE_SET_INFO( z80dma ) | |
| 462 | { | |
| 463 | switch (state) | |
| 464 | { | |
| 465 | /* no parameters to set */ | |
| 466 | } | |
| 467 | } | |
| 468 | ||
| 469 | ||
| 470 | DEVICE_GET_INFO( z80dma ) | |
| 471 | { | |
| 472 | switch (state) | |
| 473 | { | |
| 474 | /* --- the following bits of info are returned as 64-bit signed integers --- */ | |
| 475 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; | |
| 476 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; | |
| 477 | ||
| 478 | /* --- the following bits of info are returned as pointers to data or functions --- */ | |
| 479 | case DEVINFO_FCT_SET_INFO: info->set_info = DEVICE_SET_INFO_NAME(z80dma); break; | |
| 480 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(z80dma);break; | |
| 481 | case DEVINFO_FCT_STOP: /* Nothing */ break; | |
| 482 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(z80dma);break; | |
| 483 | ||
| 484 | /* --- the following bits of info are returned as NULL-terminated strings --- */ | |
| 485 | case DEVINFO_STR_NAME: info->s = "Z80DMA"; break; | |
| 486 | case DEVINFO_STR_FAMILY: info->s = "DMA controllers"; break; | |
| 487 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; | |
| 488 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; | |
| 489 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; | |
| 490 | } | |
| 491 | } | |
| 492 | ||
| 493 | /******************* Standard 8-bit CPU interfaces *******************/ | |
| 494 | ||
| 495 | READ8_HANDLER( z80dma_0_r ) | |
| 496 | { | |
| 497 | z80dma_t *z80dma = devtag_get_token(Machine, Z80DMA, Z80DMA_DEV_0_TAG); | |
| 498 | ||
| 499 | return z80dma_read(z80dma); | |
| 500 | } | |
| 501 | ||
| 502 | READ8_HANDLER( z80dma_1_r ) | |
| 503 | { | |
| 504 | z80dma_t *z80dma = devtag_get_token(Machine, Z80DMA, Z80DMA_DEV_1_TAG); | |
| 505 | ||
| 506 | return z80dma_read(z80dma); | |
| 507 | } | |
| 508 | ||
| 509 | WRITE8_HANDLER( z80dma_0_w ) | |
| 510 | { | |
| 511 | z80dma_t *z80dma = devtag_get_token(Machine, Z80DMA, Z80DMA_DEV_0_TAG); | |
| 512 | ||
| 513 | z80dma_write(z80dma, data); | |
| 514 | } | |
| 515 | ||
| 516 | WRITE8_HANDLER( z80dma_1_w ) | |
| 517 | { | |
| 518 | z80dma_t *z80dma = devtag_get_token(Machine, Z80DMA, Z80DMA_DEV_1_TAG); | |
| 519 | ||
| 520 | z80dma_write(z80dma, data); | |
| 521 | } | |
| 522 | ||
| 523 | WRITE8_HANDLER( z80dma_0_rdy_w ) | |
| 524 | { | |
| 525 | z80dma_t *z80dma = devtag_get_token(Machine, Z80DMA, Z80DMA_DEV_0_TAG); | |
| 526 | ||
| 527 | z80dma_rdy_write(z80dma, data); | |
| 528 | } | |
| 529 | ||
| 530 | WRITE8_HANDLER( z80dma_1_rdy_w ) | |
| 531 | { | |
| 532 | z80dma_t *z80dma = devtag_get_token(Machine, Z80DMA, Z80DMA_DEV_1_TAG); | |
| 533 | ||
| 534 | z80dma_rdy_write(z80dma, data); | |
| 535 | } |
| r1877 | r1878 | |
|---|---|---|
| 7 | 7 | #ifndef Z80DMA_H |
| 8 | 8 | #define Z80DMA_H |
| 9 | 9 | |
| 10 | struct z80dma_interface | |
| 10 | typedef struct _z80dma_t z80dma_t; | |
| 11 | typedef struct _z80dma_interface z80dma_interface; | |
| 12 | ||
| 13 | #define Z80DMA DEVICE_GET_INFO_NAME(z80dma) | |
| 14 | ||
| 15 | typedef UINT8 (*z80dma_read_func)(running_machine *machine, z80dma_t *z80dma, offs_t offset); | |
| 16 | #define Z80DMA_READ(name) UINT8 name(running_machine *machine, z80dma_t *z80dma, offs_t offset) | |
| 17 | ||
| 18 | typedef void (*z80dma_write_func)(running_machine *machine, z80dma_t *z80dma, offs_t offset, UINT8 data); | |
| 19 | #define Z80DMA_WRITE(name) void name(running_machine *machine, z80dma_t *z80dma, offs_t offset, UINT8 data) | |
| 20 | ||
| 21 | struct _z80dma_interface | |
| 11 | 22 | { |
| 12 | 23 | /* CPU to halt when DMA is active */ |
| 13 | 24 | int cpunum; |
| r1877 | r1878 | |
| 16 | 27 | int clockhz; |
| 17 | 28 | |
| 18 | 29 | /* accessors to main memory */ |
| 19 | UINT8 (*memory_read_func)(offs_t offset); | |
| 20 | void (*memory_write_func)(offs_t offset, UINT8 data); | |
| 30 | z80dma_read_func memory_read; | |
| 31 | z80dma_write_func memory_write; | |
| 21 | 32 | |
| 22 | 33 | /* port accesors */ |
| 23 | UINT8 (*portA_read_func)(UINT16 addr); | |
| 24 | void (*portA_write_func)(UINT16 addr, UINT8 data); | |
| 25 | UINT8 (*portB_read_func)(UINT16 addr); | |
| 26 | void (*portB_write_func)(UINT16 addr, UINT8 data); | |
| 34 | z80dma_read_func portA_read; | |
| 35 | z80dma_write_func portA_write; | |
| 36 | z80dma_read_func portB_read; | |
| 37 | z80dma_write_func portB_write; | |
| 27 | 38 | |
| 28 | 39 | /* interrupt callback - not implemented */ |
| 29 | 40 | /* void (*irqcb)(int state); */ |
| 30 | 41 | }; |
| 31 | 42 | |
| 32 | int z80dma_init(int count); | |
| 33 | void z80dma_config(int which, const struct z80dma_interface *intf); | |
| 34 | void z80dma_reset(void); | |
| 43 | /* device interface */ | |
| 44 | DEVICE_GET_INFO( z80dma ); | |
| 35 | 45 | |
| 36 | void z80dma_rdy_write(int which, int state); | |
| 46 | void z80dma_rdy_write( z80dma_t *z80dma, int state); | |
| 47 | UINT8 z80dma_read( z80dma_t *z80dma); | |
| 48 | void z80dma_write( z80dma_t *z80dma, UINT8 data); | |
| 37 | 49 | |
| 50 | /******************* Standard 8-bit CPU interfaces *******************/ | |
| 51 | ||
| 52 | #define Z80DMA_DEV_0_TAG "z80dma0" | |
| 53 | ||
| 38 | 54 | READ8_HANDLER(z80dma_0_r); |
| 55 | WRITE8_HANDLER(z80dma_0_rdy_w); | |
| 56 | WRITE8_HANDLER(z80dma_0_w); | |
| 57 | ||
| 58 | #define Z80DMA_DEV_1_TAG "z80dma1" | |
| 59 | ||
| 39 | 60 | READ8_HANDLER(z80dma_1_r); |
| 40 | WRITE8_HANDLER(z80dma_0_w); | |
| 41 | 61 | WRITE8_HANDLER(z80dma_1_w); |
| 42 | ||
| 43 | WRITE8_HANDLER(z80dma_0_rdy_w); | |
| 44 | 62 | WRITE8_HANDLER(z80dma_1_rdy_w); |
| 45 | 63 | |
| 46 | READ16_HANDLER(z80dma_16le_0_r); | |
| 47 | READ16_HANDLER(z80dma_16le_1_r); | |
| 48 | WRITE16_HANDLER(z80dma_16le_0_w); | |
| 49 | WRITE16_HANDLER(z80dma_16le_1_w); | |
| 50 | ||
| 51 | READ32_HANDLER(z80dma_32le_0_r); | |
| 52 | READ32_HANDLER(z80dma_32le_1_r); | |
| 53 | WRITE32_HANDLER(z80dma_32le_0_w); | |
| 54 | WRITE32_HANDLER(z80dma_32le_1_w); | |
| 55 | ||
| 56 | READ64_HANDLER(z80dma_64be_0_r); | |
| 57 | READ64_HANDLER(z80dma_64be_1_r); | |
| 58 | WRITE64_HANDLER(z80dma_64be_0_w); | |
| 59 | WRITE64_HANDLER(z80dma_64be_1_w); | |
| 60 | ||
| 61 | 64 | #endif /* Z80_H */ |
| r1877 | r1878 | |
|---|---|---|
| 201 | 201 | |
| 202 | 202 | return duart_pop_rx_fifo(chip, channel); |
| 203 | 203 | } |
| 204 | break; | |
| 205 | 204 | } |
| 206 | 205 | case 1: |
| 207 | 206 | { |
| r1877 | r1878 | |
| 314 | 313 | |
| 315 | 314 | return; |
| 316 | 315 | } |
| 317 | break; | |
| 318 | 316 | } |
| 319 | 317 | case 1: |
| 320 | 318 | { |
| r1877 | r1878 | |
| 335 | 333 | check_interrupts(chip, channel); |
| 336 | 334 | return; |
| 337 | 335 | } |
| 338 | break; | |
| 339 | 336 | } |
| 340 | 337 | |
| 341 | 338 | case 2: |
| r1877 | r1878 | |
|---|---|---|
| 91 | 91 | *********************************************************************/ |
| 92 | 92 | |
| 93 | 93 | #include "driver.h" |
| 94 | #include "deprecat.h" | |
| 94 | 95 | #include "8255ppi.h" |
| 95 | 96 | #include "memconv.h" |
| 96 | 97 | |
| r1877 | r1878 | |
| 99 | 100 | |
| 100 | 101 | typedef struct |
| 101 | 102 | { |
| 102 | read8_handler port_read[3]; | |
| 103 | write8_handler port_write[3]; | |
| 103 | read8_machine_func port_read[3]; | |
| 104 | write8_machine_func port_write[3]; | |
| 104 | 105 | |
| 105 | 106 | /* mode flags */ |
| 106 | 107 | UINT8 groupA_mode; |
| r1877 | r1878 | |
| 268 | 269 | if (chip->in_mask[port]) |
| 269 | 270 | { |
| 270 | 271 | if (chip->port_read[port]) |
| 271 | ppi8255_input(chip, port, chip->port_read[port](0)); | |
| 272 | ppi8255_input(chip, port, chip->port_read[port](Machine, 0)); | |
| 272 | 273 | |
| 273 | 274 | result |= chip->read[port] & chip->in_mask[port]; |
| 274 | 275 | } |
| r1877 | r1878 | |
| 328 | 329 | |
| 329 | 330 | chip->output[port] = write_data; |
| 330 | 331 | if (chip->port_write[port]) |
| 331 | chip->port_write[port](0, write_data); | |
| 332 | chip->port_write[port](Machine, 0, write_data); | |
| 332 | 333 | } |
| 333 | 334 | |
| 334 | 335 | |
| r1877 | r1878 | |
| 427 | 428 | #endif |
| 428 | 429 | |
| 429 | 430 | |
| 430 | void ppi8255_set_portAread(int which, read8_ | |
| 431 | void ppi8255_set_portAread(int which, read8_machin | |
| 431 | 432 | { |
| 432 | 433 | chips[which].port_read[0] = portAread; |
| 433 | 434 | } |
| 434 | 435 | |
| 435 | void ppi8255_set_portBread(int which, read8_ | |
| 436 | void ppi8255_set_portBread(int which, read8_machin | |
| 436 | 437 | { |
| 437 | 438 | chips[which].port_read[1] = portBread; |
| 438 | 439 | } |
| 439 | 440 | |
| 440 | void ppi8255_set_portCread(int which, read8_ | |
| 441 | void ppi8255_set_portCread(int which, read8_machin | |
| 441 | 442 | { |
| 442 | 443 | chips[which].port_read[2] = portCread; |
| 443 | 444 | } |
| 444 | 445 | |
| 445 | 446 | |
| 446 | void ppi8255_set_portAwrite(int which, write8_ | |
| 447 | void ppi8255_set_portAwrite(int which, write8_machin | |
| 447 | 448 | { |
| 448 | 449 | chips[which].port_write[0] = portAwrite; |
| 449 | 450 | } |
| 450 | 451 | |
| 451 | void ppi8255_set_portBwrite(int which, write8_ | |
| 452 | void ppi8255_set_portBwrite(int which, write8_machin | |
| 452 | 453 | { |
| 453 | 454 | chips[which].port_write[1] = portBwrite; |
| 454 | 455 | } |
| 455 | 456 | |
| 456 | void ppi8255_set_portCwrite(int which, write8_ | |
| 457 | void ppi8255_set_portCwrite(int which, write8_machin | |
| 457 | 458 | { |
| 458 | 459 | chips[which].port_write[2] = portCwrite; |
| 459 | 460 | } |
| r1877 | r1878 | |
| 571 | 572 | WRITE8_HANDLER( ppi8255_6_w ) { ppi8255_w( 6, offset, data ); } |
| 572 | 573 | WRITE8_HANDLER( ppi8255_7_w ) { ppi8255_w( 7, offset, data ); } |
| 573 | 574 | |
| 574 | READ16_HANDLER( ppi8255_16le_0_r ) { return read16le_with_read8_handler(ppi8255_0_r, offset, mem_mask); } | |
| 575 | READ16_HANDLER( ppi8255_16le_1_r ) { return read16le_with_read8_handler(ppi8255_1_r, offset, mem_mask); } | |
| 576 | READ16_HANDLER( ppi8255_16le_2_r ) { return read16le_with_read8_handler(ppi8255_2_r, offset, mem_mask); } | |
| 577 | READ16_HANDLER( ppi8255_16le_3_r ) { return read16le_with_read8_handler(ppi8255_3_r, offset, mem_mask); } | |
| 578 | READ16_HANDLER( ppi8255_16le_4_r ) { return read16le_with_read8_handler(ppi8255_4_r, offset, mem_mask); } | |
| 579 | READ16_HANDLER( ppi8255_16le_5_r ) { return read16le_with_read8_handler(ppi8255_5_r, offset, mem_mask); } | |
| 580 | READ16_HANDLER( ppi8255_16le_6_r ) { return read16le_with_read8_handler(ppi8255_6_r, offset, mem_mask); } | |
| 581 | READ16_HANDLER( ppi8255_16le_7_r ) { return read16le_with_read8_handler(ppi8255_7_r, offset, mem_mask); } | |
| 582 | WRITE16_HANDLER( ppi8255_16le_0_w ) { write16le_with_write8_handler(ppi8255_0_w, offset, data, mem_mask); } | |
| 583 | WRITE16_HANDLER( ppi8255_16le_1_w ) { write16le_with_write8_handler(ppi8255_1_w, offset, data, mem_mask); } | |
| 584 | WRITE16_HANDLER( ppi8255_16le_2_w ) { write16le_with_write8_handler(ppi8255_2_w, offset, data, mem_mask); } | |
| 585 | WRITE16_HANDLER( ppi8255_16le_3_w ) { write16le_with_write8_handler(ppi8255_3_w, offset, data, mem_mask); } | |
| 586 | WRITE16_HANDLER( ppi8255_16le_4_w ) { write16le_with_write8_handler(ppi8255_4_w, offset, data, mem_mask); } | |
| 587 | WRITE16_HANDLER( ppi8255_16le_5_w ) { write16le_with_write8_handler(ppi8255_5_w, offset, data, mem_mask); } | |
| 588 | WRITE16_HANDLER( ppi8255_16le_6_w ) { write16le_with_write8_handler(ppi8255_6_w, offset, data, mem_mask); } | |
| 589 | WRITE16_HANDLER( ppi8255_16le_7_w ) { write16le_with_write8_handler(ppi8255_7_w, offset, data, mem_mask); } | |
| 575 | READ16_HANDLER( ppi8255_16le_0_r ) { return read16le_with_read8_handler(ppi8255_0_r, machine, offset, mem_mask); } | |
| 576 | READ16_HANDLER( ppi8255_16le_1_r ) { return read16le_with_read8_handler(ppi8255_1_r, machine, offset, mem_mask); } | |
| 577 | READ16_HANDLER( ppi8255_16le_2_r ) { return read16le_with_read8_handler(ppi8255_2_r, machine, offset, mem_mask); } | |
| 578 | READ16_HANDLER( ppi8255_16le_3_r ) { return read16le_with_read8_handler(ppi8255_3_r, machine, offset, mem_mask); } | |
| 579 | READ16_HANDLER( ppi8255_16le_4_r ) { return read16le_with_read8_handler(ppi8255_4_r, machine, offset, mem_mask); } | |
| 580 | READ16_HANDLER( ppi8255_16le_5_r ) { return read16le_with_read8_handler(ppi8255_5_r, machine, offset, mem_mask); } | |
| 581 | READ16_HANDLER( ppi8255_16le_6_r ) { return read16le_with_read8_handler(ppi8255_6_r, machine, offset, mem_mask); } | |
| 582 | READ16_HANDLER( ppi8255_16le_7_r ) { return read16le_with_read8_handler(ppi8255_7_r, machine, offset, mem_mask); } | |
| 583 | WRITE16_HANDLER( ppi8255_16le_0_w ) { write16le_with_write8_handler(ppi8255_0_w, machine, offset, data, mem_mask); } | |
| 584 | WRITE16_HANDLER( ppi8255_16le_1_w ) { write16le_with_write8_handler(ppi8255_1_w, machine, offset, data, mem_mask); } | |
| 585 | WRITE16_HANDLER( ppi8255_16le_2_w ) { write16le_with_write8_handler(ppi8255_2_w, machine, offset, data, mem_mask); } | |
| 586 | WRITE16_HANDLER( ppi8255_16le_3_w ) { write16le_with_write8_handler(ppi8255_3_w, machine, offset, data, mem_mask); } | |
| 587 | WRITE16_HANDLER( ppi8255_16le_4_w ) { write16le_with_write8_handler(ppi8255_4_w, machine, offset, data, mem_mask); } | |
| 588 | WRITE16_HANDLER( ppi8255_16le_5_w ) { write16le_with_write8_handler(ppi8255_5_w, machine, offset, data, mem_mask); } | |
| 589 | WRITE16_HANDLER( ppi8255_16le_6_w ) { write16le_with_write8_handler(ppi8255_6_w, machine, offset, data, mem_mask); } | |
| 590 | WRITE16_HANDLER( ppi8255_16le_7_w ) { write16le_with_write8_handler(ppi8255_7_w, machine, offset, data, mem_mask); } |
| r1877 | r1878 | |
|---|---|---|
| 613 | 613 | |
| 614 | 614 | READ32_HANDLER( kbdc8042_32le_r ) |
| 615 | 615 | { |
| 616 | return read32le_with_read8_handler(kbdc8042_8_r, offset, mem_mask); | |
| 616 | return read32le_with_read8_handler(kbdc8042_8_r, machine, offset, mem_mask); | |
| 617 | 617 | } |
| 618 | 618 | |
| 619 | 619 | |
| 620 | 620 | |
| 621 | 621 | WRITE32_HANDLER( kbdc8042_32le_w ) |
| 622 | 622 | { |
| 623 | write32le_with_write8_handler(kbdc8042_8_w, offset, data, mem_mask); | |
| 623 | write32le_with_write8_handler(kbdc8042_8_w, machine, offset, data, mem_mask); | |
| 624 | 624 | } |
| 625 | 625 | |
| 626 | 626 | |
| 627 | 627 | |
| 628 | 628 | READ64_HANDLER( kbdc8042_64be_r ) |
| 629 | 629 | { |
| 630 | return read64be_with_read8_handler(kbdc8042_8_r, offset, mem_mask); | |
| 630 | return read64be_with_read8_handler(kbdc8042_8_r, machine, offset, mem_mask); | |
| 631 | 631 | } |
| 632 | 632 | |
| 633 | 633 | |
| 634 | 634 | |
| 635 | 635 | WRITE64_HANDLER( kbdc8042_64be_w ) |
| 636 | 636 | { |
| 637 | write64be_with_write8_handler(kbdc8042_8_w, offset, data, mem_mask); | |
| 637 | write64be_with_write8_handler(kbdc8042_8_w, machine, offset, data, mem_mask); | |
| 638 | 638 | } |
| r1877 | r1878 | |
|---|---|---|
| 14 | 14 | typedef struct |
| 15 | 15 | { |
| 16 | 16 | int num; /* number of PPIs to emulate */ |
| 17 | read8_handler portAread[MAX_8255]; | |
| 18 | read8_handler portBread[MAX_8255]; | |
| 19 | read8_handler portCread[MAX_8255]; | |
| 20 | write8_handler portAwrite[MAX_8255]; | |
| 21 | write8_handler portBwrite[MAX_8255]; | |
| 22 | write8_handler portCwrite[MAX_8255]; | |
| 17 | read8_machine_func portAread[MAX_8255]; | |
| 18 | read8_machine_func portBread[MAX_8255]; | |
| 19 | read8_machine_func portCread[MAX_8255]; | |
| 20 | write8_machine_func portAwrite[MAX_8255]; | |
| 21 | write8_machine_func portBwrite[MAX_8255]; | |
| 22 | write8_machine_func portCwrite[MAX_8255]; | |
| 23 | 23 | } ppi8255_interface; |
| 24 | 24 | |
| 25 | 25 | |
| r1877 | r1878 | |
| 30 | 30 | UINT8 ppi8255_r ( int which, offs_t offset ); |
| 31 | 31 | void ppi8255_w( int which, offs_t offset, UINT8 data ); |
| 32 | 32 | |
| 33 | void ppi8255_set_portAread( int which, read8_handler portAread); | |
| 34 | void ppi8255_set_portBread( int which, read8_handler portBread); | |
| 35 | void ppi8255_set_portCread( int which, read8_handler portCread); | |
| 33 | void ppi8255_set_portAread( int which, read8_machine_func portAread); | |
| 34 | void ppi8255_set_portBread( int which, read8_machine_func portBread); | |
| 35 | void ppi8255_set_portCread( int which, read8_machine_func portCread); | |
| 36 | 36 | |
| 37 | void ppi8255_set_portAwrite( int which, write8_handler portAwrite); | |
| 38 | void ppi8255_set_portBwrite( int which, write8_handler portBwrite); | |
| 39 | void ppi8255_set_portCwrite( int which, write8_handler portCwrite); | |
| 37 | void ppi8255_set_portAwrite( int which, write8_machine_func portAwrite); | |
| 38 | void ppi8255_set_portBwrite( int which, write8_machine_func portBwrite); | |
| 39 | void ppi8255_set_portCwrite( int which, write8_machine_func portCwrite); | |
| 40 | 40 | |
| 41 | 41 | void ppi8255_set_portA( int which, UINT8 data ); |
| 42 | 42 | void ppi8255_set_portB( int which, UINT8 data ); |
| r1877 | r1878 | |
|---|---|---|
| 435 | 435 | WRITE8_HANDLER( dma8237_0_w ) { dma8237_write(0, offset, data); } |
| 436 | 436 | WRITE8_HANDLER( dma8237_1_w ) { dma8237_write(1, offset, data); } |
| 437 | 437 | |
| 438 | READ16_HANDLER( dma8237_16le_0_r ) { return read16le_with_read8_handler(dma8237_0_r, offset, mem_mask); } | |
| 439 | READ16_HANDLER( dma8237_16le_1_r ) { return read16le_with_read8_handler(dma8237_1_r, offset, mem_mask); } | |
| 440 | WRITE16_HANDLER( dma8237_16le_0_w ) { write16le_with_write8_handler(dma8237_0_w, offset, data, mem_mask); } | |
| 441 | WRITE16_HANDLER( dma8237_16le_1_w ) { write16le_with_write8_handler(dma8237_1_w, offset, data, mem_mask); } | |
| 438 | READ16_HANDLER( dma8237_16le_0_r ) { return read16le_with_read8_handler(dma8237_0_r, machine, offset, mem_mask); } | |
| 439 | READ16_HANDLER( dma8237_16le_1_r ) { return read16le_with_read8_handler(dma8237_1_r, machine, offset, mem_mask); } | |
| 440 | WRITE16_HANDLER( dma8237_16le_0_w ) { write16le_with_write8_handler(dma8237_0_w, machine, offset, data, mem_mask); } | |
| 441 | WRITE16_HANDLER( dma8237_16le_1_w ) { write16le_with_write8_handler(dma8237_1_w, machine, offset, data, mem_mask); } | |
| 442 | 442 | |
| 443 | READ32_HANDLER( dma8237_32le_0_r ) { return read32le_with_read8_handler(dma8237_0_r, offset, mem_mask); } | |
| 444 | READ32_HANDLER( dma8237_32le_1_r ) { return read32le_with_read8_handler(dma8237_1_r, offset, mem_mask); } | |
| 445 | WRITE32_HANDLER( dma8237_32le_0_w ) { write32le_with_write8_handler(dma8237_0_w, offset, data, mem_mask); } | |
| 446 | WRITE32_HANDLER( dma8237_32le_1_w ) { write32le_with_write8_handler(dma8237_1_w, offset, data, mem_mask); } | |
| 443 | READ32_HANDLER( dma8237_32le_0_r ) { return read32le_with_read8_handler(dma8237_0_r, machine, offset, mem_mask); } | |
| 444 | READ32_HANDLER( dma8237_32le_1_r ) { return read32le_with_read8_handler(dma8237_1_r, machine, offset, mem_mask); } | |
| 445 | WRITE32_HANDLER( dma8237_32le_0_w ) { write32le_with_write8_handler(dma8237_0_w, machine, offset, data, mem_mask); } | |
| 446 | WRITE32_HANDLER( dma8237_32le_1_w ) { write32le_with_write8_handler(dma8237_1_w, machine, offset, data, mem_mask); } | |
| 447 | 447 | |
| 448 | READ64_HANDLER( dma8237_64be_0_r ) { return read64be_with_read8_handler(dma8237_0_r, offset, mem_mask); } | |
| 449 | READ64_HANDLER( dma8237_64be_1_r ) { return read64be_with_read8_handler(dma8237_1_r, offset, mem_mask); } | |
| 450 | WRITE64_HANDLER( dma8237_64be_0_w ) { write64be_with_write8_handler(dma8237_0_w, offset, data, mem_mask); } | |
| 451 | WRITE64_HANDLER( dma8237_64be_1_w ) { write64be_with_write8_handler(dma8237_1_w, offset, data, mem_mask); } | |
| 448 | READ64_HANDLER( dma8237_64be_0_r ) { return read64be_with_read8_handler(dma8237_0_r, machine, offset, mem_mask); } | |
| 449 | READ64_HANDLER( dma8237_64be_1_r ) { return read64be_with_read8_handler(dma8237_1_r, machine, offset, mem_mask); } | |
| 450 | WRITE64_HANDLER( dma8237_64be_0_w ) { write64be_with_write8_handler(dma8237_0_w, machine, offset, data, mem_mask); } | |
| 451 | WRITE64_HANDLER( dma8237_64be_1_w ) { write64be_with_write8_handler(dma8237_1_w, machine, offset, data, mem_mask); } |
| r1877 | r1878 | |
|---|---|---|
| 363 | 363 | WRITE8_HANDLER( dma8257_0_w ) { dma8257_write(0, offset, data); } |
| 364 | 364 | WRITE8_HANDLER( dma8257_1_w ) { dma8257_write(1, offset, data); } |
| 365 | 365 | |
| 366 | READ16_HANDLER( dma8257_16le_0_r ) { return read16le_with_read8_handler(dma8257_0_r, offset, mem_mask); } | |
| 367 | READ16_HANDLER( dma8257_16le_1_r ) { return read16le_with_read8_handler(dma8257_1_r, offset, mem_mask); } | |
| 368 | WRITE16_HANDLER( dma8257_16le_0_w ) { write16le_with_write8_handler(dma8257_0_w, offset, data, mem_mask); } | |
| 369 | WRITE16_HANDLER( dma8257_16le_1_w ) { write16le_with_write8_handler(dma8257_1_w, offset, data, mem_mask); } | |
| 366 | READ16_HANDLER( dma8257_16le_0_r ) { return read16le_with_read8_handler(dma8257_0_r, machine, offset, mem_mask); } | |
| 367 | READ16_HANDLER( dma8257_16le_1_r ) { return read16le_with_read8_handler(dma8257_1_r, machine, offset, mem_mask); } | |
| 368 | WRITE16_HANDLER( dma8257_16le_0_w ) { write16le_with_write8_handler(dma8257_0_w, machine, offset, data, mem_mask); } | |
| 369 | WRITE16_HANDLER( dma8257_16le_1_w ) { write16le_with_write8_handler(dma8257_1_w, machine, offset, data, mem_mask); } | |
| 370 | 370 | |
| 371 | READ32_HANDLER( dma8257_32le_0_r ) { return read32le_with_read8_handler(dma8257_0_r, offset, mem_mask); } | |
| 372 | READ32_HANDLER( dma8257_32le_1_r ) { return read32le_with_read8_handler(dma8257_1_r, offset, mem_mask); } | |
| 373 | WRITE32_HANDLER( dma8257_32le_0_w ) { write32le_with_write8_handler(dma8257_0_w, offset, data, mem_mask); } | |
| 374 | WRITE32_HANDLER( dma8257_32le_1_w ) { write32le_with_write8_handler(dma8257_1_w, offset, data, mem_mask); } | |
| 371 | READ32_HANDLER( dma8257_32le_0_r ) { return read32le_with_read8_handler(dma8257_0_r, machine, offset, mem_mask); } | |
| 372 | READ32_HANDLER( dma8257_32le_1_r ) { return read32le_with_read8_handler(dma8257_1_r, machine, offset, mem_mask); } | |
| 373 | WRITE32_HANDLER( dma8257_32le_0_w ) { write32le_with_write8_handler(dma8257_0_w, machine, offset, data, mem_mask); } | |
| 374 | WRITE32_HANDLER( dma8257_32le_1_w ) { write32le_with_write8_handler(dma8257_1_w, machine, offset, data, mem_mask); } | |
| 375 | 375 | |
| 376 | READ64_HANDLER( dma8257_64be_0_r ) { return read64be_with_read8_handler(dma8257_0_r, offset, mem_mask); } | |
| 377 | READ64_HANDLER( dma8257_64be_1_r ) { return read64be_with_read8_handler(dma8257_1_r, offset, mem_mask); } | |
| 378 | WRITE64_HANDLER( dma8257_64be_0_w ) { write64be_with_write8_handler(dma8257_0_w, offset, data, mem_mask); } | |
| 379 | WRITE64_HANDLER( dma8257_64be_1_w ) { write64be_with_write8_handler(dma8257_1_w, offset, data, mem_mask); } | |
| 376 | READ64_HANDLER( dma8257_64be_0_r ) { return read64be_with_read8_handler(dma8257_0_r, machine, offset, mem_mask); } | |
| 377 | READ64_HANDLER( dma8257_64be_1_r ) { return read64be_with_read8_handler(dma8257_1_r, machine, offset, mem_mask); } | |
| 378 | WRITE64_HANDLER( dma8257_64be_0_w ) { write64be_with_write8_handler(dma8257_0_w, machine, offset, data, mem_mask); } | |
| 379 | WRITE64_HANDLER( dma8257_64be_1_w ) { write64be_with_write8_handler(dma8257_1_w, machine, offset, data, mem_mask); } |
| r1877 | r1878 | |
|---|---|---|
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "deprecat.h" | |
| 11 | 12 | #include "z80sio.h" |
| 12 | 13 | #include "cpu/z80/z80.h" |
| 13 | 14 | #include "cpu/z80/z80daisy.h" |
| r1877 | r1878 | |
| 180 | 181 | UINT8 int_state[8]; /* interrupt states */ |
| 181 | 182 | |
| 182 | 183 | void (*irq_cb)(int state); |
| 183 | write8_handler dtr_changed_cb; | |
| 184 | write8_handler rts_changed_cb; | |
| 185 | write8_handler break_changed_cb; | |
| 186 | write8_handler transmit_cb; | |
| 184 | write8_machine_func dtr_changed_cb; | |
| 185 | write8_machine_func rts_changed_cb; | |
| 186 | write8_machine_func break_changed_cb; | |
| 187 | write8_machine_func transmit_cb; | |
| 187 | 188 | int (*receive_poll_cb)(int which); |
| 188 | 189 | }; |
| 189 | 190 | |
| r1877 | r1878 | |
| 418 | 419 | /* SIO write register 5 */ |
| 419 | 420 | case 5: |
| 420 | 421 | if (((old ^ data) & SIO_WR5_DTR) && sio->dtr_changed_cb) |
| 421 | (*sio->dtr_changed_cb)(ch, (data & SIO_WR5_DTR) != 0); | |
| 422 | (*sio->dtr_changed_cb)(Machine, ch, (data & SIO_WR5_DTR) != 0); | |
| 422 | 423 | if (((old ^ data) & SIO_WR5_SEND_BREAK) && sio->break_changed_cb) |
| 423 | (*sio->break_changed_cb)(ch, (data & SIO_WR5_SEND_BREAK) != 0); | |
| 424 | (*sio->break_changed_cb)(Machine, ch, (data & SIO_WR5_SEND_BREAK) != 0); | |
| 424 | 425 | if (((old ^ data) & SIO_WR5_RTS) && sio->rts_changed_cb) |
| 425 | (*sio->rts_changed_cb)(ch, (data & SIO_WR5_RTS) != 0); | |
| 426 | (*sio->rts_changed_cb)(Machine, ch, (data & SIO_WR5_RTS) != 0); | |
| 426 | 427 | break; |
| 427 | 428 | } |
| 428 | 429 | } |
| r1877 | r1878 | |
| 641 | 642 | |
| 642 | 643 | /* actually transmit the character */ |
| 643 | 644 | if (sio->transmit_cb != NULL) |
| 644 | (*sio->transmit_cb)(ch, chan->outbuf); | |
| 645 | (*sio->transmit_cb)(machine, ch, chan->outbuf); | |
| 645 | 646 | |
| 646 | 647 | /* update the status register */ |
| 647 | 648 | chan->status[0] |= SIO_RR0_TX_BUFFER_EMPTY; |
| r1877 | r1878 | |
|---|---|---|
| 24 | 24 | { |
| 25 | 25 | int baseclock; |
| 26 | 26 | void (*irq_cb)(int state); |
| 27 | write8_handler dtr_changed_cb; | |
| 28 | write8_handler rts_changed_cb; | |
| 29 | write8_handler break_changed_cb; | |
| 30 | write8_handler transmit_cb; | |
| 27 | write8_machine_func dtr_changed_cb; | |
| 28 | write8_machine_func rts_changed_cb; | |
| 29 | write8_machine_func break_changed_cb; | |
| 30 | write8_machine_func transmit_cb; | |
| 31 | 31 | int (*receive_poll_cb)(int which); |
| 32 | 32 | }; |
| 33 | 33 |
| r1877 | r1878 | |
|---|---|---|
| 193 | 193 | |
| 194 | 194 | |
| 195 | 195 | |
| 196 | READ64_HANDLER(pci_64be_r) { return read64be_with_32le_handler(pci_32le_r, offset, mem_mask); } | |
| 197 | WRITE64_HANDLER(pci_64be_w) { write64be_with_32le_handler(pci_32le_w, offset, data, mem_mask); } | |
| 196 | READ64_HANDLER(pci_64be_r) { return read64be_with_32le_handler(pci_32le_r, machine, offset, mem_mask); } | |
| 197 | WRITE64_HANDLER(pci_64be_w) { write64be_with_32le_handler(pci_32le_w, machine, offset, data, mem_mask); } |
| r1877 | r1878 | |
|---|---|---|
| 81 | 81 | attotime period16; /* 16/system clock */ |
| 82 | 82 | attotime period256; /* 256/system clock */ |
| 83 | 83 | void (*intr)(int which); /* interrupt callback */ |
| 84 | write8_ | |
| 84 | write8_machin | |
| 85 | 85 | UINT8 notimer; /* no timer masks */ |
| 86 | 86 | UINT16 mode[4]; /* current mode */ |
| 87 | 87 | UINT16 tconst[4]; /* time constant */ |
| r1877 | r1878 | |
| 132 | 132 | /* generate the clock pulse */ |
| 133 | 133 | if (ctc->zc[ch]) |
| 134 | 134 | { |
| 135 | (*ctc->zc[ch])(0,1); | |
| 136 | (*ctc->zc[ch])(0,0); | |
| 135 | (*ctc->zc[ch])(machine,0,1); | |
| 136 | (*ctc->zc[ch])(machine,0,0); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /* reset the down counter */ |
| r1877 | r1878 | |
|---|---|---|
| 45 | 45 | { |
| 46 | 46 | double clockin; /* input clock frequency in Hz */ |
| 47 | 47 | |
| 48 | void (*output_callback)(int); /* callback function for when output changes */ | |
| 48 | void (*output_callback_func)(int); /* callback function for when output changes */ | |
| 49 | 49 | void (*freq_callback)(double); /* callback function for when output frequency changes */ |
| 50 | 50 | |
| 51 | 51 | attotime last_updated; /* time when last updated */ |
| r1877 | r1878 | |
| 272 | 272 | if (output != timer->output) |
| 273 | 273 | { |
| 274 | 274 | timer->output = output; |
| 275 | if (timer->output_callback != NULL) | |
| 275 | if (timer->output_callback_func != NULL) | |
| 276 | 276 | { |
| 277 | timer->output_callback(output); | |
| 277 | timer->output_callback_func(output); | |
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | } |
| r1877 | r1878 | |
| 602 | 602 | break; |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | if (timer->output_callback != NULL) | |
| 605 | if (timer->output_callback_func != NULL) | |
| 606 | 606 | { |
| 607 | 607 | timer->cycles_to_output = cycles_to_output; |
| 608 | 608 | if (cycles_to_output == CYCLES_NEVER || timer->clockin == 0) |
| r1877 | r1878 | |
| 766 | 766 | timer = get_timer(pit,timerno); |
| 767 | 767 | |
| 768 | 768 | timer->clockin = pit->config->timer[timerno].clockin; |
| 769 | timer->output_callback = pit->config->timer[timerno].output_callback; | |
| 769 | timer->output_callback_func = pit->config->timer[timerno].output_callback_func; | |
| 770 | 770 | timer->freq_callback = pit->config->timer[timerno].clock_callback; |
| 771 | 771 | |
| 772 | if (timer->output_callback == NULL) | |
| 772 | if (timer->output_callback_func == NULL) | |
| 773 | 773 | timer->outputtimer = NULL; |
| 774 | 774 | else |
| 775 | 775 | { |
| r1877 | r1878 | |
| 1188 | 1188 | WRITE16_HANDLER ( pit8253_0_lsb_w ) { if (ACCESSING_LSB) pit8253_write(0, offset, data); } |
| 1189 | 1189 | WRITE16_HANDLER ( pit8253_1_lsb_w ) { if (ACCESSING_LSB) pit8253_write(1, offset, data); } |
| 1190 | 1190 | |
| 1191 | READ16_HANDLER ( pit8253_16le_0_r ) { return read16le_with_read8_handler(pit8253_0_r, offset, mem_mask); } | |
| 1192 | READ16_HANDLER ( pit8253_16le_1_r ) { return read16le_with_read8_handler(pit8253_1_r, offset, mem_mask); } | |
| 1193 | WRITE16_HANDLER ( pit8253_16le_0_w ) { write16le_with_write8_handler(pit8253_0_w, offset, data, mem_mask); } | |
| 1194 | WRITE16_HANDLER ( pit8253_16le_1_w ) { write16le_with_write8_handler(pit8253_1_w, offset, data, mem_mask); } | |
| 1191 | READ16_HANDLER ( pit8253_16le_0_r ) { return read16le_with_read8_handler(pit8253_0_r, machine, offset, mem_mask); } | |
| 1192 | READ16_HANDLER ( pit8253_16le_1_r ) { return read16le_with_read8_handler(pit8253_1_r, machine, offset, mem_mask); } | |
| 1193 | WRITE16_HANDLER ( pit8253_16le_0_w ) { write16le_with_write8_handler(pit8253_0_w, machine, offset, data, mem_mask); } | |
| 1194 | WRITE16_HANDLER ( pit8253_16le_1_w ) { write16le_with_write8_handler(pit8253_1_w, machine, offset, data, mem_mask); } | |
| 1195 | 1195 | |
| 1196 | READ32_HANDLER ( pit8253_32le_0_r ) { return read32le_with_read8_handler(pit8253_0_r, offset, mem_mask); } | |
| 1197 | READ32_HANDLER ( pit8253_32le_1_r ) { return read32le_with_read8_handler(pit8253_1_r, offset, mem_mask); } | |
| 1198 | WRITE32_HANDLER ( pit8253_32le_0_w ) { write32le_with_write8_handler(pit8253_0_w, offset, data, mem_mask); } | |
| 1199 | WRITE32_HANDLER ( pit8253_32le_1_w ) { write32le_with_write8_handler(pit8253_1_w, offset, data, mem_mask); } | |
| 1196 | READ32_HANDLER ( pit8253_32le_0_r ) { return read32le_with_read8_handler(pit8253_0_r, machine, offset, mem_mask); } | |
| 1197 | READ32_HANDLER ( pit8253_32le_1_r ) { return read32le_with_read8_handler(pit8253_1_r, machine, offset, mem_mask); } | |
| 1198 | WRITE32_HANDLER ( pit8253_32le_0_w ) { write32le_with_write8_handler(pit8253_0_w, machine, offset, data, mem_mask); } | |
| 1199 | WRITE32_HANDLER ( pit8253_32le_1_w ) { write32le_with_write8_handler(pit8253_1_w, machine, offset, data, mem_mask); } | |
| 1200 | 1200 | |
| 1201 | READ64_HANDLER ( pit8253_64be_0_r ) { return read64be_with_read8_handler(pit8253_0_r, offset, mem_mask); } | |
| 1202 | READ64_HANDLER ( pit8253_64be_1_r ) { return read64be_with_read8_handler(pit8253_1_r, offset, mem_mask); } | |
| 1203 | WRITE64_HANDLER ( pit8253_64be_0_w ) { write64be_with_write8_handler(pit8253_0_w, offset, data, mem_mask); } | |
| 1204 | WRITE64_HANDLER ( pit8253_64be_1_w ) { write64be_with_write8_handler(pit8253_1_w, offset, data, mem_mask); } | |
| 1201 | READ64_HANDLER ( pit8253_64be_0_r ) { return read64be_with_read8_handler(pit8253_0_r, machine, offset, mem_mask); } | |
| 1202 | READ64_HANDLER ( pit8253_64be_1_r ) { return read64be_with_read8_handler(pit8253_1_r, machine, offset, mem_mask); } | |
| 1203 | WRITE64_HANDLER ( pit8253_64be_0_w ) { write64be_with_write8_handler(pit8253_0_w, machine, offset, data, mem_mask); } | |
| 1204 | WRITE64_HANDLER ( pit8253_64be_1_w ) { write64be_with_write8_handler(pit8253_1_w, machine, offset, data, mem_mask); } | |
| 1205 | 1205 | |
| 1206 | 1206 | WRITE8_HANDLER ( pit8253_0_gate_w ) { pit8253_gate_write(0, offset, data); } |
| 1207 | 1207 | WRITE8_HANDLER ( pit8253_1_gate_w ) { pit8253_gate_write(1, offset, data); } |
| r1877 | r1878 | |
|---|---|---|
| 29 | 29 | int baseclock; /* timer clock */ |
| 30 | 30 | int notimer; /* timer disablers */ |
| 31 | 31 | void (*intr)(int which); /* callback when change interrupt status */ |
| 32 | write8_handler zc0; /* ZC/TO0 callback */ | |
| 33 | write8_handler zc1; /* ZC/TO1 callback */ | |
| 34 | write8_handler zc2; /* ZC/TO2 callback */ | |
| 32 | write8_machine_func zc0; /* ZC/TO0 callback */ | |
| 33 | write8_machine_func zc1; /* ZC/TO1 callback */ | |
| 34 | write8_machine_func zc2; /* ZC/TO2 callback */ | |
| 35 | 35 | } z80ctc_interface; |
| 36 | 36 | |
| 37 | 37 |
| r1877 | r1878 | |
|---|---|---|
| 15 | 15 | struct |
| 16 | 16 | { |
| 17 | 17 | double clockin; |
| 18 | void (*output_callback)(int state); | |
| 18 | void (*output_callback_func)(int state); | |
| 19 | 19 | void (*clock_callback)(double clockout); |
| 20 | 20 | } timer[3]; |
| 21 | 21 | }; |
| r1877 | r1878 | |
|---|---|---|
| 364 | 364 | |
| 365 | 365 | READ16_HANDLER(mc146818_port16le_r) |
| 366 | 366 | { |
| 367 | return read16le_with_read8_handler(mc146818_port_r, offset, mem_mask); | |
| 367 | return read16le_with_read8_handler(mc146818_port_r, machine, offset, mem_mask); | |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | WRITE16_HANDLER(mc146818_port16le_w) |
| 371 | 371 | { |
| 372 | write16le_with_write8_handler(mc146818_port_w, offset, data, mem_mask); | |
| 372 | write16le_with_write8_handler(mc146818_port_w, machine, offset, data, mem_mask); | |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | READ32_HANDLER(mc146818_port32le_r) |
| 376 | 376 | { |
| 377 | return read32le_with_read8_handler(mc146818_port_r, offset, mem_mask); | |
| 377 | return read32le_with_read8_handler(mc146818_port_r, machine, offset, mem_mask); | |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | WRITE32_HANDLER(mc146818_port32le_w) |
| 381 | 381 | { |
| 382 | write32le_with_write8_handler(mc146818_port_w, offset, data, mem_mask); | |
| 382 | write32le_with_write8_handler(mc146818_port_w, machine, offset, data, mem_mask); | |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | READ64_HANDLER(mc146818_port64be_r) |
| 386 | 386 | { |
| 387 | return read64be_with_read8_handler(mc146818_port_r, offset, mem_mask); | |
| 387 | return read64be_with_read8_handler(mc146818_port_r, machine, offset, mem_mask); | |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | WRITE64_HANDLER(mc146818_port64be_w) |
| 391 | 391 | { |
| 392 | write64be_with_write8_handler(mc146818_port_w, offset, data, mem_mask); | |
| 392 | write64be_with_write8_handler(mc146818_port_w, machine, offset, data, mem_mask); | |
| 393 | 393 | } |
| r1877 | r1878 | |
|---|---|---|
| 157 | 157 | ***************************************************************************/ |
| 158 | 158 | |
| 159 | 159 | /* output channel callback */ |
| 160 | typedef void (*output_callback)(void *param, const char *format, va_list argptr); | |
| 160 | typedef void (*output_callback_func)(void *param, const char *format, va_list argptr); | |
| 161 | 161 | |
| 162 | 162 | |
| 163 | 163 | /* forward type declarations */ |
| r1877 | r1878 | |
| 340 | 340 | /* ----- output management ----- */ |
| 341 | 341 | |
| 342 | 342 | /* set the output handler for a channel, returns the current one */ |
| 343 | void mame_set_output_channel(output_channel channel, output_callback callback, void *param, output_callback *prevcb, void **prevparam); | |
| 343 | void mame_set_output_channel(output_channel channel, output_callback_func callback, void *param, output_callback_func *prevcb, void **prevparam); | |
| 344 | 344 | |
| 345 | 345 | /* built-in default callbacks */ |
| 346 | 346 | void mame_file_output_callback(void *param, const char *format, va_list argptr); |
| r1877 | r1878 | |
|---|---|---|
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | /* macro for a custom callback functions (PORT_CUSTOM) */ |
| 43 | #define CUSTOM_INPUT(name) UINT32 name(void *param) | |
| 43 | #define CUSTOM_INPUT(name) UINT32 name(running_machine *machine, void *param) | |
| 44 | 44 | |
| 45 | /* macro for port changed callback functions (PORT_CHANGED) */ | |
| 46 | #define INPUT_CHANGED(name) void name(running_machine *machine, void *param, UINT32 oldval, UINT32 newval) | |
| 45 | 47 | |
| 48 | ||
| 46 | 49 | /* sequence types for input_port_seq() call */ |
| 47 | 50 | enum _input_seq_type |
| 48 | 51 | { |
| r1877 | r1878 | |
| 355 | 358 | INPUT_TOKEN_INVERT, |
| 356 | 359 | INPUT_TOKEN_UNUSED, |
| 357 | 360 | INPUT_TOKEN_CUSTOM, |
| 361 | INPUT_TOKEN_CHANGED, | |
| 358 | 362 | INPUT_TOKEN_DIPNAME, |
| 359 | 363 | INPUT_TOKEN_DIPSETTING, |
| 360 | 364 | INPUT_TOKEN_DIPLOCATION, |
| r1877 | r1878 | |
| 497 | 501 | |
| 498 | 502 | |
| 499 | 503 | /* a custom input port callback function */ |
| 500 | typedef UINT32 (*input_port_custom_func)(void *param); | |
| 501 | typedef void (*input_port_changed_func)(void *param, UINT32 oldval, UINT32 newval); | |
| 504 | typedef UINT32 (*input_port_custom_func)(running_machine *machine, void *param); | |
| 505 | typedef void (*input_port_changed_func)(running_machine *machine, void *param, UINT32 oldval, UINT32 newval); | |
| 502 | 506 | |
| 503 | 507 | |
| 504 | 508 | /* this type is used to encode input port definitions */ |
| r1877 | r1878 | |
| 508 | 512 | TOKEN_COMMON_FIELDS |
| 509 | 513 | const input_port_token *tokenptr; |
| 510 | 514 | input_port_custom_func customptr; |
| 515 | input_port_changed_func changedptr; | |
| 511 | 516 | }; |
| 512 | 517 | |
| 513 | 518 | |
| r1877 | r1878 | |
| 560 | 565 | const char *name; /* user-friendly name to display */ |
| 561 | 566 | input_seq seq; /* input sequence affecting the input bits */ |
| 562 | 567 | input_port_custom_func custom;/* custom callback routine */ |
| 563 | void * custom_param; /* parameter for callback routine */ | |
| 568 | void * custom_param; /* parameter for custom callback routine */ | |
| 569 | input_port_changed_func changed;/* changed callback routine */ | |
| 570 | void * changed_param; /* parameter for changed callback routine */ | |
| 571 | UINT32 changed_last_value; /* the last value for changed detection purposes */ | |
| 564 | 572 | |
| 565 | 573 | /* valid if type is between __ipt_analog_start and __ipt_analog_end */ |
| 566 | 574 | struct |
| r1877 | r1878 | |
| 783 | 791 | TOKEN_PTR(customptr, _callback), \ |
| 784 | 792 | TOKEN_PTR(voidptr, _param), |
| 785 | 793 | |
| 794 | /* changed callbacks */ | |
| 795 | #define PORT_CHANGED(_callback, _param) \ | |
| 796 | TOKEN_UINT32_PACK1(INPUT_TOKEN_CHANGED, 8), \ | |
| 797 | TOKEN_PTR(changedptr, _callback), \ | |
| 798 | TOKEN_PTR(voidptr, _param), | |
| 799 | ||
| 786 | 800 | /* dip switch definition */ |
| 787 | 801 | #define PORT_DIPNAME(_mask,_default,_name) \ |
| 788 | 802 | TOKEN_UINT32_PACK1(INPUT_TOKEN_DIPNAME, 8), \ |
| r1877 | r1878 | |
| 893 | 907 | ***************************************************************************/ |
| 894 | 908 | |
| 895 | 909 | void input_port_init(running_machine *machine, const input_port_token *ipt); |
| 910 | void input_port_post_init(running_machine *machine); | |
| 896 | 911 | const char *input_port_string_from_token(const input_port_token token); |
| 897 | 912 | |
| 898 | 913 | input_port_entry *input_port_initialize(input_port_init_params *params, UINT32 type, const char *tag, UINT32 mask, UINT32 defval); |
| r1877 | r1878 | |
| 908 | 923 | int port_type_in_use(int type); |
| 909 | 924 | int port_type_to_group(int type, int player); |
| 910 | 925 | int port_tag_to_index(const char *tag); |
| 911 | read8_handler port_tag_to_handler8(const char *tag); | |
| 912 | read16_handler port_tag_to_handler16(const char *tag); | |
| 913 | read32_handler port_tag_to_handler32(const char *tag); | |
| 914 | read64_handler port_tag_to_handler64(const char *tag); | |
| 926 | read8_machine_func port_tag_to_handler8(const char *tag); | |
| 927 | read16_machine_func port_tag_to_handler16(const char *tag); | |
| 928 | read32_machine_func port_tag_to_handler32(const char *tag); | |
| 929 | read64_machine_func port_tag_to_handler64(const char *tag); | |
| 915 | 930 | const char *input_port_name(const input_port_entry *in); |
| 916 | 931 | const input_seq *input_port_seq(input_port_entry *in, input_seq_type seqtype); |
| 917 | 932 | const input_seq *input_port_default_seq(int type, int player, input_seq_type seqtype); |
| 918 | 933 | int input_port_condition(const input_port_entry *in); |
| 919 | void input_port_set_changed_callback(int port, UINT32 mask, input_port_changed_func callback, void *param); | |
| 920 | 934 | |
| 921 | 935 | const char *port_type_to_token(int type, int player); |
| 922 | 936 | int token_to_port_type(const char *string, int *player); |
| r1877 | r1878 | |
| 926 | 940 | int input_ui_pressed_repeat(int code, int speed); |
| 927 | 941 | |
| 928 | 942 | void input_port_update_defaults(void); |
| 929 | void input_port_vblank_start(void); /* called by cpuintrf.c - not for external use */ | |
| 930 | void input_port_vblank_end(void); /* called by cpuintrf.c - not for external use */ | |
| 931 | 943 | |
| 932 | 944 | void input_port_set_digital_value(int port, UINT32 value, UINT32 mask); |
| 933 | 945 |
| r1877 | r1878 | |
|---|---|---|
| 25 | 25 | void render_font_free(render_font *font); |
| 26 | 26 | INT32 render_font_get_pixel_height(render_font *font); |
| 27 | 27 | render_texture *render_font_get_char_texture_and_bounds(render_font *font, float height, float aspect, unicode_char ch, render_bounds *bounds); |
| 28 | void render_font_get_scaled_bitmap_and_bounds(render_font *font, | |
| 28 | void render_font_get_scaled_bitmap_and_bounds(render_font *font, | |
| 29 | 29 | float render_font_get_char_width(render_font *font, float height, float aspect, unicode_char ch); |
| 30 | 30 | float render_font_get_string_width(render_font *font, float height, float aspect, const char *string); |
| 31 | 31 | float render_font_get_utf8string_width(render_font *font, float height, float aspect, const char *utf8string); |
| r1877 | r1878 | |
|---|---|---|
| 161 | 161 | device_reset_func reset; /* quick pointer to reset callback */ |
| 162 | 162 | const void * static_config; /* static device configuration */ |
| 163 | 163 | void * inline_config; /* inline device configuration */ |
| 164 | ||
| 165 | /* these two fields are only valid if the device is live */ | |
| 164 | 166 | void * token; /* token if device is live */ |
| 167 | running_machine * machine; /* machine if device is live */ | |
| 168 | ||
| 165 | 169 | char tag[1]; /* tag for this instance */ |
| 166 | 170 | }; |
| 167 | 171 |
| r1877 | r1878 | |
|---|---|---|
| 22 | 22 | /* utilities */ |
| 23 | 23 | static void resample_argb_bitmap_average(UINT32 *dest, UINT32 drowpixels, UINT32 dwidth, UINT32 dheight, const UINT32 *source, UINT32 srowpixels, UINT32 swidth, UINT32 sheight, const render_color *color, UINT32 dx, UINT32 dy); |
| 24 | 24 | static void resample_argb_bitmap_bilinear(UINT32 *dest, UINT32 drowpixels, UINT32 dwidth, UINT32 dheight, const UINT32 *source, UINT32 srowpixels, UINT32 swidth, UINT32 sheight, const render_color *color, UINT32 dx, UINT32 dy); |
| 25 | static void copy_png_to_bitmap(mame_bitmap *bitmap, const png_info *png, int *hasalpha); | |
| 26 | static void copy_png_alpha_to_bitmap(mame_bitmap *bitmap, const png_info *png, int *hasalpha); | |
| 25 | static void copy_png_to_bitmap(bitmap_t *bitmap, const png_info *png, int *hasalpha); | |
| 26 | static void copy_png_alpha_to_bitmap(bitmap_t *bitmap, const png_info *png, int *hasalpha); | |
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | |
| r1877 | r1878 | |
| 52 | 52 | quality resampling of a texture |
| 53 | 53 | -------------------------------------------------*/ |
| 54 | 54 | |
| 55 | void render_resample_argb_bitmap_hq(void *dest, UINT32 drowpixels, UINT32 dwidth, UINT32 dheight, const | |
| 55 | void render_resample_argb_bitmap_hq(void *dest, UINT32 drowpixels, UINT32 dwidth, UINT32 dheight, const | |
| 56 | 56 | { |
| 57 | 57 | UINT32 swidth, sheight; |
| 58 | 58 | const UINT32 *sbase; |
| r1877 | r1878 | |
| 556 | 556 | |
| 557 | 557 | /*------------------------------------------------- |
| 558 | 558 | render_load_png - load a PNG file into a |
| 559 | | |
| 559 | | |
| 560 | 560 | -------------------------------------------------*/ |
| 561 | 561 | |
| 562 | ||
| 562 | ||
| 563 | 563 | { |
| 564 | | |
| 564 | | |
| 565 | 565 | file_error filerr; |
| 566 | 566 | mame_file *file; |
| 567 | 567 | png_info png; |
| r1877 | r1878 | |
| 636 | 636 | bitmap |
| 637 | 637 | -------------------------------------------------*/ |
| 638 | 638 | |
| 639 | static void copy_png_to_bitmap( | |
| 639 | static void copy_png_to_bitmap( | |
| 640 | 640 | { |
| 641 | 641 | UINT8 accumalpha = 0xff; |
| 642 | 642 | UINT8 *src; |
| r1877 | r1878 | |
| 701 | 701 | to the alpha channel of a bitmap |
| 702 | 702 | -------------------------------------------------*/ |
| 703 | 703 | |
| 704 | static void copy_png_alpha_to_bitmap( | |
| 704 | static void copy_png_alpha_to_bitmap( | |
| 705 | 705 | { |
| 706 | 706 | UINT8 accumalpha = 0xff; |
| 707 | 707 | UINT8 *src; |
| r1877 | r1878 | |
|---|---|---|
| 1881 | 1881 | using a software rasterizer |
| 1882 | 1882 | -------------------------------------------------*/ |
| 1883 | 1883 | |
| 1884 | void FUNC_PREFIX(draw_primitives)(const render_primitive *primlist, void *dstdata, UINT32 width, UINT32 height, UINT32 pitch) | |
| 1884 | static void FUNC_PREFIX(draw_primitives)(const render_primitive *primlist, void *dstdata, UINT32 width, UINT32 height, UINT32 pitch) | |
| 1885 | 1885 | { |
| 1886 | 1886 | const render_primitive *prim; |
| 1887 | 1887 |
| r1877 | r1878 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | /* ----- render utilities ----- */ |
| 27 | 27 | |
| 28 | void render_resample_argb_bitmap_hq(void *dest, UINT32 drowpixels, UINT32 dwidth, UINT32 dheight, const | |
| 28 | void render_resample_argb_bitmap_hq(void *dest, UINT32 drowpixels, UINT32 dwidth, UINT32 dheight, const | |
| 29 | 29 | int render_clip_line(render_bounds *bounds, const render_bounds *clip); |
| 30 | 30 | int render_clip_quad(render_bounds *bounds, const render_bounds *clip, render_quad_texuv *texcoords); |
| 31 | 31 | void render_line_to_quad(const render_bounds *bounds, float width, render_bounds *bounds0, render_bounds *bounds1); |
| 32 | ||
| 32 | ||
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "deprecat.h" | |
| 14 | #include "cheat.h" | |
| 15 | 13 | #include "profiler.h" |
| 16 | #include "debugger.h" | |
| 17 | 14 | |
| 18 | #ifdef ENABLE_DEBUGGER | |
| 19 | #include "debug/debugcpu.h" | |
| 20 | #endif | |
| 21 | 15 | |
| 22 | 16 | |
| 23 | 17 | |
| r1877 | r1878 | |
| 71 | 65 | typedef struct _cpuexec_data cpuexec_data; |
| 72 | 66 | struct _cpuexec_data |
| 73 | 67 | { |
| 74 | UINT8 saveable; /* true if saveable */ | |
| 75 | ||
| 76 | 68 | UINT8 suspend; /* suspend reason mask (0 = not suspended) */ |
| 77 | 69 | UINT8 nextsuspend; /* pending suspend reason mask */ |
| 78 | 70 | UINT8 eatcycles; /* true if we eat cycles while suspended */ |
| 79 | 71 | UINT8 nexteatcycles; /* pending value */ |
| 80 | 72 | INT32 trigger; /* pending trigger to release a trigger suspension */ |
| 81 | 73 | |
| 82 | INT32 iloops; /* number of interrupts remaining this frame */ | |
| 83 | ||
| 84 | 74 | UINT64 totalcycles; /* total CPU cycles executed */ |
| 85 | 75 | attotime localtime; /* local time, relative to the timer system's global time */ |
| 86 | 76 | INT32 clock; /* current active clock */ |
| 87 | 77 | double clockscale; /* current active clock scale factor */ |
| 88 | 78 | |
| 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 */ | |
| 79 | emu_timer * timedint_timer; /* reference to this CPU's periodic interrupt timer */ | |
| 92 | 80 | |
| 93 | emu_timer * timedint_timer; /* reference to this CPU's timer */ | |
| 94 | attotime timedint_period; /* timing period of the timed interrupt */ | |
| 81 | /* these below are hacks to support multiple interrupts per frame */ | |
| 82 | INT32 iloops; /* number of interrupts remaining this frame */ | |
| 83 | emu_timer * partial_frame_timer; /* the timer that triggers partial frame interrupts */ | |
| 84 | attotime partial_frame_period; /* the length of one partial frame for interrupt purposes */ | |
| 95 | 85 | }; |
| 96 | 86 | |
| 97 | 87 | |
| r1877 | r1878 | |
| 103 | 93 | /* general CPU variables */ |
| 104 | 94 | static cpuexec_data cpu[MAX_CPU]; |
| 105 | 95 | |
| 106 | static UINT8 vblank; | |
| 107 | static UINT32 current_frame; | |
| 108 | ||
| 109 | 96 | static int cycles_running; |
| 110 | 97 | static int cycles_stolen; |
| 111 | 98 | |
| 112 | 99 | |
| 113 | 100 | /* timer variables */ |
| 114 | static emu_timer *vblank_timer; | |
| 115 | static INT32 vblank_countdown; | |
| 116 | static INT32 vblank_multiplier; | |
| 117 | static attotime vblank_period; | |
| 118 | ||
| 119 | static emu_timer *update_timer; | |
| 120 | ||
| 121 | emu_timer *refresh_timer; /* temporarily made non-static (for ccpu) */ | |
| 122 | static attotime refresh_period; | |
| 123 | ||
| 124 | 101 | static emu_timer *timeslice_timer; |
| 125 | 102 | static attotime timeslice_period; |
| 126 | 103 | |
| r1877 | r1878 | |
| 128 | 105 | static emu_timer *interleave_boost_timer_end; |
| 129 | 106 | static attotime perfect_interleave; |
| 130 | 107 | |
| 131 | /* watchdog state */ | |
| 132 | static UINT8 watchdog_enabled; | |
| 133 | static INT32 watchdog_counter; | |
| 134 | static emu_timer *watchdog_timer; | |
| 135 | 108 | |
| 136 | 109 | |
| 137 | ||
| 138 | 110 | /*************************************************************************** |
| 139 | 111 | FUNCTION PROTOTYPES |
| 140 | 112 | ***************************************************************************/ |
| r1877 | r1878 | |
| 142 | 114 | static void cpuexec_exit(running_machine *machine); |
| 143 | 115 | static void cpuexec_reset(running_machine *machine); |
| 144 | 116 | static void cpu_inittimers(running_machine *machine); |
| 145 | static void cpu_vblankreset(running_machine *machine); | |
| 146 | static TIMER_CALLBACK( cpu_vblankcallback ); | |
| 147 | static TIMER_CALLBACK( cpu_updatecallback ); | |
| 148 | 117 | static TIMER_CALLBACK( end_interleave_boost ); |
| 118 | static TIMER_CALLBACK( trigger_partial_frame_interrupt ); | |
| 149 | 119 | static void compute_perfect_interleave(running_machine *machine); |
| 150 | 120 | |
| 151 | void cpu_compute_vblank_timing(running_machine *machine); | |
| 152 | 121 | |
| 153 | 122 | |
| 154 | ||
| 155 | 123 | /*************************************************************************** |
| 156 | 124 | CORE CPU EXECUTION |
| 157 | 125 | ***************************************************************************/ |
| r1877 | r1878 | |
| 163 | 131 | |
| 164 | 132 | void cpuexec_init(running_machine *machine) |
| 165 | 133 | { |
| 166 | int numscreens = video_screen_count(machine->config); | |
| 167 | 134 | int cpunum; |
| 168 | 135 | |
| 169 | /* if there has been no VBLANK time specified in the MACHINE_DRIVER, compute it now | |
| 170 | from the visible area */ | |
| 171 | if (numscreens > 0 && machine->screen[0].vblank == 0 && !machine->screen[0].oldstyle_vblank_supplied) | |
| 172 | machine->screen[0].vblank = (machine->screen[0].refresh / machine->screen[0].height) * (machine->screen[0].height - (machine->screen[0].visarea.max_y + 1 - machine->screen[0].visarea.min_y)); | |
| 173 | ||
| 174 | /* allocate vblank and refresh timers, and compute the initial timing */ | |
| 175 | vblank_timer = timer_alloc(cpu_vblankcallback, NULL); | |
| 176 | refresh_timer = timer_alloc(NULL, NULL); | |
| 177 | cpu_compute_vblank_timing(machine); | |
| 178 | ||
| 179 | 136 | /* loop over all our CPUs */ |
| 180 | 137 | for (cpunum = 0; cpunum < MAX_CPU; cpunum++) |
| 181 | 138 | { |
| r1877 | r1878 | |
| 212 | 169 | state_save_register_item("cpu", cpunum, cpu[cpunum].clock); |
| 213 | 170 | state_save_register_item("cpu", cpunum, cpu[cpunum].clockscale); |
| 214 | 171 | |
| 215 | state_save_register_item("cpu", cpunum, cpu[cpunum].vblankint_countdown); | |
| 216 | ||
| 217 | 172 | /* initialize this CPU */ |
| 218 | 173 | state_save_push_tag(cpunum + 1); |
| 219 | 174 | num_regs = state_save_get_reg_count(); |
| r1877 | r1878 | |
| 235 | 190 | |
| 236 | 191 | /* compute the perfect interleave factor */ |
| 237 | 192 | compute_perfect_interleave(machine); |
| 238 | ||
| 239 | /* save some stuff in the default tag */ | |
| 240 | state_save_push_tag(0); | |
| 241 | state_save_register_item("cpu", 0, vblank); | |
| 242 | state_save_register_item("cpu", 0, current_frame); | |
| 243 | state_save_register_item("cpu", 0, watchdog_enabled); | |
| 244 | state_save_register_item("cpu", 0, watchdog_counter); | |
| 245 | state_save_register_item("cpu", 0, vblank_countdown); | |
| 246 | state_save_pop_tag(); | |
| 247 | 193 | } |
| 248 | 194 | |
| 249 | 195 | |
| r1877 | r1878 | |
| 259 | 205 | /* initialize the various timers (suspends all CPUs at startup) */ |
| 260 | 206 | cpu_inittimers(machine); |
| 261 | 207 | |
| 262 | /* set up the watchdog timer; only start off enabled if explicitly configured */ | |
| 263 | watchdog_enabled = (machine->config->watchdog_vblank_count != 0 || attotime_compare(machine->config->watchdog_time, attotime_zero) != 0); | |
| 264 | watchdog_reset(machine); | |
| 265 | watchdog_enabled = TRUE; | |
| 266 | ||
| 267 | 208 | /* first pass over CPUs */ |
| 268 | 209 | for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) |
| 269 | 210 | { |
| r1877 | r1878 | |
| 279 | 220 | /* then reset the CPU directly */ |
| 280 | 221 | cpunum_reset(cpunum); |
| 281 | 222 | } |
| 282 | ||
| 283 | /* reset the globals */ | |
| 284 | cpu_vblankreset(machine); | |
| 285 | vblank = 0; | |
| 286 | current_frame = 0; | |
| 287 | 223 | } |
| 288 | 224 | |
| 289 | 225 | |
| r1877 | r1878 | |
| 802 | 738 | |
| 803 | 739 | |
| 804 | 740 | /*************************************************************************** |
| 805 | WATCHDOG TIMERS | |
| 806 | ***************************************************************************/ | |
| 807 | ||
| 808 | /*------------------------------------------------- | |
| 809 | watchdog_callback - watchdog timer callback | |
| 810 | -------------------------------------------------*/ | |
| 811 | ||
| 812 | static TIMER_CALLBACK( watchdog_callback ) | |
| 813 | { | |
| 814 | logerror("reset caused by the watchdog\n"); | |
| 815 | mame_schedule_soft_reset(machine); | |
| 816 | } | |
| 817 | ||
| 818 | ||
| 819 | /*------------------------------------------------- | |
| 820 | watchdog_reset - reset the watchdog timer | |
| 821 | -------------------------------------------------*/ | |
| 822 | ||
| 823 | void watchdog_reset(running_machine *machine) | |
| 824 | { | |
| 825 | /* if we're not enabled, skip it */ | |
| 826 | if (!watchdog_enabled) | |
| 827 | timer_adjust_oneshot(watchdog_timer, attotime_never, 0); | |
| 828 | ||
| 829 | /* VBLANK-based watchdog? */ | |
| 830 | else if (machine->config->watchdog_vblank_count != 0) | |
| 831 | watchdog_counter = machine->config->watchdog_vblank_count; | |
| 832 | ||
| 833 | /* timer-based watchdog? */ | |
| 834 | else if (attotime_compare(machine->config->watchdog_time, attotime_zero) != 0) | |
| 835 | timer_adjust_oneshot(watchdog_timer, machine->config->watchdog_time, 0); | |
| 836 | ||
| 837 | /* default to an obscene amount of time (3 seconds) */ | |
| 838 | else | |
| 839 | timer_adjust_oneshot(watchdog_timer, ATTOTIME_IN_SEC(3), 0); | |
| 840 | } | |
| 841 | ||
| 842 | ||
| 843 | /*------------------------------------------------- | |
| 844 | watchdog_enable - reset the watchdog timer | |
| 845 | -------------------------------------------------*/ | |
| 846 | ||
| 847 | void watchdog_enable(running_machine *machine, int enable) | |
| 848 | { | |
| 849 | /* when re-enabled, we reset our state */ | |
| 850 | if (watchdog_enabled != enable) | |
| 851 | { | |
| 852 | watchdog_enabled = enable; | |
| 853 | watchdog_reset(machine); | |
| 854 | } | |
| 855 | } | |
| 856 | ||
| 857 | ||
| 858 | ||
| 859 | /*************************************************************************** | |
| 860 | 741 | CHEESY FAKE VIDEO TIMING |
| 861 | 742 | ***************************************************************************/ |
| 862 | 743 | |
| 863 | 744 | /*------------------------------------------------- |
| 864 | cpu_compute_vblank_timing - recompute cheesy | |
| 865 | VBLANK timing after a video change | |
| 866 | -------------------------------------------------*/ | |
| 867 | ||
| 868 | void cpu_compute_vblank_timing(running_machine *machine) | |
| 869 | { | |
| 870 | int numscreens = video_screen_count(machine->config); | |
| 871 | attoseconds_t refresh_attosecs; | |
| 872 | ||
| 873 | refresh_attosecs = (numscreens == 0) ? HZ_TO_ATTOSECONDS(60) : machine->screen[0].refresh; | |
| 874 | refresh_period = attotime_make(0, refresh_attosecs); | |
| 875 | ||
| 876 | /* recompute the vblank period */ | |
| 877 | vblank_period = attotime_make(0, refresh_attosecs / (vblank_multiplier ? vblank_multiplier : 1)); | |
| 878 | if (vblank_timer != NULL && timer_enable(vblank_timer, FALSE)) | |
| 879 | { | |
| 880 | attotime remaining = timer_timeleft(vblank_timer); | |
| 881 | if (remaining.seconds == 0 && remaining.attoseconds == 0) | |
| 882 | remaining = vblank_period; | |
| 883 | timer_adjust_periodic(vblank_timer, remaining, 0, vblank_period); | |
| 884 | } | |
| 885 | ||
| 886 | LOG(("cpu_compute_vblank_timing: refresh=%s vblank=%s\n", attotime_string(refresh_period, 9), attotime_string(vblank_period, 9))); | |
| 887 | } | |
| 888 | ||
| 889 | ||
| 890 | /*------------------------------------------------- | |
| 891 | 745 | cpu_scalebyfcount - scale by time between |
| 892 | 746 | refresh timers |
| 893 | 747 | -------------------------------------------------*/ |
| 894 | 748 | |
| 895 | 749 | int cpu_scalebyfcount(int value) |
| 896 | 750 | { |
| 897 | attotime refresh_elapsed = timer_timeelapsed(refresh_timer); | |
| 898 | int result; | |
| 751 | // attotime refresh_elapsed = timer_timeelapsed(refresh_timer); | |
| 752 | // int result; | |
| 899 | 753 | |
| 900 | 754 | /* shift off some bits to ensure no overflow */ |
| 901 | if (value < 65536) | |
| 902 | result = value * (refresh_elapsed.attoseconds >> 16) / (refresh_period.attoseconds >> 16); | |
| 903 | else | |
| 904 | result = value * (refresh_elapsed.attoseconds >> 32) / (refresh_period.attoseconds >> 32); | |
| 905 | if (value >= 0) | |
| 906 | return (result < value) ? result : value; | |
| 907 | else | |
| 908 | return (result > value) ? result : value; | |
| 755 | // if (value < 65536) | |
| 756 | // result = value * (refresh_elapsed.attoseconds >> 16) / (refresh_period.attoseconds >> 16); | |
| 757 | // else | |
| 758 | // result = value * (refresh_elapsed.attoseconds >> 32) / (refresh_period.attoseconds >> 32); | |
| 759 | // if (value >= 0) | |
| 760 | // return (result < value) ? result : value; | |
| 761 | // else | |
| 762 | // return (result > value) ? result : value; | |
| 763 | return 0; | |
| 909 | 764 | } |
| 910 | 765 | |
| 911 | 766 | |
| r1877 | r1878 | |
| 921 | 776 | } |
| 922 | 777 | |
| 923 | 778 | |
| 924 | /*------------------------------------------------- | |
| 925 | cpu_getvblank - return the cheesy VBLANK | |
| 926 | state (deprecated) | |
| 927 | -------------------------------------------------*/ | |
| 928 | ||
| 929 | int cpu_getvblank(void) | |
| 930 | { | |
| 931 | return vblank; | |
| 932 | } | |
| 933 | ||
| 934 | ||
| 935 | /*------------------------------------------------- | |
| 936 | cpu_getcurrentframe - return the current | |
| 937 | frame count (deprecated) | |
| 938 | -------------------------------------------------*/ | |
| 939 | ||
| 940 | int cpu_getcurrentframe(void) | |
| 941 | { | |
| 942 | return current_frame; | |
| 943 | } | |
| 944 | ||
| 945 | ||
| 946 | ||
| 947 | 779 | /*************************************************************************** |
| 948 | 780 | INTERNAL TIMING |
| 949 | 781 | ***************************************************************************/ |
| 950 | 782 | |
| 951 | 783 | /*------------------------------------------------- |
| 952 | cpu_vblankreset - hook for updating things on | |
| 953 | cheesy fake VBLANK (once per frame) | |
| 784 | on_vblank - calls any external callbacks | |
| 785 | for this screen | |
| 954 | 786 | -------------------------------------------------*/ |
| 955 | 787 | |
| 956 | static void | |
| 788 | static void on | |
| 957 | 789 | { |
| 958 | int cpunum; | |
| 959 | ||
| 960 | /* notify the video system of a VBLANK start */ | |
| 961 | video_vblank_start(machine); | |
| 962 | ||
| 963 | /* read keyboard & update the status of the input ports */ | |
| 964 | input_port_vblank_start(); | |
| 965 | ||
| 966 | /* check the watchdog */ | |
| 967 | if (machine->config->watchdog_vblank_count != 0 && --watchdog_counter == 0) | |
| 968 | watchdog_callback(machine, NULL, 0); | |
| 969 | ||
| 970 | /* reset the cycle counters */ | |
| 971 | for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) | |
| 790 | /* VBLANK starting */ | |
| 791 | if (vblank_state) | |
| 972 | 792 | { |
| 973 | if (!(cpu[cpunum].suspend & SUSPEND_REASON_DISABLE)) | |
| 974 | cpu[cpunum].iloops = machine->config->cpu[cpunum].vblank_interrupts_per_frame - 1; | |
| 975 | else | |
| 976 | cpu[cpunum].iloops = -1; | |
| 977 | } | |
| 978 | } | |
| 793 | int cpunum; | |
| 794 | const char *screen_tag = NULL; | |
| 795 | const device_config *device; | |
| 979 | 796 | |
| 797 | /* get the screen's tag */ | |
| 798 | for (device = video_screen_first(machine->config); device != NULL; device = video_screen_next(device)) | |
| 799 | if (device->token == screen) | |
| 800 | screen_tag = device->tag; | |
| 980 | 801 | |
| 981 | /*------------------------------------------------- | |
| 982 | cpu_firstvblankcallback - timer callback for | |
| 983 | the first fake VBLANK | |
| 984 | -------------------------------------------------*/ | |
| 802 | assert(screen_tag != NULL); | |
| 985 | 803 | |
| 986 | static TIMER_CALLBACK( cpu_firstvblankcallback ) | |
| 987 | { | |
| 988 | /* now that we're synced up, pulse from here on out */ | |
| 989 | timer_adjust_periodic(vblank_timer, vblank_period, param, vblank_period); | |
| 804 | /* find any CPUs that have this screen as their VBLANK interrupt source */ | |
| 805 | for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) | |
| 806 | { | |
| 807 | int cpu_interested; | |
| 808 | const cpu_config *config = machine->config->cpu + cpunum; | |
| 990 | 809 | |
| 991 | /* but we need to call the standard routine as well */ | |
| 992 | cpu_vblankcallback(machine, NULL, param); | |
| 993 | } | |
| 810 | /* start the interrupt counter */ | |
| 811 | if (!(cpu[cpunum].suspend & SUSPEND_REASON_DISABLE)) | |
| 812 | cpu[cpunum].iloops = config->vblank_interrupts_per_frame - 1; | |
| 813 | else | |
| 814 | cpu[cpunum].iloops = -1; | |
| 994 | 815 | |
| 816 | /* the hack style VBLANK decleration uses the first screen always */ | |
| 817 | if (config->vblank_interrupts_per_frame > 1) | |
| 818 | cpu_interested = TRUE; | |
| 995 | 819 | |
| 996 | /*------------------------------------------------- | |
| 997 | cpu_vblankcallback - timer callback for | |
| 998 | subsequent fake VBLANKs | |
| 999 | -------------------------------------------------*/ | |
| 820 | /* for new style decleration, we need to compare the tags */ | |
| 821 | else if (config->vblank_interrupts_per_frame == 1) | |
| 822 | cpu_interested = (strcmp(config->vblank_interrupt_screen, screen_tag) == 0); | |
| 1000 | 823 | |
| 1001 | static TIMER_CALLBACK( cpu_vblankcallback ) | |
| 1002 | { | |
| 1003 | int cpunum; | |
| 824 | /* no VBLANK interrupt, not interested */ | |
| 825 | else | |
| 826 | cpu_interested = FALSE; | |
| 1004 | 827 | |
| 1005 | if (vblank_countdown == 1) | |
| 1006 | vblank = 1; | |
| 1007 | ||
| 1008 | /* loop over CPUs */ | |
| 1009 | for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) | |
| 1010 | { | |
| 1011 | /* if the interrupt multiplier is valid */ | |
| 1012 | if (cpu[cpunum].vblankint_multiplier != -1) | |
| 1013 | { | |
| 1014 | /* decrement; if we hit zero, generate the interrupt and reset the countdown */ | |
| 1015 | if (!--cpu[cpunum].vblankint_countdown) | |
| 828 | /* if interested, call the interrupt handler */ | |
| 829 | if (cpu_interested) | |
| 1016 | 830 | { |
| 1017 | /* a param of -1 means don't call any callbacks */ | |
| 1018 | if (param != -1) | |
| 831 | if (!cpunum_is_suspended(cpunum, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) | |
| 1019 | 832 | { |
| 1020 | /* if the CPU has a VBLANK handler, call it */ | |
| 1021 | if (machine->config->cpu[cpunum].vblank_interrupt && !cpunum_is_suspended(cpunum, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) | |
| 1022 | { | |
| 1023 | cpuintrf_push_context(cpunum); | |
| 1024 | (*machine->config->cpu[cpunum].vblank_interrupt)(machine, cpunum); | |
| 1025 | cpuintrf_pop_context(); | |
| 1026 | } | |
| 1027 | ||
| 1028 | /* update the counters */ | |
| 1029 | cpu[cpunum].iloops--; | |
| 833 | cpuintrf_push_context(cpunum); | |
| 834 | (*machine->config->cpu[cpunum].vblank_interrupt)(machine, cpunum); | |
| 835 | cpuintrf_pop_context(); | |
| 1030 | 836 | } |
| 1031 | 837 | |
| 1032 | /* reset the countdown and timer */ | |
| 1033 | cpu[cpunum].vblankint_countdown = cpu[cpunum].vblankint_multiplier; | |
| 1034 | timer_adjust_oneshot(cpu[cpunum].vblankint_timer, attotime_never, 0); | |
| 838 | /* if we have more than one interrupt per frame, start the timer now to trigger the rest of them */ | |
| 839 | if ((config->vblank_interrupts_per_frame > 1) && | |
| 840 | !(cpu[cpunum].suspend & SUSPEND_REASON_DISABLE)) | |
| 841 | { | |
| 842 | cpu[cpunum].partial_frame_period = attotime_div(video_screen_get_frame_period(0), config->vblank_interrupts_per_frame); | |
| 843 | timer_adjust_oneshot(cpu[cpunum].partial_frame_timer, cpu[cpunum].partial_frame_period, cpunum); | |
| 844 | } | |
| 1035 | 845 | } |
| 1036 | 846 | } |
| 1037 | ||
| 1038 | /* else reset the VBLANK timer if this is going to be a real VBLANK */ | |
| 1039 | else if (vblank_countdown == 1) | |
| 1040 | timer_adjust_oneshot(cpu[cpunum].vblankint_timer, attotime_never, 0); | |
| 1041 | 847 | } |
| 1042 | ||
| 1043 | /* is it a real VBLANK? */ | |
| 1044 | if (!--vblank_countdown) | |
| 1045 | { | |
| 1046 | /* do we update the screen now? */ | |
| 1047 | if (!(machine->config->video_attributes & VIDEO_UPDATE_AFTER_VBLANK)) | |
| 1048 | video_frame_update(machine, FALSE); | |
| 1049 | ||
| 1050 | /* Set the timer to update the screen */ | |
| 1051 | timer_adjust_oneshot(update_timer, attotime_make(0, machine->screen[0].vblank), 0); | |
| 1052 | ||
| 1053 | /* reset the globals */ | |
| 1054 | cpu_vblankreset(machine); | |
| 1055 | ||
| 1056 | /* reset the counter */ | |
| 1057 | vblank_countdown = vblank_multiplier; | |
| 1058 | ||
| 1059 | #ifdef ENABLE_DEBUGGER | |
| 1060 | /* notify the debugger */ | |
| 1061 | debug_vblank_hook(); | |
| 1062 | #endif | |
| 1063 | } | |
| 1064 | 848 | } |
| 1065 | 849 | |
| 1066 | 850 | |
| 1067 | 851 | /*------------------------------------------------- |
| 1068 | cpu_updatecallback - timer callback for | |
| 1069 | the fake end of VBLANK | |
| 852 | trigger_partial_frame_interrupt - called to | |
| 853 | trigger a partial frame interrupt | |
| 1070 | 854 | -------------------------------------------------*/ |
| 1071 | 855 | |
| 1072 | static TIMER_CALLBACK( | |
| 856 | static TIMER_CALLBACK( trigger_ | |
| 1073 | 857 | { |
| 1074 | /* update the screen if we didn't before */ | |
| 1075 | if (machine->config->video_attributes & VIDEO_UPDATE_AFTER_VBLANK) | |
| 1076 | video_frame_update(machine, FALSE); | |
| 1077 | vblank = 0; | |
| 858 | int cpunum = param; | |
| 1078 | 859 | |
| 1079 | /* update IPT_VBLANK input ports */ | |
| 1080 | input_port_vblank_end(); | |
| 860 | cpu[cpunum].iloops--; | |
| 1081 | 861 | |
| 1082 | /* track total frames */ | |
| 1083 | current_frame++; | |
| 862 | /* call the interrupt handler */ | |
| 863 | if (!cpunum_is_suspended(cpunum, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) | |
| 864 | { | |
| 865 | cpuintrf_push_context(cpunum); | |
| 866 | (*machine->config->cpu[cpunum].vblank_interrupt)(machine, cpunum); | |
| 867 | cpuintrf_pop_context(); | |
| 868 | } | |
| 1084 | 869 | |
| 1085 | /* reset the refresh timer */ | |
| 1086 | timer_adjust_oneshot(refresh_timer, attotime_never, 0); | |
| 870 | /* more? */ | |
| 871 | if (cpu[cpunum].iloops > 0) | |
| 872 | timer_adjust_oneshot(cpu[cpunum].partial_frame_timer, cpu[cpunum].partial_frame_period, cpunum); | |
| 1087 | 873 | } |
| 1088 | 874 | |
| 1089 | 875 | |
| r1877 | r1878 | |
| 1168 | 954 | { |
| 1169 | 955 | int numscreens = video_screen_count(machine->config); |
| 1170 | 956 | attoseconds_t refresh_attosecs; |
| 1171 | attotime first_time; | |
| 1172 | int cpunum, max, ipf; | |
| 957 | int cpunum, ipf; | |
| 1173 | 958 | |
| 1174 | /* allocate a timer for the watchdog */ | |
| 1175 | watchdog_timer = timer_alloc(watchdog_callback, NULL); | |
| 1176 | ||
| 1177 | 959 | /* allocate a dummy timer at the minimum frequency to break things up */ |
| 1178 | 960 | ipf = machine->config->cpu_slices_per_frame; |
| 1179 | 961 | if (ipf <= 0) |
| r1877 | r1878 | |
| 1187 | 969 | interleave_boost_timer = timer_alloc(NULL, NULL); |
| 1188 | 970 | interleave_boost_timer_end = timer_alloc(end_interleave_boost, NULL); |
| 1189 | 971 | |
| 1190 | /* | |
| 1191 | * The following code finds all the CPUs that are interrupting in sync with the VBLANK | |
| 1192 | * and sets up the VBLANK timer to run at the minimum number of cycles per frame in | |
| 1193 | * order to service all the synced interrupts | |
| 1194 | */ | |
| 1195 | ||
| 1196 | /* find the CPU with the maximum interrupts per frame */ | |
| 1197 | max = 1; | |
| 972 | /* register the interrupt handler callbacks */ | |
| 1198 | 973 | for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) |
| 1199 | 974 | { |
| 1200 | ipf = machine->config->cpu[cpunum].vblank_interrupts_per_frame; | |
| 1201 | if (ipf > max) | |
| 1202 | max = ipf; | |
| 1203 | } | |
| 975 | const cpu_config *config = machine->config->cpu + cpunum; | |
| 1204 | 976 | |
| 1205 | /* now find the LCD with the rest of the CPUs (brute force - these numbers aren't huge) */ | |
| 1206 | vblank_multiplier = max; | |
| 1207 | while (1) | |
| 1208 | { | |
| 1209 | for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) | |
| 977 | /* VBLANK interrupts */ | |
| 978 | if (config->vblank_interrupts_per_frame > 0) | |
| 1210 | 979 | { |
| 1211 | ipf = machine->config->cpu[cpunum].vblank_interrupts_per_frame; | |
| 1212 | if (ipf > 0 && (vblank_multiplier % ipf) != 0) | |
| 1213 | break; | |
| 1214 | } | |
| 1215 | if (cpunum == cpu_gettotalcpu()) | |
| 1216 | break; | |
| 1217 | vblank_multiplier += max; | |
| 1218 | } | |
| 980 | const char *screen_tag; | |
| 981 | screen_state *screen; | |
| 1219 | 982 | |
| 1220 | /* initialize the countdown timers and intervals */ | |
| 1221 | for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) | |
| 1222 | { | |
| 1223 | ipf = machine->config->cpu[cpunum].vblank_interrupts_per_frame; | |
| 1224 | if (ipf > 0) | |
| 1225 | cpu[cpunum].vblankint_countdown = cpu[cpunum].vblankint_multiplier = vblank_multiplier / ipf; | |
| 1226 | else | |
| 1227 | cpu[cpunum].vblankint_countdown = cpu[cpunum].vblankint_multiplier = -1; | |
| 1228 | } | |
| 983 | /* get the screen that will trigger the VBLANK */ | |
| 1229 | 984 | |
| 1230 | /* allocate a vblank timer at the frame rate * the LCD number of interrupts per frame */ | |
| 1231 | vblank_period = attotime_make(0, refresh_attosecs / vblank_multiplier); | |
| 1232 | vblank_countdown = vblank_multiplier; | |
| 985 | /* new style - use screen tag directly */ | |
| 986 | if (config->vblank_interrupts_per_frame == 1) | |
| 987 | screen_tag = config->vblank_interrupt_screen; | |
| 1233 | 988 | |
| 1234 | /* allocate an update timer that will be used to time the actual screen updates */ | |
| 1235 | update_timer = timer_alloc(cpu_updatecallback, NULL); | |
| 989 | /* old style 'hack' setup - use screen #0 */ | |
| 990 | else | |
| 991 | { | |
| 992 | const device_config *config = device_list_first(machine->config->devicelist, VIDEO_SCREEN); | |
| 993 | screen_tag = config->tag; | |
| 1236 | 994 | |
| 1237 | /* | |
| 1238 | * The following code creates individual timers for each CPU whose interrupts are not | |
| 1239 | * synced to the VBLANK, and computes the typical number of cycles per interrupt | |
| 1240 | */ | |
| 995 | /* allocate timer that will trigger the partial frame updates */ | |
| 996 | cpu[cpunum].partial_frame_timer = timer_alloc(trigger_partial_frame_interrupt, 0); | |
| 997 | } | |
| 1241 | 998 | |
| 1242 | /* start the CPU interrupt timers */ | |
| 1243 | for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) | |
| 1244 | { | |
| 1245 | ipf = machine->config->cpu[cpunum].vblank_interrupts_per_frame; | |
| 999 | screen = devtag_get_token(machine, VIDEO_SCREEN, screen_tag); | |
| 1000 | video_screen_register_vbl_cb(machine, screen, on_vblank); | |
| 1001 | } | |
| 1246 | 1002 | |
| 1247 | /* compute the average number of cycles per interrupt */ | |
| 1248 | if (ipf <= 0) | |
| 1249 | ipf = 1; | |
| 1250 | cpu[cpunum].vblankint_timer = timer_alloc(NULL, NULL); | |
| 1251 | ||
| 1252 | /* see if we need to allocate a CPU timer */ | |
| 1253 | if (machine->config->cpu[cpunum].timed_interrupt_period != 0) | |
| 1003 | /* periodic interrupts */ | |
| 1004 | if (config->timed_interrupt_period != 0) | |
| 1254 | 1005 | { |
| 1255 | | |
| 1006 | attoti | |
| 1256 | 1007 | cpu[cpunum].timedint_timer = timer_alloc(cpu_timedintcallback, NULL); |
| 1257 | timer_adjust_periodic(cpu[cpunum].timedint_timer, | |
| 1008 | timer_adjust_periodic(cpu[cpunum].timedint_timer, | |
| 1258 | 1009 | } |
| 1259 | 1010 | } |
| 1260 | ||
| 1261 | /* note that since we start the first frame on the refresh, we can't pulse starting | |
| 1262 | immediately; instead, we back up one VBLANK period, and inch forward until we hit | |
| 1263 | positive time. That time will be the time of the first VBLANK timer callback */ | |
| 1264 | first_time = attotime_sub_attoseconds(vblank_period, machine->screen[0].vblank); | |
| 1265 | while (attotime_compare(first_time, attotime_zero) < 0) | |
| 1266 | { | |
| 1267 | cpu_vblankcallback(machine, NULL, -1); | |
| 1268 | first_time = attotime_add(first_time, vblank_period); | |
| 1269 | } | |
| 1270 | timer_set(first_time, NULL, 0, cpu_firstvblankcallback); | |
| 1271 | ||
| 1272 | /* reset the refresh timer to get ourself back in sync */ | |
| 1273 | timer_adjust_oneshot(refresh_timer, attotime_never, 0); | |
| 1274 | 1011 | } |
| r1877 | r1878 | |
|---|---|---|
| 77 | 77 | /* stream_sample_t is used to represent a single sample in a sound stream */ |
| 78 | 78 | typedef INT32 stream_sample_t; |
| 79 | 79 | |
| 80 | /* mame_bitmap is just a bitmap_t */ | |
| 81 | typedef bitmap_t mame_bitmap; | |
| 82 | 80 | |
| 83 | 81 | |
| 84 | ||
| 85 | 82 | /*************************************************************************** |
| 86 | 83 | * Union of UINT8, UINT16 and UINT32 in native endianess of the target |
| 87 | 84 | * This is used to access bytes and words in a machine independent manner. |
| r1877 | r1878 | |
| 183 | 180 | #define DEGREE_TO_RADIAN(x) ((M_PI / 180.0) * (x)) |
| 184 | 181 | |
| 185 | 182 | |
| 186 | /* U64 and S64 are used to wrap long integer constants. */ | |
| 187 | #ifdef __GNUC__ | |
| 188 | #define U64(val) val##ULL | |
| 189 | #define S64(val) val##LL | |
| 190 | #else | |
| 191 | #define U64(val) val | |
| 192 | #define S64(val) val | |
| 193 | #endif | |
| 194 | 183 | |
| 195 | ||
| 196 | 184 | /* Useful macros to deal with bit shuffling encryptions */ |
| 197 | 185 | #define BIT(x,n) (((x)>>(n))&1) |
| 198 | 186 |
| r1877 | r1878 | |
|---|---|---|
| 131 | 131 | render_bounds bounds; /* bounds of the element */ |
| 132 | 132 | render_color color; /* color of the element */ |
| 133 | 133 | const char * string; /* string for text components */ |
| 134 | | |
| 134 | | |
| 135 | 135 | const char * dirname; /* directory name of image file (for lazy loading) */ |
| 136 | 136 | const char * imagefile; /* name of the image file (for lazy loading) */ |
| 137 | 137 | const char * alphafile; /* name of the alpha file (for lazy loading) */ |
| r1877 | r1878 | |
| 145 | 145 | ***************************************************************************/ |
| 146 | 146 | |
| 147 | 147 | /* layout elements */ |
| 148 | static void layout_element_scale(mame_bitmap *dest, const mame_bitmap *source, const rectangle *sbounds, void *param); | |
| 149 | static void layout_element_draw_rect(mame_bitmap *dest, const rectangle *bounds, const render_color *color); | |
| 150 | static void layout_element_draw_disk(mame_bitmap *dest, const rectangle *bounds, const render_color *color); | |
| 151 | static void layout_element_draw_text(mame_bitmap *dest, const rectangle *bounds, const render_color *color, const char *string); | |
| 152 | static void layout_element_draw_led7seg(mame_bitmap *dest, const rectangle *bounds, const render_color *color, int state); | |
| 153 | static void layout_element_draw_led14seg(mame_bitmap *dest, const rectangle *bounds, const render_color *color, int state); | |
| 154 | static void layout_element_draw_led16seg(mame_bitmap *dest, const rectangle *bounds, const render_color *color, int state); | |
| 155 | static void layout_element_draw_led14segsc(mame_bitmap *dest, const rectangle *bounds, const render_color *color, int state); | |
| 156 | static void layout_element_draw_led16segsc(mame_bitmap *dest, const rectangle *bounds, const render_color *color, int state); | |
| 148 | static void layout_element_scale(bitmap_t *dest, const bitmap_t *source, const rectangle *sbounds, void *param); | |
| 149 | static void layout_element_draw_rect(bitmap_t *dest, const rectangle *bounds, const render_color *color); | |
| 150 | static void layout_element_draw_disk(bitmap_t *dest, const rectangle *bounds, const render_color *color); | |
| 151 | static void layout_element_draw_text(bitmap_t *dest, const rectangle *bounds, const render_color *color, const char *string); | |
| 152 | static void layout_element_draw_led7seg(bitmap_t *dest, const rectangle *bounds, const render_color *color, int state); | |
| 153 | static void layout_element_draw_led14seg(bitmap_t *dest, const rectangle *bounds, const render_color *color, int state); | |
| 154 | static void layout_element_draw_led16seg(bitmap_t *dest, const rectangle *bounds, const render_color *color, int state); | |
| 155 | static void layout_element_draw_led14segsc(bitmap_t *dest, const rectangle *bounds, const render_color *color, int state); | |
| 156 | static void layout_element_draw_led16segsc(bitmap_t *dest, const rectangle *bounds, const render_color *color, int state); | |
| 157 | 157 | |
| 158 | 158 | /* layout file parsing */ |
| 159 | 159 | static layout_element *load_layout_element(xml_data_node *elemnode, const char *dirname); |
| 160 | 160 | static element_component *load_element_component(xml_data_node *compnode, const char *dirname); |
| 161 | 161 | static layout_view *load_layout_view(xml_data_node *viewnode, layout_element *elemlist); |
| 162 | 162 | static view_item *load_view_item(xml_data_node *itemnode, layout_element *elemlist); |
| 163 | static | |
| 163 | static | |
| 164 | 164 | static int load_bounds(xml_data_node *boundsnode, render_bounds *bounds); |
| 165 | 165 | static int load_color(xml_data_node *colornode, render_color *color); |
| 166 | 166 | static int load_orientation(xml_data_node *orientnode, int *orientation); |
| r1877 | r1878 | |
| 228 | 228 | any non-screen elements |
| 229 | 229 | -------------------------------------------------*/ |
| 230 | 230 | |
| 231 | #ifdef UNUSED_FUNCTION | |
| 231 | 232 | INLINE int view_has_art(layout_view *view) |
| 232 | 233 | { |
| 233 | 234 | return (view->itemlist[ITEM_LAYER_BACKDROP] != 0 || |
| 234 | 235 | view->itemlist[ITEM_LAYER_OVERLAY] != 0 || |
| 235 | 236 | view->itemlist[ITEM_LAYER_BEZEL] != 0); |
| 236 | 237 | } |
| 238 | #endif | |
| 237 | 239 | |
| 238 | 240 | |
| 239 | ||
| 240 | 241 | /*************************************************************************** |
| 241 | 242 | LAYOUT VIEWS |
| 242 | 243 | ***************************************************************************/ |
| r1877 | r1878 | |
| 360 | 361 | appropriate resolution |
| 361 | 362 | -------------------------------------------------*/ |
| 362 | 363 | |
| 363 | static void layout_element_scale( | |
| 364 | static void layout_element_scale( | |
| 364 | 365 | { |
| 365 | 366 | element_texture *elemtex = param; |
| 366 | 367 | element_component *component; |
| r1877 | r1878 | |
| 432 | 433 | in the specified color |
| 433 | 434 | -------------------------------------------------*/ |
| 434 | 435 | |
| 435 | static void layout_element_draw_rect( | |
| 436 | static void layout_element_draw_rect( | |
| 436 | 437 | { |
| 437 | 438 | UINT32 r, g, b, inva; |
| 438 | 439 | UINT32 x, y; |
| r1877 | r1878 | |
| 471 | 472 | in the specified color |
| 472 | 473 | -------------------------------------------------*/ |
| 473 | 474 | |
| 474 | static void layout_element_draw_disk( | |
| 475 | static void layout_element_draw_disk( | |
| 475 | 476 | { |
| 476 | 477 | float xcenter, ycenter; |
| 477 | 478 | float xradius, yradius, ooyradius2; |
| r1877 | r1878 | |
| 530 | 531 | specified color |
| 531 | 532 | -------------------------------------------------*/ |
| 532 | 533 | |
| 533 | static void layout_element_draw_text( | |
| 534 | static void layout_element_draw_text( | |
| 534 | 535 | { |
| 535 | 536 | render_font *font = render_font_alloc(NULL); |
| 536 | | |
| 537 | | |
| 537 | 538 | UINT32 r, g, b, a; |
| 538 | 539 | float aspect = 1.0f; |
| 539 | 540 | INT32 curx, width; |
| r1877 | r1878 | |
| 613 | 614 | and start points |
| 614 | 615 | -------------------------------------------------*/ |
| 615 | 616 | |
| 616 | static void draw_segment_horizontal_caps( | |
| 617 | static void draw_segment_horizontal_caps( | |
| 617 | 618 | { |
| 618 | 619 | int x, y; |
| 619 | 620 | |
| r1877 | r1878 | |
| 636 | 637 | LED segment |
| 637 | 638 | -------------------------------------------------*/ |
| 638 | 639 | |
| 639 | static void draw_segment_horizontal( | |
| 640 | static void draw_segment_horizontal( | |
| 640 | 641 | { |
| 641 | 642 | draw_segment_horizontal_caps(dest, minx, maxx, midy, width, LINE_CAP_START | LINE_CAP_END, color); |
| 642 | 643 | } |
| r1877 | r1878 | |
| 648 | 649 | and start points |
| 649 | 650 | -------------------------------------------------*/ |
| 650 | 651 | |
| 651 | static void draw_segment_vertical_caps( | |
| 652 | static void draw_segment_vertical_caps( | |
| 652 | 653 | { |
| 653 | 654 | int x, y; |
| 654 | 655 | |
| r1877 | r1878 | |
| 671 | 672 | LED segment |
| 672 | 673 | -------------------------------------------------*/ |
| 673 | 674 | |
| 674 | static void draw_segment_vertical( | |
| 675 | static void draw_segment_vertical( | |
| 675 | 676 | { |
| 676 | 677 | draw_segment_vertical_caps(dest, miny, maxy, midx, width, LINE_CAP_START | LINE_CAP_END, color); |
| 677 | 678 | } |
| r1877 | r1878 | |
| 682 | 683 | LED segment that looks like this: / |
| 683 | 684 | -------------------------------------------------*/ |
| 684 | 685 | |
| 685 | static void draw_segment_diagonal_1( | |
| 686 | static void draw_segment_diagonal_1( | |
| 686 | 687 | { |
| 687 | 688 | int x, y; |
| 688 | 689 | float ratio; |
| r1877 | r1878 | |
| 712 | 713 | LED segment that looks like this: \ |
| 713 | 714 | -------------------------------------------------*/ |
| 714 | 715 | |
| 715 | static void draw_segment_diagonal_2( | |
| 716 | static void draw_segment_diagonal_2( | |
| 716 | 717 | { |
| 717 | 718 | int x, y; |
| 718 | 719 | float ratio; |
| r1877 | r1878 | |
| 741 | 742 | draw_segment_decimal - draw a decimal point |
| 742 | 743 | -------------------------------------------------*/ |
| 743 | 744 | |
| 744 | static void draw_segment_decimal( | |
| 745 | static void draw_segment_decimal( | |
| 745 | 746 | { |
| 746 | 747 | float ooradius2; |
| 747 | 748 | UINT32 x, y; |
| r1877 | r1878 | |
| 772 | 773 | draw_segment_comma - draw a comma tail |
| 773 | 774 | -------------------------------------------------*/ |
| 774 | 775 | #if 0 |
| 775 | static void draw_segment_comma( | |
| 776 | static void draw_segment_comma( | |
| 776 | 777 | { |
| 777 | 778 | int x, y; |
| 778 | 779 | float ratio; |
| r1877 | r1878 | |
| 797 | 798 | |
| 798 | 799 | |
| 799 | 800 | /*------------------------------------------------- |
| 800 | apply_skew - apply skew to a | |
| 801 | apply_skew - apply skew to a | |
| 801 | 802 | -------------------------------------------------*/ |
| 802 | 803 | |
| 803 | static void apply_skew( | |
| 804 | static void apply_skew( | |
| 804 | 805 | { |
| 805 | 806 | int x, y; |
| 806 | 807 | |
| r1877 | r1878 | |
| 821 | 822 | 7-segment LCD |
| 822 | 823 | -------------------------------------------------*/ |
| 823 | 824 | |
| 824 | static void layout_element_draw_led7seg( | |
| 825 | static void layout_element_draw_led7seg( | |
| 825 | 826 | { |
| 826 | 827 | const rgb_t onpen = MAKE_ARGB(0xff,0xff,0xff,0xff); |
| 827 | 828 | const rgb_t offpen = MAKE_ARGB(0xff,0x20,0x20,0x20); |
| 828 | 829 | int bmwidth, bmheight, segwidth, skewwidth; |
| 829 | | |
| 830 | | |
| 830 | 831 | |
| 831 | 832 | /* sizes for computation */ |
| 832 | 833 | bmwidth = 250; |
| r1877 | r1878 | |
| 877 | 878 | 14-segment LCD |
| 878 | 879 | -------------------------------------------------*/ |
| 879 | 880 | |
| 880 | static void layout_element_draw_led14seg( | |
| 881 | static void layout_element_draw_led14seg( | |
| 881 | 882 | { |
| 882 | 883 | const rgb_t onpen = MAKE_ARGB(0xff, 0xff, 0xff, 0xff); |
| 883 | 884 | const rgb_t offpen = MAKE_ARGB(0xff, 0x20, 0x20, 0x20); |
| 884 | 885 | int bmwidth, bmheight, segwidth, skewwidth; |
| 885 | | |
| 886 | | |
| 886 | 887 | |
| 887 | 888 | /* sizes for computation */ |
| 888 | 889 | bmwidth = 250; |
| r1877 | r1878 | |
| 983 | 984 | 14-segment LCD with semicolon (2 extra segments) |
| 984 | 985 | -------------------------------------------------*/ |
| 985 | 986 | |
| 986 | static void layout_element_draw_led14segsc( | |
| 987 | static void layout_element_draw_led14segsc( | |
| 987 | 988 | { |
| 988 | 989 | const rgb_t onpen = MAKE_ARGB(0xff, 0xff, 0xff, 0xff); |
| 989 | 990 | const rgb_t offpen = MAKE_ARGB(0xff, 0x20, 0x20, 0x20); |
| 990 | 991 | int bmwidth, bmheight, segwidth, skewwidth; |
| 991 | | |
| 992 | | |
| 992 | 993 | |
| 993 | 994 | /* sizes for computation */ |
| 994 | 995 | bmwidth = 250; |
| r1877 | r1878 | |
| 1098 | 1099 | 16-segment LCD |
| 1099 | 1100 | -------------------------------------------------*/ |
| 1100 | 1101 | |
| 1101 | static void layout_element_draw_led16seg( | |
| 1102 | static void layout_element_draw_led16seg( | |
| 1102 | 1103 | { |
| 1103 | 1104 | const rgb_t onpen = MAKE_ARGB(0xff, 0xff, 0xff, 0xff); |
| 1104 | 1105 | const rgb_t offpen = MAKE_ARGB(0xff, 0x20, 0x20, 0x20); |
| 1105 | 1106 | int bmwidth, bmheight, segwidth, skewwidth; |
| 1106 | | |
| 1107 | | |
| 1107 | 1108 | |
| 1108 | 1109 | /* sizes for computation */ |
| 1109 | 1110 | bmwidth = 250; |
| r1877 | r1878 | |
| 1214 | 1215 | 16-segment LCD with semicolon (2 extra segments) |
| 1215 | 1216 | -------------------------------------------------*/ |
| 1216 | 1217 | |
| 1217 | static void layout_element_draw_led16segsc( | |
| 1218 | static void layout_element_draw_led16segsc( | |
| 1218 | 1219 | { |
| 1219 | 1220 | const rgb_t onpen = MAKE_ARGB(0xff, 0xff, 0xff, 0xff); |
| 1220 | 1221 | const rgb_t offpen = MAKE_ARGB(0xff, 0x20, 0x20, 0x20); |
| 1221 | 1222 | int bmwidth, bmheight, segwidth, skewwidth; |
| 1222 | | |
| 1223 | | |
| 1223 | 1224 | |
| 1224 | 1225 | /* sizes for computation */ |
| 1225 | 1226 | bmwidth = 250; |
| r1877 | r1878 | |
| 1878 | 1879 | with artwork for a component |
| 1879 | 1880 | -------------------------------------------------*/ |
| 1880 | 1881 | |
| 1881 | static | |
| 1882 | static | |
| 1882 | 1883 | { |
| 1883 | | |
| 1884 | | |
| 1884 | 1885 | |
| 1885 | 1886 | /* load the basic bitmap */ |
| 1886 | 1887 | bitmap = render_load_png(dirname, file, NULL, hasalpha); |
| r1877 | r1878 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | #include "cpuint.h" |
| 18 | 18 | #include "cpuexec.h" |
| 19 | #include "watchdog.h" | |
| 19 | 20 | #include "mame.h" |
| 20 | 21 | #include "state.h" |
| 21 | 22 | |
| r1877 | r1878 | |
| 197 | 198 | |
| 198 | 199 | |
| 199 | 200 | /* define the various callback functions */ |
| 200 | typedef void (*cpufunc_get_info)(UINT32 state, cpuinfo *info); | |
| 201 | typedef void (*cpufunc_set_info)(UINT32 state, cpuinfo *info); | |
| 202 | typedef void (*cpufunc_get_context)(void *buffer); | |
| 203 | typedef void (*cpufunc_set_context)(void *buffer); | |
| 204 | typedef void (*cpufunc_init)(int index, int clock, const void *config, int (*irqcallback)(int)); | |
| 205 | typedef void (*cpufunc_reset)(void); | |
| 206 | typedef void (*cpufunc_exit)(void); | |
| 207 | typedef int (*cpufunc_execute)(int cycles); | |
| 208 | typedef void (*cpufunc_burn)(int cycles); | |
| 209 | typedef offs_t (*cpufunc_disassemble)(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); | |
| 210 | typedef int (*cpufunc_translate)(int space, offs_t *address); | |
| 211 | typedef int (*cpufunc_read)(int space, UINT32 offset, int size, UINT64 *value); | |
| 212 | typedef int (*cpufunc_write)(int space, UINT32 offset, int size, UINT64 value); | |
| 213 | typedef int (*cpufunc_readop)(UINT32 offset, int size, UINT64 *value); | |
| 214 | typedef void (*cpufunc_setup_commands)(void); | |
| 201 | typedef void (*cpu_get_info_func)(UINT32 state, cpuinfo *info); | |
| 202 | typedef void (*cpu_set_info_func)(UINT32 state, cpuinfo *info); | |
| 203 | typedef void (*cpu_get_context_func)(void *buffer); | |
| 204 | typedef void (*cpu_set_context_func)(void *buffer); | |
| 205 | typedef void (*cpu_init_func)(int index, int clock, const void *config, int (*irqcallback)(int)); | |
| 206 | typedef void (*cpu_reset_func)(void); | |
| 207 | typedef void (*cpu_exit_func)(void); | |
| 208 | typedef int (*cpu_execute_func)(int cycles); | |
| 209 | typedef void (*cpu_burn_func)(int cycles); | |
| 210 | typedef offs_t (*cpu_disassemble_func)(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); | |
| 211 | typedef int (*cpu_translate_func)(int space, offs_t *address); | |
| 212 | typedef int (*cpu_read_func)(int space, UINT32 offset, int size, UINT64 *value); | |
| 213 | typedef int (*cpu_write_func)(int space, UINT32 offset, int size, UINT64 value); | |
| 214 | typedef int (*cpu_readop_func)(UINT32 offset, int size, UINT64 *value); | |
| 215 | typedef void (*cpu_setup_commands_func)(void); | |
| 215 | 216 | |
| 216 | 217 | |
| 217 | 218 | /* cpuinfo union used to pass data to/from the get_info/set_info functions */ |
| r1877 | r1878 | |
| 222 | 223 | genf * f; /* generic function pointers */ |
| 223 | 224 | char * s; /* generic strings */ |
| 224 | 225 | |
| 225 | cpufunc_set_info setinfo; /* CPUINFO_PTR_SET_INFO */ | |
| 226 | cpufunc_get_context getcontext; /* CPUINFO_PTR_GET_CONTEXT */ | |
| 227 | cpufunc_set_context setcontext; /* CPUINFO_PTR_SET_CONTEXT */ | |
| 228 | cpufunc_init init; /* CPUINFO_PTR_INIT */ | |
| 229 | cpufunc_reset reset; /* CPUINFO_PTR_RESET */ | |
| 230 | cpufunc_exit exit; /* CPUINFO_PTR_EXIT */ | |
| 231 | cpufunc_execute execute; /* CPUINFO_PTR_EXECUTE */ | |
| 232 | cpufunc_burn burn; /* CPUINFO_PTR_BURN */ | |
| 233 | cpufunc_disassemble disassemble; /* CPUINFO_PTR_DISASSEMBLE */ | |
| 234 | cpufunc_translate translate; /* CPUINFO_PTR_TRANSLATE */ | |
| 235 | cpufunc_read read; /* CPUINFO_PTR_READ */ | |
| 236 | cpufunc_write write; /* CPUINFO_PTR_WRITE */ | |
| 237 | cpufunc_readop readop; /* CPUINFO_PTR_READOP */ | |
| 238 | cpufunc_setup_commands setup_commands; /* CPUINFO_PTR_DEBUG_SETUP_COMMANDS */ | |
| 226 | cpu_set_info_func setinfo; /* CPUINFO_PTR_SET_INFO */ | |
| 227 | cpu_get_context_func getcontext; /* CPUINFO_PTR_GET_CONTEXT */ | |
| 228 | cpu_set_context_func setcontext; /* CPUINFO_PTR_SET_CONTEXT */ | |
| 229 | cpu_init_func init; /* CPUINFO_PTR_INIT */ | |
| 230 | cpu_reset_func reset; /* CPUINFO_PTR_RESET */ | |
| 231 | cpu_exit_func exit; /* CPUINFO_PTR_EXIT */ | |
| 232 | cpu_execute_func execute; /* CPUINFO_PTR_EXECUTE */ | |
| 233 | cpu_burn_func burn; /* CPUINFO_PTR_BURN */ | |
| 234 | cpu_disassemble_func disassemble; /* CPUINFO_PTR_DISASSEMBLE */ | |
| 235 | cpu_translate_func translate; /* CPUINFO_PTR_TRANSLATE */ | |
| 236 | cpu_read_func read; /* CPUINFO_PTR_READ */ | |
| 237 | cpu_write_func write; /* CPUINFO_PTR_WRITE */ | |
| 238 | cpu_readop_func readop; /* CPUINFO_PTR_READOP */ | |
| 239 | cpu_setup_commands_func setup_commands; /* CPUINFO_PTR_DEBUG_SETUP_COMMANDS */ | |
| 239 | 240 | int * icount; /* CPUINFO_PTR_INSTRUCTION_COUNTER */ |
| 240 | 241 | construct_map_t internal_map; /* CPUINFO_PTR_INTERNAL_MEMORY_MAP */ |
| 241 | 242 | }; |
| r1877 | r1878 | |
| 245 | 246 | struct _cpu_interface |
| 246 | 247 | { |
| 247 | 248 | /* table of core functions */ |
| 248 | cpufunc_get_info get_info; | |
| 249 | cpufunc_set_info set_info; | |
| 250 | cpufunc_get_context get_context; | |
| 251 | cpufunc_set_context set_context; | |
| 252 | cpufunc_init init; | |
| 253 | cpufunc_reset reset; | |
| 254 | cpufunc_exit exit; | |
| 255 | cpufunc_execute execute; | |
| 256 | cpufunc_burn burn; | |
| 257 | cpufunc_disassemble disassemble; | |
| 258 | cpufunc_translate translate; | |
| 249 | cpu_get_info_func get_info; | |
| 250 | cpu_set_info_func set_info; | |
| 251 | cpu_get_context_func get_context; | |
| 252 | cpu_set_context_func set_context; | |
| 253 | cpu_init_func init; | |
| 254 | cpu_reset_func reset; | |
| 255 | cpu_exit_func exit; | |
| 256 | cpu_execute_func execute; | |
| 257 | cpu_burn_func burn; | |
| 258 | cpu_disassemble_func disassemble; | |
| 259 | cpu_translate_func translate; | |
| 259 | 260 | |
| 260 | 261 | /* other info */ |
| 261 | 262 | size_t context_size; |
| r1877 | r1878 | |
|---|---|---|
| 31 | 31 | struct _output_notify |
| 32 | 32 | { |
| 33 | 33 | output_notify * next; /* link to next item */ |
| 34 | output_notifier notifier; /* callback to call */ | |
| 34 | output_notifier_func notifier; /* callback to call */ | |
| 35 | 35 | void * param; /* parameter to pass the callback */ |
| 36 | 36 | }; |
| 37 | 37 | |
| r1877 | r1878 | |
| 321 | 321 | if NULL is specified |
| 322 | 322 | -------------------------------------------------*/ |
| 323 | 323 | |
| 324 | void output_set_notifier(const char *outname, output_notifier callback, void *param) | |
| 324 | void output_set_notifier(const char *outname, output_notifier_func callback, void *param) | |
| 325 | 325 | { |
| 326 | 326 | output_notify **headptr; |
| 327 | 327 | |
| r1877 | r1878 | |
| 357 | 357 | notifier for all outputs |
| 358 | 358 | -------------------------------------------------*/ |
| 359 | 359 | |
| 360 | void output_notify_all(output_notifier callback, void *param) | |
| 360 | void output_notify_all(output_notifier_func callback, void *param) | |
| 361 | 361 | { |
| 362 | 362 | output_item *item; |
| 363 | 363 | int hash; |
| r1877 | r1878 | |
|---|---|---|
| 261 | 261 | construct_map_t construct_map[ADDRESS_SPACES][2]; /* 2 memory maps per address space */ |
| 262 | 262 | void (*vblank_interrupt)(running_machine *machine, int cpunum); /* for interrupts tied to VBLANK */ |
| 263 | 263 | int vblank_interrupts_per_frame;/* usually 1 */ |
| 264 | const char * vblank_interrupt_screen; /* the screen that causes the VBLANK interrupt */ | |
| 264 | 265 | void (*timed_interrupt)(running_machine *machine, int cpunum); /* for interrupts not tied to VBLANK */ |
| 265 | 266 | attoseconds_t timed_interrupt_period; /* period for periodic interrupts */ |
| 266 | 267 | const void * reset_param; /* parameter for cpu_reset */ |
| r1877 | r1878 | |
| 370 | 371 | |
| 371 | 372 | |
| 372 | 373 | |
| 373 | /* ----- watchdog timers ----- */ | |
| 374 | ||
| 375 | /* reset the watchdog */ | |
| 376 | void watchdog_reset(running_machine *machine); | |
| 377 | ||
| 378 | /* enable/disable the watchdog */ | |
| 379 | void watchdog_enable(running_machine *machine, int enable); | |
| 380 | ||
| 381 | ||
| 382 | ||
| 383 | 374 | #endif /* __CPUEXEC_H__ */ |
| r1877 | r1878 | |
|---|---|---|
| 21 | 21 | TYPE DEFINITIONS |
| 22 | 22 | ***************************************************************************/ |
| 23 | 23 | |
| 24 | typedef void (*output_notifier)(const char *outname, INT32 value, void *param); | |
| 24 | typedef void (*output_notifier_func)(const char *outname, INT32 value, void *param); | |
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | |
| r1877 | r1878 | |
| 45 | 45 | INT32 output_get_indexed_value(const char *outname, int index); |
| 46 | 46 | |
| 47 | 47 | /* set a notifier on a particular output, or globally if NULL */ |
| 48 | void output_set_notifier(const char *outname, output_notifier callback, void *param); | |
| 48 | void output_set_notifier(const char *outname, output_notifier_func callback, void *param); | |
| 49 | 49 | |
| 50 | 50 | /* set a notifier on a particular output, or globally if NULL */ |
| 51 | void output_notify_all(output_notifier callback, void *param); | |
| 51 | void output_notify_all(output_notifier_func callback, void *param); | |
| 52 | 52 | |
| 53 | 53 | /* map a name to a unique ID */ |
| 54 | 54 | UINT32 output_name_to_id(const char *outname); |
| r1877 | r1878 | |
|---|---|---|
| 1300 | 1300 | |
| 1301 | 1301 | if( offset == 0 ) |
| 1302 | 1302 | { |
| 1303 | sp0256_ALD_w( 0, data & 0xff ); | |
| 1303 | sp0256_ALD_w( machine, 0, data & 0xff ); | |
| 1304 | 1304 | return; |
| 1305 | 1305 | } |
| 1306 | 1306 |
| r1877 | r1878 | |
|---|---|---|
| 110 | 110 | #define DSS_ADJUSTMENT__PMIN (*(node->input[5])) |
| 111 | 111 | #define DSS_ADJUSTMENT__PMAX (*(node->input[6])) |
| 112 | 112 | |
| 113 | void dss_adjustment_step(node_description *node) | |
| 113 | static void dss_adjustment_step(node_description *node) | |
| 114 | 114 | { |
| 115 | 115 | if (DSS_ADJUSTMENT__ENABLE) |
| 116 | 116 | { |
| r1877 | r1878 | |
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | void dss_adjustment_reset(node_description *node) | |
| 139 | static void dss_adjustment_reset(node_description *node) | |
| 140 | 140 | { |
| 141 | 141 | struct dss_adjustment_context *context = node->context; |
| 142 | 142 | double min, max; |
| r1877 | r1878 | |
| 184 | 184 | ************************************************************************/ |
| 185 | 185 | #define DSS_CONSTANT__INIT (*(node->input[0])) |
| 186 | 186 | |
| 187 | void dss_constant_step(node_description *node) | |
| 187 | static void dss_constant_step(node_description *node) | |
| 188 | 188 | { |
| 189 | 189 | node->output= DSS_CONSTANT__INIT; |
| 190 | 190 | } |
| r1877 | r1878 | |
| 200 | 200 | * input[3] - Current data value |
| 201 | 201 | * |
| 202 | 202 | ************************************************************************/ |
| 203 | void dss_input_step(node_description *node) | |
| 203 | static void dss_input_step(node_description *node) | |
| 204 | 204 | { |
| 205 | 205 | UINT8 *node_data = node->context; |
| 206 | 206 | |
| 207 | 207 | node->output = *node_data * DSS_INPUT__GAIN + DSS_INPUT__OFFSET; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | void dss_input_reset(node_description *node) | |
| 210 | static void dss_input_reset(node_description *node) | |
| 211 | 211 | { |
| 212 | 212 | UINT8 *node_data = node->context; |
| 213 | 213 | |
| r1877 | r1878 | |
| 227 | 227 | dss_input_step(node); |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | void dss_input_pulse_step(node_description *node) | |
| 230 | static void dss_input_pulse_step(node_description *node) | |
| 231 | 231 | { |
| 232 | 232 | UINT8 *node_data = node->context; |
| 233 | 233 | |
| r1877 | r1878 | |
| 252 | 252 | #define DSS_INPUT_STREAM__GAIN (*(node->input[1])) |
| 253 | 253 | #define DSS_INPUT_STREAM__OFFSET (*(node->input[2])) |
| 254 | 254 | |
| 255 | void dss_input_stream_step(node_description *node) | |
| 255 | static void dss_input_stream_step(node_description *node) | |
| 256 | 256 | { |
| 257 | 257 | // the context pointer is set to point to the current input stream data in discrete_stream_update |
| 258 | 258 | stream_sample_t **ptr = node->context; |
| r1877 | r1878 | |
| 261 | 261 | node->output = data ? (*data) * DSS_INPUT_STREAM__GAIN + DSS_INPUT_STREAM__OFFSET : 0; |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | void dss_input_stream_reset(node_description *node) | |
| 264 | static void dss_input_stream_reset(node_description *node) | |
| 265 | 265 | { |
| 266 | 266 | int istream = DSS_INPUT_STREAM__STREAM; |
| 267 | 267 | /* we will use the node's context pointer to point to the input stream data */ |
| r1877 | r1878 | |
|---|---|---|
| 17 | 17 | * |
| 18 | 18 | ******************************************************************************/ |
| 19 | 19 | #include "sndintrf.h" |
| 20 | #include "deprecat.h" | |
| 20 | 21 | #include "streams.h" |
| 21 | 22 | #include "cpuintrf.h" |
| 22 | 23 | #include "3812intf.h" |
| r1877 | r1878 | |
| 403 | 404 | { |
| 404 | 405 | struct y8950_info *info = param; |
| 405 | 406 | if (info->intf->portread) |
| 406 | return info->intf->portread(info->index); | |
| 407 | return info->intf->portread(Machine,info->index); | |
| 407 | 408 | return 0; |
| 408 | 409 | } |
| 409 | 410 | |
| r1877 | r1878 | |
| 411 | 412 | { |
| 412 | 413 | struct y8950_info *info = param; |
| 413 | 414 | if (info->intf->portwrite) |
| 414 | info->intf->portwrite(info->index,data); | |
| 415 | info->intf->portwrite(Machine,info->index,data); | |
| 415 | 416 | } |
| 416 | 417 | |
| 417 | 418 | static unsigned char Y8950KeyboardHandler_r(void *param) |
| 418 | 419 | { |
| 419 | 420 | struct y8950_info *info = param; |
| 420 | 421 | if (info->intf->keyboardread) |
| 421 | return info->intf->keyboardread(info->index); | |
| 422 | return info->intf->keyboardread(Machine,info->index); | |
| 422 | 423 | return 0; |
| 423 | 424 | } |
| 424 | 425 | |
| r1877 | r1878 | |
| 426 | 427 | { |
| 427 | 428 | struct y8950_info *info = param; |
| 428 | 429 | if (info->intf->keyboardwrite) |
| 429 | info->intf->keyboardwrite(info->index,data); | |
| 430 | info->intf->keyboardwrite(Machine,info->index,data); | |
| 430 | 431 | } |
| 431 | 432 | |
| 432 | 433 | static void y8950_stream_update(void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length) |
| r1877 | r1878 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | int rom_region; /* delta-T ADPCM ROM/RAM region */ |
| 17 | 17 | |
| 18 | read8_handler keyboardread; | |
| 19 | write8_handler keyboardwrite; | |
| 20 | read8_handler portread; | |
| 21 | write8_handler portwrite; | |
| 18 | read8_machine_func keyboardread; | |
| 19 | write8_machine_func keyboardwrite; | |
| 20 | read8_machine_func portread; | |
| 21 | write8_machine_func portwrite; | |
| 22 | 22 | }; |
| 23 | 23 | |
| 24 | 24 |
| r1877 | r1878 | |
|---|---|---|
| 24 | 24 | #include <math.h> |
| 25 | 25 | |
| 26 | 26 | #include "sndintrf.h" |
| 27 | #include "deprecat.h" | |
| 27 | 28 | #include "streams.h" |
| 28 | 29 | #include "ymz280b.h" |
| 29 | 30 | |
| r1877 | r1878 | |
| 91 | 92 | void (*irq_callback)(int); /* IRQ callback */ |
| 92 | 93 | struct YMZ280BVoice voice[8]; /* the 8 voices */ |
| 93 | 94 | UINT32 rom_readback_addr; /* where the CPU can read the ROM */ |
| 94 | read8_handler ext_ram_read; /* external RAM read handler */ | |
| 95 | write8_handler ext_ram_write; /* external RAM write handler */ | |
| 95 | read8_machine_func ext_ram_read; /* external RAM read handler */ | |
| 96 | write8_machine_func ext_ram_write; /* external RAM write handler */ | |
| 96 | 97 | |
| 97 | 98 | #if MAKE_WAVS |
| 98 | 99 | void * wavresample; /* resampled waveform */ |
| r1877 | r1878 | |
| 117 | 118 | static TIMER_CALLBACK( update_irq_state_timer_6 ); |
| 118 | 119 | static TIMER_CALLBACK( update_irq_state_timer_7 ); |
| 119 | 120 | |
| 120 | static const timer_c | |
| 121 | static const timer_fired_func | |
| 121 | 122 | { |
| 122 | 123 | update_irq_state_timer_0, |
| 123 | 124 | update_irq_state_timer_1, |
| r1877 | r1878 | |
| 864 | 865 | |
| 865 | 866 | case 0x87: /* RAM write */ |
| 866 | 867 | if (chip->ext_ram_write) |
| 867 | chip->ext_ram_write(chip->rom_readback_addr, data); | |
| 868 | chip->ext_ram_write(Machine, chip->rom_readback_addr, data); | |
| 868 | 869 | else |
| 869 | 870 | logerror("YMZ280B attempted RAM write to %X\n", chip->rom_readback_addr); |
| 870 | 871 | break; |
| r1877 | r1878 | |
| 1074 | 1075 | { |
| 1075 | 1076 | UINT8 data; |
| 1076 | 1077 | struct YMZ280BChip *chip = sndti_token(SOUND_YMZ280B, 0); |
| 1077 | data = chip->ext_ram_read(chip->rom_readback_addr - 1); | |
| 1078 | data = chip->ext_ram_read(machine, chip->rom_readback_addr - 1); | |
| 1078 | 1079 | chip->rom_readback_addr++; |
| 1079 | 1080 | return data; |
| 1080 | 1081 | } |
| r1877 | r1878 | |
| 1083 | 1084 | { |
| 1084 | 1085 | UINT8 data; |
| 1085 | 1086 | struct YMZ280BChip *chip = sndti_token(SOUND_YMZ280B, 1); |
| 1086 | data = chip->ext_ram_read(chip->rom_readback_addr - 1); | |
| 1087 | data = chip->ext_ram_read(machine, chip->rom_readback_addr - 1); | |
| 1087 | 1088 | chip->rom_readback_addr++; |
| 1088 | 1089 | return data; |
| 1089 | 1090 | } |
| r1877 | r1878 | |
|---|---|---|
| 12 | 12 | { |
| 13 | 13 | int region; /* memory region where the sample ROM lives */ |
| 14 | 14 | void (*irq_callback)(int state); /* irq callback */ |
| 15 | read8_handler ext_read; /* external RAM read */ | |
| 16 | write8_handler ext_write; /* external RAM write */ | |
| 15 | read8_machine_func ext_read; /* external RAM read */ | |
| 16 | write8_machine_func ext_write; /* external RAM write */ | |
| 17 | 17 | }; |
| 18 | 18 | |
| 19 | 19 | READ8_HANDLER ( YMZ280B_status_0_r ); |
| r1877 | r1878 | |
|---|---|---|
| 163 | 163 | #define DST_ADDER__IN2 (*(node->input[3])) |
| 164 | 164 | #define DST_ADDER__IN3 (*(node->input[4])) |
| 165 | 165 | |
| 166 | void dst_adder_step(node_description *node) | |
| 166 | static void dst_adder_step(node_description *node) | |
| 167 | 167 | { |
| 168 | 168 | if(DST_ADDER__ENABLE) |
| 169 | 169 | { |
| r1877 | r1878 | |
| 190 | 190 | #define DST_COMP_ADDER__ENABLE (*(node->input[0])) |
| 191 | 191 | #define DST_COMP_ADDER__SELECT (int)(*(node->input[1])) |
| 192 | 192 | |
| 193 | void dst_comp_adder_step(node_description *node) | |
| 193 | static void dst_comp_adder_step(node_description *node) | |
| 194 | 194 | { |
| 195 | 195 | const discrete_comp_adder_table *info = node->custom; |
| 196 | 196 | int bit; |
| r1877 | r1878 | |
| 240 | 240 | #define DST_CLAMP__MAX (*(node->input[3])) |
| 241 | 241 | #define DST_CLAMP__CLAMP (*(node->input[4])) |
| 242 | 242 | |
| 243 | void dst_clamp_step(node_description *node) | |
| 243 | static void dst_clamp_step(node_description *node) | |
| 244 | 244 | { |
| 245 | 245 | if(DST_CLAMP__ENABLE) |
| 246 | 246 | { |
| r1877 | r1878 | |
| 271 | 271 | #define DST_DAC_R1__DATA (int)(*(node->input[1])) |
| 272 | 272 | #define DST_DAC_R1__VON (*(node->input[2])) |
| 273 | 273 | |
| 274 | void dst_dac_r1_step(node_description *node) | |
| 274 | static void dst_dac_r1_step(node_description *node) | |
| 275 | 275 | { |
| 276 | 276 | const discrete_dac_r1_ladder *info = node->custom; |
| 277 | 277 | struct dst_dac_r1_context *context = node->context; |
| r1877 | r1878 | |
| 307 | 307 | } |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | void dst_dac_r1_reset(node_description *node) | |
| 310 | static void dst_dac_r1_reset(node_description *node) | |
| 311 | 311 | { |
| 312 | 312 | const discrete_dac_r1_ladder *info = node->custom; |
| 313 | 313 | struct dst_dac_r1_context *context = node->context; |
| r1877 | r1878 | |
| 376 | 376 | #define DST_DIODE_MIX__VJUNC (*(node->input[1])) |
| 377 | 377 | #define DST_DIODE_MIX__INP(addr) (*(node->input[2 + addr])) |
| 378 | 378 | |
| 379 | void dst_diode_mix_step(node_description *node) | |
| 379 | static void dst_diode_mix_step(node_description *node) | |
| 380 | 380 | { |
| 381 | 381 | struct dst_size_context *context = node->context; |
| 382 | 382 | double max = 0; |
| r1877 | r1878 | |
| 397 | 397 | } |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | void dst_diode_mix_reset(node_description *node) | |
| 400 | static void dst_diode_mix_reset(node_description *node) | |
| 401 | 401 | { |
| 402 | 402 | struct dst_size_context *context = node->context; |
| 403 | 403 | |
| r1877 | r1878 | |
| 420 | 420 | #define DST_DIVIDE__IN (*(node->input[1])) |
| 421 | 421 | #define DST_DIVIDE__DIV (*(node->input[2])) |
| 422 | 422 | |
| 423 | void dst_divide_step(node_description *node) | |
| 423 | static void dst_divide_step(node_description *node) | |
| 424 | 424 | { |
| 425 | 425 | if(DST_DIVIDE__ENABLE) |
| 426 | 426 | { |
| r1877 | r1878 | |
| 456 | 456 | #define DST_GAIN__GAIN (*(node->input[2])) |
| 457 | 457 | #define DST_GAIN__OFFSET (*(node->input[3])) |
| 458 | 458 | |
| 459 | void dst_gain_step(node_description *node) | |
| 459 | static void dst_gain_step(node_description *node) | |
| 460 | 460 | { |
| 461 | 461 | if(DST_GAIN__ENABLE) |
| 462 | 462 | { |
| r1877 | r1878 | |
| 518 | 518 | return (result); |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | void dst_integrate_step(node_description *node) | |
| 521 | static void dst_integrate_step(node_description *node) | |
| 522 | 522 | { |
| 523 | 523 | const discrete_integrate_info *info = node->custom; |
| 524 | 524 | struct dst_integrate_context *context = node->context; |
| r1877 | r1878 | |
| 563 | 563 | if (node->output > context->vMaxOut) node->output = context->vMaxOut; |
| 564 | 564 | } |
| 565 | 565 | |
| 566 | void dst_integrate_reset(node_description *node) | |
| 566 | static void dst_integrate_reset(node_description *node) | |
| 567 | 567 | { |
| 568 | 568 | const discrete_integrate_info *info = node->custom; |
| 569 | 569 | struct dst_integrate_context *context = node->context; |
| r1877 | r1878 | |
| 599 | 599 | #define DST_LOGIC_INV__ENABLE (*(node->input[0])) |
| 600 | 600 | #define DST_LOGIC_INV__IN (*(node->input[1])) |
| 601 | 601 | |
| 602 | void dst_logic_inv_step(node_description *node) | |
| 602 | static void dst_logic_inv_step(node_description *node) | |
| 603 | 603 | { |
| 604 | 604 | if(DST_LOGIC_INV__ENABLE) |
| 605 | 605 | { |
| r1877 | r1878 | |
| 628 | 628 | #define DST_LOGIC_AND__IN2 (*(node->input[3])) |
| 629 | 629 | #define DST_LOGIC_AND__IN3 (*(node->input[4])) |
| 630 | 630 | |
| 631 | void dst_logic_and_step(node_description *node) | |
| 631 | static void dst_logic_and_step(node_description *node) | |
| 632 | 632 | { |
| 633 | 633 | if(DST_LOGIC_AND__ENABLE) |
| 634 | 634 | { |
| r1877 | r1878 | |
| 657 | 657 | #define DST_LOGIC_NAND__IN2 (*(node->input[3])) |
| 658 | 658 | #define DST_LOGIC_NAND__IN3 (*(node->input[4])) |
| 659 | 659 | |
| 660 | void dst_logic_nand_step(node_description *node) | |
| 660 | static void dst_logic_nand_step(node_description *node) | |
| 661 | 661 | { |
| 662 | 662 | if(DST_LOGIC_NAND__ENABLE) |
| 663 | 663 | { |
| r1877 | r1878 | |
| 686 | 686 | #define DST_LOGIC_OR__IN2 (*(node->input[3])) |
| 687 | 687 | #define DST_LOGIC_OR__IN3 (*(node->input[4])) |
| 688 | 688 | |
| 689 | void dst_logic_or_step(node_description *node) | |
| 689 | static void dst_logic_or_step(node_description *node) | |
| 690 | 690 | { |
| 691 | 691 | if(DST_LOGIC_OR__ENABLE) |
| 692 | 692 | { |
| r1877 | r1878 | |
| 715 | 715 | #define DST_LOGIC_NOR__IN2 (*(node->input[3])) |
| 716 | 716 | #define DST_LOGIC_NOR__IN3 (*(node->input[4])) |
| 717 | 717 | |
| 718 | void dst_logic_nor_step(node_description *node) | |
| 718 | static void dst_logic_nor_step(node_description *node) | |
| 719 | 719 | { |
| 720 | 720 | if(DST_LOGIC_NOR__ENABLE) |
| 721 | 721 | { |
| r1877 | r1878 | |
| 740 | 740 | #define DST_LOGIC_XOR__IN0 (*(node->input[1])) |
| 741 | 741 | #define DST_LOGIC_XOR__IN1 (*(node->input[2])) |
| 742 | 742 | |
| 743 | void dst_logic_xor_step(node_description *node) | |
| 743 | static void dst_logic_xor_step(node_description *node) | |
| 744 | 744 | { |
| 745 | 745 | if(DST_LOGIC_XOR__ENABLE) |
| 746 | 746 | { |
| r1877 | r1878 | |
| 765 | 765 | #define DST_LOGIC_XNOR__IN0 (*(node->input[1])) |
| 766 | 766 | #define DST_LOGIC_XNOR__IN1 (*(node->input[2])) |
| 767 | 767 | |
| 768 | void dst_logic_nxor_step(node_description *node) | |
| 768 | static void dst_logic_nxor_step(node_description *node) | |
| 769 | 769 | { |
| 770 | 770 | if(DST_LOGIC_XNOR__ENABLE) |
| 771 | 771 | { |
| r1877 | r1878 | |
| 795 | 795 | #define DST_LOGIC_DFF__CLOCK (*(node->input[3])) |
| 796 | 796 | #define DST_LOGIC_DFF__DATA (*(node->input[4])) |
| 797 | 797 | |
| 798 | void dst_logic_dff_step(node_description *node) | |
| 798 | static void dst_logic_dff_step(node_description *node) | |
| 799 | 799 | { |
| 800 | 800 | struct dst_flipflop_context *context = node->context; |
| 801 | 801 | int clk = (int)DST_LOGIC_DFF__CLOCK; |
| r1877 | r1878 | |
| 818 | 818 | context->last_clk = clk; |
| 819 | 819 | } |
| 820 | 820 | |
| 821 | void dst_logic_ff_reset(node_description *node) | |
| 821 | static void dst_logic_ff_reset(node_description *node) | |
| 822 | 822 | { |
| 823 | 823 | struct dst_flipflop_context *context = node->context; |
| 824 | 824 | context->last_clk = 0; |
| r1877 | r1878 | |
| 845 | 845 | #define DST_LOGIC_JKFF__J (*(node->input[4])) |
| 846 | 846 | #define DST_LOGIC_JKFF__K (*(node->input[5])) |
| 847 | 847 | |
| 848 | void dst_logic_jkff_step(node_description *node) | |
| 848 | static void dst_logic_jkff_step(node_description *node) | |
| 849 | 849 | { |
| 850 | 850 | struct dst_flipflop_context *context = node->context; |
| 851 | 851 | int clk = (int)DST_LOGIC_JKFF__CLOCK; |
| r1877 | r1878 | |
| 902 | 902 | #define DST_LOOKUP_TABLE__IN (*(node->input[1])) |
| 903 | 903 | #define DST_LOOKUP_TABLE__SIZE (*(node->input[2])) |
| 904 | 904 | |
| 905 | void dst_lookup_table_step(node_description *node) | |
| 905 | static void dst_lookup_table_step(node_description *node) | |
| 906 | 906 | { |
| 907 | 907 | const double *table = node->custom; |
| 908 | 908 | int addr = DST_LOOKUP_TABLE__IN; |
| r1877 | r1878 | |
| 966 | 966 | #define DST_MIXER__ENABLE (*(node->input[0])) |
| 967 | 967 | #define DST_MIXER__IN(bit) (*(node->input[bit + 1])) |
| 968 | 968 | |
| 969 | void dst_mixer_step(node_description *node) | |
| 969 | static void dst_mixer_step(node_description *node) | |
| 970 | 970 | { |
| 971 | 971 | const discrete_mixer_desc *info = node->custom; |
| 972 | 972 | struct dst_mixer_context *context = node->context; |
| r1877 | r1878 | |
| 1069 | 1069 | } |
| 1070 | 1070 | } |
| 1071 | 1071 | |
| 1072 | void dst_mixer_reset(node_description *node) | |
| 1072 | static void dst_mixer_reset(node_description *node) | |
| 1073 | 1073 | { |
| 1074 | 1074 | const discrete_mixer_desc *info = node->custom; |
| 1075 | 1075 | struct dst_mixer_context *context = node->context; |
| r1877 | r1878 | |
| 1189 | 1189 | #define DST_MULTIPLEX__ADDR (*(node->input[1])) |
| 1190 | 1190 | #define DST_MULTIPLEX__INP(addr) (*(node->input[2 + addr])) |
| 1191 | 1191 | |
| 1192 | void dst_multiplex_step(node_description *node) | |
| 1192 | static void dst_multiplex_step(node_description *node) | |
| 1193 | 1193 | { |
| 1194 | 1194 | struct dst_size_context *context = node->context; |
| 1195 | 1195 | int addr; |
| r1877 | r1878 | |
| 1213 | 1213 | } |
| 1214 | 1214 | } |
| 1215 | 1215 | |
| 1216 | void dst_multiplex_reset(node_description *node) | |
| 1216 | static void dst_multiplex_reset(node_description *node) | |
| 1217 | 1217 | { |
| 1218 | 1218 | struct dst_size_context *context = node->context; |
| 1219 | 1219 | |
| r1877 | r1878 | |
| 1241 | 1241 | #define DST_ONESHOT__WIDTH (*(node->input[3])) |
| 1242 | 1242 | #define DST_ONESHOT__TYPE (int)(*(node->input[4])) |
| 1243 | 1243 | |
| 1244 | void dst_oneshot_step(node_description *node) | |
| 1244 | static void dst_oneshot_step(node_description *node) | |
| 1245 | 1245 | { |
| 1246 | 1246 | struct dst_oneshot_context *context = node->context; |
| 1247 | 1247 | int trigger = (DST_ONESHOT__TRIG != 0); |
| r1877 | r1878 | |
| 1300 | 1300 | } |
| 1301 | 1301 | |
| 1302 | 1302 | |
| 1303 | void dst_oneshot_reset(node_description *node) | |
| 1303 | static void dst_oneshot_reset(node_description *node) | |
| 1304 | 1304 | { |
| 1305 | 1305 | struct dst_oneshot_context *context = node->context; |
| 1306 | 1306 | context->countdown = 0; |
| r1877 | r1878 | |
| 1330 | 1330 | #define DST_RAMP__END (*(node->input[4])) |
| 1331 | 1331 | #define DST_RAMP__CLAMP (*(node->input[5])) |
| 1332 | 1332 | |
| 1333 | void dst_ramp_step(node_description *node) | |
| 1333 | static void dst_ramp_step(node_description *node) | |
| 1334 | 1334 | { |
| 1335 | 1335 | struct dss_ramp_context *context = node->context; |
| 1336 | 1336 | |
| r1877 | r1878 | |
| 1357 | 1357 | } |
| 1358 | 1358 | } |
| 1359 | 1359 | |
| 1360 | void dst_ramp_reset(node_description *node) | |
| 1360 | static void dst_ramp_reset(node_description *node) | |
| 1361 | 1361 | { |
| 1362 | 1362 | struct dss_ramp_context *context = node->context; |
| 1363 | 1363 | |
| r1877 | r1878 | |
| 1383 | 1383 | #define DST_SAMPHOLD__CLOCK (*(node->input[2])) |
| 1384 | 1384 | #define DST_SAMPHOLD__TYPE (*(node->input[3])) |
| 1385 | 1385 | |
| 1386 | void dst_samphold_step(node_description *node) | |
| 1386 | static void dst_samphold_step(node_description *node) | |
| 1387 | 1387 | { |
| 1388 | 1388 | struct dst_samphold_context *context = node->context; |
| 1389 | 1389 | |
| r1877 | r1878 | |
| 1420 | 1420 | context->lastinput=DST_SAMPHOLD__CLOCK; |
| 1421 | 1421 | } |
| 1422 | 1422 | |
| 1423 | void dst_samphold_reset(node_description *node) | |
| 1423 | static void dst_samphold_reset(node_description *node) | |
| 1424 | 1424 | { |
| 1425 | 1425 | struct dst_samphold_context *context = node->context; |
| 1426 | 1426 | |
| r1877 | r1878 | |
| 1447 | 1447 | #define DSS_SWITCH__IN0 (*(node->input[2])) |
| 1448 | 1448 | #define DSS_SWITCH__IN1 (*(node->input[3])) |
| 1449 | 1449 | |
| 1450 | void dst_switch_step(node_description *node) | |
| 1450 | static void dst_switch_step(node_description *node) | |
| 1451 | 1451 | { |
| 1452 | 1452 | if(DSS_SWITCH__ENABLE) |
| 1453 | 1453 | { |
| r1877 | r1878 | |
| 1475 | 1475 | #define DSS_ASWITCH__THRESHOLD (*(node->input[3])) |
| 1476 | 1476 | |
| 1477 | 1477 | |
| 1478 | void dst_aswitch_step(node_description *node) | |
| 1478 | static void dst_aswitch_step(node_description *node) | |
| 1479 | 1479 | { |
| 1480 | 1480 | if(DSS_SWITCH__ENABLE) |
| 1481 | 1481 | { |
| r1877 | r1878 | |
| 1524 | 1524 | return value; |
| 1525 | 1525 | } |
| 1526 | 1526 | |
| 1527 | void dst_transform_step(node_description *node) | |
| 1527 | static void dst_transform_step(node_description *node) | |
| 1528 | 1528 | { |
| 1529 | 1529 | if(DST_TRANSFORM__ENABLE) |
| 1530 | 1530 | { |
| r1877 | r1878 | |
| 1660 | 1660 | #define DST_OP_AMP__INP0 (*(node->input[1])) |
| 1661 | 1661 | #define DST_OP_AMP__INP1 (*(node->input[2])) |
| 1662 | 1662 | |
| 1663 | void dst_op_amp_step(node_description *node) | |
| 1663 | static void dst_op_amp_step(node_description *node) | |
| 1664 | 1664 | { |
| 1665 | 1665 | const discrete_op_amp_info *info = node->custom; |
| 1666 | 1666 | struct dst_op_amp_context *context = node->context; |
| r1877 | r1878 | |
| 1720 | 1720 | node->output = 0; |
| 1721 | 1721 | } |
| 1722 | 1722 | |
| 1723 | void dst_op_amp_reset(node_description *node) | |
| 1723 | static void dst_op_amp_reset(node_description *node) | |
| 1724 | 1724 | { |
| 1725 | 1725 | const discrete_op_amp_info *info = node->custom; |
| 1726 | 1726 | struct dst_op_amp_context *context = node->context; |
| r1877 | r1878 | |
| 1763 | 1763 | ************************************************************************/ |
| 1764 | 1764 | #define DST_OP_AMP_1SHT__TRIGGER (*(node->input[0])) |
| 1765 | 1765 | |
| 1766 | void dst_op_amp_1sht_step(node_description *node) | |
| 1766 | static void dst_op_amp_1sht_step(node_description *node) | |
| 1767 | 1767 | { |
| 1768 | 1768 | const discrete_op_amp_1sht_info *info = node->custom; |
| 1769 | 1769 | struct dst_op_amp_1sht_context *context = node->context; |
| r1877 | r1878 | |
| 1803 | 1803 | context->vCap1 += ((node->output - OP_AMP_NORTON_VBE) * context->r34ratio + OP_AMP_NORTON_VBE - context->vCap1) * context->exponent1c; |
| 1804 | 1804 | } |
| 1805 | 1805 | |
| 1806 | void dst_op_amp_1sht_reset(node_description *node) | |
| 1806 | static void dst_op_amp_1sht_reset(node_description *node) | |
| 1807 | 1807 | { |
| 1808 | 1808 | const discrete_op_amp_1sht_info *info = node->custom; |
| 1809 | 1809 | struct dst_op_amp_1sht_context *context = node->context; |
| r1877 | r1878 | |
| 1841 | 1841 | #define DST_TVCA_OP_AMP__INP0 (*(node->input[3])) |
| 1842 | 1842 | #define DST_TVCA_OP_AMP__INP1 (*(node->input[4])) |
| 1843 | 1843 | |
| 1844 | void dst_tvca_op_amp_step(node_description *node) | |
| 1844 | static void dst_tvca_op_amp_step(node_description *node) | |
| 1845 | 1845 | { |
| 1846 | 1846 | const discrete_op_amp_tvca_info *info = node->custom; |
| 1847 | 1847 | struct dst_tvca_op_amp_context *context = node->context; |
| r1877 | r1878 | |
| 1921 | 1921 | if (node->output > context->vOutMax) node->output = context->vOutMax; |
| 1922 | 1922 | } |
| 1923 | 1923 | |
| 1924 | void dst_tvca_op_amp_reset(node_description *node) | |
| 1924 | static void dst_tvca_op_amp_reset(node_description *node) | |
| 1925 | 1925 | { |
| 1926 | 1926 | const discrete_op_amp_tvca_info *info = node->custom; |
| 1927 | 1927 | struct dst_tvca_op_amp_context *context = node->context; |
| r1877 | r1878 | |
|---|---|---|
| 6 | 6 | - No FM mode |
| 7 | 7 | - A third sample format (ADPCM) has been added |
| 8 | 8 | - Some minor other tweeks (no EGHOLD, slighly more capable DSP) |
| 9 | ||
| 10 | init: | |
| 11 | ||
| 9 | 12 | */ |
| 10 | 13 | |
| 11 | 14 | #include "sndintrf.h" |
| r1877 | r1878 | |
| 126 | 129 | int curstep, nxtstep; |
| 127 | 130 | int cur_lpquant, cur_lpsample, cur_lpstep; |
| 128 | 131 | UINT8 *adbase, *nxtbase, *adlpbase; |
| 132 | UINT8 mslc; // monitored? | |
| 129 | 133 | }; |
| 130 | 134 | |
| 131 | 135 | |
| r1877 | r1878 | |
| 140 | 144 | #define MIFULL(aica) ((aica->udata.data[4]>>0x0)&0x0200) |
| 141 | 145 | #define MIEMPTY(aica) ((aica->udata.data[4]>>0x0)&0x0100) |
| 142 | 146 | |
| 147 | #define AFSEL(aica) ((aica->udata.data[6]>>0x0)&0x4000) | |
| 148 | #define MSLC(aica) ((aica->udata.data[6]>>0x8)&0x3F) | |
| 149 | ||
| 143 | 150 | #define SCILV0(aica) ((aica->udata.data[0xa8/2]>>0x0)&0xff) |
| 144 | 151 | #define SCILV1(aica) ((aica->udata.data[0xac/2]>>0x0)&0xff) |
| 145 | 152 | #define SCILV2(aica) ((aica->udata.data[0xb0/2]>>0x0)&0xff) |
| r1877 | r1878 | |
| 425 | 432 | const int TableQuant[8]={ADFIX(0.8984375),ADFIX(0.8984375),ADFIX(0.8984375),ADFIX(0.8984375),ADFIX(1.19921875),ADFIX(1.59765625),ADFIX(2.0),ADFIX(2.3984375)}; |
| 426 | 433 | const int quant_mul[16]= { 1, 3, 5, 7, 9, 11, 13, 15, -1, -3, -5, -7, -9, -11, -13, -15}; |
| 427 | 434 | |
| 428 | void InitADPCM(int *PrevSignal, int *PrevQuant) | |
| 435 | static void InitADPCM(int *PrevSignal, int *PrevQuant) | |
| 429 | 436 | { |
| 430 | 437 | *PrevSignal=0; |
| 431 | 438 | *PrevQuant=0x7f; |
| 432 | 439 | } |
| 433 | 440 | |
| 434 | signed short | |
| 441 | INLINE signed short | |
| 435 | 442 | { |
| 436 | 443 | *PrevSignal+=(*PrevQuant*quant_mul[Delta&15])>>(3); |
| 437 | 444 | *PrevSignal=ICLIP16(*PrevSignal); |
| r1877 | r1878 | |
| 634 | 641 | AICA->Slots[i].active=0; |
| 635 | 642 | AICA->Slots[i].base=NULL; |
| 636 | 643 | AICA->Slots[i].EG.state=RELEASE; |
| 644 | AICA->Slots[i].mslc=0; | |
| 637 | 645 | } |
| 638 | 646 | |
| 639 | 647 | AICALFO_Init(); |
| r1877 | r1878 | |
| 666 | 674 | { |
| 667 | 675 | if(KEYONB(s2) && s2->EG.state==RELEASE/*&& !s2->active*/) |
| 668 | 676 | { |
| 677 | if(s2->mslc) AICA->udata.data[0x10] &= 0x7FFF; // reset LP at KEY_ON | |
| 669 | 678 | AICA_StartSlot(AICA, s2); |
| 670 | 679 | #if 0 |
| 671 | 680 | printf("StartSlot[%02X]: SSCTL %01X SA %06X LSA %04X LEA %04X PCMS %01X LPCTL %01X\n",sl,SSCTL(s2),SA(s2),LSA(s2),LEA(s2),PCMS(s2),LPCTL(s2)); |
| r1877 | r1878 | |
| 726 | 735 | break; |
| 727 | 736 | case 0x8: |
| 728 | 737 | case 0x9: |
| 729 | AICA_MidiIn(0, AICA->udata.data[0x8/2]&0xff, 0); | |
| 738 | AICA_MidiIn(Machine, 0, AICA->udata.data[0x8/2]&0xff, 0); | |
| 730 | 739 | break; |
| 731 | /* case 0x12: | |
| 732 | case 0x13: | |
| 733 | case 0x14: | |
| 734 | case 0x15: | |
| 735 | case 0x16: | |
| 736 | case 0x17: | |
| 737 | break;*/ | |
| 740 | case 0x12: | |
| 741 | case 0x13: | |
| 742 | case 0x14: | |
| 743 | case 0x15: | |
| 744 | case 0x16: | |
| 745 | case 0x17: | |
| 746 | break; | |
| 738 | 747 | case 0x90: |
| 739 | 748 | case 0x91: |
| 740 | 749 | if(AICA->Master) |
| r1877 | r1878 | |
| 860 | 869 | case 0x10: // LP check |
| 861 | 870 | case 0x11: |
| 862 | 871 | { |
| 863 | // int MSLC = (AICA->udata.data[0xc/2]>>8) & 0x3f; // which slot are we monitoring? | |
| 864 | ||
| 865 | // AICA->udata.data[0x10/2] |= 0x8000; // set LP if necessary | |
| 872 | //int MSLC = (AICA->udata.data[0xc/2]>>8) & 0x3f; // which slot are we monitoring? | |
| 866 | 873 | } |
| 867 | 874 | break; |
| 868 | 875 | |
| r1877 | r1878 | |
| 959 | 966 | { |
| 960 | 967 | AICA_UpdateRegR(AICA, addr&0xff); |
| 961 | 968 | v= *((unsigned short *) (AICA->udata.datab+((addr&0xff)))); |
| 969 | if((addr&0xfe)==0x10) AICA->udata.data[0x10/2] &= 0x7FFF; // reset LP on read | |
| 962 | 970 | } |
| 963 | 971 | else if (addr == 0x2d00) |
| 964 | 972 | { |
| r1877 | r1878 | |
| 977 | 985 | |
| 978 | 986 | #define REVSIGN(v) ((~v)+1) |
| 979 | 987 | |
| 980 | void AICA_TimersAddTicks(struct _AICA *AICA, int ticks) | |
| 988 | #ifdef UNUSED_FUNCTION | |
| 989 | static void AICA_TimersAddTicks(struct _AICA *AICA, int ticks) | |
| 981 | 990 | { |
| 982 | 991 | if(AICA->TimCnt[0]<=0xff00) |
| 983 | 992 | { |
| r1877 | r1878 | |
| 1015 | 1024 | AICA->udata.data[0x98/2]|=AICA->TimCnt[2]>>8; |
| 1016 | 1025 | } |
| 1017 | 1026 | } |
| 1027 | #endif | |
| 1018 | 1028 | |
| 1019 | 1029 | INLINE INT32 AICA_UpdateSlot(struct _AICA *AICA, struct _SLOT *slot) |
| 1020 | 1030 | { |
| r1877 | r1878 | |
| 1060 | 1070 | } |
| 1061 | 1071 | else if (PCMS(slot) == 0) //16 bit signed |
| 1062 | 1072 | { |
| 1063 | INT16 *p1=(signed short *) (AICA->AICARAM+((SA(slot)+addr1)&AICA->RAM_MASK)); | |
| 1064 | INT16 *p2=(signed short *) (AICA->AICARAM+((SA(slot)+addr2)&AICA->RAM_MASK)); | |
| 1073 | UINT8 *p1=(UINT8 *) (AICA->AICARAM+((SA(slot)+addr1)&AICA->RAM_MASK)); | |
| 1074 | UINT8 *p2=(UINT8 *) (AICA->AICARAM+((SA(slot)+addr2)&AICA->RAM_MASK)); | |
| 1065 | 1075 | INT32 s; |
| 1066 | 1076 | INT32 fpart=slot->cur_addr&((1<<SHIFT)-1); |
| 1067 | s=(int) (p1[0])*((1<<SHIFT)-fpart)+(int) (p2[0])*fpart; | |
| 1077 | s=(int) ((INT16)(p1[0] | (p1[1]<<8)))*((1<<SHIFT)-fpart)+(int) ((INT16)(p2[0] | (p2[1]<<8)))*fpart; | |
| 1068 | 1078 | sample=(s>>SHIFT); |
| 1069 | 1079 | } |
| 1070 | 1080 | else // 4-bit ADPCM |
| r1877 | r1878 | |
| 1146 | 1156 | if(*addr[addr_select]>=LSA(slot) && *addr[addr_select]>=LEA(slot)) |
| 1147 | 1157 | { |
| 1148 | 1158 | //slot->active=0; |
| 1159 | if(slot->mslc) AICA->udata.data[8] |= 0x8000; | |
| 1149 | 1160 | AICA_StopSlot(slot,0); |
| 1150 | 1161 | } |
| 1151 | 1162 | break; |
| 1152 | 1163 | case 1: //normal loop |
| 1153 | 1164 | if(*addr[addr_select]>=LEA(slot)) |
| 1154 | 1165 | { |
| 1166 | if(slot->mslc) AICA->udata.data[8] |= 0x8000; | |
| 1155 | 1167 | rem_addr = *slot_addr[addr_select] - (LEA(slot)<<SHIFT); |
| 1156 | 1168 | *slot_addr[addr_select]=(LSA(slot)<<SHIFT) + rem_addr; |
| 1157 | 1169 | |
| r1877 | r1878 | |
| 1194 | 1206 | else |
| 1195 | 1207 | sample=(sample*EG_TABLE[EG_Update(slot)>>(SHIFT-10)])>>SHIFT; |
| 1196 | 1208 | |
| 1209 | if(slot->mslc) | |
| 1210 | { | |
| 1211 | AICA->udata.data[0x12/2] = addr1; | |
| 1212 | if (!(AFSEL(AICA))) | |
| 1213 | { | |
| 1214 | AICA->udata.data[0x10/2] |= slot->EG.state<<13; | |
| 1215 | AICA->udata.data[0x10/2] |= 0x3FF - (slot->EG.volume>>EG_SHIFT); | |
| 1216 | } | |
| 1217 | } | |
| 1218 | ||
| 1197 | 1219 | return sample; |
| 1198 | 1220 | } |
| 1199 | 1221 | |
| r1877 | r1878 | |
| 1214 | 1236 | // mix slots' direct output |
| 1215 | 1237 | for(sl=0;sl<64;++sl) |
| 1216 | 1238 | { |
| 1239 | struct _SLOT *slot=AICA->Slots+sl; | |
| 1240 | slot->mslc = (MSLC(AICA)==sl); | |
| 1217 | 1241 | RBUFDST=AICA->RINGBUF+AICA->BUFPTR; |
| 1218 | 1242 | if(AICA->Slots[sl].active) |
| 1219 | 1243 | { |
| 1220 | struct _SLOT *slot=AICA->Slots+sl; | |
| 1221 | 1244 | unsigned int Enc; |
| 1222 | 1245 | signed int sample; |
| 1223 | 1246 | |
| r1877 | r1878 | |
| 1254 | 1277 | } |
| 1255 | 1278 | } |
| 1256 | 1279 | |
| 1257 | int AICA_IRQCB(void *param) | |
| 1280 | #ifdef UNUSED_FUNCTION | |
| 1281 | static int AICA_IRQCB(void *param) | |
| 1258 | 1282 | { |
| 1259 | 1283 | CheckPendingIRQ(param); |
| 1260 | 1284 | return -1; |
| 1261 | 1285 | } |
| 1286 | #endif | |
| 1262 | 1287 | |
| 1263 | 1288 | static void AICA_Update(void *param, stream_sample_t **inputs, stream_sample_t **buf, int samples) |
| 1264 | 1289 | { |
| r1877 | r1878 | |
| 1293 | 1318 | return AICA; |
| 1294 | 1319 | } |
| 1295 | 1320 | |
| 1296 | void aica_stop(void) | |
| 1321 | #ifdef UNUSED_FUNCTION | |
| 1322 | static void aica_stop(void) | |
| 1297 | 1323 | { |
| 1298 | 1324 | } |
| 1325 | #endif | |
| 1299 | 1326 | |
| 1300 | 1327 | void AICA_set_ram_base(int which, void *base, int size) |
| 1301 | 1328 | { |
| r1877 | r1878 | |
|---|---|---|
| 270 | 270 | UINT16 ret; |
| 271 | 271 | |
| 272 | 272 | ret = info->HI_WORD_BUF[offset]<<8; |
| 273 | ret += (seta_sound_r( offset )&0xff); | |
| 273 | ret += (seta_sound_r( machine, offset )&0xff); | |
| 274 | 274 | LOG_REGISTER_READ(( "Read X1-010 PC:%06X Offset:%04X Data:%04X\n", activecpu_get_pc(), offset, ret )); |
| 275 | 275 | return ret; |
| 276 | 276 | } |
| r1877 | r1878 | |
| 279 | 279 | { |
| 280 | 280 | struct x1_010_info *info = sndti_token(SOUND_X1_010, 0); |
| 281 | 281 | info->HI_WORD_BUF[offset] = (data>>8)&0xff; |
| 282 | seta_sound_w( offset, data&0xff ); | |
| 282 | seta_sound_w( machine, offset, data&0xff ); | |
| 283 | 283 | LOG_REGISTER_WRITE(( "Write X1-010 PC:%06X Offset:%04X Data:%04X\n", activecpu_get_pc(), offset, data )); |
| 284 | 284 | } |
| 285 | 285 |
| r1877 | r1878 | |
|---|---|---|
| 197 | 197 | |
| 198 | 198 | *************************************************************/ |
| 199 | 199 | |
| 200 | ||
| 200 | ||
| 201 | 201 | { |
| 202 | 202 | { 0, 0, 1, 2, 3, 5, 7, 10, 0, 0, -1, -2, -3, -5, -7, -10 }, |
| 203 | 203 | { 0, 1, 2, 3, 4, 6, 8, 13, 0, -1, -2, -3, -4, -6, -8, -13 }, |
| r1877 | r1878 | |
| 217 | 217 | { 6, 20, 36, 54, 76, 104, 144, 214, -6, -20, -36, -54, -76, -104, -144, -214 }, |
| 218 | 218 | }; |
| 219 | 219 | |
| 220 | ||
| 220 | ||
| 221 | 221 | |
| 222 | 222 | |
| 223 | 223 |
| r1877 | r1878 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | #include <math.h> |
| 16 | 16 | #include "sndintrf.h" |
| 17 | #include "deprecat.h" | |
| 17 | 18 | #include "streams.h" |
| 18 | 19 | #include "ymf271.h" |
| 19 | 20 | |
| r1877 | r1878 | |
| 107 | 108 | UINT8 ext_read; |
| 108 | 109 | |
| 109 | 110 | const UINT8 *rom; |
| 110 | read8_handler ext_mem_read; | |
| 111 | write8_handler ext_mem_write; | |
| 111 | read8_machine_func ext_mem_read; | |
| 112 | write8_machine_func ext_mem_write; | |
| 112 | 113 | void (*irq_callback)(int); |
| 113 | 114 | |
| 114 | 115 | int index; |
| r1877 | r1878 | |
| 1375 | 1376 | static UINT8 ymf271_read_ext_memory(YMF271Chip *chip, UINT32 address) |
| 1376 | 1377 | { |
| 1377 | 1378 | if( chip->ext_mem_read ) { |
| 1378 | return chip->ext_mem_read(address); | |
| 1379 | return chip->ext_mem_read(Machine,address); | |
| 1379 | 1380 | } else { |
| 1380 | 1381 | if( address < 0x800000) |
| 1381 | 1382 | return chip->rom[address]; |
| r1877 | r1878 | |
| 1386 | 1387 | static void ymf271_write_ext_memory(YMF271Chip *chip, UINT32 address, UINT8 data) |
| 1387 | 1388 | { |
| 1388 | 1389 | if( chip->ext_mem_write ) { |
| 1389 | chip->ext_mem_write(address, data); | |
| 1390 | chip->ext_mem_write(Machine, address, data); | |
| 1390 | 1391 | } |
| 1391 | 1392 | } |
| 1392 | 1393 | |
| r1877 | r1878 | |
| 1725 | 1726 | state_save_register_item("ymf271", chip->index, chip->ext_read); |
| 1726 | 1727 | } |
| 1727 | 1728 | |
| 1728 | static void ymf271_init(YMF271Chip *chip, UINT8 *rom, void (*cb)(int), read8_ | |
| 1729 | static void ymf271_init(YMF271Chip *chip, UINT8 *rom, void (*cb)(int), read8_machin | |
| 1729 | 1730 | { |
| 1730 | 1731 | chip->timA = timer_alloc(ymf271_timer_a_tick, chip); |
| 1731 | 1732 | chip->timB = timer_alloc(ymf271_timer_b_tick, chip); |
| r1877 | r1878 | |
|---|---|---|
| 50 | 50 | *****************************************************************************/ |
| 51 | 51 | |
| 52 | 52 | #include "sndintrf.h" |
| 53 | #include "deprecat.h" | |
| 53 | 54 | #include "streams.h" |
| 54 | 55 | #include "cpuintrf.h" |
| 55 | 56 | #include "pokey.h" |
| r1877 | r1878 | |
| 180 | 181 | int timer_param[3]; /* computed parameters for these timers */ |
| 181 | 182 | emu_timer *rtimer; /* timer for calculating the random offset */ |
| 182 | 183 | emu_timer *ptimer[8]; /* pot timers */ |
| 183 | read8_handler pot_r[8]; | |
| 184 | read8_handler allpot_r; | |
| 185 | read8_handler serin_r; | |
| 186 | write8_handler serout_w; | |
| 184 | read8_machine_func pot_r[8]; | |
| 185 | read8_machine_func allpot_r; | |
| 186 | read8_machine_func serin_r; | |
| 187 | write8_machine_func serout_w; | |
| 187 | 188 | void (*interrupt_cb)(int mask); |
| 188 | 189 | UINT8 AUDF[4]; /* AUDFx (D200, D202, D204, D206) */ |
| 189 | 190 | UINT8 AUDC[4]; /* AUDCx (D201, D203, D205, D207) */ |
| r1877 | r1878 | |
| 809 | 810 | p->POTx[pot] = 0xff; |
| 810 | 811 | if( p->pot_r[pot] ) |
| 811 | 812 | { |
| 812 | int r = (*p->pot_r[pot])(pot); | |
| 813 | int r = (*p->pot_r[pot])(Machine, pot); | |
| 813 | 814 | |
| 814 | 815 | LOG(("POKEY #%d pot_r(%d) returned $%02x\n", p->index, pot, r)); |
| 815 | 816 | if( r != -1 ) |
| r1877 | r1878 | |
| 878 | 879 | } |
| 879 | 880 | else if( p->allpot_r ) |
| 880 | 881 | { |
| 881 | data = (*p->allpot_r)(offs); | |
| 882 | data = (*p->allpot_r)(Machine, offs); | |
| 882 | 883 | LOG(("POKEY #%d ALLPOT callback $%02x\n", chip, data)); |
| 883 | 884 | } |
| 884 | 885 | else |
| r1877 | r1878 | |
| 931 | 932 | |
| 932 | 933 | case SERIN_C: |
| 933 | 934 | if( p->serin_r ) |
| 934 | p->SERIN = (*p->serin_r)(offs); | |
| 935 | p->SERIN = (*p->serin_r)(Machine, offs); | |
| 935 | 936 | data = p->SERIN; |
| 936 | 937 | LOG(("POKEY #%d SERIN $%02x\n", chip, data)); |
| 937 | 938 | break; |
| r1877 | r1878 | |
| 1178 | 1179 | case SEROUT_C: |
| 1179 | 1180 | LOG(("POKEY #%d SEROUT $%02x\n", chip, data)); |
| 1180 | 1181 | if (p->serout_w) |
| 1181 | (*p->serout_w)(offs, data); | |
| 1182 | (*p->serout_w)(Machine, offs, data); | |
| 1182 | 1183 | p->SKSTAT |= SK_SEROUT; |
| 1183 | 1184 | /* |
| 1184 | 1185 | * These are arbitrary values, tested with some custom boot |
| r1877 | r1878 | |
|---|---|---|
| 4 | 4 | struct YMF271interface |
| 5 | 5 | { |
| 6 | 6 | int region; /* memory region of sample ROMs */ |
| 7 | read8_handler ext_read; /* external memory read */ | |
| 8 | write8_handler ext_write; /* external memory write */ | |
| 7 | read8_machine_func ext_read; /* external memory read */ | |
| 8 | write8_machine_func ext_write; /* external memory write */ | |
| 9 | 9 | void (*irq_callback)(int state); /* irq callback */ |
| 10 | 10 | }; |
| 11 | 11 |
| r1877 | r1878 | |
|---|---|---|
| 11 | 11 | ***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | #include "sndintrf.h" |
| 14 | #include "deprecat.h" | |
| 14 | 15 | #include "streams.h" |
| 15 | 16 | #include "cpuintrf.h" |
| 16 | 17 | #include "ay8910.h" |
| r1877 | r1878 | |
| 26 | 27 | int streams; |
| 27 | 28 | int ready; |
| 28 | 29 | sound_stream *Channel; |
| 29 | read8_handler PortAread; | |
| 30 | read8_handler PortBread; | |
| 31 | write8_handler PortAwrite; | |
| 32 | write8_handler PortBwrite; | |
| 30 | read8_machine_func PortAread; | |
| 31 | read8_machine_func PortBread; | |
| 32 | write8_machine_func PortAwrite; | |
| 33 | write8_machine_func PortBwrite; | |
| 33 | 34 | INT32 register_latch; |
| 34 | 35 | UINT8 Regs[16]; |
| 35 | 36 | INT32 lastEnable; |
| r1877 | r1878 | |
| 124 | 125 | { |
| 125 | 126 | /* write out 0xff if port set to input */ |
| 126 | 127 | if (PSG->PortAwrite) |
| 127 | (*PSG->PortAwrite)(0, (PSG->Regs[AY_ENABLE] & 0x40) ? PSG->Regs[AY_PORTA] : 0xff); | |
| 128 | (*PSG->PortAwrite)(Machine, 0, (PSG->Regs[AY_ENABLE] & 0x40) ? PSG->Regs[AY_PORTA] : 0xff); | |
| 128 | 129 | } |
| 129 | 130 | |
| 130 | 131 | if ((PSG->lastEnable == -1) || |
| r1877 | r1878 | |
| 132 | 133 | { |
| 133 | 134 | /* write out 0xff if port set to input */ |
| 134 | 135 | if (PSG->PortBwrite) |
| 135 | (*PSG->PortBwrite)(0, (PSG->Regs[AY_ENABLE] & 0x80) ? PSG->Regs[AY_PORTB] : 0xff); | |
| 136 | (*PSG->PortBwrite)(Machine, 0, (PSG->Regs[AY_ENABLE] & 0x80) ? PSG->Regs[AY_PORTB] : 0xff); | |
| 136 | 137 | } |
| 137 | 138 | |
| 138 | 139 | PSG->lastEnable = PSG->Regs[AY_ENABLE]; |
| r1877 | r1878 | |
| 212 | 213 | if (PSG->Regs[AY_ENABLE] & 0x40) |
| 213 | 214 | { |
| 214 | 215 | if (PSG->PortAwrite) |
| 215 | (*PSG->PortAwrite)(0, PSG->Regs[AY_PORTA]); | |
| 216 | (*PSG->PortAwrite)(Machine, 0, PSG->Regs[AY_PORTA]); | |
| 216 | 217 | else |
| 217 | 218 | logerror("warning - write %02x to 8910 #%d Port A\n",PSG->Regs[AY_PORTA],PSG->index); |
| 218 | 219 | } |
| r1877 | r1878 | |
| 225 | 226 | if (PSG->Regs[AY_ENABLE] & 0x80) |
| 226 | 227 | { |
| 227 | 228 | if (PSG->PortBwrite) |
| 228 | (*PSG->PortBwrite)(0, PSG->Regs[AY_PORTB]); | |
| 229 | (*PSG->PortBwrite)(Machine, 0, PSG->Regs[AY_PORTB]); | |
| 229 | 230 | else |
| 230 | 231 | logerror("warning - write %02x to 8910 #%d Port B\n",PSG->Regs[AY_PORTB],PSG->index); |
| 231 | 232 | } |
| r1877 | r1878 | |
| 613 | 614 | |
| 614 | 615 | static void AY8910_init(struct AY8910 *PSG, int streams, |
| 615 | 616 | int clock,int sample_rate, |
| 616 | read8_handler portAread,read8_handler portBread, | |
| 617 | write8_handler portAwrite,write8_handler portBwrite) | |
| 617 | read8_machine_func portAread,read8_machine_func portBread, | |
| 618 | write8_machine_func portAwrite,write8_machine_func portBwrite) | |
| 618 | 619 | { |
| 619 | 620 | PSG->PortAread = portAread; |
| 620 | 621 | PSG->PortBread = portBread; |
| r1877 | r1878 | |
| 673 | 674 | |
| 674 | 675 | |
| 675 | 676 | void *ay8910_start_ym(sound_type chip_type, int sndindex, int clock, int streams, |
| 676 | read8_handler portAread, read8_handler portBread, | |
| 677 | write8_handler portAwrite, write8_handler portBwrite) | |
| 677 | read8_machine_func portAread, read8_machine_func portBread, | |
| 678 | write8_machine_func portAwrite, write8_machine_func portBwrite) | |
| 678 | 679 | { |
| 679 | 680 | struct AY8910 *info; |
| 680 | 681 | |
| r1877 | r1878 | |
| 765 | 766 | even if the port is set as output, we still need to return the external |
| 766 | 767 | data. Some games, like kidniki, need this to work. |
| 767 | 768 | */ |
| 768 | if (PSG->PortAread) PSG->Regs[AY_PORTA] = (*PSG->PortAread)(0); | |
| 769 | if (PSG->PortAread) PSG->Regs[AY_PORTA] = (*PSG->PortAread)(Machine, 0); | |
| 769 | 770 | else logerror("PC %04x: warning - read 8910 #%d Port A\n",activecpu_get_pc(),PSG->index); |
| 770 | 771 | break; |
| 771 | 772 | case AY_PORTB: |
| 772 | 773 | if ((PSG->Regs[AY_ENABLE] & 0x80) != 0) |
| 773 | 774 | logerror("warning: read from 8910 #%d Port B set as output\n",PSG->index); |
| 774 | if (PSG->PortBread) PSG->Regs[AY_PORTB] = (*PSG->PortBread)(0); | |
| 775 | if (PSG->PortBread) PSG->Regs[AY_PORTB] = (*PSG->PortBread)(Machine, 0); | |
| 775 | 776 | else logerror("PC %04x: warning - read 8910 #%d Port B\n",activecpu_get_pc(),PSG->index); |
| 776 | 777 | break; |
| 777 | 778 | } |
| r1877 | r1878 | |
|---|---|---|
| 90 | 90 | |
| 91 | 91 | int cdda_num_from_cdrom(void *file) |
| 92 | 92 | { |
| 93 | int index; | |
| 93 | int index = 0; | |
| 94 | 94 | |
| 95 | | |
| 95 | | |
| 96 | 96 | { |
| 97 | 97 | cdda_info *info; |
| 98 | 98 | |
| r1877 | r1878 | |
| 105 | 105 | return -1; |
| 106 | 106 | if (info->disc == file) |
| 107 | 107 | return index; |
| 108 | } | |
| 109 | return 0; | |
| 108 | index++; | |
| 109 | } while (1); | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 |
| r1877 | r1878 | |
|---|---|---|
| 67 | 67 | *****************************************************************************/ |
| 68 | 68 | |
| 69 | 69 | struct POKEYinterface { |
| 70 | read8_handler pot_r[8]; | |
| 71 | read8_handler allpot_r; | |
| 72 | read8_handler serin_r; | |
| 73 | write8_handler serout_w; | |
| 70 | read8_machine_func pot_r[8]; | |
| 71 | read8_machine_func allpot_r; | |
| 72 | read8_machine_func serin_r; | |
| 73 | write8_machine_func serout_w; | |
| 74 | 74 | void (*interrupt_cb)(int mask); |
| 75 | 75 | }; |
| 76 | 76 |
| r1877 | r1878 | |
|---|---|---|
| 2 | 2 | |
| 3 | 3 | /* This is the energy lookup table (4-bits -> 10-bits) */ |
| 4 | 4 | |
| 5 | ||
| 5 | ||
| 6 | 6 | 0x0000,0x00C0,0x0140,0x01C0,0x0280,0x0380,0x0500,0x0740, |
| 7 | 7 | 0x0A00,0x0E40,0x1440,0x1C80,0x2840,0x38C0,0x5040,0x7FC0}; |
| 8 | 8 | |
| 9 | 9 | /* This is the pitch lookup table (6-bits -> 8-bits) */ |
| 10 | 10 | |
| 11 | ||
| 11 | ||
| 12 | 12 | 0x0000,0x1000,0x1100,0x1200,0x1300,0x1400,0x1500,0x1600, |
| 13 | 13 | 0x1700,0x1800,0x1900,0x1A00,0x1B00,0x1C00,0x1D00,0x1E00, |
| 14 | 14 | 0x1F00,0x2000,0x2100,0x2200,0x2300,0x2400,0x2500,0x2600, |
| r1877 | r1878 | |
| 22 | 22 | |
| 23 | 23 | /* K1 is (5-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ |
| 24 | 24 | |
| 25 | ||
| 25 | ||
| 26 | 26 | (short)0x82C0,(short)0x8380,(short)0x83C0,(short)0x8440,(short)0x84C0,(short)0x8540,(short)0x8600,(short)0x8780, |
| 27 | 27 | (short)0x8880,(short)0x8980,(short)0x8AC0,(short)0x8C00,(short)0x8D40,(short)0x8F00,(short)0x90C0,(short)0x92C0, |
| 28 | 28 | (short)0x9900,(short)0xA140,(short)0xAB80,(short)0xB840,(short)0xC740,(short)0xD8C0,(short)0xEBC0,0x0000, |
| r1877 | r1878 | |
| 30 | 30 | |
| 31 | 31 | /* K2 is (5-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ |
| 32 | 32 | |
| 33 | ||
| 33 | ||
| 34 | 34 | (short)0xAE00,(short)0xB480,(short)0xBB80,(short)0xC340,(short)0xCB80,(short)0xD440,(short)0xDDC0,(short)0xE780, |
| 35 | 35 | (short)0xF180,(short)0xFBC0,0x0600,0x1040,0x1A40,0x2400,0x2D40,0x3600, |
| 36 | 36 | 0x3E40,0x45C0,0x4CC0,0x5300,0x5880,0x5DC0,0x6240,0x6640, |
| r1877 | r1878 | |
| 38 | 38 | |
| 39 | 39 | /* K3 is (4-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ |
| 40 | 40 | |
| 41 | ||
| 41 | ||
| 42 | 42 | (short)0x9200,(short)0x9F00,(short)0xAD00,(short)0xBA00,(short)0xC800,(short)0xD500,(short)0xE300,(short)0xF000, |
| 43 | 43 | (short)0xFE00,0x0B00,0x1900,0x2600,0x3400,0x4100,0x4F00,0x5C00}; |
| 44 | 44 | |
| 45 | 45 | /* K4 is (4-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ |
| 46 | 46 | |
| 47 | ||
| 47 | ||
| 48 | 48 | (short)0xAE00,(short)0xBC00,(short)0xCA00,(short)0xD800,(short)0xE600,(short)0xF400,0x0100,0x0F00, |
| 49 | 49 | 0x1D00,0x2B00,0x3900,0x4700,0x5500,0x6300,0x7100,0x7E00}; |
| 50 | 50 | |
| 51 | 51 | /* K5 is (4-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ |
| 52 | 52 | |
| 53 | ||
| 53 | ||
| 54 | 54 | (short)0xAE00,(short)0xBA00,(short)0xC500,(short)0xD100,(short)0xDD00,(short)0xE800,(short)0xF400,(short)0xFF00, |
| 55 | 55 | 0x0B00,0x1700,0x2200,0x2E00,0x3900,0x4500,0x5100,0x5C00}; |
| 56 | 56 | |
| 57 | 57 | /* K6 is (4-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ |
| 58 | 58 | |
| 59 | ||
| 59 | ||
| 60 | 60 | (short)0xC000,(short)0xCB00,(short)0xD600,(short)0xE100,(short)0xEC00,(short)0xF700,0x0300,0x0E00, |
| 61 | 61 | 0x1900,0x2400,0x2F00,0x3A00,0x4500,0x5000,0x5B00,0x6600}; |
| 62 | 62 | |
| 63 | 63 | /* K7 is (4-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ |
| 64 | 64 | |
| 65 | ||
| 65 | ||
| 66 | 66 | (short)0xB300,(short)0xBF00,(short)0xCB00,(short)0xD700,(short)0xE300,(short)0xEF00,(short)0xFB00,0x0700, |
| 67 | 67 | 0x1300,0x1F00,0x2B00,0x3700,0x4300,0x4F00,0x5A00,0x6600}; |
| 68 | 68 | |
| 69 | 69 | /* K8 is (3-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ |
| 70 | 70 | |
| 71 | ||
| 71 | ||
| 72 | 72 | (short)0xC000,(short)0xD800,(short)0xF000,0x0700,0x1F00,0x3700,0x4F00,0x6600}; |
| 73 | 73 | |
| 74 | 74 | /* K9 is (3-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ |
| 75 | 75 | |
| 76 | ||
| 76 | ||
| 77 | 77 | (short)0xC000,(short)0xD400,(short)0xE800,(short)0xFC00,0x1000,0x2500,0x3900,0x4D00}; |
| 78 | 78 | |
| 79 | 79 | /* K10 is (3-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ |
| 80 | 80 | |
| 81 | ||
| 81 | ||
| 82 | 82 | (short)0xCD00,(short)0xDF00,(short)0xF100,0x0400,0x1600,0x2000,0x3B00,0x4D00}; |
| 83 | 83 | |
| 84 | 84 | /* chirp table */ |
| r1877 | r1878 | |
|---|---|---|
| 7 | 7 | #include <math.h> |
| 8 | 8 | |
| 9 | 9 | #include "sndintrf.h" |
| 10 | #include "deprecat.h" | |
| 10 | 11 | #include "streams.h" |
| 11 | 12 | #include "ym2151.h" |
| 12 | 13 | |
| r1877 | r1878 | |
| 165 | 166 | UINT32 noise_tab[32]; /* 17bit Noise Generator periods */ |
| 166 | 167 | |
| 167 | 168 | void (*irqhandler)(int irq); /* IRQ function handler */ |
| 168 | write8_ | |
| 169 | write8_machin | |
| 169 | 170 | |
| 170 | 171 | unsigned int clock; /* chip clock in Hz (passed from 2151intf.c) */ |
| 171 | 172 | unsigned int sampfreq; /* sampling frequency in Hz (passed from 2151intf.c) */ |
| r1877 | r1878 | |
| 1195 | 1196 | case 0x1b: /* CT2, CT1, LFO waveform */ |
| 1196 | 1197 | chip->ct = v >> 6; |
| 1197 | 1198 | chip->lfo_wsel = v & 3; |
| 1198 | if (chip->porthandler) (*chip->porthandler)(0 , chip->ct ); | |
| 1199 | if (chip->porthandler) (*chip->porthandler)(Machine, 0 , chip->ct ); | |
| 1199 | 1200 | break; |
| 1200 | 1201 | |
| 1201 | 1202 | default: |
| r1877 | r1878 | |
| 2497 | 2498 | PSG->irqhandler = handler; |
| 2498 | 2499 | } |
| 2499 | 2500 | |
| 2500 | void YM2151SetPortWriteHandler(void *chip, write8_ | |
| 2501 | void YM2151SetPortWriteHandler(void *chip, write8_machin | |
| 2501 | 2502 | { |
| 2502 | 2503 | YM2151 *PSG = chip; |
| 2503 | 2504 | PSG->porthandler = handler; |
| r1877 | r1878 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | struct AY8910interface |
| 20 | 20 | { |
| 21 | read8_handler portAread; | |
| 22 | read8_handler portBread; | |
| 23 | write8_handler portAwrite; | |
| 24 | write8_handler portBwrite; | |
| 21 | read8_machine_func portAread; | |
| 22 | read8_machine_func portBread; | |
| 23 | write8_machine_func portAwrite; | |
| 24 | write8_machine_func portBwrite; | |
| 25 | 25 | }; |
| 26 | 26 | |
| 27 | 27 | void AY8910_set_volume(int chip,int channel,int volume); |
| r1877 | r1878 | |
| 78 | 78 | /*********** An interface for SSG of YM2203 ***********/ |
| 79 | 79 | |
| 80 | 80 | void *ay8910_start_ym(sound_type chip_type, int sndindex, int clock, int streams, |
| 81 | read8_handler portAread, read8_handler portBread, | |
| 82 | write8_handler portAwrite, write8_handler portBwrite); | |
| 81 | read8_machine_func portAread, read8_machine_func portBread, | |
| 82 | write8_machine_func portAwrite, write8_machine_func portBwrite); | |
| 83 | 83 | |
| 84 | 84 | void ay8910_stop_ym(void *chip); |
| 85 | 85 | void ay8910_reset_ym(void *chip); |
| r1877 | r1878 | |
|---|---|---|
| 79 | 79 | void YM2151SetIrqHandler(void *chip, void (*handler)(int irq)); |
| 80 | 80 | |
| 81 | 81 | /* set port write handler on YM2151 chip number 'n'*/ |
| 82 | void YM2151SetPortWriteHandler(void *chip, write8_ | |
| 82 | void YM2151SetPortWriteHandler(void *chip, write8_machin | |
| 83 | 83 | |
| 84 | 84 | /* refresh chip when load state */ |
| 85 | 85 | void YM2151Postload(void *chip); |
| r1877 | r1878 | |
|---|---|---|
| 712 | 712 | break; |
| 713 | 713 | case 0x6: |
| 714 | 714 | case 0x7: |
| 715 | SCSP_MidiIn(0, SCSP->udata.data[0x6/2]&0xff, 0); | |
| 715 | SCSP_MidiIn(Machine, 0, SCSP->udata.data[0x6/2]&0xff, 0); | |
| 716 | 716 | break; |
| 717 | 717 | case 0x12: |
| 718 | 718 | case 0x13: |
| r1877 | r1878 | |
|---|---|---|
| 158 | 158 | #define DSD_555_ASTBL__C (*(node->input[3])) |
| 159 | 159 | #define DSD_555_ASTBL__CTRLV (*(node->input[4])) |
| 160 | 160 | |
| 161 | void dsd_555_astbl_step(node_description *node) | |
| 161 | static void dsd_555_astbl_step(node_description *node) | |
| 162 | 162 | { |
| 163 | 163 | const discrete_555_desc *info = node->custom; |
| 164 | 164 | struct dsd_555_astbl_context *context = node->context; |
| r1877 | r1878 | |
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | void dsd_555_astbl_reset(node_description *node) | |
| 341 | static void dsd_555_astbl_reset(node_description *node) | |
| 342 | 342 | { |
| 343 | 343 | const discrete_555_desc *info = node->custom; |
| 344 | 344 | struct dsd_555_astbl_context *context = node->context; |
| r1877 | r1878 | |
| 399 | 399 | #define DSD_555_MSTBL__R (*(node->input[2])) |
| 400 | 400 | #define DSD_555_MSTBL__C (*(node->input[3])) |
| 401 | 401 | |
| 402 | void dsd_555_mstbl_step(node_description *node) | |
| 402 | static void dsd_555_mstbl_step(node_description *node) | |
| 403 | 403 | { |
| 404 | 404 | const discrete_555_desc *info = node->custom; |
| 405 | 405 | struct dsd_555_mstbl_context *context = node->context; |
| r1877 | r1878 | |
| 485 | 485 | } |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | void dsd_555_mstbl_reset(node_description *node) | |
| 488 | static void dsd_555_mstbl_reset(node_description *node) | |
| 489 | 489 | { |
| 490 | 490 | const discrete_555_desc *info = node->custom; |
| 491 | 491 | struct dsd_555_mstbl_context *context = node->context; |
| r1877 | r1878 | |
| 542 | 542 | #define DSD_555_CC__RGND (*(node->input[5])) |
| 543 | 543 | #define DSD_555_CC__RDIS (*(node->input[6])) |
| 544 | 544 | |
| 545 | void dsd_555_cc_step(node_description *node) | |
| 545 | static void dsd_555_cc_step(node_description *node) | |
| 546 | 546 | { |
| 547 | 547 | const discrete_555_cc_desc *info = node->custom; |
| 548 | 548 | struct dsd_555_cc_context *context = node->context; |
| r1877 | r1878 | |
| 814 | 814 | } |
| 815 | 815 | } |
| 816 | 816 | |
| 817 | void dsd_555_cc_reset(node_description *node) | |
| 817 | static void dsd_555_cc_reset(node_description *node) | |
| 818 | 818 | { |
| 819 | 819 | const discrete_555_cc_desc *info = node->custom; |
| 820 | 820 | struct dsd_555_cc_context *context = node->context; |
| r1877 | r1878 | |
| 999 | 999 | #define DSD_555_VCO1__VIN1 (*(node->input[1])) |
| 1000 | 1000 | #define DSD_555_VCO1__VIN2 (*(node->input[2])) |
| 1001 | 1001 | |
| 1002 | void dsd_555_vco1_step(node_description *node) | |
| 1002 | static void dsd_555_vco1_step(node_description *node) | |
| 1003 | 1003 | { |
| 1004 | 1004 | const discrete_555_vco1_desc *info = node->custom; |
| 1005 | 1005 | struct dsd_555_vco1_context *context = node->context; |
| r1877 | r1878 | |
| 1150 | 1150 | } |
| 1151 | 1151 | } |
| 1152 | 1152 | |
| 1153 | void dsd_555_vco1_reset(node_description *node) | |
| 1153 | static void dsd_555_vco1_reset(node_description *node) | |
| 1154 | 1154 | { |
| 1155 | 1155 | const discrete_555_vco1_desc *info = node->custom; |
| 1156 | 1156 | struct dsd_555_vco1_context *context = node->context; |
| r1877 | r1878 | |
| 1228 | 1228 | #define DSD_566__R (*(node->input[2])) |
| 1229 | 1229 | #define DSD_566__C (*(node->input[3])) |
| 1230 | 1230 | |
| 1231 | void dsd_566_step(node_description *node) | |
| 1231 | static void dsd_566_step(node_description *node) | |
| 1232 | 1232 | { |
| 1233 | 1233 | const discrete_566_desc *info = node->custom; |
| 1234 | 1234 | struct dsd_566_context *context = node->context; |
| r1877 | r1878 | |
| 1338 | 1338 | node->output = 0; |
| 1339 | 1339 | } |
| 1340 | 1340 | |
| 1341 | void dsd_566_reset(node_description *node) | |
| 1341 | static void dsd_566_reset(node_description *node) | |
| 1342 | 1342 | { |
| 1343 | 1343 | const discrete_566_desc *info = node->custom; |
| 1344 | 1344 | struct dsd_566_context *context = node->context; |
| r1877 | r1878 | |
| 1404 | 1404 | #define LS624_F1(x) (0.19 + 20.0/90.0*(x)) |
| 1405 | 1405 | #define LS624_T(_C, _R, _F) (-600.0 * (_C) * log(1.0-LS624_F1(_R)*0.12/LS624_F1(_F))) |
| 1406 | 1406 | |
| 1407 | void dsd_ls624_step(node_description *node) | |
| 1407 | static void dsd_ls624_step(node_description *node) | |
| 1408 | 1408 | { |
| 1409 | 1409 | struct dsd_ls624_context *context = node->context; |
| 1410 | 1410 | |
| r1877 | r1878 | |
| 1452 | 1452 | node->output = 0; |
| 1453 | 1453 | } |
| 1454 | 1454 | |
| 1455 | void dsd_ls624_reset(node_description *node) | |
| 1455 | static void dsd_ls624_reset(node_description *node) | |
| 1456 | 1456 | { |
| 1457 | 1457 | struct dsd_ls624_context *context = node->context; |
| 1458 | 1458 |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | |
| 6 | 6 | struct YM2608interface |
| 7 | 7 | { |
| 8 | read8_handler portAread; | |
| 9 | read8_handler portBread; | |
| 10 | write8_handler portAwrite; | |
| 11 | write8_handler portBwrite; | |
| 8 | read8_machine_func portAread; | |
| 9 | read8_machine_func portBread; | |
| 10 | write8_machine_func portAwrite; | |
| 11 | write8_machine_func portBwrite; | |
| 12 | 12 | void ( *handler )( int irq ); /* IRQ handler for the YM2608 */ |
| 13 | 13 | int pcmrom; /* Delta-T memory region ram/rom */ |
| 14 | 14 | }; |
| r1877 | r1878 | |
|---|---|---|
| 177 | 177 | |
| 178 | 178 | static const int disc_7492_count[6] = {0x00, 0x01, 0x02, 0x04, 0x05, 0x06}; |
| 179 | 179 | |
| 180 | void dss_counter_step(node_description *node) | |
| 180 | static void dss_counter_step(node_description *node) | |
| 181 | 181 | { |
| 182 | 182 | struct dss_counter_context *context = node->context; |
| 183 | 183 | double cycles; |
| r1877 | r1878 | |
| 267 | 267 | node->output = context->count; |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | void dss_counter_reset(node_description *node) | |
| 270 | static void dss_counter_reset(node_description *node) | |
| 271 | 271 | { |
| 272 | 272 | struct dss_counter_context *context = node->context; |
| 273 | 273 | |
| r1877 | r1878 | |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | /* reset prototype so that it can be used in init function */ |
| 376 | void dss_lfsr_reset(node_description *node); | |
| 376 | static void dss_lfsr_reset(node_description *node); | |
| 377 | 377 | |
| 378 | void dss_lfsr_step(node_description *node) | |
| 378 | static void dss_lfsr_step(node_description *node) | |
| 379 | 379 | { |
| 380 | 380 | const discrete_lfsr_desc *lfsr_desc = node->custom; |
| 381 | 381 | struct dss_lfsr_context *context = node->context; |
| r1877 | r1878 | |
| 465 | 465 | } |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | void dss_lfsr_reset(node_description *node) | |
| 468 | static void dss_lfsr_reset(node_description *node) | |
| 469 | 469 | { |
| 470 | 470 | const discrete_lfsr_desc *lfsr_desc = node->custom; |
| 471 | 471 | struct dss_lfsr_context *context = node->context; |
| r1877 | r1878 | |
| 519 | 519 | #define DSS_NOISE__AMP (*(node->input[2])) |
| 520 | 520 | #define DSS_NOISE__BIAS (*(node->input[3])) |
| 521 | 521 | |
| 522 | void dss_noise_step(node_description *node) | |
| 522 | static void dss_noise_step(node_description *node) | |
| 523 | 523 | { |
| 524 | 524 | struct dss_noise_context *context = node->context; |
| 525 | 525 | |
| r1877 | r1878 | |
| 556 | 556 | } |
| 557 | 557 | |
| 558 | 558 | |
| 559 | void dss_noise_reset(node_description *node) | |
| 559 | static void dss_noise_reset(node_description *node) | |
| 560 | 560 | { |
| 561 | 561 | struct dss_noise_context *context = node->context; |
| 562 | 562 | |
| r1877 | r1878 | |
| 585 | 585 | #define DSS_NOTE__MAX2 (*(node->input[4])) |
| 586 | 586 | #define DSS_NOTE__CLOCK_TYPE (*(node->input[5])) |
| 587 | 587 | |
| 588 | void dss_note_step(node_description *node) | |
| 588 | static void dss_note_step(node_description *node) | |
| 589 | 589 | { |
| 590 | 590 | struct dss_note_context *context = node->context; |
| 591 | 591 | |
| r1877 | r1878 | |
| 671 | 671 | node->output = 0; |
| 672 | 672 | } |
| 673 | 673 | |
| 674 | void dss_note_reset(node_description *node) | |
| 674 | static void dss_note_reset(node_description *node) | |
| 675 | 675 | { |
| 676 | 676 | struct dss_note_context *context = node->context; |
| 677 | 677 | |
| r1877 | r1878 | |
| 709 | 709 | /* the same to save a calculation step */ |
| 710 | 710 | #define DSS_OP_AMP_OSC_NORTON_VP_IN context->high_out_V |
| 711 | 711 | |
| 712 | void dss_op_amp_osc_step(node_description *node) | |
| 712 | static void dss_op_amp_osc_step(node_description *node) | |
| 713 | 713 | { |
| 714 | 714 | const discrete_op_amp_osc_info *info = node->custom; |
| 715 | 715 | struct dss_op_amp_osc_context *context = node->context; |
| r1877 | r1878 | |
| 881 | 881 | } |
| 882 | 882 | } |
| 883 | 883 | |
| 884 | void dss_op_amp_osc_reset(node_description *node) | |
| 884 | static void dss_op_amp_osc_reset(node_description *node) | |
| 885 | 885 | { |
| 886 | 886 | const discrete_op_amp_osc_info *info = node->custom; |
| 887 | 887 | struct dss_op_amp_osc_context *context = node->context; |
| r1877 | r1878 | |
| 1024 | 1024 | #define DSS_SAWTOOTHWAVE__GRAD (*(node->input[4])) |
| 1025 | 1025 | #define DSS_SAWTOOTHWAVE__PHASE (*(node->input[5])) |
| 1026 | 1026 | |
| 1027 | void dss_sawtoothwave_step(node_description *node) | |
| 1027 | static void dss_sawtoothwave_step(node_description *node) | |
| 1028 | 1028 | { |
| 1029 | 1029 | struct dss_sawtoothwave_context *context = node->context; |
| 1030 | 1030 | |
| r1877 | r1878 | |
| 1050 | 1050 | context->phase=fmod((context->phase+((2.0*M_PI*DSS_SAWTOOTHWAVE__FREQ)/discrete_current_context->sample_rate)),2.0*M_PI); |
| 1051 | 1051 | } |
| 1052 | 1052 | |
| 1053 | void dss_sawtoothwave_reset(node_description *node) | |
| 1053 | static void dss_sawtoothwave_reset(node_description *node) | |
| 1054 | 1054 | { |
| 1055 | 1055 | struct dss_sawtoothwave_context *context = node->context; |
| 1056 | 1056 | double start; |
| r1877 | r1878 | |
| 1084 | 1084 | #define DSS_SCHMITT_OSC__VIN (*(node->input[1])) |
| 1085 | 1085 | #define DSS_SCHMITT_OSC__AMP (*(node->input[2])) |
| 1086 | 1086 | |
| 1087 | void dss_schmitt_osc_step(node_description *node) | |
| 1087 | static void dss_schmitt_osc_step(node_description *node) | |
| 1088 | 1088 | { |
| 1089 | 1089 | const discrete_schmitt_osc_desc *info = node->custom; |
| 1090 | 1090 | struct dss_schmitt_osc_context *context = node->context; |
| r1877 | r1878 | |
| 1158 | 1158 | node->output *= DSS_SCHMITT_OSC__AMP; |
| 1159 | 1159 | } |
| 1160 | 1160 | |
| 1161 | void dss_schmitt_osc_reset(node_description *node) | |
| 1161 | static void dss_schmitt_osc_reset(node_description *node) | |
| 1162 | 1162 | { |
| 1163 | 1163 | const discrete_schmitt_osc_desc *info = node->custom; |
| 1164 | 1164 | struct dss_schmitt_osc_context *context = node->context; |
| r1877 | r1878 | |
| 1204 | 1204 | #define DSS_SINEWAVE__BIAS (*(node->input[3])) |
| 1205 | 1205 | #define DSS_SINEWAVE__PHASE (*(node->input[4])) |
| 1206 | 1206 | |
| 1207 | void dss_sinewave_step(node_description *node) | |
| 1207 | static void dss_sinewave_step(node_description *node) | |
| 1208 | 1208 | { |
| 1209 | 1209 | struct dss_sinewave_context *context = node->context; |
| 1210 | 1210 | |
| r1877 | r1878 | |
| 1230 | 1230 | context->phase=fmod((context->phase+((2.0*M_PI*DSS_SINEWAVE__FREQ)/discrete_current_context->sample_rate)),2.0*M_PI); |
| 1231 | 1231 | } |
| 1232 | 1232 | |
| 1233 | void dss_sinewave_reset(node_description *node) | |
| 1233 | static void dss_sinewave_reset(node_description *node) | |
| 1234 | 1234 | { |
| 1235 | 1235 | struct dss_sinewave_context *context = node->context; |
| 1236 | 1236 | double start; |
| r1877 | r1878 | |
| 1263 | 1263 | #define DSS_SQUAREWAVE__BIAS (*(node->input[4])) |
| 1264 | 1264 | #define DSS_SQUAREWAVE__PHASE (*(node->input[5])) |
| 1265 | 1265 | |
| 1266 | void dss_squarewave_step(node_description *node) | |
| 1266 | static void dss_squarewave_step(node_description *node) | |
| 1267 | 1267 | { |
| 1268 | 1268 | struct dss_squarewave_context *context = node->context; |
| 1269 | 1269 | |
| r1877 | r1878 | |
| 1296 | 1296 | context->phase=fmod((context->phase+((2.0*M_PI*DSS_SQUAREWAVE__FREQ)/discrete_current_context->sample_rate)),2.0*M_PI); |
| 1297 | 1297 | } |
| 1298 | 1298 | |
| 1299 | void dss_squarewave_reset(node_description *node) | |
| 1299 | static void dss_squarewave_reset(node_description *node) | |
| 1300 | 1300 | { |
| 1301 | 1301 | struct dss_squarewave_context *context = node->context; |
| 1302 | 1302 | double start; |
| r1877 | r1878 | |
| 1329 | 1329 | #define DSS_SQUAREWFIX__BIAS (*(node->input[4])) |
| 1330 | 1330 | #define DSS_SQUAREWFIX__PHASE (*(node->input[5])) |
| 1331 | 1331 | |
| 1332 | void dss_squarewfix_step(node_description *node) | |
| 1332 | static void dss_squarewfix_step(node_description *node) | |
| 1333 | 1333 | { |
| 1334 | 1334 | struct dss_squarewfix_context *context = node->context; |
| 1335 | 1335 | |
| r1877 | r1878 | |
| 1358 | 1358 | } |
| 1359 | 1359 | } |
| 1360 | 1360 | |
| 1361 | void dss_squarewfix_reset(node_description *node) | |
| 1361 | static void dss_squarewfix_reset(node_description *node) | |
| 1362 | 1362 | { |
| 1363 | 1363 | struct dss_squarewfix_context *context = node->context; |
| 1364 | 1364 | |
| r1877 | r1878 | |
| 1407 | 1407 | #define DSS_SQUAREWAVE2__BIAS (*(node->input[4])) |
| 1408 | 1408 | #define DSS_SQUAREWAVE2__SHIFT (*(node->input[5])) |
| 1409 | 1409 | |
| 1410 | void dss_squarewave2_step(node_description *node) | |
| 1410 | static void dss_squarewave2_step(node_description *node) | |
| 1411 | 1411 | { |
| 1412 | 1412 | struct dss_squarewave_context *context = node->context; |
| 1413 | 1413 | double newphase; |
| r1877 | r1878 | |
| 1442 | 1442 | } |
| 1443 | 1443 | } |
| 1444 | 1444 | |
| 1445 | void dss_squarewave2_reset(node_description *node) | |
| 1445 | static void dss_squarewave2_reset(node_description *node) | |
| 1446 | 1446 | { |
| 1447 | 1447 | struct dss_squarewave_context *context = node->context; |
| 1448 | 1448 | double start; |
| r1877 | r1878 | |
| 1490 | 1490 | return info->vB; |
| 1491 | 1491 | } |
| 1492 | 1492 | |
| 1493 | void dss_inverter_osc_step(node_description *node) | |
| 1493 | static void dss_inverter_osc_step(node_description *node) | |
| 1494 | 1494 | { |
| 1495 | 1495 | struct dss_inverter_osc_context *context = node->context; |
| 1496 | 1496 | const discrete_inverter_osc_desc *info = node->custom; |
| r1877 | r1878 | |
| 1596 | 1596 | node->output = (node->output > info->vInFall); |
| 1597 | 1597 | } |
| 1598 | 1598 | |
| 1599 | void dss_inverter_osc_reset(node_description *node) | |
| 1599 | static void dss_inverter_osc_reset(node_description *node) | |
| 1600 | 1600 | { |
| 1601 | 1601 | struct dss_inverter_osc_context *context = node->context; |
| 1602 | 1602 | const discrete_inverter_osc_desc *info = node->custom; |
| r1877 | r1878 | |
| 1633 | 1633 | #define DSS_TRIANGLEWAVE__BIAS (*(node->input[3])) |
| 1634 | 1634 | #define DSS_TRIANGLEWAVE__PHASE (*(node->input[4])) |
| 1635 | 1635 | |
| 1636 | void dss_trianglewave_step(node_description *node) | |
| 1636 | static void dss_trianglewave_step(node_description *node) | |
| 1637 | 1637 | { |
| 1638 | 1638 | struct dss_trianglewave_context *context = node->context; |
| 1639 | 1639 | |
| r1877 | r1878 | |
| 1660 | 1660 | context->phase=fmod((context->phase+((2.0*M_PI*DSS_TRIANGLEWAVE__FREQ)/discrete_current_context->sample_rate)),2.0*M_PI); |
| 1661 | 1661 | } |
| 1662 | 1662 | |
| 1663 | void dss_trianglewave_reset(node_description *node) | |
| 1663 | static void dss_trianglewave_reset(node_description *node) | |
| 1664 | 1664 | { |
| 1665 | 1665 | struct dss_trianglewave_context *context = node->context; |
| 1666 | 1666 | double start; |
| r1877 | r1878 | |
| 1686 | 1686 | ************************************************************************/ |
| 1687 | 1687 | #define DSS_ADSR__ENABLE (*(node->input[0])) |
| 1688 | 1688 | |
| 1689 | void dss_adsrenv_step(node_description *node) | |
| 1689 | static void dss_adsrenv_step(node_description *node) | |
| 1690 | 1690 | { |
| 1691 | 1691 | // struct dss_adsr_context *context = node->context; |
| 1692 | 1692 | |
| r1877 | r1878 | |
| 1701 | 1701 | } |
| 1702 | 1702 | |
| 1703 | 1703 | |
| 1704 | void dss_adsrenv_reset(node_description *node) | |
| 1704 | static void dss_adsrenv_reset(node_description *node) | |
| 1705 | 1705 | { |
| 1706 | 1706 | dss_adsrenv_step(node); |
| 1707 | 1707 | } |
| r1877 | r1878 | |
|---|---|---|
| 135 | 135 | WRITE8_HANDLER( YM2151_word_0_w ) |
| 136 | 136 | { |
| 137 | 137 | if (offset) |
| 138 | YM2151_data_port_0_w(0,data); | |
| 138 | YM2151_data_port_0_w(machine,0,data); | |
| 139 | 139 | else |
| 140 | YM2151_register_port_0_w(0,data); | |
| 140 | YM2151_register_port_0_w(machine,0,data); | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | WRITE8_HANDLER( YM2151_word_1_w ) |
| 144 | 144 | { |
| 145 | 145 | if (offset) |
| 146 | YM2151_data_port_1_w(0,data); | |
| 146 | YM2151_data_port_1_w(machine,0,data); | |
| 147 | 147 | else |
| 148 | YM2151_register_port_1_w(0,data); | |
| 148 | YM2151_register_port_1_w(machine,0,data); | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | READ16_HANDLER( YM2151_status_port_0_lsb_r ) |
| 152 | 152 | { |
| 153 | return YM2151_status_port_0_r(0); | |
| 153 | return YM2151_status_port_0_r(machine,0); | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | READ16_HANDLER( YM2151_status_port_1_lsb_r ) |
| 157 | 157 | { |
| 158 | return YM2151_status_port_1_r(0); | |
| 158 | return YM2151_status_port_1_r(machine,0); | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | READ16_HANDLER( YM2151_status_port_2_lsb_r ) |
| 162 | 162 | { |
| 163 | return YM2151_status_port_2_r(0); | |
| 163 | return YM2151_status_port_2_r(machine,0); | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | |
| 167 | 167 | WRITE16_HANDLER( YM2151_register_port_0_lsb_w ) |
| 168 | 168 | { |
| 169 | 169 | if (ACCESSING_LSB) |
| 170 | YM2151_register_port_0_w(0, data & 0xff); | |
| 170 | YM2151_register_port_0_w(machine, 0, data & 0xff); | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | WRITE16_HANDLER( YM2151_register_port_1_lsb_w ) |
| 174 | 174 | { |
| 175 | 175 | if (ACCESSING_LSB) |
| 176 | YM2151_register_port_1_w(0, data & 0xff); | |
| 176 | YM2151_register_port_1_w(machine, 0, data & 0xff); | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | WRITE16_HANDLER( YM2151_register_port_2_lsb_w ) |
| 180 | 180 | { |
| 181 | 181 | if (ACCESSING_LSB) |
| 182 | YM2151_register_port_2_w(0, data & 0xff); | |
| 182 | YM2151_register_port_2_w(machine, 0, data & 0xff); | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | WRITE16_HANDLER( YM2151_data_port_0_lsb_w ) |
| 186 | 186 | { |
| 187 | 187 | if (ACCESSING_LSB) |
| 188 | YM2151_data_port_0_w(0, data & 0xff); | |
| 188 | YM2151_data_port_0_w(machine, 0, data & 0xff); | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | WRITE16_HANDLER( YM2151_data_port_1_lsb_w ) |
| 192 | 192 | { |
| 193 | 193 | if (ACCESSING_LSB) |
| 194 | YM2151_data_port_1_w(0, data & 0xff); | |
| 194 | YM2151_data_port_1_w(machine, 0, data & 0xff); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | WRITE16_HANDLER( YM2151_data_port_2_lsb_w ) |
| 198 | 198 | { |
| 199 | 199 | if (ACCESSING_LSB) |
| 200 | YM2151_data_port_2_w(0, data & 0xff); | |
| 200 | YM2151_data_port_2_w(machine, 0, data & 0xff); | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 |
| r1877 | r1878 | |
|---|---|---|
| 429 | 429 | WRITE16_HANDLER( K053260_0_lsb_w ) |
| 430 | 430 | { |
| 431 | 431 | if (ACCESSING_LSB) |
| 432 | K053260_0_w (offset, data & 0xff); | |
| 432 | K053260_0_w (machine, offset, data & 0xff); | |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | READ16_HANDLER( K053260_0_lsb_r ) |
| 436 | 436 | { |
| 437 | return K053260_0_r(offset); | |
| 437 | return K053260_0_r(machine, offset); | |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | WRITE16_HANDLER( K053260_1_lsb_w ) |
| 441 | 441 | { |
| 442 | 442 | if (ACCESSING_LSB) |
| 443 | K053260_1_w (offset, data & 0xff); | |
| 443 | K053260_1_w (machine, offset, data & 0xff); | |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | READ16_HANDLER( K053260_1_lsb_r ) |
| 447 | 447 | { |
| 448 | return K053260_1_r(offset); | |
| 448 | return K053260_1_r(machine, offset); | |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 |
| r1877 | r1878 | |
|---|---|---|
| 139 | 139 | WRITE8_HANDLER( YM2413_data_port_2_w ) { struct ym2413_info *info = sndti_token(SOUND_YM2413, 2); YM2413Write (info->chip, 1, data); } /* 3rd chip */ |
| 140 | 140 | WRITE8_HANDLER( YM2413_data_port_3_w ) { struct ym2413_info *info = sndti_token(SOUND_YM2413, 3); YM2413Write (info->chip, 1, data); } /* 4th chip */ |
| 141 | 141 | |
| 142 | WRITE16_HANDLER( YM2413_register_port_0_lsb_w ) { if (ACCESSING_LSB) YM2413_register_port_0_w(offset,data & 0xff); } | |
| 143 | WRITE16_HANDLER( YM2413_register_port_0_msb_w ) { if (ACCESSING_MSB) YM2413_register_port_0_w(offset,((data & 0xff00) >> 8)); } | |
| 144 | WRITE16_HANDLER( YM2413_register_port_1_lsb_w ) { if (ACCESSING_LSB) YM2413_register_port_1_w(offset,data & 0xff); } | |
| 145 | WRITE16_HANDLER( YM2413_register_port_2_lsb_w ) { if (ACCESSING_LSB) YM2413_register_port_2_w(offset,data & 0xff); } | |
| 146 | WRITE16_HANDLER( YM2413_register_port_3_lsb_w ) { if (ACCESSING_LSB) YM2413_register_port_3_w(offset,data & 0xff); } | |
| 147 | WRITE16_HANDLER( YM2413_data_port_0_lsb_w ) { if (ACCESSING_LSB) YM2413_data_port_0_w(offset,data & 0xff); } | |
| 148 | WRITE16_HANDLER( YM2413_data_port_0_msb_w ) { if (ACCESSING_MSB) YM2413_data_port_0_w(offset,((data & 0xff00) >> 8)); } | |
| 149 | WRITE16_HANDLER( YM2413_data_port_1_lsb_w ) { if (ACCESSING_LSB) YM2413_data_port_1_w(offset,data & 0xff); } | |
| 150 | WRITE16_HANDLER( YM2413_data_port_2_lsb_w ) { if (ACCESSING_LSB) YM2413_data_port_2_w(offset,data & 0xff); } | |
| 151 | WRITE16_HANDLER( YM2413_data_port_3_lsb_w ) { if (ACCESSING_LSB) YM2413_data_port_3_w(offset,data & 0xff); } | |
| 142 | WRITE16_HANDLER( YM2413_register_port_0_lsb_w ) { if (ACCESSING_LSB) YM2413_register_port_0_w(machine,offset,data & 0xff); } | |
| 143 | WRITE16_HANDLER( YM2413_register_port_0_msb_w ) { if (ACCESSING_MSB) YM2413_register_port_0_w(machine,offset,((data & 0xff00) >> 8)); } | |
| 144 | WRITE16_HANDLER( YM2413_register_port_1_lsb_w ) { if (ACCESSING_LSB) YM2413_register_port_1_w(machine,offset,data & 0xff); } | |
| 145 | WRITE16_HANDLER( YM2413_register_port_2_lsb_w ) { if (ACCESSING_LSB) YM2413_register_port_2_w(machine,offset,data & 0xff); } | |
| 146 | WRITE16_HANDLER( YM2413_register_port_3_lsb_w ) { if (ACCESSING_LSB) YM2413_register_port_3_w(machine,offset,data & 0xff); } | |
| 147 | WRITE16_HANDLER( YM2413_data_port_0_lsb_w ) { if (ACCESSING_LSB) YM2413_data_port_0_w(machine,offset,data & 0xff); } | |
| 148 | WRITE16_HANDLER( YM2413_data_port_0_msb_w ) { if (ACCESSING_MSB) YM2413_data_port_0_w(machine,offset,((data & 0xff00) >> 8)); } | |
| 149 | WRITE16_HANDLER( YM2413_data_port_1_lsb_w ) { if (ACCESSING_LSB) YM2413_data_port_1_w(machine,offset,data & 0xff); } | |
| 150 | WRITE16_HANDLER( YM2413_data_port_2_lsb_w ) { if (ACCESSING_LSB) YM2413_data_port_2_w(machine,offset,data & 0xff); } | |
| 151 | WRITE16_HANDLER( YM2413_data_port_3_lsb_w ) { if (ACCESSING_LSB) YM2413_data_port_3_w(machine,offset,data & 0xff); } | |
| 152 | 152 | |
| 153 | 153 | |
| 154 | 154 | /************************************************************************** |
| r1877 | r1878 | |
|---|---|---|
| 4 | 4 | struct YM2151interface |
| 5 | 5 | { |
| 6 | 6 | void (*irqhandler)(int irq); |
| 7 | write8_ | |
| 7 | write8_machin | |
| 8 | 8 | }; |
| 9 | 9 | |
| 10 | 10 | READ8_HANDLER( YM2151_status_port_0_r ); |
| r1877 | r1878 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | struct K053260_interface { |
| 10 | 10 | int region; /* memory region of sample ROM(s) */ |
| 11 | timer_c | |
| 11 | timer_fired_func | |
| 12 | 12 | }; |
| 13 | 13 | |
| 14 | 14 |
| r1877 | r1878 | |
|---|---|---|
| 109 | 109 | #define DST_CRFILTER__C (*(node->input[3])) |
| 110 | 110 | #define DST_CRFILTER__VREF (*(node->input[4])) |
| 111 | 111 | |
| 112 | void dst_crfilter_step(node_description *node) | |
| 112 | static void dst_crfilter_step(node_description *node) | |
| 113 | 113 | { |
| 114 | 114 | struct dst_rcfilter_context *context = node->context; |
| 115 | 115 | |
| r1877 | r1878 | |
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | void dst_crfilter_reset(node_description *node) | |
| 127 | static void dst_crfilter_reset(node_description *node) | |
| 128 | 128 | { |
| 129 | 129 | struct dst_rcfilter_context *context = node->context; |
| 130 | 130 | |
| r1877 | r1878 | |
| 177 | 177 | } |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | void dst_filter1_step(node_description *node) | |
| 180 | static void dst_filter1_step(node_description *node) | |
| 181 | 181 | { |
| 182 | 182 | struct dss_filter1_context *context = node->context; |
| 183 | 183 | double gain = 1.0; |
| r1877 | r1878 | |
| 193 | 193 | context->y1 = node->output; |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | void dst_filter1_reset(node_description *node) | |
| 196 | static void dst_filter1_reset(node_description *node) | |
| 197 | 197 | { |
| 198 | 198 | struct dss_filter1_context *context = node->context; |
| 199 | 199 | |
| r1877 | r1878 | |
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | void dst_filter2_step(node_description *node) | |
| 264 | static void dst_filter2_step(node_description *node) | |
| 265 | 265 | { |
| 266 | 266 | struct dss_filter2_context *context = node->context; |
| 267 | 267 | double gain = 1.0; |
| r1877 | r1878 | |
| 280 | 280 | context->y1 = node->output; |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | void dst_filter2_reset(node_description *node) | |
| 283 | static void dst_filter2_reset(node_description *node) | |
| 284 | 284 | { |
| 285 | 285 | struct dss_filter2_context *context = node->context; |
| 286 | 286 | |
| r1877 | r1878 | |
| 309 | 309 | #define DST_OP_AMP_FILT__INP2 (*(node->input[2])) |
| 310 | 310 | #define DST_OP_AMP_FILT__TYPE (*(node->input[3])) |
| 311 | 311 | |
| 312 | void dst_op_amp_filt_step(node_description *node) | |
| 312 | static void dst_op_amp_filt_step(node_description *node) | |
| 313 | 313 | { |
| 314 | 314 | const discrete_op_amp_filt_info *info = node->custom; |
| 315 | 315 | struct dst_op_amp_filt_context *context = node->context; |
| r1877 | r1878 | |
| 392 | 392 | |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | void dst_op_amp_filt_reset(node_description *node) | |
| 395 | static void dst_op_amp_filt_reset(node_description *node) | |
| 396 | 396 | { |
| 397 | 397 | const discrete_op_amp_filt_info *info = node->custom; |
| 398 | 398 | struct dst_op_amp_filt_context *context = node->context; |
| r1877 | r1878 | |
| 514 | 514 | #define DST_RCDISC__R (*(node->input[2])) |
| 515 | 515 | #define DST_RCDISC__C (*(node->input[3])) |
| 516 | 516 | |
| 517 | void dst_rcdisc_step(node_description *node) | |
| 517 | static void dst_rcdisc_step(node_description *node) | |
| 518 | 518 | { |
| 519 | 519 | struct dst_rcdisc_context *context = node->context; |
| 520 | 520 | |
| r1877 | r1878 | |
| 537 | 537 | } |
| 538 | 538 | } |
| 539 | 539 | |
| 540 | void dst_rcdisc_reset(node_description *node) | |
| 540 | static void dst_rcdisc_reset(node_description *node) | |
| 541 | 541 | { |
| 542 | 542 | struct dst_rcdisc_context *context = node->context; |
| 543 | 543 | |
| r1877 | r1878 | |
| 569 | 569 | #define DST_RCDISC2__R1 (*(node->input[4])) |
| 570 | 570 | #define DST_RCDISC2__C (*(node->input[5])) |
| 571 | 571 | |
| 572 | void dst_rcdisc2_step(node_description *node) | |
| 572 | static void dst_rcdisc2_step(node_description *node) | |
| 573 | 573 | { |
| 574 | 574 | double diff; |
| 575 | 575 | struct dst_rcdisc_context *context = node->context; |
| r1877 | r1878 | |
| 582 | 582 | node->output += diff; |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | void dst_rcdisc2_reset(node_description *node) | |
| 585 | static void dst_rcdisc2_reset(node_description *node) | |
| 586 | 586 | { |
| 587 | 587 | struct dst_rcdisc_context *context = node->context; |
| 588 | 588 | |
| r1877 | r1878 | |
| 612 | 612 | #define DST_RCDISC3__R2 (*(node->input[3])) |
| 613 | 613 | #define DST_RCDISC3__C (*(node->input[4])) |
| 614 | 614 | |
| 615 | void dst_rcdisc3_step(node_description *node) | |
| 615 | static void dst_rcdisc3_step(node_description *node) | |
| 616 | 616 | { |
| 617 | 617 | double diff; |
| 618 | 618 | struct dst_rcdisc_context *context = node->context; |
| r1877 | r1878 | |
| 640 | 640 | } |
| 641 | 641 | } |
| 642 | 642 | |
| 643 | void dst_rcdisc3_reset(node_description *node) | |
| 643 | static void dst_rcdisc3_reset(node_description *node) | |
| 644 | 644 | { |
| 645 | 645 | struct dst_rcdisc_context *context = node->context; |
| 646 | 646 | |
| r1877 | r1878 | |
| 675 | 675 | #define DST_RCDISC4__VP (*(node->input[6])) |
| 676 | 676 | #define DST_RCDISC4__TYPE (*(node->input[7])) |
| 677 | 677 | |
| 678 | void dst_rcdisc4_step(node_description *node) | |
| 678 | static void dst_rcdisc4_step(node_description *node) | |
| 679 | 679 | { |
| 680 | 680 | struct dst_rcdisc4_context *context = node->context; |
| 681 | 681 | int inp1 = (DST_RCDISC4__IN == 0) ? 0 : 1; |
| r1877 | r1878 | |
| 700 | 700 | if (node->output < 0) node->output = 0; |
| 701 | 701 | } |
| 702 | 702 | |
| 703 | void dst_rcdisc4_reset(node_description *node) | |
| 703 | static void dst_rcdisc4_reset(node_description *node) | |
| 704 | 704 | { |
| 705 | 705 | struct dst_rcdisc4_context *context = node->context; |
| 706 | 706 | double v, i, r, rT; |
| r1877 | r1878 | |
| 789 | 789 | #define DST_RCDISC5__R (*(node->input[2])) |
| 790 | 790 | #define DST_RCDISC5__C (*(node->input[3])) |
| 791 | 791 | |
| 792 | void dst_rcdisc5_step(node_description *node) | |
| 792 | static void dst_rcdisc5_step(node_description *node) | |
| 793 | 793 | { |
| 794 | 794 | double diff,u; |
| 795 | 795 | struct dst_rcdisc_context *context = node->context; |
| r1877 | r1878 | |
| 815 | 815 | } |
| 816 | 816 | } |
| 817 | 817 | |
| 818 | void dst_rcdisc5_reset(node_description *node) | |
| 818 | static void dst_rcdisc5_reset(node_description *node) | |
| 819 | 819 | { |
| 820 | 820 | struct dst_rcdisc_context *context = node->context; |
| 821 | 821 | |
| r1877 | r1878 | |
| 864 | 864 | #define KT 0.026 |
| 865 | 865 | #define EM_IC(x) (ALPHAT * IES * exp( (x) / KT - 1.0 )) |
| 866 | 866 | |
| 867 | void dst_rcintegrate_step(node_description *node) | |
| 867 | static void dst_rcintegrate_step(node_description *node) | |
| 868 | 868 | { |
| 869 | 869 | double diff,u,iQ,iQc,iC,RG,vE; |
| 870 | 870 | struct dst_rcdisc_context *context = node->context; |
| r1877 | r1878 | |
| 932 | 932 | } |
| 933 | 933 | } |
| 934 | 934 | |
| 935 | void dst_rcintegrate_reset(node_description *node) | |
| 935 | static void dst_rcintegrate_reset(node_description *node) | |
| 936 | 936 | { |
| 937 | 937 | struct dst_rcdisc_context *context = node->context; |
| 938 | 938 | double r; |
| r1877 | r1878 | |
| 981 | 981 | #define DST_RCDISC_MOD__C (*(node->input[7])) |
| 982 | 982 | #define DST_RCDISC_MOD__VP (*(node->input[8])) |
| 983 | 983 | |
| 984 | void dst_rcdisc_mod_step(node_description *node) | |
| 984 | static void dst_rcdisc_mod_step(node_description *node) | |
| 985 | 985 | { |
| 986 | 986 | double diff,Rc,Rc2,vCap,u,vD=0.0; |
| 987 | 987 | struct dst_rcdisc_context *context = node->context; |
| r1877 | r1878 | |
| 1022 | 1022 | } |
| 1023 | 1023 | } |
| 1024 | 1024 | |
| 1025 | void dst_rcdisc_mod_reset(node_description *node) | |
| 1025 | static void dst_rcdisc_mod_reset(node_description *node) | |
| 1026 | 1026 | { |
| 1027 | 1027 | struct dst_rcdisc_context *context = node->context; |
| 1028 | 1028 | |
| r1877 | r1878 | |
| 1047 | 1047 | #define DST_RCFILTER__C (*(node->input[3])) |
| 1048 | 1048 | #define DST_RCFILTER__VREF (*(node->input[4])) |
| 1049 | 1049 | |
| 1050 | void dst_rcfilter_step(node_description *node) | |
| 1050 | static void dst_rcfilter_step(node_description *node) | |
| 1051 | 1051 | { |
| 1052 | 1052 | struct dst_rcfilter_context *context = node->context; |
| 1053 | 1053 | |
| r1877 | r1878 | |
| 1066 | 1066 | } |
| 1067 | 1067 | } |
| 1068 | 1068 | |
| 1069 | void dst_rcfilter_reset(node_description *node) | |
| 1069 | static void dst_rcfilter_reset(node_description *node) | |
| 1070 | 1070 | { |
| 1071 | 1071 | struct dst_rcfilter_context *context = node->context; |
| 1072 | 1072 | |
| r1877 | r1878 | |
| 1095 | 1095 | #define DST_RCFILTERN__R (*(node->input[2])) |
| 1096 | 1096 | #define DST_RCFILTERN__C (*(node->input[3])) |
| 1097 | 1097 | |
| 1098 | void dst_rcfilterN_reset(node_description *node) | |
| 1098 | static void dst_rcfilterN_reset(node_description *node) | |
| 1099 | 1099 | { |
| 1100 | 1100 | // double f=1.0/(2*M_PI* DST_RCFILTERN__R * DST_RCFILTERN__C); |
| 1101 | 1101 | |
| r1877 | r1878 | |
| 1126 | 1126 | #define DST_RCDISCN__R (*(node->input[2])) |
| 1127 | 1127 | #define DST_RCDISCN__C (*(node->input[3])) |
| 1128 | 1128 | |
| 1129 | void dst_rcdiscN_reset(node_description *node) | |
| 1129 | static void dst_rcdiscN_reset(node_description *node) | |
| 1130 | 1130 | { |
| 1131 | 1131 | // double f=1.0/(2*M_PI* DST_RCDISCN__R * DST_RCDISCN__C); |
| 1132 | 1132 | |
| r1877 | r1878 | |
| 1140 | 1140 | dst_filter1_reset(node); |
| 1141 | 1141 | } |
| 1142 | 1142 | |
| 1143 | void dst_rcdiscN_step(node_description *node) | |
| 1143 | static void dst_rcdiscN_step(node_description *node) | |
| 1144 | 1144 | { |
| 1145 | 1145 | struct dss_filter1_context *context = node->context; |
| 1146 | 1146 | double gain = 1.0; |
| r1877 | r1878 | |
| 1190 | 1190 | double a1_1, b0_1, b1_1; /* digital filter coefficients, filter #2 */ |
| 1191 | 1191 | }; |
| 1192 | 1192 | |
| 1193 | void dst_rcdisc2N_step(node_description *node) | |
| 1193 | static void dst_rcdisc2N_step(node_description *node) | |
| 1194 | 1194 | { |
| 1195 | 1195 | struct dss_rcdisc2_context *context = node->context; |
| 1196 | 1196 | double input = ((DST_RCDISC2N__ENABLE == 0) ? DST_RCDISC2N__IN0 : DST_RCDISC2N__IN1); |
| r1877 | r1878 | |
| 1204 | 1204 | context->y1 = node->output; |
| 1205 | 1205 | } |
| 1206 | 1206 | |
| 1207 | void dst_rcdisc2N_reset(node_description *node) | |
| 1207 | static void dst_rcdisc2N_reset(node_description *node) | |
| 1208 | 1208 | { |
| 1209 | 1209 | struct dss_rcdisc2_context *context = node->context; |
| 1210 | 1210 | double f1,f2; |
| r1877 | r1878 | |
|---|---|---|
| 771 | 771 | } |
| 772 | 772 | } |
| 773 | 773 | else if (offset < 0x140) |
| 774 | namcos1_sound_w(offset - 0x100,data); | |
| 774 | namcos1_sound_w(machine, offset - 0x100,data); | |
| 775 | 775 | else |
| 776 | 776 | namco_wavedata[offset] = data; |
| 777 | 777 | } |
| r1877 | r1878 | |
|---|---|---|
| 34 | 34 | static int PSCALES[8][256]; |
| 35 | 35 | static int ASCALES[8][256]; |
| 36 | 36 | |
| 37 | void AICALFO_Init(void) | |
| 37 | static void AICALFO_Init(void) | |
| 38 | 38 | { |
| 39 | 39 | int i,s; |
| 40 | 40 | for(i=0;i<256;++i) |
| r1877 | r1878 | |
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | signed int | |
| 106 | INLINE signed int | |
| 107 | 107 | { |
| 108 | 108 | int p; |
| 109 | 109 | |
| r1877 | r1878 | |
| 116 | 116 | return p<<(SHIFT-LFO_SHIFT); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | signed int | |
| 119 | INLINE signed int | |
| 120 | 120 | { |
| 121 | 121 | int p; |
| 122 | 122 | LFO->phase+=LFO->phase_step; |
| r1877 | r1878 | |
| 128 | 128 | return p<<(SHIFT-LFO_SHIFT); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | void AICALFO_ComputeStep(struct _LFO *LFO,UINT32 LFOF,UINT32 LFOWS,UINT32 LFOS,int ALFO) | |
| 131 | static void AICALFO_ComputeStep(struct _LFO *LFO,UINT32 LFOF,UINT32 LFOWS,UINT32 LFOS,int ALFO) | |
| 132 | 132 | { |
| 133 | 133 | float step=(float) LFOFreq[LFOF]*256.0/(float)44100.0; |
| 134 | 134 | LFO->phase_step=(unsigned int) ((float) (1<<LFO_SHIFT)*step); |
| r1877 | r1878 | |
|---|---|---|
| 296 | 296 | WRITE8_HANDLER( YM2203_word_0_w ) |
| 297 | 297 | { |
| 298 | 298 | if (offset) |
| 299 | YM2203_write_port_0_w(0,data); | |
| 299 | YM2203_write_port_0_w(machine,0,data); | |
| 300 | 300 | else |
| 301 | YM2203_control_port_0_w(0,data); | |
| 301 | YM2203_control_port_0_w(machine,0,data); | |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | WRITE8_HANDLER( YM2203_word_1_w ) |
| 305 | 305 | { |
| 306 | 306 | if (offset) |
| 307 | YM2203_write_port_1_w(0,data); | |
| 307 | YM2203_write_port_1_w(machine,0,data); | |
| 308 | 308 | else |
| 309 | YM2203_control_port_1_w(0,data); | |
| 309 | YM2203_control_port_1_w(machine,0,data); | |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | |
| 6 | 6 | struct YM2203interface |
| 7 | 7 | { |
| 8 | read8_handler portAread; | |
| 9 | read8_handler portBread; | |
| 10 | write8_handler portAwrite; | |
| 11 | write8_handler portBwrite; | |
| 8 | read8_machine_func portAread; | |
| 9 | read8_machine_func portBread; | |
| 10 | write8_machine_func portAwrite; | |
| 11 | write8_machine_func portBwrite; | |
| 12 | 12 | void (*handler)(int irq); |
| 13 | 13 | }; |
| 14 | 14 |
| r1877 | r1878 | |
|---|---|---|
| 35 | 35 | |
| 36 | 36 | #include <math.h> |
| 37 | 37 | #include "sndintrf.h" |
| 38 | #include "deprecat.h" | |
| 38 | 39 | #include "cpuintrf.h" |
| 39 | 40 | #include "es5503.h" |
| 40 | 41 | #include "streams.h" |
| r1877 | r1878 | |
| 69 | 70 | |
| 70 | 71 | void (*irq_callback)(int); // IRQ callback |
| 71 | 72 | |
| 72 | read8_ | |
| 73 | read8_machin | |
| 73 | 74 | |
| 74 | 75 | INT8 oscsenabled; // # of oscillators enabled |
| 75 | 76 | |
| r1877 | r1878 | |
| 376 | 377 | case 0xe2: // A/D converter |
| 377 | 378 | if (chip->adc_read) |
| 378 | 379 | { |
| 379 | return chip->adc_read(0); | |
| 380 | return chip->adc_read(Machine, 0); | |
| 380 | 381 | } |
| 381 | 382 | break; |
| 382 | 383 | } |
| r1877 | r1878 | |
|---|---|---|
| 4 | 4 | struct ES5503interface |
| 5 | 5 | { |
| 6 | 6 | void (*irq_callback)(int state); |
| 7 | read8_ | |
| 7 | read8_machin | |
| 8 | 8 | UINT8 *wave_memory; |
| 9 | 9 | }; |
| 10 | 10 |
| r1877 | r1878 | |
|---|---|---|
| 1131 | 1131 | bufptr += sprintf(bufptr, "Vector\n"); |
| 1132 | 1132 | else |
| 1133 | 1133 | bufptr += sprintf(bufptr, "%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n", |
| 1134 | scrconfig->defstate.visarea.max_x - scrconfig->defstate.visarea.min_x + 1, | |
| 1135 | scrconfig->defstate.visarea.max_y - scrconfig->defstate.visarea.min_y + 1, | |
| 1134 | Machine->screen[index].visarea.max_x - Machine->screen[index].visarea.min_x + 1, | |
| 1135 | Machine->screen[index].visarea.max_y - Machine->screen[index].visarea.min_y + 1, | |
| 1136 | 1136 | (Machine->gamedrv->flags & ORIENTATION_SWAP_XY) ? "V" : "H", |
| 1137 | ATTOSECONDS_TO_HZ(scr | |
| 1137 | ATTOSECONDS_TO_HZ(Machine->screen[in | |
| 1138 | 1138 | } |
| 1139 | 1139 | } |
| 1140 | 1140 |
| r1877 | r1878 | |
|---|---|---|
| 785 | 785 | for a speaker |
| 786 | 786 | -------------------------------------------------*/ |
| 787 | 787 | |
| 788 | static | |
| 788 | static DEVICE_START( | |
| 789 | 789 | { |
| 790 | 790 | speaker_info *info; |
| 791 | 791 | |
| r1877 | r1878 | |
| 805 | 805 | for a speaker |
| 806 | 806 | -------------------------------------------------*/ |
| 807 | 807 | |
| 808 | static | |
| 808 | static DEVICE_STOP( speaker_output | |
| 809 | 809 | { |
| 810 | 810 | #ifdef MAME_DEBUG |
| 811 | 811 | speaker_info *info = token; |
| r1877 | r1878 | |
| 822 | 822 | callback |
| 823 | 823 | -------------------------------------------------*/ |
| 824 | 824 | |
| 825 | static | |
| 825 | static DEVICE_SET_INFO( speaker_output | |
| 826 | 826 | { |
| 827 | 827 | switch (state) |
| 828 | 828 | { |
| r1877 | r1878 | |
| 836 | 836 | callback |
| 837 | 837 | -------------------------------------------------*/ |
| 838 | 838 | |
| 839 | ||
| 839 | DEVICE_GET_INFO( speaker_output | |
| 840 | 840 | { |
| 841 | 841 | switch (state) |
| 842 | 842 | { |
| 843 | 843 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 844 | 844 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(speaker_config); break; |
| 845 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_AUDIO; break; | |
| 845 | 846 | |
| 846 | 847 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 847 | case DEVINFO_FCT_SET_INFO: info->set_info = speaker_output_set_info;break; | |
| 848 | case DEVINFO_FCT_START: info->start = speaker_output_start; break; | |
| 849 | case DEVINFO_FCT_STOP: info->stop = speaker_output_stop; break; | |
| 848 | case DEVINFO_FCT_SET_INFO: info->set_info = DEVICE_SET_INFO_NAME(speaker_output); break; | |
| 849 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(speaker_output); break; | |
| 850 | case DEVINFO_FCT_STOP: info->stop = DEVICE_STOP_NAME(speaker_output); break; | |
| 850 | 851 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 851 | 852 | |
| 852 | 853 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r1877 | r1878 | |
|---|---|---|
| 101 | 101 | /* ----- sound speaker device interface ----- */ |
| 102 | 102 | |
| 103 | 103 | /* device get info callback */ |
| 104 | #define SPEAKER_OUTPUT speaker_output_get_info | |
| 105 | void speaker_output_get_info(running_machine *machine, void *token, UINT32 state, deviceinfo *info); | |
| 104 | #define SPEAKER_OUTPUT DEVICE_GET_INFO_NAME(speaker_output) | |
| 105 | DEVICE_GET_INFO( speaker_output ); | |
| 106 | 106 | |
| 107 | 107 | |
| 108 | 108 | #endif /* __SOUND_H__ */ |
| r1877 | r1878 | |
|---|---|---|
| 61 | 61 | void * internal; /* internal callback pointer */ |
| 62 | 62 | input_item_class itemclass; /* class of the item */ |
| 63 | 63 | input_item_id itemid; /* originally specified item id */ |
| 64 | item_get_state_c | |
| 64 | item_get_state_func | |
| 65 | 65 | INT32 current; /* current raw value */ |
| 66 | 66 | INT32 memory; /* "memory" value, to remember where we started during polling */ |
| 67 | 67 | INT32 oncelatch; /* latched "once" value, cleared after each read */ |
| r1877 | r1878 | |
| 689 | 689 | input device |
| 690 | 690 | -------------------------------------------------*/ |
| 691 | 691 | |
| 692 | void input_device_item_add(input_device *device, const char *name, void *internal, input_item_id itemid, item_get_state_c | |
| 692 | void input_device_item_add(input_device *device, const char *name, void *internal, input_item_id itemid, item_get_state_func | |
| 693 | 693 | { |
| 694 | 694 | input_device_item *item; |
| 695 | 695 |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | #define VIDEO_EOF(name) void video_eof_##name(running_machine *machine) |
| 55 | 55 | #define VIDEO_EOF_CALL(name) video_eof_##name(machine) |
| 56 | 56 | |
| 57 | #define VIDEO_UPDATE(name) UINT32 video_update_##name(running_machine *machine, int screen, | |
| 57 | #define VIDEO_UPDATE(name) UINT32 video_update_##name(running_machine *machine, int screen, | |
| 58 | 58 | #define VIDEO_UPDATE_CALL(name) video_update_##name(machine, screen, bitmap, cliprect) |
| 59 | 59 | |
| 60 | 60 | |
| r1877 | r1878 | |
| 83 | 83 | typedef void (*video_reset_func)(running_machine *machine); |
| 84 | 84 | typedef void (*palette_init_func)(running_machine *machine, const UINT8 *color_prom); |
| 85 | 85 | typedef void (*video_eof_func)(running_machine *machine); |
| 86 | typedef UINT32 (*video_update_func)(running_machine *machine, int screen, | |
| 86 | typedef UINT32 (*video_update_func)(running_machine *machine, int screen, | |
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | |
| r1877 | r1878 | |
| 93 | 93 | |
| 94 | 94 | #include "cpuintrf.h" |
| 95 | 95 | #include "sndintrf.h" |
| 96 | #include "devintrf.h" | |
| 96 | 97 | #include "fileio.h" |
| 97 | 98 | #include "drawgfx.h" |
| 98 | 99 | #include "emupal.h" |
| r1877 | r1878 | |
|---|---|---|
| 358 | 358 | BLOCKMOVE PRIMITIVES |
| 359 | 359 | ***************************************************************************/ |
| 360 | 360 | |
| 361 | #ifdef UNUSED_FUNCTION | |
| 361 | 362 | INLINE void blockmove_NtoN_transpen_noremap8( |
| 362 | 363 | const UINT8 *srcdata,int srcwidth,int srcheight,int srcmodulo, |
| 363 | 364 | UINT8 *dstdata,int dstmodulo, |
| r1877 | r1878 | |
| 423 | 424 | srcheight--; |
| 424 | 425 | } |
| 425 | 426 | } |
| 427 | #endif | |
| 426 | 428 | |
| 429 | #ifdef UNUSED_FUNCTION | |
| 427 | 430 | INLINE void blockmove_NtoN_transpen_noremap_flipx8( |
| 428 | 431 | const UINT8 *srcdata,int srcwidth,int srcheight,int srcmodulo, |
| 429 | 432 | UINT8 *dstdata,int dstmodulo, |
| r1877 | r1878 | |
| 484 | 487 | srcheight--; |
| 485 | 488 | } |
| 486 | 489 | } |
| 490 | #endif | |
| 487 | 491 | |
| 488 | ||
| 489 | 492 | INLINE void blockmove_NtoN_transpen_noremap16( |
| 490 | 493 | const UINT16 *srcdata,int srcwidth,int srcheight,int srcmodulo, |
| 491 | 494 | UINT16 *dstdata,int dstmodulo, |
| r1877 | r1878 | |
| 842 | 845 | |
| 843 | 846 | ***************************************************************************/ |
| 844 | 847 | |
| 845 | INLINE void common_drawgfx( | |
| 848 | INLINE void common_drawgfx( | |
| 846 | 849 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 847 | 850 | const rectangle *clip,int transparency,int transparent_color, |
| 848 | | |
| 851 | | |
| 849 | 852 | { |
| 850 | 853 | assert(dest != NULL); |
| 851 | 854 | assert((dest->bpp == 16) || (dest->bpp == 32)); |
| r1877 | r1878 | |
| 890 | 893 | drawgfx_core32(dest,gfx,code,color,flipx,flipy,sx,sy,clip,transparency,transparent_color,pri_buffer,pri_mask); |
| 891 | 894 | } |
| 892 | 895 | |
| 893 | void drawgfx( | |
| 896 | void drawgfx( | |
| 894 | 897 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 895 | 898 | const rectangle *clip,int transparency,int transparent_color) |
| 896 | 899 | { |
| r1877 | r1878 | |
| 899 | 902 | profiler_mark(PROFILER_END); |
| 900 | 903 | } |
| 901 | 904 | |
| 902 | void pdrawgfx( | |
| 905 | void pdrawgfx( | |
| 903 | 906 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 904 | 907 | const rectangle *clip,int transparency,int transparent_color,UINT32 priority_mask) |
| 905 | 908 | { |
| r1877 | r1878 | |
| 908 | 911 | profiler_mark(PROFILER_END); |
| 909 | 912 | } |
| 910 | 913 | |
| 911 | void mdrawgfx( | |
| 914 | void mdrawgfx( | |
| 912 | 915 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 913 | 916 | const rectangle *clip,int transparency,int transparent_color,UINT32 priority_mask) |
| 914 | 917 | { |
| r1877 | r1878 | |
| 923 | 926 | Use copybitmap() to copy a bitmap onto another at the given position. |
| 924 | 927 | |
| 925 | 928 | ***************************************************************************/ |
| 926 | static void copybitmap_common( | |
| 929 | static void copybitmap_common( | |
| 927 | 930 | const rectangle *clip,int transparency,int transparent_color) |
| 928 | 931 | { |
| 929 | 932 | assert(dest != NULL); |
| r1877 | r1878 | |
| 941 | 944 | profiler_mark(PROFILER_END); |
| 942 | 945 | } |
| 943 | 946 | |
| 944 | void copybitmap( | |
| 947 | void copybitmap( | |
| 945 | 948 | int sx, int sy, const rectangle *clip) |
| 946 | 949 | { |
| 947 | 950 | copybitmap_common(dest,src,flipx,flipy,sx,sy,clip,TRANSPARENCY_NONE,0); |
| 948 | 951 | } |
| 949 | 952 | |
| 950 | void copybitmap_trans( | |
| 953 | void copybitmap_trans( | |
| 951 | 954 | int sx, int sy, const rectangle *clip, pen_t transparent_pen) |
| 952 | 955 | { |
| 953 | 956 | copybitmap_common(dest,src,flipx,flipy,sx,sy,clip,TRANSPARENCY_PEN,transparent_pen); |
| r1877 | r1878 | |
| 968 | 971 | scrolls as a whole in at least one direction. |
| 969 | 972 | |
| 970 | 973 | ***************************************************************************/ |
| 971 | static void copyscrollbitmap_common( | |
| 974 | static void copyscrollbitmap_common( | |
| 972 | 975 | int rows,const int *rowscroll,int cols,const int *colscroll, |
| 973 | 976 | const rectangle *clip,int transparency,int transparent_color) |
| 974 | 977 | { |
| r1877 | r1878 | |
| 1206 | 1209 | } |
| 1207 | 1210 | |
| 1208 | 1211 | |
| 1209 | void copyscrollbitmap( | |
| 1212 | void copyscrollbitmap( | |
| 1210 | 1213 | int rows, const int *rowscroll, int cols, const int *colscroll, |
| 1211 | 1214 | const rectangle *clip) |
| 1212 | 1215 | { |
| 1213 | 1216 | copyscrollbitmap_common(dest,src,rows,rowscroll,cols,colscroll,clip,TRANSPARENCY_NONE,0); |
| 1214 | 1217 | } |
| 1215 | 1218 | |
| 1216 | void copyscrollbitmap_trans( | |
| 1219 | void copyscrollbitmap_trans( | |
| 1217 | 1220 | int rows, const int *rowscroll, int cols, const int *colscroll, |
| 1218 | 1221 | const rectangle *clip, pen_t transparent_pen) |
| 1219 | 1222 | { |
| r1877 | r1878 | |
| 1225 | 1228 | - startx and starty MUST be UINT32 for calculations to work correctly |
| 1226 | 1229 | - srcbitmap->width and height are assumed to be a power of 2 to speed up wraparound |
| 1227 | 1230 | */ |
| 1228 | void copyrozbitmap( | |
| 1231 | void copyrozbitmap( | |
| 1229 | 1232 | UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy,int wraparound, |
| 1230 | 1233 | const rectangle *clip,int transparency,int transparent_color,UINT32 priority) |
| 1231 | 1234 | { |
| r1877 | r1878 | |
| 1259 | 1262 | |
| 1260 | 1263 | |
| 1261 | 1264 | |
| 1262 | INLINE void common_drawgfxzoom( | |
| 1265 | INLINE void common_drawgfxzoom( | |
| 1263 | 1266 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 1264 | 1267 | const rectangle *clip,int transparency,int transparent_color, |
| 1265 | int scalex, int scaley, | |
| 1268 | int scalex, int scaley, | |
| 1266 | 1269 | { |
| 1267 | 1270 | /* verify arguments */ |
| 1268 | 1271 | assert(dest_bmp != NULL); |
| r1877 | r1878 | |
| 2288 | 2291 | } |
| 2289 | 2292 | } |
| 2290 | 2293 | |
| 2291 | void drawgfxzoom( | |
| 2294 | void drawgfxzoom( | |
| 2292 | 2295 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 2293 | 2296 | const rectangle *clip,int transparency,int transparent_color,int scalex, int scaley) |
| 2294 | 2297 | { |
| r1877 | r1878 | |
| 2298 | 2301 | profiler_mark(PROFILER_END); |
| 2299 | 2302 | } |
| 2300 | 2303 | |
| 2301 | void pdrawgfxzoom( | |
| 2304 | void pdrawgfxzoom( | |
| 2302 | 2305 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 2303 | 2306 | const rectangle *clip,int transparency,int transparent_color,int scalex, int scaley, |
| 2304 | 2307 | UINT32 priority_mask) |
| r1877 | r1878 | |
| 2309 | 2312 | profiler_mark(PROFILER_END); |
| 2310 | 2313 | } |
| 2311 | 2314 | |
| 2312 | void mdrawgfxzoom( | |
| 2315 | void mdrawgfxzoom( | |
| 2313 | 2316 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 2314 | 2317 | const rectangle *clip,int transparency,int transparent_color,int scalex, int scaley, |
| 2315 | 2318 | UINT32 priority_mask) |
| r1877 | r1878 | |
| 3238 | 3241 | |
| 3239 | 3242 | |
| 3240 | 3243 | DECLARE(drawgfx_core,( |
| 3241 | | |
| 3244 | | |
| 3242 | 3245 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 3243 | 3246 | const rectangle *clip,int transparency,int transparent_color, |
| 3244 | | |
| 3247 | | |
| 3245 | 3248 | { |
| 3246 | 3249 | int ox; |
| 3247 | 3250 | int oy; |
| r1877 | r1878 | |
| 3372 | 3375 | }) |
| 3373 | 3376 | |
| 3374 | 3377 | DECLARE(copybitmap_core,( |
| 3375 | | |
| 3378 | | |
| 3376 | 3379 | int flipx,int flipy,int sx,int sy, |
| 3377 | 3380 | const rectangle *clip,int transparency,int transparent_color), |
| 3378 | 3381 | { |
| r1877 | r1878 | |
| 3437 | 3440 | } |
| 3438 | 3441 | }) |
| 3439 | 3442 | |
| 3440 | DECLARE(copyrozbitmap_core,( | |
| 3443 | DECLARE(copyrozbitmap_core,( | |
| 3441 | 3444 | UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy,int wraparound, |
| 3442 | 3445 | const rectangle *clip,int transparency,int transparent_color,UINT32 priority), |
| 3443 | 3446 | { |
| r1877 | r1878 | |
| 3719 | 3722 | #endif /* (DEPTH != 8) */ |
| 3720 | 3723 | |
| 3721 | 3724 | DECLAREG(draw_scanline, ( |
| 3722 | | |
| 3725 | | |
| 3723 | 3726 | const DATA_TYPE *src,const pen_t *pens,int transparent_pen), |
| 3724 | 3727 | { |
| 3725 | 3728 | assert(bitmap != NULL); |
| r1877 | r1878 | |
| 3821 | 3824 | }) |
| 3822 | 3825 | |
| 3823 | 3826 | DECLAREG(pdraw_scanline, ( |
| 3824 | | |
| 3827 | | |
| 3825 | 3828 | const DATA_TYPE *src,const pen_t *pens,int transparent_pen,int pri), |
| 3826 | 3829 | { |
| 3827 | 3830 | assert(bitmap != NULL); |
| r1877 | r1878 | |
| 3949 | 3952 | ) |
| 3950 | 3953 | |
| 3951 | 3954 | DECLAREG(extract_scanline, ( |
| 3952 | | |
| 3955 | | |
| 3953 | 3956 | DATA_TYPE *dst), |
| 3954 | 3957 | { |
| 3955 | 3958 | assert(bitmap != NULL); |
| r1877 | r1878 | |
|---|---|---|
| 473 | 473 | typedef UINT32 input_code; |
| 474 | 474 | |
| 475 | 475 | /* callback for getting the value of an item on a device */ |
| 476 | typedef INT32 (*item_get_state_c | |
| 476 | typedef INT32 (*item_get_state_func | |
| 477 | 477 | |
| 478 | 478 | /* (opaque) input device object */ |
| 479 | 479 | typedef struct _input_device input_device; |
| r1877 | r1878 | |
| 517 | 517 | input_device *input_device_add(input_device_class devclass, const char *name, void *internal); |
| 518 | 518 | |
| 519 | 519 | /* add a new item to an input device */ |
| 520 | void input_device_item_add(input_device *device, const char *name, void *internal, input_item_id itemid, item_get_state_c | |
| 520 | void input_device_item_add(input_device *device, const char *name, void *internal, input_item_id itemid, item_get_state_func | |
| 521 | 521 | |
| 522 | 522 | |
| 523 | 523 |
| r1877 | r1878 | |
|---|---|---|
| 197 | 197 | void freegfx(gfx_element *gfx); |
| 198 | 198 | |
| 199 | 199 | |
| 200 | void drawgfx( | |
| 200 | void drawgfx( | |
| 201 | 201 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 202 | 202 | const rectangle *clip,int transparency,int transparent_color); |
| 203 | void pdrawgfx( | |
| 203 | void pdrawgfx( | |
| 204 | 204 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 205 | 205 | const rectangle *clip,int transparency,int transparent_color, |
| 206 | 206 | UINT32 priority_mask); |
| 207 | void mdrawgfx( | |
| 207 | void mdrawgfx( | |
| 208 | 208 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 209 | 209 | const rectangle *clip,int transparency,int transparent_color, |
| 210 | 210 | UINT32 priority_mask); |
| 211 | 211 | |
| 212 | 212 | |
| 213 | void drawgfxzoom( | |
| 213 | void drawgfxzoom( | |
| 214 | 214 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 215 | 215 | const rectangle *clip,int transparency,int transparent_color,int scalex,int scaley); |
| 216 | void pdrawgfxzoom( | |
| 216 | void pdrawgfxzoom( | |
| 217 | 217 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 218 | 218 | const rectangle *clip,int transparency,int transparent_color,int scalex,int scaley, |
| 219 | 219 | UINT32 priority_mask); |
| 220 | void mdrawgfxzoom( | |
| 220 | void mdrawgfxzoom( | |
| 221 | 221 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 222 | 222 | const rectangle *clip,int transparency,int transparent_color,int scalex,int scaley, |
| 223 | 223 | UINT32 priority_mask); |
| 224 | 224 | |
| 225 | 225 | |
| 226 | void draw_scanline8(mame_bitmap *bitmap,int x,int y,int length,const UINT8 *src,const pen_t *pens,int transparent_pen); | |
| 227 | void draw_scanline16(mame_bitmap *bitmap,int x,int y,int length,const UINT16 *src,const pen_t *pens,int transparent_pen); | |
| 228 | void draw_scanline32(mame_bitmap *bitmap,int x,int y,int length,const UINT32 *src,const pen_t *pens,int transparent_pen); | |
| 229 | void pdraw_scanline8(mame_bitmap *bitmap,int x,int y,int length,const UINT8 *src,const pen_t *pens,int transparent_pen,int pri); | |
| 230 | void pdraw_scanline16(mame_bitmap *bitmap,int x,int y,int length,const UINT16 *src,const pen_t *pens,int transparent_pen,int pri); | |
| 231 | void pdraw_scanline32(mame_bitmap *bitmap,int x,int y,int length,const UINT32 *src,const pen_t *pens,int transparent_pen,int pri); | |
| 232 | void extract_scanline8(mame_bitmap *bitmap,int x,int y,int length,UINT8 *dst); | |
| 233 | void extract_scanline16(mame_bitmap *bitmap,int x,int y,int length,UINT16 *dst); | |
| 234 | void extract_scanline32(mame_bitmap *bitmap,int x,int y,int length,UINT32 *dst); | |
| 226 | void draw_scanline8(bitmap_t *bitmap,int x,int y,int length,const UINT8 *src,const pen_t *pens,int transparent_pen); | |
| 227 | void draw_scanline16(bitmap_t *bitmap,int x,int y,int length,const UINT16 *src,const pen_t *pens,int transparent_pen); | |
| 228 | void draw_scanline32(bitmap_t *bitmap,int x,int y,int length,const UINT32 *src,const pen_t *pens,int transparent_pen); | |
| 229 | void pdraw_scanline8(bitmap_t *bitmap,int x,int y,int length,const UINT8 *src,const pen_t *pens,int transparent_pen,int pri); | |
| 230 | void pdraw_scanline16(bitmap_t *bitmap,int x,int y,int length,const UINT16 *src,const pen_t *pens,int transparent_pen,int pri); | |
| 231 | void pdraw_scanline32(bitmap_t *bitmap,int x,int y,int length,const UINT32 *src,const pen_t *pens,int transparent_pen,int pri); | |
| 232 | void extract_scanline8(bitmap_t *bitmap,int x,int y,int length,UINT8 *dst); | |
| 233 | void extract_scanline16(bitmap_t *bitmap,int x,int y,int length,UINT16 *dst); | |
| 234 | void extract_scanline32(bitmap_t *bitmap,int x,int y,int length,UINT32 *dst); | |
| 235 | 235 | |
| 236 | 236 | |
| 237 | void copybitmap( | |
| 237 | void copybitmap( | |
| 238 | 238 | int sx,int sy,const rectangle *clip); |
| 239 | 239 | |
| 240 | void copybitmap_trans( | |
| 240 | void copybitmap_trans( | |
| 241 | 241 | int sx,int sy,const rectangle *clip,pen_t transparent_pen); |
| 242 | 242 | |
| 243 | void copyscrollbitmap( | |
| 243 | void copyscrollbitmap( | |
| 244 | 244 | int rows,const int *rowscroll,int cols,const int *colscroll, |
| 245 | 245 | const rectangle *clip); |
| 246 | 246 | |
| 247 | void copyscrollbitmap_trans( | |
| 247 | void copyscrollbitmap_trans( | |
| 248 | 248 | int rows,const int *rowscroll,int cols,const int *colscroll, |
| 249 | 249 | const rectangle *clip,pen_t transparent_pen); |
| 250 | 250 | |
| r1877 | r1878 | |
| 277 | 277 | Optionally the bitmap can be tiled across the screen instead of doing a single |
| 278 | 278 | copy. This is obtained by setting the wraparound parameter to true. |
| 279 | 279 | */ |
| 280 | void copyrozbitmap( | |
| 280 | void copyrozbitmap( | |
| 281 | 281 | UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy,int wraparound, |
| 282 | 282 | const rectangle *clip,int transparency,int transparent_color,UINT32 priority); |
| 283 | 283 |
| r1877 | r1878 | |
|---|---|---|
| 121 | 121 | /* a scaled_texture contains a single scaled entry for a texture */ |
| 122 | 122 | struct _scaled_texture |
| 123 | 123 | { |
| 124 | | |
| 124 | | |
| 125 | 125 | UINT32 seqid; /* sequence number */ |
| 126 | 126 | }; |
| 127 | 127 | |
| r1877 | r1878 | |
| 131 | 131 | { |
| 132 | 132 | render_texture * next; /* next texture (for free list) */ |
| 133 | 133 | render_texture * base; /* pointer to base of texture group */ |
| 134 | | |
| 134 | | |
| 135 | 135 | rectangle sbounds; /* source bounds within the bitmap */ |
| 136 | 136 | UINT32 palettebase; /* palette base within the system palette */ |
| 137 | 137 | int format; /* format of the texture data */ |
| 138 | texture_scaler scaler; /* scaling callback */ | |
| 138 | texture_scaler_func scaler; /* scaling callback */ | |
| 139 | 139 | void * param; /* scaling callback parameter */ |
| 140 | 140 | UINT32 curseq; /* current sequence number */ |
| 141 | 141 | scaled_texture scaled[MAX_TEXTURE_SCALES]; /* array of scaled variants of this texture */ |
| r1877 | r1878 | |
| 193 | 193 | float yscale; /* Y scale factor of the container */ |
| 194 | 194 | float xoffset; /* X offset of the container */ |
| 195 | 195 | float yoffset; /* Y offset of the container */ |
| 196 | | |
| 196 | | |
| 197 | 197 | render_texture * overlaytexture; /* overlay texture */ |
| 198 | 198 | palette_client * palclient; /* client to the system palette */ |
| 199 | 199 | rgb_t bcglookup256[0x400];/* lookup table for brightness/contrast/gamma */ |
| r1877 | r1878 | |
| 223 | 223 | /* containers for the UI and for screens */ |
| 224 | 224 | static render_container *ui_container; |
| 225 | 225 | static render_container *screen_container[MAX_SCREENS]; |
| 226 | static | |
| 226 | static | |
| 227 | 227 | |
| 228 | 228 | /* variables for tracking extents to clear */ |
| 229 | 229 | static INT32 clear_extents[MAX_CLEAR_EXTENTS]; |
| r1877 | r1878 | |
| 270 | 270 | static render_container *render_container_alloc(void); |
| 271 | 271 | static void render_container_free(render_container *container); |
| 272 | 272 | static container_item *render_container_item_add_generic(render_container *container, UINT8 type, float x0, float y0, float x1, float y1, rgb_t argb); |
| 273 | static void render_container_overlay_scale( | |
| 273 | static void render_container_overlay_scale( | |
| 274 | 274 | static void render_container_recompute_lookups(render_container *container); |
| 275 | 275 | static void render_container_update_palette(render_container *container); |
| 276 | 276 | |
| r1877 | r1878 | |
| 1302 | 1302 | the current layout and proposed new parameters |
| 1303 | 1303 | -------------------------------------------------*/ |
| 1304 | 1304 | |
| 1305 | void render_target_compute_visible_area(render_target *target, INT32 target_width, INT32 target_height, float target_pixel_aspect, | |
| 1305 | void render_target_compute_visible_area(render_target *target, INT32 target_width, INT32 target_height, float target_pixel_aspect, int | |
| 1306 | 1306 | { |
| 1307 | 1307 | float width, height; |
| 1308 | 1308 | float scale; |
| r1877 | r1878 | |
| 1445 | 1445 | render_target_compute_visible_area(target, target->width, target->height, target->pixel_aspect, target->orientation, &viswidth, &visheight); |
| 1446 | 1446 | |
| 1447 | 1447 | /* create a root transform for the target */ |
| 1448 | root_xform.xoffs = (target->width - viswidth) / 2; | |
| 1449 | root_xform.yoffs = (target->height - visheight) / 2; | |
| 1450 | root_xform.xscale = viswidth; | |
| 1451 | root_xform.yscale = visheight; | |
| 1448 | root_xform.xoffs = (float) (target->width - viswidth) / 2; | |
| 1449 | root_xform.yoffs = (float) (target->height - visheight) / 2; | |
| 1450 | root_xform.xscale = (float) viswidth; | |
| 1451 | root_xform.yscale = (float) visheight; | |
| 1452 | 1452 | root_xform.color.r = root_xform.color.g = root_xform.color.b = root_xform.color.a = 1.0f; |
| 1453 | 1453 | root_xform.orientation = target->orientation; |
| 1454 | 1454 | |
| r1877 | r1878 | |
| 1549 | 1549 | /* compute the transform for the UI */ |
| 1550 | 1550 | ui_xform.xoffs = 0; |
| 1551 | 1551 | ui_xform.yoffs = 0; |
| 1552 | ui_xform.xscale = target->width; | |
| 1553 | ui_xform.yscale = target->height; | |
| 1552 | ui_xform.xscale = (float) target->width; | |
| 1553 | ui_xform.yscale = (float) target->height; | |
| 1554 | 1554 | ui_xform.color.r = ui_xform.color.g = ui_xform.color.b = ui_xform.color.a = 1.0f; |
| 1555 | 1555 | ui_xform.orientation = target->orientation; |
| 1556 | 1556 | |
| r1877 | r1878 | |
| 1886 | 1886 | prim->flags = PRIMFLAG_TEXORIENT(xform->orientation) | PRIMFLAG_BLENDMODE(blendmode) | PRIMFLAG_TEXFORMAT(texture->format); |
| 1887 | 1887 | |
| 1888 | 1888 | /* compute the bounds */ |
| 1889 | set_render_bounds_wh(&prim->bounds, render_round_nearest(xform->xoffs), render_round_nearest(xform->yoffs), width, height); | |
| 1889 | set_render_bounds_wh(&prim->bounds, render_round_nearest(xform->xoffs), render_round_nearest(xform->yoffs), (float) width, (float) height); | |
| 1890 | 1890 | if (xform->orientation & ORIENTATION_SWAP_XY) |
| 1891 | 1891 | ISWAP(width, height); |
| 1892 | 1892 | width = MIN(width, target->maxtexwidth); |
| r1877 | r1878 | |
| 2221 | 2221 | render_texture_alloc - allocate a new texture |
| 2222 | 2222 | -------------------------------------------------*/ |
| 2223 | 2223 | |
| 2224 | render_texture *render_texture_alloc(texture_scaler scaler, void *param) | |
| 2224 | render_texture *render_texture_alloc(texture_scaler_func scaler, void *param) | |
| 2225 | 2225 | { |
| 2226 | 2226 | render_texture *texture; |
| 2227 | 2227 | |
| r1877 | r1878 | |
| 2291 | 2291 | bitmap |
| 2292 | 2292 | -------------------------------------------------*/ |
| 2293 | 2293 | |
| 2294 | void render_texture_set_bitmap(render_texture *texture, | |
| 2294 | void render_texture_set_bitmap(render_texture *texture, | |
| 2295 | 2295 | { |
| 2296 | 2296 | int scalenum; |
| 2297 | 2297 | |
| r1877 | r1878 | |
| 2415 | 2415 | resampling scaler |
| 2416 | 2416 | -------------------------------------------------*/ |
| 2417 | 2417 | |
| 2418 | void render_texture_hq_scale( | |
| 2418 | void render_texture_hq_scale( | |
| 2419 | 2419 | { |
| 2420 | 2420 | render_color color = { 1.0f, 1.0f, 1.0f, 1.0f }; |
| 2421 | 2421 | render_resample_argb_bitmap_hq(dest->base, dest->rowpixels, dest->width, dest->height, source, sbounds, &color); |
| r1877 | r1878 | |
| 2701 | 2701 | overlay bitmap for the container |
| 2702 | 2702 | -------------------------------------------------*/ |
| 2703 | 2703 | |
| 2704 | void render_container_set_overlay(render_container *container, | |
| 2704 | void render_container_set_overlay(render_container *container, | |
| 2705 | 2705 | { |
| 2706 | 2706 | /* free any existing texture */ |
| 2707 | 2707 | if (container->overlaytexture != NULL) |
| r1877 | r1878 | |
| 2836 | 2836 | an overlay |
| 2837 | 2837 | -------------------------------------------------*/ |
| 2838 | 2838 | |
| 2839 | static void render_container_overlay_scale( | |
| 2839 | static void render_container_overlay_scale( | |
| 2840 | 2840 | { |
| 2841 | 2841 | int x, y; |
| 2842 | 2842 |
| r1877 | r1878 | |
|---|---|---|
| 291 | 291 | bitmap to be saved |
| 292 | 292 | -------------------------------------------------*/ |
| 293 | 293 | |
| 294 | void state_save_register_bitmap(const char *module, UINT32 instance, const char *name, | |
| 294 | void state_save_register_bitmap(const char *module, UINT32 instance, const char *name, | |
| 295 | 295 | { |
| 296 | 296 | state_save_register_memory(module, instance, name, val->base, val->bpp / 8, val->rowpixels * val->height); |
| 297 | 297 | } |
| r1877 | r1878 | |
|---|---|---|
| 43 | 43 | { |
| 44 | 44 | emu_timer * next; |
| 45 | 45 | emu_timer * prev; |
| 46 | timer_c | |
| 46 | timer_fired_func | |
| 47 | 47 | INT32 param; |
| 48 | 48 | void * ptr; |
| 49 | 49 | const char * file; |
| r1877 | r1878 | |
| 458 | 458 | isn't primed yet |
| 459 | 459 | -------------------------------------------------*/ |
| 460 | 460 | |
| 461 | INLINE emu_timer *_timer_alloc_common(timer_c | |
| 461 | INLINE emu_timer *_timer_alloc_common(timer_fired_func | |
| 462 | 462 | { |
| 463 | 463 | attotime time = get_current_time(); |
| 464 | 464 | emu_timer *timer = timer_new(); |
| r1877 | r1878 | |
| 490 | 490 | return timer; |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | emu_timer *_timer_alloc_internal(timer_c | |
| 493 | emu_timer *_timer_alloc_internal(timer_fired_func | |
| 494 | 494 | { |
| 495 | 495 | return _timer_alloc_common(callback, ptr, file, line, func, FALSE); |
| 496 | 496 | } |
| r1877 | r1878 | |
| 585 | 585 | period |
| 586 | 586 | -------------------------------------------------*/ |
| 587 | 587 | |
| 588 | void _timer_pulse_internal(attotime period, void *ptr, INT32 param, timer_c | |
| 588 | void _timer_pulse_internal(attotime period, void *ptr, INT32 param, timer_fired_func | |
| 589 | 589 | { |
| 590 | 590 | emu_timer *timer = _timer_alloc_common(callback, ptr, file, line, func, FALSE); |
| 591 | 591 | timer_adjust_periodic(timer, period, param, period); |
| r1877 | r1878 | |
| 597 | 597 | calls the callback after the given duration |
| 598 | 598 | -------------------------------------------------*/ |
| 599 | 599 | |
| 600 | void _timer_set_internal(attotime duration, void *ptr, INT32 param, timer_c | |
| 600 | void _timer_set_internal(attotime duration, void *ptr, INT32 param, timer_fired_func | |
| 601 | 601 | { |
| 602 | 602 | emu_timer *timer = _timer_alloc_common(callback, ptr, file, line, func, TRUE); |
| 603 | 603 | timer_adjust_oneshot(timer, duration, param); |
| r1877 | r1878 | |
|---|---|---|
| 368 | 368 | case MCONFIG_TOKEN_CPU_VBLANK_INT: |
| 369 | 369 | assert(cpu != NULL); |
| 370 | 370 | TOKEN_UNGET_UINT32(tokens); |
| 371 | TOKEN_GET_UINT32_UNPACK1(tokens, entrytype, 8); | |
| 372 | cpu->vblank_interrupt_screen = TOKEN_GET_STRING(tokens); | |
| 373 | cpu->vblank_interrupt = TOKEN_GET_PTR(tokens, interrupt); | |
| 374 | cpu->vblank_interrupts_per_frame = 1; | |
| 375 | break; | |
| 376 | ||
| 377 | case MCONFIG_TOKEN_CPU_VBLANK_INT_HACK: | |
| 378 | assert(cpu != NULL); | |
| 379 | TOKEN_UNGET_UINT32(tokens); | |
| 371 | 380 | TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, cpu->vblank_interrupts_per_frame, 24); |
| 372 | 381 | cpu->vblank_interrupt = TOKEN_GET_PTR(tokens, interrupt); |
| 373 | 382 | break; |
| r1877 | r1878 | |
|---|---|---|
| 7946 | 7946 | { |
| 7947 | 7947 | switch(size) |
| 7948 | 7948 | { |
| 7949 | case kSearchSize_8Bit: | |
| 7950 | case kSearchSize_1Bit: | |
| 7951 | default: | |
| 7952 | buf[0] = (data >> 0) & 0xFF; | |
| 7953 | buf[1] = 0; | |
| 7954 | ||
| 7955 | return 1; | |
| 7956 | ||
| 7957 | 7949 | case kSearchSize_16Bit: |
| 7958 | 7950 | buf[0] = (data >> 8) & 0xFF; |
| 7959 | 7951 | buf[1] = (data >> 0) & 0xFF; |
| r1877 | r1878 | |
| 7977 | 7969 | buf[4] = 0; |
| 7978 | 7970 | |
| 7979 | 7971 | return 4; |
| 7972 | ||
| 7973 | case kSearchSize_8Bit: | |
| 7974 | case kSearchSize_1Bit: | |
| 7975 | default: | |
| 7976 | buf[0] = (data >> 0) & 0xFF; | |
| 7977 | buf[1] = 0; | |
| 7978 | ||
| 7979 | return 1; | |
| 7980 | ||
| 7980 | 7981 | } |
| 7981 | 7982 | |
| 7982 | buf[0] = 0; | |
| 7983 | return 0; | |
| 7984 | 7983 | } |
| 7985 | 7984 | |
| 7986 | 7985 | /*--------------------------------------------- |
| r1877 | r1878 | |
| 8923 | 8922 | |
| 8924 | 8923 | static UINT8 DefaultEnableRegion(running_machine *machine, SearchRegion * region, SearchInfo * info) |
| 8925 | 8924 | { |
| 8926 | write8_ | |
| 8925 | write8_machin | |
| 8927 | 8926 | FPTR handlerAddress = (FPTR)handler; |
| 8928 | 8927 | |
| 8929 | 8928 | switch(info->searchSpeed) |
| r1877 | r1878 | |
| 11247 | 11246 | |
| 11248 | 11247 | case kOperation_AddSubtract: |
| 11249 | 11248 | { |
| 11250 | INT32 | |
| 11249 | //INT32 temp, bound; | |
| 11251 | 11250 | |
| 11252 | 11251 | /* ----- if extend data field is invalid, direct return ----- */ |
| 11253 | 11252 | //if(action->flags & kActionFlag_IgnoreMask) |
| 11254 | 11253 | return; |
| 11255 | 11254 | |
| 11255 | /* FIXME: AddSubstract looks seriously broken | |
| 11256 | * and being worked on. */ | |
| 11257 | #if 0 | |
| 11256 | 11258 | temp = ReadData(action); |
| 11257 | 11259 | |
| 11258 | 11260 | /* ----- OperationParameter field stores add/subtract ----- */ |
| r1877 | r1878 | |
| 11274 | 11276 | } |
| 11275 | 11277 | |
| 11276 | 11278 | WriteData(action, temp); |
| 11279 | #endif | |
| 11277 | 11280 | } |
| 11278 | 11281 | break; |
| 11279 | 11282 |
| r1877 | r1878 | |
|---|---|---|
| 170 | 170 | -------------------------------------------------*/ |
| 171 | 171 | |
| 172 | 172 | /* texture scaling callback */ |
| 173 | typedef void (*texture_scaler)( | |
| 173 | typedef void (*texture_scaler_func)( | |
| 174 | 174 | |
| 175 | 175 | |
| 176 | 176 | |
| r1877 | r1878 | |
| 376 | 376 | void render_target_set_max_texture_size(render_target *target, int maxwidth, int maxheight); |
| 377 | 377 | |
| 378 | 378 | /* compute the visible area for the given target with the current layout and proposed new parameters */ |
| 379 | void render_target_compute_visible_area(render_target *target, INT32 target_width, INT32 target_height, float target_pixel_aspect, | |
| 379 | void render_target_compute_visible_area(render_target *target, INT32 target_width, INT32 target_height, float target_pixel_aspect, int | |
| 380 | 380 | |
| 381 | 381 | /* get the "minimum" size of a target, which is the smallest bounds that will ensure at least |
| 382 | 382 | 1 target pixel per source pixel for all included screens */ |
| r1877 | r1878 | |
| 390 | 390 | /* ----- render texture management ----- */ |
| 391 | 391 | |
| 392 | 392 | /* allocate a new texture */ |
| 393 | render_texture *render_texture_alloc(texture_scaler scaler, void *param); | |
| 393 | render_texture *render_texture_alloc(texture_scaler_func scaler, void *param); | |
| 394 | 394 | |
| 395 | 395 | /* free an allocated texture */ |
| 396 | 396 | void render_texture_free(render_texture *texture); |
| 397 | 397 | |
| 398 | 398 | /* set a new source bitmap */ |
| 399 | void render_texture_set_bitmap(render_texture *texture, | |
| 399 | void render_texture_set_bitmap(render_texture *texture, | |
| 400 | 400 | |
| 401 | 401 | /* generic high quality resampling scaler */ |
| 402 | void render_texture_hq_scale( | |
| 402 | void render_texture_hq_scale( | |
| 403 | 403 | |
| 404 | 404 | |
| 405 | 405 | |
| r1877 | r1878 | |
| 460 | 460 | void render_container_set_yoffset(render_container *container, float yoffset); |
| 461 | 461 | |
| 462 | 462 | /* set the overlay bitmap for the container */ |
| 463 | void render_container_set_overlay(render_container *container, | |
| 463 | void render_container_set_overlay(render_container *container, | |
| 464 | 464 | |
| 465 | 465 | /* return a pointer to the UI container */ |
| 466 | 466 | render_container *render_container_get_ui(void); |
| r1877 | r1878 | |
|---|---|---|
| 86 | 86 | int state_save_get_reg_count(void); |
| 87 | 87 | |
| 88 | 88 | void state_save_register_memory(const char *module, UINT32 instance, const char *name, void *val, UINT32 valsize, UINT32 valcount); |
| 89 | void state_save_register_bitmap(const char *module, UINT32 instance, const char *name, | |
| 89 | void state_save_register_bitmap(const char *module, UINT32 instance, const char *name, | |
| 90 | 90 | |
| 91 | 91 | void state_save_register_func_presave(void (*func)(void)); |
| 92 | 92 | void state_save_register_func_postload(void (*func)(void)); |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | ***************************************************************************/ |
| 55 | 55 | |
| 56 | 56 | /* a timer callback looks like this */ |
| 57 | typedef void (*timer_c | |
| 57 | typedef void (*timer_fired_func | |
| 58 | 58 | |
| 59 | 59 | /* opaque type for representing a timer */ |
| 60 | 60 | typedef struct _emu_timer emu_timer; |
| r1877 | r1878 | |
| 106 | 106 | /* ----- core timer management ----- */ |
| 107 | 107 | |
| 108 | 108 | /* allocate a permament timer that isn't primed yet */ |
| 109 | emu_timer *_timer_alloc_internal(timer_c | |
| 109 | emu_timer *_timer_alloc_internal(timer_fired_func | |
| 110 | 110 | |
| 111 | 111 | /* adjust the time when this timer will fire and disable any periodic firings */ |
| 112 | 112 | void timer_adjust_oneshot(emu_timer *which, attotime duration, INT32 param); |
| r1877 | r1878 | |
| 119 | 119 | /* ----- anonymous timer management ----- */ |
| 120 | 120 | |
| 121 | 121 | /* allocate a one-shot timer, which calls the callback after the given duration */ |
| 122 | void _timer_set_internal(attotime druation, void *ptr, INT32 param, timer_c | |
| 122 | void _timer_set_internal(attotime druation, void *ptr, INT32 param, timer_fired_func | |
| 123 | 123 | |
| 124 | 124 | /* allocate a pulse timer, which repeatedly calls the callback using the given period */ |
| 125 | void _timer_pulse_internal(attotime period, void *ptr, INT32 param, timer_c | |
| 125 | void _timer_pulse_internal(attotime period, void *ptr, INT32 param, timer_fired_func | |
| 126 | 126 | |
| 127 | 127 | |
| 128 | 128 |
| r1877 | r1878 | |
|---|---|---|
| 683 | 683 | for ( ; !IS_AMENTRY_END(map); map++) |
| 684 | 684 | if (!IS_AMENTRY_EXTENDED(map)) |
| 685 | 685 | { |
| 686 | int ismatchmask = ((map->flags & AM_FLAGS_MATCH_MASK) != 0); | |
| 687 | 686 | UINT32 start = SPACE_SHIFT(map->start); |
| 688 | UINT32 end = | |
| 687 | UINT32 end = | |
| 689 | 688 | |
| 689 | /* look for inverted start/end pairs */ | |
| 690 | if (end < start) | |
| 690 | 691 | { |
| 691 | /* look for inverted start/end pairs */ | |
| 692 | if (end < start) | |
| 693 | { | |
| 694 | mame_printf_error("%s: %s wrong %s memory read handler start = %08x > end = %08x\n", driver->source_file, driver->name, spacename[spacenum], map->start, map->end); | |
| 695 | error = TRUE; | |
| 696 | } | |
| 692 | mame_printf_error("%s: %s wrong %s memory read handler start = %08x > end = %08x\n", driver->source_file, driver->name, spacename[spacenum], map->start, map->end); | |
| 693 | error = TRUE; | |
| 694 | } | |
| 697 | 695 | |
| 698 | /* look for misaligned entries */ | |
| 699 | if ((start & (alignunit-1)) != 0 || (end & (alignunit-1)) != (alignunit-1)) | |
| 700 | { | |
| 701 | mame_printf_error("%s: %s wrong %s memory read handler start = %08x, end = %08x ALIGN = %d\n", driver->source_file, driver->name, spacename[spacenum], map->start, map->end, alignunit); | |
| 702 | error = TRUE; | |
| 703 | } | |
| 696 | /* look for misaligned entries */ | |
| 697 | if ((start & (alignunit-1)) != 0 || (end & (alignunit-1)) != (alignunit-1)) | |
| 698 | { | |
| 699 | mame_printf_error("%s: %s wrong %s memory read handler start = %08x, end = %08x ALIGN = %d\n", driver->source_file, driver->name, spacename[spacenum], map->start, map->end, alignunit); | |
| 700 | error = TRUE; | |
| 701 | } | |
| 704 | 702 | |
| 705 | /* if this is a program space, auto-assign implicit ROM entries */ | |
| 706 | if ((FPTR)map->read.handler == STATIC_ROM && !map->region) | |
| 707 | { | |
| 708 | map->region = REGION_CPU1 + cpunum; | |
| 709 | map->region_offs = map->start; | |
| 710 | } | |
| 703 | /* if this is a program space, auto-assign implicit ROM entries */ | |
| 704 | if ((FPTR)map->read.handler == STATIC_ROM && !map->region) | |
| 705 | { | |
| 706 | map->region = REGION_CPU1 + cpunum; | |
| 707 | map->region_offs = map->start; | |
| 708 | } | |
| 711 | 709 | |
| 712 | /* if this entry references a memory region, validate it */ | |
| 713 | if (map->region && map->share == 0) | |
| 710 | /* if this entry references a memory region, validate it */ | |
| 711 | if (map->region && map->share == 0) | |
| 712 | { | |
| 713 | offs_t length = region_length[map->region]; | |
| 714 | ||
| 715 | if (length == 0) | |
| 714 | 716 | { |
| 715 | offs_t length = region_length[map->region]; | |
| 716 | ||
| 717 | if (length == 0) | |
| 718 | { | |
| 719 | mame_printf_error("%s: %s CPU %d space %d memory map entry %X-%X references non-existant region %d\n", driver->source_file, driver->name, cpunum, spacenum, map->start, map->end, map->region); | |
| 720 | error = TRUE; | |
| 721 | } | |
| 722 | else if (map->region_offs + (end - start + 1) > length) | |
| 723 | { | |
| 724 | mame_printf_error("%s: %s CPU %d space %d memory map entry %X-%X extends beyond region %d size (%X)\n", driver->source_file, driver->name, cpunum, spacenum, map->start, map->end, map->region, length); | |
| 725 | error = TRUE; | |
| 726 | } | |
| 717 | mame_printf_error("%s: %s CPU %d space %d memory map entry %X-%X references non-existant region %d\n", driver->source_file, driver->name, cpunum, spacenum, map->start, map->end, map->region); | |
| 718 | error = TRUE; | |
| 727 | 719 | } |
| 728 | ||
| 729 | /* If this is a match/mask, make sure the match bits are present in the mask */ | |
| 730 | if (ismatchmask && (start & end) != start) | |
| 720 | else if (map->region_offs + (end - start + 1) > length) | |
| 731 | 721 | { |
| 732 | mame_printf_error("%s: %s CPU %d space %d memory map entry | |
| 722 | mame_printf_error("%s: %s CPU %d space %d memory map entry | |
| 733 | 723 | error = TRUE; |
| 734 | 724 | } |
| 735 | 725 | } |
| 726 | ||
| 727 | /* make sure all devices exist */ | |
| 728 | if (map->read_devtype != NULL && device_list_find_by_tag(config->devicelist, map->read_devtype, map->read_devtag) == NULL) | |
| 729 | { | |
| 730 | mame_printf_error("%s: %s CPU %d space %d memory map entry references nonexistant device type %s, tag %s\n", driver->source_file, driver->name, cpunum, spacenum, devtype_name(map->read_devtype), map->read_devtag); | |
| 731 | error = TRUE; | |
| 732 | } | |
| 733 | if (map->write_devtype != NULL && device_list_find_by_tag(config->devicelist, map->write_devtype, map->write_devtag) == NULL) | |
| 734 | { | |
| 735 | mame_printf_error("%s: %s CPU %d space %d memory map entry references nonexistant device type %s, tag %s\n", driver->source_file, driver->name, cpunum, spacenum, devtype_name(map->write_devtype), map->write_devtag); | |
| 736 | error = TRUE; | |
| 737 | } | |
| 736 | 738 | } |
| 737 | 739 | else |
| 738 | 740 | { |
| r1877 | r1878 | |
| 759 | 761 | } |
| 760 | 762 | } |
| 761 | 763 | } |
| 764 | ||
| 765 | /* validate the interrupts */ | |
| 766 | if (cpu->vblank_interrupt != NULL) | |
| 767 | { | |
| 768 | if (video_screen_count(config) == 0) | |
| 769 | { | |
| 770 | mame_printf_error("%s: %s cpu #%d has a VBLANK interrupt, but the driver is screenless !\n", driver->source_file, driver->name, cpunum); | |
| 771 | error = TRUE; | |
| 772 | } | |
| 773 | else if (cpu->vblank_interrupts_per_frame == 0) | |
| 774 | { | |
| 775 | mame_printf_error("%s: %s cpu #%d has a VBLANK interrupt handler with 0 interrupts!\n", driver->source_file, driver->name, cpunum); | |
| 776 | error = TRUE; | |
| 777 | } | |
| 778 | else if (cpu->vblank_interrupts_per_frame == 1) | |
| 779 | { | |
| 780 | if (cpu->vblank_interrupt_screen == NULL) | |
| 781 | { | |
| 782 | mame_printf_error("%s: %s cpu #%d has a valid VBLANK interrupt handler with no screen tag supplied!\n", driver->source_file, driver->name, cpunum); | |
| 783 | error = TRUE; | |
| 784 | } | |
| 785 | else if (device_list_index(config->devicelist, VIDEO_SCREEN, cpu->vblank_interrupt_screen) == -1) | |
| 786 | { | |
| 787 | mame_printf_error("%s: %s cpu #%d VBLANK interrupt with a non-existant screen tag (%s)!\n", driver->source_file, driver->name, cpunum, cpu->vblank_interrupt_screen); | |
| 788 | error = TRUE; | |
| 789 | } | |
| 790 | } | |
| 791 | } | |
| 792 | else if (cpu->vblank_interrupts_per_frame != 0) | |
| 793 | { | |
| 794 | mame_printf_error("%s: %s cpu #%d has no VBLANK interrupt handler but a non-0 interrupt count is given!\n", driver->source_file, driver->name, cpunum); | |
| 795 | error = TRUE; | |
| 796 | } | |
| 797 | ||
| 798 | if ((cpu->timed_interrupt != NULL) && (cpu->timed_interrupt_period == 0)) | |
| 799 | { | |
| 800 | mame_printf_error("%s: %s cpu #%d has a timer interrupt handler with 0 period!\n", driver->source_file, driver->name, cpunum); | |
| 801 | error = TRUE; | |
| 802 | } | |
| 803 | else if ((cpu->timed_interrupt == NULL) && (cpu->timed_interrupt_period != 0)) | |
| 804 | { | |
| 805 | mame_printf_error("%s: %s cpu #%d has a no timer interrupt handler but has a non-0 period given!\n", driver->source_file, driver->name, cpunum); | |
| 806 | error = TRUE; | |
| 807 | } | |
| 762 | 808 | } |
| 763 | 809 | } |
| 764 | 810 |
| r1877 | r1878 | |
|---|---|---|
| 48 | 48 | MCONFIG_TOKEN_CPU_DATA_MAP, |
| 49 | 49 | MCONFIG_TOKEN_CPU_IO_MAP, |
| 50 | 50 | MCONFIG_TOKEN_CPU_VBLANK_INT, |
| 51 | MCONFIG_TOKEN_CPU_VBLANK_INT_HACK, | |
| 51 | 52 | MCONFIG_TOKEN_CPU_PERIODIC_INT, |
| 52 | 53 | |
| 53 | 54 | MCONFIG_TOKEN_DRIVER_DATA, |
| r1877 | r1878 | |
| 138 | 139 | void (*video_start)(running_machine *machine); /* one-time video start callback */ |
| 139 | 140 | void (*video_reset)(running_machine *machine); /* video reset callback */ |
| 140 | 141 | void (*video_eof)(running_machine *machine); /* end-of-frame video callback */ |
| 141 | UINT32 (*video_update)(running_machine *machine, int screen, | |
| 142 | UINT32 (*video_update)(running_machine *machine, int screen, | |
| 142 | 143 | |
| 143 | 144 | sound_config sound[MAX_SOUND]; /* array of sound chips in the system */ |
| 144 | 145 | |
| r1877 | r1878 | |
| 188 | 189 | |
| 189 | 190 | /* use this to declare external references to a machine driver */ |
| 190 | 191 | #define MACHINE_DRIVER_EXTERN(_name) \ |
| 191 | extern const machine_config_token machine_config_##_name[] | |
| 192 | extern const machine_config_token machine_config_##_name[] | |
| 192 | 193 | |
| 193 | 194 | |
| 194 | 195 | /* importing data from other machine drivers */ |
| r1877 | r1878 | |
| 284 | 285 | TOKEN_PTR(voidptr, construct_map_##_map1), \ |
| 285 | 286 | TOKEN_PTR(voidptr, construct_map_##_map2), \ |
| 286 | 287 | |
| 287 | #define MDRV_CPU_VBLANK_INT(_func, _rate) \ | |
| 288 | TOKEN_UINT32_PACK2(MCONFIG_TOKEN_CPU_VBLANK_INT, 8, _rate, 24), \ | |
| 288 | #define MDRV_CPU_VBLANK_INT(_tag, _func) \ | |
| 289 | TOKEN_UINT32_PACK1(MCONFIG_TOKEN_CPU_VBLANK_INT, 8), \ | |
| 290 | TOKEN_STRING(_tag), \ | |
| 289 | 291 | TOKEN_PTR(interrupt, _func), |
| 290 | 292 | |
| 291 | 293 | #define MDRV_CPU_PERIODIC_INT(_func, _rate) \ |
| r1877 | r1878 | |
|---|---|---|
| 65 | 65 | XTAL_10MHz = 10000000, |
| 66 | 66 | XTAL_10_595MHz = 10595000, /* Mad Alien */ |
| 67 | 67 | XTAL_10_738635MHz = 10738635, /* TMS9918 family */ |
| 68 | XTAL_11MHz = 11000000, /* Mario I8039 sound */ | |
| 68 | XTAL_11MHz = 11000000, /* Mario I8039 sound */ | |
| 69 | 69 | XTAL_11_0592MHz = 11059200, /* Lethal Justice */ |
| 70 | 70 | XTAL_11_2MHz = 11200000, /* New York, New York */ |
| 71 | 71 | XTAL_11_289MHz = 11289000, /* Vanguard */ |
| r1877 | r1878 | |
| 82 | 82 | XTAL_14_31818MHz = 14318180, /* Extremely common, used on 100's of PCBs */ |
| 83 | 83 | XTAL_14_705882MHz = 14705882, /* Aleck64 */ |
| 84 | 84 | XTAL_14_7456MHz = 14745600, /* Namco System 12 & System Super 22/23 for H8/3002 CPU */ |
| 85 | XTAL_15MHz = 15000000, /* Sinclair QL */ | |
| 85 | XTAL_15MHz = 15000000, /* Sinclair QL */ | |
| 86 | 86 | XTAL_15_468MHz = 15468000, /* Bank Panic h/w, Sega G80 */ |
| 87 | 87 | XTAL_16MHz = 16000000, /* Extremely common, used on 100's of PCBs */ |
| 88 | 88 | XTAL_16_9344MHz = 16934400, /* Usually used to drive 90's Yamaha OPL/FM chips */ |
| 89 | 89 | XTAL_17_73447MHz = 17734470, /* 4 times the PAL subcarrier */ |
| 90 | 90 | XTAL_18MHz = 18000000, /* S.A.R, Ikari Warriors 3 */ |
| 91 | 91 | XTAL_18_432MHz = 18432000, /* Extremely common, used on 100's of PCBs */ |
| 92 | XTAL_19_968MHz = 19968000, /* Used mostly by Space Invaders games by Taito/Midway and clones */ | |
| 92 | XTAL_19_923MHz = 19923000, /* Cinematronics vectors */ | |
| 93 | XTAL_19_968MHz = 19968000, /* Used mostly by some Taito games */ | |
| 93 | 94 | XTAL_20MHz = 20000000, |
| 94 | 95 | XTAL_21MHz = 21000000, /* Lock-On pixel clock */ |
| 95 | 96 | XTAL_21_3MHz = 21300000, |
| r1877 | r1878 | |
| 105 | 106 | XTAL_27_164MHz = 27164000, /* Typically used on 90's Taito PCBs to drive the custom chips */ |
| 106 | 107 | XTAL_28MHz = 28000000, |
| 107 | 108 | XTAL_28_37516MHz = 28375160, /* Amiga PAL systems */ |
| 108 | XTAL_28_63636MHz = 28636360, /* later Leland games and Atari GT, Amiga NTSC */ | |
| 109 | XTAL_28_63636MHz = 28636360, /* later Leland games and Atari GT, Amiga NTSC , Raiden2 h/w */ | |
| 109 | 110 | XTAL_30_4761MHz = 30476100, /* Taito JC */ |
| 110 | 111 | XTAL_32MHz = 32000000, |
| 111 | 112 | XTAL_32_22MHz = 32220000, /* Typically used on 90's Data East PCBs */ |
| r1877 | r1878 | |
| 142 | 143 | XTAL_400kHz = 400000, /* Used on Great Swordman h/w */ |
| 143 | 144 | XTAL_455kHz = 455000, /* Used on Gladiator h/w */ |
| 144 | 145 | XTAL_640kHz = 640000, |
| 145 | XTAL_1_056MHz | |
| 146 | XTAL_1_056MHz | |
| 146 | 147 | }; |
| 147 | 148 | |
| 148 | 149 |
| r1877 | r1878 | |
|---|---|---|
| 176 | 176 | typedef struct _chd_file chd_file; |
| 177 | 177 | |
| 178 | 178 | |
| 179 | /* progress callback function */ | |
| 180 | typedef void (*chd_progress_printf)(const char *format, ...); | |
| 181 | ||
| 182 | ||
| 183 | 179 | /* extract header structure (NOT the on-disk header structure) */ |
| 184 | 180 | typedef struct _chd_header chd_header; |
| 185 | 181 | struct _chd_header |
| r1877 | r1878 | |
|---|---|---|
| 28 | 28 | #define VERBOSE (0) |
| 29 | 29 | #if VERBOSE |
| 30 | 30 | #define LOG(x) do { if (VERBOSE) logerror x; } while (0) |
| 31 | void CLIB_DECL logerror(const char *text,...); | |
| 31 | 32 | #else |
| 32 | 33 | #define LOG(x) |
| 33 | 34 | #endif |
| 34 | 35 | |
| 35 | void CLIB_DECL logerror(const char *text,...); | |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 |
| r1877 | r1878 | |
|---|---|---|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| 61 | #ifdef UNUSED_FUNCTON | |
| 61 | 62 | INLINE UINT16 fetch_16bit(UINT8 *v) |
| 62 | 63 | { |
| 63 | 64 | return BIG_ENDIANIZE_INT16(*(UINT16 *)v); |
| 64 | 65 | } |
| 66 | #endif | |
| 65 | 67 | |
| 66 | ||
| 67 | 68 | INLINE UINT32 fetch_32bit(UINT8 *v) |
| 68 | 69 | { |
| 69 | 70 | return BIG_ENDIANIZE_INT32(*(UINT32 *)v); |
| r1877 | r1878 | |
| 76 | 77 | } |
| 77 | 78 | |
| 78 | 79 | |
| 80 | #ifdef UNUSED_FUNCTON | |
| 79 | 81 | INLINE void put_16bit(UINT8 *v, UINT16 data) |
| 80 | 82 | { |
| 81 | 83 | *(UINT16 *)v = BIG_ENDIANIZE_INT16(data); |
| 82 | 84 | } |
| 85 | #endif | |
| 83 | 86 | |
| 84 | ||
| 85 | 87 | INLINE void put_32bit(UINT8 *v, UINT32 data) |
| 86 | 88 | { |
| 87 | 89 | *(UINT32 *)v = BIG_ENDIANIZE_INT32(data); |
| r1877 | r1878 | |
|---|---|---|
| 67 | 67 | *********************************************************************/ |
| 68 | 68 | |
| 69 | 69 | #include "driver.h" |
| 70 | #include "deprecat.h" | |
| 70 | 71 | #include "cococart.h" |
| 71 | 72 | #include "coco_vhd.h" |
| 72 | 73 | #include "includes/coco.h" |
| r1877 | r1878 | |
| 281 | 282 | |
| 282 | 283 | static UINT8 fdc_coco_r(coco_cartridge *cartridge, UINT16 addr) |
| 283 | 284 | { |
| 285 | running_machine *machine = Machine; | |
| 284 | 286 | UINT8 result = 0; |
| 285 | 287 | switch(addr & 0xEF) |
| 286 | 288 | { |
| 287 | 289 | case 8: |
| 288 | result = wd17xx_status_r(0); | |
| 290 | result = wd17xx_status_r(machine, 0); | |
| 289 | 291 | break; |
| 290 | 292 | case 9: |
| 291 | result = wd17xx_track_r(0); | |
| 293 | result = wd17xx_track_r(machine, 0); | |
| 292 | 294 | break; |
| 293 | 295 | case 10: |
| 294 | result = wd17xx_sector_r(0); | |
| 296 | result = wd17xx_sector_r(machine, 0); | |
| 295 | 297 | break; |
| 296 | 298 | case 11: |
| 297 | result = wd17xx_data_r(0); | |
| 299 | result = wd17xx_data_r(machine, 0); | |
| 298 | 300 | break; |
| 299 | 301 | } |
| 300 | 302 | return result; |
| r1877 | r1878 | |
| 308 | 310 | |
| 309 | 311 | static void fdc_coco_w(coco_cartridge *cartridge, UINT16 addr, UINT8 data) |
| 310 | 312 | { |
| 313 | running_machine *machine = Machine; | |
| 311 | 314 | switch(addr & 0xEF) |
| 312 | 315 | { |
| 313 | 316 | case 0: case 1: case 2: case 3: |
| r1877 | r1878 | |
| 315 | 318 | fdc_coco_dskreg_w(cartridge, data); |
| 316 | 319 | break; |
| 317 | 320 | case 8: |
| 318 | wd17xx_command_w(0, data); | |
| 321 | wd17xx_command_w(machine, 0, data); | |
| 319 | 322 | break; |
| 320 | 323 | case 9: |
| 321 | wd17xx_track_w(0, data); | |
| 324 | wd17xx_track_w(machine, 0, data); | |
| 322 | 325 | break; |
| 323 | 326 | case 10: |
| 324 | wd17xx_sector_w(0, data); | |
| 327 | wd17xx_sector_w(machine, 0, data); | |
| 325 | 328 | break; |
| 326 | 329 | case 11: |
| 327 | wd17xx_data_w(0, data); | |
| 330 | wd17xx_data_w(machine, 0, data); | |
| 328 | 331 | break; |
| 329 | 332 | }; |
| 330 | 333 | } |
| r1877 | r1878 | |
| 386 | 389 | |
| 387 | 390 | static UINT8 fdc_coco3plus_r(coco_cartridge *cartridge, UINT16 addr) |
| 388 | 391 | { |
| 392 | running_machine *machine = Machine; | |
| 389 | 393 | UINT8 result = fdc_coco_r(cartridge, addr); |
| 390 | 394 | |
| 391 | 395 | switch(addr) |
| 392 | 396 | { |
| 393 | 397 | case 0x10: /* FF50 */ |
| 394 | 398 | if (real_time_clock() == RTC_DISTO) |
| 395 | result = msm6242_r(msm6242_rtc_address); | |
| 399 | result = msm6242_r(machine, msm6242_rtc_address); | |
| 396 | 400 | break; |
| 397 | 401 | |
| 398 | 402 | case 0x38: /* FF78 */ |
| 399 | 403 | if (real_time_clock() == RTC_CLOUD9) |
| 400 | ds1315_r_0(addr); | |
| 404 | ds1315_r_0(machine, addr); | |
| 401 | 405 | break; |
| 402 | 406 | |
| 403 | 407 | case 0x39: /* FF79 */ |
| 404 | 408 | if (real_time_clock() == RTC_CLOUD9) |
| 405 | ds1315_r_1(addr); | |
| 409 | ds1315_r_1(machine, addr); | |
| 406 | 410 | break; |
| 407 | 411 | |
| 408 | 412 | case 0x3C: /* FF7C */ |
| 409 | 413 | if (real_time_clock() == RTC_CLOUD9) |
| 410 | result = ds1315_r_data(addr); | |
| 414 | result = ds1315_r_data(machine, addr); | |
| 411 | 415 | break; |
| 412 | 416 | |
| 413 | 417 | case 0x40: |
| r1877 | r1878 | |
| 417 | 421 | case 0x44: |
| 418 | 422 | case 0x45: |
| 419 | 423 | if (device_count(IO_VHD) > 0) |
| 420 | result = coco_vhd_io_r(addr); | |
| 424 | result = coco_vhd_io_r(machine, addr); | |
| 421 | 425 | break; |
| 422 | 426 | } |
| 423 | 427 | return result; |
| r1877 | r1878 | |
| 431 | 435 | |
| 432 | 436 | static void fdc_coco3plus_w(coco_cartridge *cartridge, UINT16 addr, UINT8 data) |
| 433 | 437 | { |
| 438 | running_machine *machine = Machine; | |
| 439 | ||
| 434 | 440 | fdc_coco_w(cartridge, addr, data); |
| 435 | 441 | |
| 436 | 442 | switch(addr) |
| 437 | 443 | { |
| 438 | 444 | case 0x10: /* FF50 */ |
| 439 | 445 | if (real_time_clock() == RTC_DISTO) |
| 440 | msm6242_w(msm6242_rtc_address, data); | |
| 446 | msm6242_w(machine, msm6242_rtc_address, data); | |
| 441 | 447 | break; |
| 442 | 448 | |
| 443 | 449 | case 0x11: /* FF51 */ |
| r1877 | r1878 | |
| 452 | 458 | case 0x44: |
| 453 | 459 | case 0x45: |
| 454 | 460 | if (device_count(IO_VHD) > 0) |
| 455 | coco_vhd_io_w(addr, data); | |
| 461 | coco_vhd_io_w(machine, addr, data); | |
| 456 | 462 | break; |
| 457 | 463 | } |
| 458 | 464 | } |
| r1877 | r1878 | |
| 559 | 565 | |
| 560 | 566 | static UINT8 fdc_dragon_r(coco_cartridge *cartridge, UINT16 addr) |
| 561 | 567 | { |
| 568 | running_machine *machine = Machine; | |
| 562 | 569 | UINT8 result = 0; |
| 563 | 570 | switch(addr & 0xEF) |
| 564 | 571 | { |
| 565 | 572 | case 0: |
| 566 | result = wd17xx_status_r(0); | |
| 573 | result = wd17xx_status_r(machine, 0); | |
| 567 | 574 | break; |
| 568 | 575 | case 1: |
| 569 | result = wd17xx_track_r(0); | |
| 576 | result = wd17xx_track_r(machine, 0); | |
| 570 | 577 | break; |
| 571 | 578 | case 2: |
| 572 | result = wd17xx_sector_r(0); | |
| 579 | result = wd17xx_sector_r(machine, 0); | |
| 573 | 580 | break; |
| 574 | 581 | case 3: |
| 575 | result = wd17xx_data_r(0); | |
| 582 | result = wd17xx_data_r(machine, 0); | |
| 576 | 583 | break; |
| 577 | 584 | } |
| 578 | 585 | return result; |
| r1877 | r1878 | |
| 586 | 593 | |
| 587 | 594 | static void fdc_dragon_w(coco_cartridge *cartridge, UINT16 addr, UINT8 data) |
| 588 | 595 | { |
| 596 | running_machine *machine = Machine; | |
| 589 | 597 | switch(addr & 0xEF) |
| 590 | 598 | { |
| 591 | 599 | case 0: |
| 592 | wd17xx_command_w(0, data); | |
| 600 | wd17xx_command_w(machine, 0, data); | |
| 593 | 601 | |
| 594 | 602 | /* disk head is encoded in the command byte */ |
| 595 | 603 | /* Only for type 3 & 4 commands */ |
| r1877 | r1878 | |
| 597 | 605 | wd17xx_set_side((data & 0x02) ? 1 : 0); |
| 598 | 606 | break; |
| 599 | 607 | case 1: |
| 600 | wd17xx_track_w(0, data); | |
| 608 | wd17xx_track_w(machine, 0, data); | |
| 601 | 609 | break; |
| 602 | 610 | case 2: |
| 603 | wd17xx_sector_w(0, data); | |
| 611 | wd17xx_sector_w(machine, 0, data); | |
| 604 | 612 | break; |
| 605 | 613 | case 3: |
| 606 | wd17xx_data_w(0, data); | |
| 614 | wd17xx_data_w(machine, 0, data); | |
| 607 | 615 | break; |
| 608 | 616 | case 8: case 9: case 10: case 11: |
| 609 | 617 | case 12: case 13: case 14: case 15: |
| r1877 | r1878 | |
|---|---|---|
| 278 | 278 | static READ8_HANDLER ( to7_5p14_r ) |
| 279 | 279 | { |
| 280 | 280 | if ( offset < 4 ) |
| 281 | return wd17xx_r( offset ); | |
| 281 | return wd17xx_r( machine, offset ); | |
| 282 | 282 | else if ( offset == 8 ) |
| 283 | 283 | return to7_5p14_select; |
| 284 | 284 | else |
| r1877 | r1878 | |
| 291 | 291 | static WRITE8_HANDLER( to7_5p14_w ) |
| 292 | 292 | { |
| 293 | 293 | if ( offset < 4 ) |
| 294 | wd17xx_w( offset, data ); | |
| 294 | wd17xx_w( machine, offset, data ); | |
| 295 | 295 | else if ( offset == 8 ) |
| 296 | 296 | { |
| 297 | 297 | /* drive select */ |
| r1877 | r1878 | |
| 375 | 375 | static READ8_HANDLER ( to7_5p14sd_r ) |
| 376 | 376 | { |
| 377 | 377 | if ( offset < 8 ) |
| 378 | return mc6843_r( offset ); | |
| 378 | return mc6843_r( machine, offset ); | |
| 379 | 379 | else if ( offset >= 8 && offset <= 9 ) |
| 380 | 380 | return to7_5p14sd_select; |
| 381 | 381 | else |
| r1877 | r1878 | |
| 388 | 388 | static WRITE8_HANDLER( to7_5p14sd_w ) |
| 389 | 389 | { |
| 390 | 390 | if ( offset < 8 ) |
| 391 | mc6843_w( offset, data ); | |
| 391 | mc6843_w( machine, offset, data ); | |
| 392 | 392 | else if ( offset >= 8 && offset <= 9 ) |
| 393 | 393 | { |
| 394 | 394 | /* drive select */ |
| r1877 | r1878 | |
| 1711 | 1711 | static READ8_HANDLER ( to7_network_r ) |
| 1712 | 1712 | { |
| 1713 | 1713 | if ( offset >= 0 && offset < 4 ) |
| 1714 | return mc6854_r( offset ); | |
| 1714 | return mc6854_r( machine, offset ); | |
| 1715 | 1715 | |
| 1716 | 1716 | if ( offset == 8 ) |
| 1717 | 1717 | { |
| r1877 | r1878 | |
| 1730 | 1730 | static WRITE8_HANDLER ( to7_network_w ) |
| 1731 | 1731 | { |
| 1732 | 1732 | if ( offset >= 0 && offset < 4 ) |
| 1733 | mc6854_w( offset, data ); | |
| 1733 | mc6854_w( machine, offset, data ); | |
| 1734 | 1734 | else |
| 1735 | 1735 | { |
| 1736 | 1736 | logerror( "%f $%04x to7_network_w: invalid write offset %i (data=$%02X)\n", |
| r1877 | r1878 | |
| 1820 | 1820 | { |
| 1821 | 1821 | |
| 1822 | 1822 | case 1: |
| 1823 | return to7_5p14sd_r( offset ); | |
| 1823 | return to7_5p14sd_r( machine, offset ); | |
| 1824 | 1824 | |
| 1825 | 1825 | case 2: |
| 1826 | return to7_5p14_r( offset ); | |
| 1826 | return to7_5p14_r( machine, offset ); | |
| 1827 | 1827 | |
| 1828 | 1828 | case 3: |
| 1829 | return thmfc_floppy_r( offset ); | |
| 1829 | return thmfc_floppy_r( machine, offset ); | |
| 1830 | 1830 | |
| 1831 | 1831 | case 4: |
| 1832 | return to7_qdd_r( offset ); | |
| 1832 | return to7_qdd_r( machine, offset ); | |
| 1833 | 1833 | |
| 1834 | 1834 | case 5: |
| 1835 | return to7_network_r( offset ); | |
| 1835 | return to7_network_r( machine, offset ); | |
| 1836 | 1836 | } |
| 1837 | 1837 | |
| 1838 | 1838 | return 0; |
| r1877 | r1878 | |
| 1846 | 1846 | { |
| 1847 | 1847 | |
| 1848 | 1848 | case 1: |
| 1849 | to7_5p14sd_w( offset, data ); | |
| 1849 | to7_5p14sd_w( machine, offset, data ); | |
| 1850 | 1850 | return; |
| 1851 | 1851 | |
| 1852 | 1852 | case 2: |
| 1853 | to7_5p14_w( offset, data ); | |
| 1853 | to7_5p14_w( machine, offset, data ); | |
| 1854 | 1854 | break; |
| 1855 | 1855 | |
| 1856 | 1856 | case 3: |
| r1877 | r1878 | |
| 1861 | 1861 | VLOG (( "to7_floppy_w: set CD 90-351 ROM bank to %i\n", data & 3 )); |
| 1862 | 1862 | } |
| 1863 | 1863 | else |
| 1864 | thmfc_floppy_w( offset, data ); | |
| 1864 | thmfc_floppy_w( machine, offset, data ); | |
| 1865 | 1865 | break; |
| 1866 | 1866 | |
| 1867 | 1867 | case 4: |
| 1868 | to7_qdd_w( offset, data ); | |
| 1868 | to7_qdd_w( machine, offset, data ); | |
| 1869 | 1869 | break; |
| 1870 | 1870 | |
| 1871 | 1871 | case 5: |
| 1872 | to7_network_w( offset, data ); | |
| 1872 | to7_network_w( machine, offset, data ); | |
| 1873 | 1873 | break; |
| 1874 | 1874 | } |
| 1875 | 1875 | } |
| r1877 | r1878 | |
| 1912 | 1912 | READ8_HANDLER ( to9_floppy_r ) |
| 1913 | 1913 | { |
| 1914 | 1914 | if ( THOM_FLOPPY_EXT ) |
| 1915 | return to7_floppy_r( offset ); | |
| 1915 | return to7_floppy_r( machine, offset ); | |
| 1916 | 1916 | else |
| 1917 | return to7_5p14_r( offset ); | |
| 1917 | return to7_5p14_r( machine, offset ); | |
| 1918 | 1918 | } |
| 1919 | 1919 | |
| 1920 | 1920 | WRITE8_HANDLER ( to9_floppy_w ) |
| 1921 | 1921 | { |
| 1922 | 1922 | if ( THOM_FLOPPY_EXT ) |
| 1923 | to7_floppy_w( offset, data ); | |
| 1923 | to7_floppy_w( machine, offset, data ); | |
| 1924 | 1924 | else |
| 1925 | to7_5p14_w( offset, data ); | |
| 1925 | to7_5p14_w( machine, offset, data ); | |
| 1926 | 1926 | } |
| r1877 | r1878 | |
|---|---|---|
| 122 | 122 | |
| 123 | 123 | WRITE8_HANDLER(crtc6845_0_address_w) |
| 124 | 124 | { |
| 125 | mc6845_address_w(mslegacy_mc6845, data); | |
| 125 | device_config *devconf = (device_config *) device_list_find_by_tag(machine->config->devicelist, MC6845, "crtc"); | |
| 126 | mc6845_address_w(devconf, offset, data); | |
| 126 | 127 | } |
| 127 | 128 | |
| 128 | 129 | |
| 129 | 130 | |
| 130 | 131 | READ8_HANDLER(crtc6845_0_register_r) |
| 131 | 132 | { |
| 132 | return mc6845_register_r(mslegacy_mc6845); | |
| 133 | device_config *devconf = (device_config *) device_list_find_by_tag(machine->config->devicelist, MC6845, "crtc"); | |
| 134 | return mc6845_register_r(devconf, offset); | |
| 133 | 135 | } |
| 134 | 136 | |
| 135 | 137 | |
| 136 | 138 | |
| 137 | 139 | WRITE8_HANDLER(crtc6845_0_register_w) |
| 138 | 140 | { |
| 139 | mc6845_register_w(mslegacy_mc6845, data); | |
| 141 | device_config *devconf = (device_config *) device_list_find_by_tag(machine->config->devicelist, MC6845, "crtc"); | |
| 142 | mc6845_register_w(devconf, offset, data); | |
| 140 | 143 | } |
| 141 | 144 | |
| 142 | 145 |
| r1877 | r1878 | |
|---|---|---|
| 131 | 131 | |
| 132 | 132 | UINT8 *memory_install_ram8_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t ram_offset, int bank) |
| 133 | 133 | { |
| 134 | read8_handler read_bank = (read8_handler) (FPTR)(STATIC_BANK1 + bank - 1); | |
| 135 | write8_handler write_bank = (write8_handler) (FPTR)(STATIC_BANK1 + bank - 1); | |
| 134 | read8_machine_func read_bank = (read8_machine_func) (FPTR)(STATIC_BANK1 + bank - 1); | |
| 135 | write8_machine_func write_bank = (write8_machine_func) (FPTR)(STATIC_BANK1 + bank - 1); | |
| 136 | 136 | offs_t bank_size = end - start + 1; |
| 137 | 137 | |
| 138 | 138 | memory_set_bankptr(bank, mess_ram + ram_offset); |
| r1877 | r1878 | |
|---|---|---|
| 59 | 59 | void pc_sh_speaker(int data) |
| 60 | 60 | { |
| 61 | 61 | int mode = 0; |
| 62 | pit8253_0_gate_w(2, data & 1); | |
| 62 | pit8253_0_gate_w(Machine, 2, data & 1); | |
| 63 | 63 | |
| 64 | 64 | switch( data ) |
| 65 | 65 | { |
| r1877 | r1878 | |
|---|---|---|
| 83 | 83 | /* configuration parameters */ |
| 84 | 84 | |
| 85 | 85 | int channel; /* first argument for DAC_data_w */ |
| 86 | write8_ | |
| 86 | write8_machin | |
| 87 | 87 | |
| 88 | 88 | /* state */ |
| 89 | 89 | |
| r1877 | r1878 | |
| 200 | 200 | (mea8000.state == MEA8000_STARTED && mea8000.bufpos < 4); |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | static void mea8000_update_req( | |
| 203 | static void mea8000_update_req( running_machine *machine ) | |
| 204 | 204 | { |
| 205 | 205 | /* actually, req pulses less than 3us for each new byte, |
| 206 | 206 | it goes back up if there space left in the buffer, or stays low if the |
| r1877 | r1878 | |
| 208 | 208 | frame end to compose a new frame. |
| 209 | 209 | */ |
| 210 | 210 | if (mea8000.req_out_func) |
| 211 | mea8000.req_out_func(0, mea8000_accept_byte()); | |
| 211 | mea8000.req_out_func(machine, 0, mea8000_accept_byte()); | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | |
| r1877 | r1878 | |
| 520 | 520 | LOG(( "%f mea8000_timer_expire: stop frame\n", attotime_to_double(timer_get_time()) )); |
| 521 | 521 | mea8000_stop_frame(); |
| 522 | 522 | } |
| 523 | mea8000_update_req(); | |
| 523 | mea8000_update_req(machine); | |
| 524 | 524 | } |
| 525 | 525 | else |
| 526 | 526 | { |
| r1877 | r1878 | |
| 593 | 593 | mea8000.state = MEA8000_STARTED; |
| 594 | 594 | } |
| 595 | 595 | } |
| 596 | mea8000_update_req(); | |
| 596 | mea8000_update_req(machine); | |
| 597 | 597 | break; |
| 598 | 598 | |
| 599 | 599 | case 1: /* command register */ |
| r1877 | r1878 | |
| 613 | 613 | activecpu_get_previouspc(), attotime_to_double(timer_get_time()), data, |
| 614 | 614 | stop, mea8000.cont, mea8000.roe )); |
| 615 | 615 | |
| 616 | mea8000_update_req(); | |
| 616 | mea8000_update_req(machine); | |
| 617 | 617 | break; |
| 618 | 618 | } |
| 619 | 619 | |
| r1877 | r1878 | |
| 628 | 628 | |
| 629 | 629 | |
| 630 | 630 | |
| 631 | void mea8000_reset ( | |
| 631 | void mea8000_reset ( running_machine *machine ) | |
| 632 | 632 | { |
| 633 | 633 | int i; |
| 634 | 634 | LOG (( "mea8000_reset\n" )); |
| r1877 | r1878 | |
| 637 | 637 | mea8000.cont = 0; |
| 638 | 638 | mea8000.roe = 0; |
| 639 | 639 | mea8000.state = MEA8000_STOPPED; |
| 640 | mea8000_update_req(); | |
| 640 | mea8000_update_req(machine); | |
| 641 | 641 | for (i=0; i<4; i++) |
| 642 | 642 | { |
| 643 | 643 | mea8000.f[i].last_output = 0; |
| r1877 | r1878 | |
| 652 | 652 | |
| 653 | 653 | |
| 654 | 654 | |
| 655 | void mea8000_config ( int channel, write8_ | |
| 655 | void mea8000_config ( running_machine *machine, int channel, write8_machin | |
| 656 | 656 | { |
| 657 | 657 | int i; |
| 658 | 658 | mea8000_init_tables(); |
| r1877 | r1878 | |
| 686 | 686 | state_save_register_item( "mea8000", 0, mea8000.pitch ); |
| 687 | 687 | state_save_register_item( "mea8000", 0, mea8000.noise ); |
| 688 | 688 | |
| 689 | mea8000_reset(); | |
| 689 | mea8000_reset(machine); | |
| 690 | 690 | } |
| r1877 | r1878 | |
|---|---|---|
| 9 | 9 | #ifndef MEA8000 |
| 10 | 10 | #define MEA8000 |
| 11 | 11 | |
| 12 | extern void mea8000_config ( int channel, write8_ | |
| 12 | extern void mea8000_config ( running_machine *machine, int channel, write8_machin | |
| 13 | 13 | |
| 14 | 14 | /* reset by external signal */ |
| 15 | extern void mea8000_reset ( | |
| 15 | extern void mea8000_reset ( running_machine *machine ); | |
| 16 | 16 | |
| 17 | 17 | /* interface to CPU via address/data bus*/ |
| 18 | 18 | extern READ8_HANDLER ( mea8000_r ); |
| r1877 | r1878 | |
|---|---|---|
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | |
| 483 | WRITE8_HANDLER ( | |
| 483 | WRITE8_HANDLER ( Dave_reg_w ) | |
| 484 | 484 | { |
| 485 | 485 | logerror("dave w: %04x %02x\n",offset,data); |
| 486 | 486 | |
| 487 | Dave_sound_w(offset,data); | |
| 487 | Dave_sound_w(machine, offset, data); | |
| 488 | 488 | |
| 489 | 489 | dave.Regs[offset & 0x01f] = data; |
| 490 | 490 |
| r1877 | r1878 | |
|---|---|---|
| 14 | 14 | READ16_HANDLER( AY8914_directread_port_0_lsb_r ) |
| 15 | 15 | { |
| 16 | 16 | int rv; |
| 17 | AY8910_control_port_0_w(0,mapping8914to8910[offset&0xff]); | |
| 18 | rv = (int)AY8910_read_port_0_r(0); | |
| 17 | AY8910_control_port_0_w(machine, 0, mapping8914to8910[offset&0xff]); | |
| 18 | rv = (int)AY8910_read_port_0_r(machine, 0); | |
| 19 | 19 | return rv; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | WRITE16_HANDLER( AY8914_directwrite_port_0_lsb_w ) |
| 23 | 23 | { |
| 24 | AY8910_control_port_0_w(0,mapping8914to8910[offset&0xff]); | |
| 25 | AY8910_write_port_0_w(0,data&0xff); | |
| 24 | AY8910_control_port_0_w(machine, 0, mapping8914to8910[offset&0xff]); | |
| 25 | AY8910_write_port_0_w(machine, 0, data&0xff); | |
| 26 | 26 | } |
| r1877 | r1878 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | READ8_HANDLER( cgenie_sh_data_port_r ) |
| 20 | 20 | { |
| 21 | return AY8910_read_port_0_r(offset); | |
| 21 | return AY8910_read_port_0_r(machine, offset); | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | WRITE8_HANDLER( cgenie_sh_control_port_w ) |
| 25 | 25 | { |
| 26 | 26 | control_port = data; |
| 27 | AY8910_control_port_0_w(offset, data); | |
| 27 | AY8910_control_port_0_w(machine, offset, data); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | WRITE8_HANDLER( cgenie_sh_data_port_w ) |
| 31 | 31 | { |
| 32 | AY8910_write_port_0_w(offset, data); | |
| 32 | AY8910_write_port_0_w(machine, offset, data); | |
| 33 | 33 | } |
| 34 | 34 |
| r1877 | r1878 | |
|---|---|---|
| 26 | 26 | { |
| 27 | 27 | void (*init)(const struct cartridge_callback *callbacks); |
| 28 | 28 | void (*term)(void); |
| 29 | read8_handler io_r; | |
| 30 | write8_handler io_w; | |
| 29 | read8_machine_func io_r; | |
| 30 | write8_machine_func io_w; | |
| 31 | 31 | void (*enablesound)(int enable); |
| 32 | 32 | }; |
| 33 | 33 |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | #define PC1401_H_ |
| 11 | 11 | |
| 12 | 12 | |
| 13 | #define KEY_OFF input_port_0_r(0)&0x80 | |
| 14 | #define KEY_CAL input_port_0_r(0)&0x40 | |
| 15 | #define KEY_BASIC input_port_0_r(0)&0x20 | |
| 16 | #define KEY_BRK input_port_0_r(0)&0x10 | |
| 17 | #define KEY_DEF input_port_0_r(0)&8 | |
| 18 | #define KEY_DOWN input_port_0_r(0)&4 | |
| 19 | #define KEY_UP input_port_0_r(0)&2 | |
| 20 | #define KEY_LEFT input_port_0_r(0)&1 | |
| 13 | #define KEY_OFF readinputport(0)&0x80 | |
| 14 | #define KEY_CAL readinputport(0)&0x40 | |
| 15 | #define KEY_BASIC readinputport(0)&0x20 | |
| 16 | #define KEY_BRK readinputport(0)&0x10 | |
| 17 | #define KEY_DEF readinputport(0)&8 | |
| 18 | #define KEY_DOWN readinputport(0)&4 | |
| 19 | #define KEY_UP readinputport(0)&2 | |
| 20 | #define KEY_LEFT readinputport(0)&1 | |
| 21 | 21 | |
| 22 | #define KEY_RIGHT input | |
| 22 | #define KEY_RIGHT readinput | |
| 23 | 23 | // pc1403 sml |
| 24 | #define KEY_SHIFT input_port_1_r(0)&0x20 | |
| 25 | #define KEY_Q input_port_1_r(0)&0x10 | |
| 26 | #define KEY_W input_port_1_r(0)&8 | |
| 27 | #define KEY_E input_port_1_r(0)&4 | |
| 28 | #define KEY_R input_port_1_r(0)&2 | |
| 29 | #define KEY_T input_port_1_r(0)&1 | |
| 24 | #define KEY_SHIFT readinputport(1)&0x20 | |
| 25 | #define KEY_Q readinputport(1)&0x10 | |
| 26 | #define KEY_W readinputport(1)&8 | |
| 27 | #define KEY_E readinputport(1)&4 | |
| 28 | #define KEY_R readinputport(1)&2 | |
| 29 | #define KEY_T readinputport(1)&1 | |
| 30 | 30 | |
| 31 | #define KEY_Y input_port_2_r(0)&0x80 | |
| 32 | #define KEY_U input_port_2_r(0)&0x40 | |
| 33 | #define KEY_I input_port_2_r(0)&0x20 | |
| 34 | #define KEY_O input_port_2_r(0)&0x10 | |
| 35 | #define KEY_P input_port_2_r(0)&8 | |
| 36 | #define KEY_A input_port_2_r(0)&4 | |
| 37 | #define KEY_S input_port_2_r(0)&2 | |
| 38 | #define KEY_D input_port_2_r(0)&1 | |
| 31 | #define KEY_Y readinputport(2)&0x80 | |
| 32 | #define KEY_U readinputport(2)&0x40 | |
| 33 | #define KEY_I readinputport(2)&0x20 | |
| 34 | #define KEY_O readinputport(2)&0x10 | |
| 35 | #define KEY_P readinputport(2)&8 | |
| 36 | #define KEY_A readinputport(2)&4 | |
| 37 | #define KEY_S readinputport(2)&2 | |
| 38 | #define KEY_D readinputport(2)&1 | |
| 39 | 39 | |
| 40 | #define KEY_F input_port_3_r(0)&0x80 | |
| 41 | #define KEY_G input_port_3_r(0)&0x40 | |
| 42 | #define KEY_H input_port_3_r(0)&0x20 | |
| 43 | #define KEY_J input_port_3_r(0)&0x10 | |
| 44 | #define KEY_K input_port_3_r(0)&8 | |
| 45 | #define KEY_L input_port_3_r(0)&4 | |
| 46 | #define KEY_COMMA input_port_3_r(0)&2 | |
| 47 | #define KEY_Z input_port_3_r(0)&1 | |
| 40 | #define KEY_F readinputport(3)&0x80 | |
| 41 | #define KEY_G readinputport(3)&0x40 | |
| 42 | #define KEY_H readinputport(3)&0x20 | |
| 43 | #define KEY_J readinputport(3)&0x10 | |
| 44 | #define KEY_K readinputport(3)&8 | |
| 45 | #define KEY_L readinputport(3)&4 | |
| 46 | #define KEY_COMMA readinputport(3)&2 | |
| 47 | #define KEY_Z readinputport(3)&1 | |
| 48 | 48 | |
| 49 | #define KEY_X input_port_4_r(0)&0x80 | |
| 50 | #define KEY_C input_port_4_r(0)&0x40 | |
| 51 | #define KEY_V input_port_4_r(0)&0x20 | |
| 52 | #define KEY_B input_port_4_r(0)&0x10 | |
| 53 | #define KEY_N input_port_4_r(0)&8 | |
| 54 | #define KEY_M input_port_4_r(0)&4 | |
| 55 | #define KEY_SPC input_port_4_r(0)&2 | |
| 56 | #define KEY_ENTER input_port_4_r(0)&1 | |
| 49 | #define KEY_X readinputport(4)&0x80 | |
| 50 | #define KEY_C readinputport(4)&0x40 | |
| 51 | #define KEY_V readinputport(4)&0x20 | |
| 52 | #define KEY_B readinputport(4)&0x10 | |
| 53 | #define KEY_N readinputport(4)&8 | |
| 54 | #define KEY_M readinputport(4)&4 | |
| 55 | #define KEY_SPC readinputport(4)&2 | |
| 56 | #define KEY_ENTER readinputport(4)&1 | |
| 57 | 57 | |
| 58 | #define KEY_HYP input_port_5_r(0)&0x80 | |
| 59 | #define KEY_SIN input_port_5_r(0)&0x40 | |
| 60 | #define KEY_COS input_port_5_r(0)&0x20 | |
| 61 | #define KEY_TAN input_port_5_r(0)&0x10 | |
| 62 | #define KEY_FE input_port_5_r(0)&8 | |
| 63 | #define KEY_CCE input_port_5_r(0)&4 | |
| 64 | #define KEY_HEX input_port_5_r(0)&2 | |
| 65 | #define KEY_DEG input_port_5_r(0)&1 | |
| 58 | #define KEY_HYP readinputport(5)&0x80 | |
| 59 | #define KEY_SIN readinputport(5)&0x40 | |
| 60 | #define KEY_COS readinputport(5)&0x20 | |
| 61 | #define KEY_TAN readinputport(5)&0x10 | |
| 62 | #define KEY_FE readinputport(5)&8 | |
| 63 | #define KEY_CCE readinputport(5)&4 | |
| 64 | #define KEY_HEX readinputport(5)&2 | |
| 65 | #define KEY_DEG readinputport(5)&1 | |
| 66 | 66 | |
| 67 | #define KEY_LN input_port_6_r(0)&0x80 | |
| 68 | #define KEY_LOG input_port_6_r(0)&0x40 | |
| 69 | #define KEY_1X input_port_6_r(0)&0x20 | |
| 70 | #define KEY_STAT input_port_6_r(0)&0x10 | |
| 71 | #define KEY_EXP input_port_6_r(0)&8 | |
| 72 | #define KEY_POT input_port_6_r(0)&4 | |
| 73 | #define KEY_ROOT input_port_6_r(0)&2 | |
| 74 | #define KEY_SQUARE input_port_6_r(0)&1 | |
| 67 | #define KEY_LN readinputport(6)&0x80 | |
| 68 | #define KEY_LOG readinputport(6)&0x40 | |
| 69 | #define KEY_1X readinputport(6)&0x20 | |
| 70 | #define KEY_STAT readinputport(6)&0x10 | |
| 71 | #define KEY_EXP readinputport(6)&8 | |
| 72 | #define KEY_POT readinputport(6)&4 | |
| 73 | #define KEY_ROOT readinputport(6)&2 | |
| 74 | #define KEY_SQUARE readinputport(6)&1 | |
| 75 | 75 | |
| 76 | #define KEY_BRACE_LEFT input_port_7_r(0)&0x80 | |
| 77 | #define KEY_BRACE_RIGHT input_port_7_r(0)&0x40 | |
| 78 | #define KEY_7 input_port_7_r(0)&0x20 | |
| 79 | #define KEY_8 input_port_7_r(0)&0x10 | |
| 80 | #define KEY_9 input_port_7_r(0)&8 | |
| 81 | #define KEY_DIV input_port_7_r(0)&4 | |
| 82 | #define KEY_XM input_port_7_r(0)&2 | |
| 83 | #define KEY_4 input_port_7_r(0)&1 | |
| 76 | #define KEY_BRACE_LEFT readinputport(7)&0x80 | |
| 77 | #define KEY_BRACE_RIGHT readinputport(7)&0x40 | |
| 78 | #define KEY_7 readinputport(7)&0x20 | |
| 79 | #define KEY_8 readinputport(7)&0x10 | |
| 80 | #define KEY_9 readinputport(7)&8 | |
| 81 | #define KEY_DIV readinputport(7)&4 | |
| 82 | #define KEY_XM readinputport(7)&2 | |
| 83 | #define KEY_4 readinputport(7)&1 | |
| 84 | 84 | |
| 85 | #define KEY_5 input_port_8_r(0)&0x80 | |
| 86 | #define KEY_6 input_port_8_r(0)&0x40 | |
| 87 | #define KEY_MUL input_port_8_r(0)&0x20 | |
| 88 | #define KEY_RM input_port_8_r(0)&0x10 | |
| 89 | #define KEY_1 input_port_8_r(0)&8 | |
| 90 | #define KEY_2 input_port_8_r(0)&4 | |
| 91 | #define KEY_3 input_port_8_r(0)&2 | |
| 92 | #define KEY_MINUS input_port_8_r(0)&1 | |
| 85 | #define KEY_5 readinputport(8)&0x80 | |
| 86 | #define KEY_6 readinputport(8)&0x40 | |
| 87 | #define KEY_MUL readinputport(8)&0x20 | |
| 88 | #define KEY_RM readinputport(8)&0x10 | |
| 89 | #define KEY_1 readinputport(8)&8 | |
| 90 | #define KEY_2 readinputport(8)&4 | |
| 91 | #define KEY_3 readinputport(8)&2 | |
| 92 | #define KEY_MINUS readinputport(8)&1 | |
| 93 | 93 | |
| 94 | #define KEY_MPLUS input_port_9_r(0)&0x80 | |
| 95 | #define KEY_0 input_port_9_r(0)&0x40 | |
| 96 | #define KEY_SIGN input_port_9_r(0)&0x20 | |
| 97 | #define KEY_POINT input_port_9_r(0)&0x10 | |
| 98 | #define KEY_PLUS input_port_9_r(0)&8 | |
| 99 | #define KEY_EQUALS input_port_9_r(0)&4 | |
| 100 | #define KEY_RESET input_port_9_r(0)&2 | |
| 94 | #define KEY_MPLUS readinputport(9)&0x80 | |
| 95 | #define KEY_0 readinputport(9)&0x40 | |
| 96 | #define KEY_SIGN readinputport(9)&0x20 | |
| 97 | #define KEY_POINT readinputport(9)&0x10 | |
| 98 | #define KEY_PLUS readinputport(9)&8 | |
| 99 | #define KEY_EQUALS readinputport(9)&4 | |
| 100 | #define KEY_RESET readinputport(9)&2 | |
| 101 | 101 | |
| 102 | #define RAM4K (input_port_10_r(0)&0xc0)==0x40 | |
| 103 | #define RAM10K (input_port_10_r(0)&0xc0)==0x80 | |
| 104 | #define CONTRAST (input_port_10_r(0)&7) | |
| 102 | #define RAM4K (readinputport(10)&0xc0)==0x40 | |
| 103 | #define RAM10K (readinputport(10)&0xc0)==0x80 | |
| 104 | #define CONTRAST (readinputport(10)&7) | |
| 105 | 105 | |
| 106 | 106 | |
| 107 | 107 | /*----------- defined in machine/pc1401.c -----------*/ |
| r1877 | r1878 | |
|---|---|---|
| 8 | 8 | #define HP48_H_ |
| 9 | 9 | |
| 10 | 10 | |
| 11 | #define KEY_A input_port_0_r(0)&0x80 | |
| 12 | #define KEY_B input_port_0_r(0)&0x40 | |
| 13 | #define KEY_C input_port_0_r(0)&0x20 | |
| 14 | #define KEY_D input_port_0_r(0)&0x10 | |
| 15 | #define KEY_E input_port_0_r(0)&8 | |
| 16 | #define KEY_F input_port_0_r(0)&4 | |
| 17 | #define KEY_G input_port_0_r(0)&2 | |
| 18 | #define KEY_H input_port_0_r(0)&1 | |
| 19 | #define KEY_I input_port_1_r(0)&0x80 | |
| 20 | #define KEY_J input_port_1_r(0)&0x40 | |
| 21 | #define KEY_K input_port_1_r(0)&0x20 | |
| 22 | #define KEY_L input_port_1_r(0)&0x10 | |
| 23 | #define KEY_M input_port_1_r(0)&8 | |
| 24 | #define KEY_N input_port_1_r(0)&4 | |
| 25 | #define KEY_O input_port_1_r(0)&2 | |
| 26 | #define KEY_P input_port_1_r(0)&1 | |
| 27 | #define KEY_Q input_port_2_r(0)&0x80 | |
| 28 | #define KEY_R input_port_2_r(0)&0x40 | |
| 29 | #define KEY_S input_port_2_r(0)&0x20 | |
| 30 | #define KEY_T input_port_2_r(0)&0x10 | |
| 31 | #define KEY_U input_port_2_r(0)&8 | |
| 32 | #define KEY_V input_port_2_r(0)&4 | |
| 33 | #define KEY_W input_port_2_r(0)&2 | |
| 34 | #define KEY_X input_port_2_r(0)&1 | |
| 35 | #define KEY_ENTER input_port_3_r(0)&0x80 | |
| 36 | #define KEY_Y input_port_3_r(0)&0x40 | |
| 37 | #define KEY_Z input_port_3_r(0)&0x20 | |
| 38 | #define KEY_DEL input_port_3_r(0)&0x10 | |
| 39 | #define KEY_LEFT input_port_3_r(0)&8 | |
| 40 | #define KEY_ALPHA input_port_3_r(0)&4 | |
| 41 | #define KEY_7 input_port_3_r(0)&2 | |
| 42 | #define KEY_8 input_port_3_r(0)&1 | |
| 43 | #define KEY_9 input_port_4_r(0)&0x80 | |
| 44 | #define KEY_DIVIDE input_port_4_r(0)&0x40 | |
| 45 | #define KEY_ORANGE input_port_4_r(0)&0x20 | |
| 46 | #define KEY_4 input_port_4_r(0)&0x10 | |
| 47 | #define KEY_5 input_port_4_r(0)&8 | |
| 48 | #define KEY_6 input_port_4_r(0)&4 | |
| 49 | #define KEY_MULTIPLY input_port_4_r(0)&2 | |
| 50 | #define KEY_BLUE input_port_4_r(0)&1 | |
| 51 | #define KEY_1 input_port_5_r(0)&0x80 | |
| 52 | #define KEY_2 input_port_5_r(0)&0x40 | |
| 53 | #define KEY_3 input_port_5_r(0)&0x20 | |
| 54 | #define KEY_MINUS input_port_5_r(0)&0x10 | |
| 55 | #define KEY_ON input_port_5_r(0)&8 | |
| 56 | #define KEY_0 input_port_5_r(0)&4 | |
| 57 | #define KEY_POINT input_port_5_r(0)&2 | |
| 58 | #define KEY_SPC input_port_5_r(0)&1 | |
| 59 | #define KEY_PLUS input_port_6_r(0)&0x80 | |
| 11 | #define KEY_A readinputport(0)&0x80 | |
| 12 | #define KEY_B readinputport(0)&0x40 | |
| 13 | #define KEY_C readinputport(0)&0x20 | |
| 14 | #define KEY_D readinputport(0)&0x10 | |
| 15 | #define KEY_E readinputport(0)&8 | |
| 16 | #define KEY_F readinputport(0)&4 | |
| 17 | #define KEY_G readinputport(0)&2 | |
| 18 | #define KEY_H readinputport(0)&1 | |
| 19 | #define KEY_I readinputport(1)&0x80 | |
| 20 | #define KEY_J readinputport(1)&0x40 | |
| 21 | #define KEY_K readinputport(1)&0x20 | |
| 22 | #define KEY_L readinputport(1)&0x10 | |
| 23 | #define KEY_M readinputport(1)&8 | |
| 24 | #define KEY_N readinputport(1)&4 | |
| 25 | #define KEY_O readinputport(1)&2 | |
| 26 | #define KEY_P readinputport(1)&1 | |
| 27 | #define KEY_Q readinputport(2)&0x80 | |
| 28 | #define KEY_R readinputport(2)&0x40 | |
| 29 | #define KEY_S readinputport(2)&0x20 | |
| 30 | #define KEY_T readinputport(2)&0x10 | |
| 31 | #define KEY_U readinputport(2)&8 | |
| 32 | #define KEY_V readinputport(2)&4 | |
| 33 | #define KEY_W readinputport(2)&2 | |
| 34 | #define KEY_X readinputport(2)&1 | |
| 35 | #define KEY_ENTER readinputport(3)&0x80 | |
| 36 | #define KEY_Y readinputport(3)&0x40 | |
| 37 | #define KEY_Z readinputport(3)&0x20 | |
| 38 | #define KEY_DEL readinputport(3)&0x10 | |
| 39 | #define KEY_LEFT readinputport(3)&8 | |
| 40 | #define KEY_ALPHA readinputport(3)&4 | |
| 41 | #define KEY_7 readinputport(3)&2 | |
| 42 | #define KEY_8 readinputport(3)&1 | |
| 43 | #define KEY_9 readinputport(4)&0x80 | |
| 44 | #define KEY_DIVIDE readinputport(4)&0x40 | |
| 45 | #define KEY_ORANGE readinputport(4)&0x20 | |
| 46 | #define KEY_4 readinputport(4)&0x10 | |
| 47 | #define KEY_5 readinputport(4)&8 | |
| 48 | #define KEY_6 readinputport(4)&4 | |
| 49 | #define KEY_MULTIPLY readinputport(4)&2 | |
| 50 | #define KEY_BLUE readinputport(4)&1 | |
| 51 | #define KEY_1 readinputport(5)&0x80 | |
| 52 | #define KEY_2 readinputport(5)&0x40 | |
| 53 | #define KEY_3 readinputport(5)&0x20 | |
| 54 | #define KEY_MINUS readinputport(5)&0x10 | |
| 55 | #define KEY_ON readinputport(5)&8 | |
| 56 | #define KEY_0 readinputport(5)&4 | |
| 57 | #define KEY_POINT readinputport(5)&2 | |
| 58 | #define KEY_SPC readinputport(5)&1 | |
| 59 | #define KEY_PLUS readinputport(6)&0x80 | |
| 60 | 60 | |
| 61 | 61 | |
| 62 | 62 | /*----------- defined in machine/hp48.c -----------*/ |
| r1877 | r1878 | |
|---|---|---|
| 8 | 8 | #define C65_H_ |
| 9 | 9 | |
| 10 | 10 | |
| 11 | #define C65_KEY_TAB (input_port_10_word_r(0,0)&0x8000) | |
| 12 | #define C65_KEY_CTRL (input_port_10_word_r(0,0)&1) | |
| 11 | #define C65_KEY_TAB (readinputport(10)&0x8000) | |
| 12 | #define C65_KEY_CTRL (readinputport(10)&1) | |
| 13 | 13 | |
| 14 | #define C65_KEY_RIGHT_SHIFT ((input | |
| 14 | #define C65_KEY_RIGHT_SHIFT ((readinput | |
| 15 | 15 | ||C65_KEY_CURSOR_UP||C65_KEY_CURSOR_LEFT) |
| 16 | #define C65_KEY_CURSOR_UP (input_port_12_r(0)&0x10) | |
| 17 | #define C65_KEY_SPACE (input_port_12_r(0)&8) | |
| 18 | #define C65_KEY_CURSOR_LEFT (input_port_12_r(0)&4) | |
| 19 | #define C65_KEY_CURSOR_DOWN ((input_port_12_r(0)&2)||C65_KEY_CURSOR_UP) | |
| 20 | #define C65_KEY_CURSOR_RIGHT ((input_port_12_r(0)&1)||C65_KEY_CURSOR_LEFT) | |
| 16 | #define C65_KEY_CURSOR_UP (readinputport(12)&0x10) | |
| 17 | #define C65_KEY_SPACE (readinputport(12)&8) | |
| 18 | #define C65_KEY_CURSOR_LEFT (readinputport(12)&4) | |
| 19 | #define C65_KEY_CURSOR_DOWN ((readinputport(12)&2)||C65_KEY_CURSOR_UP) | |
| 20 | #define C65_KEY_CURSOR_RIGHT ((readinputport(12)&1)||C65_KEY_CURSOR_LEFT) | |
| 21 | 21 | |
| 22 | #define C65_KEY_STOP (input_port_13_word_r(0,0)&0x8000) | |
| 23 | #define C65_KEY_ESCAPE (input_port_13_word_r(0,0)&0x4000) | |
| 24 | #define C65_KEY_ALT (input_port_13_word_r(0,0)&0x2000) | |
| 25 | #define C65_KEY_DIN (input_port_13_word_r(0,0)&0x1000) | |
| 26 | #define C65_KEY_NOSCRL (input_port_13_word_r(0,0)&0x0800) | |
| 27 | #define C65_KEY_F1 (input_port_13_word_r(0,0)&0x0400) | |
| 28 | #define C65_KEY_F3 (input_port_13_word_r(0,0)&0x0200) | |
| 29 | #define C65_KEY_F5 (input_port_13_word_r(0,0)&0x0100) | |
| 30 | #define C65_KEY_F7 (input_port_13_word_r(0,0)&0x0080) | |
| 31 | #define C65_KEY_F9 (input_port_13_word_r(0,0)&0x0040) | |
| 32 | #define C65_KEY_F11 (input_port_13_word_r(0,0)&0x0020) | |
| 33 | #define C65_KEY_F13 (input_port_13_word_r(0,0)&0x0010) | |
| 34 | #define C65_KEY_HELP (input_port_13_word_r(0,0)&0x0008) | |
| 22 | #define C65_KEY_STOP (readinputport(13)&0x8000) | |
| 23 | #define C65_KEY_ESCAPE (readinputport(13)&0x4000) | |
| 24 | #define C65_KEY_ALT (readinputport(13)&0x2000) | |
| 25 | #define C65_KEY_DIN (readinputport(13)&0x1000) | |
| 26 | #define C65_KEY_NOSCRL (readinputport(13)&0x0800) | |
| 27 | #define C65_KEY_F1 (readinputport(13)&0x0400) | |
| 28 | #define C65_KEY_F3 (readinputport(13)&0x0200) | |
| 29 | #define C65_KEY_F5 (readinputport(13)&0x0100) | |
| 30 | #define C65_KEY_F7 (readinputport(13)&0x0080) | |
| 31 | #define C65_KEY_F9 (readinputport(13)&0x0040) | |
| 32 | #define C65_KEY_F11 (readinputport(13)&0x0020) | |
| 33 | #define C65_KEY_F13 (readinputport(13)&0x0010) | |
| 34 | #define C65_KEY_HELP (readinputport(13)&0x0008) | |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | /*----------- defined in machine/c65.c -----------*/ |
| r1877 | r1878 | |
|---|---|---|
| 77 | 77 | #define JOYSTICK2 ((input_port_20_word_r(0,0)&0xe00)==0x200) |
| 78 | 78 | #define JOYSTICK_SWAP (input_port_20_word_r(0,0)&0x100) |
| 79 | 79 | |
| 80 | #define PADDLE1_BUTTON ((input_port_14_word_r(0,0)&0x100)) | |
| 81 | #define PADDLE1_VALUE (input_port_14_word_r(0,0)&0xff) | |
| 80 | #define PADDLE1_BUTTON ((readinputport(14)&0x100)) | |
| 81 | #define PADDLE1_VALUE (readinputport(14)&0xff) | |
| 82 | 82 | #define PADDLE2_BUTTON ((input_port_15_word_r(0,0)&0x100)) |
| 83 | 83 | #define PADDLE2_VALUE (input_port_15_word_r(0,0)&0xff) |
| 84 | 84 | #define PADDLE3_BUTTON ((input_port_16_word_r(0,0)&0x100)) |
| r1877 | r1878 | |
| 90 | 90 | #define LIGHTPEN_X_VALUE ((readinputport(18)&0x3ff)&~1) /* effectiv resolution */ |
| 91 | 91 | #define LIGHTPEN_Y_VALUE (readinputport(19)&~1) /* effectiv resolution */ |
| 92 | 92 | |
| 93 | #define JOYSTICK_1_LEFT ((input_port_13_word_r(0,0)&0x8000)) | |
| 94 | #define JOYSTICK_1_RIGHT ((input_port_13_word_r(0,0)&0x4000)) | |
| 95 | #define JOYSTICK_1_UP ((input_port_13_word_r(0,0)&0x2000)) | |
| 96 | #define JOYSTICK_1_DOWN ((input_port_13_word_r(0,0)&0x1000)) | |
| 97 | #define JOYSTICK_1_BUTTON ((input_port_13_word_r(0,0)&0x800)) | |
| 98 | #define JOYSTICK_1_BUTTON2 ((input_port_13_word_r(0,0)&0x400)) | |
| 99 | #define JOYSTICK_2_LEFT ((input_port_13_word_r(0,0)&0x80)) | |
| 100 | #define JOYSTICK_2_RIGHT ((input_port_13_word_r(0,0)&0x40)) | |
| 101 | #define JOYSTICK_2_UP ((input_port_13_word_r(0,0)&0x20)) | |
| 102 | #define JOYSTICK_2_DOWN ((input_port_13_word_r(0,0)&0x10)) | |
| 103 | #define JOYSTICK_2_BUTTON ((input_port_13_word_r(0,0)&8)) | |
| 104 | #define JOYSTICK_2_BUTTON2 ((input_port_13_word_r(0,0)&4)) | |
| 93 | #define JOYSTICK_1_LEFT ((readinputport(13)&0x8000)) | |
| 94 | #define JOYSTICK_1_RIGHT ((readinputport(13)&0x4000)) | |
| 95 | #define JOYSTICK_1_UP ((readinputport(13)&0x2000)) | |
| 96 | #define JOYSTICK_1_DOWN ((readinputport(13)&0x1000)) | |
| 97 | #define JOYSTICK_1_BUTTON ((readinputport(13)&0x800)) | |
| 98 | #define JOYSTICK_1_BUTTON2 ((readinputport(13)&0x400)) | |
| 99 | #define JOYSTICK_2_LEFT ((readinputport(13)&0x80)) | |
| 100 | #define JOYSTICK_2_RIGHT ((readinputport(13)&0x40)) | |
| 101 | #define JOYSTICK_2_UP ((readinputport(13)&0x20)) | |
| 102 | #define JOYSTICK_2_DOWN ((readinputport(13)&0x10)) | |
| 103 | #define JOYSTICK_2_BUTTON ((readinputport(13)&8)) | |
| 104 | #define JOYSTICK_2_BUTTON2 ((readinputport(13)&4)) | |
| 105 | 105 | |
| 106 | 106 | #define IEEE8ON 0 |
| 107 | 107 | #define IEEE9ON 0 |
| r1877 | r1878 | |
| 130 | 130 | |
| 131 | 131 | /*----------- defined in video/cbmb.c -----------*/ |
| 132 | 132 | |
| 133 | READ8_HANDLER( cbmb_mc6845_register_r ); | |
| 134 | WRITE8_HANDLER( cbmb_mc6845_register_w ); | |
| 135 | WRITE8_HANDLER( cbmb_mc6845_address_w ); | |
| 136 | 133 | VIDEO_START( cbmb_crtc ); |
| 137 | 134 | VIDEO_UPDATE( cbmb_crtc ); |
| 138 | 135 | MC6845_UPDATE_ROW( cbm600_update_row ); |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | #define PC1350_H_ |
| 11 | 11 | |
| 12 | 12 | |
| 13 | #define PC1350_KEY_OFF input_port_0_r(0)&0x80 | |
| 14 | #define PC1350_KEY_DOWN input_port_0_r(0)&0x40 | |
| 15 | #define PC1350_KEY_UP input_port_0_r(0)&0x20 | |
| 16 | #define PC1350_KEY_MODE input_port_0_r(0)&0x10 | |
| 17 | #define PC1350_KEY_CLS input_port_0_r(0)&8 | |
| 18 | #define PC1350_KEY_LEFT input_port_0_r(0)&4 | |
| 19 | #define PC1350_KEY_RIGHT input_port_0_r(0)&2 | |
| 20 | #define PC1350_KEY_DEL input_port_0_r(0)&1 | |
| 13 | #define PC1350_KEY_OFF readinputport(0)&0x80 | |
| 14 | #define PC1350_KEY_DOWN readinputport(0)&0x40 | |
| 15 | #define PC1350_KEY_UP readinputport(0)&0x20 | |
| 16 | #define PC1350_KEY_MODE readinputport(0)&0x10 | |
| 17 | #define PC1350_KEY_CLS readinputport(0)&8 | |
| 18 | #define PC1350_KEY_LEFT readinputport(0)&4 | |
| 19 | #define PC1350_KEY_RIGHT readinputport(0)&2 | |
| 20 | #define PC1350_KEY_DEL readinputport(0)&1 | |
| 21 | 21 | |
| 22 | #define PC1350_KEY_INS input_port_1_r(0)&0x80 | |
| 23 | #define PC1350_KEY_BRK input_port_1_r(0)&0x40 | |
| 24 | #define PC1350_KEY_RSHIFT input_port_1_r(0)&0x20 | |
| 25 | #define PC1350_KEY_7 input_port_1_r(0)&0x10 | |
| 26 | #define PC1350_KEY_8 input_port_1_r(0)&8 | |
| 27 | #define PC1350_KEY_9 input_port_1_r(0)&4 | |
| 28 | #define PC1350_KEY_BRACE_OPEN input_port_1_r(0)&2 | |
| 29 | #define PC1350_KEY_BRACE_CLOSE input_port_1_r(0)&1 | |
| 22 | #define PC1350_KEY_INS readinputport(1)&0x80 | |
| 23 | #define PC1350_KEY_BRK readinputport(1)&0x40 | |
| 24 | #define PC1350_KEY_RSHIFT readinputport(1)&0x20 | |
| 25 | #define PC1350_KEY_7 readinputport(1)&0x10 | |
| 26 | #define PC1350_KEY_8 readinputport(1)&8 | |
| 27 | #define PC1350_KEY_9 readinputport(1)&4 | |
| 28 | #define PC1350_KEY_BRACE_OPEN readinputport(1)&2 | |
| 29 | #define PC1350_KEY_BRACE_CLOSE readinputport(1)&1 | |
| 30 | 30 | |
| 31 | #define PC1350_KEY_4 input_port_2_r(0)&0x80 | |
| 32 | #define PC1350_KEY_5 input_port_2_r(0)&0x40 | |
| 33 | #define PC1350_KEY_6 input_port_2_r(0)&0x20 | |
| 34 | #define PC1350_KEY_SLASH input_port_2_r(0)&0x10 | |
| 35 | #define PC1350_KEY_COLON input_port_2_r(0)&8 | |
| 36 | #define PC1350_KEY_1 input_port_2_r(0)&4 | |
| 37 | #define PC1350_KEY_2 input_port_2_r(0)&2 | |
| 38 | #define PC1350_KEY_3 input_port_2_r(0)&1 | |
| 31 | #define PC1350_KEY_4 readinputport(2)&0x80 | |
| 32 | #define PC1350_KEY_5 readinputport(2)&0x40 | |
| 33 | #define PC1350_KEY_6 readinputport(2)&0x20 | |
| 34 | #define PC1350_KEY_SLASH readinputport(2)&0x10 | |
| 35 | #define PC1350_KEY_COLON readinputport(2)&8 | |
| 36 | #define PC1350_KEY_1 readinputport(2)&4 | |
| 37 | #define PC1350_KEY_2 readinputport(2)&2 | |
| 38 | #define PC1350_KEY_3 readinputport(2)&1 | |
| 39 | 39 | |
| 40 | #define PC1350_KEY_ASTERIX input_port_3_r(0)&0x80 | |
| 41 | #define PC1350_KEY_SEMICOLON input_port_3_r(0)&0x40 | |
| 42 | #define PC1350_KEY_0 input_port_3_r(0)&0x20 | |
| 43 | #define PC1350_KEY_POINT input_port_3_r(0)&0x10 | |
| 44 | #define PC1350_KEY_PLUS input_port_3_r(0)&8 | |
| 45 | #define PC1350_KEY_MINUS input_port_3_r(0)&4 | |
| 46 | #define PC1350_KEY_COMMA input_port_3_r(0)&2 | |
| 47 | #define PC1350_KEY_LSHIFT input_port_3_r(0)&1 | |
| 40 | #define PC1350_KEY_ASTERIX readinputport(3)&0x80 | |
| 41 | #define PC1350_KEY_SEMICOLON readinputport(3)&0x40 | |
| 42 | #define PC1350_KEY_0 readinputport(3)&0x20 | |
| 43 | #define PC1350_KEY_POINT readinputport(3)&0x10 | |
| 44 | #define PC1350_KEY_PLUS readinputport(3)&8 | |
| 45 | #define PC1350_KEY_MINUS readinputport(3)&4 | |
| 46 | #define PC1350_KEY_COMMA readinputport(3)&2 | |
| 47 | #define PC1350_KEY_LSHIFT readinputport(3)&1 | |
| 48 | 48 | |
| 49 | #define PC1350_KEY_Q input_port_4_r(0)&0x80 | |
| 50 | #define PC1350_KEY_W input_port_4_r(0)&0x40 | |
| 51 | #define PC1350_KEY_E input_port_4_r(0)&0x20 | |
| 52 | #define PC1350_KEY_R input_port_4_r(0)&0x10 | |
| 53 | #define PC1350_KEY_T input_port_4_r(0)&8 | |
| 54 | #define PC1350_KEY_Y input_port_4_r(0)&4 | |
| 55 | #define PC1350_KEY_U input_port_4_r(0)&2 | |
| 56 | #define PC1350_KEY_I input_port_4_r(0)&1 | |
| 49 | #define PC1350_KEY_Q readinputport(4)&0x80 | |
| 50 | #define PC1350_KEY_W readinputport(4)&0x40 | |
| 51 | #define PC1350_KEY_E readinputport(4)&0x20 | |
| 52 | #define PC1350_KEY_R readinputport(4)&0x10 | |
| 53 | #define PC1350_KEY_T readinputport(4)&8 | |
| 54 | #define PC1350_KEY_Y readinputport(4)&4 | |
| 55 | #define PC1350_KEY_U readinputport(4)&2 | |
| 56 | #define PC1350_KEY_I readinputport(4)&1 | |
| 57 | 57 | |
| 58 | #define PC1350_KEY_O input_port_5_r(0)&0x80 | |
| 59 | #define PC1350_KEY_P input_port_5_r(0)&0x40 | |
| 60 | #define PC1350_KEY_DEF input_port_5_r(0)&0x20 | |
| 61 | #define PC1350_KEY_A input_port_5_r(0)&0x10 | |
| 62 | #define PC1350_KEY_S input_port_5_r(0)&8 | |
| 63 | #define PC1350_KEY_D input_port_5_r(0)&4 | |
| 64 | #define PC1350_KEY_F input_port_5_r(0)&2 | |
| 65 | #define PC1350_KEY_G input_port_5_r(0)&1 | |
| 58 | #define PC1350_KEY_O readinputport(5)&0x80 | |
| 59 | #define PC1350_KEY_P readinputport(5)&0x40 | |
| 60 | #define PC1350_KEY_DEF readinputport(5)&0x20 | |
| 61 | #define PC1350_KEY_A readinputport(5)&0x10 | |
| 62 | #define PC1350_KEY_S readinputport(5)&8 | |
| 63 | #define PC1350_KEY_D readinputport(5)&4 | |
| 64 | #define PC1350_KEY_F readinputport(5)&2 | |
| 65 | #define PC1350_KEY_G readinputport(5)&1 | |
| 66 | 66 | |
| 67 | #define PC1350_KEY_H input_port_6_r(0)&0x80 | |
| 68 | #define PC1350_KEY_J input_port_6_r(0)&0x40 | |
| 69 | #define PC1350_KEY_K input_port_6_r(0)&0x20 | |
| 70 | #define PC1350_KEY_L input_port_6_r(0)&0x10 | |
| 71 | #define PC1350_KEY_EQUALS input_port_6_r(0)&8 | |
| 72 | #define PC1350_KEY_SML input_port_6_r(0)&4 | |
| 73 | #define PC1350_KEY_Z input_port_6_r(0)&2 | |
| 74 | #define PC1350_KEY_X input_port_6_r(0)&1 | |
| 67 | #define PC1350_KEY_H readinputport(6)&0x80 | |
| 68 | #define PC1350_KEY_J readinputport(6)&0x40 | |
| 69 | #define PC1350_KEY_K readinputport(6)&0x20 | |
| 70 | #define PC1350_KEY_L readinputport(6)&0x10 | |
| 71 | #define PC1350_KEY_EQUALS readinputport(6)&8 | |
| 72 | #define PC1350_KEY_SML readinputport(6)&4 | |
| 73 | #define PC1350_KEY_Z readinputport(6)&2 | |
| 74 | #define PC1350_KEY_X readinputport(6)&1 | |
| 75 | 75 | |
| 76 | #define PC1350_KEY_C input_port_7_r(0)&0x80 | |
| 77 | #define PC1350_KEY_V input_port_7_r(0)&0x40 | |
| 78 | #define PC1350_KEY_B input_port_7_r(0)&0x20 | |
| 79 | #define PC1350_KEY_N input_port_7_r(0)&0x10 | |
| 80 | #define PC1350_KEY_M input_port_7_r(0)&8 | |
| 81 | #define PC1350_KEY_SPACE input_port_7_r(0)&4 | |
| 82 | #define PC1350_KEY_ENTER input_port_7_r(0)&2 | |
| 76 | #define PC1350_KEY_C readinputport(7)&0x80 | |
| 77 | #define PC1350_KEY_V readinputport(7)&0x40 | |
| 78 | #define PC1350_KEY_B readinputport(7)&0x20 | |
| 79 | #define PC1350_KEY_N readinputport(7)&0x10 | |
| 80 | #define PC1350_KEY_M readinputport(7)&8 | |
| 81 | #define PC1350_KEY_SPACE readinputport(7)&4 | |
| 82 | #define PC1350_KEY_ENTER readinputport(7)&2 | |
| 83 | 83 | |
| 84 | #define PC1350_CONTRAST (input | |
| 84 | #define PC1350_CONTRAST (readinput | |
| 85 | 85 | |
| 86 | 86 | |
| 87 | 87 | /*----------- defined in machine/pc1350.c -----------*/ |
| r1877 | r1878 | |
|---|---|---|
| 55 | 55 | DEVICE_UNLOAD(coco_rom); |
| 56 | 56 | DEVICE_UNLOAD(coco3_rom); |
| 57 | 57 | |
| 58 | INPUT_CHANGED(coco_keyboard_changed); | |
| 59 | ||
| 58 | 60 | SNAPSHOT_LOAD ( coco_pak ); |
| 59 | 61 | SNAPSHOT_LOAD ( coco3_pak ); |
| 60 | 62 | READ8_HANDLER ( coco3_mmu_r ); |
| r1877 | r1878 | |
|---|---|---|
| 127 | 127 | |
| 128 | 128 | READ8_HANDLER( gb_video_r ); |
| 129 | 129 | WRITE8_HANDLER( gb_video_w ); |
| 130 | void gb_video_init( int mode ); | |
| 130 | void gb_video_init( running_machine *machine, int mode ); | |
| 131 | 131 | |
| 132 | 132 | |
| 133 | 133 | #endif /* GB_H_ */ |
| r1877 | r1878 | |
|---|---|---|
| 15 | 15 | #define C128_H_ |
| 16 | 16 | |
| 17 | 17 | |
| 18 | #define C128_MAIN_MEMORY (input | |
| 18 | #define C128_MAIN_MEMORY (readinput | |
| 19 | 19 | #define RAM128KB (0) |
| 20 | 20 | #define RAM256KB (0x100) |
| 21 | 21 | #define RAM1MB (0x200) |
| 22 | 22 | |
| 23 | #define VDC_RAM_64KBYTE (input_port_8_r(0)&0x40) /* else 16KB */ | |
| 24 | #define MONITOR_TV (input_port_8_r(0)&0x20) /* else RGBI */ | |
| 23 | #define VDC_RAM_64KBYTE (readinputport(8)&0x40) /* else 16KB */ | |
| 24 | #define MONITOR_TV (readinputport(8)&0x20) /* else RGBI */ | |
| 25 | 25 | |
| 26 | #define C128_KEY_RIGHT_SHIFT ((input | |
| 26 | #define C128_KEY_RIGHT_SHIFT ((readinput | |
| 27 | 27 | ||C128_KEY_CURSOR_UP||C128_KEY_CURSOR_LEFT) |
| 28 | 28 | |
| 29 | #define C128_KEY_CURSOR_DOWN ((input_port_12_r(0)&0x10)||C128_KEY_CURSOR_UP) | |
| 30 | #define C128_KEY_CURSOR_RIGHT ((input_port_12_r(0)&8)||C128_KEY_CURSOR_LEFT) | |
| 29 | #define C128_KEY_CURSOR_DOWN ((readinputport(12)&0x10)||C128_KEY_CURSOR_UP) | |
| 30 | #define C128_KEY_CURSOR_RIGHT ((readinputport(12)&8)||C128_KEY_CURSOR_LEFT) | |
| 31 | 31 | |
| 32 | #define KEY_ESCAPE (input_port_13_word_r(0,0)&0x8000) | |
| 33 | #define KEY_TAB (input_port_13_word_r(0,0)&0x4000) | |
| 34 | #define KEY_ALT (input_port_13_word_r(0,0)&0x2000) | |
| 35 | #define KEY_DIN (input_port_13_word_r(0,0)&0x1000) | |
| 32 | #define KEY_ESCAPE (readinputport(13)&0x8000) | |
| 33 | #define KEY_TAB (readinputport(13)&0x4000) | |
| 34 | #define KEY_ALT (readinputport(13)&0x2000) | |
| 35 | #define KEY_DIN (readinputport(13)&0x1000) | |
| 36 | 36 | |
| 37 | #define KEY_HELP (input_port_13_word_r(0,0)&0x0800) | |
| 38 | #define KEY_LINEFEED (input_port_13_word_r(0,0)&0x0400) | |
| 39 | #define KEY_4080 (input_port_13_word_r(0,0)&0x0200) | |
| 40 | #define KEY_NOSCRL (input_port_13_word_r(0,0)&0x0100) | |
| 37 | #define KEY_HELP (readinputport(13)&0x0800) | |
| 38 | #define KEY_LINEFEED (readinputport(13)&0x0400) | |
| 39 | #define KEY_4080 (readinputport(13)&0x0200) | |
| 40 | #define KEY_NOSCRL (readinputport(13)&0x0100) | |
| 41 | 41 | |
| 42 | #define KEY_UP (input_port_13_word_r(0,0)&0x0080) | |
| 43 | #define KEY_DOWN (input_port_13_word_r(0,0)&0x0040) | |
| 44 | #define KEY_LEFT (input_port_13_word_r(0,0)&0x0020) | |
| 45 | #define KEY_RIGHT (input_port_13_word_r(0,0)&0x0010) | |
| 42 | #define KEY_UP (readinputport(13)&0x0080) | |
| 43 | #define KEY_DOWN (readinputport(13)&0x0040) | |
| 44 | #define KEY_LEFT (readinputport(13)&0x0020) | |
| 45 | #define KEY_RIGHT (readinputport(13)&0x0010) | |
| 46 | 46 | |
| 47 | #define C128_KEY_F1 (input_port_13_word_r(0,0)&0x0008) | |
| 48 | #define C128_KEY_F3 (input_port_13_word_r(0,0)&0x0004) | |
| 49 | #define C128_KEY_F5 (input_port_13_word_r(0,0)&0x0002) | |
| 50 | #define C128_KEY_F7 (input_port_13_word_r(0,0)&0x0001) | |
| 47 | #define C128_KEY_F1 (readinputport(13)&0x0008) | |
| 48 | #define C128_KEY_F3 (readinputport(13)&0x0004) | |
| 49 | #define C128_KEY_F5 (readinputport(13)&0x0002) | |
| 50 | #define C128_KEY_F7 (readinputport(13)&0x0001) | |
| 51 | 51 | |
| 52 | #define KEY_NUM7 (input_port_14_word_r(0,0)&0x8000) | |
| 53 | #define KEY_NUM8 (input_port_14_word_r(0,0)&0x4000) | |
| 54 | #define KEY_NUM9 (input_port_14_word_r(0,0)&0x2000) | |
| 55 | #define KEY_NUMPLUS (input_port_14_word_r(0,0)&0x1000) | |
| 56 | #define KEY_NUM4 (input_port_14_word_r(0,0)&0x800) | |
| 57 | #define KEY_NUM5 (input_port_14_word_r(0,0)&0x400) | |
| 58 | #define KEY_NUM6 (input_port_14_word_r(0,0)&0x200) | |
| 59 | #define KEY_NUMMINUS (input_port_14_word_r(0,0)&0x100) | |
| 60 | #define KEY_NUM1 (input_port_14_word_r(0,0)&0x80) | |
| 61 | #define KEY_NUM2 (input_port_14_word_r(0,0)&0x40) | |
| 62 | #define KEY_NUM3 (input_port_14_word_r(0,0)&0x20) | |
| 63 | #define KEY_NUM0 (input_port_14_word_r(0,0)&0x10) | |
| 64 | #define KEY_NUMPOINT (input_port_14_word_r(0,0)&8) | |
| 65 | #define KEY_NUMENTER (input_port_14_word_r(0,0)&4) | |
| 66 | #define C128_KEY_CURSOR_UP (input_port_14_word_r(0,0)&2) | |
| 67 | #define C128_KEY_CURSOR_LEFT (input_port_14_word_r(0,0)&1) | |
| 52 | #define KEY_NUM7 (readinputport(14)&0x8000) | |
| 53 | #define KEY_NUM8 (readinputport(14)&0x4000) | |
| 54 | #define KEY_NUM9 (readinputport(14)&0x2000) | |
| 55 | #define KEY_NUMPLUS (readinputport(14)&0x1000) | |
| 56 | #define KEY_NUM4 (readinputport(14)&0x800) | |
| 57 | #define KEY_NUM5 (readinputport(14)&0x400) | |
| 58 | #define KEY_NUM6 (readinputport(14)&0x200) | |
| 59 | #define KEY_NUMMINUS (readinputport(14)&0x100) | |
| 60 | #define KEY_NUM1 (readinputport(14)&0x80) | |
| 61 | #define KEY_NUM2 (readinputport(14)&0x40) | |
| 62 | #define KEY_NUM3 (readinputport(14)&0x20) | |
| 63 | #define KEY_NUM0 (readinputport(14)&0x10) | |
| 64 | #define KEY_NUMPOINT (readinputport(14)&8) | |
| 65 | #define KEY_NUMENTER (readinputport(14)&4) | |
| 66 | #define C128_KEY_CURSOR_UP (readinputport(14)&2) | |
| 67 | #define C128_KEY_CURSOR_LEFT (readinputport(14)&1) | |
| 68 | 68 | |
| 69 | 69 | |
| 70 | 70 | /*----------- defined in machine/c128.c -----------*/ |
| r1877 | r1878 | |
| 78 | 78 | extern UINT8 *c128_external_function; |
| 79 | 79 | extern UINT8 *c128_vdcram; |
| 80 | 80 | |
| 81 | ||
| 81 | ||
| 82 | 82 | WRITE8_HANDLER(c128_mmu8722_port_w); |
| 83 | ||
| 83 | ||
| 84 | 84 | WRITE8_HANDLER(c128_mmu8722_ff00_w); |
| 85 | ||
| 85 | ||
| 86 | 86 | int c128_capslock_r (void); |
| 87 | 87 | WRITE8_HANDLER(c128_write_0000); |
| 88 | 88 | WRITE8_HANDLER(c128_write_1000); |
| r1877 | r1878 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "video/mc6845.h" |
| 11 | 11 | |
| 12 | READ8_HANDLER( pet_mc6845_register_r ); | |
| 13 | WRITE8_HANDLER( pet_mc6845_register_w ); | |
| 14 | WRITE8_HANDLER( pet_mc6845_address_w ); | |
| 15 | ||
| 16 | 12 | /*----------- defined in video/pet.c -----------*/ |
| 17 | 13 | |
| 18 | 14 | /* call to init videodriver */ |
| r1877 | r1878 | |
| 29 | 25 | |
| 30 | 26 | /*----------- defined in machine/pet.c -----------*/ |
| 31 | 27 | |
| 32 | #define CBM8096_MEMORY (input_port_11_r(0)&8) | |
| 33 | #define M6809_SELECT (input_port_11_r(0)&4) | |
| 34 | #define IEEE8ON (input_port_11_r(0)&2) | |
| 35 | #define IEEE9ON (input_port_11_r(0)&1) | |
| 28 | #define CBM8096_MEMORY (readinputport(11)&8) | |
| 29 | #define M6809_SELECT (readinputport(11)&4) | |
| 30 | #define IEEE8ON (readinputport(11)&2) | |
| 31 | #define IEEE9ON (readinputport(11)&1) | |
| 36 | 32 | |
| 37 | 33 | extern UINT8 *pet_memory; |
| 38 | 34 | extern UINT8 *pet_videoram; |
| r1877 | r1878 | |
|---|---|---|
| 8 | 8 | #define C16_H_ |
| 9 | 9 | |
| 10 | 10 | |
| 11 | #define JOYSTICK1_PORT (input_port_7_r(0)&0x80) | |
| 12 | #define JOYSTICK2_PORT (input_port_7_r(0)&0x40) | |
| 11 | #define JOYSTICK1_PORT (readinputport(7)&0x80) | |
| 12 | #define JOYSTICK2_PORT (readinputport(7)&0x40) | |
| 13 | 13 | |
| 14 | #define JOYSTICK_2_LEFT ((input_port_1_r(0)&0x80)) | |
| 15 | #define JOYSTICK_2_RIGHT ((input_port_1_r(0)&0x40)) | |
| 16 | #define JOYSTICK_2_UP ((input_port_1_r(0)&0x20)) | |
| 17 | #define JOYSTICK_2_DOWN ((input_port_1_r(0)&0x10)) | |
| 18 | #define JOYSTICK_2_BUTTON ((input_port_1_r(0)&8)) | |
| 14 | #define JOYSTICK_2_LEFT ((readinputport(1)&0x80)) | |
| 15 | #define JOYSTICK_2_RIGHT ((readinputport(1)&0x40)) | |
| 16 | #define JOYSTICK_2_UP ((readinputport(1)&0x20)) | |
| 17 | #define JOYSTICK_2_DOWN ((readinputport(1)&0x10)) | |
| 18 | #define JOYSTICK_2_BUTTON ((readinputport(1)&8)) | |
| 19 | 19 | |
| 20 | #define JOYSTICK_1_LEFT ((input_port_0_r(0)&0x80)) | |
| 21 | #define JOYSTICK_1_RIGHT ((input_port_0_r(0)&0x40)) | |
| 22 | #define JOYSTICK_1_UP ((input_port_0_r(0)&0x20)) | |
| 23 | #define JOYSTICK_1_DOWN ((input_port_0_r(0)&0x10)) | |
| 24 | #define JOYSTICK_1_BUTTON ((input_port_0_r(0)&8)) | |
| 20 | #define JOYSTICK_1_LEFT ((readinputport(0)&0x80)) | |
| 21 | #define JOYSTICK_1_RIGHT ((readinputport(0)&0x40)) | |
| 22 | #define JOYSTICK_1_UP ((readinputport(0)&0x20)) | |
| 23 | #define JOYSTICK_1_DOWN ((readinputport(0)&0x10)) | |
| 24 | #define JOYSTICK_1_BUTTON ((readinputport(0)&8)) | |
| 25 | 25 | |
| 26 | #define KEY_ESC (input_port_2_word_r(0,0)&0x8000) | |
| 27 | #define KEY_1 (input_port_2_word_r(0,0)&0x4000) | |
| 28 | #define KEY_2 (input_port_2_word_r(0,0)&0x2000) | |
| 29 | #define KEY_3 (input_port_2_word_r(0,0)&0x1000) | |
| 30 | #define KEY_4 (input_port_2_word_r(0,0)&0x800) | |
| 31 | #define KEY_5 (input_port_2_word_r(0,0)&0x400) | |
| 32 | #define KEY_6 (input_port_2_word_r(0,0)&0x200) | |
| 33 | #define KEY_7 (input_port_2_word_r(0,0)&0x100) | |
| 34 | #define KEY_8 (input_port_2_word_r(0,0)&0x80) | |
| 35 | #define KEY_9 (input_port_2_word_r(0,0)&0x40) | |
| 36 | #define KEY_0 (input_port_2_word_r(0,0)&0x20) | |
| 37 | #define KEY_LEFT (input_port_2_word_r(0,0)&0x10) | |
| 38 | #define KEY_RIGHT (input_port_2_word_r(0,0)&8) | |
| 39 | #define KEY_UP (input_port_2_word_r(0,0)&4) | |
| 40 | #define KEY_DOWN (input_port_2_word_r(0,0)&2) | |
| 41 | #define KEY_DEL (input_port_2_word_r(0,0)&1) | |
| 26 | #define KEY_ESC (readinputport(2)&0x8000) | |
| 27 | #define KEY_1 (readinputport(2)&0x4000) | |
| 28 | #define KEY_2 (readinputport(2)&0x2000) | |
| 29 | #define KEY_3 (readinputport(2)&0x1000) | |
| 30 | #define KEY_4 (readinputport(2)&0x800) | |
| 31 | #define KEY_5 (readinputport(2)&0x400) | |
| 32 | #define KEY_6 (readinputport(2)&0x200) | |
| 33 | #define KEY_7 (readinputport(2)&0x100) | |
| 34 | #define KEY_8 (readinputport(2)&0x80) | |
| 35 | #define KEY_9 (readinputport(2)&0x40) | |
| 36 | #define KEY_0 (readinputport(2)&0x20) | |
| 37 | #define KEY_LEFT (readinputport(2)&0x10) | |
| 38 | #define KEY_RIGHT (readinputport(2)&8) | |
| 39 | #define KEY_UP (readinputport(2)&4) | |
| 40 | #define KEY_DOWN (readinputport(2)&2) | |
| 41 | #define KEY_DEL (readinputport(2)&1) | |
| 42 | 42 | |
| 43 | #define KEY_CTRL (input_port_3_word_r(0,0)&0x8000) | |
| 44 | #define KEY_Q (input_port_3_word_r(0,0)&0x4000) | |
| 45 | #define KEY_W (input_port_3_word_r(0,0)&0x2000) | |
| 46 | #define KEY_E (input_port_3_word_r(0,0)&0x1000) | |
| 47 | #define KEY_R (input_port_3_word_r(0,0)&0x800) | |
| 48 | #define KEY_T (input_port_3_word_r(0,0)&0x400) | |
| 49 | #define KEY_Y (input_port_3_word_r(0,0)&0x200) | |
| 50 | #define KEY_U (input_port_3_word_r(0,0)&0x100) | |
| 51 | #define KEY_I (input_port_3_word_r(0,0)&0x80) | |
| 52 | #define KEY_O (input_port_3_word_r(0,0)&0x40) | |
| 53 | #define KEY_P (input_port_3_word_r(0,0)&0x20) | |
| 54 | #define KEY_ATSIGN (input_port_3_word_r(0,0)&0x10) | |
| 55 | #define KEY_PLUS (input_port_3_word_r(0,0)&8) | |
| 56 | #define KEY_MINUS (input_port_3_word_r(0,0)&4) | |
| 57 | #define KEY_HOME (input_port_3_word_r(0,0)&2) | |
| 58 | #define KEY_STOP (input_port_3_word_r(0,0)&1) | |
| 43 | #define KEY_CTRL (readinputport(3)&0x8000) | |
| 44 | #define KEY_Q (readinputport(3)&0x4000) | |
| 45 | #define KEY_W (readinputport(3)&0x2000) | |
| 46 | #define KEY_E (readinputport(3)&0x1000) | |
| 47 | #define KEY_R (readinputport(3)&0x800) | |
| 48 | #define KEY_T (readinputport(3)&0x400) | |
| 49 | #define KEY_Y (readinputport(3)&0x200) | |
| 50 | #define KEY_U (readinputport(3)&0x100) | |
| 51 | #define KEY_I (readinputport(3)&0x80) | |
| 52 | #define KEY_O (readinputport(3)&0x40) | |
| 53 | #define KEY_P (readinputport(3)&0x20) | |
| 54 | #define KEY_ATSIGN (readinputport(3)&0x10) | |
| 55 | #define KEY_PLUS (readinputport(3)&8) | |
| 56 | #define KEY_MINUS (readinputport(3)&4) | |
| 57 | #define KEY_HOME (readinputport(3)&2) | |
| 58 | #define KEY_STOP (readinputport(3)&1) | |
| 59 | 59 | |
| 60 | #define KEY_SHIFTLOCK (input_port_4_word_r(0,0)&0x8000) | |
| 61 | #define KEY_A (input_port_4_word_r(0,0)&0x4000) | |
| 62 | #define KEY_S (input_port_4_word_r(0,0)&0x2000) | |
| 63 | #define KEY_D (input_port_4_word_r(0,0)&0x1000) | |
| 64 | #define KEY_F (input_port_4_word_r(0,0)&0x800) | |
| 65 | #define KEY_G (input_port_4_word_r(0,0)&0x400) | |
| 66 | #define KEY_H (input_port_4_word_r(0,0)&0x200) | |
| 67 | #define KEY_J (input_port_4_word_r(0,0)&0x100) | |
| 68 | #define KEY_K (input_port_4_word_r(0,0)&0x80) | |
| 69 | #define KEY_L (input_port_4_word_r(0,0)&0x40) | |
| 70 | #define KEY_SEMICOLON (input_port_4_word_r(0,0)&0x20) | |
| 71 | #define KEY_COLON (input_port_4_word_r(0,0)&0x10) | |
| 72 | #define KEY_ASTERIX (input_port_4_word_r(0,0)&8) | |
| 73 | #define KEY_RETURN (input_port_4_word_r(0,0)&4) | |
| 74 | #define KEY_CBM (input_port_4_word_r(0,0)&2) | |
| 75 | #define KEY_LEFT_SHIFT (input_port_4_word_r(0,0)&1) | |
| 60 | #define KEY_SHIFTLOCK (readinputport(4)&0x8000) | |
| 61 | #define KEY_A (readinputport(4)&0x4000) | |
| 62 | #define KEY_S (readinputport(4)&0x2000) | |
| 63 | #define KEY_D (readinputport(4)&0x1000) | |
| 64 | #define KEY_F (readinputport(4)&0x800) | |
| 65 | #define KEY_G (readinputport(4)&0x400) | |
| 66 | #define KEY_H (readinputport(4)&0x200) | |
| 67 | #define KEY_J (readinputport(4)&0x100) | |
| 68 | #define KEY_K (readinputport(4)&0x80) | |
| 69 | #define KEY_L (readinputport(4)&0x40) | |
| 70 | #define KEY_SEMICOLON (readinputport(4)&0x20) | |
| 71 | #define KEY_COLON (readinputport(4)&0x10) | |
| 72 | #define KEY_ASTERIX (readinputport(4)&8) | |
| 73 | #define KEY_RETURN (readinputport(4)&4) | |
| 74 | #define KEY_CBM (readinputport(4)&2) | |
| 75 | #define KEY_LEFT_SHIFT (readinputport(4)&1) | |
| 76 | 76 | |
| 77 | 77 | |
| 78 | #define KEY_Z (input_port_5_word_r(0,0)&0x8000) | |
| 79 | #define KEY_X (input_port_5_word_r(0,0)&0x4000) | |
| 80 | #define KEY_C (input_port_5_word_r(0,0)&0x2000) | |
| 81 | #define KEY_V (input_port_5_word_r(0,0)&0x1000) | |
| 82 | #define KEY_B (input_port_5_word_r(0,0)&0x800) | |
| 83 | #define KEY_N (input_port_5_word_r(0,0)&0x400) | |
| 84 | #define KEY_M (input_port_5_word_r(0,0)&0x200) | |
| 85 | #define KEY_COMMA (input_port_5_word_r(0,0)&0x100) | |
| 86 | #define KEY_POINT (input_port_5_word_r(0,0)&0x80) | |
| 87 | #define KEY_SLASH (input_port_5_word_r(0,0)&0x40) | |
| 88 | #define KEY_RIGHT_SHIFT (input_port_5_word_r(0,0)&0x20) | |
| 89 | #define KEY_POUND (input_port_5_word_r(0,0)&0x10) | |
| 90 | #define KEY_EQUALS (input_port_5_word_r(0,0)&8) | |
| 91 | #define KEY_SPACE (input_port_5_word_r(0,0)&4) | |
| 92 | #define KEY_F1 (input_port_5_word_r(0,0)&2) | |
| 93 | #define KEY_F2 (input_port_5_word_r(0,0)&1) | |
| 78 | #define KEY_Z (readinputport(5)&0x8000) | |
| 79 | #define KEY_X (readinputport(5)&0x4000) | |
| 80 | #define KEY_C (readinputport(5)&0x2000) | |
| 81 | #define KEY_V (readinputport(5)&0x1000) | |
| 82 | #define KEY_B (readinputport(5)&0x800) | |
| 83 | #define KEY_N (readinputport(5)&0x400) | |
| 84 | #define KEY_M (readinputport(5)&0x200) | |
| 85 | #define KEY_COMMA (readinputport(5)&0x100) | |
| 86 | #define KEY_POINT (readinputport(5)&0x80) | |
| 87 | #define KEY_SLASH (readinputport(5)&0x40) | |
| 88 | #define KEY_RIGHT_SHIFT (readinputport(5)&0x20) | |
| 89 | #define KEY_POUND (readinputport(5)&0x10) | |
| 90 | #define KEY_EQUALS (readinputport(5)&8) | |
| 91 | #define KEY_SPACE (readinputport(5)&4) | |
| 92 | #define KEY_F1 (readinputport(5)&2) | |
| 93 | #define KEY_F2 (readinputport(5)&1) | |
| 94 | 94 | |
| 95 | #define KEY_F3 (input_port_6_word_r(0,0)&0x8000) | |
| 96 | #define KEY_HELP (input_port_6_word_r(0,0)&0x4000) | |
| 95 | #define KEY_F3 (readinputport(6)&0x8000) | |
| 96 | #define KEY_HELP (readinputport(6)&0x4000) | |
| 97 | 97 | |
| 98 | #define JOYSTICK_SWAP (input | |
| 98 | #define JOYSTICK_SWAP (readinput | |
| 99 | 99 | |
| 100 | #define DATASSETTE_PLAY (input_port_6_word_r(0,0)&4) | |
| 101 | #define DATASSETTE_RECORD (input_port_6_word_r(0,0)&2) | |
| 102 | #define DATASSETTE_STOP (input_port_6_word_r(0,0)&1) | |
| 100 | #define DATASSETTE_PLAY (readinputport(6)&4) | |
| 101 | #define DATASSETTE_RECORD (readinputport(6)&2) | |
| 102 | #define DATASSETTE_STOP (readinputport(6)&1) | |
| 103 | 103 | |
| 104 | #define QUICKLOAD (input | |
| 104 | #define QUICKLOAD (readinput | |
| 105 | 105 | |
| 106 | 106 | #define KEY_SHIFT (KEY_LEFT_SHIFT||KEY_RIGHT_SHIFT||KEY_SHIFTLOCK) |
| 107 | 107 | |
| 108 | #define DATASSETTE (input_port_7_r(0)&0x20) | |
| 109 | #define DATASSETTE_TONE (input_port_7_r(0)&0x10) | |
| 108 | #define DATASSETTE (readinputport(7)&0x20) | |
| 109 | #define DATASSETTE_TONE (readinputport(7)&0x10) | |
| 110 | 110 | |
| 111 | #define NO_REAL_FLOPPY ((input_port_8_r(0)&0xc0)==0) | |
| 112 | #define REAL_C1551 ((input_port_8_r(0)&0xc0)==0x40) | |
| 113 | #define REAL_VC1541 ((input_port_8_r(0)&0xc0)==0x80) | |
| 111 | #define NO_REAL_FLOPPY ((readinputport(8)&0xc0)==0) | |
| 112 | #define REAL_C1551 ((readinputport(8)&0xc0)==0x40) | |
| 113 | #define REAL_VC1541 ((readinputport(8)&0xc0)==0x80) | |
| 114 | 114 | |
| 115 | #define IEC8ON ((input_port_8_r(0)&0x38)==8) | |
| 116 | #define IEC8ON ((input_port_8_r(0)&0x38)==8) | |
| 117 | #define IEC9ON ((input_port_8_r(0)&7)==1) | |
| 115 | #define IEC8ON ((readinputport(8)&0x38)==8) | |
| 116 | #define IEC8ON ((readinputport(8)&0x38)==8) | |
| 117 | #define IEC9ON ((readinputport(8)&7)==1) | |
| 118 | 118 | |
| 119 | #define SIDCARD ((input | |
| 119 | #define SIDCARD ((readinput | |
| 120 | 120 | // a lot of c64 software has been converted to c16 |
| 121 | 121 | // these oftenly still produce the commands for the sid chip at 0xd400 |
| 122 | 122 | // with following hack you can hear these sounds |
| 123 | #define SIDCARD_HACK ((input | |
| 123 | #define SIDCARD_HACK ((readinput | |
| 124 | 124 | |
| 125 | #define C16_PAL ((input | |
| 125 | #define C16_PAL ((readinput | |
| 126 | 126 | |
| 127 | #define TYPE_C16 ((input_port_9_r(0)&0xc)==0) | |
| 128 | #define TYPE_PLUS4 ((input_port_9_r(0)&0xc)==4) | |
| 129 | #define TYPE_364 ((input_port_9_r(0)&0xc)==8) | |
| 127 | #define TYPE_C16 ((readinputport(9)&0xc)==0) | |
| 128 | #define TYPE_PLUS4 ((readinputport(9)&0xc)==4) | |
| 129 | #define TYPE_364 ((readinputport(9)&0xc)==8) | |
| 130 | 130 | |
| 131 | 131 | |
| 132 | 132 | /*----------- defined in machine/c16.c -----------*/ |
| r1877 | r1878 | |
| 161 | 161 | extern int c16_read_keyboard (int databus); |
| 162 | 162 | extern void c16_interrupt (int); |
| 163 | 163 | |
| 164 | extern void c16_driver_init( | |
| 164 | extern void c16_driver_init(running_machine *machine); | |
| 165 | 165 | extern MACHINE_RESET( c16 ); |
| 166 | 166 | extern INTERRUPT_GEN( c16_frame_interrupt ); |
| 167 | 167 |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | #define PC1403_H_ |
| 11 | 11 | |
| 12 | 12 | |
| 13 | #define KEY_SMALL input_port_1_r(0)&0x40 | |
| 14 | #define RAM32K (input_port_10_r(0)&0x80)==0x80 | |
| 13 | #define KEY_SMALL readinputport(1)&0x40 | |
| 14 | #define RAM32K (readinputport(10)&0x80)==0x80 | |
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | /*----------- defined in machine/pc1403.c -----------*/ |
| r1877 | r1878 | |
|---|---|---|
| 28 | 28 | |
| 29 | 29 | INTERRUPT_GEN( microtan_interrupt ); |
| 30 | 30 | |
| 31 | READ8_HANDLER ( microtan_via_0_r ); | |
| 32 | READ8_HANDLER ( microtan_via_1_r ); | |
| 33 | READ8_HANDLER ( microtan_bffx_r ); | |
| 34 | READ8_HANDLER ( microtan_sound_r ); | |
| 35 | READ8_HANDLER ( microtan_sio_r ); | |
| 31 | READ8_HANDLER ( microtan_bffx_r ); | |
| 32 | READ8_HANDLER ( microtan_sound_r ); | |
| 36 | 33 | |
| 37 | WRITE8_HANDLER ( microtan_via_0_w ); | |
| 38 | WRITE8_HANDLER ( microtan_via_1_w ); | |
| 39 | 34 | WRITE8_HANDLER ( microtan_bffx_w ); |
| 40 | 35 | WRITE8_HANDLER ( microtan_sound_w ); |
| 41 | WRITE8_HANDLER ( microtan_sio_w ); | |
| 42 | 36 | |
| 43 | 37 | |
| 44 | 38 | /*----------- defined in video/microtan.c -----------*/ |
| r1877 | r1878 | |
|---|---|---|
| 125 | 125 | struct _apple2_meminfo |
| 126 | 126 | { |
| 127 | 127 | UINT32 read_mem; |
| 128 | read8_ | |
| 128 | read8_machin | |
| 129 | 129 | UINT32 write_mem; |
| 130 | write8_ | |
| 130 | write8_machin | |
| 131 | 131 | }; |
| 132 | 132 | |
| 133 | 133 | typedef struct _apple2_memmap_entry apple2_memmap_entry; |
| r1877 | r1878 | |
|---|---|---|
| 74 | 74 | PORT_DIPSETTING( 0, DEF_STR( No ) )\ |
| 75 | 75 | PORT_DIPSETTING( 0x100, DEF_STR( Yes ) ) |
| 76 | 76 | |
| 77 | #define LIGHTPEN ((input_port_7_word_r(0,0)&0xe000)==0xa000) | |
| 78 | #define MOUSE1 ((input_port_7_word_r(0,0)&0xe000)==0x8000) | |
| 79 | #define JOYSTICK1_2BUTTON ((input_port_7_word_r(0,0)&0xe000)==0x6000) | |
| 80 | #define PADDLES12 ((input_port_7_word_r(0,0)&0xe000)==0x4000) | |
| 81 | #define JOYSTICK1 ((input_port_7_word_r(0,0)&0xe000)==0x2000) | |
| 82 | #define LIGHTPEN_POINTER (LIGHTPEN&&(input_port_7_word_r(0,0)&0x1000)) | |
| 83 | #define MOUSE2 ((input_port_7_word_r(0,0)&0xe00)==0x800) | |
| 84 | #define JOYSTICK2_2BUTTON ((input_port_7_word_r(0,0)&0xe00)==0x600) | |
| 85 | #define PADDLES34 ((input_port_7_word_r(0,0)&0xe00)==0x400) | |
| 86 | #define JOYSTICK2 ((input_port_7_word_r(0,0)&0xe00)==0x200) | |
| 87 | #define JOYSTICK_SWAP (input_port_7_word_r(0,0)&0x100) | |
| 77 | #define LIGHTPEN ((readinputport(7)&0xe000)==0xa000) | |
| 78 | #define MOUSE1 ((readinputport(7)&0xe000)==0x8000) | |
| 79 | #define JOYSTICK1_2BUTTON ((readinputport(7)&0xe000)==0x6000) | |
| 80 | #define PADDLES12 ((readinputport(7)&0xe000)==0x4000) | |
| 81 | #define JOYSTICK1 ((readinputport(7)&0xe000)==0x2000) | |
| 82 | #define LIGHTPEN_POINTER (LIGHTPEN&&(readinputport(7)&0x1000)) | |
| 83 | #define MOUSE2 ((readinputport(7)&0xe00)==0x800) | |
| 84 | #define JOYSTICK2_2BUTTON ((readinputport(7)&0xe00)==0x600) | |
| 85 | #define PADDLES34 ((readinputport(7)&0xe00)==0x400) | |
| 86 | #define JOYSTICK2 ((readinputport(7)&0xe00)==0x200) | |
| 87 | #define JOYSTICK_SWAP (readinputport(7)&0x100) | |
| 88 | 88 | |
| 89 | #define PADDLE1_BUTTON ((input_port_1_word_r(0,0)&0x100)) | |
| 90 | #define PADDLE1_VALUE (input_port_1_word_r(0,0)&0xff) | |
| 91 | #define PADDLE2_BUTTON ((input_port_2_word_r(0,0)&0x100)) | |
| 92 | #define PADDLE2_VALUE (input_port_2_word_r(0,0)&0xff) | |
| 93 | #define PADDLE3_BUTTON ((input_port_3_word_r(0,0)&0x100)) | |
| 94 | #define PADDLE3_VALUE (input_port_3_word_r(0,0)&0xff) | |
| 95 | #define PADDLE4_BUTTON ((input_port_4_word_r(0,0)&0x100)) | |
| 96 | #define PADDLE4_VALUE (input_port_4_word_r(0,0)&0xff) | |
| 89 | #define PADDLE1_BUTTON ((readinputport(1)&0x100)) | |
| 90 | #define PADDLE1_VALUE (readinputport(1)&0xff) | |
| 91 | #define PADDLE2_BUTTON ((readinputport(2)&0x100)) | |
| 92 | #define PADDLE2_VALUE (readinputport(2)&0xff) | |
| 93 | #define PADDLE3_BUTTON ((readinputport(3)&0x100)) | |
| 94 | #define PADDLE3_VALUE (readinputport(3)&0xff) | |
| 95 | #define PADDLE4_BUTTON ((readinputport(4)&0x100)) | |
| 96 | #define PADDLE4_VALUE (readinputport(4)&0xff) | |
| 97 | 97 | |
| 98 | 98 | #define MOUSE1_BUTTON1 (MOUSE1&&(readinputport(5)&0x8000)) |
| 99 | 99 | #define MOUSE1_BUTTON2 (MOUSE1&&(readinputport(5)&0x4000)) |
| r1877 | r1878 | |
| 109 | 109 | #define LIGHTPEN_X_VALUE ((readinputport(5)&0x3ff)&~1) /* effectiv resolution */ |
| 110 | 110 | #define LIGHTPEN_Y_VALUE (readinputport(6)&~1) /* effectiv resolution */ |
| 111 | 111 | |
| 112 | #define JOYSTICK_1_LEFT ((input_port_0_word_r(0,0)&0x8000)) | |
| 113 | #define JOYSTICK_1_RIGHT ((input_port_0_word_r(0,0)&0x4000)) | |
| 114 | #define JOYSTICK_1_UP ((input_port_0_word_r(0,0)&0x2000)) | |
| 115 | #define JOYSTICK_1_DOWN ((input_port_0_word_r(0,0)&0x1000)) | |
| 116 | #define JOYSTICK_1_BUTTON ((input_port_0_word_r(0,0)&0x800)) | |
| 117 | #define JOYSTICK_1_BUTTON2 ((input_port_0_word_r(0,0)&0x400)) | |
| 118 | #define JOYSTICK_2_LEFT ((input_port_0_word_r(0,0)&0x80)) | |
| 119 | #define JOYSTICK_2_RIGHT ((input_port_0_word_r(0,0)&0x40)) | |
| 120 | #define JOYSTICK_2_UP ((input_port_0_word_r(0,0)&0x20)) | |
| 121 | #define JOYSTICK_2_DOWN ((input_port_0_word_r(0,0)&0x10)) | |
| 122 | #define JOYSTICK_2_BUTTON ((input_port_0_word_r(0,0)&8)) | |
| 123 | #define JOYSTICK_2_BUTTON2 ((input_port_0_word_r(0,0)&4)) | |
| 112 | #define JOYSTICK_1_LEFT ((readinputport(0)&0x8000)) | |
| 113 | #define JOYSTICK_1_RIGHT ((readinputport(0)&0x4000)) | |
| 114 | #define JOYSTICK_1_UP ((readinputport(0)&0x2000)) | |
| 115 | #define JOYSTICK_1_DOWN ((readinputport(0)&0x1000)) | |
| 116 | #define JOYSTICK_1_BUTTON ((readinputport(0)&0x800)) | |
| 117 | #define JOYSTICK_1_BUTTON2 ((readinputport(0)&0x400)) | |
| 118 | #define JOYSTICK_2_LEFT ((readinputport(0)&0x80)) | |
| 119 | #define JOYSTICK_2_RIGHT ((readinputport(0)&0x40)) | |
| 120 | #define JOYSTICK_2_UP ((readinputport(0)&0x20)) | |
| 121 | #define JOYSTICK_2_DOWN ((readinputport(0)&0x10)) | |
| 122 | #define JOYSTICK_2_BUTTON ((readinputport(0)&8)) | |
| 123 | #define JOYSTICK_2_BUTTON2 ((readinputport(0)&4)) | |
| 124 | 124 | |
| 125 | #define QUICKLOAD (input_port_8_word_r(0,0)&0x8000) | |
| 126 | #define DATASSETTE (input_port_8_word_r(0,0)&0x4000) | |
| 127 | #define DATASSETTE_TONE (input_port_8_word_r(0,0)&0x2000) | |
| 125 | #define QUICKLOAD (readinputport(8)&0x8000) | |
| 126 | #define DATASSETTE (readinputport(8)&0x4000) | |
| 127 | #define DATASSETTE_TONE (readinputport(8)&0x2000) | |
| 128 | 128 | |
| 129 | #define DATASSETTE_PLAY (input_port_8_word_r(0,0)&0x1000) | |
| 130 | #define DATASSETTE_RECORD (input_port_8_word_r(0,0)&0x800) | |
| 131 | #define DATASSETTE_STOP (input_port_8_word_r(0,0)&0x400) | |
| 129 | #define DATASSETTE_PLAY (readinputport(8)&0x1000) | |
| 130 | #define DATASSETTE_RECORD (readinputport(8)&0x800) | |
| 131 | #define DATASSETTE_STOP (readinputport(8)&0x400) | |
| 132 | 132 | |
| 133 | #define SID8580 ((input | |
| 133 | #define SID8580 ((readinput | |
| 134 | 134 | |
| 135 | #define AUTO_MODULE ((input_port_8_r(0)&0x1c)==0) | |
| 136 | #define ULTIMAX_MODULE ((input_port_8_r(0)&0x1c)==4) | |
| 137 | #define C64_MODULE ((input_port_8_r(0)&0x1c)==8) | |
| 138 | #define SUPERGAMES_MODULE ((input_port_8_r(0)&0x1c)==0x10) | |
| 139 | #define ROBOCOP2_MODULE ((input_port_8_r(0)&0x1c)==0x14) | |
| 140 | #define C128_MODULE ((input_port_8_r(0)&0x1c)==0x18) | |
| 135 | #define AUTO_MODULE ((readinputport(8)&0x1c)==0) | |
| 136 | #define ULTIMAX_MODULE ((readinputport(8)&0x1c)==4) | |
| 137 | #define C64_MODULE ((readinputport(8)&0x1c)==8) | |
| 138 | #define SUPERGAMES_MODULE ((readinputport(8)&0x1c)==0x10) | |
| 139 | #define ROBOCOP2_MODULE ((readinputport(8)&0x1c)==0x14) | |
| 140 | #define C128_MODULE ((readinputport(8)&0x1c)==0x18) | |
| 141 | 141 | |
| 142 | #define KEY_ARROW_LEFT (input_port_9_word_r(0,0)&0x8000) | |
| 143 | #define KEY_1 (input_port_9_word_r(0,0)&0x4000) | |
| 144 | #define KEY_2 (input_port_9_word_r(0,0)&0x2000) | |
| 145 | #define KEY_3 (input_port_9_word_r(0,0)&0x1000) | |
| 146 | #define KEY_4 (input_port_9_word_r(0,0)&0x800) | |
| 147 | #define KEY_5 (input_port_9_word_r(0,0)&0x400) | |
| 148 | #define KEY_6 (input_port_9_word_r(0,0)&0x200) | |
| 149 | #define KEY_7 (input_port_9_word_r(0,0)&0x100) | |
| 150 | #define KEY_8 (input_port_9_word_r(0,0)&0x80) | |
| 151 | #define KEY_9 (input_port_9_word_r(0,0)&0x40) | |
| 152 | #define KEY_0 (input_port_9_word_r(0,0)&0x20) | |
| 153 | #define KEY_PLUS (input_port_9_word_r(0,0)&0x10) | |
| 154 | #define KEY_MINUS (input_port_9_word_r(0,0)&8) | |
| 155 | #define KEY_POUND (input_port_9_word_r(0,0)&4) | |
| 156 | #define KEY_HOME (input_port_9_word_r(0,0)&2) | |
| 157 | #define KEY_DEL (input_port_9_word_r(0,0)&1) | |
| 142 | #define KEY_ARROW_LEFT (readinputport(9)&0x8000) | |
| 143 | #define KEY_1 (readinputport(9)&0x4000) | |
| 144 | #define KEY_2 (readinputport(9)&0x2000) | |
| 145 | #define KEY_3 (readinputport(9)&0x1000) | |
| 146 | #define KEY_4 (readinputport(9)&0x800) | |
| 147 | #define KEY_5 (readinputport(9)&0x400) | |
| 148 | #define KEY_6 (readinputport(9)&0x200) | |
| 149 | #define KEY_7 (readinputport(9)&0x100) | |
| 150 | #define KEY_8 (readinputport(9)&0x80) | |
| 151 | #define KEY_9 (readinputport(9)&0x40) | |
| 152 | #define KEY_0 (readinputport(9)&0x20) | |
| 153 | #define KEY_PLUS (readinputport(9)&0x10) | |
| 154 | #define KEY_MINUS (readinputport(9)&8) | |
| 155 | #define KEY_POUND (readinputport(9)&4) | |
| 156 | #define KEY_HOME (readinputport(9)&2) | |
| 157 | #define KEY_DEL (readinputport(9)&1) | |
| 158 | 158 | |
| 159 | #define KEY_CTRL (input_port_10_word_r(0,0)&0x8000) | |
| 160 | #define KEY_Q (input_port_10_word_r(0,0)&0x4000) | |
| 161 | #define KEY_W (input_port_10_word_r(0,0)&0x2000) | |
| 162 | #define KEY_E (input_port_10_word_r(0,0)&0x1000) | |
| 163 | #define KEY_R (input_port_10_word_r(0,0)&0x800) | |
| 164 | #define KEY_T (input_port_10_word_r(0,0)&0x400) | |
| 165 | #define KEY_Y (input_port_10_word_r(0,0)&0x200) | |
| 166 | #define KEY_U (input_port_10_word_r(0,0)&0x100) | |
| 167 | #define KEY_I (input_port_10_word_r(0,0)&0x80) | |
| 168 | #define KEY_O (input_port_10_word_r(0,0)&0x40) | |
| 169 | #define KEY_P (input_port_10_word_r(0,0)&0x20) | |
| 170 | #define KEY_ATSIGN (input_port_10_word_r(0,0)&0x10) | |
| 171 | #define KEY_ASTERIX (input_port_10_word_r(0,0)&8) | |
| 172 | #define KEY_ARROW_UP (input_port_10_word_r(0,0)&4) | |
| 173 | #define KEY_RESTORE (input_port_10_word_r(0,0)&2) | |
| 174 | #define KEY_STOP (input_port_10_word_r(0,0)&1) | |
| 159 | #define KEY_CTRL (readinputport(10)&0x8000) | |
| 160 | #define KEY_Q (readinputport(10)&0x4000) | |
| 161 | #define KEY_W (readinputport(10)&0x2000) | |
| 162 | #define KEY_E (readinputport(10)&0x1000) | |
| 163 | #define KEY_R (readinputport(10)&0x800) | |
| 164 | #define KEY_T (readinputport(10)&0x400) | |
| 165 | #define KEY_Y (readinputport(10)&0x200) | |
| 166 | #define KEY_U (readinputport(10)&0x100) | |
| 167 | #define KEY_I (readinputport(10)&0x80) | |
| 168 | #define KEY_O (readinputport(10)&0x40) | |
| 169 | #define KEY_P (readinputport(10)&0x20) | |
| 170 | #define KEY_ATSIGN (readinputport(10)&0x10) | |
| 171 | #define KEY_ASTERIX (readinputport(10)&8) | |
| 172 | #define KEY_ARROW_UP (readinputport(10)&4) | |
| 173 | #define KEY_RESTORE (readinputport(10)&2) | |
| 174 | #define KEY_STOP (readinputport(10)&1) | |
| 175 | 175 | |
| 176 | #define KEY_SHIFTLOCK (input_port_11_word_r(0,0)&0x8000) | |
| 177 | #define KEY_A (input_port_11_word_r(0,0)&0x4000) | |
| 178 | #define KEY_S (input_port_11_word_r(0,0)&0x2000) | |
| 179 | #define KEY_D (input_port_11_word_r(0,0)&0x1000) | |
| 180 | #define KEY_F (input_port_11_word_r(0,0)&0x800) | |
| 181 | #define KEY_G (input_port_11_word_r(0,0)&0x400) | |
| 182 | #define KEY_H (input_port_11_word_r(0,0)&0x200) | |
| 183 | #define KEY_J (input_port_11_word_r(0,0)&0x100) | |
| 184 | #define KEY_K (input_port_11_word_r(0,0)&0x80) | |
| 185 | #define KEY_L (input_port_11_word_r(0,0)&0x40) | |
| 186 | #define KEY_SEMICOLON (input_port_11_word_r(0,0)&0x20) | |
| 187 | #define KEY_COLON (input_port_11_word_r(0,0)&0x10) | |
| 188 | #define KEY_EQUALS (input_port_11_word_r(0,0)&8) | |
| 189 | #define KEY_RETURN (input_port_11_word_r(0,0)&4) | |
| 190 | #define KEY_CBM (input_port_11_word_r(0,0)&2) | |
| 191 | #define KEY_LEFT_SHIFT ((input_port_11_word_r(0,0)&1)||KEY_SHIFTLOCK) | |
| 176 | #define KEY_SHIFTLOCK (readinputport(11)&0x8000) | |
| 177 | #define KEY_A (readinputport(11)&0x4000) | |
| 178 | #define KEY_S (readinputport(11)&0x2000) | |
| 179 | #define KEY_D (readinputport(11)&0x1000) | |
| 180 | #define KEY_F (readinputport(11)&0x800) | |
| 181 | #define KEY_G (readinputport(11)&0x400) | |
| 182 | #define KEY_H (readinputport(11)&0x200) | |
| 183 | #define KEY_J (readinputport(11)&0x100) | |
| 184 | #define KEY_K (readinputport(11)&0x80) | |
| 185 | #define KEY_L (readinputport(11)&0x40) | |
| 186 | #define KEY_SEMICOLON (readinputport(11)&0x20) | |
| 187 | #define KEY_COLON (readinputport(11)&0x10) | |
| 188 | #define KEY_EQUALS (readinputport(11)&8) | |
| 189 | #define KEY_RETURN (readinputport(11)&4) | |
| 190 | #define KEY_CBM (readinputport(11)&2) | |
| 191 | #define KEY_LEFT_SHIFT ((readinputport(11)&1)||KEY_SHIFTLOCK) | |
| 192 | 192 | |
| 193 | #define KEY_Z (input_port_12_word_r(0,0)&0x8000) | |
| 194 | #define KEY_X (input_port_12_word_r(0,0)&0x4000) | |
| 195 | #define KEY_C (input_port_12_word_r(0,0)&0x2000) | |
| 196 | #define KEY_V (input_port_12_word_r(0,0)&0x1000) | |
| 197 | #define KEY_B (input_port_12_word_r(0,0)&0x800) | |
| 198 | #define KEY_N (input_port_12_word_r(0,0)&0x400) | |
| 199 | #define KEY_M (input_port_12_word_r(0,0)&0x200) | |
| 200 | #define KEY_COMMA (input_port_12_word_r(0,0)&0x100) | |
| 201 | #define KEY_POINT (input_port_12_word_r(0,0)&0x80) | |
| 202 | #define KEY_SLASH (input_port_12_word_r(0,0)&0x40) | |
| 203 | #define KEY_RIGHT_SHIFT ((input_port_12_word_r(0,0)&0x20)\ | |
| 193 | #define KEY_Z (readinputport(12)&0x8000) | |
| 194 | #define KEY_X (readinputport(12)&0x4000) | |
| 195 | #define KEY_C (readinputport(12)&0x2000) | |
| 196 | #define KEY_V (readinputport(12)&0x1000) | |
| 197 | #define KEY_B (readinputport(12)&0x800) | |
| 198 | #define KEY_N (readinputport(12)&0x400) | |
| 199 | #define KEY_M (readinputport(12)&0x200) | |
| 200 | #define KEY_COMMA (readinputport(12)&0x100) | |
| 201 | #define KEY_POINT (readinputport(12)&0x80) | |
| 202 | #define KEY_SLASH (readinputport(12)&0x40) | |
| 203 | #define KEY_RIGHT_SHIFT ((readinputport(12)&0x20)\ | |
| 204 | 204 | ||KEY_CURSOR_UP||KEY_CURSOR_LEFT) |
| 205 | #define KEY_CURSOR_DOWN ((input_port_12_word_r(0,0)&0x10)||KEY_CURSOR_UP) | |
| 206 | #define KEY_CURSOR_RIGHT ((input_port_12_word_r(0,0)&8)||KEY_CURSOR_LEFT) | |
| 207 | #define KEY_SPACE (input_port_12_word_r(0,0)&4) | |
| 208 | #define KEY_F1 (input_port_12_word_r(0,0)&2) | |
| 209 | #define KEY_F3 (input_port_12_word_r(0,0)&1) | |
| 205 | #define KEY_CURSOR_DOWN ((readinputport(12)&0x10)||KEY_CURSOR_UP) | |
| 206 | #define KEY_CURSOR_RIGHT ((readinputport(12)&8)||KEY_CURSOR_LEFT) | |
| 207 | #define KEY_SPACE (readinputport(12)&4) | |
| 208 | #define KEY_F1 (readinputport(12)&2) | |
| 209 | #define KEY_F3 (readinputport(12)&1) | |
| 210 | 210 | |
| 211 | #define KEY_F5 (input_port_13_word_r(0,0)&0x8000) | |
| 212 | #define KEY_F7 (input_port_13_word_r(0,0)&0x4000) | |
| 213 | #define KEY_CURSOR_UP (input_port_13_word_r(0,0)&0x2000) | |
| 214 | #define KEY_CURSOR_LEFT (input_port_13_word_r(0,0)&0x1000) | |
| 211 | #define KEY_F5 (readinputport(13)&0x8000) | |
| 212 | #define KEY_F7 (readinputport(13)&0x4000) | |
| 213 | #define KEY_CURSOR_UP (readinputport(13)&0x2000) | |
| 214 | #define KEY_CURSOR_LEFT (readinputport(13)&0x1000) | |
| 215 | 215 | |
| 216 | 216 | |
| 217 | 217 | /*----------- defined in machine/c64.c -----------*/ |
| r1877 | r1878 | |
|---|---|---|
| 46 | 46 | DEVICE_LOAD( svi318_floppy ); |
| 47 | 47 | |
| 48 | 48 | MC6845_UPDATE_ROW( svi806_crtc6845_update_row ); |
| 49 | READ8_HANDLER( svi806_r ); | |
| 50 | WRITE8_HANDLER( svi806_w ); | |
| 51 | 49 | WRITE8_HANDLER( svi806_ram_enable_w ); |
| 52 | 50 | VIDEO_START( svi328_806 ); |
| 53 | 51 | VIDEO_UPDATE( svi328_806 ); |
| r1877 | r1878 | |
|---|---|---|
| 8 | 8 | #define AMSTR_PC_H_ |
| 9 | 9 | |
| 10 | 10 | |
| 11 | #define PC200_MODE (input | |
| 11 | #define PC200_MODE (readinput | |
| 12 | 12 | #define PC200_MDA 0x30 |
| 13 | 13 | |
| 14 | 14 |
| r1877 | r1878 | |
|---|---|---|
| 10 | 10 | #define PC1251_H_ |
| 11 | 11 | |
| 12 | 12 | |
| 13 | #define PC1251_SWITCH_MODE (input | |
| 13 | #define PC1251_SWITCH_MODE (readinput | |
| 14 | 14 | |
| 15 | #define PC1251_KEY_DEF input_port_0_r(0)&0x100 | |
| 16 | #define PC1251_KEY_SHIFT input_port_0_r(0)&0x80 | |
| 17 | #define PC1251_KEY_DOWN input_port_0_r(0)&0x40 | |
| 18 | #define PC1251_KEY_UP input_port_0_r(0)&0x20 | |
| 19 | #define PC1251_KEY_LEFT input_port_0_r(0)&0x10 | |
| 20 | #define PC1251_KEY_RIGHT input_port_0_r(0)&8 | |
| 15 | #define PC1251_KEY_DEF readinputport(0)&0x100 | |
| 16 | #define PC1251_KEY_SHIFT readinputport(0)&0x80 | |
| 17 | #define PC1251_KEY_DOWN readinputport(0)&0x40 | |
| 18 | #define PC1251_KEY_UP readinputport(0)&0x20 | |
| 19 | #define PC1251_KEY_LEFT readinputport(0)&0x10 | |
| 20 | #define PC1251_KEY_RIGHT readinputport(0)&8 | |
| 21 | 21 | |
| 22 | #define PC1251_KEY_BRK input_port_1_r(0)&0x80 | |
| 23 | #define PC1251_KEY_Q input_port_1_r(0)&0x40 | |
| 24 | #define PC1251_KEY_W input_port_1_r(0)&0x20 | |
| 25 | #define PC1251_KEY_E input_port_1_r(0)&0x10 | |
| 26 | #define PC1251_KEY_R input_port_1_r(0)&8 | |
| 27 | #define PC1251_KEY_T input_port_1_r(0)&4 | |
| 28 | #define PC1251_KEY_Y input_port_1_r(0)&2 | |
| 29 | #define PC1251_KEY_U input_port_1_r(0)&1 | |
| 22 | #define PC1251_KEY_BRK readinputport(1)&0x80 | |
| 23 | #define PC1251_KEY_Q readinputport(1)&0x40 | |
| 24 | #define PC1251_KEY_W readinputport(1)&0x20 | |
| 25 | #define PC1251_KEY_E readinputport(1)&0x10 | |
| 26 | #define PC1251_KEY_R readinputport(1)&8 | |
| 27 | #define PC1251_KEY_T readinputport(1)&4 | |
| 28 | #define PC1251_KEY_Y readinputport(1)&2 | |
| 29 | #define PC1251_KEY_U readinputport(1)&1 | |
| 30 | 30 | |
| 31 | #define PC1251_KEY_I input_port_2_r(0)&0x80 | |
| 32 | #define PC1251_KEY_O input_port_2_r(0)&0x40 | |
| 33 | #define PC1251_KEY_P input_port_2_r(0)&0x20 | |
| 34 | #define PC1251_KEY_A input_port_2_r(0)&0x10 | |
| 35 | #define PC1251_KEY_S input_port_2_r(0)&8 | |
| 36 | #define PC1251_KEY_D input_port_2_r(0)&4 | |
| 37 | #define PC1251_KEY_F input_port_2_r(0)&2 | |
| 38 | #define PC1251_KEY_G input_port_2_r(0)&1 | |
| 31 | #define PC1251_KEY_I readinputport(2)&0x80 | |
| 32 | #define PC1251_KEY_O readinputport(2)&0x40 | |
| 33 | #define PC1251_KEY_P readinputport(2)&0x20 | |
| 34 | #define PC1251_KEY_A readinputport(2)&0x10 | |
| 35 | #define PC1251_KEY_S readinputport(2)&8 | |
| 36 | #define PC1251_KEY_D readinputport(2)&4 | |
| 37 | #define PC1251_KEY_F readinputport(2)&2 | |
| 38 | #define PC1251_KEY_G readinputport(2)&1 | |
| 39 | 39 | |
| 40 | #define PC1251_KEY_H input_port_3_r(0)&0x80 | |
| 41 | #define PC1251_KEY_J input_port_3_r(0)&0x40 | |
| 42 | #define PC1251_KEY_K input_port_3_r(0)&0x20 | |
| 43 | #define PC1251_KEY_L input_port_3_r(0)&0x10 | |
| 44 | #define PC1251_KEY_EQUALS input_port_3_r(0)&8 | |
| 45 | #define PC1251_KEY_Z input_port_3_r(0)&4 | |
| 46 | #define PC1251_KEY_X input_port_3_r(0)&2 | |
| 47 | #define PC1251_KEY_C input_port_3_r(0)&1 | |
| 40 | #define PC1251_KEY_H readinputport(3)&0x80 | |
| 41 | #define PC1251_KEY_J readinputport(3)&0x40 | |
| 42 | #define PC1251_KEY_K readinputport(3)&0x20 | |
| 43 | #define PC1251_KEY_L readinputport(3)&0x10 | |
| 44 | #define PC1251_KEY_EQUALS readinputport(3)&8 | |
| 45 | #define PC1251_KEY_Z readinputport(3)&4 | |
| 46 | #define PC1251_KEY_X readinputport(3)&2 | |
| 47 | #define PC1251_KEY_C readinputport(3)&1 | |
| 48 | 48 | |
| 49 | #define PC1251_KEY_V input_port_4_r(0)&0x80 | |
| 50 | #define PC1251_KEY_B input_port_4_r(0)&0x40 | |
| 51 | #define PC1251_KEY_N input_port_4_r(0)&0x20 | |
| 52 | #define PC1251_KEY_M input_port_4_r(0)&0x10 | |
| 53 | #define PC1251_KEY_SPACE input_port_4_r(0)&8 | |
| 54 | #define PC1251_KEY_ENTER input_port_4_r(0)&4 | |
| 55 | #define PC1251_KEY_7 input_port_4_r(0)&2 | |
| 56 | #define PC1251_KEY_8 input_port_4_r(0)&1 | |
| 49 | #define PC1251_KEY_V readinputport(4)&0x80 | |
| 50 | #define PC1251_KEY_B readinputport(4)&0x40 | |
| 51 | #define PC1251_KEY_N readinputport(4)&0x20 | |
| 52 | #define PC1251_KEY_M readinputport(4)&0x10 | |
| 53 | #define PC1251_KEY_SPACE readinputport(4)&8 | |
| 54 | #define PC1251_KEY_ENTER readinputport(4)&4 | |
| 55 | #define PC1251_KEY_7 readinputport(4)&2 | |
| 56 | #define PC1251_KEY_8 readinputport(4)&1 | |
| 57 | 57 | |
| 58 | #define PC1251_KEY_9 input_port_5_r(0)&0x80 | |
| 59 | #define PC1251_KEY_CL input_port_5_r(0)&0x40 | |
| 60 | #define PC1251_KEY_4 input_port_5_r(0)&0x20 | |
| 61 | #define PC1251_KEY_5 input_port_5_r(0)&0x10 | |
| 62 | #define PC1251_KEY_6 input_port_5_r(0)&8 | |
| 63 | #define PC1251_KEY_SLASH input_port_5_r(0)&4 | |
| 64 | #define PC1251_KEY_1 input_port_5_r(0)&2 | |
| 65 | #define PC1251_KEY_2 input_port_5_r(0)&1 | |
| 58 | #define PC1251_KEY_9 readinputport(5)&0x80 | |
| 59 | #define PC1251_KEY_CL readinputport(5)&0x40 | |
| 60 | #define PC1251_KEY_4 readinputport(5)&0x20 | |
| 61 | #define PC1251_KEY_5 readinputport(5)&0x10 | |
| 62 | #define PC1251_KEY_6 readinputport(5)&8 | |
| 63 | #define PC1251_KEY_SLASH readinputport(5)&4 | |
| 64 | #define PC1251_KEY_1 readinputport(5)&2 | |
| 65 | #define PC1251_KEY_2 readinputport(5)&1 | |
| 66 | 66 | |
| 67 | #define PC1251_KEY_3 input_port_6_r(0)&0x80 | |
| 68 | #define PC1251_KEY_ASTERIX input_port_6_r(0)&0x40 | |
| 69 | #define PC1251_KEY_0 input_port_6_r(0)&0x20 | |
| 70 | #define PC1251_KEY_POINT input_port_6_r(0)&0x10 | |
| 71 | #define PC1251_KEY_PLUS input_port_6_r(0)&8 | |
| 72 | #define PC1251_KEY_MINUS input_port_6_r(0)&4 | |
| 73 | #define PC1251_KEY_RESET input_port_6_r(0)&1 | |
| 67 | #define PC1251_KEY_3 readinputport(6)&0x80 | |
| 68 | #define PC1251_KEY_ASTERIX readinputport(6)&0x40 | |
| 69 | #define PC1251_KEY_0 readinputport(6)&0x20 | |
| 70 | #define PC1251_KEY_POINT readinputport(6)&0x10 | |
| 71 | #define PC1251_KEY_PLUS readinputport(6)&8 | |
| 72 | #define PC1251_KEY_MINUS readinputport(6)&4 | |
| 73 | #define PC1251_KEY_RESET readinputport(6)&1 | |
| 74 | 74 | |
| 75 | #define PC1251_RAM4K (input_port_7_r(0)&0xc0)==0x40 | |
| 76 | #define PC1251_RAM6K (input_port_7_r(0)&0xc0)==0x80 | |
| 77 | #define PC1251_RAM11K (input_port_7_r(0)&0xc0)==0xc0 | |
| 75 | #define PC1251_RAM4K (readinputport(7)&0xc0)==0x40 | |
| 76 | #define PC1251_RAM6K (readinputport(7)&0xc0)==0x80 | |
| 77 | #define PC1251_RAM11K (readinputport(7)&0xc0)==0xc0 | |
| 78 | 78 | |
| 79 | #define PC1251_CONTRAST (input | |
| 79 | #define PC1251_CONTRAST (readinput | |
| 80 | 80 | |
| 81 | 81 | |
| 82 | 82 | /*----------- defined in machine/pc1251.c -----------*/ |
| r1877 | r1878 | |
|---|---|---|
| 14 | 14 | void vc20tape_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info); |
| 15 | 15 | |
| 16 | 16 | /* the function which should be called by change on readline */ |
| 17 | extern void vc20_tape_open (write8_ | |
| 17 | extern void vc20_tape_open (write8_machin | |
| 18 | 18 | extern void c16_tape_open (void); |
| 19 | 19 | extern void vc20_tape_close (void); |
| 20 | 20 |
| r1877 | r1878 | |
|---|---|---|
| 22 | 22 | return 0; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | READ8_HANDLER( cbmb_mc6845_register_r ) { | |
| 26 | return mc6845_register_r( mc6845 ); | |
| 27 | } | |
| 28 | ||
| 29 | WRITE8_HANDLER( cbmb_mc6845_register_w ) { | |
| 30 | mc6845_register_w( mc6845, data ); | |
| 31 | } | |
| 32 | ||
| 33 | WRITE8_HANDLER( cbmb_mc6845_address_w ) { | |
| 34 | mc6845_address_w( mc6845, data ); | |
| 35 | } | |
| 36 | ||
| 37 | 25 | void cbm600_vh_init(void) |
| 38 | 26 | { |
| 39 | 27 | UINT8 *gfx = memory_region(REGION_GFX1); |
| r1877 | r1878 | |
|---|---|---|
| 213 | 213 | |
| 214 | 214 | |
| 215 | 215 | |
| 216 | WRITE64_HANDLER( cirrus_64be_42E8_w ) { write64be_with_write8_handler(cirrus_42E8_w, offset, data, mem_mask); } | |
| 216 | WRITE64_HANDLER( cirrus_64be_42E8_w ) { write64be_with_write8_handler(cirrus_42E8_w, machine, offset, data, mem_mask); } | |
| 217 | 217 |
| r1877 | r1878 | |
|---|---|---|
| 52 | 52 | |
| 53 | 53 | static void coco_horizontal_sync_callback(int data) |
| 54 | 54 | { |
| 55 | pia_0_ca1_w(0, data); | |
| 55 | pia_0_ca1_w(Machine, 0, data); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| 59 | 59 | |
| 60 | 60 | static void coco_field_sync_callback(int data) |
| 61 | 61 | { |
| 62 | pia_0_cb1_w(0, data); | |
| 62 | pia_0_cb1_w(Machine, 0, data); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 |
| r1877 | r1878 | |
|---|---|---|
| 1154 | 1154 | cpunum_set_input_line( machine, 0, VBL_INT, ASSERT_LINE ); |
| 1155 | 1155 | } |
| 1156 | 1156 | |
| 1157 | void gb_video_init( int mode ) { | |
| 1157 | void gb_video_init( running_machine *machine, int mode ) { | |
| 1158 | 1158 | int i; |
| 1159 | 1159 | int vram_size = 0x2000; |
| 1160 | 1160 | |
| r1877 | r1878 | |
| 1218 | 1218 | timer_set( ATTOTIME_IN_CYCLES(1,0), NULL, 0, gb_video_init_vbl ); |
| 1219 | 1219 | |
| 1220 | 1220 | /* Initialize some video registers */ |
| 1221 | gb_video_w( 0x0, 0x91 ); /* LCDCONT */ | |
| 1222 | gb_video_w( 0x7, 0xFC ); /* BGRDPAL */ | |
| 1223 | gb_video_w( 0x8, 0xFC ); /* SPR0PAL */ | |
| 1224 | gb_video_w( 0x9, 0xFC ); /* SPR1PAL */ | |
| 1221 | gb_video_w( machine, 0x0, 0x91 ); /* LCDCONT */ | |
| 1222 | gb_video_w( machine, 0x7, 0xFC ); /* BGRDPAL */ | |
| 1223 | gb_video_w( machine, 0x8, 0xFC ); /* SPR0PAL */ | |
| 1224 | gb_video_w( machine, 0x9, 0xFC ); /* SPR1PAL */ | |
| 1225 | 1225 | |
| 1226 | 1226 | CURLINE = gb_lcd.current_line = 0; |
| 1227 | 1227 | LCDSTAT = ( LCDSTAT & 0xF8 ) | 0x05; |
| r1877 | r1878 | |
| 1246 | 1246 | timer_set( ATTOTIME_IN_CYCLES(1,0), NULL, 0, gb_video_init_vbl ); |
| 1247 | 1247 | |
| 1248 | 1248 | /* Initialize some video registers */ |
| 1249 | gb_video_w( 0x0, 0x91 ); /* LCDCONT */ | |
| 1250 | gb_video_w( 0x7, 0xFC ); /* BGRDPAL */ | |
| 1251 | gb_video_w( 0x8, 0xFC ); /* SPR0PAL */ | |
| 1252 | gb_video_w( 0x9, 0xFC ); /* SPR1PAL */ | |
| 1249 | gb_video_w( machine, 0x0, 0x91 ); /* LCDCONT */ | |
| 1250 | gb_video_w( machine, 0x7, 0xFC ); /* BGRDPAL */ | |
| 1251 | gb_video_w( machine, 0x8, 0xFC ); /* SPR0PAL */ | |
| 1252 | gb_video_w( machine, 0x9, 0xFC ); /* SPR1PAL */ | |
| 1253 | 1253 | |
| 1254 | 1254 | CURLINE = gb_lcd.current_line = 0; |
| 1255 | 1255 | LCDSTAT = ( LCDSTAT & 0xF8 ) | 0x05; |
| r1877 | r1878 | |
| 1278 | 1278 | timer_set( ATTOTIME_IN_CYCLES(1,0), NULL, 0, gb_video_init_vbl ); |
| 1279 | 1279 | |
| 1280 | 1280 | /* Initialize some video registers */ |
| 1281 | gbc_video_w( 0x0, 0x91 ); /* LCDCONT */ | |
| 1282 | gbc_video_w( 0x7, 0xFC ); /* BGRDPAL */ | |
| 1283 | gbc_video_w( 0x8, 0xFC ); /* SPR0PAL */ | |
| 1284 | gbc_video_w( 0x9, 0xFC ); /* SPR1PAL */ | |
| 1285 | gbc_video_w( 0x0F, 0x00 ); | |
| 1281 | gbc_video_w( machine, 0x0, 0x91 ); /* LCDCONT */ | |
| 1282 | gbc_video_w( machine, 0x7, 0xFC ); /* BGRDPAL */ | |
| 1283 | gbc_video_w( machine, 0x8, 0xFC ); /* SPR0PAL */ | |
| 1284 | gbc_video_w( machine, 0x9, 0xFC ); /* SPR1PAL */ | |
| 1285 | gbc_video_w( machine, 0x0F, 0x00 ); | |
| 1286 | 1286 | CURLINE = gb_lcd.current_line = 0x90; |
| 1287 | 1287 | LCDSTAT = ( LCDSTAT & 0xF8 ) | 0x01; |
| 1288 | 1288 | gb_lcd.mode = 1; |
| r1877 | r1878 | |
| 2185 | 2185 | return; |
| 2186 | 2186 | default: |
| 2187 | 2187 | /* we didn't handle the write, so pass it to the GB handler */ |
| 2188 | gb_video_w( offset, data ); | |
| 2188 | gb_video_w( machine, offset, data ); | |
| 2189 | 2189 | return; |
| 2190 | 2190 | } |
| 2191 | 2191 |
| r1877 | r1878 | |
|---|---|---|
| 865 | 865 | switch( nREX3_DCBSlvSelect ) |
| 866 | 866 | { |
| 867 | 867 | case 0x00: |
| 868 | return newport_vc2_r( 0, mem_mask ); | |
| 868 | return newport_vc2_r( machine, 0, mem_mask ); | |
| 869 | 869 | break; |
| 870 | 870 | case 0x02: |
| 871 | return newport_cmap0_r( 0, mem_mask ); | |
| 871 | return newport_cmap0_r( machine, 0, mem_mask ); | |
| 872 | 872 | break; |
| 873 | 873 | case 0x03: |
| 874 | return newport_cmap1_r( 0, mem_mask ); | |
| 874 | return newport_cmap1_r( machine, 0, mem_mask ); | |
| 875 | 875 | break; |
| 876 | 876 | case 0x05: |
| 877 | return newport_xmap0_r( 0, mem_mask ); | |
| 877 | return newport_xmap0_r( machine, 0, mem_mask ); | |
| 878 | 878 | break; |
| 879 | 879 | case 0x06: |
| 880 | return newport_xmap1_r( 0, mem_mask ); | |
| 880 | return newport_xmap1_r( machine, 0, mem_mask ); | |
| 881 | 881 | break; |
| 882 | 882 | default: |
| 883 | 883 | verboselog( 2, "REX3 Display Control Bus Data MSW Read: %08x\n", nREX3_DCBDataMSW ); |
| r1877 | r1878 | |
| 1660 | 1660 | switch( nREX3_DCBSlvSelect ) |
| 1661 | 1661 | { |
| 1662 | 1662 | case 0x00: |
| 1663 | newport_vc2_w( 0, data, mem_mask ); | |
| 1663 | newport_vc2_w( machine, 0, data, mem_mask ); | |
| 1664 | 1664 | break; |
| 1665 | 1665 | case 0x01: |
| 1666 | newport_cmap0_w( 0, data, mem_mask ); | |
| 1666 | newport_cmap0_w( machine, 0, data, mem_mask ); | |
| 1667 | 1667 | break; |
| 1668 | 1668 | case 0x04: |
| 1669 | newport_xmap0_w( 0, data, mem_mask ); | |
| 1670 | newport_xmap1_w( 0, data, mem_mask ); | |
| 1669 | newport_xmap0_w( machine, 0, data, mem_mask ); | |
| 1670 | newport_xmap1_w( machine, 0, data, mem_mask ); | |
| 1671 | 1671 | break; |
| 1672 | 1672 | case 0x05: |
| 1673 | newport_xmap0_w( 0, data, mem_mask ); | |
| 1673 | newport_xmap0_w( machine, 0, data, mem_mask ); | |
| 1674 | 1674 | break; |
| 1675 | 1675 | case 0x06: |
| 1676 | newport_xmap1_w( 0, data, mem_mask ); | |
| 1676 | newport_xmap1_w( machine, 0, data, mem_mask ); | |
| 1677 | 1677 | break; |
| 1678 | 1678 | default: |
| 1679 | 1679 | verboselog( 2, "REX3 Display Control Bus Data MSW Write: %08x\n", data ); |
| r1877 | r1878 | |
|---|---|---|
| 402 | 402 | } |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | static | |
| 405 | static | |
| 406 | 406 | { |
| 407 | 407 | int data; |
| 408 | 408 | data=vga.memory[((offset&~1)<<1)|(offset&1)]; |
| r1877 | r1878 | |
| 412 | 412 | |
| 413 | 413 | static WRITE8_HANDLER(vga_text_w) |
| 414 | 414 | { |
| 415 | vga_dirty_w(((offset&~1)<<1)|(offset&1),data); | |
| 415 | vga_dirty_w(machine, ((offset&~1)<<1)|(offset&1),data); | |
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | INLINE UINT8 ega_bitplane_to_packed(UINT8 *latch, int number) |
| r1877 | r1878 | |
| 498 | 498 | static WRITE8_HANDLER(vga_ega_w) |
| 499 | 499 | { |
| 500 | 500 | if (vga.sequencer.data[2]&1) |
| 501 | vga_dirty_w(offset<<2, vga_latch_write(0,data)); | |
| 501 | vga_dirty_w(machine, offset<<2, vga_latch_write(0,data)); | |
| 502 | 502 | if (vga.sequencer.data[2]&2) |
| 503 | vga_dirty_w((offset<<2)+1, vga_latch_write(1,data)); | |
| 503 | vga_dirty_w(machine, (offset<<2)+1, vga_latch_write(1,data)); | |
| 504 | 504 | if (vga.sequencer.data[2]&4) |
| 505 | vga_dirty_font_w((offset<<2)+2, vga_latch_write(2,data)); | |
| 505 | vga_dirty_font_w(machine, (offset<<2)+2, vga_latch_write(2,data)); | |
| 506 | 506 | if (vga.sequencer.data[2]&8) |
| 507 | vga_dirty_w((offset<<2)+3, vga_latch_write(3,data)); | |
| 507 | vga_dirty_w(machine, (offset<<2)+3, vga_latch_write(3,data)); | |
| 508 | 508 | if ((offset==0xffff)&&(data==0)) vga.log=1; |
| 509 | 509 | } |
| 510 | 510 | |
| r1877 | r1878 | |
| 518 | 518 | |
| 519 | 519 | static WRITE8_HANDLER(vga_vga_w) |
| 520 | 520 | { |
| 521 | vga_dirty_font_w(((offset&~3)<<2)|(offset&3),data); | |
| 521 | vga_dirty_font_w(machine, ((offset&~3)<<2)|(offset&3),data); | |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | static READ64_HANDLER( vga_text64_r ) { return read64be_with_read8_handler(vga_text_r, offset, mem_mask); } | |
| 525 | static READ64_HANDLER( vga_vga64_r ) { return read64be_with_read8_handler(vga_vga_r, offset, mem_mask); } | |
| 526 | static WRITE64_HANDLER( vga_text64_w ) { write64be_with_write8_handler(vga_text_w, offset, data, mem_mask); } | |
| 527 | static WRITE64_HANDLER( vga_vga64_w ) { write64be_with_write8_handler(vga_vga_w, offset, data, mem_mask); } | |
| 524 | static READ64_HANDLER( vga_text64_r ) { return read64be_with_read8_handler(vga_text_r, machine, offset, mem_mask); } | |
| 525 | static READ64_HANDLER( vga_vga64_r ) { return read64be_with_read8_handler(vga_vga_r, machine, offset, mem_mask); } | |
| 526 | static WRITE64_HANDLER( vga_text64_w ) { write64be_with_write8_handler(vga_text_w, machine, offset, data, mem_mask); } | |
| 527 | static WRITE64_HANDLER( vga_vga64_w ) { write64be_with_write8_handler(vga_vga_w, machine, offset, data, mem_mask); } | |
| 528 | 528 | |
| 529 | 529 | static void vga_cpu_interface(void) |
| 530 | 530 | { |
| 531 | 531 | static int sequencer, gc; |
| 532 | read8_handler read_handler; | |
| 533 | write8_handler write_handler; | |
| 534 | read64_handler read_handler64; | |
| 535 | write64_handler write_handler64; | |
| 532 | read8_machine_func read_handler; | |
| 533 | write8_machine_func write_handler; | |
| 534 | read64_machine_func read_handler64; | |
| 535 | write64_machine_func write_handler64; | |
| 536 | 536 | UINT8 sel; |
| 537 | 537 | int buswidth; |
| 538 | 538 | |
| r1877 | r1878 | |
| 573 | 573 | case 0x00: |
| 574 | 574 | if (vga.vga_intf.vga_memory_bank != 0) |
| 575 | 575 | { |
| 576 | read_handler = (read8_handler) (FPTR)vga.vga_intf.vga_memory_bank; | |
| 577 | write_handler = (write8_handler) (FPTR)vga.vga_intf.vga_memory_bank; | |
| 576 | read_handler = (read8_machine_func) (FPTR)vga.vga_intf.vga_memory_bank; | |
| 577 | write_handler = (write8_machine_func) (FPTR)vga.vga_intf.vga_memory_bank; | |
| 578 | 578 | } |
| 579 | 579 | else |
| 580 | 580 | { |
| r1877 | r1878 | |
| 754 | 754 | { |
| 755 | 755 | UINT8 data = 0xff; |
| 756 | 756 | if (CRTC_PORT_ADDR==0x3b0) |
| 757 | data=vga_crtc_r(offset); | |
| 757 | data=vga_crtc_r(machine, offset); | |
| 758 | 758 | return data; |
| 759 | 759 | } |
| 760 | 760 | |
| r1877 | r1878 | |
| 792 | 792 | switch ((vga.miscellaneous_output>>2)&3) |
| 793 | 793 | { |
| 794 | 794 | case 3: |
| 795 | if (vga.vga_intf.read_dipswitch && vga.vga_intf.read_dipswitch(0) & 0x01) | |
| 795 | if (vga.vga_intf.read_dipswitch && vga.vga_intf.read_dipswitch(machine, 0) & 0x01) | |
| 796 | 796 | data |= 0x10; |
| 797 | 797 | break; |
| 798 | 798 | case 2: |
| 799 | if (vga.vga_intf.read_dipswitch && vga.vga_intf.read_dipswitch(0) & 0x02) | |
| 799 | if (vga.vga_intf.read_dipswitch && vga.vga_intf.read_dipswitch(machine, 0) & 0x02) | |
| 800 | 800 | data |= 0x10; |
| 801 | 801 | break; |
| 802 | 802 | case 1: |
| 803 | if (vga.vga_intf.read_dipswitch && vga.vga_intf.read_dipswitch(0) & 0x04) | |
| 803 | if (vga.vga_intf.read_dipswitch && vga.vga_intf.read_dipswitch(machine, 0) & 0x04) | |
| 804 | 804 | data |= 0x10; |
| 805 | 805 | break; |
| 806 | 806 | case 0: |
| 807 | if (vga.vga_intf.read_dipswitch && vga.vga_intf.read_dipswitch(0) & 0x08) | |
| 807 | if (vga.vga_intf.read_dipswitch && vga.vga_intf.read_dipswitch(machine, 0) & 0x08) | |
| 808 | 808 | data |= 0x10; |
| 809 | 809 | break; |
| 810 | 810 | } |
| r1877 | r1878 | |
| 886 | 886 | { |
| 887 | 887 | UINT8 data = 0xff; |
| 888 | 888 | if (CRTC_PORT_ADDR == 0x3d0) |
| 889 | data = vga_crtc_r(offset); | |
| 889 | data = vga_crtc_r(machine, offset); | |
| 890 | 890 | return data; |
| 891 | 891 | } |
| 892 | 892 | |
| r1877 | r1878 | |
| 896 | 896 | logerror("vga_port_03b0_w(): port=0x%04x data=0x%02x\n", offset + 0x3b0, data); |
| 897 | 897 | |
| 898 | 898 | if (CRTC_PORT_ADDR == 0x3b0) |
| 899 | vga_crtc_w(offset, data); | |
| 899 | vga_crtc_w(machine, offset, data); | |
| 900 | 900 | } |
| 901 | 901 | |
| 902 | 902 | WRITE8_HANDLER(vga_port_03c0_w) |
| r1877 | r1878 | |
| 1016 | 1016 | logerror("vga_port_03d0_w(): port=0x%04x data=0x%02x\n", offset + 0x3d0, data); |
| 1017 | 1017 | |
| 1018 | 1018 | if (CRTC_PORT_ADDR == 0x3d0) |
| 1019 | vga_crtc_w(offset,data); | |
| 1019 | vga_crtc_w(machine, offset, data); | |
| 1020 | 1020 | } |
| 1021 | 1021 | |
| 1022 | 1022 | |
| 1023 | 1023 | |
| 1024 | 1024 | READ8_HANDLER( paradise_ega_03c0_r ) |
| 1025 | 1025 | { |
| 1026 | UINT8 data = vga_port_03c0_r(offset); | |
| 1026 | UINT8 data = vga_port_03c0_r(machine, offset); | |
| 1027 | 1027 | |
| 1028 | 1028 | if (offset == 2) |
| 1029 | 1029 | { |
| 1030 | 1030 | if ( (vga.feature_control&3)==2 ) { |
| 1031 | data=(data&~0x60)|((vga.vga_intf.read_dipswitch(0)&0xc0)>>1); | |
| 1031 | data=(data&~0x60)|((vga.vga_intf.read_dipswitch(machine, 0)&0xc0)>>1); | |
| 1032 | 1032 | } else if ((vga.feature_control&3)==1 ) { |
| 1033 | data=(data&~0x60)|((vga.vga_intf.read_dipswitch(0)&0x30)<<1); | |
| 1033 | data=(data&~0x60)|((vga.vga_intf.read_dipswitch(machine, 0)&0x30)<<1); | |
| 1034 | 1034 | } |
| 1035 | 1035 | } |
| 1036 | 1036 | return data; |
| r1877 | r1878 | |
| 1076 | 1076 | |
| 1077 | 1077 | |
| 1078 | 1078 | |
| 1079 | static READ64_HANDLER( vga_port64be_03b0_r ) { return read64be_with_read8_handler(vga_port_03b0_r, offset, mem_mask); } | |
| 1080 | static READ64_HANDLER( vga_port64be_03c0_r ) { return read64be_with_read8_handler(vga_port_03c0_r, offset, mem_mask); } | |
| 1081 | static READ64_HANDLER( vga_port64be_03d0_r ) { return read64be_with_read8_handler(vga_port_03d0_r, offset, mem_mask); } | |
| 1079 | static READ64_HANDLER( vga_port64be_03b0_r ) { return read64be_with_read8_handler(vga_port_03b0_r, machine, offset, mem_mask); } | |
| 1080 | static READ64_HANDLER( vga_port64be_03c0_r ) { return read64be_with_read8_handler(vga_port_03c0_r, machine, offset, mem_mask); } | |
| 1081 | static READ64_HANDLER( vga_port64be_03d0_r ) { return read64be_with_read8_handler(vga_port_03d0_r, machine, offset, mem_mask); } | |
| 1082 | 1082 | |
| 1083 | static WRITE64_HANDLER( vga_port64be_03b0_w ) { write64be_with_write8_handler(vga_port_03b0_w, offset, data, mem_mask); } | |
| 1084 | static WRITE64_HANDLER( vga_port64be_03c0_w ) { write64be_with_write8_handler(vga_port_03c0_w, offset, data, mem_mask); } | |
| 1085 | static WRITE64_HANDLER( vga_port64be_03d0_w ) { write64be_with_write8_handler(vga_port_03d0_w, offset, data, mem_mask); } | |
| 1083 | static WRITE64_HANDLER( vga_port64be_03b0_w ) { write64be_with_write8_handler(vga_port_03b0_w, machine, offset, data, mem_mask); } | |
| 1084 | static WRITE64_HANDLER( vga_port64be_03c0_w ) { write64be_with_write8_handler(vga_port_03c0_w, machine, offset, data, mem_mask); } | |
| 1085 | static WRITE64_HANDLER( vga_port64be_03d0_w ) { write64be_with_write8_handler(vga_port_03d0_w, machine, offset, data, mem_mask); } | |
| 1086 | 1086 | |
| 1087 | 1087 | |
| 1088 | 1088 | |
| r1877 | r1878 | |
| 1471 | 1471 | |
| 1472 | 1472 | |
| 1473 | 1473 | |
| 1474 | READ16_HANDLER( vga_port16le_03b0_r ) { return read16le_with_read8_handler(vga_port_03b0_r, offset, mem_mask); } | |
| 1475 | READ16_HANDLER( vga_port16le_03c0_r ) { return read16le_with_read8_handler(vga_port_03c0_r, offset, mem_mask); } | |
| 1476 | READ16_HANDLER( vga_port16le_03d0_r ) { return read16le_with_read8_handler(vga_port_03d0_r, offset, mem_mask); } | |
| 1477 | WRITE16_HANDLER( vga_port16le_03b0_w ) { write16le_with_write8_handler(vga_port_03b0_w, offset, data, mem_mask); } | |
| 1478 | WRITE16_HANDLER( vga_port16le_03c0_w ) { write16le_with_write8_handler(vga_port_03c0_w, offset, data, mem_mask); } | |
| 1479 | WRITE16_HANDLER( vga_port16le_03d0_w ) { write16le_with_write8_handler(vga_port_03d0_w, offset, data, mem_mask); } | |
| 1474 | READ16_HANDLER( vga_port16le_03b0_r ) { return read16le_with_read8_handler(vga_port_03b0_r, machine, offset, mem_mask); } | |
| 1475 | READ16_HANDLER( vga_port16le_03c0_r ) { return read16le_with_read8_handler(vga_port_03c0_r, machine, offset, mem_mask); } | |
| 1476 | READ16_HANDLER( vga_port16le_03d0_r ) { return read16le_with_read8_handler(vga_port_03d0_r, machine, offset, mem_mask); } | |
| 1477 | WRITE16_HANDLER( vga_port16le_03b0_w ) { write16le_with_write8_handler(vga_port_03b0_w, machine, offset, data, mem_mask); } | |
| 1478 | WRITE16_HANDLER( vga_port16le_03c0_w ) { write16le_with_write8_handler(vga_port_03c0_w, machine, offset, data, mem_mask); } | |
| 1479 | WRITE16_HANDLER( vga_port16le_03d0_w ) { write16le_with_write8_handler(vga_port_03d0_w, machine, offset, data, mem_mask); } | |
| 1480 | 1480 | |
| 1481 | READ16_HANDLER( paradise_ega16le_03c0_r ) { return read16le_with_read8_handler(paradise_ega_03c0_r, offset, mem_mask); } | |
| 1481 | READ16_HANDLER( paradise_ega16le_03c0_r ) { return read16le_with_read8_handler(paradise_ega_03c0_r, machine, offset, mem_mask); } |
| r1877 | r1878 | |
|---|---|---|
| 19 | 19 | { |
| 20 | 20 | /* VGA memory mapper */ |
| 21 | 21 | int vga_memory_bank; |
| 22 | void (*map_vga_memory)(offs_t begin, offs_t end, read8_ | |
| 22 | void (*map_vga_memory)(offs_t begin, offs_t end, read8_machin | |
| 23 | 23 | |
| 24 | 24 | /* VGA dipswitch (???) */ |
| 25 | read8_ | |
| 25 | read8_machin | |
| 26 | 26 | |
| 27 | 27 | /* where the ports go */ |
| 28 | 28 | int port_addressspace; |
| r1877 | r1878 | |
|---|---|---|
| 103 | 103 | { |
| 104 | 104 | if (vectrex_lightpen_port & 1) |
| 105 | 105 | { |
| 106 | via_0_ca1_w (0, 1); | |
| 107 | via_0_ca1_w (0, 0); | |
| 106 | via_0_ca1_w(machine, 0, 1); | |
| 107 | via_0_ca1_w(machine, 0, 0); | |
| 108 | 108 | } |
| 109 | 109 | if (vectrex_lightpen_port & 2) |
| 110 | 110 | { |
| r1877 | r1878 | |
| 365 | 365 | { |
| 366 | 366 | /* BDIR active, PSG latches */ |
| 367 | 367 | if (data & 0x08) /* BC1 (do we select a reg or write it ?) */ |
| 368 | AY8910_control_port_0_w | |
| 368 | AY8910_control_port_0_w | |
| 369 | 369 | else |
| 370 | AY8910_write_port_0_w | |
| 370 | AY8910_write_port_0_w | |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | if (!(data & 0x1) && (vectrex_via_out[PORTB] & 0x1)) |
| r1877 | r1878 | |
| 470 | 470 | via_reset(); |
| 471 | 471 | z_factor = 2; |
| 472 | 472 | |
| 473 | raaspec_led_w | |
| 473 | raaspec_led_w | |
| 474 | 474 | |
| 475 | 475 | VIDEO_START_CALL(vector); |
| 476 | 476 | } |
| r1877 | r1878 | |
|---|---|---|
| 84 | 84 | |
| 85 | 85 | TIMER_CALLBACK(aim65_printer_timer) |
| 86 | 86 | { |
| 87 | via_0_cb1_w(0, printer_level); | |
| 88 | via_0_ca1_w(0, !printer_level); | |
| 87 | via_0_cb1_w(machine, 0, printer_level); | |
| 88 | via_0_ca1_w(machine, 0, !printer_level); | |
| 89 | 89 | printer_level = !printer_level; |
| 90 | 90 | aim65_printer_inc(); |
| 91 | 91 | } |
| r1877 | r1878 | |
| 97 | 97 | { |
| 98 | 98 | aim65_printer_cr(); |
| 99 | 99 | timer_adjust_periodic(print_timer, attotime_zero, 0, ATTOTIME_IN_USEC(10)); |
| 100 | via_0_cb1_w(0, 0); | |
| 100 | via_0_cb1_w(machine, 0, 0); | |
| 101 | 101 | printer_level = 1; |
| 102 | 102 | } |
| 103 | 103 | else |
| r1877 | r1878 | |
|---|---|---|
| 1410 | 1410 | |
| 1411 | 1411 | |
| 1412 | 1412 | |
| 1413 | static | |
| 1413 | static INPUT_CHANGED( artifacting_changed | |
| 1414 | 1414 | { |
| 1415 | 1415 | set_dirty(); |
| 1416 | 1416 | } |
| r1877 | r1878 | |
| 1419 | 1419 | |
| 1420 | 1420 | INPUT_PORTS_START( m6847_artifacting ) |
| 1421 | 1421 | PORT_START_TAG("artifacting") |
| 1422 | PORT_CONFNAME( 0x03, 0x01, "Artifacting" ) | |
| 1422 | PORT_CONFNAME( 0x03, 0x01, "Artifacting" ) PORT_CHANGED(artifacting_changed, NULL) | |
| 1423 | 1423 | PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) |
| 1424 | 1424 | PORT_CONFSETTING( 0x01, DEF_STR( Standard ) ) |
| 1425 | 1425 | PORT_CONFSETTING( 0x02, DEF_STR( Reverse ) ) |
| r1877 | r1878 | |
| 1811 | 1811 | UINT32 frequency; |
| 1812 | 1812 | attoseconds_t period, frame_period, cpu0_clock_period = 0; |
| 1813 | 1813 | double total_scanlines; |
| 1814 | int portnum; | |
| 1815 | 1814 | |
| 1816 | 1815 | /* identify proper M6847 variant */ |
| 1817 | 1816 | assert(cfg->type < sizeof(variants) / sizeof(variants[0])); |
| r1877 | r1878 | |
| 1899 | 1898 | /* build font */ |
| 1900 | 1899 | build_fontdata(v); |
| 1901 | 1900 | |
| 1902 | /* artifact callbacks */ | |
| 1903 | portnum = port_tag_to_index("artifacting"); | |
| 1904 | if (portnum >= 0) | |
| 1905 | input_port_set_changed_callback(portnum, ~0, artifacting_changed, NULL); | |
| 1906 | ||
| 1907 | 1901 | /* dump stats */ |
| 1908 | 1902 | if (LOG_STATS) |
| 1909 | 1903 | { |
| r1877 | r1878 | |
|---|---|---|
| 1100 | 1100 | // popmessage("Keyboard buffer position = %i",sys.keyboard.headpos); |
| 1101 | 1101 | // popmessage("IERA = 0x%02x, IERB = 0x%02x",sys.mfp.iera,sys.mfp.ierb); |
| 1102 | 1102 | // popmessage("IPRA = 0x%02x, IPRB = 0x%02x",sys.mfp.ipra,sys.mfp.iprb); |
| 1103 | // popmessage("uPD72065 status = %02x",nec765_status_r(0)); | |
| 1103 | // popmessage("uPD72065 status = %02x",nec765_status_r(machine, 0)); | |
| 1104 | 1104 | // popmessage("Layer enable - 0x%02x",sys.video.reg[2] & 0xff); |
| 1105 | 1105 | // popmessage("Graphic layer scroll - %i, %i - %i, %i - %i, %i - %i, %i", |
| 1106 | 1106 | // sys.crtc.reg[12],sys.crtc.reg[13],sys.crtc.reg[14],sys.crtc.reg[15],sys.crtc.reg[16],sys.crtc.reg[17],sys.crtc.reg[18],sys.crtc.reg[19]); |
| r1877 | r1878 | |
|---|---|---|
| 339 | 339 | |
| 340 | 340 | /* else draw in copy mode */ |
| 341 | 341 | |
| 342 | astrocade_videoram_w(offset,data); | |
| 342 | astrocade_videoram_w(machine, offset,data); | |
| 343 | 343 | |
| 344 | 344 | magic_expand_flipflop ^= 1; |
| 345 | 345 | } |
| r1877 | r1878 | |
|---|---|---|
| 123 | 123 | |
| 124 | 124 | static struct terminal *kaypro_terminal; |
| 125 | 125 | |
| 126 | static void kaypro_putstr(const char * src) | |
| 126 | static void kaypro_putstr(running_machine *machine, const char * src) | |
| 127 | 127 | { |
| 128 | 128 | while (*src) |
| 129 | kaypro_conout_w(0, *src++); | |
| 129 | kaypro_conout_w(machine, 0, *src++); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | static int kaypro_getcursorcode(int code) |
| r1877 | r1878 | |
| 141 | 141 | |
| 142 | 142 | kaypro_terminal = terminal_create(0, ' ', 10, kaypro_getcursorcode, KAYPRO_SCREEN_W, KAYPRO_SCREEN_H); |
| 143 | 143 | |
| 144 | kaypro_putstr( | |
| 144 | kaypro_putstr(machine, | |
| 145 | 145 | /* a test of GB1/GB2 video mode graphics */ \ |
| 146 | 146 | "\033B5" /* start video mode */ \ |
| 147 | 147 | "MESS KAYPRO Terminal Emulator \200\220\200\263" \ |
| r1877 | r1878 | |
|---|---|---|
| 151 | 151 | XXX(2) |
| 152 | 152 | |
| 153 | 153 | #define XXX(n) \ |
| 154 | static WRITE8_HANDLER(write_gvram##n##_bank5){write_gvram(offset+0x4000*n,data);} \ | |
| 155 | static WRITE8_HANDLER(write_gvram##n##_bank6){write_gvram(offset+0x4000*n+0x3000,data);} | |
| 154 | static WRITE8_HANDLER(write_gvram##n##_bank5){write_gvram(machine, offset+0x4000*n,data);} \ | |
| 155 | static WRITE8_HANDLER(write_gvram##n##_bank6){write_gvram(machine, offset+0x4000*n+0x3000,data);} | |
| 156 | 156 | VVV |
| 157 | 157 | #undef XXX |
| 158 | 158 | |
| r1877 | r1878 | |
| 183 | 183 | (x & 2 ? gVRAM[offset+0x4000] : ~gVRAM[offset+0x4000]) & \ |
| 184 | 184 | (x & 4 ? gVRAM[offset+0x8000] : ~gVRAM[offset+0x8000]); \ |
| 185 | 185 | } \ |
| 186 | static READ8_HANDLER(read_gvram_alu##x##_bank5){return read_gvram_alu##x(offset);} \ | |
| 187 | static READ8_HANDLER(read_gvram_alu##x##_bank6){return read_gvram_alu##x(offset+0x3000);} | |
| 186 | static READ8_HANDLER(read_gvram_alu##x##_bank5){return read_gvram_alu##x(machine, offset);} \ | |
| 187 | static READ8_HANDLER(read_gvram_alu##x##_bank6){return read_gvram_alu##x(machine, offset+0x3000);} | |
| 188 | 188 | |
| 189 | 189 | YYY |
| 190 | 190 | |
| r1877 | r1878 | |
| 195 | 195 | #define WWW(x) \ |
| 196 | 196 | switch(ALU1&(0x11<<x)) { \ |
| 197 | 197 | case 0x00<<x: \ |
| 198 | write_gvram(offset+x*0x4000,gVRAM[offset+x*0x4000]&(~data)); \ | |
| 198 | write_gvram(machine, offset+x*0x4000,gVRAM[offset+x*0x4000]&(~data)); \ | |
| 199 | 199 | break; \ |
| 200 | 200 | case 0x01<<x: \ |
| 201 | write_gvram(offset+x*0x4000,gVRAM[offset+x*0x4000]|data); \ | |
| 201 | write_gvram(machine, offset+x*0x4000,gVRAM[offset+x*0x4000]|data); \ | |
| 202 | 202 | break; \ |
| 203 | 203 | case 0x10<<x: \ |
| 204 | write_gvram(offset+x*0x4000,gVRAM[offset+x*0x4000]^data); \ | |
| 204 | write_gvram(machine, offset+x*0x4000,gVRAM[offset+x*0x4000]^data); \ | |
| 205 | 205 | break; \ |
| 206 | 206 | case 0x11<<x: \ |
| 207 | 207 | break; \ |
| r1877 | r1878 | |
| 215 | 215 | } |
| 216 | 216 | static WRITE8_HANDLER(write_gvram_alu1) |
| 217 | 217 | { |
| 218 | write_gvram(offset+0x0000 , ALU_save0); | |
| 219 | write_gvram(offset+0x4000 , ALU_save1); | |
| 220 | write_gvram(offset+0x8000 , ALU_save2); | |
| 218 | write_gvram(machine, offset+0x0000 , ALU_save0); | |
| 219 | write_gvram(machine, offset+0x4000 , ALU_save1); | |
| 220 | write_gvram(machine, offset+0x8000 , ALU_save2); | |
| 221 | 221 | } |
| 222 | static WRITE8_HANDLER(write_gvram_alu2){write_gvram(offset+0x0000,ALU_save1);} | |
| 223 | static WRITE8_HANDLER(write_gvram_alu3){write_gvram(offset+0x4000,ALU_save0);} | |
| 222 | static WRITE8_HANDLER(write_gvram_alu2){write_gvram(machine, offset+0x0000,ALU_save1);} | |
| 223 | static WRITE8_HANDLER(write_gvram_alu3){write_gvram(machine, offset+0x4000,ALU_save0);} | |
| 224 | 224 | |
| 225 | 225 | #define XXX(x) \ |
| 226 | static WRITE8_HANDLER(write_gvram_alu##x##_bank5){write_gvram_alu##x(offset,data);} \ | |
| 227 | static WRITE8_HANDLER(write_gvram_alu##x##_bank6){write_gvram_alu##x(offset+0x3000,data);} | |
| 226 | static WRITE8_HANDLER(write_gvram_alu##x##_bank5){write_gvram_alu##x(machine, offset,data);} \ | |
| 227 | static WRITE8_HANDLER(write_gvram_alu##x##_bank6){write_gvram_alu##x(machine, offset+0x3000,data);} | |
| 228 | 228 | |
| 229 | 229 | ZZZ |
| 230 | 230 | |
| r1877 | r1878 | |
| 232 | 232 | |
| 233 | 233 | int is_pc8801_vram_select(void) |
| 234 | 234 | { |
| 235 | read8_handler rh5 = NULL, rh6 = NULL; | |
| 236 | write8_handler wh5 = NULL, wh6 = NULL; | |
| 235 | read8_machine_func rh5 = NULL, rh6 = NULL; | |
| 236 | write8_machine_func wh5 = NULL, wh6 = NULL; | |
| 237 | 237 | |
| 238 | 238 | if(ALUON) { |
| 239 | 239 | /* ALU mode */ |
| r1877 | r1878 | |
|---|---|---|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | |
| 132 | WRITE16_HANDLER( pc_video_videoram16le_w ) { write16le_with_write8_handler(pc_video_videoram_w, offset, mem_mask, data); } | |
| 132 | WRITE16_HANDLER( pc_video_videoram16le_w ) { write16le_with_write8_handler(pc_video_videoram_w, machine, offset, mem_mask, data); } | |
| 133 | 133 | |
| 134 | 134 | WRITE32_HANDLER( pc_video_videoram32_w ) |
| 135 | 135 | { |
| r1877 | r1878 | |
|---|---|---|
| 66 | 66 | case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: |
| 67 | 67 | case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: |
| 68 | 68 | case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: |
| 69 | vic2_port_w(offset,data); | |
| 69 | vic2_port_w(machine, offset,data); | |
| 70 | 70 | break; |
| 71 | 71 | case 0x2f: |
| 72 | 72 | DBG_LOG (2, "vic write", ("%.2x:%.2x\n", offset, data)); |
| r1877 | r1878 | |
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | ||
| 121 | ||
| 122 | 122 | { |
| 123 | 123 | int val = 0; |
| 124 | 124 | offset &= 0x7f; |
| r1877 | r1878 | |
| 130 | 130 | case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: |
| 131 | 131 | case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: |
| 132 | 132 | case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: |
| 133 | return vic2_port_r(offset); | |
| 133 | return vic2_port_r(machine, offset); | |
| 134 | 134 | case 0x2f: |
| 135 | 135 | case 0x30: |
| 136 | 136 | val = vic2.reg[offset]; |
| r1877 | r1878 | |
|---|---|---|
| 216 | 216 | */ |
| 217 | 217 | static int pc_mda_status_r(void) |
| 218 | 218 | { |
| 219 | int data = (input | |
| 219 | int data = (readinput | |
| 220 | 220 | mda.status ^= 0x01; |
| 221 | 221 | return data; |
| 222 | 222 | } |
| r1877 | r1878 | |
|---|---|---|
| 282 | 282 | */ |
| 283 | 283 | static int pc_t1t_status_r(void) |
| 284 | 284 | { |
| 285 | int data = (input | |
| 285 | int data = (readinput | |
| 286 | 286 | pcjr.status ^= 0x01; |
| 287 | 287 | return data; |
| 288 | 288 | } |
| r1877 | r1878 | |
|---|---|---|
| 131 | 131 | static READ8_HANDLER ( pc_aga_mda_r ) |
| 132 | 132 | { |
| 133 | 133 | if (aga.mode==AGA_MONO) |
| 134 | return pc_MDA_r(offset); | |
| 134 | return pc_MDA_r(machine, offset); | |
| 135 | 135 | return 0xff; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | static WRITE8_HANDLER ( pc_aga_mda_w ) |
| 139 | 139 | { |
| 140 | 140 | if (aga.mode==AGA_MONO) |
| 141 | pc_MDA_w(offset, data); | |
| 141 | pc_MDA_w(machine, offset, data); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | static READ8_HANDLER ( pc_aga_cga_r ) |
| 145 | 145 | { |
| 146 | 146 | if (aga.mode==AGA_COLOR) |
| 147 | return pc_cga8_r(offset); | |
| 147 | return pc_cga8_r(machine, offset); | |
| 148 | 148 | return 0xff; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | static WRITE8_HANDLER ( pc_aga_cga_w ) |
| 152 | 152 | { |
| 153 | 153 | if (aga.mode==AGA_COLOR) |
| 154 | pc_cga8_w(offset, data); | |
| 154 | pc_cga8_w(machine, offset, data); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | static READ16_HANDLER ( pc16le_aga_mda_r ) { return read16le_with_read8_handler(pc_aga_mda_r, offset, mem_mask); } | |
| 158 | static WRITE16_HANDLER ( pc16le_aga_mda_w ) { write16le_with_write8_handler(pc_aga_mda_w, offset, data, mem_mask); } | |
| 159 | static READ16_HANDLER ( pc16le_aga_cga_r ) { return read16le_with_read8_handler(pc_aga_cga_r, offset, mem_mask); } | |
| 160 | static WRITE16_HANDLER ( pc16le_aga_cga_w ) { write16le_with_write8_handler(pc_aga_cga_w, offset, data, mem_mask); } | |
| 157 | static READ16_HANDLER ( pc16le_aga_mda_r ) { return read16le_with_read8_handler(pc_aga_mda_r, machine, offset, mem_mask); } | |
| 158 | static WRITE16_HANDLER ( pc16le_aga_mda_w ) { write16le_with_write8_handler(pc_aga_mda_w, machine, offset, data, mem_mask); } | |
| 159 | static READ16_HANDLER ( pc16le_aga_cga_r ) { return read16le_with_read8_handler(pc_aga_cga_r, machine, offset, mem_mask); } | |
| 160 | static WRITE16_HANDLER ( pc16le_aga_cga_w ) { write16le_with_write8_handler(pc_aga_cga_w, machine, offset, data, mem_mask); } | |
| 161 | 161 | |
| 162 | 162 | |
| 163 | 163 | |
| r1877 | r1878 | |
| 290 | 290 | switch (aga.mode) { |
| 291 | 291 | case AGA_COLOR: |
| 292 | 292 | if (offset>=0x8000) |
| 293 | pc_video_videoram_w(offset-0x8000, data); | |
| 293 | pc_video_videoram_w(machine, offset-0x8000, data); | |
| 294 | 294 | break; |
| 295 | 295 | case AGA_MONO: |
| 296 | pc_video_videoram_w(offset,data); | |
| 296 | pc_video_videoram_w(machine, offset,data); | |
| 297 | 297 | break; |
| 298 | 298 | case AGA_OFF: break; |
| 299 | 299 | } |
| r1877 | r1878 | |
| 331 | 331 | { |
| 332 | 332 | default: |
| 333 | 333 | if (offset>=0x8000) |
| 334 | pc_video_videoram_w(offset-0x8000, data); | |
| 334 | pc_video_videoram_w(machine, offset-0x8000, data); | |
| 335 | 335 | break; |
| 336 | 336 | case AGA_MONO: |
| 337 | pc_video_videoram_w(offset,data); | |
| 337 | pc_video_videoram_w(machine, offset,data); | |
| 338 | 338 | break; |
| 339 | 339 | } |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | READ16_HANDLER( pc200_videoram16le_r ) { return read16le_with_read8_handler(pc200_videoram_r, offset, mem_mask); } | |
| 343 | WRITE16_HANDLER( pc200_videoram16le_w ) { write16le_with_write8_handler(pc200_videoram_w, offset, data, mem_mask); } | |
| 342 | READ16_HANDLER( pc200_videoram16le_r ) { return read16le_with_read8_handler(pc200_videoram_r, machine, offset, mem_mask); } | |
| 343 | WRITE16_HANDLER( pc200_videoram16le_w ) { write16le_with_write8_handler(pc200_videoram_w, machine, offset, data, mem_mask); } | |
| 344 | 344 | |
| 345 | 345 | |
| 346 | 346 | static struct { |
| r1877 | r1878 | |
| 354 | 354 | switch(offset) { |
| 355 | 355 | case 4: |
| 356 | 356 | pc200.portd |= 0x20; |
| 357 | pc_cga8_w(offset,data); | |
| 357 | pc_cga8_w(machine, offset,data); | |
| 358 | 358 | break; |
| 359 | 359 | case 8: |
| 360 | 360 | pc200.port8 = data; |
| 361 | 361 | pc200.portd |= 0x80; |
| 362 | pc_cga8_w(offset,data); | |
| 362 | pc_cga8_w(machine, offset,data); | |
| 363 | 363 | break; |
| 364 | 364 | case 0xe: |
| 365 | 365 | pc200.portd = 0x1f; |
| r1877 | r1878 | |
| 384 | 384 | break; |
| 385 | 385 | |
| 386 | 386 | default: |
| 387 | pc_cga8_w(offset,data); | |
| 387 | pc_cga8_w(machine, offset,data); | |
| 388 | 388 | break; |
| 389 | 389 | } |
| 390 | 390 | } |
| r1877 | r1878 | |
| 407 | 407 | case 0xe: |
| 408 | 408 | // 0x20 low cga |
| 409 | 409 | // 0x10 low special |
| 410 | result = input | |
| 410 | result = readinput | |
| 411 | 411 | break; |
| 412 | 412 | |
| 413 | 413 | default: |
| 414 | result = pc_cga8_r(offset); | |
| 414 | result = pc_cga8_r(machine, offset); | |
| 415 | 415 | break; |
| 416 | 416 | } |
| 417 | 417 | return result; |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | READ16_HANDLER( pc200_cga16le_r ) { return read16le_with_read8_handler(pc200_cga_r, offset, mem_mask); } | |
| 421 | WRITE16_HANDLER( pc200_cga16le_w ) { write16le_with_write8_handler(pc200_cga_w, offset, data, mem_mask); } | |
| 420 | READ16_HANDLER( pc200_cga16le_r ) { return read16le_with_read8_handler(pc200_cga_r, machine, offset, mem_mask); } | |
| 421 | WRITE16_HANDLER( pc200_cga16le_w ) { write16le_with_write8_handler(pc200_cga_w, machine, offset, data, mem_mask); } |
| r1877 | r1878 | |
|---|---|---|
| 199 | 199 | #define CGA_FONT_2 2 |
| 200 | 200 | #define CGA_FONT_3 3 |
| 201 | 201 | |
| 202 | #define CGA_MONITOR (input | |
| 202 | #define CGA_MONITOR (readinput | |
| 203 | 203 | #define CGA_MONITOR_RGB 0x00 /* Colour RGB */ |
| 204 | 204 | #define CGA_MONITOR_MONO 0x04 /* Greyscale RGB */ |
| 205 | 205 | #define CGA_MONITOR_COMPOSITE 0x08 /* Colour composite */ |
| 206 | 206 | #define CGA_MONITOR_TELEVISION 0x0C /* Television */ |
| 207 | 207 | #define CGA_MONITOR_LCD 0x10 /* LCD, eg PPC512 */ |
| 208 | 208 | |
| 209 | #define CGA_CHIPSET (input | |
| 209 | #define CGA_CHIPSET (readinput | |
| 210 | 210 | #define CGA_CHIPSET_IBM 0x00 /* Original IBM CGA */ |
| 211 | 211 | #define CGA_CHIPSET_PC1512 0x20 /* PC1512 CGA subset */ |
| 212 | 212 | #define CGA_CHIPSET_PC200 0x40 /* PC200 in CGA mode */ |
| r1877 | r1878 | |
| 430 | 430 | */ |
| 431 | 431 | static int pc_cga_status_r(void) |
| 432 | 432 | { |
| 433 | int data = ((~input | |
| 433 | int data = ((~readinput | |
| 434 | 434 | cga.status ^= 0x01; |
| 435 | 435 | return data; |
| 436 | 436 | } |
| r1877 | r1878 | |
| 485 | 485 | |
| 486 | 486 | |
| 487 | 487 | |
| 488 | READ16_HANDLER( pc_cga16le_r ) { return read16le_with_read8_handler(pc_cga8_r, offset, mem_mask); } | |
| 489 | WRITE16_HANDLER( pc_cga16le_w ) { write16le_with_write8_handler(pc_cga8_w, offset, data, mem_mask); } | |
| 490 | READ32_HANDLER( pc_cga32le_r ) { return read32le_with_read8_handler(pc_cga8_r, offset, mem_mask); } | |
| 491 | WRITE32_HANDLER( pc_cga32le_w ) { write32le_with_write8_handler(pc_cga8_w, offset, data, mem_mask); } | |
| 488 | READ16_HANDLER( pc_cga16le_r ) { return read16le_with_read8_handler(pc_cga8_r,machine, offset, mem_mask); } | |
| 489 | WRITE16_HANDLER( pc_cga16le_w ) { write16le_with_write8_handler(pc_cga8_w, machine, offset, data, mem_mask); } | |
| 490 | READ32_HANDLER( pc_cga32le_r ) { return read32le_with_read8_handler(pc_cga8_r, machine, offset, mem_mask); } | |
| 491 | WRITE32_HANDLER( pc_cga32le_w ) { write32le_with_write8_handler(pc_cga8_w, machine, offset, data, mem_mask); } | |
| 492 | 492 | |
| 493 | 493 | |
| 494 | 494 | |
| r1877 | r1878 | |
| 1269 | 1269 | } |
| 1270 | 1270 | } |
| 1271 | 1271 | mscrtc6845_set_char_lines(mscrtc6845, 200 ); |
| 1272 | pc_cga8_w(offset, data); | |
| 1272 | pc_cga8_w(machine, offset, data); | |
| 1273 | 1273 | break; |
| 1274 | 1274 | |
| 1275 | 1275 | default: |
| 1276 | pc_cga8_w(offset,data); | |
| 1276 | pc_cga8_w(machine, offset,data); | |
| 1277 | 1277 | break; |
| 1278 | 1278 | } |
| 1279 | 1279 | } |
| r1877 | r1878 | |
| 1292 | 1292 | break; |
| 1293 | 1293 | |
| 1294 | 1294 | default: |
| 1295 | data = pc_cga8_r(offset); | |
| 1295 | data = pc_cga8_r(machine, offset); | |
| 1296 | 1296 | break; |
| 1297 | 1297 | } |
| 1298 | 1298 | return data; |
| r1877 | r1878 | |
| 1313 | 1313 | |
| 1314 | 1314 | |
| 1315 | 1315 | |
| 1316 | READ16_HANDLER ( pc1512_16le_r ) { return read16le_with_read8_handler(pc1512_r, offset, mem_mask); } | |
| 1317 | WRITE16_HANDLER ( pc1512_16le_w ) { write16le_with_write8_handler(pc1512_w, offset, data, mem_mask); } | |
| 1318 | WRITE16_HANDLER ( pc1512_videoram16le_w ) { write16le_with_write8_handler(pc1512_videoram_w, offset, data, mem_mask); } | |
| 1316 | READ16_HANDLER ( pc1512_16le_r ) { return read16le_with_read8_handler(pc1512_r, machine, offset, mem_mask); } | |
| 1317 | WRITE16_HANDLER ( pc1512_16le_w ) { write16le_with_write8_handler(pc1512_w, machine, offset, data, mem_mask); } | |
| 1318 | WRITE16_HANDLER ( pc1512_videoram16le_w ) { write16le_with_write8_handler(pc1512_videoram_w, machine, offset, data, mem_mask); } | |
| 1319 | 1319 | |
| 1320 | 1320 | |
| 1321 | 1321 |
| r1877 | r1878 | |
|---|---|---|
| 29 | 29 | WRITE16_HANDLER( pc1512_16le_w ); |
| 30 | 30 | WRITE16_HANDLER( pc1512_videoram16le_w ); |
| 31 | 31 | |
| 32 | #define CGA_FONT (input | |
| 32 | #define CGA_FONT (readinput | |
| 33 | 33 | |
| 34 | 34 | //internal use |
| 35 | 35 | void pc_cga_cursor(struct mscrtc6845_cursor *cursor); |
| r1877 | r1878 | |
|---|---|---|
| 999 | 999 | switch(command & 0xf000) |
| 1000 | 1000 | { |
| 1001 | 1001 | case 0x0000: // Load PSG register |
| 1002 | AY8910_control_port_0_w(0,(command & 0x0f00) >> 8); | |
| 1003 | AY8910_write_port_0_w(0,command & 0x00ff); | |
| 1004 | AY8910_control_port_0_w(0,prev_reg); | |
| 1002 | AY8910_control_port_0_w(machine, 0,(command & 0x0f00) >> 8); | |
| 1003 | AY8910_write_port_0_w(machine, 0,command & 0x00ff); | |
| 1004 | AY8910_control_port_0_w(machine, 0,prev_reg); | |
| 1005 | 1005 | logerror("DMA %i: LOAD %i, %i\n",channel,(command & 0x0f00) >> 8, command & 0x00ff); |
| 1006 | 1006 | break; |
| 1007 | 1007 | case 0x1000: // Pause for n HSYNCs (0 - 4095) |
| r1877 | r1878 | |
|---|---|---|
| 496 | 496 | static int timer1_active, timer2_active, timer3_active; |
| 497 | 497 | static emu_timer *timer1, *timer2, *timer3; |
| 498 | 498 | static int cursor1 = FALSE; |
| 499 | static read8_handler vic_dma_read; | |
| 500 | static read8_handler vic_dma_read_rom; | |
| 499 | static read8_machine_func vic_dma_read; | |
| 500 | static read8_machine_func vic_dma_read_rom; | |
| 501 | 501 | static int chargenaddr, bitmapaddr, videoaddr; |
| 502 | 502 | |
| 503 | 503 | static int x_begin, x_end; |
| r1877 | r1878 | |
| 540 | 540 | timer3 = timer_alloc(ted7360_timer_timeout, NULL); |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | void ted7360_set_dma (read8_handler dma_read, | |
| 544 | read8_handler dma_read_rom) | |
| 543 | void ted7360_set_dma (read8_machine_func dma_read, | |
| 544 | read8_machine_func dma_read_rom) | |
| 545 | 545 | { |
| 546 | 546 | vic_dma_read = dma_read; |
| 547 | 547 | vic_dma_read_rom = dma_read_rom; |
| r1877 | r1878 | |
| 967 | 967 | for (y = ybegin; y <= yend; y++) |
| 968 | 968 | { |
| 969 | 969 | if (INROM) |
| 970 | code = vic_dma_read_rom (chargenaddr + ch * 8 + y); | |
| 970 | code = vic_dma_read_rom (Machine, chargenaddr + ch * 8 + y); | |
| 971 | 971 | else |
| 972 | code = vic_dma_read (chargenaddr + ch * 8 + y); | |
| 972 | code = vic_dma_read (Machine, chargenaddr + ch * 8 + y); | |
| 973 | 973 | *BITMAP_ADDR16(ted7360_bitmap, y + yoff, 0 + xoff) = color[code >> 7]; |
| 974 | 974 | *BITMAP_ADDR16(ted7360_bitmap, y + yoff, 1 + xoff) = color[(code >> 6) & 1]; |
| 975 | 975 | *BITMAP_ADDR16(ted7360_bitmap, y + yoff, 2 + xoff) = color[(code >> 5) & 1]; |
| r1877 | r1878 | |
| 989 | 989 | for (y = ybegin; y <= yend; y++) |
| 990 | 990 | { |
| 991 | 991 | if (INROM) |
| 992 | code = vic_dma_read_rom (chargenaddr + ch * 8 + y); | |
| 992 | code = vic_dma_read_rom (Machine, chargenaddr + ch * 8 + y); | |
| 993 | 993 | else |
| 994 | code = vic_dma_read (chargenaddr + ch * 8 + y); | |
| 994 | code = vic_dma_read (Machine, chargenaddr + ch * 8 + y); | |
| 995 | 995 | *BITMAP_ADDR16(ted7360_bitmap, y + yoff, 0 + xoff) = |
| 996 | 996 | *BITMAP_ADDR16(ted7360_bitmap, y + yoff, 1 + xoff) = multi[code >> 6]; |
| 997 | 997 | *BITMAP_ADDR16(ted7360_bitmap, y + yoff, 2 + xoff) = |
| r1877 | r1878 | |
| 1010 | 1010 | |
| 1011 | 1011 | for (y = ybegin; y <= yend; y++) |
| 1012 | 1012 | { |
| 1013 | code = vic_dma_read (bitmapaddr + ch * 8 + y); | |
| 1013 | code = vic_dma_read (Machine, bitmapaddr + ch * 8 + y); | |
| 1014 | 1014 | *BITMAP_ADDR16(ted7360_bitmap, y + yoff, 0 + xoff) = c16_bitmap[code >> 7]; |
| 1015 | 1015 | *BITMAP_ADDR16(ted7360_bitmap, y + yoff, 1 + xoff) = c16_bitmap[(code >> 6) & 1]; |
| 1016 | 1016 | *BITMAP_ADDR16(ted7360_bitmap, y + yoff, 2 + xoff) = c16_bitmap[(code >> 5) & 1]; |
| r1877 | r1878 | |
| 1029 | 1029 | |
| 1030 | 1030 | for (y = ybegin; y <= yend; y++) |
| 1031 | 1031 | { |
| 1032 | code = vic_dma_read (bitmapaddr + ch * 8 + y); | |
| 1032 | code = vic_dma_read (Machine, bitmapaddr + ch * 8 + y); | |
| 1033 | 1033 | *BITMAP_ADDR16(ted7360_bitmap, y + yoff, 0 + xoff) = |
| 1034 | 1034 | *BITMAP_ADDR16(ted7360_bitmap, y + yoff, 1 + xoff) = bitmapmulti[code >> 6]; |
| 1035 | 1035 | *BITMAP_ADDR16(ted7360_bitmap, y + yoff, 2 + xoff) = |
| r1877 | r1878 | |
| 1118 | 1118 | { |
| 1119 | 1119 | if (HIRESON) |
| 1120 | 1120 | { |
| 1121 | ch = vic_dma_read ((videoaddr | 0x400) + offs); | |
| 1122 | attr = vic_dma_read (((videoaddr) + offs)); | |
| 1121 | ch = vic_dma_read (Machine, (videoaddr | 0x400) + offs); | |
| 1122 | attr = vic_dma_read (Machine, ((videoaddr) + offs)); | |
| 1123 | 1123 | c1 = ((ch >> 4) & 0xf) | (attr << 4); |
| 1124 | 1124 | c2 = (ch & 0xf) | (attr & 0x70); |
| 1125 | 1125 | bitmapmulti[1] = c16_bitmap[1] = Machine->pens[c1 & 0x7f]; |
| r1877 | r1878 | |
| 1135 | 1135 | } |
| 1136 | 1136 | else |
| 1137 | 1137 | { |
| 1138 | ch = vic_dma_read ((videoaddr | 0x400) + offs); | |
| 1139 | attr = vic_dma_read (((videoaddr) + offs)); | |
| 1138 | ch = vic_dma_read (Machine, (videoaddr | 0x400) + offs); | |
| 1139 | attr = vic_dma_read (Machine, ((videoaddr) + offs)); | |
| 1140 | 1140 | // levente harsfalvi's docu says cursor off in ecm and multicolor |
| 1141 | 1141 | if (ECMON) |
| 1142 | 1142 | { |
| r1877 | r1878 | |
|---|---|---|
| 20 | 20 | /* pal version */ |
| 21 | 21 | /* dma_read: videochip fetched 1 byte data from system bus */ |
| 22 | 22 | extern void ted7360_init (int pal); |
| 23 | extern void ted7360_set_dma (read8_handler dma_read, | |
| 24 | read8_handler dma_read_rom); | |
| 23 | extern void ted7360_set_dma (read8_machine_func dma_read, | |
| 24 | read8_machine_func dma_read_rom); | |
| 25 | 25 | |
| 26 | 26 | #define TED7360NTSC_VRETRACERATE 60 |
| 27 | 27 | #define TED7360PAL_VRETRACERATE 50 |
| r1877 | r1878 | |
|---|---|---|
| 139 | 139 | |
| 140 | 140 | #ifndef ANALOG_HACK |
| 141 | 141 | case 0xcc: |
| 142 | if (!activecpu_get_reg(S2650_FO)) data=input_port_7_r(0); | |
| 143 | else data=input_port_8_r(0); | |
| 142 | if (!activecpu_get_reg(S2650_FO)) data=readinputport(7); | |
| 143 | else data=readinputport(8); | |
| 144 | 144 | break; |
| 145 | 145 | case 0xcd: |
| 146 | if (!activecpu_get_reg(S2650_FO)) data=input_port_9_r(0); | |
| 147 | else data=input_port_10_r(0); | |
| 146 | if (!activecpu_get_reg(S2650_FO)) data=readinputport(9); | |
| 147 | else data=readinputport(10); | |
| 148 | 148 | break; |
| 149 | 149 | #else |
| 150 | 150 | |
| r1877 | r1878 | |
| 153 | 153 | // between 20 and 225 |
| 154 | 154 | if (!activecpu_get_reg(S2650_FO)) |
| 155 | 155 | { |
| 156 | if (input_port_7_r(0)&0x1) data=20; | |
| 157 | if (input_port_7_r(0)&0x2) data=225; | |
| 156 | if (readinputport(7)&0x1) data=20; | |
| 157 | if (readinputport(7)&0x2) data=225; | |
| 158 | 158 | } |
| 159 | 159 | else |
| 160 | 160 | { |
| 161 | if (input_port_7_r(0)&0x4) data=225; | |
| 162 | if (input_port_7_r(0)&0x8) data=20; | |
| 161 | if (readinputport(7)&0x4) data=225; | |
| 162 | if (readinputport(7)&0x8) data=20; | |
| 163 | 163 | } |
| 164 | 164 | break; |
| 165 | 165 | |
| r1877 | r1878 | |
| 167 | 167 | data = 0x66; |
| 168 | 168 | if (!activecpu_get_reg(S2650_FO)) |
| 169 | 169 | { |
| 170 | if (input_port_7_r(0)&0x10) data=20; | |
| 171 | if (input_port_7_r(0)&0x20) data=225; | |
| 170 | if (readinputport(7)&0x10) data=20; | |
| 171 | if (readinputport(7)&0x20) data=225; | |
| 172 | 172 | } |
| 173 | 173 | else |
| 174 | 174 | { |
| 175 | if (input_port_7_r(0)&0x40) data=225; | |
| 176 | if (input_port_7_r(0)&0x80) data=20; | |
| 175 | if (readinputport(7)&0x40) data=225; | |
| 176 | if (readinputport(7)&0x80) data=20; | |
| 177 | 177 | } |
| 178 | 178 | break; |
| 179 | 179 | #endif |
| r1877 | r1878 | |
|---|---|---|
| 828 | 828 | Bit 0-3 - Master volume |
| 829 | 829 | Bit 4-7 - Unknown |
| 830 | 830 | */ |
| 831 | wswan_sound_port_w( offset, data ); | |
| 831 | wswan_sound_port_w( machine, offset, data ); | |
| 832 | 832 | break; |
| 833 | 833 | case 0xa0: /* Hardware type - this is probably read only |
| 834 | 834 | Bit 0 - Enable cartridge slot and/or disable bios |
| r1877 | r1878 | |
| 1378 | 1378 | /* Handle Sound DMA */ |
| 1379 | 1379 | if ( ( sound_dma.enable & 0x88 ) == 0x80 ) { |
| 1380 | 1380 | /* TODO: Output sound DMA byte */ |
| 1381 | wswan_port_w( 0x89, program_read_byte_8( sound_dma.source ) ); | |
| 1381 | wswan_port_w( machine, 0x89, program_read_byte_8( sound_dma.source ) ); | |
| 1382 | 1382 | sound_dma.size--; |
| 1383 | 1383 | sound_dma.source = ( sound_dma.source + 1 ) & 0x0FFFFF; |
| 1384 | 1384 | if ( sound_dma.size == 0 ) { |
| r1877 | r1878 | |
|---|---|---|
| 43 | 43 | return address; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | static void common_init_machine(opbase_handler setopbase) | |
| 46 | static void common_init_machine(opbase_handler_func setopbase) | |
| 47 | 47 | { |
| 48 | 48 | memory_set_opbase_handler(0, setopbase); |
| 49 | 49 | zx_tape_bit = 0x80; |
| r1877 | r1878 | |
|---|---|---|
| 174 | 174 | // Info for bank switcher |
| 175 | 175 | struct bank_info_entry |
| 176 | 176 | { |
| 177 | write8_ | |
| 177 | write8_machin | |
| 178 | 178 | offs_t start; // Offset of start of block |
| 179 | 179 | offs_t end; // offset of end of block |
| 180 | 180 | }; |
| r1877 | r1878 | |
| 239 | 239 | { |
| 240 | 240 | int Page; |
| 241 | 241 | UINT8 *readbank; |
| 242 | write8_ | |
| 242 | write8_machin | |
| 243 | 243 | int bank_start; |
| 244 | 244 | int bank_end; |
| 245 | 245 | int MapPage; |
| r1877 | r1878 | |
| 562 | 562 | { |
| 563 | 563 | switch (Idx) |
| 564 | 564 | { |
| 565 | case 0 : Keyboard[Idx]=input_port_0_r(0); break; | |
| 566 | case 1 : Keyboard[Idx]=input_port_1_r(0); break; | |
| 567 | case 2 : Keyboard[Idx]=input_port_2_r(0); break; | |
| 568 | case 3 : Keyboard[Idx]=input_port_3_r(0); break; | |
| 569 | case 4 : Keyboard[Idx]=input_port_4_r(0); break; | |
| 570 | case 5 : Keyboard[Idx]=input_port_5_r(0); break; | |
| 571 | case 6 : Keyboard[Idx]=input_port_6_r(0); break; | |
| 572 | case 7 : Keyboard[Idx]=input_port_7_r(0); break; | |
| 573 | case 8 : Keyboard[Idx]=input_port_8_r(0); break; | |
| 574 | case 9 : Keyboard[Idx]=input_port_9_r(0); break; | |
| 565 | case 0 : Keyboard[Idx]=readinputport(0); break; | |
| 566 | case 1 : Keyboard[Idx]=readinputport(1); break; | |
| 567 | case 2 : Keyboard[Idx]=readinputport(2); break; | |
| 568 | case 3 : Keyboard[Idx]=readinputport(3); break; | |
| 569 | case 4 : Keyboard[Idx]=readinputport(4); break; | |
| 570 | case 5 : Keyboard[Idx]=readinputport(5); break; | |
| 571 | case 6 : Keyboard[Idx]=readinputport(6); break; | |
| 572 | case 7 : Keyboard[Idx]=readinputport(7); break; | |
| 573 | case 8 : Keyboard[Idx]=readinputport(8); break; | |
| 574 | case 9 : Keyboard[Idx]=readinputport(9); break; | |
| 575 | 575 | } |
| 576 | 576 | |
| 577 | 577 | if(Keyboard[Idx]!=0x7F) |
| r1877 | r1878 | |
| 903 | 903 | |
| 904 | 904 | static void dgnbeta_fdc_callback(wd17xx_state_t event, void *param) |
| 905 | 905 | { |
| 906 | running_machine *machine = Machine; | |
| 906 | 907 | /* The INTRQ line goes through pia2 ca1, in exactly the same way as DRQ from DragonDos does */ |
| 907 | 908 | /* DRQ is routed through various logic to the FIRQ inturrupt line on *BOTH* CPUs */ |
| 908 | 909 | |
| 909 | 910 | switch(event) |
| 910 | 911 | { |
| 911 | 912 | case WD17XX_IRQ_CLR: |
| 912 | pia_2_ca1_w(0,CLEAR_LINE); | |
| 913 | pia_2_ca1_w(machine, 0, CLEAR_LINE); | |
| 913 | 914 | break; |
| 914 | 915 | case WD17XX_IRQ_SET: |
| 915 | pia_2_ca1_w(0,ASSERT_LINE); | |
| 916 | pia_2_ca1_w(machine, 0, ASSERT_LINE); | |
| 916 | 917 | break; |
| 917 | 918 | case WD17XX_DRQ_CLR: |
| 918 | 919 | /*wd2797_drq=CLEAR_LINE;*/ |
| r1877 | r1878 | |
| 934 | 935 | switch(offset & 0x03) |
| 935 | 936 | { |
| 936 | 937 | case 0: |
| 937 | result = wd17xx_status_r(0); | |
| 938 | result = wd17xx_status_r(machine, 0); | |
| 938 | 939 | LOG_DISK(("Disk status=%2.2X\n",result)); |
| 939 | 940 | break; |
| 940 | 941 | case 1: |
| 941 | result = wd17xx_track_r(0); | |
| 942 | result = wd17xx_track_r(machine, 0); | |
| 942 | 943 | break; |
| 943 | 944 | case 2: |
| 944 | result = wd17xx_sector_r(0); | |
| 945 | result = wd17xx_sector_r(machine, 0); | |
| 945 | 946 | break; |
| 946 | 947 | case 3: |
| 947 | result = wd17xx_data_r(0); | |
| 948 | result = wd17xx_data_r(machine, 0); | |
| 948 | 949 | break; |
| 949 | 950 | default: |
| 950 | 951 | break; |
| r1877 | r1878 | |
| 962 | 963 | /* But only for Type 3/4 commands */ |
| 963 | 964 | if(data & 0x80) |
| 964 | 965 | wd17xx_set_side((data & 0x02) ? 1 : 0); |
| 965 | wd17xx_command_w(0, data); | |
| 966 | wd17xx_command_w(machine, 0, data); | |
| 966 | 967 | break; |
| 967 | 968 | case 1: |
| 968 | wd17xx_track_w(0, data); | |
| 969 | wd17xx_track_w(machine, 0, data); | |
| 969 | 970 | break; |
| 970 | 971 | case 2: |
| 971 | wd17xx_sector_w(0, data); | |
| 972 | wd17xx_sector_w(machine, 0, data); | |
| 972 | 973 | break; |
| 973 | 974 | case 3: |
| 974 | wd17xx_data_w(0, data); | |
| 975 | wd17xx_data_w(machine, 0, data); | |
| 975 | 976 | break; |
| 976 | 977 | }; |
| 977 | 978 | } |
| r1877 | r1878 | |
| 991 | 992 | { |
| 992 | 993 | switch (Idx) |
| 993 | 994 | { |
| 994 | case 0 : Row=input_port_0_r(0) /*| 0x33*/; break; | |
| 995 | case 1 : Row=input_port_1_r(0); break; | |
| 996 | case 2 : Row=input_port_2_r(0); break; | |
| 997 | case 3 : Row=input_port_3_r(0); break; | |
| 998 | case 4 : Row=input_port_4_r(0); break; | |
| 999 | case 5 : Row=input_port_5_r(0); break; | |
| 1000 | case 6 : Row=input_port_6_r(0); break; | |
| 1001 | case 7 : Row=input_port_7_r(0); break; | |
| 1002 | case 8 : Row=input_port_8_r(0); break; | |
| 1003 | case 9 : Row=input_port_9_r(0); break; | |
| 995 | case 0 : Row=readinputport(0) /*| 0x33*/; break; | |
| 996 | case 1 : Row=readinputport(1); break; | |
| 997 | case 2 : Row=readinputport(2); break; | |
| 998 | case 3 : Row=readinputport(3); break; | |
| 999 | case 4 : Row=readinputport(4); break; | |
| 1000 | case 5 : Row=readinputport(5); break; | |
| 1001 | case 6 : Row=readinputport(6); break; | |
| 1002 | case 7 : Row=readinputport(7); break; | |
| 1003 | case 8 : Row=readinputport(8); break; | |
| 1004 | case 9 : Row=readinputport(9); break; | |
| 1004 | 1005 | default : Row=0x7F; break; |
| 1005 | 1006 | } |
| 1006 | 1007 | Keyboard[Idx]=Row; |
| r1877 | r1878 | |
| 1016 | 1017 | /* VBlank inturrupt */ |
| 1017 | 1018 | void dgn_beta_frame_interrupt (int data) |
| 1018 | 1019 | { |
| 1020 | running_machine *machine = Machine; | |
| 1021 | ||
| 1019 | 1022 | /* Set PIA line, so it recognises inturrupt */ |
| 1020 | 1023 | if (!data) |
| 1021 | 1024 | { |
| 1022 | pia_2_cb2_w(0,ASSERT_LINE); | |
| 1025 | pia_2_cb2_w(machine, 0, ASSERT_LINE); | |
| 1023 | 1026 | } |
| 1024 | 1027 | else |
| 1025 | 1028 | { |
| 1026 | pia_2_cb2_w(0,CLEAR_LINE); | |
| 1029 | pia_2_cb2_w(machine, 0, CLEAR_LINE); | |
| 1027 | 1030 | } |
| 1028 | 1031 | LOG_VIDEO(("Vblank\n")); |
| 1029 | 1032 | ScanInKeyboard(); |
| r1877 | r1878 | |
| 1034 | 1037 | // /* Set PIA line, so it recognises inturrupt */ |
| 1035 | 1038 | // if (data) |
| 1036 | 1039 | // { |
| 1037 | // pia_0_cb1_w(0,ASSERT_LINE); | |
| 1040 | // pia_0_cb1_w(machine, 0,ASSERT_LINE); | |
| 1038 | 1041 | // } |
| 1039 | 1042 | // else |
| 1040 | 1043 | // { |
| 1041 | // pia_0_cb1_w(0,CLEAR_LINE); | |
| 1044 | // pia_0_cb1_w(machine, 0,CLEAR_LINE); | |
| 1042 | 1045 | // } |
| 1043 | 1046 | } |
| 1044 | 1047 |
| r1877 | r1878 | |
|---|---|---|
| 2097 | 2097 | nec765_set_dma_drq(CLEAR_LINE); |
| 2098 | 2098 | |
| 2099 | 2099 | /* write data */ |
| 2100 | nec765_data_w(offset, data); | |
| 2100 | nec765_data_w(machine, offset, data); | |
| 2101 | 2101 | } |
| 2102 | 2102 | |
| 2103 | ||
| 2103 | ||
| 2104 | 2104 | { |
| 2105 | 2105 | /* clear data request */ |
| 2106 | 2106 | nec765_set_dma_drq(CLEAR_LINE); |
| 2107 | 2107 | |
| 2108 | 2108 | /* read data */ |
| 2109 | return nec765_data_r(offset); | |
| 2109 | return nec765_data_r(machine, offset); | |
| 2110 | 2110 | } |
| 2111 | 2111 | |
| 2112 | 2112 |
| r1877 | r1878 | |
|---|---|---|
| 868 | 868 | } |
| 869 | 869 | else |
| 870 | 870 | { |
| 871 | sndglu_dummy_read = ES5503_reg_0_r(sndglu_addr); | |
| 871 | sndglu_dummy_read = ES5503_reg_0_r(machine, sndglu_addr); | |
| 872 | 872 | } |
| 873 | 873 | |
| 874 | 874 | if (sndglu_ctrl & 0x20) // auto-increment |
| r1877 | r1878 | |
| 907 | 907 | } |
| 908 | 908 | else |
| 909 | 909 | { |
| 910 | ES5503_reg_0_w(sndglu_addr, data); | |
| 910 | ES5503_reg_0_w(machine, sndglu_addr, data); | |
| 911 | 911 | } |
| 912 | 912 | |
| 913 | 913 | if (sndglu_ctrl & 0x20) // auto-increment |
| r1877 | r1878 | |
| 1047 | 1047 | case 0x39: /* C039 - SCCAREG */ |
| 1048 | 1048 | case 0x3A: /* C03A - SCCBDATA */ |
| 1049 | 1049 | case 0x3B: /* C03B - SCCADATA */ |
| 1050 | result = scc_r(offset & 0x03); | |
| 1050 | result = scc_r(machine, offset & 0x03); | |
| 1051 | 1051 | break; |
| 1052 | 1052 | |
| 1053 | 1053 | case 0x3C: /* C03C - SOUNDCTL */ |
| 1054 | 1054 | case 0x3D: /* C03D - SOUNDDATA */ |
| 1055 | 1055 | case 0x3E: /* C03E - SOUNDADRL */ |
| 1056 | 1056 | case 0x3F: /* C03F - SOUNDADRH */ |
| 1057 | result = gssnd_r(offset & 0x03); | |
| 1057 | result = gssnd_r(machine, offset & 0x03); | |
| 1058 | 1058 | break; |
| 1059 | 1059 | |
| 1060 | 1060 | case 0x41: /* C041 - INTEN */ |
| r1877 | r1878 | |
| 1088 | 1088 | result = 0x00; |
| 1089 | 1089 | |
| 1090 | 1090 | default: |
| 1091 | result = apple2_c0xx_r(offset); | |
| 1091 | result = apple2_c0xx_r(machine, offset); | |
| 1092 | 1092 | break; |
| 1093 | 1093 | } |
| 1094 | 1094 | |
| r1877 | r1878 | |
| 1177 | 1177 | |
| 1178 | 1178 | case 0x36: /* C036 - CYAREG */ |
| 1179 | 1179 | apple2gs_cyareg = data & ~0x20; |
| 1180 | cpunum_set_clock( | |
| 1180 | cpunum_set_clock(machine, 0, (data & 0x80) ? APPLE2GS_14M/5 : APPLE2GS_7M/7); | |
| 1181 | 1181 | break; |
| 1182 | 1182 | |
| 1183 | 1183 | case 0x38: /* C038 - SCCBREG */ |
| 1184 | 1184 | case 0x39: /* C039 - SCCAREG */ |
| 1185 | 1185 | case 0x3A: /* C03A - SCCBDATA */ |
| 1186 | 1186 | case 0x3B: /* C03B - SCCADATA */ |
| 1187 | scc_w(offset & 0x03, data); | |
| 1187 | scc_w(machine, offset & 0x03, data); | |
| 1188 | 1188 | break; |
| 1189 | 1189 | |
| 1190 | 1190 | case 0x3C: /* C03C - SOUNDCTL */ |
| 1191 | 1191 | case 0x3D: /* C03D - SOUNDDATA */ |
| 1192 | 1192 | case 0x3E: /* C03E - SOUNDADRL */ |
| 1193 | 1193 | case 0x3F: /* C03F - SOUNDADRH */ |
| 1194 | gssnd_w(offset & 0x03, data); | |
| 1194 | gssnd_w(machine, offset & 0x03, data); | |
| 1195 | 1195 | break; |
| 1196 | 1196 | |
| 1197 | 1197 | case 0x41: /* C041 - INTEN */ |
| r1877 | r1878 | |
| 1221 | 1221 | break; |
| 1222 | 1222 | |
| 1223 | 1223 | default: |
| 1224 | apple2_c0xx_w(offset, data); | |
| 1224 | apple2_c0xx_w(machine, offset, data); | |
| 1225 | 1225 | break; |
| 1226 | 1226 | } |
| 1227 | 1227 | } |
| r1877 | r1878 | |
| 1308 | 1308 | { |
| 1309 | 1309 | int color = (offset - 0x19e00) >> 1; |
| 1310 | 1310 | |
| 1311 | palette_set_color_rgb( | |
| 1311 | palette_set_color_rgb(machine, color + 16, | |
| 1312 | 1312 | ((apple2gs_slowmem[0x19E00 + (color * 2) + 1] >> 0) & 0x0F) * 17, |
| 1313 | 1313 | ((apple2gs_slowmem[0x19E00 + (color * 2) + 0] >> 4) & 0x0F) * 17, |
| 1314 | 1314 | ((apple2gs_slowmem[0x19E00 + (color * 2) + 0] >> 0) & 0x0F) * 17); |
| r1877 | r1878 | |
| 1527 | 1527 | |
| 1528 | 1528 | |
| 1529 | 1529 | |
| 1530 | static UINT8 apple2gs_xxCxxx_r(offs_t address) | |
| 1530 | static UINT8 apple2gs_xxCxxx_r(running_machine *machine, offs_t address) | |
| 1531 | 1531 | { |
| 1532 | 1532 | UINT8 result; |
| 1533 | 1533 | int slot; |
| r1877 | r1878 | |
| 1538 | 1538 | } |
| 1539 | 1539 | else if ((address & 0x000F00) == 0x000000) |
| 1540 | 1540 | { |
| 1541 | result = apple2gs_c0xx_r(address); | |
| 1541 | result = apple2gs_c0xx_r(machine, address); | |
| 1542 | 1542 | } |
| 1543 | 1543 | else |
| 1544 | 1544 | { |
| r1877 | r1878 | |
| 1554 | 1554 | |
| 1555 | 1555 | |
| 1556 | 1556 | |
| 1557 | static void apple2gs_xxCxxx_w(offs_t address, UINT8 data) | |
| 1557 | static void apple2gs_xxCxxx_w(running_machine *machine, offs_t address, UINT8 data) | |
| 1558 | 1558 | { |
| 1559 | 1559 | int slot; |
| 1560 | 1560 | |
| r1877 | r1878 | |
| 1564 | 1564 | } |
| 1565 | 1565 | else if ((address & 0x000F00) == 0x000000) |
| 1566 | 1566 | { |
| 1567 | apple2gs_c0xx_w(address, data); | |
| 1567 | apple2gs_c0xx_w(machine, address, data); | |
| 1568 | 1568 | } |
| 1569 | 1569 | else |
| 1570 | 1570 | { |
| r1877 | r1878 | |
| 1615 | 1615 | |
| 1616 | 1616 | |
| 1617 | 1617 | |
| 1618 | static READ8_HANDLER( apple2gs_00Cxxx_r ) { return apple2gs_xxCxxx_r(offset | 0x00C000); } | |
| 1619 | static READ8_HANDLER( apple2gs_01Cxxx_r ) { return apple2gs_xxCxxx_r(offset | 0x01C000); } | |
| 1620 | static READ8_HANDLER( apple2gs_E0Cxxx_r ) { return apple2gs_xxCxxx_r(offset | 0xE0C000); } | |
| 1621 | static READ8_HANDLER( apple2gs_E1Cxxx_r ) { return apple2gs_xxCxxx_r(offset | 0xE1C000); } | |
| 1618 | static READ8_HANDLER( apple2gs_00Cxxx_r ) { return apple2gs_xxCxxx_r(machine, offset | 0x00C000); } | |
| 1619 | static READ8_HANDLER( apple2gs_01Cxxx_r ) { return apple2gs_xxCxxx_r(machine, offset | 0x01C000); } | |
| 1620 | static READ8_HANDLER( apple2gs_E0Cxxx_r ) { return apple2gs_xxCxxx_r(machine, offset | 0xE0C000); } | |
| 1621 | static READ8_HANDLER( apple2gs_E1Cxxx_r ) { return apple2gs_xxCxxx_r(machine, offset | 0xE1C000); } | |
| 1622 | 1622 | |
| 1623 | static WRITE8_HANDLER( apple2gs_00Cxxx_w) { apple2gs_xxCxxx_w(offset | 0x00C000, data); } | |
| 1624 | static WRITE8_HANDLER( apple2gs_01Cxxx_w) { apple2gs_xxCxxx_w(offset | 0x01C000, data); } | |
| 1625 | static WRITE8_HANDLER( apple2gs_E0Cxxx_w) { apple2gs_xxCxxx_w(offset | 0xE0C000, data); } | |
| 1626 | static WRITE8_HANDLER( apple2gs_E1Cxxx_w) { apple2gs_xxCxxx_w(offset | 0xE1C000, data); } | |
| 1623 | static WRITE8_HANDLER( apple2gs_00Cxxx_w) { apple2gs_xxCxxx_w(machine, offset | 0x00C000, data); } | |
| 1624 | static WRITE8_HANDLER( apple2gs_01Cxxx_w) { apple2gs_xxCxxx_w(machine, offset | 0x01C000, data); } | |
| 1625 | static WRITE8_HANDLER( apple2gs_E0Cxxx_w) { apple2gs_xxCxxx_w(machine, offset | 0xE0C000, data); } | |
| 1626 | static WRITE8_HANDLER( apple2gs_E1Cxxx_w) { apple2gs_xxCxxx_w(machine, offset | 0xE1C000, data); } | |
| 1627 | 1627 | |
| 1628 | 1628 | static WRITE8_HANDLER( apple2gs_Exxxxx_w ) |
| 1629 | 1629 | { |
| 1630 | 1630 | apple2gs_slowmem[offset] = data; |
| 1631 | 1631 | } |
| 1632 | 1632 | |
| 1633 | static WRITE8_HANDLER( apple2gs_E004xx_w ) { apple2gs_Exxxxx_w(offset + 0x00400, data); } | |
| 1634 | static WRITE8_HANDLER( apple2gs_E02xxx_w ) { apple2gs_Exxxxx_w(offset + 0x02000, data); } | |
| 1635 | static WRITE8_HANDLER( apple2gs_E104xx_w ) { apple2gs_Exxxxx_w(offset + 0x10400, data); } | |
| 1636 | static WRITE8_HANDLER( apple2gs_E12xxx_w ) { apple2gs_Exxxxx_w(offset + 0x12000, data); } | |
| 1633 | static WRITE8_HANDLER( apple2gs_E004xx_w ) { apple2gs_Exxxxx_w(machine, offset + 0x00400, data); } | |
| 1634 | static WRITE8_HANDLER( apple2gs_E02xxx_w ) { apple2gs_Exxxxx_w(machine, offset + 0x02000, data); } | |
| 1635 | static WRITE8_HANDLER( apple2gs_E104xx_w ) { apple2gs_Exxxxx_w(machine, offset + 0x10400, data); } | |
| 1636 | static WRITE8_HANDLER( apple2gs_E12xxx_w ) { apple2gs_Exxxxx_w(machine, offset + 0x12000, data); } | |
| 1637 | 1637 | |
| 1638 | 1638 | static WRITE8_HANDLER( apple2gs_slowmem_w ) |
| 1639 | 1639 | { |
| r1877 | r1878 | |
| 1643 | 1643 | { |
| 1644 | 1644 | int color = (offset - 0x19e00) >> 1; |
| 1645 | 1645 | |
| 1646 | palette_set_color_rgb( | |
| 1646 | palette_set_color_rgb(machine, color + 16, | |
| 1647 | 1647 | ((apple2gs_slowmem[0x19E00 + (color * 2) + 1] >> 0) & 0x0F) * 17, |
| 1648 | 1648 | ((apple2gs_slowmem[0x19E00 + (color * 2) + 0] >> 4) & 0x0F) * 17, |
| 1649 | 1649 | ((apple2gs_slowmem[0x19E00 + (color * 2) + 0] >> 0) & 0x0F) * 17); |
| r1877 | r1878 | |
|---|---|---|
| 68 | 68 | // to do support weired comparator settings |
| 69 | 69 | static void hp48_config(void) |
| 70 | 70 | { |
| 71 | static const read8_ | |
| 71 | static const read8_machin | |
| 72 | 72 | int i, begin_bank, end_bank, begin, end, mem_type, bank; |
| 73 | 73 | |
| 74 | 74 | /* Determine the current memory map */ |
| r1877 | r1878 | |
| 151 | 151 | |
| 152 | 152 | /* Check for write to HDW */ |
| 153 | 153 | if ( hp48s.mem[HDW].adr != -1 && offset >= hp48s.mem[HDW].adr && offset < hp48s.mem[HDW].adr + 0x40 ) { |
| 154 | hp48_write( offset & 0x3F, data ); | |
| 154 | hp48_write( machine, offset & 0x3F, data ); | |
| 155 | 155 | } else { |
| 156 | 156 | switch( hp48_banks[bank].type ) { |
| 157 | 157 | case HP48_RAM: |
| r1877 | r1878 | |
| 500 | 500 | if (KEY_PLUS) data|=1; |
| 501 | 501 | } |
| 502 | 502 | #else |
| 503 | if (out&0x100) data|=input_port_0_r(0); | |
| 504 | if (out&0x080) data|=input_port_1_r(0); | |
| 505 | if (out&0x040) data|=input_port_2_r(0); | |
| 506 | if (out&0x020) data|=input_port_3_r(0); | |
| 507 | if (out&0x010) data|=input_port_4_r(0); | |
| 508 | if (out&0x008) data|=input_port_5_r(0); | |
| 509 | if (out&0x004) data|=input_port_6_r(0); | |
| 510 | if (out&0x002) data|=input_port_7_r(0); | |
| 511 | if (out&0x001) data|=input_port_8_r(0); | |
| 503 | if (out&0x100) data|=readinputport(0); | |
| 504 | if (out&0x080) data|=readinputport(1); | |
| 505 | if (out&0x040) data|=readinputport(2); | |
| 506 | if (out&0x020) data|=readinputport(3); | |
| 507 | if (out&0x010) data|=readinputport(4); | |
| 508 | if (out&0x008) data|=readinputport(5); | |
| 509 | if (out&0x004) data|=readinputport(6); | |
| 510 | if (out&0x002) data|=readinputport(7); | |
| 511 | if (out&0x001) data|=readinputport(8); | |
| 512 | 512 | #endif |
| 513 | 513 | return data; |
| 514 | 514 | } |
| r1877 | r1878 | |
|---|---|---|
| 184 | 184 | case 0xE4: case 0xE5: case 0xE6: case 0xE7: |
| 185 | 185 | case 0xE8: case 0xE9: case 0xEA: case 0xEB: |
| 186 | 186 | case 0xEC: case 0xED: case 0xEE: case 0xEF: |
| 187 | result = applefdc_r(offset); | |
| 187 | result = applefdc_r(machine, offset); | |
| 188 | 188 | break; |
| 189 | 189 | |
| 190 | 190 | case 0xF0: |
| 191 | 191 | case 0xF1: |
| 192 | 192 | case 0xF2: |
| 193 | 193 | case 0xF3: |
| 194 | result = acia_6551_r(offset & 0x03); | |
| 194 | result = acia_6551_r(machine, offset & 0x03); | |
| 195 | 195 | break; |
| 196 | 196 | } |
| 197 | 197 | return result; |
| r1877 | r1878 | |
| 245 | 245 | case 0xE4: case 0xE5: case 0xE6: case 0xE7: |
| 246 | 246 | case 0xE8: case 0xE9: case 0xEA: case 0xEB: |
| 247 | 247 | case 0xEC: case 0xED: case 0xEE: case 0xEF: |
| 248 | applefdc_w(offset, data); | |
| 248 | applefdc_w(machine, offset, data); | |
| 249 | 249 | break; |
| 250 | 250 | |
| 251 | 251 | case 0xF0: |
| 252 | 252 | case 0xF1: |
| 253 | 253 | case 0xF2: |
| 254 | 254 | case 0xF3: |
| 255 | acia_6551_w(offset & 0x03, data); | |
| 255 | acia_6551_w(machine, offset & 0x03, data); | |
| 256 | 256 | break; |
| 257 | 257 | } |
| 258 | 258 | } |
| r1877 | r1878 | |
|---|---|---|
| 428 | 428 | WRITE8_HANDLER ( uart8250_2_w ) { uart8250_w(2, offset, data); } |
| 429 | 429 | WRITE8_HANDLER ( uart8250_3_w ) { uart8250_w(3, offset, data); } |
| 430 | 430 | |
| 431 | READ16_HANDLER ( uart8250_16le_0_r ) { return read16le_with_read8_handler(uart8250_0_r, offset, mem_mask); } | |
| 432 | READ16_HANDLER ( uart8250_16le_1_r ) { return read16le_with_read8_handler(uart8250_1_r, offset, mem_mask); } | |
| 433 | READ16_HANDLER ( uart8250_16le_2_r ) { return read16le_with_read8_handler(uart8250_2_r, offset, mem_mask); } | |
| 434 | READ16_HANDLER ( uart8250_16le_3_r ) { return read16le_with_read8_handler(uart8250_3_r, offset, mem_mask); } | |
| 435 | WRITE16_HANDLER ( uart8250_16le_0_w ) { write16le_with_write8_handler(uart8250_0_w, offset, data, mem_mask); } | |
| 436 | WRITE16_HANDLER ( uart8250_16le_1_w ) { write16le_with_write8_handler(uart8250_1_w, offset, data, mem_mask); } | |
| 437 | WRITE16_HANDLER ( uart8250_16le_2_w ) { write16le_with_write8_handler(uart8250_2_w, offset, data, mem_mask); } | |
| 438 | WRITE16_HANDLER ( uart8250_16le_3_w ) { write16le_with_write8_handler(uart8250_3_w, offset, data, mem_mask); } | |
| 431 | READ16_HANDLER ( uart8250_16le_0_r ) { return read16le_with_read8_handler(uart8250_0_r, machine, offset, mem_mask); } | |
| 432 | READ16_HANDLER ( uart8250_16le_1_r ) { return read16le_with_read8_handler(uart8250_1_r, machine, offset, mem_mask); } | |
| 433 | READ16_HANDLER ( uart8250_16le_2_r ) { return read16le_with_read8_handler(uart8250_2_r, machine, offset, mem_mask); } | |
| 434 | READ16_HANDLER ( uart8250_16le_3_r ) { return read16le_with_read8_handler(uart8250_3_r, machine, offset, mem_mask); } | |
| 435 | WRITE16_HANDLER ( uart8250_16le_0_w ) { write16le_with_write8_handler(uart8250_0_w, machine, offset, data, mem_mask); } | |
| 436 | WRITE16_HANDLER ( uart8250_16le_1_w ) { write16le_with_write8_handler(uart8250_1_w, machine, offset, data, mem_mask); } | |
| 437 | WRITE16_HANDLER ( uart8250_16le_2_w ) { write16le_with_write8_handler(uart8250_2_w, machine, offset, data, mem_mask); } | |
| 438 | WRITE16_HANDLER ( uart8250_16le_3_w ) { write16le_with_write8_handler(uart8250_3_w, machine, offset, data, mem_mask); } | |
| 439 | 439 | |
| 440 | READ32_HANDLER ( uart8250_32le_0_r ) { return read32le_with_read8_handler(uart8250_0_r, offset, mem_mask); } | |
| 441 | READ32_HANDLER ( uart8250_32le_1_r ) { return read32le_with_read8_handler(uart8250_1_r, offset, mem_mask); } | |
| 442 | READ32_HANDLER ( uart8250_32le_2_r ) { return read32le_with_read8_handler(uart8250_2_r, offset, mem_mask); } | |
| 443 | READ32_HANDLER ( uart8250_32le_3_r ) { return read32le_with_read8_handler(uart8250_3_r, offset, mem_mask); } | |
| 444 | WRITE32_HANDLER ( uart8250_32le_0_w ) { write32le_with_write8_handler(uart8250_0_w, offset, data, mem_mask); } | |
| 445 | WRITE32_HANDLER ( uart8250_32le_1_w ) { write32le_with_write8_handler(uart8250_1_w, offset, data, mem_mask); } | |
| 446 | WRITE32_HANDLER ( uart8250_32le_2_w ) { write32le_with_write8_handler(uart8250_2_w, offset, data, mem_mask); } | |
| 447 | WRITE32_HANDLER ( uart8250_32le_3_w ) { write32le_with_write8_handler(uart8250_3_w, offset, data, mem_mask); } | |
| 440 | READ32_HANDLER ( uart8250_32le_0_r ) { return read32le_with_read8_handler(uart8250_0_r, machine, offset, mem_mask); } | |
| 441 | READ32_HANDLER ( uart8250_32le_1_r ) { return read32le_with_read8_handler(uart8250_1_r, machine, offset, mem_mask); } | |
| 442 | READ32_HANDLER ( uart8250_32le_2_r ) { return read32le_with_read8_handler(uart8250_2_r, machine, offset, mem_mask); } | |
| 443 | READ32_HANDLER ( uart8250_32le_3_r ) { return read32le_with_read8_handler(uart8250_3_r, machine, offset, mem_mask); } | |
| 444 | WRITE32_HANDLER ( uart8250_32le_0_w ) { write32le_with_write8_handler(uart8250_0_w, machine, offset, data, mem_mask); } | |
| 445 | WRITE32_HANDLER ( uart8250_32le_1_w ) { write32le_with_write8_handler(uart8250_1_w, machine, offset, data, mem_mask); } | |
| 446 | WRITE32_HANDLER ( uart8250_32le_2_w ) { write32le_with_write8_handler(uart8250_2_w, machine, offset, data, mem_mask); } | |
| 447 | WRITE32_HANDLER ( uart8250_32le_3_w ) { write32le_with_write8_handler(uart8250_3_w, machine, offset, data, mem_mask); } | |
| 448 | 448 | |
| 449 | READ64_HANDLER ( uart8250_64be_0_r ) { return read64be_with_read8_handler(uart8250_0_r, offset, mem_mask); } | |
| 450 | READ64_HANDLER ( uart8250_64be_1_r ) { return read64be_with_read8_handler(uart8250_1_r, offset, mem_mask); } | |
| 451 | READ64_HANDLER ( uart8250_64be_2_r ) { return read64be_with_read8_handler(uart8250_2_r, offset, mem_mask); } | |
| 452 | READ64_HANDLER ( uart8250_64be_3_r ) { return read64be_with_read8_handler(uart8250_3_r, offset, mem_mask); } | |
| 453 | WRITE64_HANDLER ( uart8250_64be_0_w ) { write64be_with_write8_handler(uart8250_0_w, offset, data, mem_mask); } | |
| 454 | WRITE64_HANDLER ( uart8250_64be_1_w ) { write64be_with_write8_handler(uart8250_1_w, offset, data, mem_mask); } | |
| 455 | WRITE64_HANDLER ( uart8250_64be_2_w ) { write64be_with_write8_handler(uart8250_2_w, offset, data, mem_mask); } | |
| 456 | WRITE64_HANDLER ( uart8250_64be_3_w ) { write64be_with_write8_handler(uart8250_3_w, offset, data, mem_mask); } | |
| 449 | READ64_HANDLER ( uart8250_64be_0_r ) { return read64be_with_read8_handler(uart8250_0_r, machine, offset, mem_mask); } | |
| 450 | READ64_HANDLER ( uart8250_64be_1_r ) { return read64be_with_read8_handler(uart8250_1_r, machine, offset, mem_mask); } | |
| 451 | READ64_HANDLER ( uart8250_64be_2_r ) { return read64be_with_read8_handler(uart8250_2_r, machine, offset, mem_mask); } | |
| 452 | READ64_HANDLER ( uart8250_64be_3_r ) { return read64be_with_read8_handler(uart8250_3_r, machine, offset, mem_mask); } | |
| 453 | WRITE64_HANDLER ( uart8250_64be_0_w ) { write64be_with_write8_handler(uart8250_0_w, machine, offset, data, mem_mask); } | |
| 454 | WRITE64_HANDLER ( uart8250_64be_1_w ) { write64be_with_write8_handler(uart8250_1_w, machine, offset, data, mem_mask); } | |
| 455 | WRITE64_HANDLER ( uart8250_64be_2_w ) { write64be_with_write8_handler(uart8250_2_w, machine, offset, data, mem_mask); } | |
| 456 | WRITE64_HANDLER ( uart8250_64be_3_w ) { write64be_with_write8_handler(uart8250_3_w, machine, offset, data, mem_mask); } |
| r1877 | r1878 | |
|---|---|---|
| 82 | 82 | version 2: |
| 83 | 83 | cmd 0x30 used for this |
| 84 | 84 | */ |
| 85 | static void c65_dma_port_w(int offset, int value) | |
| 85 | static void c65_dma_port_w(running_machine *machine, int offset, int value) | |
| 86 | 86 | { |
| 87 | 87 | static int dump=0; |
| 88 | 88 | PAIR pair, src, dst, len; |
| r1877 | r1878 | |
| 99 | 99 | pair.b.h2=dma.data[2]; |
| 100 | 100 | pair.b.h=dma.data[1]; |
| 101 | 101 | pair.b.l=dma.data[0]=value; |
| 102 | cmd=c65_read_mem(pair.d++); | |
| 102 | cmd=c65_read_mem(machine, pair.d++); | |
| 103 | 103 | len.w.h=0; |
| 104 | len.b.l=c65_read_mem(pair.d++); | |
| 105 | len.b.h=c65_read_mem(pair.d++); | |
| 104 | len.b.l=c65_read_mem(machine, pair.d++); | |
| 105 | len.b.h=c65_read_mem(machine, pair.d++); | |
| 106 | 106 | src.b.h3=0; |
| 107 | fill=src.b.l=c65_read_mem(pair.d++); | |
| 108 | src.b.h=c65_read_mem(pair.d++); | |
| 109 | src.b.h2=c65_read_mem(pair.d++); | |
| 107 | fill=src.b.l=c65_read_mem(machine, pair.d++); | |
| 108 | src.b.h=c65_read_mem(machine, pair.d++); | |
| 109 | src.b.h2=c65_read_mem(machine, pair.d++); | |
| 110 | 110 | dst.b.h3=0; |
| 111 | dst.b.l=c65_read_mem(pair.d++); | |
| 112 | dst.b.h=c65_read_mem(pair.d++); | |
| 113 | dst.b.h2=c65_read_mem(pair.d++); | |
| 111 | dst.b.l=c65_read_mem(machine, pair.d++); | |
| 112 | dst.b.h=c65_read_mem(machine, pair.d++); | |
| 113 | dst.b.h2=c65_read_mem(machine, pair.d++); | |
| 114 | 114 | |
| 115 | 115 | switch (cmd) { |
| 116 | 116 | case 0: |
| r1877 | r1878 | |
| 118 | 118 | if (dump) |
| 119 | 119 | DBG_LOG(1,"dma copy job", |
| 120 | 120 | ("len:%.4x src:%.6x dst:%.6x sub:%.2x modrm:%.2x\n", |
| 121 | len.w.l, src.d, dst.d, c65_read_mem(pair.d), | |
| 122 | c65_read_mem(pair.d+1) ) ); | |
| 121 | len.w.l, src.d, dst.d, c65_read_mem(machine, pair.d), | |
| 122 | c65_read_mem(machine, pair.d+1) ) ); | |
| 123 | 123 | if ( (dma.version==1) |
| 124 | 124 | &&( (src.d&0x400000)||(dst.d&0x400000)) ) { |
| 125 | 125 | if ( !(src.d&0x400000) ) { |
| 126 | 126 | dst.d&=~0x400000; |
| 127 | 127 | for (i=0; i<len.w.l; i++) |
| 128 | c65_write_mem(dst.d--,c65_read_mem(src.d++)); | |
| 128 | c65_write_mem(machine, dst.d--,c65_read_mem(machine, src.d++)); | |
| 129 | 129 | } else if ( !(dst.d&0x400000) ) { |
| 130 | 130 | src.d&=~0x400000; |
| 131 | 131 | for (i=0; i<len.w.l; i++) |
| 132 | c65_write_mem(dst.d++,c65_read_mem(src.d--)); | |
| 132 | c65_write_mem(machine, dst.d++,c65_read_mem(machine, src.d--)); | |
| 133 | 133 | } else { |
| 134 | 134 | src.d&=~0x400000; |
| 135 | 135 | dst.d&=~0x400000; |
| 136 | 136 | for (i=0; i<len.w.l; i++) |
| 137 | c65_write_mem(--dst.d,c65_read_mem(--src.d)); | |
| 137 | c65_write_mem(machine, --dst.d,c65_read_mem(machine, --src.d)); | |
| 138 | 138 | } |
| 139 | 139 | } else { |
| 140 | 140 | for (i=0; i<len.w.l; i++) |
| 141 | c65_write_mem(dst.d++,c65_read_mem(src.d++)); | |
| 141 | c65_write_mem(machine, dst.d++,c65_read_mem(machine, src.d++)); | |
| 142 | 142 | } |
| 143 | 143 | break; |
| 144 | 144 | case 3: |
| 145 | 145 | DBG_LOG(3,"dma fill job", |
| 146 | 146 | ("len:%.4x value:%.2x dst:%.6x sub:%.2x modrm:%.2x\n", |
| 147 | len.w.l, fill, dst.d, c65_read_mem(pair.d), | |
| 148 | c65_read_mem(pair.d+1))); | |
| 147 | len.w.l, fill, dst.d, c65_read_mem(machine, pair.d), | |
| 148 | c65_read_mem(machine, pair.d+1))); | |
| 149 | 149 | for (i=0; i<len.w.l; i++) |
| 150 | c65_write_mem(dst.d++,fill); | |
| 150 | c65_write_mem(machine, dst.d++,fill); | |
| 151 | 151 | break; |
| 152 | 152 | case 0x30: |
| 153 | 153 | DBG_LOG(1,"dma copy down", |
| 154 | 154 | ("len:%.4x src:%.6x dst:%.6x sub:%.2x modrm:%.2x\n", |
| 155 | len.w.l, src.d, dst.d, c65_read_mem(pair.d), | |
| 156 | c65_read_mem(pair.d+1) ) ); | |
| 155 | len.w.l, src.d, dst.d, c65_read_mem(machine, pair.d), | |
| 156 | c65_read_mem(machine, pair.d+1) ) ); | |
| 157 | 157 | for (i=0; i<len.w.l; i++) |
| 158 | c65_write_mem(dst.d--,c65_read_mem(src.d--)); | |
| 158 | c65_write_mem(machine, dst.d--,c65_read_mem(machine, src.d--)); | |
| 159 | 159 | break; |
| 160 | 160 | default: |
| 161 | 161 | DBG_LOG(1,"dma job", |
| 162 | 162 | ("cmd:%.2x len:%.4x src:%.6x dst:%.6x sub:%.2x modrm:%.2x\n", |
| 163 | cmd,len.w.l, src.d, dst.d, c65_read_mem(pair.d), | |
| 164 | c65_read_mem(pair.d+1))); | |
| 163 | cmd,len.w.l, src.d, dst.d, c65_read_mem(machine, pair.d), | |
| 164 | c65_read_mem(machine, pair.d+1))); | |
| 165 | 165 | } |
| 166 | 166 | break; |
| 167 | 167 | default: |
| r1877 | r1878 | |
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | static int c65_dma_port_r(int offset) | |
| 173 | static int c65_dma_port_r(running_machine *machine, int offset) | |
| 174 | 174 | { |
| 175 | 175 | /* offset 3 bit 7 in progress ? */ |
| 176 | 176 | DBG_LOG (2, "dma chip read", ("%.3x\n", offset)); |
| 177 | 177 | return 0x7f; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | static void c65_6511_port_w(int offset, int value) | |
| 180 | static void c65_6511_port_w(running_machine *machine, int offset, int value) | |
| 181 | 181 | { |
| 182 | 182 | if (offset==7) { |
| 183 | 183 | c65_6511_port=value; |
| r1877 | r1878 | |
| 185 | 185 | DBG_LOG (2, "r6511 write", ("%.2x %.2x\n", offset, value)); |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | static int c65_6511_port_r(int offset) | |
| 188 | static int c65_6511_port_r(running_machine *machine, int offset) | |
| 189 | 189 | { |
| 190 | 190 | int data=0xff; |
| 191 | 191 | if (offset==7) { |
| r1877 | r1878 | |
| 320 | 320 | } |
| 321 | 321 | #endif |
| 322 | 322 | |
| 323 | static void c65_fdc_w(int offset, int data) | |
| 323 | static void c65_fdc_w(running_machine *machine, int offset, int data) | |
| 324 | 324 | { |
| 325 | 325 | DBG_LOG (1, "fdc write", ("%.5x %.2x %.2x\n", activecpu_get_pc(), offset, data)); |
| 326 | 326 | switch (offset&0xf) { |
| r1877 | r1878 | |
| 371 | 371 | } |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | static int c65_fdc_r(int offset) | |
| 374 | static int c65_fdc_r(running_machine *machine, int offset) | |
| 375 | 375 | { |
| 376 | 376 | UINT8 data=0; |
| 377 | 377 | switch (offset&0xf) { |
| r1877 | r1878 | |
| 461 | 461 | switch(offset&0xf00) { |
| 462 | 462 | case 0x000: |
| 463 | 463 | if (offset < 0x80) |
| 464 | vic3_port_w (offset & 0x7f, data); | |
| 464 | vic3_port_w (machine, offset & 0x7f, data); | |
| 465 | 465 | else if (offset < 0xa0) { |
| 466 | c65_fdc_w(offset&0x1f,data); | |
| 466 | c65_fdc_w(machine, offset&0x1f,data); | |
| 467 | 467 | } else { |
| 468 | c65_ram_expansion_w(offset&0x1f, data); | |
| 468 | c65_ram_expansion_w(machine, offset&0x1f, data); | |
| 469 | 469 | /*ram expansion crtl optional */ |
| 470 | 470 | } |
| 471 | 471 | break; |
| 472 | 472 | case 0x100:case 0x200: case 0x300: |
| 473 | vic3_palette_w(offset-0x100,data); | |
| 473 | vic3_palette_w(machine, offset-0x100,data); | |
| 474 | 474 | break; |
| 475 | 475 | case 0x400: |
| 476 | 476 | if (offset<0x420) /* maybe 0x20 */ |
| 477 | sid6581_0_port_w (offset & 0x3f, data); | |
| 477 | sid6581_0_port_w (machine, offset & 0x3f, data); | |
| 478 | 478 | else if (offset<0x440) |
| 479 | sid6581_1_port_w(offset&0x3f, data); | |
| 479 | sid6581_1_port_w(machine, offset&0x3f, data); | |
| 480 | 480 | else |
| 481 | 481 | DBG_LOG (1, "io write", ("%.3x %.2x\n", offset, data)); |
| 482 | 482 | break; |
| r1877 | r1878 | |
| 484 | 484 | DBG_LOG (1, "io write", ("%.3x %.2x\n", offset, data)); |
| 485 | 485 | break; |
| 486 | 486 | case 0x600: |
| 487 | c65_6511_port_w(offset&0xff,data); | |
| 487 | c65_6511_port_w(machine, offset&0xff,data); | |
| 488 | 488 | break; |
| 489 | 489 | case 0x700: |
| 490 | c65_dma_port_w(offset&0xff, data); | |
| 490 | c65_dma_port_w(machine, offset&0xff, data); | |
| 491 | 491 | break; |
| 492 | 492 | } |
| 493 | 493 | } |
| r1877 | r1878 | |
| 496 | 496 | { |
| 497 | 497 | switch(offset&0xf00) { |
| 498 | 498 | case 0x000: |
| 499 | cia_0_w(offset, data); | |
| 499 | cia_0_w(machine, offset, data); | |
| 500 | 500 | break; |
| 501 | 501 | case 0x100: |
| 502 | cia_1_w(offset, data); | |
| 502 | cia_1_w(machine, offset, data); | |
| 503 | 503 | break; |
| 504 | 504 | case 0x200: |
| 505 | 505 | case 0x300: |
| r1877 | r1878 | |
| 513 | 513 | switch(offset&0xf00) { |
| 514 | 514 | case 0x000: |
| 515 | 515 | if (offset < 0x80) |
| 516 | return vic3_port_r (offset & 0x7f); | |
| 516 | return vic3_port_r (machine, offset & 0x7f); | |
| 517 | 517 | if (offset < 0xa0) { |
| 518 | return c65_fdc_r(offset&0x1f); | |
| 518 | return c65_fdc_r(machine, offset&0x1f); | |
| 519 | 519 | } else { |
| 520 | return c65_ram_expansion_r(offset&0x1f); | |
| 520 | return c65_ram_expansion_r(machine, offset&0x1f); | |
| 521 | 521 | /*return; ram expansion crtl optional */ |
| 522 | 522 | } |
| 523 | 523 | break; |
| r1877 | r1878 | |
| 527 | 527 | break; |
| 528 | 528 | case 0x400: |
| 529 | 529 | if (offset<0x420) |
| 530 | return sid6581_0_port_r | |
| 530 | return sid6581_0_port_r | |
| 531 | 531 | if (offset<0x440) |
| 532 | return sid6581_1_port_r(offset&0x3f); | |
| 532 | return sid6581_1_port_r(machine, offset&0x3f); | |
| 533 | 533 | DBG_LOG (1, "io read", ("%.3x\n", offset)); |
| 534 | 534 | break; |
| 535 | 535 | case 0x500: |
| 536 | 536 | DBG_LOG (1, "io read", ("%.3x\n", offset)); |
| 537 | 537 | break; |
| 538 | 538 | case 0x600: |
| 539 | return c65_6511_port_r(offset&0xff); | |
| 539 | return c65_6511_port_r(machine, offset&0xff); | |
| 540 | 540 | case 0x700: |
| 541 | return c65_dma_port_r(offset&0xff); | |
| 541 | return c65_dma_port_r(machine, offset&0xff); | |
| 542 | 542 | } |
| 543 | 543 | return 0xff; |
| 544 | 544 | } |
| r1877 | r1878 | |
| 547 | 547 | { |
| 548 | 548 | switch(offset&0x300) { |
| 549 | 549 | case 0x000: |
| 550 | return cia_0_r(offset); | |
| 550 | return cia_0_r(machine, offset); | |
| 551 | 551 | case 0x100: |
| 552 | return cia_1_r(offset); | |
| 552 | return cia_1_r(machine, offset); | |
| 553 | 553 | case 0x200: |
| 554 | 554 | case 0x300: |
| 555 | 555 | DBG_LOG (1, "io read", ("%.3x\n", offset+0xc00)); |
| r1877 | r1878 | |
| 572 | 572 | static void c65_bankswitch_interface(int value) |
| 573 | 573 | { |
| 574 | 574 | static int old=0; |
| 575 | read8_handler rh; | |
| 576 | write8_handler wh; | |
| 575 | read8_machine_func rh; | |
| 576 | write8_machine_func wh; | |
| 577 | 577 | |
| 578 | 578 | DBG_LOG (2, "c65 bankswitch", ("%.2x\n",value)); |
| 579 | 579 | |
| r1877 | r1878 | |
| 620 | 620 | { |
| 621 | 621 | static int old = -1; |
| 622 | 622 | int data, loram, hiram, charen; |
| 623 | read8_handler rh4, rh8; | |
| 624 | write8_handler wh5, wh9; | |
| 623 | read8_machine_func rh4, rh8; | |
| 624 | write8_machine_func wh5, wh9; | |
| 625 | 625 | |
| 626 | 626 | data = (UINT8) cpunum_get_info_int(0, CPUINFO_INT_M6510_PORT); |
| 627 | 627 | if (data == old) |
| r1877 | r1878 | |
|---|---|---|
| 107 | 107 | offs_t memory_size, void *memory_data, int is_rom, int bank) |
| 108 | 108 | { |
| 109 | 109 | offs_t memory_mask; |
| 110 | read16_handler rh; | |
| 111 | write16_handler wh; | |
| 110 | read16_machine_func rh; | |
| 111 | write16_machine_func wh; | |
| 112 | 112 | |
| 113 | 113 | memory_size = MIN(memory_size, (memory_end + 1 - memory_begin)); |
| 114 | 114 | memory_mask = memory_size - 1; |
| 115 | 115 | |
| 116 | rh = (read16_handler) (FPTR)bank; | |
| 117 | wh = is_rom ? MWA16_UNMAP : (write16_handler) (FPTR)bank; | |
| 116 | rh = (read16_machine_func) (FPTR)bank; | |
| 117 | wh = is_rom ? MWA16_UNMAP : (write16_machine_func) (FPTR)bank; | |
| 118 | 118 | |
| 119 | 119 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, memory_begin, |
| 120 | 120 | memory_end, memory_mask, 0, rh); |
| r1877 | r1878 | |
| 693 | 693 | reg = R5380_CURDATA_DTACK; |
| 694 | 694 | } |
| 695 | 695 | |
| 696 | return ncr5380_r(reg)<<8; | |
| 696 | return ncr5380_r(machine, reg)<<8; | |
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | WRITE16_HANDLER ( macplus_scsi_w ) |
| r1877 | r1878 | |
| 705 | 705 | reg = R5380_OUTDATA_DTACK; |
| 706 | 706 | } |
| 707 | 707 | |
| 708 | ncr5380_w(reg, data); | |
| 708 | ncr5380_w(machine, reg, data); | |
| 709 | 709 | } |
| 710 | 710 | |
| 711 | 711 | /* ************************************************************************* |
| r1877 | r1878 | |
| 751 | 751 | READ16_HANDLER ( mac_scc_r ) |
| 752 | 752 | { |
| 753 | 753 | UINT16 result; |
| 754 | result = scc_r(offset); | |
| 754 | result = scc_r(machine, offset); | |
| 755 | 755 | return (result << 8) | result; |
| 756 | 756 | } |
| 757 | 757 | |
| r1877 | r1878 | |
| 759 | 759 | |
| 760 | 760 | WRITE16_HANDLER ( mac_scc_w ) |
| 761 | 761 | { |
| 762 | scc_w(offset, (UINT8) data); | |
| 762 | scc_w(machine, offset, (UINT8) data); | |
| 763 | 763 | } |
| 764 | 764 | |
| 765 | 765 | |
| r1877 | r1878 | |
| 1118 | 1118 | if (LOG_MAC_IWM) |
| 1119 | 1119 | logerror("mac_iwm_r: offset=0x%08x\n", offset); |
| 1120 | 1120 | |
| 1121 | result = applefdc_r(offset >> 8); | |
| 1121 | result = applefdc_r(machine, offset >> 8); | |
| 1122 | 1122 | return (result << 8) | result; |
| 1123 | 1123 | } |
| 1124 | 1124 | |
| r1877 | r1878 | |
| 1128 | 1128 | logerror("mac_iwm_w: offset=0x%08x data=0x%04x\n", offset, data); |
| 1129 | 1129 | |
| 1130 | 1130 | if (ACCESSING_LSB) |
| 1131 | applefdc_w(offset >> 8, data & 0xff); | |
| 1131 | applefdc_w(machine, offset >> 8, data & 0xff); | |
| 1132 | 1132 | } |
| 1133 | 1133 | |
| 1134 | 1134 | /* ************************************************************************* |
| r1877 | r1878 | |
| 1261 | 1261 | |
| 1262 | 1262 | if (LOG_VIA) |
| 1263 | 1263 | logerror("mac_via_r: offset=0x%02x\n", offset); |
| 1264 | data = via_0_r(offset); | |
| 1264 | data = via_0_r(machine, offset); | |
| 1265 | 1265 | |
| 1266 | 1266 | return (data & 0xff) | (data << 8); |
| 1267 | 1267 | } |
| r1877 | r1878 | |
| 1275 | 1275 | logerror("mac_via_w: offset=0x%02x data=0x%08x\n", offset, data); |
| 1276 | 1276 | |
| 1277 | 1277 | if (ACCESSING_MSB) |
| 1278 | via_0_w(offset, (data >> 8) & 0xff); | |
| 1278 | via_0_w(machine, offset, (data >> 8) & 0xff); | |
| 1279 | 1279 | } |
| 1280 | 1280 | |
| 1281 | 1281 |
| r1877 | r1878 | |
|---|---|---|
| 776 | 776 | //logerror("Configurando la memoria, L:%02xh, U:%02xh\n", adam_lower_memory, adam_upper_memory); |
| 777 | 777 | } |
| 778 | 778 | |
| 779 | ||
| 779 | ||
| 780 | 780 | { |
| 781 | return ((offset&0x01) ? TMS9928A_register_r(1) : TMS9928A_vram_r(0)); | |
| 781 | return ((offset&0x01) ? TMS9928A_register_r(machine, 1) : TMS9928A_vram_r(machine, 0)); | |
| 782 | 782 | } |
| 783 | 783 | |
| 784 | 784 | WRITE8_HANDLER(adam_video_w) |
| 785 | 785 | { |
| 786 | (offset&0x01) ? TMS9928A_register_w(1, data) : TMS9928A_vram_w(0, data); | |
| 786 | (offset&0x01) ? TMS9928A_register_w(machine, 1, data) : TMS9928A_vram_w(machine, 0, data); | |
| 787 | 787 | } |
| 788 | 788 | |
| 789 | 789 | READ8_HANDLER( master6801_ram_r ) |
| r1877 | r1878 | |
|---|---|---|
| 64 | 64 | for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) |
| 65 | 65 | { |
| 66 | 66 | memory_install_read64_handler(cpunum, ADDRESS_SPACE_PROGRAM, begin, end, |
| 67 | 0, 0, (read64_ | |
| 67 | 0, 0, (read64_machin | |
| 68 | 68 | memory_install_write64_handler(cpunum, ADDRESS_SPACE_PROGRAM, begin, end, |
| 69 | 0, 0, (write64_ | |
| 69 | 0, 0, (write64_machin | |
| 70 | 70 | } |
| 71 | 71 | memory_set_bankptr(bank + mpc105->bank_base, mess_ram); |
| 72 | 72 | } |
| r1877 | r1878 | |
|---|---|---|
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | 20 | #include "driver.h" |
| 21 | #include "deprecat.h" | |
| 21 | 22 | #include "includes/msx_slot.h" |
| 22 | 23 | #include "includes/msx.h" |
| 23 | 24 | #include "machine/wd17xx.h" |
| r1877 | r1878 | |
| 340 | 341 | return 0xff; |
| 341 | 342 | } |
| 342 | 343 | else { |
| 343 | return K051649_waveform_r (offset & 0x7f); | |
| 344 | return K051649_waveform_r (machine, offset & 0x7f); | |
| 344 | 345 | } |
| 345 | 346 | } |
| 346 | 347 | |
| r1877 | r1878 | |
| 369 | 370 | |
| 370 | 371 | MSX_SLOT_WRITE(konami_scc) |
| 371 | 372 | { |
| 373 | running_machine *machine = Machine; | |
| 374 | ||
| 372 | 375 | if (addr >= 0x5000 && addr < 0x5800) { |
| 373 | 376 | state->banks[0] = val & state->bank_mask; |
| 374 | 377 | slot_konami_scc_map (state, 1); |
| r1877 | r1878 | |
| 395 | 398 | int offset = addr & 0xff; |
| 396 | 399 | |
| 397 | 400 | if (offset < 0x80) { |
| 398 | K051649_waveform_w (offset, val); | |
| 401 | K051649_waveform_w (machine, offset, val); | |
| 399 | 402 | } |
| 400 | 403 | else if (offset < 0xa0) { |
| 401 | 404 | offset &= 0xf; |
| 402 | 405 | if (offset < 0xa) { |
| 403 | K051649_frequency_w (offset, val); | |
| 406 | K051649_frequency_w (machine, offset, val); | |
| 404 | 407 | } |
| 405 | 408 | else if (offset < 0xf) { |
| 406 | K051649_volume_w (offset - 0xa, val); | |
| 409 | K051649_volume_w (machine, offset - 0xa, val); | |
| 407 | 410 | } |
| 408 | 411 | else { |
| 409 | K051649_keyonoff_w (0, val); | |
| 412 | K051649_keyonoff_w (machine, 0, val); | |
| 410 | 413 | } |
| 411 | 414 | } |
| 412 | 415 | #if 0 |
| r1877 | r1878 | |
| 1132 | 1135 | static READ8_HANDLER (msx_diskrom_page1_r) |
| 1133 | 1136 | { |
| 1134 | 1137 | switch (offset) { |
| 1135 | case 0: return wd17xx_status_r (0); | |
| 1136 | case 1: return wd17xx_track_r (0); | |
| 1137 | case 2: return wd17xx_sector_r (0); | |
| 1138 | case 3: return wd17xx_data_r (0); | |
| 1138 | case 0: return wd17xx_status_r (machine, 0); | |
| 1139 | case 1: return wd17xx_track_r (machine, 0); | |
| 1140 | case 2: return wd17xx_sector_r (machine, 0); | |
| 1141 | case 3: return wd17xx_data_r (machine, 0); | |
| 1139 | 1142 | case 7: return msx1.dsk_stat; |
| 1140 | 1143 | default: |
| 1141 | 1144 | return msx1.state[1]->mem[offset + 0x3ff8]; |
| r1877 | r1878 | |
| 1147 | 1150 | if (offset >= 0x7f8) { |
| 1148 | 1151 | switch (offset) { |
| 1149 | 1152 | case 0x7f8: |
| 1150 | return wd17xx_status_r (0); | |
| 1153 | return wd17xx_status_r (machine, 0); | |
| 1151 | 1154 | case 0x7f9: |
| 1152 | return wd17xx_track_r (0); | |
| 1155 | return wd17xx_track_r (machine, 0); | |
| 1153 | 1156 | case 0x7fa: |
| 1154 | return wd17xx_sector_r (0); | |
| 1157 | return wd17xx_sector_r (machine, 0); | |
| 1155 | 1158 | case 0x7fb: |
| 1156 | return wd17xx_data_r (0); | |
| 1159 | return wd17xx_data_r (machine, 0); | |
| 1157 | 1160 | case 0x7ff: |
| 1158 | 1161 | return msx1.dsk_stat; |
| 1159 | 1162 | default: |
| r1877 | r1878 | |
| 1191 | 1194 | |
| 1192 | 1195 | MSX_SLOT_WRITE(diskrom) |
| 1193 | 1196 | { |
| 1197 | running_machine *machine = Machine; | |
| 1198 | ||
| 1194 | 1199 | if (addr >= 0xa000 && addr < 0xc000) { |
| 1195 | 1200 | addr -= 0x4000; |
| 1196 | 1201 | } |
| 1197 | 1202 | switch (addr) { |
| 1198 | 1203 | case 0x7ff8: |
| 1199 | wd17xx_command_w (0, val); | |
| 1204 | wd17xx_command_w (machine, 0, val); | |
| 1200 | 1205 | break; |
| 1201 | 1206 | case 0x7ff9: |
| 1202 | wd17xx_track_w (0, val); | |
| 1207 | wd17xx_track_w (machine, 0, val); | |
| 1203 | 1208 | break; |
| 1204 | 1209 | case 0x7ffa: |
| 1205 | wd17xx_sector_w (0, val); | |
| 1210 | wd17xx_sector_w (machine, 0, val); | |
| 1206 | 1211 | break; |
| 1207 | 1212 | case 0x7ffb: |
| 1208 | wd17xx_data_w (0, val); | |
| 1213 | wd17xx_data_w (machine, 0, val); | |
| 1209 | 1214 | break; |
| 1210 | 1215 | case 0x7ffc: |
| 1211 | 1216 | wd17xx_set_side (val & 1); |
| r1877 | r1878 | |
| 1239 | 1244 | wd17xx_reset (); |
| 1240 | 1245 | } |
| 1241 | 1246 | |
| 1242 | static | |
| 1247 | static | |
| 1243 | 1248 | { |
| 1244 | 1249 | switch (offset) { |
| 1245 | case 0: return wd17xx_status_r (0); | |
| 1246 | case 1: return wd17xx_track_r (0); | |
| 1247 | case 2: return wd17xx_sector_r (0); | |
| 1248 | case 3: return wd17xx_data_r (0); | |
| 1250 | case 0: return wd17xx_status_r(machine, 0); | |
| 1251 | case 1: return wd17xx_track_r(machine, 0); | |
| 1252 | case 2: return wd17xx_sector_r(machine, 0); | |
| 1253 | case 3: return wd17xx_data_r(machine, 0); | |
| 1249 | 1254 | case 4: return msx1.dsk_stat; |
| 1250 | 1255 | default: |
| 1251 | 1256 | return msx1.state[1]->mem[offset + 0x3ff8]; |
| r1877 | r1878 | |
| 1257 | 1262 | if (offset >= 0x7b8) { |
| 1258 | 1263 | switch (offset) { |
| 1259 | 1264 | case 0x7b8: |
| 1260 | return wd17xx_status_r (0); | |
| 1265 | return wd17xx_status_r (machine, 0); | |
| 1261 | 1266 | case 0x7b9: |
| 1262 | return wd17xx_track_r (0); | |
| 1267 | return wd17xx_track_r (machine, 0); | |
| 1263 | 1268 | case 0x7ba: |
| 1264 | return wd17xx_sector_r (0); | |
| 1269 | return wd17xx_sector_r (machine, 0); | |
| 1265 | 1270 | case 0x7bb: |
| 1266 | return wd17xx_data_r (0); | |
| 1271 | return wd17xx_data_r (machine, 0); | |
| 1267 | 1272 | case 0x7bc: |
| 1268 | 1273 | return msx1.dsk_stat; |
| 1269 | 1274 | default: |
| r1877 | r1878 | |
| 1300 | 1305 | |
| 1301 | 1306 | MSX_SLOT_WRITE(diskrom2) |
| 1302 | 1307 | { |
| 1308 | running_machine *machine = Machine; | |
| 1309 | ||
| 1303 | 1310 | if (addr >= 0xa000 && addr < 0xc000) { |
| 1304 | 1311 | addr -= 0x4000; |
| 1305 | 1312 | } |
| 1306 | 1313 | switch (addr) { |
| 1307 | 1314 | case 0x7fb8: |
| 1308 | wd17xx_command_w (0, val); | |
| 1315 | wd17xx_command_w (machine, 0, val); | |
| 1309 | 1316 | break; |
| 1310 | 1317 | case 0x7fb9: |
| 1311 | wd17xx_track_w (0, val); | |
| 1318 | wd17xx_track_w (machine, 0, val); | |
| 1312 | 1319 | break; |
| 1313 | 1320 | case 0x7fba: |
| 1314 | wd17xx_sector_w (0, val); | |
| 1321 | wd17xx_sector_w (machine, 0, val); | |
| 1315 | 1322 | break; |
| 1316 | 1323 | case 0x7fbb: |
| 1317 | wd17xx_data_w (0, val); | |
| 1324 | wd17xx_data_w (machine, 0, val); | |
| 1318 | 1325 | break; |
| 1319 | 1326 | case 0x7fbc: |
| 1320 | 1327 | wd17xx_set_side (val & 1); |
| r1877 | r1878 | |
| 1521 | 1528 | |
| 1522 | 1529 | MSX_SLOT_WRITE(fmpac) |
| 1523 | 1530 | { |
| 1531 | running_machine *machine = Machine; | |
| 1524 | 1532 | int i, data; |
| 1525 | 1533 | |
| 1526 | 1534 | if (addr >= 0x4000 && addr < 0x6000 && state->cart.fmpac.sram_support) { |
| r1877 | r1878 | |
| 1536 | 1544 | switch (addr) { |
| 1537 | 1545 | case 0x7ff4: |
| 1538 | 1546 | if (state->cart.fmpac.opll_active) { |
| 1539 | YM2413_register_port_0_w (0, val); | |
| 1547 | YM2413_register_port_0_w (machine, 0, val); | |
| 1540 | 1548 | } |
| 1541 | 1549 | break; |
| 1542 | 1550 | case 0x7ff5: |
| 1543 | 1551 | if (state->cart.fmpac.opll_active) { |
| 1544 | YM2413_data_port_0_w (0, val); | |
| 1552 | YM2413_data_port_0_w (machine, 0, val); | |
| 1545 | 1553 | } |
| 1546 | 1554 | break; |
| 1547 | 1555 | case 0x7ff6: |
| r1877 | r1878 | |
| 1984 | 1992 | reg = offset & 0xff; |
| 1985 | 1993 | |
| 1986 | 1994 | if (reg < 0x80) { |
| 1987 | return K051649_waveform_r (reg); | |
| 1995 | return K051649_waveform_r (machine, reg); | |
| 1988 | 1996 | } |
| 1989 | 1997 | else if (reg < 0xa0) { |
| 1990 | 1998 | /* nothing */ |
| 1991 | 1999 | } |
| 1992 | 2000 | else if (reg < 0xc0) { |
| 1993 | 2001 | /* read wave 5 */ |
| 1994 | return K051649_waveform_r (0x80 + (reg & 0x1f)); | |
| 2002 | return K051649_waveform_r (machine, 0x80 + (reg & 0x1f)); | |
| 1995 | 2003 | } |
| 1996 | 2004 | #if 0 |
| 1997 | 2005 | else if (reg < 0xe0) { |
| r1877 | r1878 | |
| 2014 | 2022 | reg = offset & 0xff; |
| 2015 | 2023 | |
| 2016 | 2024 | if (reg < 0xa0) { |
| 2017 | return K051649_waveform_r (reg); | |
| 2025 | return K051649_waveform_r (machine, reg); | |
| 2018 | 2026 | } |
| 2019 | 2027 | #if 0 |
| 2020 | 2028 | else if (reg >= 0xc0 && reg < 0xe0) { |
| r1877 | r1878 | |
| 2054 | 2062 | MSX_SLOT_WRITE(soundcartridge) |
| 2055 | 2063 | { |
| 2056 | 2064 | int i; |
| 2065 | running_machine *machine = Machine; | |
| 2057 | 2066 | |
| 2058 | 2067 | if (addr < 0x4000) { |
| 2059 | 2068 | return; |
| r1877 | r1878 | |
| 2103 | 2112 | int offset = addr & 0xff; |
| 2104 | 2113 | |
| 2105 | 2114 | if (offset < 0x80) { |
| 2106 | K051649_waveform_w (offset, val); | |
| 2115 | K051649_waveform_w (machine, offset, val); | |
| 2107 | 2116 | } |
| 2108 | 2117 | else if (offset < 0xa0) { |
| 2109 | 2118 | offset &= 0xf; |
| 2110 | 2119 | |
| 2111 | 2120 | if (offset < 0xa) { |
| 2112 | K051649_frequency_w (offset, val); | |
| 2121 | K051649_frequency_w (machine, offset, val); | |
| 2113 | 2122 | } |
| 2114 | 2123 | else if (offset < 0x0f) { |
| 2115 | K051649_volume_w (offset - 0xa, val); | |
| 2124 | K051649_volume_w (machine, offset - 0xa, val); | |
| 2116 | 2125 | } |
| 2117 | 2126 | else if (offset == 0x0f) { |
| 2118 | K051649_keyonoff_w (0, val); | |
| 2127 | K051649_keyonoff_w (machine, 0, val); | |
| 2119 | 2128 | } |
| 2120 | 2129 | } |
| 2121 | 2130 | #if 0 |
| r1877 | r1878 | |
| 2143 | 2152 | int offset = addr & 0xff; |
| 2144 | 2153 | |
| 2145 | 2154 | if (offset < 0xa0) { |
| 2146 | K052539_waveform_w (offset, val); | |
| 2155 | K052539_waveform_w (machine, offset, val); | |
| 2147 | 2156 | } |
| 2148 | 2157 | else if (offset < 0xc0) { |
| 2149 | 2158 | offset &= 0x0f; |
| 2150 | 2159 | |
| 2151 | 2160 | if (offset < 0x0a) { |
| 2152 | K051649_frequency_w (offset, val); | |
| 2161 | K051649_frequency_w (machine, offset, val); | |
| 2153 | 2162 | } |
| 2154 | 2163 | else if (offset < 0x0f) { |
| 2155 | K051649_volume_w (offset - 0x0a, val); | |
| 2164 | K051649_volume_w (machine, offset - 0x0a, val); | |
| 2156 | 2165 | } |
| 2157 | 2166 | else if (offset == 0x0f) { |
| 2158 | K051649_keyonoff_w (0, val); | |
| 2167 | K051649_keyonoff_w (machine, 0, val); | |
| 2159 | 2168 | } |
| 2160 | 2169 | } |
| 2161 | 2170 | #if 0 |
| r1877 | r1878 | |
|---|---|---|
| 1368 | 1368 | |
| 1369 | 1369 | |
| 1370 | 1370 | /* to be completed! */ |
| 1371 | ||
| 1371 | ||
| 1372 | 1372 | { |
| 1373 | return i8271_data_r(offset); | |
| 1373 | return i8271_data_r(machine, offset); | |
| 1374 | 1374 | } |
| 1375 | 1375 | |
| 1376 | 1376 | /* to be completed! */ |
| 1377 | 1377 | WRITE8_HANDLER(i8271_dack_w) |
| 1378 | 1378 | { |
| 1379 | i8271_data_w(offset, data); | |
| 1379 | i8271_data_w(machine, offset, data); | |
| 1380 | 1380 | } |
| 1381 | 1381 | |
| 1382 | 1382 | READ8_HANDLER(i8271_data_r) |
| r1877 | r1878 | |
|---|---|---|
| 11 | 11 | **********************************************************************/ |
| 12 | 12 | |
| 13 | 13 | #include "driver.h" |
| 14 | #include "deprecat.h" | |
| 14 | 15 | #include "mc6850.h" |
| 15 | 16 | |
| 16 | 17 | struct acia6850 |
| r1877 | r1878 | |
| 44 | 45 | { |
| 45 | 46 | case ACIA_6850_CTRL: |
| 46 | 47 | if ((*(*currptr).intf).in_status_func) |
| 47 | val = (*(*currptr).intf).in_status_func(0); | |
| 48 | val = (*(*currptr).intf).in_status_func(Machine, 0); | |
| 48 | 49 | break; |
| 49 | 50 | case ACIA_6850_DATA: |
| 50 | 51 | if ((*(*currptr).intf).in_recv_func) |
| 51 | val = (*(*currptr).intf).in_recv_func(0); | |
| 52 | val = (*(*currptr).intf).in_recv_func(Machine, 0); | |
| 52 | 53 | break; |
| 53 | 54 | } |
| 54 | 55 | return (val); |
| r1877 | r1878 | |
| 62 | 63 | { |
| 63 | 64 | case ACIA_6850_CTRL: |
| 64 | 65 | if ((*(*currptr).intf).out_status_func) |
| 65 | (*(*currptr).intf).out_status_func(0, data); | |
| 66 | (*(*currptr).intf).out_status_func(Machine, 0, data); | |
| 66 | 67 | break; |
| 67 | 68 | case ACIA_6850_DATA: |
| 68 | 69 | if ((*(*currptr).intf).out_tran_func) |
| 69 | (*(*currptr).intf).out_tran_func(0, data); | |
| 70 | (*(*currptr).intf).out_tran_func(Machine, 0, data); | |
| 70 | 71 | break; |
| 71 | 72 | } |
| 72 | 73 | } |
| r1877 | r1878 | |
|---|---|---|
| 833 | 833 | |
| 834 | 834 | void coco3_horizontal_sync_callback(int data) |
| 835 | 835 | { |
| 836 | pia_0_ca1_w(0, data); | |
| 836 | pia_0_ca1_w(Machine, 0, data); | |
| 837 | 837 | coco3_raise_interrupt(COCO3_INT_HBORD, data); |
| 838 | 838 | } |
| 839 | 839 | |
| r1877 | r1878 | |
| 841 | 841 | |
| 842 | 842 | void coco3_field_sync_callback(int data) |
| 843 | 843 | { |
| 844 | pia_0_cb1_w(0, data); | |
| 844 | pia_0_cb1_w(Machine, 0, data); | |
| 845 | 845 | } |
| 846 | 846 | |
| 847 | 847 | void coco3_gime_field_sync_callback(void) |
| r1877 | r1878 | |
| 869 | 869 | coco3_recalc_irq(); |
| 870 | 870 | } |
| 871 | 871 | |
| 872 | static timer_c | |
| 872 | static timer_fired_func | |
| 873 | 873 | |
| 874 | 874 | void coco_set_halt_line(int halt_line) |
| 875 | 875 | { |
| r1877 | r1878 | |
| 1240 | 1240 | joystick = mux_sel2; |
| 1241 | 1241 | |
| 1242 | 1242 | /* poll keyoard keys */ |
| 1243 | if ((input_port_0_r(0) | pia0_pb) != 0xff) porta &= ~0x01; | |
| 1244 | if ((input_port_1_r(0) | pia0_pb) != 0xff) porta &= ~0x02; | |
| 1245 | if ((input_port_2_r(0) | pia0_pb) != 0xff) porta &= ~0x04; | |
| 1246 | if ((input_port_3_r(0) | pia0_pb) != 0xff) porta &= ~0x08; | |
| 1247 | if ((input_port_4_r(0) | pia0_pb) != 0xff) porta &= ~0x10; | |
| 1248 | if ((input_port_5_r(0) | pia0_pb) != 0xff) porta &= ~0x20; | |
| 1249 | if ((input_port_6_r(0) | pia0_pb) != 0xff) porta &= ~0x40; | |
| 1243 | if ((readinputport(0) | pia0_pb) != 0xff) porta &= ~0x01; | |
| 1244 | if ((readinputport(1) | pia0_pb) != 0xff) porta &= ~0x02; | |
| 1245 | if ((readinputport(2) | pia0_pb) != 0xff) porta &= ~0x04; | |
| 1246 | if ((readinputport(3) | pia0_pb) != 0xff) porta &= ~0x08; | |
| 1247 | if ((readinputport(4) | pia0_pb) != 0xff) porta &= ~0x10; | |
| 1248 | if ((readinputport(5) | pia0_pb) != 0xff) porta &= ~0x20; | |
| 1249 | if ((readinputport(6) | pia0_pb) != 0xff) porta &= ~0x40; | |
| 1250 | 1250 | |
| 1251 | if ((input_port_0_r(0) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x01; | |
| 1252 | if ((input_port_1_r(0) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x02; | |
| 1253 | if ((input_port_2_r(0) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x04; | |
| 1254 | if ((input_port_3_r(0) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x08; | |
| 1255 | if ((input_port_4_r(0) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x10; | |
| 1256 | if ((input_port_5_r(0) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x20; | |
| 1257 | if ((input_port_6_r(0) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x40; | |
| 1251 | if ((readinputport(0) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x01; | |
| 1252 | if ((readinputport(1) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x02; | |
| 1253 | if ((readinputport(2) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x04; | |
| 1254 | if ((readinputport(3) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x08; | |
| 1255 | if ((readinputport(4) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x10; | |
| 1256 | if ((readinputport(5) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x20; | |
| 1257 | if ((readinputport(6) | pia_get_port_b_z_mask(0)) != 0xff) port_za &= ~0x40; | |
| 1258 | 1258 | |
| 1259 | 1259 | switch(get_input_device(joystick ? INPUTPORT_LEFT_JOYSTICK : INPUTPORT_RIGHT_JOYSTICK)) |
| 1260 | 1260 | { |
| r1877 | r1878 | |
| 1343 | 1343 | |
| 1344 | 1344 | |
| 1345 | 1345 | /* three functions that update the keyboard in varying ways */ |
| 1346 | static WRITE8_HANDLER ( d_pia0_pb_w ) { (*update_keyboard)(); } | |
| 1347 | static void coco_poll_keyboard(void *param, UINT32 value, UINT32 mask) { (*update_keyboard)(); } | |
| 1348 | static TIMER_CALLBACK(coco_update_keyboard_timerproc) { (*update_keyboard)(); } | |
| 1346 | static WRITE8_HANDLER ( d_pia0_pb_w ) { (*update_keyboard)(); } | |
| 1347 | INPUT_CHANGED(coco_keyboard_changed) { (*update_keyboard)(); } | |
| 1348 | static TIMER_CALLBACK(coco_update_keyboard_timerproc) { (*update_keyboard)(); } | |
| 1349 | 1349 | |
| 1350 | 1350 | static WRITE8_HANDLER ( d_pia0_pa_w ) |
| 1351 | 1351 | { |
| r1877 | r1878 | |
| 1494 | 1494 | { |
| 1495 | 1495 | int ddr; |
| 1496 | 1496 | |
| 1497 | d_pia1_pb_w(0, data); | |
| 1497 | d_pia1_pb_w(machine, 0, data); | |
| 1498 | 1498 | |
| 1499 | 1499 | ddr = ~pia_get_port_b_z_mask(1); |
| 1500 | 1500 | |
| r1877 | r1878 | |
| 1541 | 1541 | case 0x00 : /* Inactive, do nothing */ |
| 1542 | 1542 | break; |
| 1543 | 1543 | case 0x01 : /* Write to selected port */ |
| 1544 | AY8910_write_port_0_w(0, pia_get_output_b(2)); | |
| 1544 | AY8910_write_port_0_w(machine, 0, pia_get_output_b(2)); | |
| 1545 | 1545 | break; |
| 1546 | 1546 | case 0x02 : /* Read from selected port */ |
| 1547 | pia_set_input_b(2, AY8910_read_port_0_r(0)); | |
| 1547 | pia_set_input_b(2, AY8910_read_port_0_r(machine, 0)); | |
| 1548 | 1548 | break; |
| 1549 | 1549 | case 0x03 : /* Select port to write to */ |
| 1550 | AY8910_control_port_0_w(0, pia_get_output_b(2)); | |
| 1550 | AY8910_control_port_0_w(machine, 0, pia_get_output_b(2)); | |
| 1551 | 1551 | break; |
| 1552 | 1552 | } |
| 1553 | 1553 | } |
| r1877 | r1878 | |
| 1576 | 1576 | |
| 1577 | 1577 | static void dgnalpha_fdc_callback(wd17xx_state_t event, void *param) |
| 1578 | 1578 | { |
| 1579 | running_machine *machine = Machine; | |
| 1580 | ||
| 1579 | 1581 | /* The NMI line on the alphaAlpha is gated through IC16 (early PLD), and is gated by pia2 CA2 */ |
| 1580 | 1582 | /* The DRQ line goes through pia2 cb1, in exactly the same way as DRQ from DragonDos does */ |
| 1581 | 1583 | /* for pia1 cb1 */ |
| 1582 | 1584 | switch(event) |
| 1583 | 1585 | { |
| 1584 | 1586 | case WD17XX_IRQ_CLR: |
| 1585 | cpunum_set_input_line( | |
| 1587 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE); | |
| 1586 | 1588 | break; |
| 1587 | 1589 | case WD17XX_IRQ_SET: |
| 1588 | 1590 | if(dgnalpha_just_reset) |
| r1877 | r1878 | |
| 1592 | 1594 | else |
| 1593 | 1595 | { |
| 1594 | 1596 | if (pia_get_output_ca2(2)) |
| 1595 | cpunum_set_input_line( | |
| 1597 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); | |
| 1596 | 1598 | } |
| 1597 | 1599 | break; |
| 1598 | 1600 | case WD17XX_DRQ_CLR: |
| 1599 | pia_2_cb1_w(0,CARTLINE_CLEAR); | |
| 1601 | pia_2_cb1_w(machine, 0, CARTLINE_CLEAR); | |
| 1600 | 1602 | break; |
| 1601 | 1603 | case WD17XX_DRQ_SET: |
| 1602 | pia_2_cb1_w(0,CARTLINE_ASSERTED); | |
| 1604 | pia_2_cb1_w(machine, 0, CARTLINE_ASSERTED); | |
| 1603 | 1605 | break; |
| 1604 | 1606 | } |
| 1605 | 1607 | } |
| r1877 | r1878 | |
| 1612 | 1614 | switch(offset & 0x03) |
| 1613 | 1615 | { |
| 1614 | 1616 | case 0: |
| 1615 | result = wd17xx_data_r(0); | |
| 1617 | result = wd17xx_data_r(machine, 0); | |
| 1616 | 1618 | break; |
| 1617 | 1619 | case 1: |
| 1618 | result = wd17xx_sector_r(0); | |
| 1620 | result = wd17xx_sector_r(machine, 0); | |
| 1619 | 1621 | break; |
| 1620 | 1622 | case 2: |
| 1621 | result = wd17xx_track_r(0); | |
| 1623 | result = wd17xx_track_r(machine, 0); | |
| 1622 | 1624 | break; |
| 1623 | 1625 | case 3: |
| 1624 | result = wd17xx_status_r(0); | |
| 1626 | result = wd17xx_status_r(machine, 0); | |
| 1625 | 1627 | break; |
| 1626 | 1628 | default: |
| 1627 | 1629 | break; |
| r1877 | r1878 | |
| 1635 | 1637 | switch(offset & 0x3) |
| 1636 | 1638 | { |
| 1637 | 1639 | case 0: |
| 1638 | wd17xx_data_w(0, data); | |
| 1640 | wd17xx_data_w(machine, 0, data); | |
| 1639 | 1641 | break; |
| 1640 | 1642 | case 1: |
| 1641 | wd17xx_sector_w(0, data); | |
| 1643 | wd17xx_sector_w(machine, 0, data); | |
| 1642 | 1644 | break; |
| 1643 | 1645 | case 2: |
| 1644 | wd17xx_track_w(0, data); | |
| 1646 | wd17xx_track_w(machine, 0, data); | |
| 1645 | 1647 | break; |
| 1646 | 1648 | case 3: |
| 1647 | wd17xx_command_w(0, data); | |
| 1649 | wd17xx_command_w(machine, 0, data); | |
| 1648 | 1650 | |
| 1649 | 1651 | /* disk head is encoded in the command byte */ |
| 1650 | 1652 | wd17xx_set_side((data & 0x02) ? 1 : 0); |
| r1877 | r1878 | |
| 2543 | 2545 | READ8_HANDLER(coco3_cartridge_r) |
| 2544 | 2546 | { |
| 2545 | 2547 | /* this behavior is documented in Super Extended Basic Unravelled, page 14 */ |
| 2546 | return ((coco3_gimereg[0] & 0x04) || (offset >= 0x10)) ? coco_cartridge_r(offset) : 0; | |
| 2548 | return ((coco3_gimereg[0] & 0x04) || (offset >= 0x10)) ? coco_cartridge_r(machine, offset) : 0; | |
| 2547 | 2549 | } |
| 2548 | 2550 | |
| 2549 | 2551 | |
| r1877 | r1878 | |
| 2557 | 2559 | { |
| 2558 | 2560 | /* this behavior is documented in Super Extended Basic Unravelled, page 14 */ |
| 2559 | 2561 | if ((coco3_gimereg[0] & 0x04) || (offset >= 0x10)) |
| 2560 | coco_cartridge_w(offset, data); | |
| 2562 | coco_cartridge_w(machine, offset, data); | |
| 2561 | 2563 | } |
| 2562 | 2564 | |
| 2563 | 2565 | |
| r1877 | r1878 | |
| 2568 | 2570 | |
| 2569 | 2571 | static void coco_cart_timer_w(running_machine *machine, int data) |
| 2570 | 2572 | { |
| 2571 | pia_1_cb1_w(0, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE); | |
| 2573 | pia_1_cb1_w(machine, 0, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE); | |
| 2572 | 2574 | |
| 2573 | 2575 | /* special code for Q state */ |
| 2574 | 2576 | if ((data == 0x02) || (data == 0x03) || (data == 0x04)) |
| r1877 | r1878 | |
| 2718 | 2720 | |
| 2719 | 2721 | WRITE8_HANDLER(coco_pia_1_w) |
| 2720 | 2722 | { |
| 2721 | pia_1_w(offset, data); | |
| 2723 | pia_1_w(machine, offset, data); | |
| 2722 | 2724 | twiddle_cart_line_if_q(); |
| 2723 | 2725 | } |
| 2724 | 2726 | |
| r1877 | r1878 | |
| 2732 | 2734 | { |
| 2733 | 2735 | const pia6821_interface *piaintf; /* PIA initializer */ |
| 2734 | 2736 | int piaintf_count; /* PIA count */ |
| 2735 | timer_c | |
| 2737 | timer_fired_func | |
| 2736 | 2738 | void (*printer_out_)(int data); /* printer output callback */ |
| 2737 | timer_c | |
| 2739 | timer_fired_func | |
| 2738 | 2740 | const char *fdc_cart_hardware; /* normal cartridge hardware */ |
| 2739 | 2741 | void (*map_memory)(coco_cartridge *cartridge, UINT32 offset, UINT32 mask); |
| 2740 | 2742 | }; |
| r1877 | r1878 | |
| 2748 | 2750 | /* for everything except the coco3, so it made sense not to pass it as a parameter */ |
| 2749 | 2751 | static void generic_init_machine(running_machine *machine, const machine_init_interface *init) |
| 2750 | 2752 | { |
| 2751 | int portnum; | |
| 2752 | 2753 | coco_cartridge_config cart_config; |
| 2753 | 2754 | mess_image *cart_image; |
| 2754 | 2755 | const char *extrainfo; |
| r1877 | r1878 | |
| 2816 | 2817 | cart_config.map_memory = init->map_memory; |
| 2817 | 2818 | coco_cart = cococart_init(cart_hardware, &cart_config); |
| 2818 | 2819 | |
| 2819 | /* set up callbacks to be invoked on key press */ | |
| 2820 | for (portnum = 0; portnum <= 6; portnum++) | |
| 2821 | input_port_set_changed_callback(portnum, ~0, coco_poll_keyboard, NULL); | |
| 2822 | ||
| 2823 | 2820 | #ifdef MAME_DEBUG |
| 2824 | 2821 | cpuintrf_set_dasm_override(0, coco_dasm_override); |
| 2825 | 2822 | #endif |
| r1877 | r1878 | |
|---|---|---|
| 50 | 50 | int pulse_count; |
| 51 | 51 | int pulse1_state; |
| 52 | 52 | int pulse16_state; |
| 53 | void (*timer_c | |
| 53 | void (*timer_fired_func | |
| 54 | 54 | void (*alarm_callback)(int state); |
| 55 | 55 | }; // Ricoh RP5C15 |
| 56 | 56 |
| r1877 | r1878 | |
|---|---|---|
| 16 | 16 | #include "machine/wd33c93.h" |
| 17 | 17 | #include "machine/tpi6525.h" |
| 18 | 18 | #include "matsucd.h" |
| 19 | #include "deprecat.h" | |
| 19 | 20 | |
| 20 | 21 | |
| 21 | 22 | #define VERBOSE_DMAC 0 |
| r1877 | r1878 | |
| 81 | 82 | return; |
| 82 | 83 | |
| 83 | 84 | /* otherwise, generate the IRQ */ |
| 84 | amiga_custom_w(REG_INTREQ, 0x8000 | INTENA_PORTS, 0); | |
| 85 | amiga_custom_w(Machine, REG_INTREQ, 0x8000 | INTENA_PORTS, 0); | |
| 85 | 86 | } |
| 86 | 87 | |
| 87 | 88 | static TIMER_CALLBACK(dmac_dma_proc) |
| r1877 | r1878 | |
| 213 | 214 | case 0x67: |
| 214 | 215 | { |
| 215 | 216 | LOG(( "DMAC: PC=%08x - TPI6525 Read(%d)\n", activecpu_get_pc(), (offset - 0x58) )); |
| 216 | return tpi6525_0_port_r(offset - 0x58); | |
| 217 | return tpi6525_0_port_r(machine, offset - 0x58); | |
| 217 | 218 | } |
| 218 | 219 | break; |
| 219 | 220 | |
| r1877 | r1878 | |
| 339 | 340 | case 0x67: |
| 340 | 341 | { |
| 341 | 342 | LOG(( "DMAC: PC=%08x - TPI6525 Write(%d) - data = %04x\n", activecpu_get_pc(), (offset - 0x58), data )); |
| 342 | tpi6525_0_port_w(offset - 0x58, data); | |
| 343 | tpi6525_0_port_w(machine, offset - 0x58, data); | |
| 343 | 344 | } |
| 344 | 345 | break; |
| 345 | 346 | |
| r1877 | r1878 | |
| 451 | 452 | |
| 452 | 453 | if ( (CUSTOM_REG(REG_INTREQ) & INTENA_PORTS) == 0 ) |
| 453 | 454 | { |
| 454 | amiga_custom_w(REG_INTREQ, 0x8000 | INTENA_PORTS, 0); | |
| 455 | amiga_custom_w(machine, REG_INTREQ, 0x8000 | INTENA_PORTS, 0); | |
| 455 | 456 | } |
| 456 | 457 | else |
| 457 | 458 | { |
| r1877 | r1878 | |
| 467 | 468 | { |
| 468 | 469 | if ( (CUSTOM_REG(REG_INTREQ) & INTENA_PORTS) == 0 ) |
| 469 | 470 | { |
| 470 | amiga_custom_w(REG_INTREQ, 0x8000 | INTENA_PORTS, 0); | |
| 471 | amiga_custom_w(Machine, REG_INTREQ, 0x8000 | INTENA_PORTS, 0); | |
| 471 | 472 | } |
| 472 | 473 | else |
| 473 | 474 | { |
| r1877 | r1878 | |
|---|---|---|
| 26 | 26 | |
| 27 | 27 | struct acia6850_interface |
| 28 | 28 | { |
| 29 | read8_handler in_status_func; | |
| 30 | read8_handler in_recv_func; | |
| 31 | write8_handler out_status_func; | |
| 32 | write8_handler out_tran_func; | |
| 29 | read8_machine_func in_status_func; | |
| 30 | read8_machine_func in_recv_func; | |
| 31 | write8_machine_func out_status_func; | |
| 32 | write8_machine_func out_tran_func; | |
| 33 | 33 | }; |
| 34 | 34 | |
| 35 | 35 | void acia6850_unconfig(void); |
| r1877 | r1878 | |
|---|---|---|
| 161 | 161 | /* #define V_BANK*/ /* Display bank switching debug information */ |
| 162 | 162 | #endif |
| 163 | 163 | |
| 164 | static void gb_init_regs( | |
| 164 | static void gb_init_regs(running_machine *machine) { | |
| 165 | 165 | /* Initialize the registers */ |
| 166 | 166 | SIODATA = 0x00; |
| 167 | 167 | SIOCONT = 0x7E; |
| 168 | 168 | |
| 169 | gb_io_w( 0x05, 0x00 ); /* TIMECNT */ | |
| 170 | gb_io_w( 0x06, 0x00 ); /* TIMEMOD */ | |
| 169 | gb_io_w( machine, 0x05, 0x00 ); /* TIMECNT */ | |
| 170 | gb_io_w( machine, 0x06, 0x00 ); /* TIMEMOD */ | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | static void gb_rom16_0000( UINT8 *addr ) { |
| r1877 | r1878 | |
| 188 | 188 | memory_set_bankptr( 4, addr ); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | static void gb_init( | |
| 191 | static void gb_init(running_machine *machine) { | |
| 192 | 192 | /* Initialize the memory banks */ |
| 193 | 193 | MBC1Mode = 0; |
| 194 | 194 | MBC3RTCBank = 0; |
| r1877 | r1878 | |
| 264 | 264 | break; |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | gb_sound_w( 0x16, 0x00 ); /* Initialize sound hardware */ | |
| 267 | gb_sound_w( machine, 0x16, 0x00 ); /* Initialize sound hardware */ | |
| 268 | 268 | |
| 269 | 269 | /* Allocate the serial timer, and disable it */ |
| 270 | 270 | gb_serial_timer = timer_alloc( gb_serial_timer_proc , NULL); |
| r1877 | r1878 | |
| 282 | 282 | |
| 283 | 283 | MACHINE_RESET( gb ) |
| 284 | 284 | { |
| 285 | gb_init(); | |
| 285 | gb_init(machine); | |
| 286 | 286 | |
| 287 | gb_video_init( GB_VIDEO_DMG ); | |
| 287 | gb_video_init( machine, GB_VIDEO_DMG ); | |
| 288 | 288 | |
| 289 | 289 | /* Enable BIOS rom */ |
| 290 | 290 | memory_set_bankptr(5, memory_region(REGION_CPU1) ); |
| r1877 | r1878 | |
| 295 | 295 | |
| 296 | 296 | MACHINE_RESET( sgb ) |
| 297 | 297 | { |
| 298 | gb_init(); | |
| 298 | gb_init(machine); | |
| 299 | 299 | |
| 300 | gb_video_init( GB_VIDEO_SGB ); | |
| 300 | gb_video_init( machine, GB_VIDEO_SGB ); | |
| 301 | 301 | |
| 302 | gb_init_regs(); | |
| 302 | gb_init_regs(machine); | |
| 303 | 303 | |
| 304 | 304 | memory_set_bankptr(5, ROMMap[ROMBank00] ? ROMMap[ROMBank00] : gb_dummy_rom_bank ); |
| 305 | 305 | memory_set_bankptr(10, ROMMap[ROMBank00] ? ROMMap[ROMBank00] + 0x0100 : gb_dummy_rom_bank + 0x0100 ); |
| r1877 | r1878 | |
| 308 | 308 | memset( sgb_tile_data, 0, 0x2000 ); |
| 309 | 309 | |
| 310 | 310 | /* Initialize the Sound Registers */ |
| 311 | gb_sound_w(0x16,0xF0); /* F0 for SGB */ | |
| 312 | gb_sound_w(0x15,0xF3); | |
| 313 | gb_sound_w(0x14,0x77); | |
| 311 | gb_sound_w(machine, 0x16,0xF0); /* F0 for SGB */ | |
| 312 | gb_sound_w(machine, 0x15,0xF3); | |
| 313 | gb_sound_w(machine, 0x14,0x77); | |
| 314 | 314 | |
| 315 | 315 | sgb_window_mask = 0; |
| 316 | 316 | memset( sgb_pal_map, 0, 20*18 ); |
| r1877 | r1878 | |
| 331 | 331 | |
| 332 | 332 | MACHINE_RESET( gbpocket ) |
| 333 | 333 | { |
| 334 | gb_init(); | |
| 334 | gb_init(machine); | |
| 335 | 335 | |
| 336 | gb_video_init( GB_VIDEO_MGB ); | |
| 336 | gb_video_init( machine, GB_VIDEO_MGB ); | |
| 337 | 337 | |
| 338 | gb_init_regs(); | |
| 338 | gb_init_regs(machine); | |
| 339 | 339 | |
| 340 | 340 | /* Initialize the Sound registers */ |
| 341 | gb_sound_w(0x16,0x80); | |
| 342 | gb_sound_w(0x15,0xF3); | |
| 343 | gb_sound_w(0x14,0x77); | |
| 341 | gb_sound_w(machine, 0x16,0x80); | |
| 342 | gb_sound_w(machine, 0x15,0xF3); | |
| 343 | gb_sound_w(machine, 0x14,0x77); | |
| 344 | 344 | |
| 345 | 345 | /* Enable BIOS rom if we have one */ |
| 346 | 346 | memory_set_bankptr(5, ROMMap[ROMBank00] ? ROMMap[ROMBank00] : gb_dummy_rom_bank ); |
| r1877 | r1878 | |
| 353 | 353 | { |
| 354 | 354 | int ii; |
| 355 | 355 | |
| 356 | gb_init(); | |
| 356 | gb_init(machine); | |
| 357 | 357 | |
| 358 | gb_video_init( GB_VIDEO_CGB ); | |
| 358 | gb_video_init( machine, GB_VIDEO_CGB ); | |
| 359 | 359 | |
| 360 | gb_init_regs(); | |
| 360 | gb_init_regs(machine); | |
| 361 | 361 | |
| 362 | 362 | /* Initialize the Sound registers */ |
| 363 | gb_sound_w(0x16, 0x80); | |
| 364 | gb_sound_w(0x15, 0xF3); | |
| 365 | gb_sound_w(0x14, 0x77); | |
| 363 | gb_sound_w(machine, 0x16, 0x80); | |
| 364 | gb_sound_w(machine, 0x15, 0xF3); | |
| 365 | gb_sound_w(machine, 0x14, 0x77); | |
| 366 | 366 | |
| 367 | 367 | memory_set_bankptr(5, ROMMap[ROMBank00] ? ROMMap[ROMBank00] : gb_dummy_rom_bank ); |
| 368 | 368 | memory_set_bankptr(10, ROMMap[ROMBank00] ? ROMMap[ROMBank00] + 0x0100 : gb_dummy_rom_bank + 0x0100); |
| r1877 | r1878 | |
| 372 | 372 | GBC_RAMMap[ii] = mess_ram + CGB_START_RAM_BANKS + ii * 0x1000; |
| 373 | 373 | memset (GBC_RAMMap[ii], 0, 0x1000); |
| 374 | 374 | } |
| 375 | gbc_io2_w( 0x30, 0x00 ); | |
| 375 | gbc_io2_w( machine, 0x30, 0x00 ); | |
| 376 | 376 | |
| 377 | 377 | /* Initialise registers */ |
| 378 | gb_io_w( 0x6C, 0xFE ); | |
| 379 | gb_io_w( 0x72, 0x00 ); | |
| 380 | gb_io_w( 0x73, 0x00 ); | |
| 381 | gb_io_w( 0x74, 0x8F ); | |
| 382 | gb_io_w( 0x75, 0x00 ); | |
| 383 | gb_io_w( 0x76, 0x00 ); | |
| 384 | gb_io_w( 0x77, 0x00 ); | |
| 378 | gb_io_w( machine, 0x6C, 0xFE ); | |
| 379 | gb_io_w( machine, 0x72, 0x00 ); | |
| 380 | gb_io_w( machine, 0x73, 0x00 ); | |
| 381 | gb_io_w( machine, 0x74, 0x8F ); | |
| 382 | gb_io_w( machine, 0x75, 0x00 ); | |
| 383 | gb_io_w( machine, 0x76, 0x00 ); | |
| 384 | gb_io_w( machine, 0x77, 0x00 ); | |
| 385 | 385 | |
| 386 | 386 | /* Are we in colour or mono mode? */ |
| 387 | 387 | if( gb_cart[0x143] == 0x80 || gb_cart[0x143] == 0xC0 ) |
| r1877 | r1878 | |
| 823 | 823 | /* disable BIOS ROM */ |
| 824 | 824 | memory_set_bankptr(5, ROMMap[ROMBank00]); |
| 825 | 825 | } else { |
| 826 | gb_video_w( offset, data ); | |
| 826 | gb_video_w( machine, offset, data ); | |
| 827 | 827 | } |
| 828 | 828 | } |
| 829 | 829 | |
| r1877 | r1878 | |
| 1340 | 1340 | return; |
| 1341 | 1341 | default: |
| 1342 | 1342 | /* we didn't handle the write, so pass it to the GB handler */ |
| 1343 | gb_io_w( offset, data ); | |
| 1343 | gb_io_w( machine, offset, data ); | |
| 1344 | 1344 | return; |
| 1345 | 1345 | } |
| 1346 | 1346 | |
| r1877 | r1878 | |
| 1881 | 1881 | default: |
| 1882 | 1882 | break; |
| 1883 | 1883 | } |
| 1884 | gbc_video_w( offset, data ); | |
| 1884 | gbc_video_w( machine, offset, data ); | |
| 1885 | 1885 | } |
| 1886 | 1886 | |
| 1887 | 1887 | READ8_HANDLER( gbc_io2_r ) { |
| r1877 | r1878 | |
| 1893 | 1893 | default: |
| 1894 | 1894 | break; |
| 1895 | 1895 | } |
| 1896 | return gbc_video_r( offset ); | |
| 1896 | return gbc_video_r( machine, offset ); | |
| 1897 | 1897 | } |
| 1898 | 1898 | |
| 1899 | 1899 | /**************************************************************************** |
| r1877 | r1878 | |
| 1905 | 1905 | MACHINE_RESET( megaduck ) |
| 1906 | 1906 | { |
| 1907 | 1907 | /* We may have to add some more stuff here, if not then it can be merged back into gb */ |
| 1908 | gb_init(); | |
| 1908 | gb_init(machine); | |
| 1909 | 1909 | |
| 1910 | gb_video_init( GB_VIDEO_DMG ); | |
| 1910 | gb_video_init( machine, GB_VIDEO_DMG ); | |
| 1911 | 1911 | } |
| 1912 | 1912 | |
| 1913 | 1913 | /* |
| r1877 | r1878 | |
| 1953 | 1953 | if ( (offset & 0x0C) && ((offset & 0x0C) ^ 0x0C) ) { |
| 1954 | 1954 | offset ^= 0x0C; |
| 1955 | 1955 | } |
| 1956 | data = gb_video_r( offset ); | |
| 1956 | data = gb_video_r( machine, offset ); | |
| 1957 | 1957 | if ( offset ) |
| 1958 | 1958 | return data; |
| 1959 | 1959 | return BITSWAP8(data,7,0,5,4,6,3,2,1); |
| r1877 | r1878 | |
| 1967 | 1967 | if ( (offset & 0x0C) && ((offset & 0x0C) ^ 0x0C) ) { |
| 1968 | 1968 | offset ^= 0x0C; |
| 1969 | 1969 | } |
| 1970 | gb_video_w(offset, data ); | |
| 1970 | gb_video_w(machine, offset, data ); | |
| 1971 | 1971 | } |
| 1972 | 1972 | |
| 1973 | 1973 | /* Map megaduck audio offset to gameboy audio offsets */ |
| r1877 | r1878 | |
| 1976 | 1976 | |
| 1977 | 1977 | WRITE8_HANDLER( megaduck_sound_w1 ) |
| 1978 | 1978 | { |
| 1979 | gb_sound_w( megaduck_sound_offsets[offset], data ); | |
| 1979 | gb_sound_w( machine, megaduck_sound_offsets[offset], data ); | |
| 1980 | 1980 | } |
| 1981 | 1981 | |
| 1982 | 1982 | READ8_HANDLER( megaduck_sound_r1 ) |
| 1983 | 1983 | { |
| 1984 | return gb_sound_r( megaduck_sound_offsets[offset] ); | |
| 1984 | return gb_sound_r( machine, megaduck_sound_offsets[offset] ); | |
| 1985 | 1985 | } |
| 1986 | 1986 | |
| 1987 | 1987 | WRITE8_HANDLER( megaduck_sound_w2 ) |
| 1988 | 1988 | { |
| 1989 | 1989 | switch(offset) { |
| 1990 | case 0x00: gb_sound_w( 0x10, data ); break; | |
| 1991 | case 0x01: gb_sound_w( 0x12, data ); break; | |
| 1992 | case 0x02: gb_sound_w( 0x11, data ); break; | |
| 1993 | case 0x03: gb_sound_w( 0x13, data ); break; | |
| 1994 | case 0x04: gb_sound_w( 0x14, data ); break; | |
| 1995 | case 0x05: gb_sound_w( 0x16, data ); break; | |
| 1996 | case 0x06: gb_sound_w( 0x15, data ); break; | |
| 1990 | case 0x00: gb_sound_w( machine, 0x10, data ); break; | |
| 1991 | case 0x01: gb_sound_w( machine, 0x12, data ); break; | |
| 1992 | case 0x02: gb_sound_w( machine, 0x11, data ); break; | |
| 1993 | case 0x03: gb_sound_w( machine, 0x13, data ); break; | |
| 1994 | case 0x04: gb_sound_w( machine, 0x14, data ); break; | |
| 1995 | case 0x05: gb_sound_w( machine, 0x16, data ); break; | |
| 1996 | case 0x06: gb_sound_w( machine, 0x15, data ); break; | |
| 1997 | 1997 | case 0x07: |
| 1998 | 1998 | case 0x08: |
| 1999 | 1999 | case 0x09: |
| r1877 | r1878 | |
| 2009 | 2009 | |
| 2010 | 2010 | READ8_HANDLER( megaduck_sound_r2 ) |
| 2011 | 2011 | { |
| 2012 | return gb_sound_r(0x10 + megaduck_sound_offsets[offset]); | |
| 2012 | return gb_sound_r(machine, 0x10 + megaduck_sound_offsets[offset]); | |
| 2013 | 2013 | } |
| 2014 | 2014 | |
| 2015 | 2015 | WRITE8_HANDLER( megaduck_rom_bank_select_type1 ) |
| r1877 | r1878 | |
|---|---|---|
| 76 | 76 | |
| 77 | 77 | static struct |
| 78 | 78 | { |
| 79 | read8_handler reg_read; | |
| 80 | write8_handler reg_write; | |
| 81 | read8_handler rom_read; | |
| 82 | write8_handler rom_write; | |
| 79 | read8_machine_func reg_read; | |
| 80 | write8_machine_func reg_write; | |
| 81 | read8_machine_func rom_read; | |
| 82 | write8_machine_func rom_write; | |
| 83 | 83 | } expansion_slots[4]; |
| 84 | 84 | |
| 85 | 85 | static void concept_fdc_init(int slot); |
| r1877 | r1878 | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | static void install_expansion_slot(int slot, |
| 114 | read8_handler reg_read, write8_handler reg_write, | |
| 115 | read8_handler rom_read, write8_handler rom_write) | |
| 114 | read8_machine_func reg_read, write8_machine_func reg_write, | |
| 115 | read8_machine_func rom_read, write8_machine_func rom_write) | |
| 116 | 116 | { |
| 117 | 117 | expansion_slots[slot].reg_read = reg_read; |
| 118 | 118 | expansion_slots[slot].reg_write = reg_write; |
| r1877 | r1878 | |
| 301 | 301 | { |
| 302 | 302 | int slot = ((offset >> 4) & 7) - 1; |
| 303 | 303 | if (expansion_slots[slot].reg_read) |
| 304 | return expansion_slots[slot].reg_read(offset & 0xf); | |
| 304 | return expansion_slots[slot].reg_read(machine, offset & 0xf); | |
| 305 | 305 | } |
| 306 | 306 | break; |
| 307 | 307 | |
| r1877 | r1878 | |
| 324 | 324 | int slot = ((offset >> 8) & 7) - 1; |
| 325 | 325 | LOG(("concept_io_r: Slot ROM memory accessed for slot %d at address 0x03%4.4x\n", slot, offset << 1)); |
| 326 | 326 | if (expansion_slots[slot].rom_read) |
| 327 | return expansion_slots[slot].rom_read(offset & 0xff); | |
| 327 | return expansion_slots[slot].rom_read(machine, offset & 0xff); | |
| 328 | 328 | } |
| 329 | 329 | break; |
| 330 | 330 | |
| r1877 | r1878 | |
| 440 | 440 | LOG(("concept_io_w: Slot I/O register written for slot %d at address 0x03%4.4x, data: 0x%4.4x\n", |
| 441 | 441 | slot, offset << 1, data)); |
| 442 | 442 | if (expansion_slots[slot].reg_write) |
| 443 | expansion_slots[slot].reg_write(offset & 0xf, data); | |
| 443 | expansion_slots[slot].reg_write(machine, offset & 0xf, data); | |
| 444 | 444 | } |
| 445 | 445 | break; |
| 446 | 446 | |
| r1877 | r1878 | |
| 463 | 463 | int slot = ((offset >> 8) & 7) - 1; |
| 464 | 464 | LOG(("concept_io_w: Slot ROM memory written to for slot %d at address 0x03%4.4x, data: 0x%4.4x\n", slot, offset << 1, data)); |
| 465 | 465 | if (expansion_slots[slot].rom_write) |
| 466 | expansion_slots[slot].rom_write(offset & 0xff, data); | |
| 466 | expansion_slots[slot].rom_write(machine, offset & 0xff, data); | |
| 467 | 467 | } |
| 468 | 468 | break; |
| 469 | 469 | |
| r1877 | r1878 | |
| 614 | 614 | |
| 615 | 615 | case 8: |
| 616 | 616 | /* FDC STATUS REG */ |
| 617 | return wd17xx_status_r(offset); | |
| 617 | return wd17xx_status_r(machine, offset); | |
| 618 | 618 | break; |
| 619 | 619 | |
| 620 | 620 | case 9: |
| 621 | 621 | /* FDC TRACK REG */ |
| 622 | return wd17xx_track_r(offset); | |
| 622 | return wd17xx_track_r(machine, offset); | |
| 623 | 623 | break; |
| 624 | 624 | |
| 625 | 625 | case 10: |
| 626 | 626 | /* FDC SECTOR REG */ |
| 627 | return wd17xx_sector_r(offset); | |
| 627 | return wd17xx_sector_r(machine, offset); | |
| 628 | 628 | break; |
| 629 | 629 | |
| 630 | 630 | case 11: |
| 631 | 631 | /* FDC DATA REG */ |
| 632 | return wd17xx_data_r(offset); | |
| 632 | return wd17xx_data_r(machine, offset); | |
| 633 | 633 | break; |
| 634 | 634 | } |
| 635 | 635 | |
| r1877 | r1878 | |
| 658 | 658 | |
| 659 | 659 | case 8: |
| 660 | 660 | /* FDC COMMAMD REG */ |
| 661 | wd17xx_command_w(offset, data); | |
| 661 | wd17xx_command_w(machine, offset, data); | |
| 662 | 662 | break; |
| 663 | 663 | |
| 664 | 664 | case 9: |
| 665 | 665 | /* FDC TRACK REG */ |
| 666 | wd17xx_track_w(offset, data); | |
| 666 | wd17xx_track_w(machine, offset, data); | |
| 667 | 667 | break; |
| 668 | 668 | |
| 669 | 669 | case 10: |
| 670 | 670 | /* FDC SECTOR REG */ |
| 671 | wd17xx_sector_w(offset, data); | |
| 671 | wd17xx_sector_w(machine, offset, data); | |
| 672 | 672 | break; |
| 673 | 673 | |
| 674 | 674 | case 11: |
| 675 | 675 | /* FDC DATA REG */ |
| 676 | wd17xx_data_w(offset, data); | |
| 676 | wd17xx_data_w(machine, offset, data); | |
| 677 | 677 | break; |
| 678 | 678 | } |
| 679 | 679 | } |
| r1877 | r1878 | |
| 713 | 713 | { |
| 714 | 714 | case 0: |
| 715 | 715 | /* HDC Data Register */ |
| 716 | return corvus_hdc_data_r(offset); | |
| 716 | return corvus_hdc_data_r(machine, offset); | |
| 717 | 717 | break; |
| 718 | 718 | |
| 719 | 719 | case 1: |
| 720 | 720 | /* HDC Status Register */ |
| 721 | return corvus_hdc_status_r(offset); | |
| 721 | return corvus_hdc_status_r(machine, offset); | |
| 722 | 722 | break; |
| 723 | 723 | } |
| 724 | 724 | |
| r1877 | r1878 | |
| 734 | 734 | { |
| 735 | 735 | case 0: |
| 736 | 736 | /* HDC Data Register */ |
| 737 | corvus_hdc_data_w(offset, data); | |
| 737 | corvus_hdc_data_w(machine, offset, data); | |
| 738 | 738 | break; |
| 739 | 739 | } |
| 740 | 740 | } |
| r1877 | r1878 | |
|---|---|---|
| 693 | 693 | switch (which) |
| 694 | 694 | { |
| 695 | 695 | case 0: /* key row 1 */ |
| 696 | m6530[1].dria = input | |
| 696 | m6530[1].dria = readinput | |
| 697 | 697 | logerror("read keybd(%d): %c%c%c%c%c%c%c\n", |
| 698 | 698 | which, |
| 699 | 699 | (m6530[1].dria & 0x40) ? '.' : '0', |
| r1877 | r1878 | |
| 705 | 705 | (m6530[1].dria & 0x01) ? '.' : '6'); |
| 706 | 706 | break; |
| 707 | 707 | case 1: /* key row 2 */ |
| 708 | m6530[1].dria = input | |
| 708 | m6530[1].dria = readinput | |
| 709 | 709 | logerror("read keybd(%d): %c%c%c%c%c%c%c\n", |
| 710 | 710 | which, |
| 711 | 711 | (m6530[1].dria & 0x40) ? '.' : '7', |
| r1877 | r1878 | |
| 717 | 717 | (m6530[1].dria & 0x01) ? '.' : 'D'); |
| 718 | 718 | break; |
| 719 | 719 | case 2: /* key row 3 */ |
| 720 | m6530[1].dria = input | |
| 720 | m6530[1].dria = readinput | |
| 721 | 721 | logerror("read keybd(%d): %c%c%c%c%c%c%c\n", |
| 722 | 722 | which, |
| 723 | 723 | (m6530[1].dria & 0x40) ? '.' : 'E', |
| r1877 | r1878 | |
|---|---|---|
| 420 | 420 | /* prototypes */ |
| 421 | 421 | static void fdc_callback(wd17xx_state_t event, void *param); |
| 422 | 422 | static TIMER_CALLBACK(motor_on_timer_callback); |
| 423 | static int fdc_cru_r(int offset); | |
| 424 | static void fdc_cru_w(int offset, int data); | |
| 423 | static int fdc_cru_r(running_machine *machine, int offset); | |
| 424 | static void fdc_cru_w(running_machine *machine, int offset, int data); | |
| 425 | 425 | static READ8_HANDLER(fdc_mem_r); |
| 426 | 426 | static WRITE8_HANDLER(fdc_mem_w); |
| 427 | 427 | |
| r1877 | r1878 | |
| 466 | 466 | bit 6: always 1 |
| 467 | 467 | bit 7: selected side |
| 468 | 468 | */ |
| 469 | static int fdc_cru_r(int offset) | |
| 469 | static int fdc_cru_r(running_machine *machine, int offset) | |
| 470 | 470 | { |
| 471 | 471 | int reply; |
| 472 | 472 | |
| r1877 | r1878 | |
| 493 | 493 | /* |
| 494 | 494 | Write disk CRU interface |
| 495 | 495 | */ |
| 496 | static void fdc_cru_w(int offset, int data) | |
| 496 | static void fdc_cru_w(running_machine *machine, int offset, int data) | |
| 497 | 497 | { |
| 498 | 498 | switch (offset) |
| 499 | 499 | { |
| r1877 | r1878 | |
| 576 | 576 | switch (offset) |
| 577 | 577 | { |
| 578 | 578 | case 0x1FF0: /* Status register */ |
| 579 | return (wd17xx_status_r(offset) ^ 0xFF); | |
| 579 | return (wd17xx_status_r(machine, offset) ^ 0xFF); | |
| 580 | 580 | break; |
| 581 | 581 | case 0x1FF2: /* Track register */ |
| 582 | return wd17xx_track_r(offset) ^ 0xFF; | |
| 582 | return wd17xx_track_r(machine, offset) ^ 0xFF; | |
| 583 | 583 | break; |
| 584 | 584 | case 0x1FF4: /* Sector register */ |
| 585 | return wd17xx_sector_r(offset) ^ 0xFF; | |
| 585 | return wd17xx_sector_r(machine, offset) ^ 0xFF; | |
| 586 | 586 | break; |
| 587 | 587 | case 0x1FF6: /* Data register */ |
| 588 | return wd17xx_data_r(offset) ^ 0xFF; | |
| 588 | return wd17xx_data_r(machine, offset) ^ 0xFF; | |
| 589 | 589 | break; |
| 590 | 590 | default: /* DSR ROM */ |
| 591 | 591 | return ti99_disk_DSR[offset]; |
| r1877 | r1878 | |
| 603 | 603 | switch (offset) |
| 604 | 604 | { |
| 605 | 605 | case 0x1FF8: /* Command register */ |
| 606 | wd17xx_command_w(offset, data); | |
| 606 | wd17xx_command_w(machine, offset, data); | |
| 607 | 607 | break; |
| 608 | 608 | case 0x1FFA: /* Track register */ |
| 609 | wd17xx_track_w(offset, data); | |
| 609 | wd17xx_track_w(machine, offset, data); | |
| 610 | 610 | break; |
| 611 | 611 | case 0x1FFC: /* Sector register */ |
| 612 | wd17xx_sector_w(offset, data); | |
| 612 | wd17xx_sector_w(machine, offset, data); | |
| 613 | 613 | break; |
| 614 | 614 | case 0x1FFE: /* Data register */ |
| 615 | wd17xx_data_w(offset, data); | |
| 615 | wd17xx_data_w(machine, offset, data); | |
| 616 | 616 | break; |
| 617 | 617 | } |
| 618 | 618 | } |
| r1877 | r1878 | |
| 632 | 632 | */ |
| 633 | 633 | |
| 634 | 634 | /* prototypes */ |
| 635 | static int ccfdc_cru_r(int offset); | |
| 636 | static void ccfdc_cru_w(int offset, int data); | |
| 635 | static int ccfdc_cru_r(running_machine *machine, int offset); | |
| 636 | static void ccfdc_cru_w(running_machine *machine, int offset, int data); | |
| 637 | 637 | static READ8_HANDLER(ccfdc_mem_r); |
| 638 | 638 | static WRITE8_HANDLER(ccfdc_mem_w); |
| 639 | 639 | |
| r1877 | r1878 | |
| 834 | 834 | */ |
| 835 | 835 | |
| 836 | 836 | /* prototypes */ |
| 837 | static int bwg_cru_r(int offset); | |
| 838 | static void bwg_cru_w(int offset, int data); | |
| 839 | static READ8_HANDLER(bwg_mem_r); | |
| 837 | static int bwg_cru_r(running_machine *machine, int offset); | |
| 838 | static void bwg_cru_w(running_machine *machine, int offset, int data); | |
| 839 | static READ8_HANDLER(bwg_mem_r); | |
| 840 | 840 | static WRITE8_HANDLER(bwg_mem_w); |
| 841 | 841 | |
| 842 | 842 | static const ti99_peb_card_handlers_t bwg_handlers = |
| r1877 | r1878 | |
| 886 | 886 | bit 1-3: drive n active |
| 887 | 887 | bit 4-7: dip switches 1-4 |
| 888 | 888 | */ |
| 889 | static int bwg_cru_r(int offset) | |
| 889 | static int bwg_cru_r(running_machine *machine, int offset) | |
| 890 | 890 | { |
| 891 | 891 | int reply; |
| 892 | 892 | |
| r1877 | r1878 | |
| 911 | 911 | /* |
| 912 | 912 | Write disk CRU interface |
| 913 | 913 | */ |
| 914 | static void bwg_cru_w(int offset, int data) | |
| 914 | static void bwg_cru_w(running_machine *machine, int offset, int data) | |
| 915 | 915 | { |
| 916 | 916 | switch (offset) |
| 917 | 917 | { |
| r1877 | r1878 | |
| 1047 | 1047 | switch (offset) |
| 1048 | 1048 | { |
| 1049 | 1049 | case 0x1FF0: /* Status register */ |
| 1050 | reply = wd17xx_status_r(offset); | |
| 1050 | reply = wd17xx_status_r(machine, offset); | |
| 1051 | 1051 | break; |
| 1052 | 1052 | case 0x1FF2: /* Track register */ |
| 1053 | reply = wd17xx_track_r(offset); | |
| 1053 | reply = wd17xx_track_r(machine, offset); | |
| 1054 | 1054 | break; |
| 1055 | 1055 | case 0x1FF4: /* Sector register */ |
| 1056 | reply = wd17xx_sector_r(offset); | |
| 1056 | reply = wd17xx_sector_r(machine, offset); | |
| 1057 | 1057 | break; |
| 1058 | 1058 | case 0x1FF6: /* Data register */ |
| 1059 | reply = wd17xx_data_r(offset); | |
| 1059 | reply = wd17xx_data_r(machine, offset); | |
| 1060 | 1060 | break; |
| 1061 | 1061 | default: |
| 1062 | 1062 | reply = 0; |
| r1877 | r1878 | |
| 1091 | 1091 | switch (offset) |
| 1092 | 1092 | { |
| 1093 | 1093 | case 0x1FF8: /* Command register */ |
| 1094 | wd17xx_command_w(offset, data); | |
| 1094 | wd17xx_command_w(machine, offset, data); | |
| 1095 | 1095 | break; |
| 1096 | 1096 | case 0x1FFA: /* Track register */ |
| 1097 | wd17xx_track_w(offset, data); | |
| 1097 | wd17xx_track_w(machine, offset, data); | |
| 1098 | 1098 | break; |
| 1099 | 1099 | case 0x1FFC: /* Sector register */ |
| 1100 | wd17xx_sector_w(offset, data); | |
| 1100 | wd17xx_sector_w(machine, offset, data); | |
| 1101 | 1101 | break; |
| 1102 | 1102 | case 0x1FFE: /* Data register */ |
| 1103 | wd17xx_data_w(offset, data); | |
| 1103 | wd17xx_data_w(machine, offset, data); | |
| 1104 | 1104 | break; |
| 1105 | 1105 | } |
| 1106 | 1106 | } |
| r1877 | r1878 | |
| 1126 | 1126 | */ |
| 1127 | 1127 | |
| 1128 | 1128 | /* prototypes */ |
| 1129 | static int hfdc_cru_r(int offset); | |
| 1130 | static void hfdc_cru_w(int offset, int data); | |
| 1129 | static int hfdc_cru_r(running_machine *machine, int offset); | |
| 1130 | static void hfdc_cru_w(running_machine *machine, int offset, int data); | |
| 1131 | 1131 | static READ8_HANDLER(hfdc_mem_r); |
| 1132 | 1132 | static WRITE8_HANDLER(hfdc_mem_w); |
| 1133 | 1133 | |
| r1877 | r1878 | |
| 1254 | 1254 | /* |
| 1255 | 1255 | Read disk CRU interface |
| 1256 | 1256 | */ |
| 1257 | static int hfdc_cru_r(int offset) | |
| 1257 | static int hfdc_cru_r(running_machine *machine, int offset) | |
| 1258 | 1258 | { |
| 1259 | 1259 | int reply; |
| 1260 | 1260 | switch (offset) |
| r1877 | r1878 | |
| 1294 | 1294 | /* |
| 1295 | 1295 | Write disk CRU interface |
| 1296 | 1296 | */ |
| 1297 | static void hfdc_cru_w(int offset, int data) | |
| 1297 | static void hfdc_cru_w(running_machine *machine, int offset, int data) | |
| 1298 | 1298 | { |
| 1299 | 1299 | switch (offset) |
| 1300 | 1300 | { |
| r1877 | r1878 | |
|---|---|---|
| 426 | 426 | |
| 427 | 427 | READ8_HANDLER ( msx_psg_r ) |
| 428 | 428 | { |
| 429 | return AY8910_read_port_0_r (offset); | |
| 429 | return AY8910_read_port_0_r (machine, offset); | |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | WRITE8_HANDLER ( msx_psg_w ) |
| 433 | 433 | { |
| 434 | 434 | if (offset & 0x01) |
| 435 | AY8910_write_port_0_w (offset, data); | |
| 435 | AY8910_write_port_0_w (machine, offset, data); | |
| 436 | 436 | else |
| 437 | AY8910_control_port_0_w (offset, data); | |
| 437 | AY8910_control_port_0_w (machine, offset, data); | |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | static mess_image *cassette_device_image(void) |
| r1877 | r1878 | |
| 453 | 453 | |
| 454 | 454 | data = (cassette_input(cassette_device_image()) > 0.0038 ? 0x80 : 0); |
| 455 | 455 | |
| 456 | if ( (msx1.psg_b ^ readinputport | |
| 456 | if ( (msx1.psg_b ^ readinputport | |
| 457 | 457 | { |
| 458 | 458 | /* game port 2 */ |
| 459 | inp = input | |
| 459 | inp = readinput | |
| 460 | 460 | #if 0 |
| 461 | 461 | if ( !(inp & 0x80) ) |
| 462 | 462 | { |
| r1877 | r1878 | |
| 481 | 481 | else |
| 482 | 482 | { |
| 483 | 483 | /* game port 1 */ |
| 484 | inp = input | |
| 484 | inp = readinput | |
| 485 | 485 | #if 0 |
| 486 | 486 | if ( !(inp & 0x80) ) |
| 487 | 487 | { |
| r1877 | r1878 | |
| 573 | 573 | if (msx1.opll_active) { |
| 574 | 574 | |
| 575 | 575 | if (offset == 1) { |
| 576 | YM2413_data_port_0_w (0, data); | |
| 576 | YM2413_data_port_0_w (machine, 0, data); | |
| 577 | 577 | } |
| 578 | 578 | else { |
| 579 | YM2413_register_port_0_w (0, data); | |
| 579 | YM2413_register_port_0_w (machine, 0, data); | |
| 580 | 580 | } |
| 581 | 581 | } |
| 582 | 582 | } |
| r1877 | r1878 | |
| 592 | 592 | |
| 593 | 593 | WRITE8_HANDLER (msx_rtc_reg_w) |
| 594 | 594 | { |
| 595 | tc8521_w | |
| 595 | tc8521_w | |
| 596 | 596 | } |
| 597 | 597 | |
| 598 | 598 | READ8_HANDLER (msx_rtc_reg_r) |
| 599 | 599 | { |
| 600 | return tc8521_r | |
| 600 | return tc8521_r | |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | NVRAM_HANDLER( msx2 ) |
| r1877 | r1878 | |
| 728 | 728 | UINT8 result = 0xff; |
| 729 | 729 | int row, data; |
| 730 | 730 | |
| 731 | row = ppi8255_0_r | |
| 731 | row = ppi8255_0_r | |
| 732 | 732 | if (row <= 10) |
| 733 | 733 | { |
| 734 | 734 | data = readinputport (row/2); |
| r1877 | r1878 | |
| 962 | 962 | if (msx1.slot[2]->slot_type == SLOT_SUPERLOADRUNNER) { |
| 963 | 963 | msx1.slot[2]->map (msx1.state[2], 2); |
| 964 | 964 | } |
| 965 | msx_page0_w | |
| 965 | msx_page0_w | |
| 966 | 966 | } |
| 967 | 967 | |
| 968 | 968 | WRITE8_HANDLER (msx_page0_w) |
| r1877 | r1878 | |
| 1023 | 1023 | msx_memory_map_all (); |
| 1024 | 1024 | } |
| 1025 | 1025 | else { |
| 1026 | msx_page3_w | |
| 1026 | msx_page3_w | |
| 1027 | 1027 | } |
| 1028 | 1028 | } |
| 1029 | 1029 |
| r1877 | r1878 | |
|---|---|---|
| 89 | 89 | gamecom_dma.enabled = 0; |
| 90 | 90 | |
| 91 | 91 | memset( internal_registers, 0x00, sizeof(internal_registers) ); |
| 92 | gamecom_internal_w( SM8521_URTT, 0xFF ); | |
| 93 | gamecom_internal_w( SM8521_URTS, 0x42 ); | |
| 94 | gamecom_internal_w( SM8521_WDTC, 0x38 ); | |
| 92 | gamecom_internal_w( machine, SM8521_URTT, 0xFF ); | |
| 93 | gamecom_internal_w( machine, SM8521_URTS, 0x42 ); | |
| 94 | gamecom_internal_w( machine, SM8521_WDTC, 0x38 ); | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | static void gamecom_set_mmu( int mmu, UINT8 data ) { |
| r1877 | r1878 | |
|---|---|---|
| 93 | 93 | { |
| 94 | 94 | case 0x20: |
| 95 | 95 | if (i->intf->in_a_func) |
| 96 | val = i->intf->in_a_func(0); | |
| 96 | val = i->intf->in_a_func(Machine, 0); | |
| 97 | 97 | i->in_a = val; |
| 98 | 98 | break; |
| 99 | 99 | |
| 100 | 100 | case 0x21: |
| 101 | 101 | if (i->intf->in_b_func) |
| 102 | val = i->intf->in_b_func(0); | |
| 102 | val = i->intf->in_b_func(Machine, 0); | |
| 103 | 103 | i->in_b = val; |
| 104 | 104 | break; |
| 105 | 105 | |
| r1877 | r1878 | |
| 107 | 107 | if (offset < 0x08) |
| 108 | 108 | { |
| 109 | 109 | if (i->intf->in_a_func) |
| 110 | val = (i->intf->in_a_func(0) << (8 - offset)) & 0x80; | |
| 110 | val = (i->intf->in_a_func(Machine, 0) << (8 - offset)) & 0x80; | |
| 111 | 111 | i->in_a = val; |
| 112 | 112 | } |
| 113 | 113 | else |
| 114 | 114 | { |
| 115 | 115 | if (i->intf->in_a_func) |
| 116 | val = (i->intf->in_a_func(0) << (8 - (offset >> 4))) & 0x80; | |
| 116 | val = (i->intf->in_a_func(Machine, 0) << (8 - (offset >> 4))) & 0x80; | |
| 117 | 117 | i->in_b = val; |
| 118 | 118 | } |
| 119 | 119 | break; |
| r1877 | r1878 | |
| 133 | 133 | if (i->odra) |
| 134 | 134 | { |
| 135 | 135 | if (i->intf->out_a_func) |
| 136 | i->intf->out_a_func(0, (data & i->odra) | (i->odra ^ 0xff)); | |
| 136 | i->intf->out_a_func(Machine, 0, (data & i->odra) | (i->odra ^ 0xff)); | |
| 137 | 137 | else |
| 138 | 138 | logerror("INS8154 chip #%d (%08x): Write to port A but no write handler defined!\n", |
| 139 | 139 | which, safe_activecpu_get_pc()); |
| r1877 | r1878 | |
| 151 | 151 | if (i->odrb) |
| 152 | 152 | { |
| 153 | 153 | if (i->intf->out_b_func) |
| 154 | i->intf->out_b_func(0, (data & i->odrb) | (i->odrb ^ 0xff)); | |
| 154 | i->intf->out_b_func(Machine, 0, (data & i->odrb) | (i->odrb ^ 0xff)); | |
| 155 | 155 | else |
| 156 | 156 | logerror("INS8154 chip #%d (%08x): Write to port B but no write handler defined!\n", |
| 157 | 157 | which, safe_activecpu_get_pc()); |
| r1877 | r1878 | |
|---|---|---|
| 90 | 90 | videoram = auto_malloc(videoram_size); |
| 91 | 91 | colorram = auto_malloc(0x800); |
| 92 | 92 | |
| 93 | mz700_bank_w(4, 0); | |
| 93 | mz700_bank_w(machine, 4, 0); | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
| r1877 | r1878 | |
| 233 | 233 | break; |
| 234 | 234 | |
| 235 | 235 | case 4: case 5: case 6: case 7: |
| 236 | data = pit8253_0_r(offset & 3); | |
| 236 | data = pit8253_0_r(machine, offset & 3); | |
| 237 | 237 | break; |
| 238 | 238 | |
| 239 | 239 | case 8: |
| r1877 | r1878 | |
| 258 | 258 | |
| 259 | 259 | /* the next four ports are connected to a 8253 PIT */ |
| 260 | 260 | case 4: case 5: case 6: case 7: |
| 261 | pit8253_0_w(offset & 3, data); | |
| 261 | pit8253_0_w(machine, offset & 3, data); | |
| 262 | 262 | break; |
| 263 | 263 | |
| 264 | 264 | case 8: |
| 265 | 265 | LOG(1,"mz700_e008_w",("%02X\n", data)); |
| 266 | pit8253_0_gate_w(0, data & 1); | |
| 266 | pit8253_0_gate_w(machine, 0, data & 1); | |
| 267 | 267 | break; |
| 268 | 268 | } |
| 269 | 269 | } |
| r1877 | r1878 | |
| 477 | 477 | case 6: /* 0000-0FFF no chg D000-FFFF unlocked */ |
| 478 | 478 | LOG(1,"mz700_bank_w",("6: D000-FFFF unlocked\n")); |
| 479 | 479 | if (mz700_locked == 1) |
| 480 | mz700_bank_w(vio_lock, 0); /* old config for D000-DFFF */ | |
| 480 | mz700_bank_w(machine, vio_lock, 0); /* old config for D000-DFFF */ | |
| 481 | 481 | break; |
| 482 | 482 | } |
| 483 | 483 | } |
| r1877 | r1878 | |
| 515 | 515 | break; |
| 516 | 516 | |
| 517 | 517 | case 4: case 5: case 6: case 7: |
| 518 | data = pit8253_0_r(offset & 3); | |
| 518 | data = pit8253_0_r(machine, offset & 3); | |
| 519 | 519 | break; |
| 520 | 520 | |
| 521 | 521 | default: |
| r1877 | r1878 | |
| 637 | 637 | WRITE8_HANDLER( mz800_mmio_w ) |
| 638 | 638 | { |
| 639 | 639 | /* just wrap to the mz700 handler */ |
| 640 | mz700_mmio_w(offset,data); | |
| 640 | mz700_mmio_w(machine, offset,data); | |
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | /* port E0-E9 */ |
| r1877 | r1878 | |
| 705 | 705 | case 6: /* 0000-0FFF no chg D000-FFFF unlocked */ |
| 706 | 706 | LOG(1,"mz800_bank_w",("6: D000-FFFF unlocked\n")); |
| 707 | 707 | if (mz800_locked == 1) |
| 708 | mz800_bank_w(vio_lock, 0); /* old config for D000-DFFF */ | |
| 708 | mz800_bank_w(machine, vio_lock, 0); /* old config for D000-DFFF */ | |
| 709 | 709 | break; |
| 710 | 710 | |
| 711 | 711 | case 8: /* set MZ700 enable bit 7 ? */ |
| r1877 | r1878 | |
| 776 | 776 | mem = memory_region(REGION_USER1); |
| 777 | 777 | memset(&mem[0x00000], 0xff, 0x10000); |
| 778 | 778 | |
| 779 | mz800_display_mode_w(0,0x08); /* set MZ700 mode */ | |
| 780 | mz800_bank_r(1); | |
| 781 | mz800_bank_w(4, 0); | |
| 779 | mz800_display_mode_w(machine, 0, 0x08); /* set MZ700 mode */ | |
| 780 | mz800_bank_r(machine, 1); | |
| 781 | mz800_bank_w(machine, 4, 0); | |
| 782 | 782 | } |
| 783 | 783 | |
| 784 | 784 |
| r1877 | r1878 | |
|---|---|---|
| 15 | 15 | typedef struct _ins8154_interface ins8154_interface; |
| 16 | 16 | struct _ins8154_interface |
| 17 | 17 | { |
| 18 | read8_handler in_a_func; | |
| 19 | read8_handler in_b_func; | |
| 20 | write8_handler out_a_func; | |
| 21 | write8_handler out_b_func; | |
| 18 | read8_machine_func in_a_func; | |
| 19 | read8_machine_func in_b_func; | |
| 20 | write8_machine_func out_a_func; | |
| 21 | write8_machine_func out_b_func; | |
| 22 | 22 | void (*irq_func)(int state); |
| 23 | 23 | }; |
| 24 | 24 |
| r1877 | r1878 | |
|---|---|---|
| 107 | 107 | *********************************************************************/ |
| 108 | 108 | void vectrex_configuration(void) |
| 109 | 109 | { |
| 110 | unsigned char cport = input | |
| 110 | unsigned char cport = readinput | |
| 111 | 111 | |
| 112 | 112 | /* Vectrex 'dipswitch' configuration */ |
| 113 | 113 | |
| r1877 | r1878 | |
| 184 | 184 | vectrex_beam_color = RGB_WHITE; |
| 185 | 185 | imager_colors[0]=imager_colors[1]=imager_colors[2]=imager_colors[3]=imager_colors[4]=imager_colors[5]=RGB_WHITE; |
| 186 | 186 | } |
| 187 | vectrex_lightpen_port = (input | |
| 187 | vectrex_lightpen_port = (readinput | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /********************************************************************* |
| r1877 | r1878 | |
| 208 | 208 | return vectrex_via_out[PORTB]; |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | ||
| 211 | ||
| 212 | 212 | { |
| 213 | 213 | if ((!(vectrex_via_out[PORTB] & 0x10)) && (vectrex_via_out[PORTB] & 0x08)) |
| 214 | 214 | /* BDIR inactive, we can read the PSG. BC1 has to be active. */ |
| 215 | 215 | { |
| 216 | vectrex_via_out[PORTA] = AY8910_read_port_0_r | |
| 216 | vectrex_via_out[PORTA] = AY8910_read_port_0_r | |
| 217 | 217 | & ~(vectrex_imager_pinlevel & 0x80); |
| 218 | 218 | vectrex_imager_pinlevel &= ~0x80; |
| 219 | 219 | } |
| 220 | 220 | return vectrex_via_out[PORTA]; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | ||
| 223 | ||
| 224 | 224 | { |
| 225 | return (vectrex_via_out[PORTB] & ~0x40) | ((input | |
| 225 | return (vectrex_via_out[PORTB] & ~0x40) | ((readinput | |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | /********************************************************************* |
| r1877 | r1878 | |
| 251 | 251 | timer_set (double_to_attotime(rtime * 0.50), NULL, 1, vectrex_imager_right_eye); |
| 252 | 252 | |
| 253 | 253 | /* Index hole sensor is connected to IO7 which triggers also CA1 of VIA */ |
| 254 | via_0_ca1_w (0, 1); | |
| 255 | via_0_ca1_w (0, 0); | |
| 254 | via_0_ca1_w(machine, 0, 1); | |
| 255 | via_0_ca1_w(machine, 0, 0); | |
| 256 | 256 | vectrex_imager_pinlevel |= 0x80; |
| 257 | 257 | } |
| 258 | 258 | } |
| r1877 | r1878 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | static const pia6821_interface pia = |
| 107 | 107 | { |
| 108 | NULL, // read8_handler in_a_func, | |
| 109 | NULL, // read8_handler in_b_func, | |
| 110 | NULL, // read8_handler in_ca1_func, | |
| 111 | NULL, // read8_handler in_cb1_func, | |
| 112 | NULL, // read8_handler in_ca2_func, | |
| 113 | NULL, // read8_handler in_cb2_func, | |
| 108 | NULL, // read8_machine_func in_a_func, | |
| 109 | NULL, // read8_machine_func in_b_func, | |
| 110 | NULL, // read8_machine_func in_ca1_func, | |
| 111 | NULL, // read8_machine_func in_cb1_func, | |
| 112 | NULL, // read8_machine_func in_ca2_func, | |
| 113 | NULL, // read8_machine_func in_cb2_func, | |
| 114 | 114 | aim65_pia_a_w, |
| 115 | 115 | aim65_pia_b_w, |
| 116 | NULL, // write8_handler out_ca2_func, | |
| 117 | NULL, // write8_handler out_cb2_func, | |
| 116 | NULL, // write8_machine_func out_ca2_func, | |
| 117 | NULL, // write8_machine_func out_cb2_func, | |
| 118 | 118 | NULL, // void (*irq_a_func)(int state), |
| 119 | 119 | NULL, // void (*irq_b_func)(int state), |
| 120 | 120 | }; |
| r1877 | r1878 | |
| 197 | 197 | |
| 198 | 198 | static const struct via6522_interface via0 = |
| 199 | 199 | { |
| 200 | 0, // read8_handler in_a_func; | |
| 201 | aim65_via0_b_r, // read8_handler in_b_func; | |
| 202 | 0, // read8_handler in_ca1_func; | |
| 203 | 0, // read8_handler in_cb1_func; | |
| 204 | 0, // read8_handler in_ca2_func; | |
| 205 | 0, // read8_handler in_cb2_func; | |
| 206 | aim65_via0_a_w, // write8_handler out_a_func; | |
| 207 | aim65_via0_b_w, // write8_handler out_b_func; | |
| 208 | 0, // write8_handler out_ca1_func; | |
| 209 | 0, // write8_handler out_cb1_func; | |
| 210 | 0, // write8_handler out_ca2_func; | |
| 211 | aim65_printer_on, // write8_handler out_cb2_func; | |
| 200 | 0, // read8_machine_func in_a_func; | |
| 201 | aim65_via0_b_r, // read8_machine_func in_b_func; | |
| 202 | 0, // read8_machine_func in_ca1_func; | |
| 203 | 0, // read8_machine_func in_cb1_func; | |
| 204 | 0, // read8_machine_func in_ca2_func; | |
| 205 | 0, // read8_machine_func in_cb2_func; | |
| 206 | aim65_via0_a_w, // write8_machine_func out_a_func; | |
| 207 | aim65_via0_b_w, // write8_machine_func out_b_func; | |
| 208 | 0, // write8_machine_func out_ca1_func; | |
| 209 | 0, // write8_machine_func out_cb1_func; | |
| 210 | 0, // write8_machine_func out_ca2_func; | |
| 211 | aim65_printer_on, // write8_machine_func out_cb2_func; | |
| 212 | 212 | aim65_via_irq_func // void (*irq_func)(int state); |
| 213 | 213 | }; |
| 214 | 214 | |
| r1877 | r1878 | |
| 242 | 242 | r6532_reset(0); |
| 243 | 243 | |
| 244 | 244 | via_config(0, &via0); |
| 245 | via_0_cb1_w(1, 1); | |
| 246 | via_0_ca1_w(1, 0); | |
| 245 | via_0_cb1_w(machine, 1, 1); | |
| 246 | via_0_ca1_w(machine, 1, 0); | |
| 247 | 247 | |
| 248 | 248 | via_config(1, &user_via); |
| 249 | 249 | via_reset(); |
| r1877 | r1878 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | int MMC1_extended; /* 0 = normal MMC1 cart, 1 = 512k MMC1, 2 = 1024k MMC1 */ |
| 51 | 51 | |
| 52 | write8_handler mmc_write_low; | |
| 53 | read8_handler mmc_read_low; | |
| 54 | write8_handler mmc_write_mid; | |
| 55 | read8_handler mmc_read_mid; | |
| 56 | write8_handler mmc_write; | |
| 52 | write8_machine_func mmc_write_low; | |
| 53 | read8_machine_func mmc_read_low; | |
| 54 | write8_machine_func mmc_write_mid; | |
| 55 | read8_machine_func mmc_read_mid; | |
| 56 | write8_machine_func mmc_write; | |
| 57 | 57 | /*void (*ppu_latch)(offs_t offset);*/ |
| 58 | 58 | |
| 59 | 59 | static int vrom_bank[16]; |
| r1877 | r1878 | |
| 106 | 106 | |
| 107 | 107 | WRITE8_HANDLER( nes_low_mapper_w ) |
| 108 | 108 | { |
| 109 | if (mmc_write_low) (*mmc_write_low)(offset, data); | |
| 109 | if (mmc_write_low) (*mmc_write_low)(machine, offset, data); | |
| 110 | 110 | else |
| 111 | 111 | { |
| 112 | 112 | logerror("Unimplemented LOW mapper write, offset: %04x, data: %02x\n", offset, data); |
| r1877 | r1878 | |
| 124 | 124 | READ8_HANDLER( nes_low_mapper_r ) |
| 125 | 125 | { |
| 126 | 126 | if (mmc_read_low) |
| 127 | return (*mmc_read_low)(offset); | |
| 127 | return (*mmc_read_low)(machine, offset); | |
| 128 | 128 | else |
| 129 | 129 | logerror("low mapper area read, addr: %04x\n", offset + 0x4100); |
| 130 | 130 | |
| r1877 | r1878 | |
| 133 | 133 | |
| 134 | 134 | WRITE8_HANDLER ( nes_mid_mapper_w ) |
| 135 | 135 | { |
| 136 | if (mmc_write_mid) (*mmc_write_mid)(offset, data); | |
| 136 | if (mmc_write_mid) (*mmc_write_mid)(machine, offset, data); | |
| 137 | 137 | else if (nes.mid_ram_enable) |
| 138 | 138 | battery_ram[offset] = data; |
| 139 | 139 | // else |
| r1877 | r1878 | |
| 159 | 159 | |
| 160 | 160 | WRITE8_HANDLER ( nes_mapper_w ) |
| 161 | 161 | { |
| 162 | if (mmc_write) (*mmc_write)(offset, data); | |
| 162 | if (mmc_write) (*mmc_write)(machine, offset, data); | |
| 163 | 163 | else |
| 164 | 164 | { |
| 165 | 165 | logerror("Unimplemented mapper write, offset: %04x, data: %02x\n", offset, data); |
| r1877 | r1878 | |
| 901 | 901 | /* Send $5000-$5015 to the sound chip */ |
| 902 | 902 | if ((offset >= 0xf00) && (offset <= 0xf15)) |
| 903 | 903 | { |
| 904 | NESPSG_0_w (offset & 0x1f, data); | |
| 904 | NESPSG_0_w (machine, offset & 0x1f, data); | |
| 905 | 905 | return; |
| 906 | 906 | } |
| 907 | 907 | |
| r1877 | r1878 | |
| 2959 | 2959 | break; |
| 2960 | 2960 | |
| 2961 | 2961 | default: |
| 2962 | mapper4_w( offset, data ); | |
| 2962 | mapper4_w( machine, offset, data ); | |
| 2963 | 2963 | break; |
| 2964 | 2964 | } |
| 2965 | 2965 | } |
| r1877 | r1878 | |
| 4419 | 4419 | if ( (offset & 0x6001) == 0x2000 ) |
| 4420 | 4420 | return; |
| 4421 | 4421 | |
| 4422 | mapper4_w( offset, data ); | |
| 4422 | mapper4_w( machine, offset, data ); | |
| 4423 | 4423 | } |
| 4424 | 4424 | |
| 4425 | 4425 | static WRITE8_HANDLER( mapper225_w ) |
| r1877 | r1878 | |
|---|---|---|
| 58 | 58 | static void pc_LPT_w(int n, int offset, int data) |
| 59 | 59 | { |
| 60 | 60 | PC_LPT *This=LPT+n; |
| 61 | if ( !(input | |
| 61 | if ( !(readinput | |
| 62 | 62 | // if (!This->on) return; |
| 63 | 63 | switch( offset ) |
| 64 | 64 | { |
| r1877 | r1878 | |
| 93 | 93 | { |
| 94 | 94 | PC_LPT *This=LPT+n; |
| 95 | 95 | int data = 0xff; |
| 96 | if ( !(input | |
| 96 | if ( !(readinput | |
| 97 | 97 | // if (!This->on) return data; |
| 98 | 98 | switch( offset ) |
| 99 | 99 | { |
| r1877 | r1878 | |
| 156 | 156 | WRITE8_HANDLER ( pc_parallelport1_w ) { pc_LPT_w(1,offset,data); } |
| 157 | 157 | WRITE8_HANDLER ( pc_parallelport2_w ) { pc_LPT_w(2,offset,data); } |
| 158 | 158 | |
| 159 | READ16_HANDLER ( pc16le_parallelport0_r ) { return read16le_with_read8_handler(pc_parallelport0_r, offset, mem_mask); } | |
| 160 | READ16_HANDLER ( pc16le_parallelport1_r ) { return read16le_with_read8_handler(pc_parallelport1_r, offset, mem_mask); } | |
| 161 | READ16_HANDLER ( pc16le_parallelport2_r ) { return read16le_with_read8_handler(pc_parallelport2_r, offset, mem_mask); } | |
| 162 | WRITE16_HANDLER( pc16le_parallelport0_w ) { write16le_with_write8_handler(pc_parallelport0_w, offset, data, mem_mask); } | |
| 163 | WRITE16_HANDLER( pc16le_parallelport1_w ) { write16le_with_write8_handler(pc_parallelport1_w, offset, data, mem_mask); } | |
| 164 | WRITE16_HANDLER( pc16le_parallelport2_w ) { write16le_with_write8_handler(pc_parallelport2_w, offset, data, mem_mask); } | |
| 159 | READ16_HANDLER ( pc16le_parallelport0_r ) { return read16le_with_read8_handler(pc_parallelport0_r, machine, offset, mem_mask); } | |
| 160 | READ16_HANDLER ( pc16le_parallelport1_r ) { return read16le_with_read8_handler(pc_parallelport1_r, machine, offset, mem_mask); } | |
| 161 | READ16_HANDLER ( pc16le_parallelport2_r ) { return read16le_with_read8_handler(pc_parallelport2_r, machine, offset, mem_mask); } | |
| 162 | WRITE16_HANDLER( pc16le_parallelport0_w ) { write16le_with_write8_handler(pc_parallelport0_w, machine, offset, data, mem_mask); } | |
| 163 | WRITE16_HANDLER( pc16le_parallelport1_w ) { write16le_with_write8_handler(pc_parallelport1_w, machine, offset, data, mem_mask); } | |
| 164 | WRITE16_HANDLER( pc16le_parallelport2_w ) { write16le_with_write8_handler(pc_parallelport2_w, machine, offset, data, mem_mask); } | |
| 165 | 165 | |
| 166 | READ32_HANDLER ( pc32le_parallelport0_r ) { return read32le_with_read8_handler(pc_parallelport0_r, offset, mem_mask); } | |
| 167 | READ32_HANDLER ( pc32le_parallelport1_r ) { return read32le_with_read8_handler(pc_parallelport1_r, offset, mem_mask); } | |
| 168 | READ32_HANDLER ( pc32le_parallelport2_r ) { return read32le_with_read8_handler(pc_parallelport2_r, offset, mem_mask); } | |
| 169 | WRITE32_HANDLER( pc32le_parallelport0_w ) { write32le_with_write8_handler(pc_parallelport0_w, offset, data, mem_mask); } | |
| 170 | WRITE32_HANDLER( pc32le_parallelport1_w ) { write32le_with_write8_handler(pc_parallelport1_w, offset, data, mem_mask); } | |
| 171 | WRITE32_HANDLER( pc32le_parallelport2_w ) { write32le_with_write8_handler(pc_parallelport2_w, offset, data, mem_mask); } | |
| 166 | READ32_HANDLER ( pc32le_parallelport0_r ) { return read32le_with_read8_handler(pc_parallelport0_r, machine, offset, mem_mask); } | |
| 167 | READ32_HANDLER ( pc32le_parallelport1_r ) { return read32le_with_read8_handler(pc_parallelport1_r, machine, offset, mem_mask); } | |
| 168 | READ32_HANDLER ( pc32le_parallelport2_r ) { return read32le_with_read8_handler(pc_parallelport2_r, machine, offset, mem_mask); } | |
| 169 | WRITE32_HANDLER( pc32le_parallelport0_w ) { write32le_with_write8_handler(pc_parallelport0_w, machine, offset, data, mem_mask); } | |
| 170 | WRITE32_HANDLER( pc32le_parallelport1_w ) { write32le_with_write8_handler(pc_parallelport1_w, machine, offset, data, mem_mask); } | |
| 171 | WRITE32_HANDLER( pc32le_parallelport2_w ) { write32le_with_write8_handler(pc_parallelport2_w, machine, offset, data, mem_mask); } |
| r1877 | r1878 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | |
| 54 | READ16_HANDLER ( pc16le_JOY_r ) { return read16le_with_read8_handler(pc_JOY_r, offset, mem_mask); } | |
| 55 | WRITE16_HANDLER ( pc16le_JOY_w ) { write16le_with_write8_handler(pc_JOY_w, offset, data, mem_mask); } | |
| 54 | READ16_HANDLER ( pc16le_JOY_r ) { return read16le_with_read8_handler(pc_JOY_r, machine, offset, mem_mask); } | |
| 55 | WRITE16_HANDLER ( pc16le_JOY_w ) { write16le_with_write8_handler(pc_JOY_w, machine, offset, data, mem_mask); } | |
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 |
| r1877 | r1878 | |
|---|---|---|
| 355 | 355 | vc1541->head.sync=0; |
| 356 | 356 | if (vc1541->type==TypeVC1541) { |
| 357 | 357 | cpunum_set_input_line(machine, vc1541->cpunumber, M6502_SET_OVERFLOW, 1); |
| 358 | via_3_ca1_w(0,1); | |
| 358 | via_3_ca1_w(machine, 0,1); | |
| 359 | 359 | } |
| 360 | 360 | return; |
| 361 | 361 | } |
| r1877 | r1878 | |
| 379 | 379 | } |
| 380 | 380 | if (vc1541->type==TypeVC1541) { |
| 381 | 381 | cpunum_set_input_line(machine, vc1541->cpunumber, M6502_SET_OVERFLOW, 0); |
| 382 | via_3_ca1_w(0,0); | |
| 382 | via_3_ca1_w(machine, 0,0); | |
| 383 | 383 | } |
| 384 | 384 | vc1541->clock=0; |
| 385 | 385 | } |
| r1877 | r1878 | |
| 966 | 966 | #ifdef CPU_SYNC |
| 967 | 967 | cpu_sync(); |
| 968 | 968 | #endif |
| 969 | tpi6525_0_port_a_w(0,data); | |
| 969 | tpi6525_0_port_a_w(Machine, 0,data); | |
| 970 | 970 | } |
| 971 | 971 | |
| 972 | 972 | static int c1551x_read_data (TPI6525 *This) |
| r1877 | r1878 | |
| 975 | 975 | #ifdef CPU_SYNC |
| 976 | 976 | cpu_sync (); |
| 977 | 977 | #endif |
| 978 | data=tpi6525_0_port_a_r(0); | |
| 978 | data=tpi6525_0_port_a_r(Machine, 0); | |
| 979 | 979 | DBG_LOG(2, "c1551 cpu",("%d read data %.2x\n", |
| 980 | 980 | cpu_getactivecpu (), data)); |
| 981 | 981 | return data; |
| r1877 | r1878 | |
| 988 | 988 | #ifdef CPU_SYNC |
| 989 | 989 | cpu_sync(); |
| 990 | 990 | #endif |
| 991 | tpi6525_0_port_c_w(0,data&0x40?0xff:0x7f); | |
| 991 | tpi6525_0_port_c_w(Machine, 0,data&0x40?0xff:0x7f); | |
| 992 | 992 | } |
| 993 | 993 | |
| 994 | 994 | static int c1551x_read_handshake (TPI6525 *This) |
| r1877 | r1878 | |
| 997 | 997 | #ifdef CPU_SYNC |
| 998 | 998 | cpu_sync(); |
| 999 | 999 | #endif |
| 1000 | data=tpi6525_0_port_c_r(0)&8?0x80:0; | |
| 1000 | data=tpi6525_0_port_c_r(Machine, 0)&8?0x80:0; | |
| 1001 | 1001 | DBG_LOG(2, "c1551 cpu",("%d read handshake %.2x\n", |
| 1002 | 1002 | cpu_getactivecpu (), data)); |
| 1003 | 1003 | return data; |
| r1877 | r1878 | |
| 1009 | 1009 | #ifdef CPU_SYNC |
| 1010 | 1010 | cpu_sync(); |
| 1011 | 1011 | #endif |
| 1012 | data=tpi6525_0_port_c_r(0)&3; | |
| 1012 | data=tpi6525_0_port_c_r(Machine, 0)&3; | |
| 1013 | 1013 | DBG_LOG(1, "c1551 cpu",("%d read status %.2x\n", |
| 1014 | 1014 | cpu_getactivecpu (), data)); |
| 1015 | 1015 | return data; |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | { |
| 6 | 6 | int iNesMapper; /* iNES Mapper # */ |
| 7 | 7 | const char *desc; /* Mapper description */ |
| 8 | write8_handler mmc_write_low; /* $4100-$5fff write routine */ | |
| 9 | read8_handler mmc_read_low; /* $4100-$5fff read routine */ | |
| 10 | write8_handler mmc_write_mid; /* $6000-$7fff write routine */ | |
| 11 | write8_handler mmc_write; /* $8000-$ffff write routine */ | |
| 8 | write8_machine_func mmc_write_low; /* $4100-$5fff write routine */ | |
| 9 | read8_machine_func mmc_read_low; /* $4100-$5fff read routine */ | |
| 10 | write8_machine_func mmc_write_mid; /* $6000-$7fff write routine */ | |
| 11 | write8_machine_func mmc_write; /* $8000-$ffff write routine */ | |
| 12 | 12 | void (*ppu_latch)(offs_t offset); |
| 13 | 13 | ppu2c0x_scanline_cb mmc_scanline; |
| 14 | 14 | ppu2c0x_hblank_cb mmc_hblank; |
| r1877 | r1878 | |
| 23 | 23 | extern UINT8 MMC5_vram[0x400]; |
| 24 | 24 | extern int MMC5_vram_control; |
| 25 | 25 | |
| 26 | extern write8_handler mmc_write_low; | |
| 27 | extern read8_handler mmc_read_low; | |
| 28 | extern write8_handler mmc_write_mid; | |
| 29 | extern read8_handler mmc_read_mid; | |
| 30 | extern write8_handler mmc_write; | |
| 26 | extern write8_machine_func mmc_write_low; | |
| 27 | extern read8_machine_func mmc_read_low; | |
| 28 | extern write8_machine_func mmc_write_mid; | |
| 29 | extern read8_machine_func mmc_read_mid; | |
| 30 | extern write8_machine_func mmc_write; | |
| 31 | 31 | |
| 32 | 32 | int mapper_reset (int mapperNum); |
| 33 | 33 |
| r1877 | r1878 | |
|---|---|---|
| 19 | 19 | **********************************************************************/ |
| 20 | 20 | |
| 21 | 21 | #include "driver.h" |
| 22 | #include "deprecat.h" | |
| 22 | 23 | #include "mc6846.h" |
| 23 | 24 | |
| 24 | 25 | #define VERBOSE 0 |
| r1877 | r1878 | |
| 69 | 70 | |
| 70 | 71 | #define PORT \ |
| 71 | 72 | ((mc6846.pdr & mc6846.ddr) | \ |
| 72 | ((mc6846.iface->in_port_func ? mc6846.iface->in_port_func(0) : 0) & \ | |
| 73 | ((mc6846.iface->in_port_func ? mc6846.iface->in_port_func(machine, 0) : 0) & \ | |
| 73 | 74 | ~mc6846.ddr)) |
| 74 | 75 | |
| 75 | 76 | #define CTO \ |
| r1877 | r1878 | |
| 126 | 127 | |
| 127 | 128 | |
| 128 | 129 | |
| 129 | INLINE void mc6846_update_cto ( | |
| 130 | INLINE void mc6846_update_cto ( running_machine *machine ) | |
| 130 | 131 | { |
| 131 | 132 | int cto = CTO; |
| 132 | 133 | static int old_cto; |
| r1877 | r1878 | |
| 136 | 137 | old_cto = cto; |
| 137 | 138 | } |
| 138 | 139 | if ( mc6846.iface->out_cto_func ) |
| 139 | mc6846.iface->out_cto_func( 0, cto ); | |
| 140 | mc6846.iface->out_cto_func( machine, 0, cto ); | |
| 140 | 141 | } |
| 141 | 142 | |
| 142 | 143 | |
| 143 | 144 | |
| 144 | INLINE void mc6846_timer_launch ( | |
| 145 | INLINE void mc6846_timer_launch ( running_machine *machine ) | |
| 145 | 146 | { |
| 146 | 147 | int delay = FACTOR * (mc6846.preset+1); |
| 147 | 148 | LOG (( "%f: mc6846 timer launch called, mode=%i, preset=%i (x%i)\n", attotime_to_double(timer_get_time()), MODE, mc6846.preset, FACTOR )); |
| r1877 | r1878 | |
| 178 | 179 | mc6846.timer_started = 1; |
| 179 | 180 | |
| 180 | 181 | mc6846.csr &= ~1; |
| 181 | mc6846_update_cto(); | |
| 182 | mc6846_update_cto(machine); | |
| 182 | 183 | mc6846_update_irq(); |
| 183 | 184 | } |
| 184 | 185 | |
| r1877 | r1878 | |
| 223 | 224 | timer_reset( mc6846.interval, ATTOTIME_IN_CYCLES( delay, mc6846.iface->cpunum ) ); |
| 224 | 225 | |
| 225 | 226 | mc6846.csr |= 1; |
| 226 | mc6846_update_cto(); | |
| 227 | mc6846_update_cto(machine); | |
| 227 | 228 | mc6846_update_irq(); |
| 228 | 229 | } |
| 229 | 230 | |
| r1877 | r1878 | |
| 235 | 236 | |
| 236 | 237 | /* 1 micro second after one-shot launch, we put cto to high */ |
| 237 | 238 | mc6846.cto = 1; |
| 238 | mc6846_update_cto(); | |
| 239 | mc6846_update_cto(machine); | |
| 239 | 240 | } |
| 240 | 241 | |
| 241 | 242 | |
| r1877 | r1878 | |
| 355 | 356 | { |
| 356 | 357 | mc6846.cp2_cpu = (data >> 3) & 1; |
| 357 | 358 | if ( mc6846.iface->out_cp2_func ) |
| 358 | mc6846.iface->out_cp2_func( 0, mc6846.cp2_cpu ); | |
| 359 | mc6846.iface->out_cp2_func( machine, 0, mc6846.cp2_cpu ); | |
| 359 | 360 | } |
| 360 | 361 | else |
| 361 | 362 | logerror( "$%04x mc6846 acknowledge not implemented\n", activecpu_get_previouspc() ); |
| r1877 | r1878 | |
| 368 | 369 | { |
| 369 | 370 | mc6846.ddr = data; |
| 370 | 371 | if ( mc6846.iface->out_port_func ) |
| 371 | mc6846.iface->out_port_func( 0, mc6846.pdr & mc6846.ddr ); | |
| 372 | mc6846.iface->out_port_func( machine, 0, mc6846.pdr & mc6846.ddr ); | |
| 372 | 373 | } |
| 373 | 374 | break; |
| 374 | 375 | |
| r1877 | r1878 | |
| 378 | 379 | { |
| 379 | 380 | mc6846.pdr = data; |
| 380 | 381 | if ( mc6846.iface->out_port_func ) |
| 381 | mc6846.iface->out_port_func( 0, mc6846.pdr & mc6846.ddr ); | |
| 382 | mc6846.iface->out_port_func( machine, 0, mc6846.pdr & mc6846.ddr ); | |
| 382 | 383 | if ( mc6846.csr1_to_be_cleared && (mc6846.csr & 2) ) |
| 383 | 384 | { |
| 384 | 385 | mc6846.csr &= ~2; |
| r1877 | r1878 | |
| 416 | 417 | mc6846.csr &= ~1; |
| 417 | 418 | if ( MODE != 0x30 ) |
| 418 | 419 | mc6846.cto = 0; |
| 419 | mc6846_update_cto(); | |
| 420 | mc6846_update_cto(machine); | |
| 420 | 421 | timer_reset( mc6846.interval, attotime_never ); |
| 421 | 422 | timer_reset( mc6846.one_shot, attotime_never ); |
| 422 | 423 | mc6846.timer_started = 0; |
| r1877 | r1878 | |
| 425 | 426 | { |
| 426 | 427 | /* timer launch */ |
| 427 | 428 | if ( ! mc6846.timer_started ) |
| 428 | mc6846_timer_launch(); | |
| 429 | mc6846_timer_launch(machine); | |
| 429 | 430 | } |
| 430 | 431 | mc6846_update_irq(); |
| 431 | 432 | } |
| r1877 | r1878 | |
| 445 | 446 | mc6846.csr &= ~1; |
| 446 | 447 | mc6846_update_irq(); |
| 447 | 448 | mc6846.cto = 0; |
| 448 | mc6846_update_cto(); | |
| 449 | mc6846_update_cto(machine); | |
| 449 | 450 | /* launch only if started */ |
| 450 | 451 | if (!(mc6846.tcr & 1)) |
| 451 | mc6846_timer_launch(); | |
| 452 | mc6846_timer_launch(machine); | |
| 452 | 453 | } |
| 453 | 454 | break; |
| 454 | 455 | |
| r1877 | r1878 | |
| 502 | 503 | |
| 503 | 504 | UINT8 mc6846_get_output_port ( void ) |
| 504 | 505 | { |
| 506 | running_machine *machine = Machine; | |
| 505 | 507 | return PORT; |
| 506 | 508 | } |
| 507 | 509 |
| r1877 | r1878 | |
|---|---|---|
| 762 | 762 | READ8_HANDLER ( to7_modem_mea8000_r ) |
| 763 | 763 | { |
| 764 | 764 | if ( readinputport( THOM_INPUT_MCONFIG ) & 1 ) |
| 765 | return mea8000_r( offset ); | |
| 765 | return mea8000_r( machine, offset ); | |
| 766 | 766 | else |
| 767 | 767 | { |
| 768 | 768 | switch ( offset ) { |
| 769 | case 0: return acia6850_0_stat_r( 0 ); | |
| 770 | case 1: return acia6850_0_data_r( 0 ); | |
| 769 | case 0: return acia6850_0_stat_r( machine, 0 ); | |
| 770 | case 1: return acia6850_0_data_r( machine, 0 ); | |
| 771 | 771 | default: return 0; |
| 772 | 772 | } |
| 773 | 773 | } |
| r1877 | r1878 | |
| 778 | 778 | WRITE8_HANDLER ( to7_modem_mea8000_w ) |
| 779 | 779 | { |
| 780 | 780 | if ( readinputport( THOM_INPUT_MCONFIG ) & 1 ) |
| 781 | mea8000_w( offset, data ); | |
| 781 | mea8000_w( machine, offset, data ); | |
| 782 | 782 | else |
| 783 | 783 | { |
| 784 | 784 | switch ( offset ) { |
| 785 | case 0: acia6850_0_ctrl_w( 0, data ); break; | |
| 786 | case 1: acia6850_0_data_w( 0, data ); break; | |
| 785 | case 0: acia6850_0_ctrl_w( machine, 0, data ); break; | |
| 786 | case 1: acia6850_0_data_w( machine, 0, data ); break; | |
| 787 | 787 | } |
| 788 | 788 | } |
| 789 | 789 | } |
| r1877 | r1878 | |
| 1262 | 1262 | to7_modem_reset(); |
| 1263 | 1263 | to7_midi_reset(); |
| 1264 | 1264 | to7_rf57932_reset(); |
| 1265 | mea8000_reset(); | |
| 1265 | mea8000_reset(machine); | |
| 1266 | 1266 | |
| 1267 | 1267 | /* video */ |
| 1268 | 1268 | thom_set_video_mode( THOM_VMODE_TO770 ); |
| r1877 | r1878 | |
| 1298 | 1298 | to7_modem_init(); |
| 1299 | 1299 | to7_midi_init(); |
| 1300 | 1300 | to7_rf57932_init(); |
| 1301 | mea8000_config( THOM_SOUND_SPEECH, NULL ); | |
| 1301 | mea8000_config( machine, THOM_SOUND_SPEECH, NULL ); | |
| 1302 | 1302 | |
| 1303 | 1303 | /* memory */ |
| 1304 | 1304 | thom_cart_bank = 0; |
| r1877 | r1878 | |
| 1314 | 1314 | /* BASIC instruction to see free memory: ?FRE(0) */ |
| 1315 | 1315 | int extram = mess_ram_size - 24*1024; |
| 1316 | 1316 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000 + extram - 1, 0, 0, |
| 1317 | (write8_ | |
| 1317 | (write8_machin | |
| 1318 | 1318 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000 + extram - 1, 0, 0, |
| 1319 | (read8_ | |
| 1319 | (read8_machin | |
| 1320 | 1320 | memory_configure_bank( THOM_RAM_BANK, 0, 1, mess_ram + 0x6000, extram ); |
| 1321 | 1321 | memory_set_bank( THOM_RAM_BANK, 0 ); |
| 1322 | 1322 | } |
| r1877 | r1878 | |
| 1392 | 1392 | memory_set_bank( THOM_RAM_BANK, bank ); |
| 1393 | 1393 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xdfff, 0, 0, |
| 1394 | 1394 | (mess_ram_size == 128*1024 || bank < 2) ? |
| 1395 | (write8_ | |
| 1395 | (write8_machin | |
| 1396 | 1396 | old_bank = bank; |
| 1397 | 1397 | } |
| 1398 | 1398 | |
| r1877 | r1878 | |
| 1494 | 1494 | to7_modem_reset(); |
| 1495 | 1495 | to7_midi_reset(); |
| 1496 | 1496 | to7_rf57932_reset(); |
| 1497 | mea8000_reset(); | |
| 1497 | mea8000_reset(machine); | |
| 1498 | 1498 | |
| 1499 | 1499 | /* video */ |
| 1500 | 1500 | thom_set_video_mode( THOM_VMODE_TO770 ); |
| r1877 | r1878 | |
| 1531 | 1531 | to7_modem_init(); |
| 1532 | 1532 | to7_midi_init(); |
| 1533 | 1533 | to7_rf57932_init(); |
| 1534 | mea8000_config( THOM_SOUND_SPEECH, NULL ); | |
| 1534 | mea8000_config( machine, THOM_SOUND_SPEECH, NULL ); | |
| 1535 | 1535 | |
| 1536 | 1536 | /* memory */ |
| 1537 | 1537 | thom_cart_bank = 0; |
| r1877 | r1878 | |
| 1753 | 1753 | int bank = 0; |
| 1754 | 1754 | |
| 1755 | 1755 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, |
| 1756 | (read8_ | |
| 1756 | (read8_machin | |
| 1757 | 1757 | |
| 1758 | 1758 | if ( rom_is_ram && thom_cart_nb_banks == 4 ) |
| 1759 | 1759 | { |
| r1877 | r1878 | |
| 1769 | 1769 | int write_enable = mo5_reg_cart & 8; |
| 1770 | 1770 | bank = 4 + ( mo5_reg_cart & 3 ); |
| 1771 | 1771 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, write_enable ? |
| 1772 | (write8_ | |
| 1772 | (write8_machin | |
| 1773 | 1773 | if ( bank != old_bank ) |
| 1774 | 1774 | LOG_BANK(( "mo5_update_cart_bank: CART is nanonetwork RAM bank %i (write-enable=%i)\n", mo5_reg_cart & 3, write_enable ? 1 : 0 )); |
| 1775 | 1775 | } |
| r1877 | r1878 | |
| 1843 | 1843 | to7_midi_reset(); |
| 1844 | 1844 | to7_rf57932_reset(); |
| 1845 | 1845 | mo5_init_timer(); |
| 1846 | mea8000_reset(); | |
| 1846 | mea8000_reset(machine); | |
| 1847 | 1847 | |
| 1848 | 1848 | /* video */ |
| 1849 | 1849 | thom_set_video_mode( THOM_VMODE_MO5 ); |
| r1877 | r1878 | |
| 1879 | 1879 | to7_midi_init(); |
| 1880 | 1880 | to7_rf57932_init(); |
| 1881 | 1881 | mo5_periodic_timer = timer_alloc( mo5_periodic_cb , NULL); |
| 1882 | mea8000_config( THOM_SOUND_SPEECH, NULL ); | |
| 1882 | mea8000_config( machine, THOM_SOUND_SPEECH, NULL ); | |
| 1883 | 1883 | |
| 1884 | 1884 | /* memory */ |
| 1885 | 1885 | thom_cart_bank = 0; |
| r1877 | r1878 | |
| 2110 | 2110 | int slot = ( mc6846_get_output_port() >> 4 ) & 3; /* bits 4-5: ROM bank */ |
| 2111 | 2111 | |
| 2112 | 2112 | /* reset cartridge read handler */ |
| 2113 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0003, 0, 0, (read8_ | |
| 2113 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0003, 0, 0, (read8_machin | |
| 2114 | 2114 | |
| 2115 | 2115 | switch ( slot ) |
| 2116 | 2116 | { |
| r1877 | r1878 | |
| 2214 | 2214 | memory_set_bank( THOM_RAM_BANK, bank ); |
| 2215 | 2215 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xdfff, 0, 0, |
| 2216 | 2216 | (mess_ram_size == 192*1024 || bank < 6) ? |
| 2217 | (write8_ | |
| 2217 | (write8_machin | |
| 2218 | 2218 | old_bank = bank; |
| 2219 | 2219 | } |
| 2220 | 2220 | |
| r1877 | r1878 | |
| 2781 | 2781 | to7_modem_reset(); |
| 2782 | 2782 | to7_midi_reset(); |
| 2783 | 2783 | to7_rf57932_reset(); |
| 2784 | mea8000_reset(); | |
| 2784 | mea8000_reset(machine); | |
| 2785 | 2785 | |
| 2786 | 2786 | /* video */ |
| 2787 | 2787 | thom_set_video_mode( THOM_VMODE_TO9 ); |
| r1877 | r1878 | |
| 2820 | 2820 | to7_modem_init(); |
| 2821 | 2821 | to7_midi_init(); |
| 2822 | 2822 | to7_rf57932_init(); |
| 2823 | mea8000_config( THOM_SOUND_SPEECH, NULL ); | |
| 2823 | mea8000_config( machine, THOM_SOUND_SPEECH, NULL ); | |
| 2824 | 2824 | |
| 2825 | 2825 | /* memory */ |
| 2826 | 2826 | thom_vram = mess_ram; |
| r1877 | r1878 | |
| 3249 | 3249 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, |
| 3250 | 3250 | (mess_ram_size == 512*1024 || to8_data_vpage < 16) ? |
| 3251 | 3251 | to8_data_vpage <= 4 ? to8_data_lo_w : |
| 3252 | (write8_ | |
| 3252 | (write8_machin | |
| 3253 | 3253 | MWA8_NOP ); |
| 3254 | 3254 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, |
| 3255 | 3255 | (mess_ram_size == 512*1024 || to8_data_vpage < 16) ? |
| 3256 | 3256 | to8_data_vpage <= 4 ? to8_data_hi_w : |
| 3257 | (write8_ | |
| 3257 | (write8_machin | |
| 3258 | 3258 | MWA8_NOP ); |
| 3259 | 3259 | } |
| 3260 | 3260 | |
| r1877 | r1878 | |
| 3266 | 3266 | int bank = 0; |
| 3267 | 3267 | |
| 3268 | 3268 | /* reset bank switch */ |
| 3269 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0003, 0, 0, (read8_ | |
| 3269 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0003, 0, 0, (read8_machin | |
| 3270 | 3270 | |
| 3271 | 3271 | if ( to8_reg_cart & 0x20 ) |
| 3272 | 3272 | { |
| r1877 | r1878 | |
| 3276 | 3276 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, |
| 3277 | 3277 | ((to8_cart_vpage < 8 || mess_ram_size == 512*1024) && (to8_reg_cart & 0x40)) ? |
| 3278 | 3278 | (to8_cart_vpage <= 4) ? to8_vcart_w : |
| 3279 | (write8_ | |
| 3279 | (write8_machin | |
| 3280 | 3280 | MWA8_NOP ); |
| 3281 | 3281 | if ( bank != old_bank ) |
| 3282 | 3282 | LOG_BANK(( "to8_update_cart_bank: CART is RAM bank %i (write-enable=%i)\n", to8_cart_vpage, (to8_reg_cart & 0x40) ? 1 : 0 )); |
| r1877 | r1878 | |
| 3366 | 3366 | { |
| 3367 | 3367 | if ( (to8_reg_sys1 & 0x80) && THOM_FLOPPY_EXT ) |
| 3368 | 3368 | /* external controller */ |
| 3369 | return to7_floppy_r( offset ); | |
| 3369 | return to7_floppy_r( machine, offset ); | |
| 3370 | 3370 | else if ( ! (to8_reg_sys1 & 0x80) && THOM_FLOPPY_INT ) |
| 3371 | 3371 | /* internal controller */ |
| 3372 | return thmfc_floppy_r( offset ); | |
| 3372 | return thmfc_floppy_r( machine, offset ); | |
| 3373 | 3373 | else |
| 3374 | 3374 | /* no controller */ |
| 3375 | 3375 | return 0; |
| r1877 | r1878 | |
| 3381 | 3381 | { |
| 3382 | 3382 | if ( (to8_reg_sys1 & 0x80) && THOM_FLOPPY_EXT ) |
| 3383 | 3383 | /* external controller */ |
| 3384 | to7_floppy_w( offset, data ); | |
| 3384 | to7_floppy_w( machine, offset, data ); | |
| 3385 | 3385 | else if ( ! (to8_reg_sys1 & 0x80) && THOM_FLOPPY_INT ) |
| 3386 | 3386 | /* internal controller */ |
| 3387 | thmfc_floppy_w( offset, data ); | |
| 3387 | thmfc_floppy_w( machine, offset, data ); | |
| 3388 | 3388 | } |
| 3389 | 3389 | |
| 3390 | 3390 | |
| r1877 | r1878 | |
| 3505 | 3505 | if ( ( offset == 3 ) && ( to8_reg_ram & 0x80 ) && ( to8_reg_sys1 & 0x80 ) ) |
| 3506 | 3506 | { |
| 3507 | 3507 | if ( THOM_FLOPPY_EXT ) |
| 3508 | return to7_floppy_r( 0xc ); | |
| 3508 | return to7_floppy_r( machine, 0xc ); | |
| 3509 | 3509 | else |
| 3510 | 3510 | return 0; |
| 3511 | 3511 | } |
| r1877 | r1878 | |
| 3569 | 3569 | if ( ( offset == 3 ) && ( to8_reg_ram & 0x80 ) && ( to8_reg_sys1 & 0x80 ) ) |
| 3570 | 3570 | { |
| 3571 | 3571 | if ( THOM_FLOPPY_EXT ) |
| 3572 | to7_floppy_w( 0xc, data ); | |
| 3572 | to7_floppy_w( machine, 0xc, data ); | |
| 3573 | 3573 | } |
| 3574 | 3574 | else |
| 3575 | 3575 | { |
| r1877 | r1878 | |
| 3706 | 3706 | to7_modem_reset(); |
| 3707 | 3707 | to7_midi_reset(); |
| 3708 | 3708 | to7_rf57932_reset(); |
| 3709 | mea8000_reset(); | |
| 3709 | mea8000_reset(machine); | |
| 3710 | 3710 | |
| 3711 | 3711 | /* gate-array */ |
| 3712 | 3712 | to7_lightpen = 0; |
| r1877 | r1878 | |
| 3756 | 3756 | to7_modem_init(); |
| 3757 | 3757 | to7_midi_init(); |
| 3758 | 3758 | to7_rf57932_init(); |
| 3759 | mea8000_config( THOM_SOUND_SPEECH, NULL ); | |
| 3759 | mea8000_config( machine, THOM_SOUND_SPEECH, NULL ); | |
| 3760 | 3760 | |
| 3761 | 3761 | /* memory */ |
| 3762 | 3762 | thom_cart_bank = 0; |
| r1877 | r1878 | |
| 3868 | 3868 | to7_modem_reset(); |
| 3869 | 3869 | to7_midi_reset(); |
| 3870 | 3870 | to7_rf57932_reset(); |
| 3871 | mea8000_reset(); | |
| 3871 | mea8000_reset(machine); | |
| 3872 | 3872 | |
| 3873 | 3873 | /* gate-array */ |
| 3874 | 3874 | to7_lightpen = 0; |
| r1877 | r1878 | |
| 3918 | 3918 | to7_modem_init(); |
| 3919 | 3919 | to7_midi_init(); |
| 3920 | 3920 | to7_rf57932_init(); |
| 3921 | mea8000_config( THOM_SOUND_SPEECH, NULL ); | |
| 3921 | mea8000_config( machine, THOM_SOUND_SPEECH, NULL ); | |
| 3922 | 3922 | |
| 3923 | 3923 | /* memory */ |
| 3924 | 3924 | thom_cart_bank = 0; |
| r1877 | r1878 | |
| 3988 | 3988 | static int old_bank = -1; |
| 3989 | 3989 | int bank = 0; |
| 3990 | 3990 | |
| 3991 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, (read8_ | |
| 3991 | memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, (read8_machin | |
| 3992 | 3992 | |
| 3993 | 3993 | if ( ( ( to8_reg_sys1 & 0x40 ) && ( to8_reg_cart & 0x20 ) ) || ( ! ( to8_reg_sys1 & 0x40 ) && ( mo5_reg_cart & 4 ) ) ) |
| 3994 | 3994 | { |
| r1877 | r1878 | |
| 4000 | 4000 | bank = 8 + to8_cart_vpage; |
| 4001 | 4001 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, |
| 4002 | 4002 | (to8_reg_cart & 0x40) ? (to8_cart_vpage <= 4) ? to8_vcart_w : |
| 4003 | (write8_ | |
| 4003 | (write8_machin | |
| 4004 | 4004 | if ( bank != old_bank ) |
| 4005 | 4005 | LOG_BANK(( "mo6_update_cart_bank: CART is RAM bank %i (write-enable=%i)\n", to8_cart_vpage, (to8_reg_cart & 0x40) ? 1 : 0 )); |
| 4006 | 4006 | } |
| r1877 | r1878 | |
| 4019 | 4019 | to8_cart_vpage = (mo5_reg_cart & 3) | 4; |
| 4020 | 4020 | bank = 8 + to8_cart_vpage; |
| 4021 | 4021 | memory_install_write8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xefff, 0, 0, write_enable ? |
| 4022 | (write8_ | |
| 4022 | (write8_machin | |
| 4023 | 4023 | if ( bank != old_bank ) |
| 4024 | 4024 | LOG_BANK(( "mo6_update_cart_bank: CART is RAM bank %i (write-enable=%i) (MO5 compat.)\n", to8_cart_vpage, write_enable ? 1 : 0 )); |
| 4025 | 4025 | } |
| r1877 | r1878 | |
| 4359 | 4359 | { |
| 4360 | 4360 | /* 0xa7dc from external floppy drive aliases the video gate-array */ |
| 4361 | 4361 | if ( ( offset == 3 ) && ( to8_reg_ram & 0x80 ) ) |
| 4362 | return to7_floppy_r( 0xc ); | |
| 4362 | return to7_floppy_r( machine, 0xc ); | |
| 4363 | 4363 | |
| 4364 | 4364 | switch ( offset ) |
| 4365 | 4365 | { |
| 4366 | 4366 | |
| 4367 | 4367 | case 0: /* palette data */ |
| 4368 | 4368 | case 1: /* palette address */ |
| 4369 | return to8_vreg_r( offset ); | |
| 4369 | return to8_vreg_r( machine, offset ); | |
| 4370 | 4370 | |
| 4371 | 4371 | case 2: |
| 4372 | 4372 | case 3: |
| r1877 | r1878 | |
| 4391 | 4391 | |
| 4392 | 4392 | case 0: /* palette data */ |
| 4393 | 4393 | case 1: /* palette address */ |
| 4394 | to8_vreg_w( offset, data ); | |
| 4394 | to8_vreg_w( machine, offset, data ); | |
| 4395 | 4395 | return; |
| 4396 | 4396 | |
| 4397 | 4397 | case 2: /* display / external floppy register */ |
| 4398 | 4398 | if ( ( to8_reg_sys1 & 0x80 ) && ( to8_reg_ram & 0x80 ) ) |
| 4399 | to7_floppy_w( 0xc, data ); | |
| 4399 | to7_floppy_w( machine, 0xc, data ); | |
| 4400 | 4400 | else |
| 4401 | 4401 | to9_set_video_mode( data, 2 ); |
| 4402 | 4402 | break; |
| r1877 | r1878 | |
| 4404 | 4404 | case 3: /* system register 2 */ |
| 4405 | 4405 | /* 0xa7dc from external floppy drive aliases the video gate-array */ |
| 4406 | 4406 | if ( ( offset == 3 ) && ( to8_reg_ram & 0x80 ) ) |
| 4407 | to7_floppy_w( 0xc, data ); | |
| 4407 | to7_floppy_w( machine, 0xc, data ); | |
| 4408 | 4408 | else |
| 4409 | 4409 | { |
| 4410 | 4410 | to8_reg_sys2 = data; |
| r1877 | r1878 | |
| 4440 | 4440 | to7_midi_reset(); |
| 4441 | 4441 | to7_rf57932_reset(); |
| 4442 | 4442 | mo5_init_timer(); |
| 4443 | mea8000_reset(); | |
| 4443 | mea8000_reset(machine); | |
| 4444 | 4444 | |
| 4445 | 4445 | /* gate-array */ |
| 4446 | 4446 | to7_lightpen = 0; |
| r1877 | r1878 | |
| 4485 | 4485 | to7_midi_init(); |
| 4486 | 4486 | to7_rf57932_init(); |
| 4487 | 4487 | mo5_periodic_timer = timer_alloc( mo5_periodic_cb , NULL); |
| 4488 | mea8000_config( THOM_SOUND_SPEECH, NULL ); | |
| 4488 | mea8000_config( machine, THOM_SOUND_SPEECH, NULL ); | |
| 4489 | 4489 | |
| 4490 | 4490 | /* memory */ |
| 4491 | 4491 | thom_cart_bank = 0; |
| r1877 | r1878 | |
| 4535 | 4535 | READ8_HANDLER ( mo5nr_net_r ) |
| 4536 | 4536 | { |
| 4537 | 4537 | if ( to7_controller_type ) |
| 4538 | return to7_floppy_r ( offset ); | |
| 4538 | return to7_floppy_r ( machine, offset ); | |
| 4539 | 4539 | |
| 4540 | 4540 | logerror( "$%04x %f mo5nr_net_r: read from reg %i\n", activecpu_get_previouspc(), attotime_to_double(timer_get_time()), offset ); |
| 4541 | 4541 | |
| 4542 | 4542 | if ( to7_controller_type ) |
| 4543 | return to7_floppy_r ( offset ); | |
| 4543 | return to7_floppy_r ( machine, offset ); | |
| 4544 | 4544 | |
| 4545 | 4545 | return 0; |
| 4546 | 4546 | } |
| r1877 | r1878 | |
| 4550 | 4550 | WRITE8_HANDLER ( mo5nr_net_w ) |
| 4551 | 4551 | { |
| 4552 | 4552 | if ( to7_controller_type ) |
| 4553 | to7_floppy_w ( offset, data ); | |
| 4553 | to7_floppy_w ( machine, offset, data ); | |
| 4554 | 4554 | else |
| 4555 | 4555 | logerror( "$%04x %f mo5nr_net_w: write $%02X to reg %i\n", |
| 4556 | 4556 | activecpu_get_previouspc(), attotime_to_double(timer_get_time()), data, offset ); |
| r1877 | r1878 | |
| 4707 | 4707 | to7_midi_reset(); |
| 4708 | 4708 | to7_rf57932_reset(); |
| 4709 | 4709 | mo5_init_timer(); |
| 4710 | mea8000_reset(); | |
| 4710 | mea8000_reset(machine); | |
| 4711 | 4711 | |
| 4712 | 4712 | /* gate-array */ |
| 4713 | 4713 | to7_lightpen = 0; |
| r1877 | r1878 | |
| 4752 | 4752 | to7_midi_init(); |
| 4753 | 4753 | to7_rf57932_init(); |
| 4754 | 4754 | mo5_periodic_timer = timer_alloc( mo5_periodic_cb , NULL); |
| 4755 | mea8000_config( THOM_SOUND_SPEECH, NULL ); | |
| 4755 | mea8000_config( machine, THOM_SOUND_SPEECH, NULL ); | |
| 4756 | 4756 | |
| 4757 | 4757 | /* memory */ |
| 4758 | 4758 | thom_cart_bank = 0; |
| r1877 | r1878 | |
|---|---|---|
| 1174 | 1174 | via_set_clock(1, lisa_features.has_fast_timers ? 1250000 : 500000); /* one of these values must be wrong : see note after description of the has_fast_timers field */ |
| 1175 | 1175 | |
| 1176 | 1176 | via_reset(); |
| 1177 | COPS_via_out_ca2(0, 0); /* VIA core forgets to do so */ | |
| 1177 | COPS_via_out_ca2(machine, 0, 0); /* VIA core forgets to do so */ | |
| 1178 | 1178 | |
| 1179 | 1179 | /* initialize floppy */ |
| 1180 | 1180 | { |
| r1877 | r1878 | |
| 1358 | 1358 | } |
| 1359 | 1359 | } |
| 1360 | 1360 | |
| 1361 | ||
| 1361 | ||
| 1362 | 1362 | { |
| 1363 | 1363 | int answer=0; |
| 1364 | 1364 | |
| 1365 | 1365 | switch ((offset & 0x0030) >> 4) |
| 1366 | 1366 | { |
| 1367 | 1367 | case 0: /* IWM */ |
| 1368 | answer = /*iwm_lisa_r*/applefdc_r(offset); | |
| 1368 | answer = /*iwm_lisa_r*/applefdc_r(machine, offset); | |
| 1369 | 1369 | break; |
| 1370 | 1370 | |
| 1371 | 1371 | case 1: /* TTL glue */ |
| r1877 | r1878 | |
| 1390 | 1390 | switch ((offset & 0x0030) >> 4) |
| 1391 | 1391 | { |
| 1392 | 1392 | case 0: /* IWM */ |
| 1393 | /*iwm_lisa_w*/applefdc_w(offset, data); | |
| 1393 | /*iwm_lisa_w*/applefdc_w(machine, offset, data); | |
| 1394 | 1394 | break; |
| 1395 | 1395 | |
| 1396 | 1396 | case 1: /* TTL glue */ |
| r1877 | r1878 | |
| 1418 | 1418 | if (! (offset & 0x0400)) |
| 1419 | 1419 | return lisa_fdc_ram[offset & 0x03ff]; |
| 1420 | 1420 | else |
| 1421 | return lisa_fdc_io_r(offset & 0x03ff); | |
| 1421 | return lisa_fdc_io_r(machine, offset & 0x03ff); | |
| 1422 | 1422 | else |
| 1423 | 1423 | return 0; /* ??? */ |
| 1424 | 1424 | } |
| r1877 | r1878 | |
| 1434 | 1434 | if (! (offset & 0x0800)) |
| 1435 | 1435 | return lisa_fdc_ram[offset & 0x03ff]; |
| 1436 | 1436 | else |
| 1437 | return lisa_fdc_io_r(offset & 0x03ff); | |
| 1437 | return lisa_fdc_io_r(machine, offset & 0x03ff); | |
| 1438 | 1438 | else |
| 1439 | 1439 | return 0; /* ??? */ |
| 1440 | 1440 | } |
| r1877 | r1878 | |
| 1451 | 1451 | if (! (offset & 0x0400)) |
| 1452 | 1452 | lisa_fdc_ram[offset & 0x03ff] = data; |
| 1453 | 1453 | else |
| 1454 | lisa_fdc_io_w(offset & 0x03ff, data); | |
| 1454 | lisa_fdc_io_w(machine, offset & 0x03ff, data); | |
| 1455 | 1455 | } |
| 1456 | 1456 | } |
| 1457 | 1457 | } |
| r1877 | r1878 | |
| 1465 | 1465 | if (! (offset & 0x0800)) |
| 1466 | 1466 | lisa_fdc_ram[offset & 0x03ff] = data; |
| 1467 | 1467 | else |
| 1468 | lisa_fdc_io_w(offset & 0x03ff, data); | |
| 1468 | lisa_fdc_io_w(machine, offset & 0x03ff, data); | |
| 1469 | 1469 | } |
| 1470 | 1470 | } |
| 1471 | 1471 | } |
| r1877 | r1878 | |
| 1568 | 1568 | break; |
| 1569 | 1569 | |
| 1570 | 1570 | case IO: |
| 1571 | answer = lisa_IO_r((address & 0x00ffff) >> 1, mem_mask); | |
| 1571 | answer = lisa_IO_r(machine, (address & 0x00ffff) >> 1, mem_mask); | |
| 1572 | 1572 | break; |
| 1573 | 1573 | |
| 1574 | 1574 | case invalid: /* unmapped segment */ |
| r1877 | r1878 | |
| 1840 | 1840 | break; |
| 1841 | 1841 | |
| 1842 | 1842 | case IO: |
| 1843 | lisa_IO_w((address & 0x00ffff) >> 1, data, mem_mask); | |
| 1843 | lisa_IO_w(machine, (address & 0x00ffff) >> 1, data, mem_mask); | |
| 1844 | 1844 | break; |
| 1845 | 1845 | |
| 1846 | 1846 | case RAM_stack_r: /* read-only */ |
| r1877 | r1878 | |
|---|---|---|
| 138 | 138 | riot_port_b = data; |
| 139 | 139 | |
| 140 | 140 | /* first 4 pins are connected to the 74145 */ |
| 141 | ttl74145_0_w(0, data & 0x0f); | |
| 141 | ttl74145_0_w(machine, 0, data & 0x0f); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 |
| r1877 | r1878 | |
|---|---|---|
| 1063 | 1063 | data |= 4; // no comlynx adapter |
| 1064 | 1064 | break; |
| 1065 | 1065 | case 0x8c: case 0x8d: |
| 1066 | data = lynx_uart_r( offset | |
| 1066 | data = lynx_uart_r(machine, offset | |
| 1067 | 1067 | break; |
| 1068 | 1068 | default: |
| 1069 | 1069 | data = mikey.data[offset]; |
| r1877 | r1878 | |
| 1121 | 1121 | break; |
| 1122 | 1122 | |
| 1123 | 1123 | case 0x8c: case 0x8d: |
| 1124 | lynx_uart_w(offset, data); | |
| 1124 | lynx_uart_w(machine, offset, data); | |
| 1125 | 1125 | break; |
| 1126 | 1126 | |
| 1127 | 1127 | case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7: |
| r1877 | r1878 | |
| 1180 | 1180 | static void lynx_reset(running_machine *machine) |
| 1181 | 1181 | { |
| 1182 | 1182 | int i; |
| 1183 | lynx_memory_config_w(0, 0); | |
| 1183 | lynx_memory_config_w(machine, 0, 0); | |
| 1184 | 1184 | |
| 1185 | 1185 | cpunum_set_input_line(machine, 0, M65SC02_IRQ_LINE, CLEAR_LINE); |
| 1186 | 1186 | |
| r1877 | r1878 | |
| 1208 | 1208 | |
| 1209 | 1209 | static void lynx_postload(void) |
| 1210 | 1210 | { |
| 1211 | lynx_memory_config_w(0, lynx_memory_config); | |
| 1211 | lynx_memory_config_w(Machine, 0, lynx_memory_config); | |
| 1212 | 1212 | } |
| 1213 | 1213 | |
| 1214 | 1214 | MACHINE_START( lynx ) |
| r1877 | r1878 | |
|---|---|---|
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | #define AYWriteReg(chip,port,value) \ |
| 23 | AY8910_control_port_0_w(0,port); \ | |
| 24 | AY8910_write_port_0_w(0,value) | |
| 23 | AY8910_control_port_0_w(machine, 0,port); \ | |
| 24 | AY8910_write_port_0_w(machine, 0,value) | |
| 25 | 25 | |
| 26 | 26 | #define TAPE_HEADER "Colour Genie - Virtual Tape File" |
| 27 | 27 | |
| r1877 | r1878 | |
| 855 | 855 | { |
| 856 | 856 | /* comparator value */ |
| 857 | 857 | psg_b_inp = 0x00; |
| 858 | if( input | |
| 858 | if( readinput | |
| 859 | 859 | psg_b_inp |= 0x80; |
| 860 | if( input | |
| 860 | if( readinput | |
| 861 | 861 | psg_b_inp |= 0x40; |
| 862 | if( input | |
| 862 | if( readinput | |
| 863 | 863 | psg_b_inp |= 0x20; |
| 864 | if( input | |
| 864 | if( readinput | |
| 865 | 865 | psg_b_inp |= 0x10; |
| 866 | 866 | } |
| 867 | 867 | else |
| r1877 | r1878 | |
| 869 | 869 | /* read keypad matrix */ |
| 870 | 870 | psg_b_inp = 0xFF; |
| 871 | 871 | if( !(psg_a_out & 0x01) ) |
| 872 | psg_b_inp &= ~(input | |
| 872 | psg_b_inp &= ~(readinput | |
| 873 | 873 | if( !(psg_a_out & 0x02) ) |
| 874 | psg_b_inp &= ~(input | |
| 874 | psg_b_inp &= ~(readinput | |
| 875 | 875 | if( !(psg_a_out & 0x04) ) |
| 876 | psg_b_inp &= ~(input | |
| 876 | psg_b_inp &= ~(readinput | |
| 877 | 877 | if( !(psg_a_out & 0x08) ) |
| 878 | psg_b_inp &= ~(input | |
| 878 | psg_b_inp &= ~(readinput | |
| 879 | 879 | if( !(psg_a_out & 0x10) ) |
| 880 | psg_b_inp &= ~(input | |
| 880 | psg_b_inp &= ~(readinput | |
| 881 | 881 | if( !(psg_a_out & 0x20) ) |
| 882 | psg_b_inp &= ~(input | |
| 882 | psg_b_inp &= ~(readinput | |
| 883 | 883 | } |
| 884 | 884 | return psg_b_inp; |
| 885 | 885 | } |
| r1877 | r1878 | |
| 899 | 899 | /* If the floppy isn't emulated, return 0 */ |
| 900 | 900 | if( (readinputport(0) & 0x80) == 0 ) |
| 901 | 901 | return 0; |
| 902 | return wd17xx_status_r(offset); | |
| 902 | return wd17xx_status_r(machine, offset); | |
| 903 | 903 | } |
| 904 | 904 | |
| 905 | 905 | READ8_HANDLER( cgenie_track_r ) |
| r1877 | r1878 | |
| 907 | 907 | /* If the floppy isn't emulated, return 0xff */ |
| 908 | 908 | if( (readinputport(0) & 0x80) == 0 ) |
| 909 | 909 | return 0xff; |
| 910 | return wd17xx_track_r(offset); | |
| 910 | return wd17xx_track_r(machine, offset); | |
| 911 | 911 | } |
| 912 | 912 | |
| 913 | 913 | READ8_HANDLER( cgenie_sector_r ) |
| r1877 | r1878 | |
| 915 | 915 | /* If the floppy isn't emulated, return 0xff */ |
| 916 | 916 | if( (readinputport(0) & 0x80) == 0 ) |
| 917 | 917 | return 0xff; |
| 918 | return wd17xx_sector_r(offset); | |
| 918 | return wd17xx_sector_r(machine, offset); | |
| 919 | 919 | } |
| 920 | 920 | |
| 921 | 921 | READ8_HANDLER(cgenie_data_r ) |
| r1877 | r1878 | |
| 923 | 923 | /* If the floppy isn't emulated, return 0xff */ |
| 924 | 924 | if( (readinputport(0) & 0x80) == 0 ) |
| 925 | 925 | return 0xff; |
| 926 | return wd17xx_data_r(offset); | |
| 926 | return wd17xx_data_r(machine, offset); | |
| 927 | 927 | } |
| 928 | 928 | |
| 929 | 929 | WRITE8_HANDLER( cgenie_command_w ) |
| r1877 | r1878 | |
| 931 | 931 | /* If the floppy isn't emulated, return immediately */ |
| 932 | 932 | if( (readinputport(0) & 0x80) == 0 ) |
| 933 | 933 | return; |
| 934 | wd17xx_command_w(offset, data); | |
| 934 | wd17xx_command_w(machine, offset, data); | |
| 935 | 935 | } |
| 936 | 936 | |
| 937 | 937 | WRITE8_HANDLER( cgenie_track_w ) |
| r1877 | r1878 | |
| 939 | 939 | /* If the floppy isn't emulated, ignore the write */ |
| 940 | 940 | if( (readinputport(0) & 0x80) == 0 ) |
| 941 | 941 | return; |
| 942 | wd17xx_track_w(offset, data); | |
| 942 | wd17xx_track_w(machine, offset, data); | |
| 943 | 943 | } |
| 944 | 944 | |
| 945 | 945 | WRITE8_HANDLER( cgenie_sector_w ) |
| r1877 | r1878 | |
| 947 | 947 | /* If the floppy isn't emulated, ignore the write */ |
| 948 | 948 | if( (readinputport(0) & 0x80) == 0 ) |
| 949 | 949 | return; |
| 950 | wd17xx_sector_w(offset, data); | |
| 950 | wd17xx_sector_w(machine, offset, data); | |
| 951 | 951 | } |
| 952 | 952 | |
| 953 | 953 | WRITE8_HANDLER( cgenie_data_w ) |
| r1877 | r1878 | |
| 955 | 955 | /* If the floppy isn't emulated, ignore the write */ |
| 956 | 956 | if( (readinputport(0) & 0x80) == 0 ) |
| 957 | 957 | return; |
| 958 | wd17xx_data_w(offset, data); | |
| 958 | wd17xx_data_w(machine, offset, data); | |
| 959 | 959 | } |
| 960 | 960 | |
| 961 | 961 | READ8_HANDLER( cgenie_irq_status_r ) |
| r1877 | r1878 | |
| 1041 | 1041 | int result = 0; |
| 1042 | 1042 | |
| 1043 | 1043 | if( offset & 0x01 ) |
| 1044 | result |= input | |
| 1044 | result |= readinput | |
| 1045 | 1045 | if( offset & 0x02 ) |
| 1046 | result |= input | |
| 1046 | result |= readinput | |
| 1047 | 1047 | if( offset & 0x04 ) |
| 1048 | result |= input | |
| 1048 | result |= readinput | |
| 1049 | 1049 | if( offset & 0x08 ) |
| 1050 | result |= input | |
| 1050 | result |= readinput | |
| 1051 | 1051 | if( offset & 0x10 ) |
| 1052 | result |= input | |
| 1052 | result |= readinput | |
| 1053 | 1053 | if( offset & 0x20 ) |
| 1054 | result |= input | |
| 1054 | result |= readinput | |
| 1055 | 1055 | if( offset & 0x40 ) |
| 1056 | result |= input | |
| 1056 | result |= readinput | |
| 1057 | 1057 | if( offset & 0x80 ) |
| 1058 | result |= input | |
| 1058 | result |= readinput | |
| 1059 | 1059 | |
| 1060 | 1060 | return result; |
| 1061 | 1061 | } |
| r1877 | r1878 | |
| 1133 | 1133 | { |
| 1134 | 1134 | if( cgenie_tv_mode != (readinputport(0) & 0x10) ) |
| 1135 | 1135 | { |
| 1136 | cgenie_tv_mode = input | |
| 1136 | cgenie_tv_mode = readinput | |
| 1137 | 1137 | /* force setting of background color */ |
| 1138 | 1138 | port_ff ^= FF_BGD0; |
| 1139 | cgenie_port_ff_w(0, port_ff ^ FF_BGD0); | |
| 1139 | cgenie_port_ff_w(machine, 0, port_ff ^ FF_BGD0); | |
| 1140 | 1140 | } |
| 1141 | 1141 | } |
| r1877 | r1878 | |
|---|---|---|
| 16 | 16 | struct _mc6846_interface |
| 17 | 17 | { |
| 18 | 18 | /* CPU write to the outside through chip */ |
| 19 | write8_handler out_port_func; /* 8-bit output */ | |
| 20 | write8_handler out_cp1_func; /* 1-bit output */ | |
| 21 | write8_handler out_cp2_func; /* 1-bit output */ | |
| 19 | write8_machine_func out_port_func; /* 8-bit output */ | |
| 20 | write8_machine_func out_cp1_func; /* 1-bit output */ | |
| 21 | write8_machine_func out_cp2_func; /* 1-bit output */ | |
| 22 | 22 | |
| 23 | 23 | /* CPU read from the outside through chip */ |
| 24 | read8_ | |
| 24 | read8_machin | |
| 25 | 25 | |
| 26 | 26 | /* asynchronous timer output to outside world */ |
| 27 | write8_ | |
| 27 | write8_machin | |
| 28 | 28 | |
| 29 | 29 | /* timer interrupt */ |
| 30 | 30 | void ( * irq_func ) ( int state ); |
| r1877 | r1878 | |
|---|---|---|
| 471 | 471 | switch (offset & 0x80) |
| 472 | 472 | { |
| 473 | 473 | case 0x80: /* Motherboard 8255 */ |
| 474 | return ppi8255_0_r(offset & 0x03); | |
| 474 | return ppi8255_0_r(machine, offset & 0x03); | |
| 475 | 475 | } |
| 476 | 476 | break; |
| 477 | 477 | case 0x08: /* ROM module connector */ |
| r1877 | r1878 | |
| 486 | 486 | switch (offset & 0x80) |
| 487 | 487 | { |
| 488 | 488 | case 0x80: /* ROM module 8255 */ |
| 489 | return ppi8255_3_r(offset & 0x03); | |
| 489 | return ppi8255_3_r(machine, offset & 0x03); | |
| 490 | 490 | } |
| 491 | 491 | } |
| 492 | 492 | break; |
| r1877 | r1878 | |
| 501 | 501 | case 0x10: /* 8251 (casette recorder, V24) */ |
| 502 | 502 | switch (offset & 0x01) |
| 503 | 503 | { |
| 504 | case 0x00: return msm8251_data_r(offset & 0x01); | |
| 505 | case 0x01: return msm8251_status_r(offset & 0x01); | |
| 504 | case 0x00: return msm8251_data_r(machine, offset & 0x01); | |
| 505 | case 0x01: return msm8251_status_r(machine, offset & 0x01); | |
| 506 | 506 | } |
| 507 | 507 | break; |
| 508 | 508 | case 0x40: /* 8255 (GPIO/0, GPIO/1) */ |
| 509 | return ppi8255_1_r(offset & 0x03); | |
| 509 | return ppi8255_1_r(machine, offset & 0x03); | |
| 510 | 510 | case 0x50: /* 8253 */ |
| 511 | return pit8253_0_r | |
| 511 | return pit8253_0_r | |
| 512 | 512 | case 0x70: /* 8255 (IMS-2) */ |
| 513 | return ppi8255_2_r(offset & 0x03); | |
| 513 | return ppi8255_2_r(machine, offset & 0x03); | |
| 514 | 514 | } |
| 515 | 515 | break; |
| 516 | 516 | case 0x80: /* external interfaces */ |
| r1877 | r1878 | |
| 537 | 537 | switch (offset & 0x80) |
| 538 | 538 | { |
| 539 | 539 | case 0x80: /* Motherboard 8255 */ |
| 540 | ppi8255_0_w(offset & 0x03, data); | |
| 540 | ppi8255_0_w(machine, offset & 0x03, data); | |
| 541 | 541 | /* PMD-85.3 memory banking */ |
| 542 | 542 | if ((offset & 0x03) == 0x03) |
| 543 | 543 | { |
| r1877 | r1878 | |
| 559 | 559 | switch (offset & 0x80) |
| 560 | 560 | { |
| 561 | 561 | case 0x80: /* ROM module 8255 */ |
| 562 | ppi8255_3_w(offset & 0x03, data); | |
| 562 | ppi8255_3_w(machine, offset & 0x03, data); | |
| 563 | 563 | break; |
| 564 | 564 | } |
| 565 | 565 | } |
| r1877 | r1878 | |
| 575 | 575 | case 0x10: /* 8251 (casette recorder, V24) */ |
| 576 | 576 | switch (offset & 0x01) |
| 577 | 577 | { |
| 578 | case 0x00: msm8251_data_w(offset & 0x01, data); break; | |
| 579 | case 0x01: msm8251_control_w(offset & 0x01, data); break; | |
| 578 | case 0x00: msm8251_data_w(machine, offset & 0x01, data); break; | |
| 579 | case 0x01: msm8251_control_w(machine, offset & 0x01, data); break; | |
| 580 | 580 | } |
| 581 | 581 | break; |
| 582 | 582 | case 0x40: /* 8255 (GPIO/0, GPIO/0) */ |
| 583 | ppi8255_1_w(offset & 0x03, data); | |
| 583 | ppi8255_1_w(machine, offset & 0x03, data); | |
| 584 | 584 | break; |
| 585 | 585 | case 0x50: /* 8253 */ |
| 586 | pit8253_0_w | |
| 586 | pit8253_0_w | |
| 587 | 587 | logerror ("8253 writing. Address: %02x, Data: %02x\n", offset, data); |
| 588 | 588 | break; |
| 589 | 589 | case 0x70: /* 8255 (IMS-2) */ |
| 590 | ppi8255_2_w(offset & 0x03, data); | |
| 590 | ppi8255_2_w(machine, offset & 0x03, data); | |
| 591 | 591 | break; |
| 592 | 592 | } |
| 593 | 593 | break; |
| r1877 | r1878 | |
| 621 | 621 | switch (offset & 0x80) |
| 622 | 622 | { |
| 623 | 623 | case 0x80: /* Motherboard 8255 */ |
| 624 | return ppi8255_0_r(offset & 0x03); | |
| 624 | return ppi8255_0_r(machine, offset & 0x03); | |
| 625 | 625 | } |
| 626 | 626 | break; |
| 627 | 627 | } |
| r1877 | r1878 | |
| 644 | 644 | switch (offset & 0x80) |
| 645 | 645 | { |
| 646 | 646 | case 0x80: /* Motherboard 8255 */ |
| 647 | ppi8255_0_w(offset & 0x03, data); | |
| 647 | ppi8255_0_w(machine, offset & 0x03, data); | |
| 648 | 648 | break; |
| 649 | 649 | } |
| 650 | 650 | break; |
| r1877 | r1878 | |
| 774 | 774 | return address; |
| 775 | 775 | } |
| 776 | 776 | |
| 777 | static void pmd85_common_driver_init ( | |
| 777 | static void pmd85_common_driver_init (running_machine *machine) | |
| 778 | 778 | { |
| 779 | 779 | memory_set_opbase_handler(0, pmd85_opbaseoverride); |
| 780 | 780 | |
| 781 | 781 | pit8253_init(1, &pmd85_pit8253_interface); |
| 782 | pit8253_0_gate_w(0, 1); | |
| 783 | pit8253_0_gate_w(1, 1); | |
| 784 | pit8253_0_gate_w(2, 1); | |
| 782 | pit8253_0_gate_w(machine, 0, 1); | |
| 783 | pit8253_0_gate_w(machine, 1, 1); | |
| 784 | pit8253_0_gate_w(machine, 2, 1); | |
| 785 | 785 | |
| 786 | 786 | msm8251_init(&pmd85_msm8251_interface); |
| 787 | 787 | |
| r1877 | r1878 | |
| 799 | 799 | pmd85_model = PMD85_1; |
| 800 | 800 | pmd85_update_memory = pmd851_update_memory; |
| 801 | 801 | ppi8255_init(&pmd85_ppi8255_interface); |
| 802 | pmd85_common_driver_init(); | |
| 802 | pmd85_common_driver_init(machine); | |
| 803 | 803 | } |
| 804 | 804 | |
| 805 | 805 | DRIVER_INIT ( pmd852a ) |
| r1877 | r1878 | |
| 807 | 807 | pmd85_model = PMD85_2A; |
| 808 | 808 | pmd85_update_memory = pmd852a_update_memory; |
| 809 | 809 | ppi8255_init(&pmd85_ppi8255_interface); |
| 810 | pmd85_common_driver_init(); | |
| 810 | pmd85_common_driver_init(machine); | |
| 811 | 811 | } |
| 812 | 812 | |
| 813 | 813 | DRIVER_INIT ( pmd853 ) |
| r1877 | r1878 | |
| 815 | 815 | pmd85_model = PMD85_3; |
| 816 | 816 | pmd85_update_memory = pmd853_update_memory; |
| 817 | 817 | ppi8255_init(&pmd85_ppi8255_interface); |
| 818 | pmd85_common_driver_init(); | |
| 818 | pmd85_common_driver_init(machine); | |
| 819 | 819 | } |
| 820 | 820 | |
| 821 | 821 | DRIVER_INIT ( alfa ) |
| r1877 | r1878 | |
| 823 | 823 | pmd85_model = ALFA; |
| 824 | 824 | pmd85_update_memory = alfa_update_memory; |
| 825 | 825 | ppi8255_init(&alfa_ppi8255_interface); |
| 826 | pmd85_common_driver_init(); | |
| 826 | pmd85_common_driver_init(machine); | |
| 827 | 827 | } |
| 828 | 828 | |
| 829 | 829 | DRIVER_INIT ( mato ) |
| r1877 | r1878 | |
|---|---|---|
| 792 | 792 | int i; |
| 793 | 793 | unsigned char lo, hi, data; |
| 794 | 794 | SPECTRUM_Z80_SNAPSHOT_TYPE z80_type; |
| 795 | running_machine *machine = Machine; | |
| 795 | 796 | |
| 796 | 797 | z80_type = spectrum_identify_z80(pSnapshot, SnapshotSize); |
| 797 | 798 | |
| r1877 | r1878 | |
| 954 | 955 | /* Only set up sound registers for 128K machine or TS2068! */ |
| 955 | 956 | for (i = 0; i < 16; i++) |
| 956 | 957 | { |
| 957 | AY8910_control_port_0_w(0, i); | |
| 958 | AY8910_write_port_0_w(0, pSnapshot[39 + i]); | |
| 958 | AY8910_control_port_0_w(machine, 0, i); | |
| 959 | AY8910_write_port_0_w(machine, 0, pSnapshot[39 + i]); | |
| 959 | 960 | } |
| 960 | AY8910_control_port_0_w(0, pSnapshot[38]); | |
| 961 | AY8910_control_port_0_w(machine, 0, pSnapshot[38]); | |
| 961 | 962 | } |
| 962 | 963 | |
| 963 | 964 | pSource = pSnapshot + header_size; |
| r1877 | r1878 | |
|---|---|---|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | row = 9; |
| 170 | new = input | |
| 170 | new = readinput | |
| 171 | 171 | chg = keyrows[row] ^ new; |
| 172 | 172 | |
| 173 | if (!chg) { new = input_port_9_r(0); chg = keyrows[--row] ^ new; } | |
| 174 | if (!chg) { new = input_port_8_r(0); chg = keyrows[--row] ^ new; } | |
| 175 | if (!chg) { new = input_port_7_r(0); chg = keyrows[--row] ^ new; } | |
| 176 | if (!chg) { new = input_port_6_r(0); chg = keyrows[--row] ^ new; } | |
| 177 | if (!chg) { new = input_port_5_r(0); chg = keyrows[--row] ^ new; } | |
| 178 | if (!chg) { new = input_port_4_r(0); chg = keyrows[--row] ^ new; } | |
| 179 | if (!chg) { new = input_port_3_r(0); chg = keyrows[--row] ^ new; } | |
| 180 | if (!chg) { new = input_port_2_r(0); chg = keyrows[--row] ^ new; } | |
| 181 | if (!chg) { new = input_port_1_r(0); chg = keyrows[--row] ^ new; } | |
| 173 | if (!chg) { new = readinputport(9); chg = keyrows[--row] ^ new; } | |
| 174 | if (!chg) { new = readinputport(8); chg = keyrows[--row] ^ new; } | |
| 175 | if (!chg) { new = readinputport(7); chg = keyrows[--row] ^ new; } | |
| 176 | if (!chg) { new = readinputport(6); chg = keyrows[--row] ^ new; } | |
| 177 | if (!chg) { new = readinputport(5); chg = keyrows[--row] ^ new; } | |
| 178 | if (!chg) { new = readinputport(4); chg = keyrows[--row] ^ new; } | |
| 179 | if (!chg) { new = readinputport(3); chg = keyrows[--row] ^ new; } | |
| 180 | if (!chg) { new = readinputport(2); chg = keyrows[--row] ^ new; } | |
| 181 | if (!chg) { new = readinputport(1); chg = keyrows[--row] ^ new; } | |
| 182 | 182 | if (!chg) --row; |
| 183 | 183 | |
| 184 | 184 | if (row >= 0) |
| r1877 | r1878 | |
| 222 | 222 | if( key ) /* normal key */ |
| 223 | 223 | { |
| 224 | 224 | repeater = 30; |
| 225 | kaypro_conin_w(0, key); | |
| 225 | kaypro_conin_w(machine, 0, key); | |
| 226 | 226 | } |
| 227 | 227 | else |
| 228 | 228 | if( (row == 0) && (chg == 0x04) ) /* Ctrl-@ (NUL) */ |
| 229 | kaypro_conin_w(0, 0); | |
| 229 | kaypro_conin_w(machine, 0, 0); | |
| 230 | 230 | keyrows[row] |= new; |
| 231 | 231 | } |
| 232 | 232 | else |
| r1877 | r1878 | |
| 237 | 237 | } |
| 238 | 238 | else if ( key && (keyrows[lastrow] & mask) && repeat == 0 ) |
| 239 | 239 | { |
| 240 | kaypro_conin_w(0, key); | |
| 240 | kaypro_conin_w(machine, 0, key); | |
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 |
| r1877 | r1878 | |
|---|---|---|
| 372 | 372 | { |
| 373 | 373 | activecpu_adjust_icount(-8); /* this is just a minimum, it can be more */ |
| 374 | 374 | |
| 375 | return tms5220_status_r(offset); | |
| 375 | return tms5220_status_r(machine, offset); | |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | #if 0 |
| r1877 | r1878 | |
| 415 | 415 | } |
| 416 | 416 | #endif |
| 417 | 417 | |
| 418 | tms5220_data_w(offset, data); | |
| 418 | tms5220_data_w(machine, offset, data); | |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | READ8_HANDLER ( geneve_r ) |
| r1877 | r1878 | |
| 437 | 437 | { |
| 438 | 438 | case 0xf100: |
| 439 | 439 | case 0xf108: /* mirror? */ |
| 440 | return v9938_vram_r(0); | |
| 440 | return v9938_vram_r(machine, 0); | |
| 441 | 441 | |
| 442 | 442 | case 0xf102: |
| 443 | 443 | case 0xf10a: /* mirror? */ |
| 444 | return v9938_status_r(0); | |
| 444 | return v9938_status_r(machine, 0); | |
| 445 | 445 | |
| 446 | 446 | case 0xf110: |
| 447 | 447 | case 0xf111: |
| r1877 | r1878 | |
| 537 | 537 | { |
| 538 | 538 | if (offset & 2) |
| 539 | 539 | { /* read VDP status */ |
| 540 | return v9938_status_r(0); | |
| 540 | return v9938_status_r(machine, 0); | |
| 541 | 541 | } |
| 542 | 542 | else |
| 543 | 543 | { /* read VDP RAM */ |
| 544 | return v9938_vram_r(0); | |
| 544 | return v9938_vram_r(machine, 0); | |
| 545 | 545 | } |
| 546 | 546 | } |
| 547 | 547 | return 0; |
| r1877 | r1878 | |
| 550 | 550 | /* speech read */ |
| 551 | 551 | if ((! (offset & 1)) && has_speech) |
| 552 | 552 | { |
| 553 | return geneve_speech_r(0); | |
| 553 | return geneve_speech_r(machine, 0); | |
| 554 | 554 | } |
| 555 | 555 | return 0; |
| 556 | 556 | |
| r1877 | r1878 | |
| 645 | 645 | #endif |
| 646 | 646 | case 0xba: |
| 647 | 647 | /* DSR space */ |
| 648 | return geneve_peb_r(offset); | |
| 648 | return geneve_peb_r(machine, offset); | |
| 649 | 649 | |
| 650 | 650 | case 0xbc: |
| 651 | 651 | /* speech space */ |
| 652 | 652 | if (has_speech) |
| 653 | 653 | { |
| 654 | 654 | if ((offset >= 0x1000) && (offset < 0x1400) && (! (offset & 1))) |
| 655 | return geneve_speech_r(0); | |
| 655 | return geneve_speech_r(machine, 0); | |
| 656 | 656 | else |
| 657 | 657 | return 0; |
| 658 | 658 | } |
| r1877 | r1878 | |
| 681 | 681 | { |
| 682 | 682 | case 0xf100: |
| 683 | 683 | case 0xf108: /* mirror? */ |
| 684 | v9938_vram_w(0, data); | |
| 684 | v9938_vram_w(machine, 0, data); | |
| 685 | 685 | return; |
| 686 | 686 | |
| 687 | 687 | case 0xf102: |
| 688 | 688 | case 0xf10a: /* mirror? */ |
| 689 | v9938_command_w(0, data); | |
| 689 | v9938_command_w(machine, 0, data); | |
| 690 | 690 | return; |
| 691 | 691 | |
| 692 | 692 | case 0xf104: |
| 693 | 693 | case 0xf10c: /* mirror? */ |
| 694 | v9938_palette_w(0, data); | |
| 694 | v9938_palette_w(machine, 0, data); | |
| 695 | 695 | return; |
| 696 | 696 | |
| 697 | 697 | case 0xf106: |
| 698 | 698 | case 0xf10e: /* mirror? */ |
| 699 | v9938_register_w(0, data); | |
| 699 | v9938_register_w(machine, 0, data); | |
| 700 | 700 | return; |
| 701 | 701 | |
| 702 | 702 | case 0xf110: |
| r1877 | r1878 | |
| 715 | 715 | return*/ |
| 716 | 716 | |
| 717 | 717 | case 0xf120: |
| 718 | SN76496_0_w(0, data); | |
| 718 | SN76496_0_w(machine, 0, data); | |
| 719 | 719 | break; |
| 720 | 720 | |
| 721 | 721 | case 0xf130: |
| r1877 | r1878 | |
| 799 | 799 | { |
| 800 | 800 | case 1: |
| 801 | 801 | /* sound write */ |
| 802 | SN76496_0_w(0, data); | |
| 802 | SN76496_0_w(machine, 0, data); | |
| 803 | 803 | return; |
| 804 | 804 | |
| 805 | 805 | case 3: |
| r1877 | r1878 | |
| 811 | 811 | { |
| 812 | 812 | case 0: |
| 813 | 813 | /* write VDP RAM */ |
| 814 | v9938_vram_w(0, data); | |
| 814 | v9938_vram_w(machine, 0, data); | |
| 815 | 815 | break; |
| 816 | 816 | case 1: |
| 817 | 817 | /* write VDP address */ |
| 818 | v9938_command_w(0, data); | |
| 818 | v9938_command_w(machine, 0, data); | |
| 819 | 819 | break; |
| 820 | 820 | case 2: |
| 821 | 821 | /* write palette */ |
| 822 | v9938_palette_w(0, data); | |
| 822 | v9938_palette_w(machine, 0, data); | |
| 823 | 823 | break; |
| 824 | 824 | case 3: |
| 825 | 825 | /* write register */ |
| 826 | v9938_register_w(0, data); | |
| 826 | v9938_register_w(machine, 0, data); | |
| 827 | 827 | break; |
| 828 | 828 | } |
| 829 | 829 | } |
| r1877 | r1878 | |
| 833 | 833 | /* speech write */ |
| 834 | 834 | if ((! (offset & 1)) && has_speech) |
| 835 | 835 | { |
| 836 | geneve_speech_w(0, data); | |
| 836 | geneve_speech_w(machine, 0, data); | |
| 837 | 837 | } |
| 838 | 838 | return; |
| 839 | 839 | |
| r1877 | r1878 | |
| 937 | 937 | #endif |
| 938 | 938 | case 0xba: |
| 939 | 939 | /* DSR space */ |
| 940 | geneve_peb_w(offset, data); | |
| 940 | geneve_peb_w(machine, offset, data); | |
| 941 | 941 | return; |
| 942 | 942 | |
| 943 | 943 | case 0xbc: |
| r1877 | r1878 | |
| 945 | 945 | if (has_speech) |
| 946 | 946 | { |
| 947 | 947 | if ((offset >= 0x1400) && (offset < 0x1800) && (! (offset & 1))) |
| 948 | geneve_speech_w(0, data); | |
| 948 | geneve_speech_w(machine, 0, data); | |
| 949 | 949 | return; |
| 950 | 950 | } |
| 951 | 951 | |
| r1877 | r1878 | |
| 1006 | 1006 | } |
| 1007 | 1007 | } |
| 1008 | 1008 | |
| 1009 | geneve_peb_cru_w(offset, data); | |
| 1009 | geneve_peb_cru_w(machine, offset, data); | |
| 1010 | 1010 | } |
| 1011 | 1011 | |
| 1012 | 1012 | /*===========================================================================*/ |
| r1877 | r1878 | |
|---|---|---|
| 58 | 58 | static int c128_ram_bottom, c128_ram_top; |
| 59 | 59 | static UINT8 *c128_ram; |
| 60 | 60 | |
| 61 | static void c128_set_m8502_read_handler(UINT16 start, UINT16 end, read8_ | |
| 61 | static void c128_set_m8502_read_handler(running_machine *machine, UINT16 start, UINT16 end, read8_machin | |
| 62 | 62 | { |
| 63 | 63 | int cpunum; |
| 64 | cpunum = mame_find_cpu_index( | |
| 64 | cpunum = mame_find_cpu_index(machine, "m8502"); | |
| 65 | 65 | memory_install_read8_handler(cpunum, ADDRESS_SPACE_PROGRAM, start, end, 0, 0, rh); |
| 66 | 66 | } |
| 67 | 67 | |
| r1877 | r1878 | |
| 102 | 102 | switch ((offset&0xf00)>>8) |
| 103 | 103 | { |
| 104 | 104 | case 0:case 1: case 2: case 3: |
| 105 | vic2_port_w (offset & 0x3ff, data); | |
| 105 | vic2_port_w (machine, offset & 0x3ff, data); | |
| 106 | 106 | break; |
| 107 | 107 | case 4: |
| 108 | sid6581_0_port_w (offset & 0x3f, data); | |
| 108 | sid6581_0_port_w (machine, offset & 0x3f, data); | |
| 109 | 109 | break; |
| 110 | 110 | case 5: |
| 111 | c128_mmu8722_port_w (offset & 0xff, data); | |
| 111 | c128_mmu8722_port_w (machine, offset & 0xff, data); | |
| 112 | 112 | break; |
| 113 | 113 | case 6:case 7: |
| 114 | vdc8563_port_w (offset & 0xff, data); | |
| 114 | vdc8563_port_w (machine, offset & 0xff, data); | |
| 115 | 115 | break; |
| 116 | 116 | case 8: case 9: case 0xa: case 0xb: |
| 117 | 117 | if (c64mode) |
| r1877 | r1878 | |
| 120 | 120 | c64_colorram[(offset & 0x3ff)|((c64_port6510&3)<<10)] = data | 0xf0; // maybe all 8 bit connected! |
| 121 | 121 | break; |
| 122 | 122 | case 0xc: |
| 123 | cia_0_w(offset, data); | |
| 123 | cia_0_w(machine, offset, data); | |
| 124 | 124 | break; |
| 125 | 125 | case 0xd: |
| 126 | cia_1_w(offset, data); | |
| 126 | cia_1_w(machine, offset, data); | |
| 127 | 127 | break; |
| 128 | 128 | case 0xf: |
| 129 | c128_dma8726_port_w(offset&0xff,data); | |
| 129 | c128_dma8726_port_w(machine, offset&0xff,data); | |
| 130 | 130 | break; |
| 131 | 131 | case 0xe: |
| 132 | 132 | DBG_LOG (1, "io write", ("%.3x %.2x\n", offset, data)); |
| r1877 | r1878 | |
| 137 | 137 | |
| 138 | 138 | |
| 139 | 139 | |
| 140 | static | |
| 140 | static | |
| 141 | 141 | { |
| 142 | 142 | switch ((offset&0xf00)>>8) { |
| 143 | 143 | case 0:case 1: case 2: case 3: |
| 144 | return vic2_port_r (offset & 0x3ff); | |
| 144 | return vic2_port_r (machine, offset & 0x3ff); | |
| 145 | 145 | case 4: |
| 146 | return sid6581_0_port_r (offset & 0xff); | |
| 146 | return sid6581_0_port_r (machine, offset & 0xff); | |
| 147 | 147 | case 5: |
| 148 | return c128_mmu8722_port_r (offset & 0xff); | |
| 148 | return c128_mmu8722_port_r (machine, offset & 0xff); | |
| 149 | 149 | case 6:case 7: |
| 150 | return vdc8563_port_r (offset & 0xff); | |
| 150 | return vdc8563_port_r (machine, offset & 0xff); | |
| 151 | 151 | case 8: case 9: case 0xa: case 0xb: |
| 152 | 152 | return c64_colorram[offset & 0x3ff]; |
| 153 | 153 | case 0xc: |
| 154 | return cia_0_r(offset); | |
| 154 | return cia_0_r(machine, offset); | |
| 155 | 155 | case 0xd: |
| 156 | return cia_1_r(offset); | |
| 156 | return cia_1_r(machine, offset); | |
| 157 | 157 | case 0xf: |
| 158 | return c128_dma8726_port_r(offset&0xff); | |
| 158 | return c128_dma8726_port_r(machine, offset&0xff); | |
| 159 | 159 | case 0xe:default: |
| 160 | 160 | DBG_LOG (1, "io read", ("%.3x\n", offset)); |
| 161 | 161 | return 0xff; |
| r1877 | r1878 | |
| 166 | 166 | { |
| 167 | 167 | static int old, exrom, game; |
| 168 | 168 | int data, loram, hiram, charen; |
| 169 | read8_ | |
| 169 | read8_machin | |
| 170 | 170 | |
| 171 | 171 | if (!c64mode) |
| 172 | 172 | return; |
| r1877 | r1878 | |
| 219 | 219 | else |
| 220 | 220 | memory_set_bankptr(13, c64_memory + 0xd000); |
| 221 | 221 | } |
| 222 | c128_set_m8502_read_handler(0xd000, 0xdfff, rh); | |
| 222 | c128_set_m8502_read_handler(Machine, 0xd000, 0xdfff, rh); | |
| 223 | 223 | |
| 224 | 224 | if (!c64_game && c64_exrom) |
| 225 | 225 | { |
| r1877 | r1878 | |
| 336 | 336 | |
| 337 | 337 | static void c128_bankswitch_128 (int reset) |
| 338 | 338 | { |
| 339 | read8_ | |
| 339 | read8_machin | |
| 340 | 340 | |
| 341 | 341 | c64mode = MMU_64MODE; |
| 342 | 342 | if (c64mode) |
| r1877 | r1878 | |
| 415 | 415 | else |
| 416 | 416 | c128_ram_top = 0x10000; |
| 417 | 417 | |
| 418 | c128_set_m8502_read_handler(0xff00, 0xff04, c128_mmu8722_ff00_r); | |
| 418 | c128_set_m8502_read_handler(Machine, 0xff00, 0xff04, c128_mmu8722_ff00_r); | |
| 419 | 419 | |
| 420 | 420 | if (MMU_IO_ON) |
| 421 | 421 | { |
| r1877 | r1878 | |
| 427 | 427 | c128_write_io = 0; |
| 428 | 428 | rh = MRA8_BANK13; |
| 429 | 429 | } |
| 430 | c128_set_m8502_read_handler(0xd000, 0xdfff, rh); | |
| 430 | c128_set_m8502_read_handler(Machine, 0xd000, 0xdfff, rh); | |
| 431 | 431 | |
| 432 | 432 | if (MMU_RAM_HI) |
| 433 | 433 | { |
| r1877 | r1878 | |
| 707 | 707 | WRITE8_HANDLER( c128_write_ff00 ) |
| 708 | 708 | { |
| 709 | 709 | if (!c64mode) |
| 710 | c128_mmu8722_ff00_w (offset, data); | |
| 710 | c128_mmu8722_ff00_w (machine, offset, data); | |
| 711 | 711 | else if (c128_ram!=NULL) |
| 712 | 712 | c64_memory[0xff00 + offset] = data; |
| 713 | 713 | } |
| r1877 | r1878 | |
|---|---|---|
| 102 | 102 | |
| 103 | 103 | |
| 104 | 104 | |
| 105 | static void intel82439tx_configure_memory(UINT8 val, offs_t begin, offs_t end, int read_bank, write32_ | |
| 105 | static void intel82439tx_configure_memory(UINT8 val, offs_t begin, offs_t end, int read_bank, write32_machin | |
| 106 | 106 | { |
| 107 | 107 | memory_install_read_handler(0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, read_bank); |
| 108 | 108 | if (val & 0x01) |
| r1877 | r1878 | |
|---|---|---|
| 143 | 143 | switch ((offset >> 4) & 0x3) |
| 144 | 144 | { |
| 145 | 145 | case 0: |
| 146 | return ppi8255_0_r(offset & 3); | |
| 146 | return ppi8255_0_r(machine, offset & 3); | |
| 147 | 147 | break; |
| 148 | 148 | |
| 149 | 149 | case 1: |
| 150 | return ppi8255_1_r(offset & 3); | |
| 150 | return ppi8255_1_r(machine, offset & 3); | |
| 151 | 151 | break; |
| 152 | 152 | |
| 153 | 153 | case 2: |
| r1877 | r1878 | |
| 180 | 180 | switch ((offset >> 4) & 0x3) |
| 181 | 181 | { |
| 182 | 182 | case 0: |
| 183 | ppi8255_0_w(offset & 3, data); | |
| 183 | ppi8255_0_w(machine, offset & 3, data); | |
| 184 | 184 | break; |
| 185 | 185 | |
| 186 | 186 | case 1: |
| 187 | ppi8255_1_w(offset & 3, data); | |
| 187 | ppi8255_1_w(machine, offset & 3, data); | |
| 188 | 188 | break; |
| 189 | 189 | |
| 190 | 190 | case 2: |
| r1877 | r1878 | |
|---|---|---|
| 181 | 181 | WRITE8_HANDLER(pc88sr_outport_30) |
| 182 | 182 | { |
| 183 | 183 | /* bit 1-5 not implemented yet */ |
| 184 | pc88sr_disp_30(offset,data); | |
| 184 | pc88sr_disp_30(machine, offset,data); | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | WRITE8_HANDLER(pc88sr_outport_40) |
| r1877 | r1878 | |
| 194 | 194 | if((port_save&0x04) == 0x00 && (data&0x04) != 0x00) calender_shift(); |
| 195 | 195 | port_save=data; |
| 196 | 196 | |
| 197 | if((input | |
| 197 | if((readinput | |
| 198 | 198 | data&=0x7f; |
| 199 | 199 | } |
| 200 | 200 | switch(data&0xa0) { |
| r1877 | r1878 | |
| 241 | 241 | int r; |
| 242 | 242 | |
| 243 | 243 | /* read DIP-SW */ |
| 244 | r=input | |
| 244 | r=readinput | |
| 245 | 245 | /* change bit 0 according BASIC mode */ |
| 246 | 246 | if(is_Nbasic) { |
| 247 | 247 | r&=0xfe; |
| r1877 | r1878 | |
| 268 | 268 | int r; |
| 269 | 269 | |
| 270 | 270 | /* read DIP-SW */ |
| 271 | r=input | |
| 271 | r=readinput | |
| 272 | 272 | /* change bit 6 according speed switch */ |
| 273 | 273 | if(pc88sr_is_highspeed) { |
| 274 | 274 | r|=0x40; |
| r1877 | r1878 | |
| 487 | 487 | RAMmode=((data&0x02)!=0); |
| 488 | 488 | ROMmode=((data&0x04)!=0); |
| 489 | 489 | pc8801_update_bank(); |
| 490 | pc88sr_disp_31(offset,data); | |
| 490 | pc88sr_disp_31(machine, offset,data); | |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | 493 | READ8_HANDLER(pc88sr_inport_32) |
| r1877 | r1878 | |
| 503 | 503 | no4throm2=(data&3); |
| 504 | 504 | enable_FM_IRQ=((data & 0x80) == 0x00); |
| 505 | 505 | if(FM_IRQ_save && enable_FM_IRQ) pc8801_raise_interrupt(FM_IRQ_LEVEL); |
| 506 | pc88sr_disp_32(offset,data); | |
| 506 | pc88sr_disp_32(machine, offset,data); | |
| 507 | 507 | pc8801_update_bank(); |
| 508 | 508 | } |
| 509 | 509 | |
| r1877 | r1878 | |
| 572 | 572 | pc8801_update_bank(); |
| 573 | 573 | pc8801_video_init(hireso); |
| 574 | 574 | |
| 575 | if(extmem_mode!=input_port_19_r(0)) { | |
| 576 | extmem_mode=input_port_19_r(0); | |
| 575 | if(extmem_mode!=readinputport(19)) { | |
| 576 | extmem_mode=readinputport(19); | |
| 577 | 577 | if(extRAM!=NULL) { |
| 578 | 578 | free(extRAM); |
| 579 | 579 | extRAM=NULL; |
| r1877 | r1878 | |
| 695 | 695 | { |
| 696 | 696 | int a; |
| 697 | 697 | |
| 698 | a=input | |
| 698 | a=readinput | |
| 699 | 699 | is_Nbasic = ((a&0x01)==0x00); |
| 700 | 700 | is_V2mode = ((a&0x02)==0x00); |
| 701 | 701 | pc88sr_is_highspeed = ((a&0x04)!=0x00); |
| r1877 | r1878 | |
| 810 | 810 | |
| 811 | 811 | static void pc8801_init_5fd(void) |
| 812 | 812 | { |
| 813 | use_5FD = (input | |
| 813 | use_5FD = (readinput | |
| 814 | 814 | ppi8255_init(&pc8801_8255_config); |
| 815 | 815 | if (!use_5FD) |
| 816 | 816 | cpunum_suspend(1, SUSPEND_REASON_DISABLE, 1); |
| r1877 | r1878 | |
|---|---|---|
| 31 | 31 | UINT8 *pet_videoram; |
| 32 | 32 | static UINT8 *pet80_bank1_base; |
| 33 | 33 | |
| 34 | static READ8_HANDLER( pet_mc6845_register_r ) | |
| 35 | { | |
| 36 | device_config *devconf = (device_config *) device_list_find_by_tag(machine->config->devicelist, MC6845, "crtc"); | |
| 37 | return mc6845_register_r(devconf, offset); | |
| 38 | } | |
| 39 | ||
| 40 | static WRITE8_HANDLER( pet_mc6845_register_w ) | |
| 41 | { | |
| 42 | device_config *devconf = (device_config *) device_list_find_by_tag(machine->config->devicelist, MC6845, "crtc"); | |
| 43 | mc6845_register_w(devconf, offset, data); | |
| 44 | } | |
| 45 | ||
| 46 | static WRITE8_HANDLER( pet_mc6845_address_w ) | |
| 47 | { | |
| 48 | device_config *devconf = (device_config *) device_list_find_by_tag(machine->config->devicelist, MC6845, "crtc"); | |
| 49 | mc6845_address_w(devconf, offset, data); | |
| 50 | } | |
| 51 | ||
| 34 | 52 | /* pia at 0xe810 |
| 35 | 53 | port a |
| 36 | 54 | 7 sense input (low for diagnostics) |
| r1877 | r1878 | |
| 249 | 267 | static WRITE8_HANDLER(cbm8096_io_w) |
| 250 | 268 | { |
| 251 | 269 | if (offset<0x10) ; |
| 252 | else if (offset<0x14) pia_0_w(offset&3,data); | |
| 270 | else if (offset<0x14) pia_0_w(machine, offset&3,data); | |
| 253 | 271 | else if (offset<0x20) ; |
| 254 | else if (offset<0x24) pia_1_w(offset&3,data); | |
| 272 | else if (offset<0x24) pia_1_w(machine, offset&3,data); | |
| 255 | 273 | else if (offset<0x40) ; |
| 256 | else if (offset<0x50) via_0_w(offset&0xf,data); | |
| 274 | else if (offset<0x50) via_0_w(machine, offset&0xf,data); | |
| 257 | 275 | else if (offset<0x80) ; |
| 258 | else if (offset == 0x80) pet_mc6845_address_w(offset, data); | |
| 259 | else if (offset == 0x81) pet_mc6845_register_w(offset, data); | |
| 276 | else if (offset == 0x80) pet_mc6845_address_w(machine, offset, data); | |
| 277 | else if (offset == 0x81) pet_mc6845_register_w(machine, offset, data); | |
| 260 | 278 | } |
| 261 | 279 | |
| 262 | static | |
| 280 | static | |
| 263 | 281 | { |
| 264 | 282 | int data=0xff; |
| 265 | 283 | if (offset<0x10) ; |
| 266 | else if (offset<0x14) data=pia_0_r(offset&3); | |
| 284 | else if (offset<0x14) data=pia_0_r(machine, offset&3); | |
| 267 | 285 | else if (offset<0x20) ; |
| 268 | else if (offset<0x24) data=pia_1_r(offset&3); | |
| 286 | else if (offset<0x24) data=pia_1_r(machine, offset&3); | |
| 269 | 287 | else if (offset<0x40) ; |
| 270 | else if (offset<0x50) data=via_0_r(offset&0xf); | |
| 288 | else if (offset<0x50) data=via_0_r(machine, offset&0xf); | |
| 271 | 289 | else if (offset<0x80) ; |
| 272 | else if (offset == 0x81) data=pet_mc6845_register_r(offset); | |
| 290 | else if (offset == 0x81) data=pet_mc6845_register_r(machine, offset); | |
| 273 | 291 | return data; |
| 274 | 292 | } |
| 275 | 293 | |
| r1877 | r1878 | |
| 290 | 308 | */ |
| 291 | 309 | WRITE8_HANDLER(cbm8096_w) |
| 292 | 310 | { |
| 293 | read8_handler rh; | |
| 294 | write8_handler wh; | |
| 311 | read8_machine_func rh; | |
| 312 | write8_machine_func wh; | |
| 295 | 313 | |
| 296 | 314 | if (data&0x80) |
| 297 | 315 | { |
| r1877 | r1878 | |
| 434 | 452 | { |
| 435 | 453 | static int level=0; |
| 436 | 454 | |
| 437 | pia_0_cb1_w(0,level); | |
| 455 | pia_0_cb1_w(machine, 0,level); | |
| 438 | 456 | level=!level; |
| 439 | 457 | } |
| 440 | 458 | |
| r1877 | r1878 | |
| 558 | 576 | { |
| 559 | 577 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfff0, 0xfff0, 0, 0, MWA8_NOP); |
| 560 | 578 | } |
| 561 | cbm8096_w(0,0); | |
| 579 | cbm8096_w(machine, 0, 0); | |
| 562 | 580 | } |
| 563 | 581 | |
| 564 | 582 | cbm_drive_0_config (IEEE8ON ? IEEE : 0, 8); |
| r1877 | r1878 | |
|---|---|---|
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | static void c16_common_driver_init ( | |
| 384 | static void c16_common_driver_init (running_machine *machine) | |
| 385 | 385 | { |
| 386 | 386 | #ifdef VC1541 |
| 387 | 387 | VC1541_CONFIG vc1541= { 1, 8 }; |
| r1877 | r1878 | |
| 392 | 392 | cpunum_set_info_fct(0, CPUINFO_PTR_M6510_PORTREAD, (genf *) c16_m7501_port_read); |
| 393 | 393 | cpunum_set_info_fct(0, CPUINFO_PTR_M6510_PORTWRITE, (genf *) c16_m7501_port_write); |
| 394 | 394 | |
| 395 | c16_select_roms (0, 0); | |
| 396 | c16_switch_to_rom (0, 0); | |
| 395 | c16_select_roms (machine, 0, 0); | |
| 396 | c16_switch_to_rom (machine, 0, 0); | |
| 397 | 397 | |
| 398 | 398 | if (REAL_C1551) { |
| 399 | 399 | tpi6525[2].a.read=c1551x_0_read_data; |
| r1877 | r1878 | |
| 441 | 441 | #endif |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | void c16_driver_init( | |
| 444 | void c16_driver_init(running_machine *machine) | |
| 445 | 445 | { |
| 446 | c16_common_driver_init (); | |
| 446 | c16_common_driver_init (machine); | |
| 447 | 447 | ted7360_init (C16_PAL); |
| 448 | 448 | ted7360_set_dma (ted7360_dma_read, ted7360_dma_read_rom); |
| 449 | 449 | } |
| r1877 | r1878 | |
| 454 | 454 | mess_ram[(0x5400 + offset) % mess_ram_size] = data; |
| 455 | 455 | mess_ram[(0x9400 + offset) % mess_ram_size] = data; |
| 456 | 456 | mess_ram[(0xd400 + offset) % mess_ram_size] = data; |
| 457 | sid6581_0_port_w(offset,data); | |
| 457 | sid6581_0_port_w(machine, offset,data); | |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | static WRITE8_HANDLER(c16_sidcart_64k) |
| 461 | 461 | { |
| 462 | 462 | mess_ram[(0xd400 + offset) % mess_ram_size] = data; |
| 463 | sid6581_0_port_w(offset,data); | |
| 463 | sid6581_0_port_w(machine, offset,data); | |
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | MACHINE_RESET( c16 ) |
| r1877 | r1878 | |
|---|---|---|
| 172 | 172 | /* if psg is in read register state return reg data */ |
| 173 | 173 | if (oric_psg_control==0x01) |
| 174 | 174 | { |
| 175 | return AY8910_read_port_0_r(0); | |
| 175 | return AY8910_read_port_0_r(machine, 0); | |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | /* return high-impedance */ |
| r1877 | r1878 | |
| 199 | 199 | /* read/write data depending on state of bdir, bc1 pins and data output to psg */ |
| 200 | 200 | static void oric_psg_connection_refresh(void) |
| 201 | 201 | { |
| 202 | running_machine *machine = Machine; | |
| 203 | ||
| 202 | 204 | if (oric_psg_control!=0) |
| 203 | 205 | { |
| 204 | 206 | switch (oric_psg_control) |
| r1877 | r1878 | |
| 209 | 211 | /* read register data */ |
| 210 | 212 | case 1: |
| 211 | 213 | { |
| 212 | //oric_via_port_a_data = AY8910_read_port_0_r(0); | |
| 214 | //oric_via_port_a_data = AY8910_read_port_0_r(machine, 0); | |
| 213 | 215 | } |
| 214 | 216 | break; |
| 215 | 217 | /* write register data */ |
| 216 | 218 | case 2: |
| 217 | 219 | { |
| 218 | AY8910_write_port_0_w | |
| 220 | AY8910_write_port_0_w | |
| 219 | 221 | } |
| 220 | 222 | break; |
| 221 | 223 | /* write register index */ |
| 222 | 224 | case 3: |
| 223 | 225 | { |
| 224 | AY8910_control_port_0_w | |
| 226 | AY8910_control_port_0_w | |
| 225 | 227 | } |
| 226 | 228 | break; |
| 227 | 229 | |
| r1877 | r1878 | |
| 593 | 595 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_w); |
| 594 | 596 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0380, 0x0383, 0, 0, apple2_v2_interface_w); |
| 595 | 597 | |
| 596 | apple2_v2_interface_w(0,0); | |
| 598 | apple2_v2_interface_w(Machine, 0, 0); | |
| 597 | 599 | } |
| 598 | 600 | |
| 599 | 601 | /********************/ |
| r1877 | r1878 | |
| 722 | 724 | { |
| 723 | 725 | /* jasmin floppy disc interface */ |
| 724 | 726 | case 0x04: |
| 725 | data = wd17xx_status_r(0); | |
| 727 | data = wd17xx_status_r(machine, 0); | |
| 726 | 728 | break; |
| 727 | 729 | case 0x05: |
| 728 | data =wd17xx_track_r(0); | |
| 730 | data =wd17xx_track_r(machine, 0); | |
| 729 | 731 | break; |
| 730 | 732 | case 0x06: |
| 731 | data = wd17xx_sector_r(0); | |
| 733 | data = wd17xx_sector_r(machine, 0); | |
| 732 | 734 | break; |
| 733 | 735 | case 0x07: |
| 734 | data = wd17xx_data_r(0); | |
| 736 | data = wd17xx_data_r(machine, 0); | |
| 735 | 737 | break; |
| 736 | 738 | default: |
| 737 | data = via_0_r(offset & 0x0f); | |
| 739 | data = via_0_r(machine, offset & 0x0f); | |
| 738 | 740 | logerror("unhandled io read: %04x %02x\n", offset, data); |
| 739 | 741 | break; |
| 740 | 742 | |
| r1877 | r1878 | |
| 749 | 751 | { |
| 750 | 752 | /* microdisc floppy disc interface */ |
| 751 | 753 | case 0x04: |
| 752 | wd17xx_command_w(0,data); | |
| 754 | wd17xx_command_w(machine, 0, data); | |
| 753 | 755 | break; |
| 754 | 756 | case 0x05: |
| 755 | wd17xx_track_w(0,data); | |
| 757 | wd17xx_track_w(machine, 0, data); | |
| 756 | 758 | break; |
| 757 | 759 | case 0x06: |
| 758 | wd17xx_sector_w(0,data); | |
| 760 | wd17xx_sector_w(machine, 0, data); | |
| 759 | 761 | break; |
| 760 | 762 | case 0x07: |
| 761 | wd17xx_data_w(0,data); | |
| 763 | wd17xx_data_w(machine, 0, data); | |
| 762 | 764 | break; |
| 763 | 765 | /* bit 0 = side */ |
| 764 | 766 | case 0x08: |
| r1877 | r1878 | |
| 787 | 789 | break; |
| 788 | 790 | |
| 789 | 791 | default: |
| 790 | via_0_w(offset & 0x0f, data); | |
| 792 | via_0_w(machine, offset & 0x0f, data); | |
| 791 | 793 | break; |
| 792 | 794 | } |
| 793 | 795 | } |
| r1877 | r1878 | |
| 954 | 956 | { |
| 955 | 957 | /* microdisc floppy disc interface */ |
| 956 | 958 | case 0x00: |
| 957 | data = wd17xx_status_r(0); | |
| 959 | data = wd17xx_status_r(machine, 0); | |
| 958 | 960 | break; |
| 959 | 961 | case 0x01: |
| 960 | data =wd17xx_track_r(0); | |
| 962 | data =wd17xx_track_r(machine, 0); | |
| 961 | 963 | break; |
| 962 | 964 | case 0x02: |
| 963 | data = wd17xx_sector_r(0); | |
| 965 | data = wd17xx_sector_r(machine, 0); | |
| 964 | 966 | break; |
| 965 | 967 | case 0x03: |
| 966 | data = wd17xx_data_r(0); | |
| 968 | data = wd17xx_data_r(machine, 0); | |
| 967 | 969 | break; |
| 968 | 970 | case 0x04: |
| 969 | 971 | data = port_314_r | 0x07f; |
| r1877 | r1878 | |
| 975 | 977 | break; |
| 976 | 978 | |
| 977 | 979 | default: |
| 978 | data = via_0_r(offset & 0x0f); | |
| 980 | data = via_0_r(machine, offset & 0x0f); | |
| 979 | 981 | break; |
| 980 | 982 | |
| 981 | 983 | } |
| r1877 | r1878 | |
| 989 | 991 | { |
| 990 | 992 | /* microdisc floppy disc interface */ |
| 991 | 993 | case 0x00: |
| 992 | wd17xx_command_w(0,data); | |
| 994 | wd17xx_command_w(machine, 0, data); | |
| 993 | 995 | break; |
| 994 | 996 | case 0x01: |
| 995 | wd17xx_track_w(0,data); | |
| 997 | wd17xx_track_w(machine, 0, data); | |
| 996 | 998 | break; |
| 997 | 999 | case 0x02: |
| 998 | wd17xx_sector_w(0,data); | |
| 1000 | wd17xx_sector_w(machine, 0, data); | |
| 999 | 1001 | break; |
| 1000 | 1002 | case 0x03: |
| 1001 | wd17xx_data_w(0,data); | |
| 1003 | wd17xx_data_w(machine, 0, data); | |
| 1002 | 1004 | break; |
| 1003 | 1005 | case 0x04: |
| 1004 | 1006 | { |
| r1877 | r1878 | |
| 1031 | 1033 | break; |
| 1032 | 1034 | |
| 1033 | 1035 | default: |
| 1034 | via_0_w(offset & 0x0f, data); | |
| 1036 | via_0_w(machine, offset & 0x0f, data); | |
| 1035 | 1037 | break; |
| 1036 | 1038 | } |
| 1037 | 1039 | } |
| r1877 | r1878 | |
| 1228 | 1230 | } |
| 1229 | 1231 | } |
| 1230 | 1232 | /* it is repeated */ |
| 1231 | return via_0_r(offset & 0x0f); | |
| 1233 | return via_0_r(machine, offset & 0x0f); | |
| 1232 | 1234 | } |
| 1233 | 1235 | |
| 1234 | 1236 | WRITE8_HANDLER ( oric_IO_w ) |
| r1877 | r1878 | |
| 1267 | 1269 | logerror("via 0 w: %04x %02x %04x\n",offset,data,(unsigned) cpunum_get_reg(0, REG_PC)); |
| 1268 | 1270 | } |
| 1269 | 1271 | |
| 1270 | via_0_w(offset & 0x0f,data); | |
| 1272 | via_0_w(machine, offset & 0x0f,data); | |
| 1271 | 1273 | } |
| 1272 | 1274 | |
| 1273 | 1275 | |
| r1877 | r1878 | |
| 1344 | 1346 | |
| 1345 | 1347 | static void telestrat_refresh_mem(void) |
| 1346 | 1348 | { |
| 1347 | read8_handler rh; | |
| 1348 | write8_handler wh; | |
| 1349 | read8_machine_func rh; | |
| 1350 | write8_machine_func wh; | |
| 1349 | 1351 | |
| 1350 | 1352 | struct telestrat_mem_block *mem_block = &telestrat_blocks[telestrat_bank_selection]; |
| 1351 | 1353 |
| r1877 | r1878 | |
|---|---|---|
| 123 | 123 | } |
| 124 | 124 | break; |
| 125 | 125 | case 0xa: |
| 126 | europc_rtc_w(0, data); | |
| 126 | europc_rtc_w(machine, 0, data); | |
| 127 | 127 | return; |
| 128 | 128 | } |
| 129 | 129 | logerror("jim write %.2x %.2x\n",offset,data); |
| 130 | 130 | europc_jim.data[offset]=data; |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | ||
| 133 | ||
| 134 | 134 | { |
| 135 | 135 | int data=0; |
| 136 | 136 | switch(offset) { |
| 137 | 137 | case 4: case 5: case 6: case 7: data=europc_jim.data[offset];break; |
| 138 | 138 | case 0: case 1: case 2: case 3: data=0;break; |
| 139 | case 0xa: return europc_rtc_r(0); | |
| 139 | case 0xa: return europc_rtc_r(machine, 0); | |
| 140 | 140 | } |
| 141 | 141 | return data; |
| 142 | 142 | } |
| r1877 | r1878 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | int val = 0x40; |
| 71 | 71 | |
| 72 | if ((input | |
| 72 | if ((readinput | |
| 73 | 73 | val |= 0x01; |
| 74 | if ((input | |
| 74 | if ((readinput | |
| 75 | 75 | val |= 0x02; |
| 76 | if ((input | |
| 76 | if ((readinput | |
| 77 | 77 | val |= 0x04; |
| 78 | if ((input | |
| 78 | if ((readinput | |
| 79 | 79 | val |= 0x08; |
| 80 | if ((input | |
| 80 | if ((readinput | |
| 81 | 81 | val |= 0x10; |
| 82 | if ((input | |
| 82 | if ((readinput | |
| 83 | 83 | val |= 0x20; |
| 84 | 84 | |
| 85 | 85 | return val; |
| r1877 | r1878 | |
| 138 | 138 | mess_image *img = image_from_devtype_and_index(IO_CASSETTE, 0); |
| 139 | 139 | int val = 0xed; |
| 140 | 140 | |
| 141 | if ((input | |
| 141 | if ((readinput | |
| 142 | 142 | val |= 0x02; |
| 143 | 143 | |
| 144 | 144 | if (cassette_input(img) >= 0) |
| r1877 | r1878 | |
|---|---|---|
| 428 | 428 | case 2: |
| 429 | 429 | case 3: |
| 430 | 430 | /* 8271 registers */ |
| 431 | return i8271_r(offset); | |
| 431 | return i8271_r(machine, offset); | |
| 432 | 432 | case 4: |
| 433 | return i8271_data_r(offset); | |
| 433 | return i8271_data_r(machine, offset); | |
| 434 | 434 | default: |
| 435 | 435 | break; |
| 436 | 436 | } |
| r1877 | r1878 | |
| 447 | 447 | case 2: |
| 448 | 448 | case 3: |
| 449 | 449 | /* 8271 registers */ |
| 450 | i8271_w(offset, data); | |
| 450 | i8271_w(machine, offset, data); | |
| 451 | 451 | return; |
| 452 | 452 | case 4: |
| 453 | i8271_data_w(offset, data); | |
| 453 | i8271_data_w(machine, offset, data); | |
| 454 | 454 | return; |
| 455 | 455 | default: |
| 456 | 456 | break; |
| r1877 | r1878 | |
|---|---|---|
| 40 | 40 | { |
| 41 | 41 | int inport0,inport1,inport6,data; |
| 42 | 42 | |
| 43 | inport0 = input_port_0_r(0); | |
| 44 | inport1 = input_port_1_r(0); | |
| 45 | inport6 = input_port_6_r(0); | |
| 43 | inport0 = readinputport(0); | |
| 44 | inport1 = readinputport(1); | |
| 45 | inport6 = readinputport(6); | |
| 46 | 46 | |
| 47 | 47 | /* Numeric pad buttons are not independent on a real ColecoVision, if you push more |
| 48 | 48 | than one, a real ColecoVision think that it is a third button, so we are going to emulate |
| r1877 | r1878 | |
| 69 | 69 | /* Joystick and fire 2 (SAC Red Button) */ |
| 70 | 70 | else |
| 71 | 71 | { |
| 72 | int data = input_port_2_r(0) & 0xCF; | |
| 73 | int inport6 = input_port_6_r(0); | |
| 72 | int data = readinputport(2) & 0xCF; | |
| 73 | int inport6 = readinputport(6); | |
| 74 | 74 | |
| 75 | 75 | if (inport6&0x07) /* If Extra Contollers enabled */ |
| 76 | 76 | { |
| r1877 | r1878 | |
| 88 | 88 | { |
| 89 | 89 | int inport3,inport4,data; |
| 90 | 90 | |
| 91 | inport3 = input_port_3_r(0); | |
| 92 | inport4 = input_port_4_r(0); | |
| 91 | inport3 = readinputport(3); | |
| 92 | inport4 = readinputport(4); | |
| 93 | 93 | |
| 94 | 94 | /* Numeric pad buttons are not independent on a real ColecoVision, if you push more |
| 95 | 95 | than one, a real ColecoVision think that it is a third button, so we are going to emulate |
| r1877 | r1878 | |
| 114 | 114 | /* Joystick and fire 2*/ |
| 115 | 115 | else |
| 116 | 116 | { |
| 117 | int data = input_port_5_r(0) & 0xCF; | |
| 118 | int inport6 = input_port_6_r(0); | |
| 117 | int data = readinputport(5) & 0xCF; | |
| 118 | int inport6 = readinputport(6); | |
| 119 | 119 | |
| 120 | 120 | if (inport6&0x02) /* If Roller Controller enabled */ |
| 121 | 121 | { |
| r1877 | r1878 | |
|---|---|---|
| 92 | 92 | |
| 93 | 93 | |
| 94 | 94 | |
| 95 | static void at_map_vga_memory(offs_t begin, offs_t end, read8_ | |
| 95 | static void at_map_vga_memory(offs_t begin, offs_t end, read8_machin | |
| 96 | 96 | { |
| 97 | 97 | int buswidth; |
| 98 | 98 | buswidth = cputype_databus_width(Machine->config->cpu[0].type, ADDRESS_SPACE_PROGRAM); |
| r1877 | r1878 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | /* prototypes */ |
| 36 | static int usbsm_cru_r(int offset); | |
| 37 | static void usbsm_cru_w(int offset, int data); | |
| 36 | static int usbsm_cru_r(running_machine *machine, int offset); | |
| 37 | static void usbsm_cru_w(running_machine *machine, int offset, int data); | |
| 38 | 38 | static READ8_HANDLER(usbsm_mem_r); |
| 39 | 39 | static WRITE8_HANDLER(usbsm_mem_w); |
| 40 | 40 | static UINT16 usbsm_mem_16_r(offs_t offset); |
| r1877 | r1878 | |
| 100 | 100 | /* |
| 101 | 101 | Read USB-SmartMedia CRU interface |
| 102 | 102 | */ |
| 103 | static int usbsm_cru_r(int offset) | |
| 103 | static int usbsm_cru_r(running_machine *machine, int offset) | |
| 104 | 104 | { |
| 105 | 105 | int reply = 0; |
| 106 | 106 | |
| r1877 | r1878 | |
| 138 | 138 | /* |
| 139 | 139 | Write USB-SmartMedia CRU interface |
| 140 | 140 | */ |
| 141 | static void usbsm_cru_w(int offset, int data) | |
| 141 | static void usbsm_cru_w(running_machine *machine, int offset, int data) | |
| 142 | 142 | { |
| 143 | 143 | offset &= 31; |
| 144 | 144 |
| r1877 | r1878 | |
|---|---|---|
| 574 | 574 | cbm_drive_1_config (SERIAL, 9); |
| 575 | 575 | } |
| 576 | 576 | via_reset (); |
| 577 | via_0_ca1_w | |
| 577 | via_0_ca1_w | |
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | static int vc20_rom_id(mess_image *image) |
| r1877 | r1878 | |
| 713 | 713 | |
| 714 | 714 | INTERRUPT_GEN( vc20_frame_interrupt ) |
| 715 | 715 | { |
| 716 | via_0_ca1_w | |
| 716 | via_0_ca1_w | |
| 717 | 717 | keyboard[0] = readinputportbytag( TAG_KEYBOARD_ROW0 ); |
| 718 | 718 | keyboard[1] = readinputportbytag( TAG_KEYBOARD_ROW1 ); |
| 719 | 719 | keyboard[2] = readinputportbytag( TAG_KEYBOARD_ROW2 ); |
| r1877 | r1878 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | **********************************************************************/ |
| 13 | 13 | |
| 14 | #include "driver.h" | |
| 15 | #include "deprecat.h" | |
| 14 | 16 | #include "machine/pc_fdc.h" |
| 15 | 17 | #include "machine/nec765.h" |
| 16 | 18 | #include "memconv.h" |
| r1877 | r1878 | |
| 160 | 162 | /* if dma is not enabled, dacks are not acknowledged */ |
| 161 | 163 | if ((fdc->digital_output_register & PC_FDC_FLAGS_DOR_DMA_ENABLED)!=0) |
| 162 | 164 | { |
| 163 | data = nec765_dack_r(0); | |
| 165 | data = nec765_dack_r(Machine, 0); | |
| 164 | 166 | } |
| 165 | 167 | |
| 166 | 168 | return data; |
| r1877 | r1878 | |
| 174 | 176 | if ((fdc->digital_output_register & PC_FDC_FLAGS_DOR_DMA_ENABLED)!=0) |
| 175 | 177 | { |
| 176 | 178 | /* dma acknowledge - and send byte to fdc */ |
| 177 | nec765_dack_w(0,data); | |
| 179 | nec765_dack_w(Machine, 0,data); | |
| 178 | 180 | } |
| 179 | 181 | } |
| 180 | 182 | |
| r1877 | r1878 | |
| 324 | 326 | case 3: /* tape drive select? */ |
| 325 | 327 | break; |
| 326 | 328 | case 4: |
| 327 | data = nec765_status_r(0); | |
| 329 | data = nec765_status_r(machine, 0); | |
| 328 | 330 | break; |
| 329 | 331 | case 5: |
| 330 | data = nec765_data_r(offset); | |
| 332 | data = nec765_data_r(machine, offset); | |
| 331 | 333 | break; |
| 332 | 334 | case 6: /* FDC reserved */ |
| 333 | 335 | break; |
| r1877 | r1878 | |
| 363 | 365 | pc_fdc_data_rate_w(data); |
| 364 | 366 | break; |
| 365 | 367 | case 5: |
| 366 | nec765_data_w(0, data); | |
| 368 | nec765_data_w(machine, 0, data); | |
| 367 | 369 | break; |
| 368 | 370 | case 6: |
| 369 | 371 | /* FDC reserved */ |
| r1877 | r1878 | |
| 382 | 384 | } |
| 383 | 385 | } |
| 384 | 386 | |
| 385 | READ16_HANDLER( pc16le_fdc_r ) { return read16le_with_read8_handler(pc_fdc_r, offset, mem_mask); } | |
| 386 | WRITE16_HANDLER( pc16le_fdc_w ) { write16le_with_write8_handler(pc_fdc_w, offset, data, mem_mask); } | |
| 387 | READ16_HANDLER( pc16le_fdc_r ) { return read16le_with_read8_handler(pc_fdc_r, machine, offset, mem_mask); } | |
| 388 | WRITE16_HANDLER( pc16le_fdc_w ) { write16le_with_write8_handler(pc_fdc_w, machine, offset, data, mem_mask); } | |
| 387 | 389 | |
| 388 | READ32_HANDLER( pc32le_fdc_r ) { return read32le_with_read8_handler(pc_fdc_r, offset, mem_mask); } | |
| 389 | WRITE32_HANDLER( pc32le_fdc_w ) { write32le_with_write8_handler(pc_fdc_w, offset, data, mem_mask); } | |
| 390 | READ32_HANDLER( pc32le_fdc_r ) { return read32le_with_read8_handler(pc_fdc_r, machine, offset, mem_mask); } | |
| 391 | WRITE32_HANDLER( pc32le_fdc_w ) { write32le_with_write8_handler(pc_fdc_w, machine, offset, data, mem_mask); } | |
| 390 | 392 | |
| 391 | READ64_HANDLER( pc64be_fdc_r ) { return read64be_with_read8_handler(pc_fdc_r, offset, mem_mask); } | |
| 392 | WRITE64_HANDLER( pc64be_fdc_w ) { write64be_with_write8_handler(pc_fdc_w, offset, data, mem_mask); } | |
| 393 | READ64_HANDLER( pc64be_fdc_r ) { return read64be_with_read8_handler(pc_fdc_r, machine, offset, mem_mask); } | |
| 394 | WRITE64_HANDLER( pc64be_fdc_w ) { write64be_with_write8_handler(pc_fdc_w,machine, offset, data, mem_mask); } | |
| 393 | 395 |
| r1877 | r1878 | |
|---|---|---|
| 719 | 719 | static UINT8 pc_HDC_r(int chip, offs_t offs) |
| 720 | 720 | { |
| 721 | 721 | UINT8 data = 0xff; |
| 722 | if( !(input | |
| 722 | if( !(readinput | |
| 723 | 723 | return data; |
| 724 | 724 | switch( offs ) |
| 725 | 725 | { |
| r1877 | r1878 | |
| 742 | 742 | if (LOG_HDC_CALL) |
| 743 | 743 | logerror("pc_HDC_w(): chip=%d offs=%d data=0x%02x\n", chip, offs, data); |
| 744 | 744 | |
| 745 | if( !(input | |
| 745 | if( !(readinput | |
| 746 | 746 | return; |
| 747 | 747 | |
| 748 | 748 | switch( offs ) |
| r1877 | r1878 | |
| 766 | 766 | WRITE8_HANDLER ( pc_HDC1_w ) { pc_HDC_w(0, offset, data); } |
| 767 | 767 | WRITE8_HANDLER ( pc_HDC2_w ) { pc_HDC_w(1, offset, data); } |
| 768 | 768 | |
| 769 | READ16_HANDLER ( pc16le_HDC1_r ) { return read16le_with_read8_handler(pc_HDC1_r, offset, mem_mask); } | |
| 770 | READ16_HANDLER ( pc16le_HDC2_r ) { return read16le_with_read8_handler(pc_HDC2_r, offset, mem_mask); } | |
| 771 | WRITE16_HANDLER ( pc16le_HDC1_w ) { write16le_with_write8_handler(pc_HDC1_w, offset, data, mem_mask); } | |
| 772 | WRITE16_HANDLER ( pc16le_HDC2_w ) { write16le_with_write8_handler(pc_HDC2_w, offset, data, mem_mask); } | |
| 769 | READ16_HANDLER ( pc16le_HDC1_r ) { return read16le_with_read8_handler(pc_HDC1_r, machine, offset, mem_mask); } | |
| 770 | READ16_HANDLER ( pc16le_HDC2_r ) { return read16le_with_read8_handler(pc_HDC2_r, machine, offset, mem_mask); } | |
| 771 | WRITE16_HANDLER ( pc16le_HDC1_w ) { write16le_with_write8_handler(pc_HDC1_w, machine, offset, data, mem_mask); } | |
| 772 | WRITE16_HANDLER ( pc16le_HDC2_w ) { write16le_with_write8_handler(pc_HDC2_w, machine, offset, data, mem_mask); } | |
| 773 | 773 | |
| 774 | READ32_HANDLER ( pc32le_HDC1_r ) { return read32le_with_read8_handler(pc_HDC1_r, offset, mem_mask); } | |
| 775 | READ32_HANDLER ( pc32le_HDC2_r ) { return read32le_with_read8_handler(pc_HDC2_r, offset, mem_mask); } | |
| 776 | WRITE32_HANDLER ( pc32le_HDC1_w ) { write32le_with_write8_handler(pc_HDC1_w, offset, data, mem_mask); } | |
| 777 | WRITE32_HANDLER ( pc32le_HDC2_w ) { write32le_with_write8_handler(pc_HDC2_w, offset, data, mem_mask); } | |
| 774 | READ32_HANDLER ( pc32le_HDC1_r ) { return read32le_with_read8_handler(pc_HDC1_r, machine, offset, mem_mask); } | |
| 775 | READ32_HANDLER ( pc32le_HDC2_r ) { return read32le_with_read8_handler(pc_HDC2_r, machine, offset, mem_mask); } | |
| 776 | WRITE32_HANDLER ( pc32le_HDC1_w ) { write32le_with_write8_handler(pc_HDC1_w, machine, offset, data, mem_mask); } | |
| 777 | WRITE32_HANDLER ( pc32le_HDC2_w ) { write32le_with_write8_handler(pc_HDC2_w, machine, offset, data, mem_mask); } |
| r1877 | r1878 | |
|---|---|---|
| 29 | 29 | /* prototypes */ |
| 30 | 30 | static void ide_interrupt_callback(int state); |
| 31 | 31 | |
| 32 | static int ide_cru_r(int offset); | |
| 33 | static void ide_cru_w(int offset, int data); | |
| 34 | static READ8_HANDLER(ide_mem_r); | |
| 32 | static int ide_cru_r(running_machine *machine, int offset); | |
| 33 | static void ide_cru_w(running_machine *machine, int offset, int data); | |
| 34 | static READ8_HANDLER(ide_mem_r); | |
| 35 | 35 | static WRITE8_HANDLER(ide_mem_w); |
| 36 | 36 | |
| 37 | 37 | /* pointer to the IDE RAM area */ |
| r1877 | r1878 | |
| 167 | 167 | /* |
| 168 | 168 | Read ide CRU interface |
| 169 | 169 | */ |
| 170 | static int ide_cru_r(int offset) | |
| 170 | static int ide_cru_r(running_machine *machine, int offset) | |
| 171 | 171 | { |
| 172 | 172 | int reply; |
| 173 | 173 | |
| r1877 | r1878 | |
| 191 | 191 | /* |
| 192 | 192 | Write ide CRU interface |
| 193 | 193 | */ |
| 194 | static void ide_cru_w(int offset, int data) | |
| 194 | static void ide_cru_w(running_machine *machine, int offset, int data) | |
| 195 | 195 | { |
| 196 | 196 | offset &= 7; |
| 197 | 197 |
| r1877 | r1878 | |
|---|---|---|
| 149 | 149 | if (pc_ppi.portc_switch_high) |
| 150 | 150 | { |
| 151 | 151 | /* read hi nibble of S2 */ |
| 152 | data = (data&0xf0)|((input | |
| 152 | data = (data&0xf0)|((readinput | |
| 153 | 153 | PIO_LOG(1,"PIO_C_r (hi)",("$%02x\n", data)); |
| 154 | 154 | } |
| 155 | 155 | else |
| 156 | 156 | { |
| 157 | 157 | /* read lo nibble of S2 */ |
| 158 | data = (data&0xf0)|(input | |
| 158 | data = (data&0xf0)|(readinput | |
| 159 | 159 | PIO_LOG(1,"PIO_C_r (lo)",("$%02x\n", data)); |
| 160 | 160 | } |
| 161 | 161 | |
| r1877 | r1878 | |
| 243 | 243 | } |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | READ16_HANDLER( pc16le_rtc_r ) { return read16le_with_read8_handler(pc_rtc_r, offset, mem_mask); } | |
| 247 | WRITE16_HANDLER( pc16le_rtc_w ) { write16le_with_write8_handler(pc_rtc_w, offset, data, mem_mask); } | |
| 246 | READ16_HANDLER( pc16le_rtc_r ) { return read16le_with_read8_handler(pc_rtc_r, machine, offset, mem_mask); } | |
| 247 | WRITE16_HANDLER( pc16le_rtc_w ) { write16le_with_write8_handler(pc_rtc_w, machine, offset, data, mem_mask); } | |
| 248 | 248 | |
| 249 | 249 | /************************************************************************* |
| 250 | 250 | * |
| r1877 | r1878 | |
|---|---|---|
| 284 | 284 | { |
| 285 | 285 | mc68901_t *chip = ptr; |
| 286 | 286 | |
| 287 | UINT8 gpio = chip->intf->gpio_r(0); | |
| 287 | UINT8 gpio = chip->intf->gpio_r(machine, 0); | |
| 288 | 288 | |
| 289 | 289 | UINT8 gpold = (chip->gpip & ~chip->ddr) ^ chip->aer; |
| 290 | 290 | UINT8 gpnew = (gpio & ~chip->ddr) ^ chip->aer; |
| r1877 | r1878 | |
| 708 | 708 | |
| 709 | 709 | if (chip->intf->gpio_w) |
| 710 | 710 | { |
| 711 | chip->intf->gpio_w(0, chip->gpip); | |
| 711 | chip->intf->gpio_w(Machine, 0, chip->gpip); | |
| 712 | 712 | } |
| 713 | 713 | break; |
| 714 | 714 |
| r1877 | r1878 | |
|---|---|---|
| 15 | 15 | #include "amiga.h" |
| 16 | 16 | #include "amigafdc.h" |
| 17 | 17 | #include "machine/6526cia.h" |
| 18 | #include "deprecat.h" | |
| 18 | 19 | |
| 19 | 20 | |
| 20 | 21 | #define MAX_TRACK_BYTES 12500 |
| r1877 | r1878 | |
| 267 | 268 | if ( fdc_status[drive].mfm[cur_pos-2] == ( ( sync >> 8 ) & 0xff ) && |
| 268 | 269 | fdc_status[drive].mfm[cur_pos-1] == ( sync & 0xff ) ) |
| 269 | 270 | { |
| 270 | amiga_custom_w(REG_INTREQ, 0x8000 | INTENA_DSKSYN, 0); | |
| 271 | amiga_custom_w(machine, REG_INTREQ, 0x8000 | INTENA_DSKSYN, 0); | |
| 271 | 272 | } |
| 272 | 273 | |
| 273 | 274 | if ( sector < 10 ) |
| r1877 | r1878 | |
| 309 | 310 | { |
| 310 | 311 | logerror("Write to disk unsupported yet\n" ); |
| 311 | 312 | |
| 312 | amiga_custom_w(REG_INTREQ, 0x8000 | INTENA_DSKBLK, 0); | |
| 313 | amiga_custom_w(machine, REG_INTREQ, 0x8000 | INTENA_DSKBLK, 0); | |
| 313 | 314 | } |
| 314 | 315 | } |
| 315 | 316 | else |
| r1877 | r1878 | |
| 342 | 343 | |
| 343 | 344 | if ( fdc_status[drive].len <= 0 ) |
| 344 | 345 | { |
| 345 | amiga_custom_w(REG_INTREQ, 0x8000 | INTENA_DSKBLK, 0); | |
| 346 | amiga_custom_w(machine, REG_INTREQ, 0x8000 | INTENA_DSKBLK, 0); | |
| 346 | 347 | } |
| 347 | 348 | else |
| 348 | 349 | { |
| r1877 | r1878 | |
| 373 | 374 | |
| 374 | 375 | if ( drive == -1 ) { |
| 375 | 376 | logerror("Disk DMA started with no drive selected!\n" ); |
| 376 | amiga_custom_w(REG_INTREQ, 0x8000 | INTENA_DSKBLK, 0); | |
| 377 | amiga_custom_w(Machine, REG_INTREQ, 0x8000 | INTENA_DSKBLK, 0); | |
| 377 | 378 | return; |
| 378 | 379 | } |
| 379 | 380 |
| r1877 | r1878 | |
|---|---|---|
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "deprecat.h" | |
| 11 | 12 | #include "z80dart.h" |
| 12 | 13 | #include "cpu/z80/z80.h" |
| 13 | 14 | #include "cpu/z80/z80daisy.h" |
| r1877 | r1878 | |
| 159 | 160 | UINT8 int_state[8]; /* interrupt states */ |
| 160 | 161 | |
| 161 | 162 | void (*irq_cb)(int state); |
| 162 | write8_handler dtr_changed_cb; | |
| 163 | write8_handler rts_changed_cb; | |
| 164 | write8_handler break_changed_cb; | |
| 165 | write8_handler transmit_cb; | |
| 163 | write8_machine_func dtr_changed_cb; | |
| 164 | write8_machine_func rts_changed_cb; | |
| 165 | write8_machine_func break_changed_cb; | |
| 166 | write8_machine_func transmit_cb; | |
| 166 | 167 | int (*receive_poll_cb)(int which); |
| 167 | 168 | }; |
| 168 | 169 | |
| r1877 | r1878 | |
| 344 | 345 | dart_channel *chan = &dart->chan[ch]; |
| 345 | 346 | int reg = chan->regs[0] & 7; |
| 346 | 347 | UINT8 old = chan->regs[reg]; |
| 348 | running_machine *machine = Machine; | |
| 347 | 349 | |
| 348 | 350 | if (reg != 0 || (reg & 0xf8)) |
| 349 | 351 | VPRINTF(("%04X:dart_reg_w(%c,%d) = %02X\n", activecpu_get_pc(), 'A' + ch, reg, data)); |
| r1877 | r1878 | |
| 397 | 399 | /* DART write register 5 */ |
| 398 | 400 | case 5: |
| 399 | 401 | if (((old ^ data) & DART_WR5_DTR) && dart->dtr_changed_cb) |
| 400 | (*dart->dtr_changed_cb)(ch, (data & DART_WR5_DTR) != 0); | |
| 402 | (*dart->dtr_changed_cb)(machine, ch, (data & DART_WR5_DTR) != 0); | |
| 401 | 403 | if (((old ^ data) & DART_WR5_SEND_BREAK) && dart->break_changed_cb) |
| 402 | (*dart->break_changed_cb)(ch, (data & DART_WR5_SEND_BREAK) != 0); | |
| 404 | (*dart->break_changed_cb)(machine, ch, (data & DART_WR5_SEND_BREAK) != 0); | |
| 403 | 405 | if (((old ^ data) & DART_WR5_RTS) && dart->rts_changed_cb) |
| 404 | (*dart->rts_changed_cb)(ch, (data & DART_WR5_RTS) != 0); | |
| 406 | (*dart->rts_changed_cb)(machine, ch, (data & DART_WR5_RTS) != 0); | |
| 405 | 407 | break; |
| 406 | 408 | } |
| 407 | 409 | } |
| r1877 | r1878 | |
| 645 | 647 | |
| 646 | 648 | /* actually transmit the character */ |
| 647 | 649 | if (dart->transmit_cb != NULL) |
| 648 | (*dart->transmit_cb)(ch, chan->outbuf); | |
| 650 | (*dart->transmit_cb)(machine, ch, chan->outbuf); | |
| 649 | 651 | |
| 650 | 652 | /* update the status register */ |
| 651 | 653 | chan->status[0] |= DART_RR0_TX_BUFFER_EMPTY; |
| r1877 | r1878 | |
|---|---|---|
| 442 | 442 | static READ8_HANDLER( bebox_800001F0_8_r ) { return ide_controller_0_r(offset + 0x1F0); } |
| 443 | 443 | static WRITE8_HANDLER( bebox_800001F0_8_w ) { ide_controller_0_w(offset + 0x1F0, data); } |
| 444 | 444 | |
| 445 | READ64_HANDLER( bebox_800001F0_r ) { return read64be_with_read8_handler(bebox_800001F0_8_r, offset, mem_mask); } | |
| 446 | WRITE64_HANDLER( bebox_800001F0_w ) { write64be_with_write8_handler(bebox_800001F0_8_w, offset, data, mem_mask); } | |
| 445 | READ64_HANDLER( bebox_800001F0_r ) { return read64be_with_read8_handler(bebox_800001F0_8_r, machine, offset, mem_mask); } | |
| 446 | WRITE64_HANDLER( bebox_800001F0_w ) { write64be_with_write8_handler(bebox_800001F0_8_w, machine, offset, data, mem_mask); } | |
| 447 | 447 | |
| 448 | 448 | |
| 449 | 449 | READ64_HANDLER( bebox_800003F0_r ) |
| 450 | 450 | { |
| 451 | UINT64 result = pc64be_fdc_r(offset, mem_mask | 0xFFFF); | |
| 451 | UINT64 result = pc64be_fdc_r(machine, offset, mem_mask | 0xFFFF); | |
| 452 | 452 | |
| 453 | 453 | if (((mem_mask >> 8) & 0xFF) == 0) |
| 454 | 454 | { |
| r1877 | r1878 | |
| 467 | 467 | |
| 468 | 468 | WRITE64_HANDLER( bebox_800003F0_w ) |
| 469 | 469 | { |
| 470 | pc64be_fdc_w(offset, data, mem_mask | 0xFFFF); | |
| 470 | pc64be_fdc_w(machine, offset, data, mem_mask | 0xFFFF); | |
| 471 | 471 | |
| 472 | 472 | if (((mem_mask >> 8) & 0xFF) == 0) |
| 473 | 473 | ide_controller_0_w(0x3F6, (data >> 8) & 0xFF); |
| r1877 | r1878 | |
| 496 | 496 | * |
| 497 | 497 | *************************************/ |
| 498 | 498 | |
| 499 | static read8_handler bebox_vga_memory_rh; | |
| 500 | static write8_handler bebox_vga_memory_wh; | |
| 499 | static read8_machine_func bebox_vga_memory_rh; | |
| 500 | static write8_machine_func bebox_vga_memory_wh; | |
| 501 | 501 | |
| 502 | 502 | static READ64_HANDLER( bebox_video_r ) |
| 503 | 503 | { |
| r1877 | r1878 | |
| 517 | 517 | |
| 518 | 518 | static READ64_HANDLER( bebox_vga_memory_r ) |
| 519 | 519 | { |
| 520 | return read64be_with_read8_handler(bebox_vga_memory_rh, offset, mem_mask); | |
| 520 | return read64be_with_read8_handler(bebox_vga_memory_rh, machine, offset, mem_mask); | |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | |
| 524 | 524 | static WRITE64_HANDLER( bebox_vga_memory_w ) |
| 525 | 525 | { |
| 526 | write64be_with_write8_handler(bebox_vga_memory_wh, offset, data, mem_mask); | |
| 526 | write64be_with_write8_handler(bebox_vga_memory_wh, machine, offset, data, mem_mask); | |
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | |
| 530 | static void bebox_map_vga_memory(offs_t begin, offs_t end, read8_ | |
| 530 | static void bebox_map_vga_memory(offs_t begin, offs_t end, read8_machin | |
| 531 | 531 | { |
| 532 | read64_handler rh64 = (rh == MRA8_BANK4) ? MRA64_BANK4 : bebox_vga_memory_r; | |
| 533 | write64_handler wh64 = (wh == MWA8_BANK4) ? MWA64_BANK4 : bebox_vga_memory_w; | |
| 532 | read64_machine_func rh64 = (rh == MRA8_BANK4) ? MRA64_BANK4 : bebox_vga_memory_r; | |
| 533 | write64_machine_func wh64 = (wh == MWA8_BANK4) ? MWA64_BANK4 : bebox_vga_memory_w; | |
| 534 | 534 | |
| 535 | 535 | bebox_vga_memory_rh = rh; |
| 536 | 536 | bebox_vga_memory_wh = wh; |
| r1877 | r1878 | |
| 615 | 615 | |
| 616 | 616 | READ64_HANDLER(bebox_page_r) |
| 617 | 617 | { |
| 618 | return read64be_with_read8_handler(at_page8_r, offset, mem_mask); | |
| 618 | return read64be_with_read8_handler(at_page8_r, machine, offset, mem_mask); | |
| 619 | 619 | } |
| 620 | 620 | |
| 621 | 621 | |
| 622 | 622 | WRITE64_HANDLER(bebox_page_w) |
| 623 | 623 | { |
| 624 | write64be_with_write8_handler(at_page8_w, offset, data, mem_mask); | |
| 624 | write64be_with_write8_handler(at_page8_w, machine, offset, data, mem_mask); | |
| 625 | 625 | } |
| 626 | 626 | |
| 627 | 627 | |
| r1877 | r1878 | |
| 657 | 657 | |
| 658 | 658 | WRITE64_HANDLER(bebox_80000480_w) |
| 659 | 659 | { |
| 660 | write64be_with_write8_handler(at_hipage8_w, offset, data, mem_mask); | |
| 660 | write64be_with_write8_handler(at_hipage8_w, machine, offset, data, mem_mask); | |
| 661 | 661 | } |
| 662 | 662 | |
| 663 | 663 | |
| r1877 | r1878 | |
| 748 | 748 | |
| 749 | 749 | READ64_HANDLER( bebox_flash_r ) |
| 750 | 750 | { |
| 751 | return read64be_with_read8_handler(bebox_flash8_r, offset, mem_mask); | |
| 751 | return read64be_with_read8_handler(bebox_flash8_r, machine, offset, mem_mask); | |
| 752 | 752 | } |
| 753 | 753 | |
| 754 | 754 | |
| 755 | 755 | WRITE64_HANDLER( bebox_flash_w ) |
| 756 | 756 | { |
| 757 | write64be_with_write8_handler(bebox_flash8_w, offset, data, mem_mask); | |
| 757 | write64be_with_write8_handler(bebox_flash8_w, machine, offset, data, mem_mask); | |
| 758 | 758 | } |
| 759 | 759 | |
| 760 | 760 |
| r1877 | r1878 | |
|---|---|---|
| 404 | 404 | } |
| 405 | 405 | break; |
| 406 | 406 | } |
| 407 | tia_sound_w(offset,data); | |
| 407 | tia_sound_w(machine, offset,data); | |
| 408 | 408 | ROM[offset] = data; |
| 409 | 409 | } |
| 410 | 410 | |
| r1877 | r1878 | |
| 428 | 428 | } |
| 429 | 429 | else if(a7800_cart_type & 0x01) |
| 430 | 430 | { |
| 431 | pokey1_w(offset,data); | |
| 431 | pokey1_w(machine, offset,data); | |
| 432 | 432 | } |
| 433 | 433 | else |
| 434 | 434 | { |
| r1877 | r1878 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | void (*irq_callback)(mc68901_t *chip, int state); |
| 65 | 65 | |
| 66 | read8_handler gpio_r; | |
| 67 | write8_handler gpio_w; | |
| 66 | read8_machine_func gpio_r; | |
| 67 | write8_machine_func gpio_w; | |
| 68 | 68 | }; |
| 69 | 69 | |
| 70 | 70 | /* device interface */ |
| r1877 | r1878 | |
|---|---|---|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | static | |
| 57 | static INPUT_CHANGED( kbd_updat | |
| 58 | 58 | { |
| 59 | 59 | int index = *( (int*)(param) ), i; |
| 60 | UINT32 delta = oldval | |
| 60 | UINT32 delta = oldval | |
| 61 | 61 | |
| 62 | 62 | /* Special case Page UP, which we will use as Action Replay button */ |
| 63 | if ( (index == 3) && ( delta & 0x80000000 ) && ( newval | |
| 63 | if ( (index == 3) && ( delta & 0x80000000 ) && ( newval | |
| 64 | 64 | { |
| 65 | 65 | const amiga_machine_interface *amiga_intf = amiga_get_interface(); |
| 66 | 66 | |
| r1877 | r1878 | |
| 77 | 77 | { |
| 78 | 78 | if ( delta & ( 1 << i ) ) |
| 79 | 79 | { |
| 80 | int down = ( newval | |
| 80 | int down = ( newval | |
| 81 | 81 | int scancode = ( ( (index*32)+i ) << 1 ) | down; |
| 82 | 82 | int amigacode = ~scancode; |
| 83 | 83 | |
| r1877 | r1878 | |
| 97 | 97 | |
| 98 | 98 | void amigakbd_init( void ) |
| 99 | 99 | { |
| 100 | /* register for changes on the keyboard ports */ | |
| 101 | int i; | |
| 102 | ||
| 103 | for( i = 0; i < 4; i++ ) | |
| 104 | { | |
| 105 | char buf[64]; | |
| 106 | ||
| 107 | sprintf( buf, "amiga_keyboard_%d", i ); | |
| 108 | ||
| 109 | input_port_set_changed_callback( port_tag_to_index( buf ), 0xFFFFFFFF, kbd_update, &kbd_index[i] ); | |
| 110 | } | |
| 111 | ||
| 112 | 100 | /* allocate a keyboard buffer */ |
| 113 | 101 | key_buf = auto_malloc( KEYBOARD_BUFFER_SIZE ); |
| 114 | 102 | key_buf_pos = 0; |
| r1877 | r1878 | |
| 120 | 108 | /*********************************************************************************************/ |
| 121 | 109 | |
| 122 | 110 | INPUT_PORTS_START( amiga_keyboard ) |
| 123 | PORT_START_TAG("amiga_keyboard_0") | |
| 111 | PORT_START_TAG("amiga_keyboard_0") PORT_CHANGED(kbd_update, &kbd_index[0]) | |
| 124 | 112 | PORT_BIT( 0x00000001, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) // 00 |
| 125 | 113 | PORT_BIT( 0x00000002, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) // 01 |
| 126 | 114 | PORT_BIT( 0x00000004, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) // 02 |
| r1877 | r1878 | |
| 154 | 142 | PORT_BIT( 0x40000000, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_2_PAD) // 1E |
| 155 | 143 | PORT_BIT( 0x80000000, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_3_PAD) // 1F |
| 156 | 144 | |
| 157 | PORT_START_TAG("amiga_keyboard_1") | |
| 145 | PORT_START_TAG("amiga_keyboard_1") PORT_CHANGED(kbd_update, &kbd_index[1]) | |
| 158 | 146 | PORT_BIT( 0x00000001, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) // 20 |
| 159 | 147 | PORT_BIT( 0x00000002, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) // 21 |
| 160 | 148 | PORT_BIT( 0x00000004, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) // 22 |
| r1877 | r1878 | |
| 188 | 176 | PORT_BIT( 0x40000000, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_8_PAD) // 3E |
| 189 | 177 | PORT_BIT( 0x80000000, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_9_PAD) // 3F |
| 190 | 178 | |
| 191 | PORT_START_TAG("amiga_keyboard_2") | |
| 179 | PORT_START_TAG("amiga_keyboard_2") PORT_CHANGED(kbd_update, &kbd_index[2]) | |
| 192 | 180 | PORT_BIT( 0x00000001, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) // 40 |
| 193 | 181 | PORT_BIT( 0x00000002, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) // 41 |
| 194 | 182 | PORT_BIT( 0x00000004, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) // 42 |
| r1877 | r1878 | |
| 222 | 210 | PORT_BIT( 0x40000000, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_PLUS_PAD) // 5E |
| 223 | 211 | PORT_BIT( 0x80000000, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_INSERT) // 5F |
| 224 | 212 | |
| 225 | PORT_START_TAG("amiga_keyboard_3") | |
| 213 | PORT_START_TAG("amiga_keyboard_3") PORT_CHANGED(kbd_update, &kbd_index[3]) | |
| 226 | 214 | PORT_BIT( 0x00000001, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) // 60 |
| 227 | 215 | PORT_BIT( 0x00000002, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_RSHIFT) // 61 |
| 228 | 216 | PORT_BIT( 0x00000004, 0x0000, IPT_KEYBOARD) PORT_CODE(KEYCODE_CAPSLOCK) // 62 |
| r1877 | r1878 | |
|---|---|---|
| 24 | 24 | { |
| 25 | 25 | int baseclock; |
| 26 | 26 | void (*irq_cb)(int state); |
| 27 | write8_handler dtr_changed_cb; | |
| 28 | write8_handler rts_changed_cb; | |
| 29 | write8_handler break_changed_cb; | |
| 30 | write8_handler transmit_cb; | |
| 27 | write8_machine_func dtr_changed_cb; | |
| 28 | write8_machine_func rts_changed_cb; | |
| 29 | write8_machine_func break_changed_cb; | |
| 30 | write8_machine_func transmit_cb; | |
| 31 | 31 | int (*receive_poll_cb)(int which); |
| 32 | 32 | }; |
| 33 | 33 |
| r1877 | r1878 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | static void mtx_tms9929a_interrupt(int data) |
| 53 | 53 | { |
| 54 | z80ctc_0_trg0_w(0, data ? 0 : 1); | |
| 54 | running_machine *machine = Machine; | |
| 55 | z80ctc_0_trg0_w(machine, 0, data ? 0 : 1); | |
| 55 | 56 | } |
| 56 | 57 | |
| 57 | 58 | static const TMS9928a_interface tms9928a_interface = |
| r1877 | r1878 | |
| 217 | 218 | |
| 218 | 219 | READ8_HANDLER( mtx_ctc_r ) |
| 219 | 220 | { |
| 220 | return z80ctc_0_r(offset); | |
| 221 | return z80ctc_0_r(machine, offset); | |
| 221 | 222 | } |
| 222 | 223 | |
| 223 | 224 | WRITE8_HANDLER( mtx_ctc_w ) |
| 224 | 225 | { |
| 225 | 226 | // logerror("mtx_ctc_w: %02x\n", data); |
| 226 | 227 | if (offset < 3) |
| 227 | z80ctc_0_w(offset,data); | |
| 228 | z80ctc_0_w(machine, offset,data); | |
| 228 | 229 | } |
| 229 | 230 | |
| 230 | 231 | static z80ctc_interface mtx_ctc_intf = |
| r1877 | r1878 | |
|---|---|---|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /************************************************************** |
| 298 | * VIA read wrappers | |
| 299 | **************************************************************/ | |
| 300 | ||
| 301 | static const char *const via_name[16] = { | |
| 302 | "PB ","PA ","DDRB","DDRA", | |
| 303 | "T1CL","T1CH","T1LL","T1LH", | |
| 304 | "T2CL","T2CH","SR ","ACR ", | |
| 305 | "PCR ","IFR ","IER ","PANH" | |
| 306 | }; | |
| 307 | ||
| 308 | READ8_HANDLER( microtan_via_0_r ) | |
| 309 | { | |
| 310 | int data = via_0_r(offset); | |
| 311 | LOG(("microtan_via_0_r %s -> %02X\n", via_name[offset], data)); | |
| 312 | return data; | |
| 313 | } | |
| 314 | ||
| 315 | READ8_HANDLER( microtan_via_1_r ) | |
| 316 | { | |
| 317 | int data = via_1_r(offset); | |
| 318 | LOG(("microtan_via_1_r %s -> %02X\n", via_name[offset], data)); | |
| 319 | return data; | |
| 320 | } | |
| 321 | ||
| 322 | /************************************************************** | |
| 323 | * VIA write wrappers | |
| 324 | **************************************************************/ | |
| 325 | WRITE8_HANDLER( microtan_via_0_w ) | |
| 326 | { | |
| 327 | LOG(("via_0_w (%2d) %s <- %02X\n", offset, via_name[offset], data)); | |
| 328 | via_0_w(offset,data); | |
| 329 | } | |
| 330 | ||
| 331 | WRITE8_HANDLER( microtan_via_1_w ) | |
| 332 | { | |
| 333 | LOG(("via_1_w (%2d) %s <- %02X\n", offset, via_name[offset], data)); | |
| 334 | via_1_w(offset,data); | |
| 335 | } | |
| 336 | ||
| 337 | /************************************************************** | |
| 338 | 298 | * VIA interface structure |
| 339 | 299 | **************************************************************/ |
| 340 | 300 | static const struct via6522_interface via6522[2] = |
| r1877 | r1878 | |
| 370 | 330 | via_set_input_cb2(0,1); |
| 371 | 331 | } |
| 372 | 332 | |
| 373 | ||
| 333 | ||
| 374 | 334 | { |
| 375 | int data; | |
| 376 | data = acia_6551_r(offset); | |
| 377 | LOG(("microtan_sio_r: %d -> %02x\n", offset, data)); | |
| 378 | return data; | |
| 379 | } | |
| 380 | ||
| 381 | WRITE8_HANDLER( microtan_sio_w ) | |
| 382 | { | |
| 383 | LOG(("microtan_sio_w: %d <- %02x\n", offset, data)); | |
| 384 | acia_6551_w(offset,data); | |
| 385 | } | |
| 386 | ||
| 387 | ||
| 388 | READ8_HANDLER( microtan_sound_r ) | |
| 389 | { | |
| 390 | 335 | int data = 0xff; |
| 391 | 336 | LOG(("microtan_sound_r: -> %02x\n", data)); |
| 392 | 337 | return data; |
| r1877 | r1878 | |
| 747 | 692 | |
| 748 | 693 | static void microtan_snapshot_copy(UINT8 *snapshot_buff, int snapshot_size) |
| 749 | 694 | { |
| 695 | running_machine *machine = Machine; | |
| 750 | 696 | UINT8 *RAM = memory_region(REGION_CPU1); |
| 751 | 697 | |
| 752 | 698 | /* check for .DMP file format */ |
| r1877 | r1878 | |
| 803 | 749 | |
| 804 | 750 | /* first set of VIA6522 registers */ |
| 805 | 751 | for (i = 0; i < 16; i++ ) |
| 806 | via_0_w(i, snapshot_buff[base++]); | |
| 752 | via_0_w(machine, i, snapshot_buff[base++]); | |
| 807 | 753 | |
| 808 | 754 | /* second set of VIA6522 registers */ |
| 809 | 755 | for (i = 0; i < 16; i++ ) |
| 810 | via_1_w(i, snapshot_buff[base++]); | |
| 756 | via_1_w(machine, i, snapshot_buff[base++]); | |
| 811 | 757 | |
| 812 | 758 | /* microtan IO bff0-bfff */ |
| 813 | 759 | for (i = 0; i < 16; i++ ) |
| 814 | 760 | { |
| 815 | 761 | RAM[0xbff0+i] = snapshot_buff[base++]; |
| 816 | 762 | if (i < 4) |
| 817 | microtan_bffx_w(i,RAM[0xbff0+i]); | |
| 763 | microtan_bffx_w(machine, i, RAM[0xbff0+i]); | |
| 818 | 764 | } |
| 819 | 765 | |
| 820 | microtan_sound_w(0, snapshot_buff[base++]); | |
| 766 | microtan_sound_w(machine, 0, snapshot_buff[base++]); | |
| 821 | 767 | microtan_chunky_graphics = snapshot_buff[base++]; |
| 822 | 768 | |
| 823 | 769 | /* first set of AY8910 registers */ |
| 824 | 770 | for (i = 0; i < 16; i++ ) |
| 825 | 771 | { |
| 826 | AY8910_control_port_0_w(0, i); | |
| 827 | AY8910_write_port_0_w(0, snapshot_buff[base++]); | |
| 772 | AY8910_control_port_0_w(machine, 0, i); | |
| 773 | AY8910_write_port_0_w(machine, 0, snapshot_buff[base++]); | |
| 828 | 774 | } |
| 829 | 775 | |
| 830 | 776 | /* second set of AY8910 registers */ |
| 831 | 777 | for (i = 0; i < 16; i++ ) |
| 832 | 778 | { |
| 833 | AY8910_control_port_0_w(0, i); | |
| 834 | AY8910_write_port_0_w(0, snapshot_buff[base++]); | |
| 779 | AY8910_control_port_0_w(machine, 0, i); | |
| 780 | AY8910_write_port_0_w(machine, 0, snapshot_buff[base++]); | |
| 835 | 781 | } |
| 836 | 782 | |
| 837 | 783 | for (i = 0; i < 32*16; i++) |
| r1877 | r1878 | |
|---|---|---|
| 53 | 53 | switch (offset) |
| 54 | 54 | { |
| 55 | 55 | case 0x000: |
| 56 | rv = input | |
| 56 | rv = readinput | |
| 57 | 57 | logerror("TAPE: Read %02x from 0x40%02x - XOR Data?\n",rv,offset); |
| 58 | 58 | break; |
| 59 | 59 | case 0x001: |
| 60 | rv = (input | |
| 60 | rv = (readinput | |
| 61 | 61 | logerror("TAPE: Read %02x from 0x40%02x - Sense 1?\n",rv,offset); |
| 62 | 62 | break; |
| 63 | 63 | case 0x002: |
| 64 | rv = (input | |
| 64 | rv = (readinput | |
| 65 | 65 | logerror("TAPE: Read %02x from 0x40%02x - Sense 2?\n",rv,offset); |
| 66 | 66 | break; |
| 67 | 67 | case 0x003: |
| 68 | rv = (input | |
| 68 | rv = (readinput | |
| 69 | 69 | logerror("TAPE: Read %02x from 0x40%02x - Tape Present\n",rv,offset); |
| 70 | 70 | break; |
| 71 | 71 | case 0x004: |
| 72 | rv = (input | |
| 72 | rv = (readinput | |
| 73 | 73 | logerror("TAPE: Read %02x from 0x40%02x - Comp (339/1)\n",rv,offset); |
| 74 | 74 | break; |
| 75 | 75 | case 0x005: |
| 76 | rv = (input | |
| 76 | rv = (readinput | |
| 77 | 77 | logerror("TAPE: Read %02x from 0x40%02x - Clocked Comp (339/13)\n",rv,offset); |
| 78 | 78 | break; |
| 79 | 79 | case 0x006: |
| r1877 | r1878 | |
| 93 | 93 | case 0x060: /* Keyboard Read */ |
| 94 | 94 | rv = 0xff; |
| 95 | 95 | if (intvkbd_keyboard_col == 0) |
| 96 | rv = input | |
| 96 | rv = readinput | |
| 97 | 97 | if (intvkbd_keyboard_col == 1) |
| 98 | rv = input | |
| 98 | rv = readinput | |
| 99 | 99 | if (intvkbd_keyboard_col == 2) |
| 100 | rv = input | |
| 100 | rv = readinput | |
| 101 | 101 | if (intvkbd_keyboard_col == 3) |
| 102 | rv = input | |
| 102 | rv = readinput | |
| 103 | 103 | if (intvkbd_keyboard_col == 4) |
| 104 | rv = input | |
| 104 | rv = readinput | |
| 105 | 105 | if (intvkbd_keyboard_col == 5) |
| 106 | rv = input | |
| 106 | rv = readinput | |
| 107 | 107 | if (intvkbd_keyboard_col == 6) |
| 108 | rv = input | |
| 108 | rv = readinput | |
| 109 | 109 | if (intvkbd_keyboard_col == 7) |
| 110 | rv = input | |
| 110 | rv = readinput | |
| 111 | 111 | if (intvkbd_keyboard_col == 8) |
| 112 | rv = input | |
| 112 | rv = readinput | |
| 113 | 113 | if (intvkbd_keyboard_col == 9) |
| 114 | rv = input | |
| 114 | rv = readinput | |
| 115 | 115 | break; |
| 116 | 116 | case 0x80: |
| 117 | 117 | rv = 0x00; |
| r1877 | r1878 | |
| 140 | 140 | case 0xce: |
| 141 | 141 | case 0xcf: |
| 142 | 142 | /* TMS9927 regs */ |
| 143 | rv = intvkbd_tms9927_r(offset-0xc0); | |
| 143 | rv = intvkbd_tms9927_r(machine, offset-0xc0); | |
| 144 | 144 | break; |
| 145 | 145 | default: |
| 146 | 146 | rv = (intvkbd_dualport_ram[offset]&0x0300)>>8; |
| r1877 | r1878 | |
| 258 | 258 | case 0xce: |
| 259 | 259 | case 0xcf: |
| 260 | 260 | /* TMS9927 regs */ |
| 261 | intvkbd_tms9927_w(offset-0xc0, data); | |
| 261 | intvkbd_tms9927_w(machine, offset-0xc0, data); | |
| 262 | 262 | break; |
| 263 | 263 | default: |
| 264 | 264 | logerror("%04X: Unknown write %02x to 0x40%02x\n",activecpu_get_pc(),data,offset); |
| r1877 | r1878 | |
| 459 | 459 | switch(byte) |
| 460 | 460 | { |
| 461 | 461 | case 0: |
| 462 | value = input | |
| 462 | value = readinput | |
| 463 | 463 | break; |
| 464 | 464 | case 1: |
| 465 | value = input | |
| 465 | value = readinput | |
| 466 | 466 | break; |
| 467 | 467 | case 2: |
| 468 | value = input | |
| 468 | value = readinput | |
| 469 | 469 | break; |
| 470 | 470 | } |
| 471 | 471 | for(bit=7; bit>=0; bit--) |
| r1877 | r1878 | |
|---|---|---|
| 121 | 121 | { |
| 122 | 122 | struct |
| 123 | 123 | { |
| 124 | read8_handler mem_read; /* card mem read handler (8 bits) */ | |
| 125 | write8_handler mem_write; /* card mem write handler (8 bits) */ | |
| 124 | read8_machine_func mem_read; /* card mem read handler (8 bits) */ | |
| 125 | write8_machine_func mem_write; /* card mem write handler (8 bits) */ | |
| 126 | 126 | } width_8bit; |
| 127 | 127 | struct |
| 128 | 128 | { |
| 129 | read16_handler mem_read; /* card mem read handler (16 bits) */ | |
| 130 | write16_handler mem_write; /* card mem write handler (16 bits) */ | |
| 129 | read16_machine_func mem_read; /* card mem read handler (16 bits) */ | |
| 130 | write16_machine_func mem_write; /* card mem write handler (16 bits) */ | |
| 131 | 131 | } width_16bit; |
| 132 | 132 | } w; |
| 133 | 133 | } ti99_4p_peb_card_handlers_t; |
| r1877 | r1878 | |
| 325 | 325 | /* |
| 326 | 326 | Read CRU in range >1000->1ffe (>800->fff) (ti-99/4(a)) |
| 327 | 327 | */ |
| 328 | ||
| 328 | ||
| 329 | 329 | { |
| 330 | 330 | int port; |
| 331 | 331 | cru_read_handler handler; |
| r1877 | r1878 | |
| 334 | 334 | port = (offset & 0x00f0) >> 4; |
| 335 | 335 | handler = expansion_ports[port].cru_read; |
| 336 | 336 | |
| 337 | reply = (handler) ? (*handler)(offset & 0xf) : 0; | |
| 337 | reply = (handler) ? (*handler)(machine, offset & 0xf) : 0; | |
| 338 | 338 | |
| 339 | 339 | return reply; |
| 340 | 340 | } |
| r1877 | r1878 | |
| 351 | 351 | handler = expansion_ports[port].cru_write; |
| 352 | 352 | |
| 353 | 353 | if (handler) |
| 354 | (*handler)(offset & 0x7f, data); | |
| 354 | (*handler)(machine, offset & 0x7f, data); | |
| 355 | 355 | |
| 356 | 356 | /* expansion card enable? */ |
| 357 | 357 | if ((offset & 0x7f) == 0) |
| r1877 | r1878 | |
| 377 | 377 | READ16_HANDLER ( ti99_4x_peb_r ) |
| 378 | 378 | { |
| 379 | 379 | int reply = 0; |
| 380 | read8_ | |
| 380 | read8_machin | |
| 381 | 381 | |
| 382 | 382 | activecpu_adjust_icount(-4); |
| 383 | 383 | |
| r1877 | r1878 | |
| 386 | 386 | handler = expansion_ports[active_card].mem_read; |
| 387 | 387 | if (handler) |
| 388 | 388 | { |
| 389 | reply = (*handler)((offset << 1) + 1); | |
| 390 | reply |= ((unsigned) (*handler)(offset << 1)) << 8; | |
| 389 | reply = (*handler)(machine, (offset << 1) + 1); | |
| 390 | reply |= ((unsigned) (*handler)(machine, offset << 1)) << 8; | |
| 391 | 391 | } |
| 392 | 392 | } |
| 393 | 393 | |
| r1877 | r1878 | |
| 399 | 399 | */ |
| 400 | 400 | WRITE16_HANDLER ( ti99_4x_peb_w ) |
| 401 | 401 | { |
| 402 | write8_ | |
| 402 | write8_machin | |
| 403 | 403 | |
| 404 | 404 | activecpu_adjust_icount(-4); |
| 405 | 405 | |
| r1877 | r1878 | |
| 411 | 411 | handler = expansion_ports[active_card].mem_write; |
| 412 | 412 | if (handler) |
| 413 | 413 | { |
| 414 | (*handler)((offset << 1) + 1, data & 0xff); | |
| 415 | (*handler)(offset << 1, (data >> 8) & 0xff); | |
| 414 | (*handler)(machine, (offset << 1) + 1, data & 0xff); | |
| 415 | (*handler)(machine, offset << 1, (data >> 8) & 0xff); | |
| 416 | 416 | } |
| 417 | 417 | } |
| 418 | 418 | } |
| r1877 | r1878 | |
| 430 | 430 | port = (offset & 0x00f0) >> 4; |
| 431 | 431 | handler = expansion_ports[port].cru_read; |
| 432 | 432 | |
| 433 | reply = (handler) ? (*handler)(offset & 0xf) : 0; | |
| 433 | reply = (handler) ? (*handler)(machine, offset & 0xf) : 0; | |
| 434 | 434 | |
| 435 | 435 | return reply; |
| 436 | 436 | } |
| r1877 | r1878 | |
| 447 | 447 | handler = expansion_ports[port].cru_write; |
| 448 | 448 | |
| 449 | 449 | if (handler) |
| 450 | (*handler)(offset & 0x7f, data); | |
| 450 | (*handler)(machine, offset & 0x7f, data); | |
| 451 | 451 | |
| 452 | 452 | /* expansion card enable? */ |
| 453 | 453 | if ((offset & 0x7f) == 0) |
| r1877 | r1878 | |
| 473 | 473 | READ8_HANDLER ( geneve_peb_r ) |
| 474 | 474 | { |
| 475 | 475 | int reply = 0; |
| 476 | read8_ | |
| 476 | read8_machin | |
| 477 | 477 | |
| 478 | 478 | activecpu_adjust_icount(-8); |
| 479 | 479 | |
| r1877 | r1878 | |
| 481 | 481 | { |
| 482 | 482 | handler = expansion_ports[active_card].mem_read; |
| 483 | 483 | if (handler) |
| 484 | reply = (*handler)(offset); | |
| 484 | reply = (*handler)(machine, offset); | |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | return reply; |
| r1877 | r1878 | |
| 492 | 492 | */ |
| 493 | 493 | WRITE8_HANDLER ( geneve_peb_w ) |
| 494 | 494 | { |
| 495 | write8_ | |
| 495 | write8_machin | |
| 496 | 496 | |
| 497 | 497 | activecpu_adjust_icount(-8); |
| 498 | 498 | |
| r1877 | r1878 | |
| 500 | 500 | { |
| 501 | 501 | handler = expansion_ports[active_card].mem_write; |
| 502 | 502 | if (handler) |
| 503 | (*handler)(offset, data); | |
| 503 | (*handler)(machine, offset, data); | |
| 504 | 504 | } |
| 505 | 505 | } |
| 506 | 506 | |
| r1877 | r1878 | |
| 516 | 516 | port = (offset & 0x01f0) >> 4; |
| 517 | 517 | handler = expansion_ports[port].cru_read; |
| 518 | 518 | |
| 519 | reply = (handler) ? (*handler)(offset & 0xf) : 0; | |
| 519 | reply = (handler) ? (*handler)(machine, offset & 0xf) : 0; | |
| 520 | 520 | |
| 521 | 521 | return reply; |
| 522 | 522 | } |
| r1877 | r1878 | |
| 533 | 533 | handler = expansion_ports[port].cru_write; |
| 534 | 534 | |
| 535 | 535 | if (handler) |
| 536 | (*handler)(offset & 0x7f, data); | |
| 536 | (*handler)(machine, offset & 0x7f, data); | |
| 537 | 537 | |
| 538 | 538 | /* expansion card enable? */ |
| 539 | 539 | if ((offset & 0x7f) == 0) |
| r1877 | r1878 | |
| 559 | 559 | READ8_HANDLER ( ti99_8_peb_r ) |
| 560 | 560 | { |
| 561 | 561 | int reply = 0; |
| 562 | read8_ | |
| 562 | read8_machin | |
| 563 | 563 | |
| 564 | 564 | activecpu_adjust_icount(-4); |
| 565 | 565 | |
| r1877 | r1878 | |
| 567 | 567 | { |
| 568 | 568 | handler = expansion_ports[active_card].mem_read; |
| 569 | 569 | if (handler) |
| 570 | reply = (*handler)(offset); | |
| 570 | reply = (*handler)(machine, offset); | |
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 | return reply; |
| r1877 | r1878 | |
| 578 | 578 | */ |
| 579 | 579 | WRITE8_HANDLER ( ti99_8_peb_w ) |
| 580 | 580 | { |
| 581 | write8_ | |
| 581 | write8_machin | |
| 582 | 582 | |
| 583 | 583 | activecpu_adjust_icount(-4); |
| 584 | 584 | |
| r1877 | r1878 | |
| 586 | 586 | { |
| 587 | 587 | handler = expansion_ports[active_card].mem_write; |
| 588 | 588 | if (handler) |
| 589 | (*handler)(offset, data); | |
| 589 | (*handler)(machine, offset, data); | |
| 590 | 590 | } |
| 591 | 591 | } |
| 592 | 592 | |
| r1877 | r1878 | |
| 602 | 602 | port = offset >> 4; |
| 603 | 603 | handler = ti99_4p_expansion_ports[port].cru_read; |
| 604 | 604 | |
| 605 | reply = (handler) ? (*handler)(offset & 0xf) : 0; | |
| 605 | reply = (handler) ? (*handler)(machine, offset & 0xf) : 0; | |
| 606 | 606 | |
| 607 | 607 | return reply; |
| 608 | 608 | } |
| r1877 | r1878 | |
| 619 | 619 | handler = ti99_4p_expansion_ports[port].cru_write; |
| 620 | 620 | |
| 621 | 621 | if (handler) |
| 622 | (*handler)(offset & 0x7f, data); | |
| 622 | (*handler)(machine, offset & 0x7f, data); | |
| 623 | 623 | |
| 624 | 624 | /* expansion card enable? */ |
| 625 | 625 | if ((offset & 0x7f) == 0) |
| r1877 | r1878 | |
| 663 | 663 | READ16_HANDLER ( ti99_4p_peb_r ) |
| 664 | 664 | { |
| 665 | 665 | int reply = 0; |
| 666 | read8_handler handler; | |
| 667 | read16_handler handler16; | |
| 666 | read8_machine_func handler; | |
| 667 | read16_machine_func handler16; | |
| 668 | 668 | |
| 669 | 669 | |
| 670 | 670 | if (active_card == -1) |
| r1877 | r1878 | |
| 679 | 679 | handler = ti99_4p_expansion_ports[active_card].w.width_8bit.mem_read; |
| 680 | 680 | if (handler) |
| 681 | 681 | { |
| 682 | reply = (*handler)((offset << 1) + 1); | |
| 683 | reply |= ((unsigned) (*handler)(offset << 1)) << 8; | |
| 682 | reply = (*handler)(machine, (offset << 1) + 1); | |
| 683 | reply |= ((unsigned) (*handler)(machine, offset << 1)) << 8; | |
| 684 | 684 | } |
| 685 | 685 | } |
| 686 | 686 | else |
| r1877 | r1878 | |
| 689 | 689 | |
| 690 | 690 | handler16 = ti99_4p_expansion_ports[active_card].w.width_16bit.mem_read; |
| 691 | 691 | if (handler16) |
| 692 | reply = (*handler16)(offset, /*mem_mask*/0); | |
| 692 | reply = (*handler16)(machine, offset, /*mem_mask*/0); | |
| 693 | 693 | } |
| 694 | 694 | } |
| 695 | 695 | |
| r1877 | r1878 | |
| 713 | 713 | */ |
| 714 | 714 | WRITE16_HANDLER ( ti99_4p_peb_w ) |
| 715 | 715 | { |
| 716 | write8_handler handler; | |
| 717 | write16_handler handler16; | |
| 716 | write8_machine_func handler; | |
| 717 | write16_machine_func handler16; | |
| 718 | 718 | |
| 719 | 719 | if (active_card == -1) |
| 720 | 720 | activecpu_adjust_icount(-4); /* ??? */ |
| r1877 | r1878 | |
| 730 | 730 | handler = ti99_4p_expansion_ports[active_card].w.width_8bit.mem_write; |
| 731 | 731 | if (handler) |
| 732 | 732 | { |
| 733 | (*handler)((offset << 1) + 1, data & 0xff); | |
| 734 | (*handler)(offset << 1, (data >> 8) & 0xff); | |
| 733 | (*handler)(machine, (offset << 1) + 1, data & 0xff); | |
| 734 | (*handler)(machine, offset << 1, (data >> 8) & 0xff); | |
| 735 | 735 | } |
| 736 | 736 | } |
| 737 | 737 | else |
| r1877 | r1878 | |
| 740 | 740 | |
| 741 | 741 | handler16 = ti99_4p_expansion_ports[active_card].w.width_16bit.mem_write; |
| 742 | 742 | if (handler16) |
| 743 | (*handler16)(offset, data, /*mem_mask*/0); | |
| 743 | (*handler16)(machine, offset, data, /*mem_mask*/0); | |
| 744 | 744 | } |
| 745 | 745 | } |
| 746 | 746 | } |
| r1877 | r1878 | |
|---|---|---|
| 197 | 197 | amiga_ar23_freeze(); |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | return amiga_cia_r( offset, mem_mask ); | |
| 200 | return amiga_cia_r( machine, offset, mem_mask ); | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | static WRITE16_HANDLER( amiga_ar23_mode_w ) |
| r1877 | r1878 | |
|---|---|---|
| 84 | 84 | } else { |
| 85 | 85 | switch( offset & 0x0F00 ) { |
| 86 | 86 | case 0x100: /* Floppy */ |
| 87 | data = wd17xx_r( offset ); | |
| 87 | data = wd17xx_r( machine, offset ); | |
| 88 | 88 | break; |
| 89 | 89 | case 0x200: /* Keyboard */ |
| 90 | 90 | /* Row 0 */ |
| r1877 | r1878 | |
| 105 | 105 | if ( offset & 0x80 ) data &= readinputport(7); |
| 106 | 106 | break; |
| 107 | 107 | case 0x900: /* IEEE488 PIA */ |
| 108 | data = pia_0_r( offset & 0x03 ); | |
| 108 | data = pia_0_r( machine, offset & 0x03 ); | |
| 109 | 109 | break; |
| 110 | 110 | case 0xA00: /* Serial */ |
| 111 | 111 | break; |
| 112 | 112 | case 0xC00: /* Video PIA */ |
| 113 | data = pia_1_r( offset & 0x03 ); | |
| 113 | data = pia_1_r( machine, offset & 0x03 ); | |
| 114 | 114 | break; |
| 115 | 115 | } |
| 116 | 116 | } |
| r1877 | r1878 | |
| 128 | 128 | /* Handle writes to the I/O area */ |
| 129 | 129 | switch( offset & 0x0F00 ) { |
| 130 | 130 | case 0x100: /* Floppy */ |
| 131 | wd17xx_w( offset, data ); | |
| 131 | wd17xx_w( machine, offset, data ); | |
| 132 | 132 | break; |
| 133 | 133 | case 0x900: /* IEEE488 PIA */ |
| 134 | pia_0_w( offset & 0x03, data ); | |
| 134 | pia_0_w( machine, offset & 0x03, data ); | |
| 135 | 135 | break; |
| 136 | 136 | case 0xA00: /* Serial */ |
| 137 | 137 | break; |
| 138 | 138 | case 0xC00: /* Video PIA */ |
| 139 | pia_1_w( offset & 0x03, data ); | |
| 139 | pia_1_w( machine, offset & 0x03, data ); | |
| 140 | 140 | break; |
| 141 | 141 | } |
| 142 | 142 | } |
| r1877 | r1878 | |
| 217 | 217 | static int osborne1_z80_irq_ack(int param) { |
| 218 | 218 | /* Enable ROM and I/O when IRQ is acknowledged */ |
| 219 | 219 | UINT8 old_bankswitch = osborne1.bankswitch; |
| 220 | osborne1_bankswitch_w( 0, 0 ); | |
| 220 | osborne1_bankswitch_w( Machine, 0, 0 ); | |
| 221 | 221 | osborne1.bankswitch = old_bankswitch; |
| 222 | 222 | osborne1.in_irq_handler = 1; |
| 223 | 223 | return 0xF8; |
| r1877 | r1878 | |
| 316 | 316 | /* Clear CA1 on video PIA */ |
| 317 | 317 | osborne1.start_y = ( osborne1.new_start_y - 1 ) & 0x1F; |
| 318 | 318 | osborne1.charline = 0; |
| 319 | pia_1_ca1_w( 0, 0 ); | |
| 319 | pia_1_ca1_w( machine, 0, 0 ); | |
| 320 | 320 | } |
| 321 | 321 | if ( y == 240 ) { |
| 322 | 322 | /* Set CA1 on video PIA */ |
| 323 | pia_1_ca1_w( 0, 0xFF ); | |
| 323 | pia_1_ca1_w( machine, 0, 0xFF ); | |
| 324 | 324 | } |
| 325 | 325 | if ( y < 240 ) { |
| 326 | 326 | /* Draw a line of the display */ |
| r1877 | r1878 | |
| 424 | 424 | |
| 425 | 425 | MACHINE_RESET( osborne1 ) { |
| 426 | 426 | /* Initialize memory configuration */ |
| 427 | osborne1_bankswitch_w( 0x00, 0 ); | |
| 427 | osborne1_bankswitch_w( machine, 0x00, 0 ); | |
| 428 | 428 | |
| 429 | 429 | osborne1.pia_0_irq_state = FALSE; |
| 430 | 430 | osborne1.pia_1_irq_state = FALSE; |
| r1877 | r1878 | |
| 435 | 435 | |
| 436 | 436 | osborne1.video_timer = timer_alloc( osborne1_video_callback , NULL); |
| 437 | 437 | timer_adjust_oneshot(osborne1.video_timer, video_screen_get_time_until_pos( 0, 1, 0 ), 0); |
| 438 | pia_1_ca1_w( 0, 0 ); | |
| 438 | pia_1_ca1_w( machine, 0, 0 ); | |
| 439 | 439 | |
| 440 | 440 | timer_set( attotime_zero, NULL, 0, setup_beep ); |
| 441 | 441 |
| r1877 | r1878 | |
|---|---|---|
| 28 | 28 | #include "devices/snapquik.h" |
| 29 | 29 | #include "includes/amstrad.h" |
| 30 | 30 | #include "sound/ay8910.h" |
| 31 | #include "deprecat.h" | |
| 31 | 32 | |
| 32 | 33 | |
| 33 | 34 | void amstrad_setup_machine(void) |
| r1877 | r1878 | |
| 38 | 39 | /* load CPCEMU style snapshots */ |
| 39 | 40 | void amstrad_handle_snapshot(unsigned char *pSnapshot) |
| 40 | 41 | { |
| 42 | running_machine *machine = Machine; | |
| 41 | 43 | int RegData; |
| 42 | 44 | int i; |
| 43 | 45 | |
| r1877 | r1878 | |
| 144 | 146 | /* PSG */ |
| 145 | 147 | for (i=0; i<16; i++) |
| 146 | 148 | { |
| 147 | AY8910_control_port_0_w(0,i); | |
| 149 | AY8910_control_port_0_w(machine, 0,i); | |
| 148 | 150 | |
| 149 | AY8910_write_port_0_w(0,pSnapshot[0x05b + i] & 0x0ff); | |
| 151 | AY8910_write_port_0_w(machine, 0,pSnapshot[0x05b + i] & 0x0ff); | |
| 150 | 152 | } |
| 151 | 153 | |
| 152 | AY8910_control_port_0_w(0,pSnapshot[0x05a]); | |
| 154 | AY8910_control_port_0_w(machine, 0,pSnapshot[0x05a]); | |
| 153 | 155 | |
| 154 | 156 | { |
| 155 | 157 | int MemSize; |
| r1877 | r1878 | |
|---|---|---|
| 5 | 5 | /* |
| 6 | 6 | prototype for CRU handlers in expansion system |
| 7 | 7 | */ |
| 8 | typedef int (*cru_read_handler)(int offset); | |
| 9 | typedef void (*cru_write_handler)(int offset, int data); | |
| 8 | typedef int (*cru_read_handler)(running_machine *machine, int offset); | |
| 9 | typedef void (*cru_write_handler)(running_machine *machine, int offset, int data); | |
| 10 | 10 | |
| 11 | 11 | /* |
| 12 | 12 | Descriptor for TI peripheral expansion cards (8-bit bus) |
| r1877 | r1878 | |
| 16 | 16 | cru_read_handler cru_read; /* card CRU read handler */ |
| 17 | 17 | cru_write_handler cru_write; /* card CRU handler */ |
| 18 | 18 | |
| 19 | read8_handler mem_read; /* card mem read handler (8 bits) */ | |
| 20 | write8_handler mem_write; /* card mem write handler (8 bits) */ | |
| 19 | read8_machine_func mem_read; /* card mem read handler (8 bits) */ | |
| 20 | write8_machine_func mem_write; /* card mem write handler (8 bits) */ | |
| 21 | 21 | } ti99_peb_card_handlers_t; |
| 22 | 22 | |
| 23 | 23 | /* |
| r1877 | r1878 | |
| 30 | 30 | cru_read_handler cru_read; /* card CRU read handler */ |
| 31 | 31 | cru_write_handler cru_write; /* card CRU handler */ |
| 32 | 32 | |
| 33 | read16_handler mem_read; /* card mem read handler (16 bits) */ | |
| 34 | write16_handler mem_write; /* card mem write handler (16 bits) */ | |
| 33 | read16_machine_func mem_read; /* card mem read handler (16 bits) */ | |
| 34 | write16_machine_func mem_write; /* card mem write handler (16 bits) */ | |
| 35 | 35 | } ti99_peb_16bit_card_handlers_t; |
| 36 | 36 | |
| 37 | 37 | /* masks for ila and ilb */ |
| r1877 | r1878 | |
|---|---|---|
| 242 | 242 | smsVersion = (data & 0xA0); |
| 243 | 243 | } |
| 244 | 244 | if ( data & 0x08 ) { |
| 245 | sms_input_write( 0, ( data & 0x20 ) >> 5 ); | |
| 245 | sms_input_write( machine, 0, ( data & 0x20 ) >> 5 ); | |
| 246 | 246 | } |
| 247 | 247 | if ( data & 0x02 ) { |
| 248 | sms_input_write( 1, ( data & 0x80 ) >> 7 ); | |
| 248 | sms_input_write( machine, 1, ( data & 0x80 ) >> 7 ); | |
| 249 | 249 | } |
| 250 | 250 | } |
| 251 | 251 | |
| r1877 | r1878 | |
| 273 | 273 | |
| 274 | 274 | READ8_HANDLER(sms_count_r) { |
| 275 | 275 | if ( offset & 0x01 ) { |
| 276 | return sms_vdp_hcount_r(offset); | |
| 276 | return sms_vdp_hcount_r(machine, offset); | |
| 277 | 277 | } else { |
| 278 | 278 | /* VCount read */ |
| 279 | return sms_vdp_vcount_r(offset); | |
| 279 | return sms_vdp_vcount_r(machine, offset); | |
| 280 | 280 | } |
| 281 | 281 | } |
| 282 | 282 | |
| r1877 | r1878 | |
| 305 | 305 | |
| 306 | 306 | WRITE8_HANDLER(sms_YM2413_register_port_0_w) { |
| 307 | 307 | if ( HAS_FM ) { |
| 308 | YM2413_register_port_0_w(offset, (data & 0x3F)); | |
| 308 | YM2413_register_port_0_w(machine, offset, (data & 0x3F)); | |
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | WRITE8_HANDLER(sms_YM2413_data_port_0_w) { |
| 313 | 313 | if ( HAS_FM ) { |
| 314 | 314 | logerror("data_port_0_w %x %x\n", offset, data); |
| 315 | YM2413_data_port_0_w(offset, data); | |
| 315 | YM2413_data_port_0_w(machine, offset, data); | |
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 |
| r1877 | r1878 | |
|---|---|---|
| 1582 | 1582 | |
| 1583 | 1583 | switch(offset % 4) { |
| 1584 | 1584 | case 0: |
| 1585 | result = wd17xx_status_r(0); | |
| 1585 | result = wd17xx_status_r(machine, 0); | |
| 1586 | 1586 | break; |
| 1587 | 1587 | case 1: |
| 1588 | result = wd17xx_track_r(0); | |
| 1588 | result = wd17xx_track_r(machine, 0); | |
| 1589 | 1589 | break; |
| 1590 | 1590 | case 2: |
| 1591 | result = wd17xx_sector_r(0); | |
| 1591 | result = wd17xx_sector_r(machine, 0); | |
| 1592 | 1592 | break; |
| 1593 | 1593 | case 3: |
| 1594 | result = wd17xx_data_r(0); | |
| 1594 | result = wd17xx_data_r(machine, 0); | |
| 1595 | 1595 | break; |
| 1596 | 1596 | } |
| 1597 | 1597 | return result; |
| r1877 | r1878 | |
| 1603 | 1603 | { |
| 1604 | 1604 | switch(offset % 4) { |
| 1605 | 1605 | case 0: |
| 1606 | wd17xx_command_w(0, data); | |
| 1606 | wd17xx_command_w(machine, 0, data); | |
| 1607 | 1607 | break; |
| 1608 | 1608 | case 1: |
| 1609 | wd17xx_track_w(0, data); | |
| 1609 | wd17xx_track_w(machine, 0, data); | |
| 1610 | 1610 | break; |
| 1611 | 1611 | case 2: |
| 1612 | wd17xx_sector_w(0, data); | |
| 1612 | wd17xx_sector_w(machine, 0, data); | |
| 1613 | 1613 | break; |
| 1614 | 1614 | case 3: |
| 1615 | wd17xx_data_w(0, data); | |
| 1615 | wd17xx_data_w(machine, 0, data); | |
| 1616 | 1616 | break; |
| 1617 | 1617 | } |
| 1618 | 1618 | } |
| r1877 | r1878 | |
|---|---|---|
| 39 | 39 | |
| 40 | 40 | static void coupe_update_bank(int bank, UINT8 *memory, int is_readonly) |
| 41 | 41 | { |
| 42 | read8_handler rh; | |
| 43 | write8_handler wh; | |
| 42 | read8_machine_func rh; | |
| 43 | write8_machine_func wh; | |
| 44 | 44 | |
| 45 | 45 | if (memory) |
| 46 | 46 | memory_set_bankptr(bank, memory); |
| 47 | 47 | |
| 48 | rh = !memory ? MRA8_NOP : (read8_handler) (STATIC_BANK1 + (FPTR)bank - 1); | |
| 49 | wh = !memory ? MWA8_NOP : (is_readonly ? MWA8_UNMAP : (write8_handler) (STATIC_BANK1 + (FPTR)bank - 1)); | |
| 48 | rh = !memory ? MRA8_NOP : (read8_machine_func) (STATIC_BANK1 + (FPTR)bank - 1); | |
| 49 | wh = !memory ? MWA8_NOP : (is_readonly ? MWA8_UNMAP : (write8_machine_func) (STATIC_BANK1 + (FPTR)bank - 1)); | |
| 50 | 50 | |
| 51 | 51 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, ((bank-1) * 0x4000), ((bank-1) * 0x4000) + 0x3FFF, 0, 0, rh); |
| 52 | 52 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, ((bank-1) * 0x4000), ((bank-1) * 0x4000) + 0x3FFF, 0, 0, wh); |
| r1877 | r1878 | |
|---|---|---|
| 433 | 433 | { |
| 434 | 434 | UINT16 data = 0; |
| 435 | 435 | _logerror( 2, ("cybiko_key_r (%08X/%04X)\n", offset, mem_mask)); |
| 436 | if ACCESSING_MSB16 data = data | (cybiko_key_r_byte( offset * 2 + 0) << 8); | |
| 437 | if ACCESSING_LSB16 data = data | (cybiko_key_r_byte( offset * 2 + 1) << 0); | |
| 436 | if ACCESSING_MSB16 data = data | (cybiko_key_r_byte(machine, offset * 2 + 0) << 8); | |
| 437 | if ACCESSING_LSB16 data = data | (cybiko_key_r_byte(machine, offset * 2 + 1) << 0); | |
| 438 | 438 | _logerror( 2, ("%04X\n", data)); |
| 439 | 439 | return data; |
| 440 | 440 | } |
| r1877 | r1878 | |
| 504 | 504 | READ8_HANDLER( cybikov1_io_reg_r ) |
| 505 | 505 | { |
| 506 | 506 | _logerror( 2, ("cybikov1_io_reg_r (%08X)\n", offset)); |
| 507 | return cybiko_io_reg_r( offset); | |
| 507 | return cybiko_io_reg_r(machine, offset); | |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | 510 | READ8_HANDLER( cybikov2_io_reg_r ) |
| 511 | 511 | { |
| 512 | 512 | _logerror( 2, ("cybikov2_io_reg_r (%08X)\n", offset)); |
| 513 | return cybiko_io_reg_r( offset); | |
| 513 | return cybiko_io_reg_r(machine, offset); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | READ8_HANDLER( cybikoxt_io_reg_r ) |
| r1877 | r1878 | |
| 522 | 522 | // rs232 |
| 523 | 523 | case H8S_IO_PORT3 : if (cybiko_rs232_pin_rxd()) data = data | H8S_P3_RXD1; break; |
| 524 | 524 | // default |
| 525 | default : data = cybiko_io_reg_r( offset); | |
| 525 | default : data = cybiko_io_reg_r(machine, offset); | |
| 526 | 526 | } |
| 527 | 527 | return data; |
| 528 | 528 | } |
| r1877 | r1878 | |
| 530 | 530 | WRITE8_HANDLER( cybikov1_io_reg_w ) |
| 531 | 531 | { |
| 532 | 532 | _logerror( 2, ("cybikov1_io_reg_w (%08X/%02X)\n", offset, data)); |
| 533 | cybiko_io_reg_w( offset, data); | |
| 533 | cybiko_io_reg_w(machine, offset, data); | |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | WRITE8_HANDLER( cybikov2_io_reg_w ) |
| 537 | 537 | { |
| 538 | 538 | _logerror( 2, ("cybikov2_io_reg_w (%08X/%02X)\n", offset, data)); |
| 539 | cybiko_io_reg_w( offset, data); | |
| 539 | cybiko_io_reg_w(machine, offset, data); | |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | WRITE8_HANDLER( cybikoxt_io_reg_w ) |
| r1877 | r1878 | |
| 552 | 552 | } |
| 553 | 553 | break; |
| 554 | 554 | // default |
| 555 | default : cybiko_io_reg_w( offset, data); | |
| 555 | default : cybiko_io_reg_w(machine, offset, data); | |
| 556 | 556 | } |
| 557 | 557 | } |
| 558 | 558 |
| r1877 | r1878 | |
|---|---|---|
| 755 | 755 | int result = 0; |
| 756 | 756 | |
| 757 | 757 | if (offset & 1) |
| 758 | result |= input | |
| 758 | result |= readinput | |
| 759 | 759 | if (offset & 2) |
| 760 | result |= input | |
| 760 | result |= readinput | |
| 761 | 761 | if (offset & 4) |
| 762 | result |= input | |
| 762 | result |= readinput | |
| 763 | 763 | if (offset & 8) |
| 764 | result |= input | |
| 764 | result |= readinput | |
| 765 | 765 | if (offset & 16) |
| 766 | result |= input | |
| 766 | result |= readinput | |
| 767 | 767 | if (offset & 32) |
| 768 | result |= input | |
| 768 | result |= readinput | |
| 769 | 769 | if (offset & 64) |
| 770 | result |= input | |
| 770 | result |= readinput | |
| 771 | 771 | if (offset & 128) |
| 772 | result |= input | |
| 772 | result |= readinput | |
| 773 | 773 | |
| 774 | 774 | return result; |
| 775 | 775 | } |
| r1877 | r1878 | |
|---|---|---|
| 71 | 71 | READ8_HANDLER( odyssey2_bus_r ) |
| 72 | 72 | { |
| 73 | 73 | if ((p1 & (P1_VDC_COPY_MODE_ENABLE | P1_VDC_ENABLE)) == 0) |
| 74 | return odyssey2_video_r(offset); /* seems to have higher priority than ram??? */ | |
| 74 | return odyssey2_video_r(machine, offset); /* seems to have higher priority than ram??? */ | |
| 75 | 75 | |
| 76 | 76 | else if (!(p1 & P1_EXT_RAM_ENABLE)) |
| 77 | 77 | return ram[offset]; |
| r1877 | r1878 | |
| 86 | 86 | if ( offset & 0x80 ) { |
| 87 | 87 | if ( data & 0x20 ) { |
| 88 | 88 | logerror("voice write %02X, data = %02X (p1 = %02X)\n", offset, data, p1 ); |
| 89 | sp0256_ALD_w( 0, offset & 0x7F ); | |
| 89 | sp0256_ALD_w( machine, 0, offset & 0x7F ); | |
| 90 | 90 | } else { |
| 91 | 91 | /* TODO: Reset sp0256 in this case */ |
| 92 | 92 | } |
| r1877 | r1878 | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | else if (!(p1 & P1_VDC_ENABLE)) |
| 97 | odyssey2_video_w(offset, data); | |
| 97 | odyssey2_video_w(machine, offset, data); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | READ8_HANDLER( g7400_bus_r ) |
| 101 | 101 | { |
| 102 | 102 | if ((p1 & (P1_VDC_COPY_MODE_ENABLE | P1_VDC_ENABLE)) == 0) { |
| 103 | return odyssey2_video_r(offset); /* seems to have higher priority than ram??? */ | |
| 103 | return odyssey2_video_r(machine, offset); /* seems to have higher priority than ram??? */ | |
| 104 | 104 | } |
| 105 | 105 | else if (!(p1 & P1_EXT_RAM_ENABLE)) { |
| 106 | 106 | return ram[offset]; |
| r1877 | r1878 | |
| 117 | 117 | ram[offset] = data; |
| 118 | 118 | } |
| 119 | 119 | else if (!(p1 & P1_VDC_ENABLE)) { |
| 120 | odyssey2_video_w(offset, data); | |
| 120 | odyssey2_video_w(machine, offset, data); | |
| 121 | 121 | } else { |
| 122 | 122 | // ef9341_w( offset & 0x02, offset & 0x01, data ); |
| 123 | 123 | } |
| r1877 | r1878 | |
| 139 | 139 | |
| 140 | 140 | odyssey2_switch_banks(); |
| 141 | 141 | |
| 142 | odyssey2_lum_w ( 0, p1 >> 7 ); | |
| 142 | odyssey2_lum_w ( machine, 0, p1 >> 7 ); | |
| 143 | 143 | |
| 144 | 144 | logerror("%.6f p1 written %.2x\n", attotime_to_double(timer_get_time()), data); |
| 145 | 145 | } |
| r1877 | r1878 | |
|---|---|---|
| 106 | 106 | int i, bank, rbank, wbank; |
| 107 | 107 | int full_update = 0; |
| 108 | 108 | apple2_meminfo meminfo; |
| 109 | read8_handler rh; | |
| 110 | write8_handler wh; | |
| 109 | read8_machine_func rh; | |
| 110 | write8_machine_func wh; | |
| 111 | 111 | offs_t begin, end_r, end_w; |
| 112 | 112 | UINT8 *rbase, *wbase, *rom, *slot_ram; |
| 113 | 113 | UINT32 rom_length, slot_length, offset; |
| r1877 | r1878 | |
| 147 | 147 | rbank = (bank_disposition != A2MEM_IO) ? bank : 0; |
| 148 | 148 | begin = apple2_mem_config.memmap[i].begin; |
| 149 | 149 | end_r = apple2_mem_config.memmap[i].end; |
| 150 | rh = (read8_ | |
| 150 | rh = (read8_machin | |
| 151 | 151 | |
| 152 | 152 | LOG(("apple2_update_memory(): Updating RD {%06X..%06X} [#%02d] --> %08X\n", |
| 153 | 153 | begin, end_r, rbank, meminfo.read_mem)); |
| r1877 | r1878 | |
| 227 | 227 | wbank = 0; |
| 228 | 228 | begin = apple2_mem_config.memmap[i].begin; |
| 229 | 229 | end_w = apple2_mem_config.memmap[i].end; |
| 230 | wh = (write8_ | |
| 230 | wh = (write8_machin | |
| 231 | 231 | |
| 232 | 232 | LOG(("apple2_update_memory(): Updating WR {%06X..%06X} [#%02d] --> %08X\n", |
| 233 | 233 | begin, end_w, wbank, meminfo.write_mem)); |
| r1877 | r1878 | |
| 299 | 299 | |
| 300 | 300 | READ8_HANDLER(apple2_c0xx_r) |
| 301 | 301 | { |
| 302 | static const read8_ | |
| 302 | static const read8_machin | |
| 303 | 303 | { |
| 304 | 304 | apple2_c00x_r, |
| 305 | 305 | apple2_c01x_r, |
| r1877 | r1878 | |
| 312 | 312 | }; |
| 313 | 313 | UINT8 result = 0x00; |
| 314 | 314 | int slot; |
| 315 | running_machine *machine = Machine; | |
| 316 | 315 | |
| 317 | 316 | offset &= 0xFF; |
| 318 | 317 | |
| 319 | 318 | if (offset < 0x80) |
| 320 | 319 | { |
| 321 | 320 | if (handlers[offset / 0x10]) |
| 322 | result = handlers[offset / 0x10](offset % 0x10); | |
| 321 | result = handlers[offset / 0x10](machine, offset % 0x10); | |
| 323 | 322 | } |
| 324 | 323 | else |
| 325 | 324 | { |
| r1877 | r1878 | |
| 334 | 333 | |
| 335 | 334 | WRITE8_HANDLER(apple2_c0xx_w) |
| 336 | 335 | { |
| 337 | static const write8_ | |
| 336 | static const write8_machin | |
| 338 | 337 | { |
| 339 | 338 | apple2_c00x_w, |
| 340 | 339 | apple2_c01x_w, |
| r1877 | r1878 | |
| 346 | 345 | apple2_c07x_w |
| 347 | 346 | }; |
| 348 | 347 | int slot; |
| 349 | running_machine *machine = Machine; | |
| 350 | 348 | |
| 351 | 349 | offset &= 0xFF; |
| 352 | 350 | |
| 353 | 351 | if (offset < 0x80) |
| 354 | 352 | { |
| 355 | 353 | if (handlers[offset / 0x10]) |
| 356 | handlers[offset / 0x10](offset % 0x10, data); | |
| 354 | handlers[offset / 0x10](machine, offset % 0x10, data); | |
| 357 | 355 | } |
| 358 | 356 | else |
| 359 | 357 | { |
| r1877 | r1878 | |
| 923 | 921 | |
| 924 | 922 | READ8_HANDLER( apple2_c02x_r ) |
| 925 | 923 | { |
| 926 | apple2_c02x_w(offset, 0); | |
| 924 | apple2_c02x_w(machine, offset, 0); | |
| 927 | 925 | return apple2_getfloatingbusvalue(); |
| 928 | 926 | } |
| 929 | 927 | |
| r1877 | r1878 | |
| 970 | 968 | |
| 971 | 969 | WRITE8_HANDLER ( apple2_c03x_w ) |
| 972 | 970 | { |
| 973 | apple2_c03x_r(offset); | |
| 971 | apple2_c03x_r(machine, offset); | |
| 974 | 972 | } |
| 975 | 973 | |
| 976 | 974 | |
| r1877 | r1878 | |
| 1000 | 998 | |
| 1001 | 999 | WRITE8_HANDLER ( apple2_c05x_w ) |
| 1002 | 1000 | { |
| 1003 | apple2_c05x_r(offset); | |
| 1001 | apple2_c05x_r(machine, offset); | |
| 1004 | 1002 | } |
| 1005 | 1003 | |
| 1006 | 1004 | |
| r1877 | r1878 | |
| 1081 | 1079 | |
| 1082 | 1080 | WRITE8_HANDLER ( apple2_c07x_w ) |
| 1083 | 1081 | { |
| 1084 | apple2_c07x_r(offset); | |
| 1082 | apple2_c07x_r(machine, offset); | |
| 1085 | 1083 | } |
| 1086 | 1084 | |
| 1087 | 1085 | |
| r1877 | r1878 | |
| 1128 | 1126 | |
| 1129 | 1127 | static WRITE8_HANDLER ( apple2_c08x_w ) |
| 1130 | 1128 | { |
| 1131 | apple2_c08x_r(offset); | |
| 1129 | apple2_c08x_r(machine, offset); | |
| 1132 | 1130 | } |
| 1133 | 1131 | |
| 1134 | 1132 | |
| r1877 | r1878 | |
| 1139 | 1137 | |
| 1140 | 1138 | static UINT8 apple2_langcard_read(running_machine *machine, void *token, offs_t offset) |
| 1141 | 1139 | { |
| 1142 | return apple2_c08x_r(offset); | |
| 1140 | return apple2_c08x_r(machine, offset); | |
| 1143 | 1141 | |
| 1144 | 1142 | } |
| 1145 | 1143 | |
| r1877 | r1878 | |
| 1147 | 1145 | |
| 1148 | 1146 | static void apple2_langcard_write(running_machine *machine, void *token, offs_t offset, UINT8 data) |
| 1149 | 1147 | { |
| 1150 | apple2_c08x_w(offset, data); | |
| 1148 | apple2_c08x_w(machine, offset, data); | |
| 1151 | 1149 | } |
| 1152 | 1150 | |
| 1153 | 1151 | |
| r1877 | r1878 | |
| 1225 | 1223 | case 0x04: /* make inactive */ |
| 1226 | 1224 | break; |
| 1227 | 1225 | case 0x06: /* write data */ |
| 1228 | AY8910_write_port_0_w (0, latch0); | |
| 1226 | AY8910_write_port_0_w (machine, 0, latch0); | |
| 1229 | 1227 | break; |
| 1230 | 1228 | case 0x07: /* set register */ |
| 1231 | AY8910_control_port_0_w (0, latch0); | |
| 1229 | AY8910_control_port_0_w (machine, 0, latch0); | |
| 1232 | 1230 | break; |
| 1233 | 1231 | } |
| 1234 | 1232 | break; |
| r1877 | r1878 | |
| 1250 | 1248 | case 0x04: /* make inactive */ |
| 1251 | 1249 | break; |
| 1252 | 1250 | case 0x06: /* write data */ |
| 1253 | AY8910_write_port_1_w (0, latch1); | |
| 1251 | AY8910_write_port_1_w (machine, 0, latch1); | |
| 1254 | 1252 | break; |
| 1255 | 1253 | case 0x07: /* set register */ |
| 1256 | AY8910_control_port_1_w (0, latch1); | |
| 1254 | AY8910_control_port_1_w (machine, 0, latch1); | |
| 1257 | 1255 | break; |
| 1258 | 1256 | } |
| 1259 | 1257 | break; |
| r1877 | r1878 | |
| 1473 | 1471 | |
| 1474 | 1472 | static UINT8 apple2_fdc_read(running_machine *machine, void *token, offs_t offset) |
| 1475 | 1473 | { |
| 1476 | return applefdc_r(offset); | |
| 1474 | return applefdc_r(machine, offset); | |
| 1477 | 1475 | } |
| 1478 | 1476 | |
| 1479 | 1477 | |
| 1480 | 1478 | |
| 1481 | 1479 | static void apple2_fdc_write(running_machine *machine, void *token, offs_t offset, UINT8 data) |
| 1482 | 1480 | { |
| 1483 | applefdc_w(offset, data); | |
| 1481 | applefdc_w(machine, offset, data); | |
| 1484 | 1482 | } |
| 1485 | 1483 | |
| 1486 | 1484 |
| r1877 | r1878 | |
|---|---|---|
| 138 | 138 | |
| 139 | 139 | static void update_ti86_memory (void) |
| 140 | 140 | { |
| 141 | write8_ | |
| 141 | write8_machin | |
| 142 | 142 | |
| 143 | 143 | if (ti85_memory_page_0x4000 & 0x40) |
| 144 | 144 | { |
| r1877 | r1878 | |
|---|---|---|
| 473 | 473 | { |
| 474 | 474 | c64_io_mirror[ offset ] = data; |
| 475 | 475 | if (offset < 0x400) { |
| 476 | vic2_port_w (offset & 0x3ff, data); | |
| 476 | vic2_port_w (machine, offset & 0x3ff, data); | |
| 477 | 477 | } else if (offset < 0x800) { |
| 478 | sid6581_0_port_w (offset & 0x3ff, data); | |
| 478 | sid6581_0_port_w (machine, offset & 0x3ff, data); | |
| 479 | 479 | } else if (offset < 0xc00) |
| 480 | 480 | c64_colorram[offset & 0x3ff] = data | 0xf0; |
| 481 | 481 | else if (offset < 0xd00) |
| 482 | cia_0_w(offset, data); | |
| 482 | cia_0_w(machine, offset, data); | |
| 483 | 483 | else if (offset < 0xe00) |
| 484 | 484 | { |
| 485 | 485 | if (c64_cia1_on) |
| 486 | cia_1_w(offset, data); | |
| 486 | cia_1_w(machine, offset, data); | |
| 487 | 487 | else |
| 488 | 488 | DBG_LOG (1, "io write", ("%.3x %.2x\n", offset, data)); |
| 489 | 489 | } |
| r1877 | r1878 | |
| 515 | 515 | WRITE8_HANDLER(c64_ioarea_w) |
| 516 | 516 | { |
| 517 | 517 | if ( c64_io_enabled ) { |
| 518 | c64_write_io( offset, data ); | |
| 518 | c64_write_io( machine, offset, data ); | |
| 519 | 519 | } else { |
| 520 | 520 | c64_io_ram_w_ptr[ offset ] = data; |
| 521 | 521 | } |
| r1877 | r1878 | |
| 524 | 524 | READ8_HANDLER( c64_read_io ) |
| 525 | 525 | { |
| 526 | 526 | if (offset < 0x400) |
| 527 | return vic2_port_r (offset & 0x3ff); | |
| 527 | return vic2_port_r (machine, offset & 0x3ff); | |
| 528 | 528 | else if (offset < 0x800) |
| 529 | return sid6581_0_port_r (offset & 0x3ff); | |
| 529 | return sid6581_0_port_r (machine, offset & 0x3ff); | |
| 530 | 530 | else if (offset < 0xc00) |
| 531 | 531 | return c64_colorram[offset & 0x3ff]; |
| 532 | 532 | else if (offset < 0xd00) |
| 533 | return cia_0_r(offset); | |
| 533 | return cia_0_r(machine, offset); | |
| 534 | 534 | else if (c64_cia1_on && (offset < 0xe00)) |
| 535 | return cia_1_r(offset); | |
| 535 | return cia_1_r(machine, offset); | |
| 536 | 536 | DBG_LOG (1, "io read", ("%.3x\n", offset)); |
| 537 | 537 | return 0xff; |
| 538 | 538 | } |
| r1877 | r1878 | |
| 540 | 540 | READ8_HANDLER(c64_ioarea_r) |
| 541 | 541 | { |
| 542 | 542 | if ( c64_io_enabled ) { |
| 543 | return c64_read_io( offset ); | |
| 543 | return c64_read_io( machine, offset ); | |
| 544 | 544 | } |
| 545 | 545 | return c64_io_ram_r_ptr[ offset ]; |
| 546 | 546 | } |
| r1877 | r1878 | |
| 974 | 974 | opcode_base = c64_io_mirror; |
| 975 | 975 | opcode_memory_min = 0x0000; |
| 976 | 976 | opcode_memory_max = 0xcfff; |
| 977 | c64_io_mirror[address & 0x0fff] = c64_read_io( address & 0x0fff ); | |
| 977 | c64_io_mirror[address & 0x0fff] = c64_read_io( machine, address & 0x0fff ); | |
| 978 | 978 | } else { |
| 979 | 979 | opcode_mask = 0x0fff; |
| 980 | 980 | opcode_arg_base = c64_io_ram_r_ptr; |
| r1877 | r1878 | |
|---|---|---|
| 239 | 239 | |
| 240 | 240 | READ8_HANDLER( svi318_ppi_r ) |
| 241 | 241 | { |
| 242 | return ppi8255_0_r | |
| 242 | return ppi8255_0_r | |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | WRITE8_HANDLER( svi318_ppi_w ) |
| 246 | 246 | { |
| 247 | ppi8255_0_w | |
| 247 | ppi8255_0_w | |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | /* Printer port */ |
| r1877 | r1878 | |
| 451 | 451 | } |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | static void svi806_set_crtc_register(UINT8 reg, UINT8 data) { | |
| 455 | mc6845_address_w(mc6845, reg); | |
| 456 | mc6845_register_w(mc6845, data); | |
| 454 | static void svi806_set_crtc_register(UINT8 reg, UINT8 data) { | |
| 455 | /* | |
| 456 | NPW 9-Mar-2008 - This is bad; commenting out | |
| 457 | ||
| 458 | mc6845_address_w(mc6845, 0, reg); | |
| 459 | mc6845_register_w(mc6845, 0, data); | |
| 460 | */ | |
| 457 | 461 | } |
| 458 | 462 | |
| 459 | 463 | static TIMER_CALLBACK(svi318_80col_init_registers) { |
| r1877 | r1878 | |
| 491 | 495 | timer_set( attotime_zero, NULL, 0, svi318_80col_init_registers ); |
| 492 | 496 | } |
| 493 | 497 | |
| 494 | READ8_HANDLER( svi806_r ) | |
| 495 | { | |
| 496 | return mc6845_register_r( mc6845 ); | |
| 497 | } | |
| 498 | ||
| 499 | WRITE8_HANDLER( svi806_w ) | |
| 500 | { | |
| 501 | switch( offset ) { | |
| 502 | case 0: | |
| 503 | mc6845_address_w( mc6845, data ); | |
| 504 | break; | |
| 505 | case 1: | |
| 506 | mc6845_register_w( mc6845, data ); | |
| 507 | break; | |
| 508 | } | |
| 509 | } | |
| 510 | ||
| 511 | 498 | WRITE8_HANDLER( svi806_ram_enable_w ) |
| 512 | 499 | { |
| 513 | 500 | svi.svi806_ram_enabled = ( data & 0x01 ); |
| r1877 | r1878 | |
| 644 | 631 | TMS9928A_reset(); |
| 645 | 632 | |
| 646 | 633 | /* PPI */ |
| 647 | ppi8255_0_w(3, 0x92); | |
| 634 | ppi8255_0_w(machine, 3, 0x92); | |
| 648 | 635 | |
| 649 | 636 | svi.bank_switch = 0xff; |
| 650 | 637 | svi318_set_banks(); |
| r1877 | r1878 | |
|---|---|---|
| 114 | 114 | cr_ramena = 0x8000 |
| 115 | 115 | }; |
| 116 | 116 | |
| 117 | static void hsgpl_cru_w(int offset, int data); | |
| 118 | static READ8_HANDLER(hsgpl_dsr_r); | |
| 117 | static void hsgpl_cru_w(running_machine *machine, int offset, int data); | |
| 118 | static READ8_HANDLER(hsgpl_dsr_r); | |
| 119 | 119 | |
| 120 | 120 | static const ti99_peb_card_handlers_t hsgpl_handlers = |
| 121 | 121 | { |
| r1877 | r1878 | |
| 285 | 285 | /* |
| 286 | 286 | Write hsgpl CRU interface |
| 287 | 287 | */ |
| 288 | static void hsgpl_cru_w(int offset, int data) | |
| 288 | static void hsgpl_cru_w(running_machine *machine, int offset, int data) | |
| 289 | 289 | { |
| 290 | 290 | offset &= 0xf; |
| 291 | 291 |
| r1877 | r1878 | |
|---|---|---|
| 149 | 149 | |
| 150 | 150 | |
| 151 | 151 | |
| 152 | static void pc_map_vga_memory(offs_t begin, offs_t end, read8_ | |
| 152 | static void pc_map_vga_memory(offs_t begin, offs_t end, read8_machin | |
| 153 | 153 | { |
| 154 | 154 | int buswidth; |
| 155 | 155 | buswidth = cputype_databus_width(Machine->config->cpu[0].type, ADDRESS_SPACE_PROGRAM); |
| r1877 | r1878 | |
|---|---|---|
| 200 | 200 | |
| 201 | 201 | READ8_HANDLER( pc200_port378_r ) |
| 202 | 202 | { |
| 203 | int data=pc_parallelport1_r(offset); | |
| 204 | if (offset==1) data=(data&~7)|(input_port_1_r(0)&7); | |
| 205 | if (offset==2) data=(data&~0xe0)|(input_port_1_r(0)&0xc0); | |
| 203 | int data=pc_parallelport1_r(machine, offset); | |
| 204 | if (offset==1) data=(data&~7)|(readinputport(1)&7); | |
| 205 | if (offset==2) data=(data&~0xe0)|(readinputport(1)&0xc0); | |
| 206 | 206 | return data; |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | |
| 210 | 210 | READ8_HANDLER( pc1640_port378_r ) |
| 211 | 211 | { |
| 212 | int data=pc_parallelport1_r(offset); | |
| 213 | if (offset==1) data=(data&~7)|(input_port_1_r(0)&7); | |
| 212 | int data=pc_parallelport1_r(machine, offset); | |
| 213 | if (offset==1) data=(data&~7)|(readinputport(1)&7); | |
| 214 | 214 | if (offset==2) { |
| 215 | 215 | switch (pc1640.dipstate) { |
| 216 | 216 | case 0: |
| 217 | data=(data&~0xe0)|(input | |
| 217 | data=(data&~0xe0)|(readinput | |
| 218 | 218 | break; |
| 219 | 219 | case 1: |
| 220 | data=(data&~0xe0)|((input | |
| 220 | data=(data&~0xe0)|((readinput | |
| 221 | 221 | break; |
| 222 | 222 | case 2: |
| 223 | data=(data&~0xe0)|((input | |
| 223 | data=(data&~0xe0)|((readinput | |
| 224 | 224 | break; |
| 225 | 225 | |
| 226 | 226 | } |
| r1877 | r1878 | |
| 231 | 231 | READ8_HANDLER( pc1640_port3d0_r ) |
| 232 | 232 | { |
| 233 | 233 | if (offset==0xa) pc1640.dipstate=0; |
| 234 | return vga_port_03d0_r(offset); | |
| 234 | return vga_port_03d0_r(machine, offset); | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | READ8_HANDLER( pc1640_port4278_r ) |
| r1877 | r1878 | |
| 250 | 250 | |
| 251 | 251 | static READ8_HANDLER( pc1640_mouse_x_r ) |
| 252 | 252 | { |
| 253 | return pc1640.mouse.x-input | |
| 253 | return pc1640.mouse.x-readinput | |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | static READ8_HANDLER( pc1640_mouse_y_r ) |
| 257 | 257 | { |
| 258 | return pc1640.mouse.y-input | |
| 258 | return pc1640.mouse.y-readinput | |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | static WRITE8_HANDLER( pc1640_mouse_x_w ) |
| 262 | 262 | { |
| 263 | pc1640.mouse.x=data+input | |
| 263 | pc1640.mouse.x=data+readinput | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | static WRITE8_HANDLER( pc1640_mouse_y_w ) |
| 267 | 267 | { |
| 268 | pc1640.mouse.y=data+input | |
| 268 | pc1640.mouse.y=data+readinput | |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | READ16_HANDLER( pc1640_16le_mouse_x_r ) { return read16le_with_read8_handler(pc1640_mouse_x_r, offset, mem_mask); } | |
| 272 | READ16_HANDLER( pc1640_16le_mouse_y_r ) { return read16le_with_read8_handler(pc1640_mouse_y_r, offset, mem_mask); } | |
| 273 | WRITE16_HANDLER( pc1640_16le_mouse_x_w ) { write16le_with_write8_handler(pc1640_mouse_x_w, offset, data, mem_mask); } | |
| 274 | WRITE16_HANDLER( pc1640_16le_mouse_y_w ) { write16le_with_write8_handler(pc1640_mouse_y_w, offset, data, mem_mask); } | |
| 271 | READ16_HANDLER( pc1640_16le_mouse_x_r ) { return read16le_with_read8_handler(pc1640_mouse_x_r, machine, offset, mem_mask); } | |
| 272 | READ16_HANDLER( pc1640_16le_mouse_y_r ) { return read16le_with_read8_handler(pc1640_mouse_y_r, machine, offset, mem_mask); } | |
| 273 | WRITE16_HANDLER( pc1640_16le_mouse_x_w ) { write16le_with_write8_handler(pc1640_mouse_x_w, machine, offset, data, mem_mask); } | |
| 274 | WRITE16_HANDLER( pc1640_16le_mouse_y_w ) { write16le_with_write8_handler(pc1640_mouse_y_w, machine, offset, data, mem_mask); } | |
| 275 | 275 | |
| 276 | 276 | INPUT_PORTS_START( amstrad_keyboard ) |
| 277 | 277 | |
| r1877 | r1878 | |
| 402 | 402 | INPUT_PORTS_END |
| 403 | 403 | |
| 404 | 404 | |
| 405 | READ16_HANDLER( pc1640_16le_port60_r ) { return read16le_with_read8_handler(pc1640_port60_r, offset, mem_mask); } | |
| 406 | WRITE16_HANDLER( pc1640_16le_port60_w ) { write16le_with_write8_handler(pc1640_port60_w, offset, data, mem_mask); } | |
| 405 | READ16_HANDLER( pc1640_16le_port60_r ) { return read16le_with_read8_handler(pc1640_port60_r, machine, offset, mem_mask); } | |
| 406 | WRITE16_HANDLER( pc1640_16le_port60_w ) { write16le_with_write8_handler(pc1640_port60_w, machine, offset, data, mem_mask); } | |
| 407 | 407 | |
| 408 | READ16_HANDLER( pc200_16le_port378_r ) { return read16le_with_read8_handler(pc200_port378_r, offset, mem_mask); } | |
| 409 | READ16_HANDLER( pc1640_16le_port378_r ) { return read16le_with_read8_handler(pc1640_port378_r, offset, mem_mask); } | |
| 410 | READ16_HANDLER( pc1640_16le_port3d0_r ) { return read16le_with_read8_handler(pc1640_port3d0_r, offset, mem_mask); } | |
| 411 | READ16_HANDLER( pc1640_16le_port4278_r ) { return read16le_with_read8_handler(pc1640_port4278_r, offset, mem_mask); } | |
| 412 | READ16_HANDLER( pc1640_16le_port278_r ) { return read16le_with_read8_handler(pc1640_port278_r, offset, mem_mask); } | |
| 408 | READ16_HANDLER( pc200_16le_port378_r ) { return read16le_with_read8_handler(pc200_port378_r, machine, offset, mem_mask); } | |
| 409 | READ16_HANDLER( pc1640_16le_port378_r ) { return read16le_with_read8_handler(pc1640_port378_r, machine, offset, mem_mask); } | |
| 410 | READ16_HANDLER( pc1640_16le_port3d0_r ) { return read16le_with_read8_handler(pc1640_port3d0_r, machine, offset, mem_mask); } | |
| 411 | READ16_HANDLER( pc1640_16le_port4278_r ) { return read16le_with_read8_handler(pc1640_port4278_r, machine, offset, mem_mask); } | |
| 412 | READ16_HANDLER( pc1640_16le_port278_r ) { return read16le_with_read8_handler(pc1640_port278_r, machine, offset, mem_mask); } |
| r1877 | r1878 | |
|---|---|---|
| 1022 | 1022 | |
| 1023 | 1023 | if (hsgpl_crdena) |
| 1024 | 1024 | /* hsgpl is enabled */ |
| 1025 | return ti99_hsgpl_rom6_r(offset, mem_mask); | |
| 1025 | return ti99_hsgpl_rom6_r(machine, offset, mem_mask); | |
| 1026 | 1026 | |
| 1027 | 1027 | if (cartridge_mbx && (offset >= 0x0600) && (offset <= 0x07fe)) |
| 1028 | 1028 | return (cartridge_pages[0])[offset]; |
| r1877 | r1878 | |
| 1036 | 1036 | |
| 1037 | 1037 | if (hsgpl_crdena) |
| 1038 | 1038 | /* hsgpl is enabled */ |
| 1039 | ti99_hsgpl_rom6_w(offset, data, mem_mask); | |
| 1039 | ti99_hsgpl_rom6_w(machine, offset, data, mem_mask); | |
| 1040 | 1040 | else if (cartridge_minimemory && offset >= 0x800) |
| 1041 | 1041 | /* handle minimem RAM */ |
| 1042 | 1042 | COMBINE_DATA(current_page_ptr+offset); |
| r1877 | r1878 | |
| 1066 | 1066 | |
| 1067 | 1067 | if (hsgpl_crdena) |
| 1068 | 1068 | /* hsgpl is enabled */ |
| 1069 | return ti99_hsgpl_rom6_r(offset, mem_mask); | |
| 1069 | return ti99_hsgpl_rom6_r(machine, offset, mem_mask); | |
| 1070 | 1070 | |
| 1071 | 1071 | return 0; |
| 1072 | 1072 | } |
| r1877 | r1878 | |
| 1083 | 1083 | |
| 1084 | 1084 | if (hsgpl_crdena) |
| 1085 | 1085 | /* hsgpl is enabled */ |
| 1086 | ti99_hsgpl_rom6_w(offset, data, mem_mask); | |
| 1086 | ti99_hsgpl_rom6_w(machine, offset, data, mem_mask); | |
| 1087 | 1087 | } |
| 1088 | 1088 | |
| 1089 | 1089 | /*---------------------------------------------------------------------------*/ |
| r1877 | r1878 | |
| 1123 | 1123 | { |
| 1124 | 1124 | activecpu_adjust_icount(-4); |
| 1125 | 1125 | |
| 1126 | SN76496_0_w(offset, (data >> 8) & 0xff); | |
| 1126 | SN76496_0_w(machine, offset, (data >> 8) & 0xff); | |
| 1127 | 1127 | } |
| 1128 | 1128 | |
| 1129 | 1129 | /* |
| r1877 | r1878 | |
| 1135 | 1135 | |
| 1136 | 1136 | if (offset & 1) |
| 1137 | 1137 | { /* read VDP status */ |
| 1138 | return ((int) TMS9928A_register_r(0)) << 8; | |
| 1138 | return ((int) TMS9928A_register_r(machine, 0)) << 8; | |
| 1139 | 1139 | } |
| 1140 | 1140 | else |
| 1141 | 1141 | { /* read VDP RAM */ |
| 1142 | return ((int) TMS9928A_vram_r(0)) << 8; | |
| 1142 | return ((int) TMS9928A_vram_r(machine, 0)) << 8; | |
| 1143 | 1143 | } |
| 1144 | 1144 | } |
| 1145 | 1145 | |
| r1877 | r1878 | |
| 1152 | 1152 | |
| 1153 | 1153 | if (offset & 1) |
| 1154 | 1154 | { /* write VDP address */ |
| 1155 | TMS9928A_register_w(0, (data >> 8) & 0xff); | |
| 1155 | TMS9928A_register_w(machine, 0, (data >> 8) & 0xff); | |
| 1156 | 1156 | } |
| 1157 | 1157 | else |
| 1158 | 1158 | { /* write VDP data */ |
| 1159 | TMS9928A_vram_w(0, (data >> 8) & 0xff); | |
| 1159 | TMS9928A_vram_w(machine, 0, (data >> 8) & 0xff); | |
| 1160 | 1160 | } |
| 1161 | 1161 | } |
| 1162 | 1162 | |
| r1877 | r1878 | |
| 1169 | 1169 | |
| 1170 | 1170 | if (offset & 1) |
| 1171 | 1171 | { /* read VDP status */ |
| 1172 | return ((int) v9938_status_r(0)) << 8; | |
| 1172 | return ((int) v9938_status_r(machine, 0)) << 8; | |
| 1173 | 1173 | } |
| 1174 | 1174 | else |
| 1175 | 1175 | { /* read VDP RAM */ |
| 1176 | return ((int) v9938_vram_r(0)) << 8; | |
| 1176 | return ((int) v9938_vram_r(machine, 0)) << 8; | |
| 1177 | 1177 | } |
| 1178 | 1178 | } |
| 1179 | 1179 | |
| r1877 | r1878 | |
| 1188 | 1188 | { |
| 1189 | 1189 | case 0: |
| 1190 | 1190 | /* write VDP data */ |
| 1191 | v9938_vram_w(0, (data >> 8) & 0xff); | |
| 1191 | v9938_vram_w(machine, 0, (data >> 8) & 0xff); | |
| 1192 | 1192 | break; |
| 1193 | 1193 | case 1: |
| 1194 | 1194 | /* write VDP address */ |
| 1195 | v9938_command_w(0, (data >> 8) & 0xff); | |
| 1195 | v9938_command_w(machine, 0, (data >> 8) & 0xff); | |
| 1196 | 1196 | break; |
| 1197 | 1197 | case 2: |
| 1198 | 1198 | /* write VDP palette */ |
| 1199 | v9938_palette_w(0, (data >> 8) & 0xff); | |
| 1199 | v9938_palette_w(machine, 0, (data >> 8) & 0xff); | |
| 1200 | 1200 | break; |
| 1201 | 1201 | case 3: |
| 1202 | 1202 | /* write VDP register */ |
| 1203 | v9938_register_w(0, (data >> 8) & 0xff); | |
| 1203 | v9938_register_w(machine, 0, (data >> 8) & 0xff); | |
| 1204 | 1204 | break; |
| 1205 | 1205 | } |
| 1206 | 1206 | } |
| r1877 | r1878 | |
| 1212 | 1212 | { |
| 1213 | 1213 | activecpu_adjust_icount(-(18+3)); /* this is just a minimum, it can be more */ |
| 1214 | 1214 | |
| 1215 | return ((int) tms5220_status_r(offset)) << 8; | |
| 1215 | return ((int) tms5220_status_r(machine, offset)) << 8; | |
| 1216 | 1216 | } |
| 1217 | 1217 | |
| 1218 | 1218 | #if 0 |
| r1877 | r1878 | |
| 1255 | 1255 | } |
| 1256 | 1256 | #endif |
| 1257 | 1257 | |
| 1258 | tms5220_data_w(offset, (data >> 8) & 0xff); | |
| 1258 | tms5220_data_w(machine, offset, (data >> 8) & 0xff); | |
| 1259 | 1259 | } |
| 1260 | 1260 | |
| 1261 | 1261 | /* |
| r1877 | r1878 | |
| 1297 | 1297 | |
| 1298 | 1298 | if (hsgpl_crdena) |
| 1299 | 1299 | /* hsgpl buffers are stronger than console GROM buffers */ |
| 1300 | reply = ti99_hsgpl_gpl_r(offset, mem_mask); | |
| 1300 | reply = ti99_hsgpl_gpl_r(machine, offset, mem_mask); | |
| 1301 | 1301 | |
| 1302 | 1302 | return reply; |
| 1303 | 1303 | } |
| r1877 | r1878 | |
| 1345 | 1345 | } |
| 1346 | 1346 | |
| 1347 | 1347 | if (hsgpl_crdena) |
| 1348 | ti99_hsgpl_gpl_w(offset, data, mem_mask); | |
| 1348 | ti99_hsgpl_gpl_w(machine, offset, data, mem_mask); | |
| 1349 | 1349 | } |
| 1350 | 1350 | |
| 1351 | 1351 | /* |
| r1877 | r1878 | |
| 1355 | 1355 | { |
| 1356 | 1356 | activecpu_adjust_icount(-4); /* HSGPL is located on 8-bit bus? */ |
| 1357 | 1357 | |
| 1358 | return /*hsgpl_crdena ?*/ ti99_hsgpl_gpl_r(offset, mem_mask) /*: 0*/; | |
| 1358 | return /*hsgpl_crdena ?*/ ti99_hsgpl_gpl_r(machine, offset, mem_mask) /*: 0*/; | |
| 1359 | 1359 | } |
| 1360 | 1360 | |
| 1361 | 1361 | /* |
| r1877 | r1878 | |
| 1366 | 1366 | activecpu_adjust_icount(-4); /* HSGPL is located on 8-bit bus? */ |
| 1367 | 1367 | |
| 1368 | 1368 | /*if (hsgpl_crdena)*/ |
| 1369 | ti99_hsgpl_gpl_w(offset, data, mem_mask); | |
| 1369 | ti99_hsgpl_gpl_w(machine, offset, data, mem_mask); | |
| 1370 | 1370 | } |
| 1371 | 1371 | |
| 1372 | 1372 | |
| r1877 | r1878 | |
| 1416 | 1416 | { |
| 1417 | 1417 | if (offset & 2) |
| 1418 | 1418 | /* read VDP status */ |
| 1419 | reply = TMS9928A_register_r(0); | |
| 1419 | reply = TMS9928A_register_r(machine, 0); | |
| 1420 | 1420 | else |
| 1421 | 1421 | /* read VDP RAM */ |
| 1422 | reply = TMS9928A_vram_r(0); | |
| 1422 | reply = TMS9928A_vram_r(machine, 0); | |
| 1423 | 1423 | } |
| 1424 | 1424 | } |
| 1425 | 1425 | else |
| r1877 | r1878 | |
| 1435 | 1435 | if (! (offset & 1)) |
| 1436 | 1436 | { |
| 1437 | 1437 | activecpu_adjust_icount(-16*4); /* this is just a minimum, it can be more */ |
| 1438 | reply = tms5220_status_r(0); | |
| 1438 | reply = tms5220_status_r(machine, 0); | |
| 1439 | 1439 | } |
| 1440 | 1440 | break; |
| 1441 | 1441 | |
| 1442 | 1442 | case 6: |
| 1443 | 1443 | /* GPL read */ |
| 1444 | 1444 | if (! (offset & 1)) |
| 1445 | reply = ti99_rgpl_r(offset >> 1, 0) >> 8; | |
| 1445 | reply = ti99_rgpl_r(machine, offset >> 1, 0) >> 8; | |
| 1446 | 1446 | break; |
| 1447 | 1447 | |
| 1448 | 1448 | default: |
| r1877 | r1878 | |
| 1487 | 1487 | |
| 1488 | 1488 | case 2: |
| 1489 | 1489 | /* DSR space */ |
| 1490 | reply = ti99_8_peb_r(offset & 0x1fff); | |
| 1490 | reply = ti99_8_peb_r(machine, offset & 0x1fff); | |
| 1491 | 1491 | break; |
| 1492 | 1492 | |
| 1493 | 1493 | case 3: |
| r1877 | r1878 | |
| 1546 | 1546 | case 1: |
| 1547 | 1547 | /* sound write + RAM */ |
| 1548 | 1548 | if (offset < 0x8410) |
| 1549 | SN76496_0_w(offset, data); | |
| 1549 | SN76496_0_w(machine, offset, data); | |
| 1550 | 1550 | else |
| 1551 | 1551 | sRAM_ptr_8[offset & 0x1fff] = data; |
| 1552 | 1552 | break; |
| r1877 | r1878 | |
| 1587 | 1587 | { |
| 1588 | 1588 | if (offset & 2) |
| 1589 | 1589 | /* read VDP status */ |
| 1590 | TMS9928A_register_w(0, data); | |
| 1590 | TMS9928A_register_w(machine, 0, data); | |
| 1591 | 1591 | else |
| 1592 | 1592 | /* read VDP RAM */ |
| 1593 | TMS9928A_vram_w(0, data); | |
| 1593 | TMS9928A_vram_w(machine, 0, data); | |
| 1594 | 1594 | } |
| 1595 | 1595 | break; |
| 1596 | 1596 | |
| r1877 | r1878 | |
| 1617 | 1617 | timer_set(attotime_zero, NULL, 0, /*speech_kludge_callback*/NULL); |
| 1618 | 1618 | } |
| 1619 | 1619 | |
| 1620 | tms5220_data_w(offset, data); | |
| 1620 | tms5220_data_w(machine, offset, data); | |
| 1621 | 1621 | } |
| 1622 | 1622 | break; |
| 1623 | 1623 | |
| 1624 | 1624 | case 7: |
| 1625 | 1625 | /* GPL write */ |
| 1626 | 1626 | if (! (offset & 1)) |
| 1627 | ti99_wgpl_w(offset >> 1, data << 8, 0); | |
| 1627 | ti99_wgpl_w(machine, offset >> 1, data << 8, 0); | |
| 1628 | 1628 | break; |
| 1629 | 1629 | |
| 1630 | 1630 | default: |
| r1877 | r1878 | |
| 1664 | 1664 | |
| 1665 | 1665 | case 2: |
| 1666 | 1666 | /* DSR space */ |
| 1667 | ti99_8_peb_w(offset & 0x1fff, data); | |
| 1667 | ti99_8_peb_w(machine, offset & 0x1fff, data); | |
| 1668 | 1668 | break; |
| 1669 | 1669 | |
| 1670 | 1670 | case 3: |
| r1877 | r1878 | |
| 2467 | 2467 | */ |
| 2468 | 2468 | |
| 2469 | 2469 | /* prototypes */ |
| 2470 | static void ti99_8_internal_dsr_cru_w(int offset, int data); | |
| 2470 | static void ti99_8_internal_dsr_cru_w(running_machine *machine, int offset, int data); | |
| 2471 | 2471 | static READ8_HANDLER(ti99_8_internal_dsr_r); |
| 2472 | 2472 | |
| 2473 | 2473 | |
| r1877 | r1878 | |
| 2494 | 2494 | /* write CRU bit: |
| 2495 | 2495 | bit0: enable/disable internal DSR ROM, |
| 2496 | 2496 | bit1: hard reset */ |
| 2497 | static void ti99_8_internal_dsr_cru_w(int offset, int data) | |
| 2497 | static void ti99_8_internal_dsr_cru_w(running_machine *machine, int offset, int data) | |
| 2498 | 2498 | { |
| 2499 | 2499 | switch (offset) |
| 2500 | 2500 | { |
| r1877 | r1878 | |
| 2524 | 2524 | */ |
| 2525 | 2525 | |
| 2526 | 2526 | /* prototypes */ |
| 2527 | static void ti99_4p_internal_dsr_cru_w(int offset, int data); | |
| 2527 | static void ti99_4p_internal_dsr_cru_w(running_machine *machine, int offset, int data); | |
| 2528 | 2528 | static READ16_HANDLER(ti99_4p_internal_dsr_r); |
| 2529 | 2529 | |
| 2530 | 2530 | |
| r1877 | r1878 | |
| 2558 | 2558 | bit1: enable/disable internal cartridge ROM |
| 2559 | 2559 | bit2: set/clear senila |
| 2560 | 2560 | bit3: set/clear senilb*/ |
| 2561 | static void ti99_4p_internal_dsr_cru_w(int offset, int data) | |
| 2561 | static void ti99_4p_internal_dsr_cru_w(running_machine *machine, int offset, int data) | |
| 2562 | 2562 | { |
| 2563 | 2563 | switch (offset) |
| 2564 | 2564 | { |
| r1877 | r1878 | |
| 2655 | 2655 | */ |
| 2656 | 2656 | |
| 2657 | 2657 | /* prototypes */ |
| 2658 | static void sAMS_cru_w(int offset, int data); | |
| 2658 | static void sAMS_cru_w(running_machine *machine, int offset, int data); | |
| 2659 | 2659 | static READ8_HANDLER(sAMS_mapper_r); |
| 2660 | 2660 | static WRITE8_HANDLER(sAMS_mapper_w); |
| 2661 | 2661 | |
| r1877 | r1878 | |
| 2700 | 2700 | /* write CRU bit: |
| 2701 | 2701 | bit0: enable/disable mapper registers in DSR space, |
| 2702 | 2702 | bit1: enable/disable address mapping */ |
| 2703 | static void sAMS_cru_w(int offset, int data) | |
| 2703 | static void sAMS_cru_w(running_machine *machine, int offset, int data) | |
| 2704 | 2704 | { |
| 2705 | 2705 | if (offset == 1) |
| 2706 | 2706 | sAMS_mapper_on = data; |
| r1877 | r1878 | |
| 2770 | 2770 | */ |
| 2771 | 2771 | |
| 2772 | 2772 | /* prototypes */ |
| 2773 | static void ti99_4p_mapper_cru_w(int offset, int data); | |
| 2773 | static void ti99_4p_mapper_cru_w(running_machine *machine, int offset, int data); | |
| 2774 | 2774 | static READ16_HANDLER(ti99_4p_mapper_r); |
| 2775 | 2775 | static WRITE16_HANDLER(ti99_4p_mapper_w); |
| 2776 | 2776 | |
| r1877 | r1878 | |
| 2842 | 2842 | /* write CRU bit: |
| 2843 | 2843 | bit0: enable/disable mapper registers in DSR space, |
| 2844 | 2844 | bit1: enable/disable address mapping */ |
| 2845 | static void ti99_4p_mapper_cru_w(int offset, int data) | |
| 2845 | static void ti99_4p_mapper_cru_w(running_machine *machine, int offset, int data) | |
| 2846 | 2846 | { |
| 2847 | 2847 | int i; |
| 2848 | 2848 | |
| r1877 | r1878 | |
| 2920 | 2920 | Up to 512kb of RAM. Straightforward mapper, works with 32kb chunks. |
| 2921 | 2921 | */ |
| 2922 | 2922 | |
| 2923 | static int myarc_cru_r(int offset); | |
| 2924 | static void myarc_cru_w(int offset, int data); | |
| 2923 | static int myarc_cru_r(running_machine *machine, int offset); | |
| 2924 | static void myarc_cru_w(running_machine *machine, int offset, int data); | |
| 2925 | 2925 | |
| 2926 | 2926 | static READ16_HANDLER ( ti99_myarcxramlow_r ); |
| 2927 | 2927 | static WRITE16_HANDLER ( ti99_myarcxramlow_w ); |
| r1877 | r1878 | |
| 2984 | 2984 | |
| 2985 | 2985 | /* read CRU bit: |
| 2986 | 2986 | bit 1-2 (128kb) or 1-4 (512kb): read current map offset */ |
| 2987 | static int myarc_cru_r(int offset) | |
| 2987 | static int myarc_cru_r(running_machine *machine, int offset) | |
| 2988 | 2988 | { |
| 2989 | 2989 | /*if (offset == 0)*/ /* right??? */ |
| 2990 | 2990 | { |
| r1877 | r1878 | |
| 2994 | 2994 | |
| 2995 | 2995 | /* write CRU bit: |
| 2996 | 2996 | bit 1-2 (128kb) or 1-4 (512kb): write map offset */ |
| 2997 | static void myarc_cru_w(int offset, int data) | |
| 2997 | static void myarc_cru_w(running_machine *machine, int offset, int data) | |
| 2998 | 2998 | { |
| 2999 | 2999 | offset &= 0x7; /* right??? */ |
| 3000 | 3000 | if (offset >= 1) |
| r1877 | r1878 | |
| 3051 | 3051 | */ |
| 3052 | 3052 | |
| 3053 | 3053 | /* prototypes */ |
| 3054 | static int evpc_cru_r(int offset); | |
| 3055 | static void evpc_cru_w(int offset, int data); | |
| 3054 | static int evpc_cru_r(running_machine *machine, int offset); | |
| 3055 | static void evpc_cru_w(running_machine *machine, int offset, int data); | |
| 3056 | 3056 | static READ8_HANDLER(evpc_mem_r); |
| 3057 | 3057 | static WRITE8_HANDLER(evpc_mem_w); |
| 3058 | 3058 | |
| r1877 | r1878 | |
| 3091 | 3091 | /* |
| 3092 | 3092 | Read evpc CRU interface |
| 3093 | 3093 | */ |
| 3094 | static int evpc_cru_r(int offset) | |
| 3094 | static int evpc_cru_r(running_machine *machine, int offset) | |
| 3095 | 3095 | { |
| 3096 | 3096 | return 0; /* dip-switch value */ |
| 3097 | 3097 | } |
| r1877 | r1878 | |
| 3099 | 3099 | /* |
| 3100 | 3100 | Write evpc CRU interface |
| 3101 | 3101 | */ |
| 3102 | static void evpc_cru_w(int offset, int data) | |
| 3102 | static void evpc_cru_w(running_machine *machine, int offset, int data) | |
| 3103 | 3103 | { |
| 3104 | 3104 | switch (offset) |
| 3105 | 3105 | { |
| r1877 | r1878 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | int data; |
| 33 | 33 | int motor; |
| 34 | write8_ | |
| 34 | write8_machin | |
| 35 | 35 | |
| 36 | 36 | int type; /* 0 nothing */ |
| 37 | 37 | } |
| r1877 | r1878 | |
| 885 | 885 | } |
| 886 | 886 | } |
| 887 | 887 | if (tape.read_callback) |
| 888 | tape.read_callback (0, tape.data); | |
| 888 | tape.read_callback (machine, 0, tape.data); | |
| 889 | 889 | vc20_prg_state (); |
| 890 | 890 | } |
| 891 | 891 | |
| 892 | void vc20_tape_open (write8_ | |
| 892 | void vc20_tape_open (write8_machin | |
| 893 | 893 | { |
| 894 | 894 | tape.read_callback = read_callback; |
| 895 | 895 | #ifndef NEW_GAMEDRIVER |
| r1877 | r1878 | |
|---|---|---|
| 31 | 31 | /* prototypes */ |
| 32 | 32 | static void int_callback(int which, int INT); |
| 33 | 33 | static void xmit_callback(int which, int data); |
| 34 | static int rs232_cru_r(int offset); | |
| 35 | static void rs232_cru_w(int offset, int data); | |
| 36 | static READ8_HANDLER(rs232_mem_r); | |
| 34 | static int rs232_cru_r(running_machine *machine, int offset); | |
| 35 | static void rs232_cru_w(running_machine *machine, int offset, int data); | |
| 36 | static READ8_HANDLER(rs232_mem_r); | |
| 37 | 37 | static WRITE8_HANDLER(rs232_mem_w); |
| 38 | 38 | |
| 39 | 39 | /* pointer to the rs232 ROM data */ |
| r1877 | r1878 | |
| 235 | 235 | bit 0: always 0 |
| 236 | 236 | ... |
| 237 | 237 | */ |
| 238 | static int rs232_cru_r(int offset) | |
| 238 | static int rs232_cru_r(running_machine *machine, int offset) | |
| 239 | 239 | { |
| 240 | 240 | int reply; |
| 241 | 241 | |
| r1877 | r1878 | |
| 291 | 291 | /* |
| 292 | 292 | Write rs232 card CRU interface |
| 293 | 293 | */ |
| 294 | static void rs232_cru_w(int offset, int data) | |
| 294 | static void rs232_cru_w(running_machine *machine, int offset, int data) | |
| 295 | 295 | { |
| 296 | 296 | switch (offset >> 5) |
| 297 | 297 | { |
| r1877 | r1878 | |
|---|---|---|
| 574 | 574 | if ((offset>=0x200) && (offset<=0x2ff)) /* SHEILA */ |
| 575 | 575 | { |
| 576 | 576 | myo=offset-0x200; |
| 577 | if ((myo>=0x00) && (myo<=0x07)) return BBC_6845_r(myo-0x00); /* Video Controller */ | |
| 578 | if ((myo>=0x08) && (myo<=0x0f)) return BBC_6850_r(myo-0x08); /* Serial Controller */ | |
| 577 | if ((myo>=0x00) && (myo<=0x07)) return BBC_6845_r(machine, myo-0x00); /* Video Controller */ | |
| 578 | if ((myo>=0x08) && (myo<=0x0f)) return BBC_6850_r(machine, myo-0x08); /* Serial Controller */ | |
| 579 | 579 | if ((myo>=0x10) && (myo<=0x17)) return 0xfe; /* Serial System Chip */ |
| 580 | if ((myo>=0x18) && (myo<=0x1f)) return uPD7002_r(myo-0x18); /* A to D converter */ | |
| 580 | if ((myo>=0x18) && (myo<=0x1f)) return uPD7002_r(machine, myo-0x18); /* A to D converter */ | |
| 581 | 581 | if ((myo>=0x20) && (myo<=0x23)) return 0xfe; /* VideoULA */ |
| 582 | if ((myo>=0x24) && (myo<=0x27)) return bbcm_wd1770l_read(myo-0x24); /* 1770 */ | |
| 583 | if ((myo>=0x28) && (myo<=0x2f)) return bbcm_wd1770_read(myo-0x28); /* disc control latch */ | |
| 582 | if ((myo>=0x24) && (myo<=0x27)) return bbcm_wd1770l_read(machine, myo-0x24); /* 1770 */ | |
| 583 | if ((myo>=0x28) && (myo<=0x2f)) return bbcm_wd1770_read(machine, myo-0x28); /* disc control latch */ | |
| 584 | 584 | if ((myo>=0x30) && (myo<=0x33)) return 0xfe; /* page select */ |
| 585 | if ((myo>=0x34) && (myo<=0x37)) return bbcm_ACCCON_read(myo-0x34); /* ACCCON */ | |
| 585 | if ((myo>=0x34) && (myo<=0x37)) return bbcm_ACCCON_read(machine, myo-0x34); /* ACCCON */ | |
| 586 | 586 | if ((myo>=0x38) && (myo<=0x3f)) return 0xfe; /* NC ?? */ |
| 587 | if ((myo>=0x40) && (myo<=0x5f)) return via_0_r(myo-0x40); | |
| 588 | if ((myo>=0x60) && (myo<=0x7f)) return via_1_r(myo-0x60); | |
| 587 | if ((myo>=0x40) && (myo<=0x5f)) return via_0_r(machine, myo-0x40); | |
| 588 | if ((myo>=0x60) && (myo<=0x7f)) return via_1_r(machine, myo-0x60); | |
| 589 | 589 | if ((myo>=0x80) && (myo<=0x9f)) return 0xfe; |
| 590 | 590 | if ((myo>=0xa0) && (myo<=0xbf)) return 0xfe; |
| 591 | 591 | if ((myo>=0xc0) && (myo<=0xdf)) return 0xfe; |
| r1877 | r1878 | |
| 602 | 602 | if ((offset>=0x200) && (offset<=0x2ff)) /* SHEILA */ |
| 603 | 603 | { |
| 604 | 604 | myo=offset-0x200; |
| 605 | if ((myo>=0x00) && (myo<=0x07)) BBC_6845_w(myo-0x00,data); /* Video Controller */ | |
| 606 | if ((myo>=0x08) && (myo<=0x0f)) BBC_6850_w(myo-0x08,data); /* Serial Controller */ | |
| 607 | if ((myo>=0x10) && (myo<=0x17)) BBC_SerialULA_w(myo-0x10,data); /* Serial System Chip */ | |
| 608 | if ((myo>=0x18) && (myo<=0x1f)) uPD7002_w(myo-0x18,data); /* A to D converter */ | |
| 609 | if ((myo>=0x20) && (myo<=0x23)) videoULA_w(myo-0x20,data); /* VideoULA */ | |
| 610 | if ((myo>=0x24) && (myo<=0x27)) bbcm_wd1770l_write(myo-0x24,data); /* 1770 */ | |
| 611 | if ((myo>=0x28) && (myo<=0x2f)) bbcm_wd1770_write(myo-0x28,data); /* disc control latch */ | |
| 612 | if ((myo>=0x30) && (myo<=0x33)) page_selectbm_w(myo-0x30,data); /* page select */ | |
| 613 | if ((myo>=0x34) && (myo<=0x37)) bbcm_ACCCON_write(myo-0x34,data); /* ACCCON */ | |
| 605 | if ((myo>=0x00) && (myo<=0x07)) BBC_6845_w(machine, myo-0x00,data); /* Video Controller */ | |
| 606 | if ((myo>=0x08) && (myo<=0x0f)) BBC_6850_w(machine, myo-0x08,data); /* Serial Controller */ | |
| 607 | if ((myo>=0x10) && (myo<=0x17)) BBC_SerialULA_w(machine, myo-0x10,data); /* Serial System Chip */ | |
| 608 | if ((myo>=0x18) && (myo<=0x1f)) uPD7002_w(machine, myo-0x18,data); /* A to D converter */ | |
| 609 | if ((myo>=0x20) && (myo<=0x23)) videoULA_w(machine, myo-0x20,data); /* VideoULA */ | |
| 610 | if ((myo>=0x24) && (myo<=0x27)) bbcm_wd1770l_write(machine, myo-0x24,data); /* 1770 */ | |
| 611 | if ((myo>=0x28) && (myo<=0x2f)) bbcm_wd1770_write(machine, myo-0x28,data); /* disc control latch */ | |
| 612 | if ((myo>=0x30) && (myo<=0x33)) page_selectbm_w(machine, myo-0x30,data); /* page select */ | |
| 613 | if ((myo>=0x34) && (myo<=0x37)) bbcm_ACCCON_write(machine, myo-0x34,data); /* ACCCON */ | |
| 614 | 614 | //if ((myo>=0x38) && (myo<=0x3f)) /* NC ?? */ |
| 615 | if ((myo>=0x40) && (myo<=0x5f)) via_0_w(myo-0x40,data); | |
| 616 | if ((myo>=0x60) && (myo<=0x7f)) via_1_w(myo-0x60,data); | |
| 615 | if ((myo>=0x40) && (myo<=0x5f)) via_0_w(machine, myo-0x40,data); | |
| 616 | if ((myo>=0x60) && (myo<=0x7f)) via_1_w(machine, myo-0x60,data); | |
| 617 | 617 | //if ((myo>=0x80) && (myo<=0x9f)) |
| 618 | 618 | //if ((myo>=0xa0) && (myo<=0xbf)) |
| 619 | 619 | //if ((myo>=0xc0) && (myo<=0xdf)) |
| r1877 | r1878 | |
| 767 | 767 | |
| 768 | 768 | if ((readinputport(column)|0x01)!=0xff) |
| 769 | 769 | { |
| 770 | via_0_ca2_w(0,1); | |
| 770 | via_0_ca2_w(machine, 0,1); | |
| 771 | 771 | } else { |
| 772 | via_0_ca2_w(0,0); | |
| 772 | via_0_ca2_w(machine, 0,0); | |
| 773 | 773 | } |
| 774 | 774 | |
| 775 | 775 | } else { |
| 776 | via_0_ca2_w(0,0); | |
| 776 | via_0_ca2_w(machine, 0,0); | |
| 777 | 777 | } |
| 778 | 778 | } |
| 779 | 779 | } |
| r1877 | r1878 | |
| 799 | 799 | |
| 800 | 800 | if ((readinputport(column)|0x01)!=0xff) |
| 801 | 801 | { |
| 802 | via_0_ca2_w(0,1); | |
| 802 | via_0_ca2_w(machine, 0,1); | |
| 803 | 803 | } else { |
| 804 | via_0_ca2_w(0,0); | |
| 804 | via_0_ca2_w(machine, 0,0); | |
| 805 | 805 | } |
| 806 | 806 | |
| 807 | 807 | } else { |
| 808 | via_0_ca2_w(0,0); | |
| 808 | via_0_ca2_w(machine, 0,0); | |
| 809 | 809 | } |
| 810 | 810 | } |
| 811 | 811 | } |
| 812 | 812 | |
| 813 | 813 | |
| 814 | 814 | |
| 815 | static int bbc_keyboard(int data) | |
| 815 | static int bbc_keyboard(running_machine *machine, int data) | |
| 816 | 816 | { |
| 817 | 817 | int bit; |
| 818 | 818 | int row; |
| r1877 | r1878 | |
| 834 | 834 | |
| 835 | 835 | if ((res|1)!=0xff) |
| 836 | 836 | { |
| 837 | via_0_ca2_w(0,1); | |
| 837 | via_0_ca2_w(machine, 0,1); | |
| 838 | 838 | } else { |
| 839 | via_0_ca2_w(0,0); | |
| 839 | via_0_ca2_w(machine, 0,0); | |
| 840 | 840 | } |
| 841 | 841 | |
| 842 | 842 | return (data & 0x7f) | (bit<<7); |
| r1877 | r1878 | |
| 858 | 858 | |
| 859 | 859 | |
| 860 | 860 | /* This the BBC Masters Real Time Clock and NVRam IC */ |
| 861 | static void MC146818_set( | |
| 861 | static void MC146818_set(running_machine *machine) | |
| 862 | 862 | { |
| 863 | 863 | logerror ("146181 WR=%d DS=%d AS=%d CE=%d \n",MC146818_WR,MC146818_DS,MC146818_AS,MC146818_CE); |
| 864 | 864 | |
| r1877 | r1878 | |
| 870 | 870 | { |
| 871 | 871 | if (MC146818_WR) |
| 872 | 872 | { |
| 873 | via_system_porta=mc146818_port_r(1); | |
| 873 | via_system_porta=mc146818_port_r(machine, 1); | |
| 874 | 874 | //logerror("read 146818 data %d \n",via_system_porta); |
| 875 | 875 | } else { |
| 876 | mc146818_port_w(1,via_system_porta); | |
| 876 | mc146818_port_w(machine, 1,via_system_porta); | |
| 877 | 877 | //logerror("write 146818 data %d \n",via_system_porta); |
| 878 | 878 | } |
| 879 | 879 | } |
| r1877 | r1878 | |
| 881 | 881 | // if address select is set then set the address in the 146818 |
| 882 | 882 | if (MC146818_AS) |
| 883 | 883 | { |
| 884 | mc146818_port_w(0,via_system_porta); | |
| 884 | mc146818_port_w(machine, 0,via_system_porta); | |
| 885 | 885 | //logerror("write 146818 address %d \n",via_system_porta); |
| 886 | 886 | } |
| 887 | 887 | } |
| r1877 | r1878 | |
| 897 | 897 | if (b0_sound==0) |
| 898 | 898 | { |
| 899 | 899 | //logerror("Doing an unsafe write to the sound chip %d \n",data); |
| 900 | SN76496_0_w(0,via_system_porta); | |
| 900 | SN76496_0_w(machine, 0,via_system_porta); | |
| 901 | 901 | } |
| 902 | 902 | if (b3_keyboard==0) |
| 903 | 903 | { |
| 904 | 904 | //logerror("Doing an unsafe write to the keyboard %d \n",data); |
| 905 | via_system_porta=bbc_keyboard(via_system_porta); | |
| 905 | via_system_porta=bbc_keyboard(machine, via_system_porta); | |
| 906 | 906 | } |
| 907 | if (bbc_Master) MC146818_set(); | |
| 907 | if (bbc_Master) MC146818_set(machine); | |
| 908 | 908 | } |
| 909 | 909 | |
| 910 | 910 | |
| r1877 | r1878 | |
| 931 | 931 | { |
| 932 | 932 | /* BBC MASTER has NV RAM Here */ |
| 933 | 933 | MC146818_WR=1; |
| 934 | MC146818_set(); | |
| 934 | MC146818_set(machine); | |
| 935 | 935 | } |
| 936 | 936 | } else { |
| 937 | 937 | if (b1_speech_read==0) { |
| r1877 | r1878 | |
| 947 | 947 | { |
| 948 | 948 | /* BBC MASTER has NV RAM Here */ |
| 949 | 949 | MC146818_DS=1; |
| 950 | MC146818_set(); | |
| 950 | MC146818_set(machine); | |
| 951 | 951 | } |
| 952 | 952 | } else { |
| 953 | 953 | if (b2_speech_write==0) { |
| r1877 | r1878 | |
| 992 | 992 | case 0: |
| 993 | 993 | if (b0_sound==1) { |
| 994 | 994 | b0_sound=0; |
| 995 | SN76496_0_w(0,via_system_porta); | |
| 995 | SN76496_0_w(machine, 0,via_system_porta); | |
| 996 | 996 | } |
| 997 | 997 | break; |
| 998 | 998 | case 1: |
| r1877 | r1878 | |
| 1002 | 1002 | { |
| 1003 | 1003 | /* BBC MASTER has NV RAM Here */ |
| 1004 | 1004 | MC146818_WR=0; |
| 1005 | MC146818_set(); | |
| 1005 | MC146818_set(machine); | |
| 1006 | 1006 | } |
| 1007 | 1007 | } else { |
| 1008 | 1008 | if (b1_speech_read==1) { |
| r1877 | r1878 | |
| 1018 | 1018 | { |
| 1019 | 1019 | /* BBC MASTER has NV RAM Here */ |
| 1020 | 1020 | MC146818_DS=0; |
| 1021 | MC146818_set(); | |
| 1021 | MC146818_set(machine); | |
| 1022 | 1022 | } |
| 1023 | 1023 | } else { |
| 1024 | 1024 | if (b2_speech_write==1) { |
| r1877 | r1878 | |
| 1031 | 1031 | if (b3_keyboard==1) { |
| 1032 | 1032 | b3_keyboard=0; |
| 1033 | 1033 | /* *** call keyboard enabled *** */ |
| 1034 | via_system_porta=bbc_keyboard(via_system_porta); | |
| 1034 | via_system_porta=bbc_keyboard(machine, via_system_porta); | |
| 1035 | 1035 | } |
| 1036 | 1036 | break; |
| 1037 | 1037 | case 4: |
| r1877 | r1878 | |
| 1069 | 1069 | if (MC146818_AS != ((data>>7)&1)) |
| 1070 | 1070 | { |
| 1071 | 1071 | MC146818_AS=(data>>7)&1; |
| 1072 | MC146818_set(); | |
| 1072 | MC146818_set(machine); | |
| 1073 | 1073 | } |
| 1074 | 1074 | |
| 1075 | 1075 | //if CE changes |
| 1076 | 1076 | if (MC146818_CE != ((data>>6)&1)) |
| 1077 | 1077 | { |
| 1078 | 1078 | MC146818_CE=(data>>6)&1; |
| 1079 | MC146818_set(); | |
| 1079 | MC146818_set(machine); | |
| 1080 | 1080 | } |
| 1081 | 1081 | } |
| 1082 | 1082 | } |
| r1877 | r1878 | |
| 1129 | 1129 | /* joystick EOC */ |
| 1130 | 1130 | static READ8_HANDLER( bbcb_via_system_read_cb1 ) |
| 1131 | 1131 | { |
| 1132 | return uPD7002_EOC_r(0); | |
| 1132 | return uPD7002_EOC_r(machine, 0); | |
| 1133 | 1133 | } |
| 1134 | 1134 | |
| 1135 | 1135 | |
| r1877 | r1878 | |
| 1250 | 1250 | /* this is a very bad way of returning an acknowledge |
| 1251 | 1251 | by just linking the strobe output into the acknowledge input */ |
| 1252 | 1252 | bbc_printer_ca1=data; |
| 1253 | via_1_ca1_w(0,data); | |
| 1253 | via_1_ca1_w(machine, 0,data); | |
| 1254 | 1254 | } |
| 1255 | 1255 | |
| 1256 | 1256 | static void bbc_via_user_irq(int level) |
| r1877 | r1878 | |
| 1305 | 1305 | |
| 1306 | 1306 | static void BBC_uPD7002_EOC(int data) |
| 1307 | 1307 | { |
| 1308 | via_0_cb1_w(0,data); | |
| 1308 | via_0_cb1_w(Machine, 0,data); | |
| 1309 | 1309 | } |
| 1310 | 1310 | |
| 1311 | 1311 | static const struct uPD7002_interface BBC_uPD7002 = |
| r1877 | r1878 | |
| 1541 | 1541 | case 2: |
| 1542 | 1542 | case 3: |
| 1543 | 1543 | /* 8271 registers */ |
| 1544 | ret=i8271_r(offset); | |
| 1544 | ret=i8271_r(machine, offset); | |
| 1545 | 1545 | logerror(" %d\n",ret); |
| 1546 | 1546 | return ret; |
| 1547 | 1547 | case 4: |
| 1548 | ret=i8271_data_r(offset); | |
| 1548 | ret=i8271_data_r(machine, offset); | |
| 1549 | 1549 | logerror(" %d\n",ret); |
| 1550 | 1550 | return ret; |
| 1551 | 1551 | default: |
| r1877 | r1878 | |
| 1566 | 1566 | case 2: |
| 1567 | 1567 | case 3: |
| 1568 | 1568 | /* 8271 registers */ |
| 1569 | i8271_w(offset, data); | |
| 1569 | i8271_w(machine, offset, data); | |
| 1570 | 1570 | return; |
| 1571 | 1571 | case 4: |
| 1572 | i8271_data_w(offset, data); | |
| 1572 | i8271_data_w(machine, offset, data); | |
| 1573 | 1573 | return; |
| 1574 | 1574 | default: |
| 1575 | 1575 | break; |
| r1877 | r1878 | |
| 1722 | 1722 | switch (offset) |
| 1723 | 1723 | { |
| 1724 | 1724 | case 4: |
| 1725 | retval=wd17xx_status_r(0); | |
| 1725 | retval=wd17xx_status_r(machine, 0); | |
| 1726 | 1726 | break; |
| 1727 | 1727 | case 5: |
| 1728 | retval=wd17xx_track_r(0); | |
| 1728 | retval=wd17xx_track_r(machine, 0); | |
| 1729 | 1729 | break; |
| 1730 | 1730 | case 6: |
| 1731 | retval=wd17xx_sector_r(0); | |
| 1731 | retval=wd17xx_sector_r(machine, 0); | |
| 1732 | 1732 | break; |
| 1733 | 1733 | case 7: |
| 1734 | retval=wd17xx_data_r(0); | |
| 1734 | retval=wd17xx_data_r(machine, 0); | |
| 1735 | 1735 | break; |
| 1736 | 1736 | default: |
| 1737 | 1737 | break; |
| r1877 | r1878 | |
| 1747 | 1747 | switch (offset) |
| 1748 | 1748 | { |
| 1749 | 1749 | case 0: |
| 1750 | bbc_wd177x_status_w(0, data); | |
| 1750 | bbc_wd177x_status_w(machine, 0, data); | |
| 1751 | 1751 | break; |
| 1752 | 1752 | case 4: |
| 1753 | wd17xx_command_w(0, data); | |
| 1753 | wd17xx_command_w(machine, 0, data); | |
| 1754 | 1754 | break; |
| 1755 | 1755 | case 5: |
| 1756 | wd17xx_track_w(0, data); | |
| 1756 | wd17xx_track_w(machine, 0, data); | |
| 1757 | 1757 | break; |
| 1758 | 1758 | case 6: |
| 1759 | wd17xx_sector_w(0, data); | |
| 1759 | wd17xx_sector_w(machine, 0, data); | |
| 1760 | 1760 | break; |
| 1761 | 1761 | case 7: |
| 1762 | wd17xx_data_w(0, data); | |
| 1762 | wd17xx_data_w(machine, 0, data); | |
| 1763 | 1763 | break; |
| 1764 | 1764 | default: |
| 1765 | 1765 | break; |
| r1877 | r1878 | |
| 1842 | 1842 | switch (offset) |
| 1843 | 1843 | { |
| 1844 | 1844 | case 0xf8: |
| 1845 | return wd17xx_status_r(0); | |
| 1845 | return wd17xx_status_r(machine, 0); | |
| 1846 | 1846 | break; |
| 1847 | 1847 | case 0xf9: |
| 1848 | return wd17xx_track_r(0); | |
| 1848 | return wd17xx_track_r(machine, 0); | |
| 1849 | 1849 | break; |
| 1850 | 1850 | case 0xfa: |
| 1851 | return wd17xx_sector_r(0); | |
| 1851 | return wd17xx_sector_r(machine, 0); | |
| 1852 | 1852 | break; |
| 1853 | 1853 | case 0xfb: |
| 1854 | return wd17xx_data_r(0); | |
| 1854 | return wd17xx_data_r(machine, 0); | |
| 1855 | 1855 | break; |
| 1856 | 1856 | } |
| 1857 | 1857 | |
| r1877 | r1878 | |
| 1873 | 1873 | switch (offset) |
| 1874 | 1874 | { |
| 1875 | 1875 | case 0xf8: |
| 1876 | wd17xx_command_w(0, data); | |
| 1876 | wd17xx_command_w(machine, 0, data); | |
| 1877 | 1877 | break; |
| 1878 | 1878 | case 0xf9: |
| 1879 | wd17xx_track_w(0, data); | |
| 1879 | wd17xx_track_w(machine, 0, data); | |
| 1880 | 1880 | break; |
| 1881 | 1881 | case 0xfa: |
| 1882 | wd17xx_sector_w(0, data); | |
| 1882 | wd17xx_sector_w(machine, 0, data); | |
| 1883 | 1883 | break; |
| 1884 | 1884 | case 0xfb: |
| 1885 | wd17xx_data_w(0, data); | |
| 1885 | wd17xx_data_w(machine, 0, data); | |
| 1886 | 1886 | break; |
| 1887 | 1887 | case 0xfc: |
| 1888 | bbc_opus_status_w(0,data); | |
| 1888 | bbc_opus_status_w(machine, 0,data); | |
| 1889 | 1889 | break; |
| 1890 | 1890 | case 0xfe: |
| 1891 | 1891 | opusbank=(opusbank & 0xff) | (data<<8); |
| r1877 | r1878 | |
| 1912 | 1912 | switch (offset) |
| 1913 | 1913 | { |
| 1914 | 1914 | case 0: |
| 1915 | retval=wd17xx_status_r(0); | |
| 1915 | retval=wd17xx_status_r(machine, 0); | |
| 1916 | 1916 | break; |
| 1917 | 1917 | case 1: |
| 1918 | retval=wd17xx_track_r(0); | |
| 1918 | retval=wd17xx_track_r(machine, 0); | |
| 1919 | 1919 | break; |
| 1920 | 1920 | case 2: |
| 1921 | retval=wd17xx_sector_r(0); | |
| 1921 | retval=wd17xx_sector_r(machine, 0); | |
| 1922 | 1922 | break; |
| 1923 | 1923 | case 3: |
| 1924 | retval=wd17xx_data_r(0); | |
| 1924 | retval=wd17xx_data_r(machine, 0); | |
| 1925 | 1925 | break; |
| 1926 | 1926 | default: |
| 1927 | 1927 | break; |
| r1877 | r1878 | |
| 1936 | 1936 | switch (offset) |
| 1937 | 1937 | { |
| 1938 | 1938 | case 0: |
| 1939 | wd17xx_command_w(0, data); | |
| 1939 | wd17xx_command_w(machine, 0, data); | |
| 1940 | 1940 | break; |
| 1941 | 1941 | case 1: |
| 1942 | wd17xx_track_w(0, data); | |
| 1942 | wd17xx_track_w(machine, 0, data); | |
| 1943 | 1943 | break; |
| 1944 | 1944 | case 2: |
| 1945 | wd17xx_sector_w(0, data); | |
| 1945 | wd17xx_sector_w(machine, 0, data); | |
| 1946 | 1946 | break; |
| 1947 | 1947 | case 3: |
| 1948 | wd17xx_data_w(0, data); | |
| 1948 | wd17xx_data_w(machine, 0, data); | |
| 1949 | 1949 | break; |
| 1950 | 1950 | default: |
| 1951 | 1951 | break; |
| r1877 | r1878 | |
| 1996 | 1996 | switch (bbc_DFSType){ |
| 1997 | 1997 | /* case 0 to 3 are all standard 8271 interfaces */ |
| 1998 | 1998 | case 0: case 1: case 2: case 3: |
| 1999 | return bbc_i8271_read(offset); | |
| 1999 | return bbc_i8271_read(machine, offset); | |
| 2000 | 2000 | break; |
| 2001 | 2001 | /* case 4 is the acown 1770 interface */ |
| 2002 | 2002 | case 4: |
| 2003 | return bbc_wd1770_read(offset); | |
| 2003 | return bbc_wd1770_read(machine, offset); | |
| 2004 | 2004 | break; |
| 2005 | 2005 | /* case 5 is the watford 1770 interface */ |
| 2006 | 2006 | case 5: |
| 2007 | return bbc_wd1770_read(offset); | |
| 2007 | return bbc_wd1770_read(machine, offset); | |
| 2008 | 2008 | break; |
| 2009 | 2009 | /* case 6 is the Opus challenger interface */ |
| 2010 | 2010 | case 6: |
| r1877 | r1878 | |
| 2022 | 2022 | switch (bbc_DFSType){ |
| 2023 | 2023 | /* case 0 to 3 are all standard 8271 interfaces */ |
| 2024 | 2024 | case 0: case 1: case 2: case 3: |
| 2025 | bbc_i8271_write(offset,data); | |
| 2025 | bbc_i8271_write(machine, offset,data); | |
| 2026 | 2026 | break; |
| 2027 | 2027 | /* case 4 is the acown 1770 interface */ |
| 2028 | 2028 | case 4: |
| 2029 | bbc_wd1770_write(offset,data); | |
| 2029 | bbc_wd1770_write(machine, offset,data); | |
| 2030 | 2030 | break; |
| 2031 | 2031 | /* case 5 is the watford 1770 interface */ |
| 2032 | 2032 | case 5: |
| 2033 | bbc_wd1770_write(offset,data); | |
| 2033 | bbc_wd1770_write(machine, offset,data); | |
| 2034 | 2034 | break; |
| 2035 | 2035 | /* case 6 is the Opus challenger interface */ |
| 2036 | 2036 | case 6: |
| r1877 | r1878 | |
|---|---|---|
| 204 | 204 | |
| 205 | 205 | READ16_HANDLER ( compis_osp_pic_r ) |
| 206 | 206 | { |
| 207 | return pic8259_0_r | |
| 207 | return pic8259_0_r | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | WRITE16_HANDLER ( compis_osp_pic_w ) |
| 211 | 211 | { |
| 212 | pic8259_0_w | |
| 212 | pic8259_0_w | |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /*-------------------------------------------------------------------------*/ |
| r1877 | r1878 | |
| 328 | 328 | /* DMA acknowledge if iSBX-218A has DMA enabled */ |
| 329 | 329 | if (readinputport(7)) |
| 330 | 330 | { |
| 331 | data = nec765_dack_r(0); | |
| 331 | data = nec765_dack_r(machine, 0); | |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | return data; |
| r1877 | r1878 | |
| 339 | 339 | switch(offset) |
| 340 | 340 | { |
| 341 | 341 | case 2: |
| 342 | nec765_data_w(0, data); | |
| 342 | nec765_data_w(machine, 0, data); | |
| 343 | 343 | break; |
| 344 | 344 | default: |
| 345 | 345 | logerror("FDC Unknown Port Write %04X = %04X\n", offset, data); |
| r1877 | r1878 | |
| 354 | 354 | switch(offset) |
| 355 | 355 | { |
| 356 | 356 | case 0: |
| 357 | data = nec765_status_r(0); | |
| 357 | data = nec765_status_r(machine, 0); | |
| 358 | 358 | break; |
| 359 | 359 | case 1: |
| 360 | data = nec765_data_r(0); | |
| 360 | data = nec765_data_r(machine, 0); | |
| 361 | 361 | break; |
| 362 | 362 | default: |
| 363 | 363 | logerror("FDC Unknown Port Read %04X\n", offset); |
| r1877 | r1878 | |
| 448 | 448 | |
| 449 | 449 | READ16_HANDLER ( compis_ppi_r ) |
| 450 | 450 | { |
| 451 | return ppi8255_0_r | |
| 451 | return ppi8255_0_r | |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | WRITE16_HANDLER ( compis_ppi_w ) |
| 455 | 455 | { |
| 456 | ppi8255_0_w | |
| 456 | ppi8255_0_w | |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | /*-------------------------------------------------------------------------*/ |
| r1877 | r1878 | |
| 488 | 488 | |
| 489 | 489 | READ16_HANDLER ( compis_pit_r ) |
| 490 | 490 | { |
| 491 | return pit8253_0_r | |
| 491 | return pit8253_0_r | |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | WRITE16_HANDLER ( compis_pit_w ) |
| 495 | 495 | { |
| 496 | pit8253_0_w | |
| 496 | pit8253_0_w | |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | /*-------------------------------------------------------------------------*/ |
| r1877 | r1878 | |
| 502 | 502 | |
| 503 | 503 | READ16_HANDLER ( compis_osp_pit_r ) |
| 504 | 504 | { |
| 505 | return pit8253_1_r | |
| 505 | return pit8253_1_r | |
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | WRITE16_HANDLER ( compis_osp_pit_w ) |
| 509 | 509 | { |
| 510 | pit8253_1_w | |
| 510 | pit8253_1_w | |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | /*-------------------------------------------------------------------------*/ |
| r1877 | r1878 | |
| 544 | 544 | |
| 545 | 545 | READ16_HANDLER ( compis_usart_r ) |
| 546 | 546 | { |
| 547 | return msm8251_data_r | |
| 547 | return msm8251_data_r | |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | WRITE16_HANDLER ( compis_usart_w ) |
| r1877 | r1878 | |
| 552 | 552 | switch (offset) |
| 553 | 553 | { |
| 554 | 554 | case 0x00: |
| 555 | msm8251_data_w | |
| 555 | msm8251_data_w | |
| 556 | 556 | break; |
| 557 | 557 | case 0x01: |
| 558 | msm8251_control_w | |
| 558 | msm8251_control_w | |
| 559 | 559 | break; |
| 560 | 560 | default: |
| 561 | 561 | logerror("USART Unknown Port Write %04X = %04X\n", offset, data); |
| r1877 | r1878 | |
|---|---|---|
| 62 | 62 | static READ8_HANDLER ( mra_bank4) { return mra_bank(3,offset); } |
| 63 | 63 | |
| 64 | 64 | /* read banked memory (handle memory mapped i/o) */ |
| 65 | static const read8_ | |
| 65 | static const read8_machin | |
| 66 | 66 | { |
| 67 | 67 | mra_bank1, /* mapped in 0000-3fff */ |
| 68 | 68 | mra_bank2, /* mapped in 4000-7fff */ |
| r1877 | r1878 | |
| 71 | 71 | }; |
| 72 | 72 | |
| 73 | 73 | /* write banked memory (handle memory mapped i/o and videoram) */ |
| 74 | static const write8_ | |
| 74 | static const write8_machin | |
| 75 | 75 | { |
| 76 | 76 | mwa_bank1, /* mapped in 0000-3fff */ |
| 77 | 77 | mwa_bank2, /* mapped in 4000-7fff */ |
| r1877 | r1878 | |
| 80 | 80 | }; |
| 81 | 81 | |
| 82 | 82 | /* read banked memory (plain ROM/RAM) */ |
| 83 | static const read8_ | |
| 83 | static const read8_machin | |
| 84 | 84 | { |
| 85 | 85 | MRA8_BANK1, /* mapped in 0000-3fff */ |
| 86 | 86 | MRA8_BANK2, /* mapped in 4000-7fff */ |
| r1877 | r1878 | |
| 89 | 89 | }; |
| 90 | 90 | |
| 91 | 91 | /* write banked memory (plain ROM/RAM) */ |
| 92 | static const write8_ | |
| 92 | static const write8_machin | |
| 93 | 93 | { |
| 94 | 94 | MWA8_BANK1, /* mapped in 0000-3fff */ |
| 95 | 95 | MWA8_BANK2, /* mapped in 4000-7fff */ |
| r1877 | r1878 | |
| 114 | 114 | |
| 115 | 115 | |
| 116 | 116 | |
| 117 | static void laser_machine_init(int bank_mask, int video_mask) | |
| 117 | static void laser_machine_init(running_machine *machine, int bank_mask, int video_mask) | |
| 118 | 118 | { |
| 119 | 119 | int i; |
| 120 | 120 | |
| r1877 | r1878 | |
| 124 | 124 | logerror("laser_machine_init(): bank mask $%04X, video %d [$%05X]\n", laser_bank_mask, laser_video_bank, laser_video_bank * 0x04000); |
| 125 | 125 | |
| 126 | 126 | for (i = 0; i < sizeof(laser_bank) / sizeof(laser_bank[0]); i++) |
| 127 | laser_bank_select_w(i, 0); | |
| 127 | laser_bank_select_w(machine, i, 0); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | MACHINE_RESET( laser350 ) |
| 131 | 131 | { |
| 132 | 132 | /* banks 0 to 3 only, optional ROM extension */ |
| 133 | laser_machine_init(0xf00f, 3); | |
| 133 | laser_machine_init(machine, 0xf00f, 3); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | MACHINE_RESET( laser500 ) |
| 137 | 137 | { |
| 138 | 138 | /* banks 0 to 2, and 4-7 only , optional ROM extension */ |
| 139 | laser_machine_init(0xf0f7, 7); | |
| 139 | laser_machine_init(machine, 0xf0f7, 7); | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | MACHINE_RESET( laser700 ) |
| 143 | 143 | { |
| 144 | 144 | /* all banks except #3 */ |
| 145 | laser_machine_init(0xfff7, 7); | |
| 145 | laser_machine_init(machine, 0xfff7, 7); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | |
| r1877 | r1878 | |
| 153 | 153 | "RAM #0","RAM #1","RAM #2","RAM #3", |
| 154 | 154 | "RAM #4","RAM #5","RAM #6","RAM #7/Video RAM hi", |
| 155 | 155 | "ext ROM #0","ext ROM #1","ext ROM #2","ext ROM #3"}; |
| 156 | read8_handler read_handler; | |
| 157 | write8_handler write_handler; | |
| 156 | read8_machine_func read_handler; | |
| 157 | write8_machine_func write_handler; | |
| 158 | 158 | |
| 159 | 159 | offset %= 4; |
| 160 | 160 | data &= 15; |
| r1877 | r1878 | |
|---|---|---|
| 155 | 155 | } |
| 156 | 156 | #endif |
| 157 | 157 | |
| 158 | ||
| 158 | ||
| 159 | 159 | { |
| 160 | return z80ctc_1_r(offset); | |
| 160 | return z80ctc_1_r(machine, offset); | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | WRITE8_HANDLER(kc85_disk_hw_ctc_w) |
| 164 | 164 | { |
| 165 | z80ctc_1_w(offset,data); | |
| 165 | z80ctc_1_w(machine, offset, data); | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | WRITE8_HANDLER(kc85_disc_interface_ram_w) |
| r1877 | r1878 | |
| 179 | 179 | program_write_byte(addr|0x0f000,data); |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | ||
| 182 | ||
| 183 | 183 | { |
| 184 | 184 | int addr; |
| 185 | 185 | |
| r1877 | r1878 | |
| 1242 | 1242 | /* update status of memory area 0x4000-0x07fff */ |
| 1243 | 1243 | static void kc85_4_update_0x04000(void) |
| 1244 | 1244 | { |
| 1245 | read8_handler rh; | |
| 1246 | write8_handler wh; | |
| 1245 | read8_machine_func rh; | |
| 1246 | write8_machine_func wh; | |
| 1247 | 1247 | |
| 1248 | 1248 | /* access ram? */ |
| 1249 | 1249 | if (kc85_86_data & (1<<0)) |
| r1877 | r1878 | |
| 1292 | 1292 | /* update memory address 0x0c000-0x0e000 */ |
| 1293 | 1293 | static void kc85_4_update_0x0c000(void) |
| 1294 | 1294 | { |
| 1295 | read8_ | |
| 1295 | read8_machin | |
| 1296 | 1296 | |
| 1297 | 1297 | if (kc85_86_data & (1<<7)) |
| 1298 | 1298 | { |
| r1877 | r1878 | |
| 1333 | 1333 | /* update memory address 0x0e000-0x0ffff */ |
| 1334 | 1334 | static void kc85_4_update_0x0e000(void) |
| 1335 | 1335 | { |
| 1336 | read8_ | |
| 1336 | read8_machin | |
| 1337 | 1337 | |
| 1338 | 1338 | if (kc85_pio_data[0] & (1<<0)) |
| 1339 | 1339 | { |
| r1877 | r1878 | |
| 1447 | 1447 | /* update memory region 0x0c000-0x0e000 */ |
| 1448 | 1448 | static void kc85_3_update_0x0c000(void) |
| 1449 | 1449 | { |
| 1450 | read8_ | |
| 1450 | read8_machin | |
| 1451 | 1451 | |
| 1452 | 1452 | if (kc85_pio_data[0] & (1<<7)) |
| 1453 | 1453 | { |
| r1877 | r1878 | |
| 1469 | 1469 | /* update memory address 0x0e000-0x0ffff */ |
| 1470 | 1470 | static void kc85_3_update_0x0e000(void) |
| 1471 | 1471 | { |
| 1472 | read8_ | |
| 1472 | read8_machin | |
| 1473 | 1473 | |
| 1474 | 1474 | if (kc85_pio_data[0] & (1<<0)) |
| 1475 | 1475 | { |
| r1877 | r1878 | |
| 1493 | 1493 | for write operations */ |
| 1494 | 1494 | static void kc85_3_update_0x00000(void) |
| 1495 | 1495 | { |
| 1496 | read8_handler rh; | |
| 1497 | write8_handler wh; | |
| 1496 | read8_machine_func rh; | |
| 1497 | write8_machine_func wh; | |
| 1498 | 1498 | |
| 1499 | 1499 | /* access ram? */ |
| 1500 | 1500 | if (kc85_pio_data[0] & (1<<1)) |
| r1877 | r1878 | |
| 1542 | 1542 | /* MRA8_BANK3 is used for read, MWA8_BANK8 is used for write */ |
| 1543 | 1543 | static void kc85_3_update_0x08000(void) |
| 1544 | 1544 | { |
| 1545 | read8_handler rh; | |
| 1546 | write8_handler wh; | |
| 1545 | read8_machine_func rh; | |
| 1546 | write8_machine_func wh; | |
| 1547 | 1547 | unsigned char *ram_page; |
| 1548 | 1548 | |
| 1549 | 1549 | if (kc85_pio_data[0] & (1<<2)) |
| r1877 | r1878 | |
| 1713 | 1713 | { |
| 1714 | 1714 | unsigned char data; |
| 1715 | 1715 | |
| 1716 | data = z80ctc_0_r(offset); | |
| 1716 | data = z80ctc_0_r(machine, offset); | |
| 1717 | 1717 | //LOG_KBD(("ctc data r:%02x\n",data)); |
| 1718 | 1718 | return data; |
| 1719 | 1719 | } |
| r1877 | r1878 | |
| 1722 | 1722 | { |
| 1723 | 1723 | //logerror("ctc data w:%02x\n",data); |
| 1724 | 1724 | |
| 1725 | z80ctc_0_w(offset,data); | |
| 1725 | z80ctc_0_w(machine, offset,data); | |
| 1726 | 1726 | } |
| 1727 | 1727 | |
| 1728 | 1728 | |
| r1877 | r1878 | |
| 1787 | 1787 | kc85_15khz_state^=1; |
| 1788 | 1788 | |
| 1789 | 1789 | /* set clock input for channel 2 and 3 to ctc */ |
| 1790 | z80ctc_0_trg0_w(0,kc85_15khz_state); | |
| 1791 | z80ctc_0_trg1_w(0,kc85_15khz_state); | |
| 1790 | z80ctc_0_trg0_w(machine, 0,kc85_15khz_state); | |
| 1791 | z80ctc_0_trg1_w(machine, 0,kc85_15khz_state); | |
| 1792 | 1792 | |
| 1793 | 1793 | kc85_15khz_count++; |
| 1794 | 1794 | |
| r1877 | r1878 | |
| 1800 | 1800 | kc85_50hz_state^=1; |
| 1801 | 1801 | |
| 1802 | 1802 | /* set clock input for channel 2 and 3 to ctc */ |
| 1803 | z80ctc_0_trg2_w(0,kc85_50hz_state); | |
| 1804 | z80ctc_0_trg3_w(0,kc85_50hz_state); | |
| 1803 | z80ctc_0_trg2_w(machine, 0, kc85_50hz_state); | |
| 1804 | z80ctc_0_trg3_w(machine, 0, kc85_50hz_state); | |
| 1805 | 1805 | } |
| 1806 | 1806 | } |
| 1807 | 1807 |
| r1877 | r1878 | |
|---|---|---|
| 130 | 130 | #CPUS += ASAP |
| 131 | 131 | CPUS += UPD7810 |
| 132 | 132 | #CPUS += UPD7807 |
| 133 | CPUS += UPD7801 | |
| 134 | 133 | CPUS += ARM |
| 135 | 134 | CPUS += ARM7 |
| 136 | 135 | CPUS += JAGUAR |
| r1877 | r1878 | |
| 211 | 210 | CPUS += TMS7000_EXL |
| 212 | 211 | CPUS += SM8500 |
| 213 | 212 | CPUS += V30MZ |
| 213 | CPUS += UPD7801 | |
| 214 | 214 | CPUS += M68008 |
| 215 | 215 | #CPUS += TMS99000 |
| 216 | 216 | CPUS += TMS99010 |
| r1877 | r1878 | |
|---|---|---|
| 31 | 31 | ***************************************************************************/ |
| 32 | 32 | |
| 33 | 33 | #include "driver.h" |
| 34 | #include "deprecat.h" | |
| 34 | 35 | #include "includes/wswan.h" |
| 35 | 36 | #include "devices/cartslot.h" |
| 36 | 37 | #include "sound/custom.h" |
| r1877 | r1878 | |
| 129 | 130 | MDRV_CPU_ADD_TAG("main", V30MZ, 3072000) |
| 130 | 131 | MDRV_CPU_PROGRAM_MAP(wswan_mem, 0) |
| 131 | 132 | MDRV_CPU_IO_MAP(wswan_io, 0) |
| 132 | MDRV_CPU_VBLANK_INT(wswan_scanline_interrupt, 159) /* 1 int each scanline */ | |
| 133 | MDRV_CPU_VBLANK_INT_HACK(wswan_scanline_interrupt, 159) /* 1 int each scanline */ | |
| 133 | 134 | |
| 134 | 135 | MDRV_SCREEN_ADD("main", LCD) |
| 135 | 136 | MDRV_SCREEN_REFRESH_RATE(75) |
| r1877 | r1878 | |
|---|---|---|
| 397 | 397 | MDRV_CPU_ADD(PDP1, 1000000/*the CPU core uses microsecond counts*/) |
| 398 | 398 | MDRV_CPU_CONFIG(pdp1_reset_param) |
| 399 | 399 | MDRV_CPU_PROGRAM_MAP(pdp1_map, 0) |
| 400 | MDRV_CPU_VBLANK_INT(pdp1_interrupt | |
| 400 | MDRV_CPU_VBLANK_INT("main", pdp1_interrupt | |
| 401 | 401 | |
| 402 | 402 | MDRV_MACHINE_START( pdp1 ) |
| 403 | 403 | MDRV_MACHINE_RESET( pdp1 ) |
| r1877 | r1878 | |
|---|---|---|
| 314 | 314 | /* basic machine hardware */ |
| 315 | 315 | MDRV_CPU_ADD_TAG("main", M4510, 3500000) /* or VIC6567_CLOCK, */ |
| 316 | 316 | MDRV_CPU_PROGRAM_MAP(c65_mem, 0) |
| 317 | MDRV_CPU_VBLANK_INT(c64_frame_interrupt | |
| 317 | MDRV_CPU_VBLANK_INT("main", c64_frame_interrupt | |
| 318 | 318 | MDRV_CPU_PERIODIC_INT(vic3_raster_irq, VIC2_HRETRACERATE) |
| 319 | 319 | MDRV_INTERLEAVE(0) |
| 320 | 320 |
| r1877 | r1878 | |
|---|---|---|
| 7 | 7 | ******************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "deprecat.h" | |
| 10 | 11 | #include "cpu/m6502/m6502.h" |
| 11 | 12 | #include "includes/atari.h" |
| 12 | 13 | #include "devices/cartslot.h" |
| r1877 | r1878 | |
| 735 | 736 | |
| 736 | 737 | MDRV_CPU_MODIFY( "main" ) |
| 737 | 738 | MDRV_CPU_PROGRAM_MAP(a400_mem, 0) |
| 738 | MDRV_CPU_VBLANK_INT(a400_interrupt, TOTAL_LINES_60HZ) | |
| 739 | MDRV_CPU_VBLANK_INT_HACK(a400_interrupt, TOTAL_LINES_60HZ) | |
| 739 | 740 | |
| 740 | 741 | MDRV_MACHINE_START( a400 ) |
| 741 | 742 | |
| r1877 | r1878 | |
| 750 | 751 | |
| 751 | 752 | MDRV_CPU_MODIFY( "main" ) |
| 752 | 753 | MDRV_CPU_PROGRAM_MAP(a400_mem, 0) |
| 753 | MDRV_CPU_VBLANK_INT(a400_interrupt, TOTAL_LINES_50HZ) | |
| 754 | MDRV_CPU_VBLANK_INT_HACK(a400_interrupt, TOTAL_LINES_50HZ) | |
| 754 | 755 | |
| 755 | 756 | MDRV_MACHINE_START( a400 ) |
| 756 | 757 | |
| r1877 | r1878 | |
| 765 | 766 | |
| 766 | 767 | MDRV_CPU_MODIFY( "main" ) |
| 767 | 768 | MDRV_CPU_PROGRAM_MAP(a800_mem, 0) |
| 768 | MDRV_CPU_VBLANK_INT(a800_interrupt, TOTAL_LINES_60HZ) | |
| 769 | MDRV_CPU_VBLANK_INT_HACK(a800_interrupt, TOTAL_LINES_60HZ) | |
| 769 | 770 | |
| 770 | 771 | MDRV_MACHINE_START( a800 ) |
| 771 | 772 | |
| r1877 | r1878 | |
| 780 | 781 | |
| 781 | 782 | MDRV_CPU_MODIFY( "main" ) |
| 782 | 783 | MDRV_CPU_PROGRAM_MAP(a800_mem, 0) |
| 783 | MDRV_CPU_VBLANK_INT(a800_interrupt, TOTAL_LINES_50HZ) | |
| 784 | MDRV_CPU_VBLANK_INT_HACK(a800_interrupt, TOTAL_LINES_50HZ) | |
| 784 | 785 | |
| 785 | 786 | MDRV_MACHINE_START( a800 ) |
| 786 | 787 | |
| r1877 | r1878 | |
| 795 | 796 | |
| 796 | 797 | MDRV_CPU_MODIFY( "main" ) |
| 797 | 798 | MDRV_CPU_PROGRAM_MAP(a800xl_mem, 0) |
| 798 | MDRV_CPU_VBLANK_INT(a800xl_interrupt, TOTAL_LINES_60HZ) | |
| 799 | MDRV_CPU_VBLANK_INT_HACK(a800xl_interrupt, TOTAL_LINES_60HZ) | |
| 799 | 800 | |
| 800 | 801 | MDRV_MACHINE_START( a800xl ) |
| 801 | 802 | |
| r1877 | r1878 | |
| 810 | 811 | |
| 811 | 812 | MDRV_CPU_MODIFY( "main" ) |
| 812 | 813 | MDRV_CPU_PROGRAM_MAP(a5200_mem, 0) |
| 813 | MDRV_CPU_VBLANK_INT(a5200_interrupt, TOTAL_LINES_60HZ) | |
| 814 | MDRV_CPU_VBLANK_INT_HACK(a5200_interrupt, TOTAL_LINES_60HZ) | |
| 814 | 815 | |
| 815 | 816 | MDRV_MACHINE_START( a5200 ) |
| 816 | 817 |
| r1877 | r1878 | |
|---|---|---|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | |
| 334 | static const read8_ | |
| 334 | static const read8_machin | |
| 335 | 335 | MRA8_BANK1, MRA8_BANK2, MRA8_BANK3, MRA8_BANK4}; |
| 336 | 336 | |
| 337 | static const write8_ | |
| 337 | static const write8_machin | |
| 338 | 338 | MWA8_BANK5, MWA8_BANK6, MWA8_BANK7, MWA8_BANK8}; |
| 339 | 339 | |
| 340 | 340 | static void nc_refresh_memory_bank_config(int bank) |
| 341 | 341 | { |
| 342 | 342 | int mem_type; |
| 343 | 343 | int mem_bank; |
| 344 | read8_handler read_handler; | |
| 345 | write8_handler write_handler = NULL; | |
| 344 | read8_machine_func read_handler; | |
| 345 | write8_machine_func write_handler = NULL; | |
| 346 | 346 | |
| 347 | 347 | mem_type = (nc_memory_config[bank]>>6) & 0x03; |
| 348 | 348 | mem_bank = nc_memory_config[bank] & 0x03f; |
| r1877 | r1878 | |
| 848 | 848 | |
| 849 | 849 | static WRITE8_HANDLER(nc100_uart_control_w) |
| 850 | 850 | { |
| 851 | nc_uart_control_w(offset,data); | |
| 851 | nc_uart_control_w(machine, offset,data); | |
| 852 | 852 | |
| 853 | 853 | // /* is this correct?? */ |
| 854 | 854 | // if (data & (1<<3)) |
| r1877 | r1878 | |
| 1472 | 1472 | |
| 1473 | 1473 | reset_fdc = (nc_uart_control^data) & (1<<5); |
| 1474 | 1474 | |
| 1475 | nc_uart_control_w(offset,data); | |
| 1475 | nc_uart_control_w(machine, offset,data); | |
| 1476 | 1476 | |
| 1477 | 1477 | if (data & (1<<3)) |
| 1478 | 1478 | { |
| r1877 | r1878 | |
|---|---|---|
| 630 | 630 | //MDRV_CPU_ADD(M6800, 4000000) /* 4.0 Mhz */ |
| 631 | 631 | //MDRV_CPU_PROGRAM_MAP(master6801_mem, 0) |
| 632 | 632 | |
| 633 | MDRV_CPU_VBLANK_INT(adam_interrupt | |
| 633 | MDRV_CPU_VBLANK_INT("main", adam_interrupt | |
| 634 | 634 | |
| 635 | 635 | MDRV_MACHINE_START( adam ) |
| 636 | 636 | MDRV_MACHINE_RESET( adam ) |
| r1877 | r1878 | |
|---|---|---|
| 187 | 187 | /* {0xfc000, 0xfcfff, MRA8_ROM }, */ |
| 188 | 188 | AM_RANGE(0xfd000, 0xfd7ff) AM_READ( MRA8_ROM ) |
| 189 | 189 | // AM_RANGE(0xfd800, 0xfd8ff) |
| 190 | AM_RANGE(0xfd801, 0xfd801) AM_MIRROR( 0xfe ) AM_READ( c | |
| 190 | AM_RANGE(0xfd801, 0xfd801) AM_MIRROR( 0xfe ) AM_DEVREAD(MC6845, "crtc", m | |
| 191 | 191 | /* disk units */ |
| 192 | 192 | AM_RANGE(0xfda00, 0xfdaff) AM_READ( sid6581_0_port_r ) |
| 193 | 193 | /* db00 coprocessor */ |
| r1877 | r1878 | |
| 209 | 209 | AM_RANGE(0xf6000, 0xf7fff) AM_WRITE( MWA8_ROM ) |
| 210 | 210 | AM_RANGE(0xf8000, 0xfbfff) AM_WRITE( MWA8_ROM) AM_BASE( &cbmb_basic ) |
| 211 | 211 | AM_RANGE(0xfd000, 0xfd7ff) AM_WRITE( MWA8_RAM) AM_BASE( &videoram) AM_SIZE(&videoram_size ) /* VIDEORAM */ |
| 212 | AM_RANGE(0xfd800, 0xfd800) AM_MIRROR( 0xfe ) AM_WRITE( cbmb_mc6845_address_w ) | |
| 213 | AM_RANGE(0xfd801, 0xfd801) AM_MIRROR( 0xfe ) AM_WRITE( cbmb_mc6845_register_w ) | |
| 212 | AM_RANGE(0xfd800, 0xfd800) AM_MIRROR( 0xfe ) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 213 | AM_RANGE(0xfd801, 0xfd801) AM_MIRROR( 0xfe ) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 214 | 214 | /* disk units */ |
| 215 | 215 | AM_RANGE(0xfda00, 0xfdaff) AM_WRITE( sid6581_0_port_w) |
| 216 | 216 | /* db00 coprocessor */ |
| r1877 | r1878 | |
|---|---|---|
| 332 | 332 | { |
| 333 | 333 | unsigned char data; |
| 334 | 334 | |
| 335 | data = z80ctc_0_r(offset & 0x03); | |
| 335 | data = z80ctc_0_r(machine, offset & 0x03); | |
| 336 | 336 | |
| 337 | 337 | logerror("sord ctc r: %04x %02x\n",(offset & 0x03), data); |
| 338 | 338 | |
| r1877 | r1878 | |
| 343 | 343 | { |
| 344 | 344 | logerror("sord ctc w: %04x %02x\n",(offset & 0x03), data); |
| 345 | 345 | |
| 346 | z80ctc_0_w(offset & 0x03, data); | |
| 346 | z80ctc_0_w(machine, offset & 0x03, data); | |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | static READ8_HANDLER(sord_sys_r) |
| r1877 | r1878 | |
| 449 | 449 | { |
| 450 | 450 | if (state) |
| 451 | 451 | { |
| 452 | z80ctc_0_trg3_w(0,1); | |
| 453 | z80ctc_0_trg3_w(0,0); | |
| 452 | z80ctc_0_trg3_w(Machine, 0, 1); | |
| 453 | z80ctc_0_trg3_w(Machine, 0, 0); | |
| 454 | 454 | } |
| 455 | 455 | } |
| 456 | 456 | |
| r1877 | r1878 | |
| 625 | 625 | MDRV_CPU_ADD_TAG("main", Z80, 3800000) |
| 626 | 626 | MDRV_CPU_PROGRAM_MAP(sord_m5_mem, 0) |
| 627 | 627 | MDRV_CPU_IO_MAP(sord_m5_io, 0) |
| 628 | MDRV_CPU_VBLANK_INT(sord_interrupt | |
| 628 | MDRV_CPU_VBLANK_INT("main", sord_interrupt | |
| 629 | 629 | MDRV_CPU_CONFIG( sord_m5_daisy_chain ) |
| 630 | 630 | MDRV_INTERLEAVE(1) |
| 631 | 631 |
| r1877 | r1878 | |
|---|---|---|
| 256 | 256 | MDRV_CPU_PROGRAM_MAP(mbee_mem, 0) |
| 257 | 257 | MDRV_CPU_IO_MAP(mbee_ports, 0) |
| 258 | 258 | MDRV_CPU_CONFIG(mbee_daisy_chain) |
| 259 | MDRV_CPU_VBLANK_INT(mbee_interrupt | |
| 259 | MDRV_CPU_VBLANK_INT("main", mbee_interrupt | |
| 260 | 260 | MDRV_INTERLEAVE(1) |
| 261 | 261 | |
| 262 | 262 | MDRV_MACHINE_RESET( mbee ) |
| r1877 | r1878 | |
|---|---|---|
| 66 | 66 | MDRV_PALETTE_INIT( pokemini ) |
| 67 | 67 | MDRV_SCREEN_REFRESH_RATE( 30 ) |
| 68 | 68 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 69 | MDRV_CPU_VBLANK_INT( pokemini_int | |
| 69 | MDRV_CPU_VBLANK_INT("main", pokemini_int | |
| 70 | 70 | |
| 71 | 71 | /* sound hardware */ |
| 72 | 72 | #if 0 |
| r1877 | r1878 | |
|---|---|---|
| 283 | 283 | */ |
| 284 | 284 | static INPUT_PORTS_START( dragon32 ) |
| 285 | 285 | PORT_START /* KEY ROW 0 */ |
| 286 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') | |
| 287 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') | |
| 288 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"') | |
| 289 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') | |
| 290 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') | |
| 291 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') | |
| 292 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') | |
| 293 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') | |
| 286 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0) PORT_CHAR('0') | |
| 287 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') | |
| 288 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"') | |
| 289 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') | |
| 290 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') | |
| 291 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') | |
| 292 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') | |
| 293 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') | |
| 294 | 294 | |
| 295 | 295 | PORT_START /* KEY ROW 1 */ |
| 296 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') | |
| 297 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') | |
| 298 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*') | |
| 299 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(';') PORT_CHAR('+') | |
| 300 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') | |
| 301 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') | |
| 302 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') | |
| 303 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') | |
| 296 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') | |
| 297 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') | |
| 298 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*') | |
| 299 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(';') PORT_CHAR('+') | |
| 300 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') | |
| 301 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') | |
| 302 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') | |
| 303 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') | |
| 304 | 304 | |
| 305 | 305 | PORT_START /* KEY ROW 2 */ |
| 306 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('@') | |
| 307 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('A') | |
| 308 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('B') | |
| 309 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('C') | |
| 310 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('D') | |
| 311 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E') | |
| 312 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('F') | |
| 313 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('G') | |
| 306 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('@') | |
| 307 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_A) PORT_CHAR('A') | |
| 308 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_B) PORT_CHAR('B') | |
| 309 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_C) PORT_CHAR('C') | |
| 310 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_D) PORT_CHAR('D') | |
| 311 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_E) PORT_CHAR('E') | |
| 312 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_F) PORT_CHAR('F') | |
| 313 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_G) PORT_CHAR('G') | |
| 314 | 314 | |
| 315 | 315 | PORT_START /* KEY ROW 3 */ |
| 316 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('H') | |
| 317 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('I') | |
| 318 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('J') | |
| 319 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('K') | |
| 320 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('L') | |
| 321 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('M') | |
| 322 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('N') | |
| 323 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O') | |
| 316 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_H) PORT_CHAR('H') | |
| 317 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_I) PORT_CHAR('I') | |
| 318 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_J) PORT_CHAR('J') | |
| 319 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_K) PORT_CHAR('K') | |
| 320 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_L) PORT_CHAR('L') | |
| 321 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_M) PORT_CHAR('M') | |
| 322 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_N) PORT_CHAR('N') | |
| 323 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_O) PORT_CHAR('O') | |
| 324 | 324 | |
| 325 | 325 | PORT_START /* KEY ROW 4 */ |
| 326 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('P') | |
| 327 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') | |
| 328 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('R') | |
| 329 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('S') | |
| 330 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('T') | |
| 331 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('U') | |
| 332 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('V') | |
| 333 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('W') | |
| 326 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_P) PORT_CHAR('P') | |
| 327 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') | |
| 328 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_R) PORT_CHAR('R') | |
| 329 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_S) PORT_CHAR('S') | |
| 330 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_T) PORT_CHAR('T') | |
| 331 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_U) PORT_CHAR('U') | |
| 332 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_V) PORT_CHAR('V') | |
| 333 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_W) PORT_CHAR('W') | |
| 334 | 334 | |
| 335 | 335 | PORT_START /* KEY ROW 5 */ |
| 336 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('X') | |
| 337 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') | |
| 338 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') | |
| 339 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("UP") PORT_CODE(KEYCODE_UP) PORT_CHAR('^') | |
| 340 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("DOWN") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(10) | |
| 341 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LEFT") PORT_CODE(KEYCODE_LEFT) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) | |
| 342 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(9) | |
| 343 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') | |
| 336 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_X) PORT_CHAR('X') | |
| 337 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') | |
| 338 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') | |
| 339 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("UP") PORT_CODE(KEYCODE_UP) PORT_CHAR('^') | |
| 340 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("DOWN") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(10) | |
| 341 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("LEFT") PORT_CODE(KEYCODE_LEFT) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) | |
| 342 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(9) | |
| 343 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') | |
| 344 | 344 | |
| 345 | 345 | PORT_START /* KEY ROW 6 */ |
| 346 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) | |
| 347 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_HOME) PORT_CHAR(12) | |
| 348 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("BREAK") PORT_CODE(KEYCODE_END) PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) | |
| 346 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) | |
| 347 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_HOME) PORT_CHAR(12) | |
| 348 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("BREAK") PORT_CODE(KEYCODE_END) PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) | |
| 349 | 349 | PORT_BIT (0x78, IP_ACTIVE_LOW, IPT_UNUSED) |
| 350 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L-SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) | |
| 351 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R-SHIFT") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) | |
| 350 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("L-SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) | |
| 351 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("R-SHIFT") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) | |
| 352 | 352 | |
| 353 | 353 | PORT_INCLUDE( coco_joystick ) |
| 354 | 354 | PORT_INCLUDE( coco_joystick_buttons ) |
| r1877 | r1878 | |
| 370 | 370 | */ |
| 371 | 371 | static INPUT_PORTS_START( coco ) |
| 372 | 372 | PORT_START /* KEY ROW 0 */ |
| 373 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('@') | |
| 374 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('A') | |
| 375 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('B') | |
| 376 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('C') | |
| 377 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('D') | |
| 378 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E') | |
| 379 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('F') | |
| 380 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('G') | |
| 373 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('@') | |
| 374 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_A) PORT_CHAR('A') | |
| 375 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_B) PORT_CHAR('B') | |
| 376 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_C) PORT_CHAR('C') | |
| 377 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_D) PORT_CHAR('D') | |
| 378 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_E) PORT_CHAR('E') | |
| 379 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_F) PORT_CHAR('F') | |
| 380 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_G) PORT_CHAR('G') | |
| 381 | 381 | |
| 382 | 382 | PORT_START /* KEY ROW 1 */ |
| 383 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('H') | |
| 384 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('I') | |
| 385 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('J') | |
| 386 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('K') | |
| 387 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('L') | |
| 388 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('M') | |
| 389 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('N') | |
| 390 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O') | |
| 383 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_H) PORT_CHAR('H') | |
| 384 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_I) PORT_CHAR('I') | |
| 385 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_J) PORT_CHAR('J') | |
| 386 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_K) PORT_CHAR('K') | |
| 387 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_L) PORT_CHAR('L') | |
| 388 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_M) PORT_CHAR('M') | |
| 389 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_N) PORT_CHAR('N') | |
| 390 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_O) PORT_CHAR('O') | |
| 391 | 391 | |
| 392 | 392 | PORT_START /* KEY ROW 2 */ |
| 393 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('P') | |
| 394 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') | |
| 395 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('R') | |
| 396 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('S') | |
| 397 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('T') | |
| 398 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('U') | |
| 399 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('V') | |
| 400 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('W') | |
| 393 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_P) PORT_CHAR('P') | |
| 394 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') | |
| 395 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_R) PORT_CHAR('R') | |
| 396 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_S) PORT_CHAR('S') | |
| 397 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_T) PORT_CHAR('T') | |
| 398 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_U) PORT_CHAR('U') | |
| 399 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_V) PORT_CHAR('V') | |
| 400 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_W) PORT_CHAR('W') | |
| 401 | 401 | |
| 402 | 402 | PORT_START /* KEY ROW 3 */ |
| 403 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('X') | |
| 404 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') | |
| 405 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') | |
| 406 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("UP") PORT_CODE(KEYCODE_UP) PORT_CHAR('^') | |
| 407 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("DOWN") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(10) | |
| 408 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LEFT") PORT_CODE(KEYCODE_LEFT) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) | |
| 409 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(9) | |
| 410 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') | |
| 403 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_X) PORT_CHAR('X') | |
| 404 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') | |
| 405 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') | |
| 406 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("UP") PORT_CODE(KEYCODE_UP) PORT_CHAR('^') | |
| 407 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("DOWN") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(10) | |
| 408 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("LEFT") PORT_CODE(KEYCODE_LEFT) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) | |
| 409 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(9) | |
| 410 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') | |
| 411 | 411 | |
| 412 | 412 | PORT_START /* KEY ROW 4 */ |
| 413 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') | |
| 414 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') | |
| 415 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"') | |
| 416 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') | |
| 417 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') | |
| 418 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') | |
| 419 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') | |
| 420 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') | |
| 413 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0) PORT_CHAR('0') | |
| 414 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') | |
| 415 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"') | |
| 416 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') | |
| 417 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') | |
| 418 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') | |
| 419 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') | |
| 420 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') | |
| 421 | 421 | |
| 422 | 422 | PORT_START /* KEY ROW 5 */ |
| 423 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') | |
| 424 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') | |
| 425 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*') | |
| 426 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(';') PORT_CHAR('+') | |
| 427 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') | |
| 428 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') | |
| 429 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') | |
| 430 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') | |
| 423 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') | |
| 424 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') | |
| 425 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*') | |
| 426 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(';') PORT_CHAR('+') | |
| 427 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') | |
| 428 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') | |
| 429 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') | |
| 430 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') | |
| 431 | 431 | |
| 432 | 432 | PORT_START /* KEY ROW 6 */ |
| 433 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) | |
| 434 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_HOME) PORT_CHAR(12) | |
| 435 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("BREAK") PORT_CODE(KEYCODE_END) PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) | |
| 433 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) | |
| 434 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_HOME) PORT_CHAR(12) | |
| 435 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("BREAK") PORT_CODE(KEYCODE_END) PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) | |
| 436 | 436 | PORT_BIT(0x78, IP_ACTIVE_LOW, IPT_UNUSED) |
| 437 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L-SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) | |
| 438 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R-SHIFT") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) | |
| 437 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("L-SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) | |
| 438 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("R-SHIFT") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) | |
| 439 | 439 | |
| 440 | 440 | PORT_INCLUDE( coco_joystick ) |
| 441 | 441 | PORT_INCLUDE( coco_joystick_buttons ) |
| r1877 | r1878 | |
|---|---|---|
| 20 | 20 | |
| 21 | 21 | static READ8_HANDLER( psg_4015_r ) |
| 22 | 22 | { |
| 23 | return NESPSG_0_r(0x15); | |
| 23 | return NESPSG_0_r(machine, 0x15); | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | static WRITE8_HANDLER( psg_4015_w ) |
| 27 | 27 | { |
| 28 | NESPSG_0_w(0x15, data); | |
| 28 | NESPSG_0_w(machine, 0x15, data); | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | static WRITE8_HANDLER( psg_4017_w ) |
| 32 | 32 | { |
| 33 | NESPSG_0_w(0x17, data); | |
| 33 | NESPSG_0_w(machine, 0x17, data); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | static WRITE8_HANDLER(nes_vh_sprite_dma_w) |
| r1877 | r1878 | |
|---|---|---|
| 403 | 403 | MDRV_CPU_CONFIG(ti99_8_processor_config) |
| 404 | 404 | MDRV_CPU_PROGRAM_MAP(ti99_8_memmap, 0) |
| 405 | 405 | MDRV_CPU_IO_MAP(ti99_8_readcru, ti99_8_writecru) |
| 406 | MDRV_CPU_VBLANK_INT(ti99_vblank_interrupt | |
| 406 | MDRV_CPU_VBLANK_INT("main", ti99_vblank_interrupt | |
| 407 | 407 | |
| 408 | 408 | MDRV_MACHINE_START( ti99_8_60hz ) |
| 409 | 409 | MDRV_MACHINE_RESET( ti99 ) |
| r1877 | r1878 | |
| 433 | 433 | MDRV_CPU_CONFIG(ti99_8_processor_config) |
| 434 | 434 | MDRV_CPU_PROGRAM_MAP(ti99_8_memmap, 0) |
| 435 | 435 | MDRV_CPU_IO_MAP(ti99_8_readcru, ti99_8_writecru) |
| 436 | MDRV_CPU_VBLANK_INT(ti99_vblank_interrupt | |
| 436 | MDRV_CPU_VBLANK_INT("main", ti99_vblank_interrupt | |
| 437 | 437 | |
| 438 | 438 | MDRV_MACHINE_START( ti99_8_50hz ) |
| 439 | 439 | MDRV_MACHINE_RESET( ti99 ) |
| r1877 | r1878 | |
|---|---|---|
| 556 | 556 | MDRV_CPU_ADD_TAG("main", Z80GB, 4194304) /* 4.194304 Mhz */ |
| 557 | 557 | MDRV_CPU_PROGRAM_MAP(gb_map, 0) |
| 558 | 558 | MDRV_CPU_CONFIG(dmg_cpu_reset) |
| 559 | MDRV_CPU_VBLANK_INT(gb_scanline_interrupt | |
| 559 | MDRV_CPU_VBLANK_INT("main", gb_scanline_interrupt | |
| 560 | 560 | |
| 561 | 561 | MDRV_SCREEN_ADD("main", LCD) |
| 562 | 562 | MDRV_SCREEN_REFRESH_RATE(DMG_FRAMES_PER_SECOND) |
| r1877 | r1878 | |
| 673 | 673 | /* basic machine hardware */ |
| 674 | 674 | MDRV_CPU_ADD_TAG("main", Z80GB, 4194304) /* 4.194304 Mhz */ |
| 675 | 675 | MDRV_CPU_PROGRAM_MAP( megaduck_map, 0 ) |
| 676 | MDRV_CPU_VBLANK_INT(gb_scanline_interrupt | |
| 676 | MDRV_CPU_VBLANK_INT("main", gb_scanline_interrupt | |
| 677 | 677 | MDRV_CPU_CONFIG(megaduck_cpu_reset) |
| 678 | 678 | |
| 679 | 679 | MDRV_SCREEN_ADD("main", LCD) |
| r1877 | r1878 | |
|---|---|---|
| 177 | 177 | |
| 178 | 178 | static void z88_install_memory_handler_pair(offs_t start, offs_t size, int bank_base, void *read_addr, void *write_addr) |
| 179 | 179 | { |
| 180 | read8_handler read_handler; | |
| 181 | write8_handler write_handler; | |
| 180 | read8_machine_func read_handler; | |
| 181 | write8_machine_func write_handler; | |
| 182 | 182 | |
| 183 | read_handler = read_addr ? (read8_handler) (STATIC_BANK1 + (FPTR)(bank_base - 1 + 0)) : MRA8_ROM; | |
| 184 | write_handler = write_addr ? (write8_handler) (STATIC_BANK1 + (FPTR)(bank_base - 1 + 1)) : MWA8_UNMAP; | |
| 183 | read_handler = read_addr ? (read8_machine_func) (STATIC_BANK1 + (FPTR)(bank_base - 1 + 0)) : MRA8_ROM; | |
| 184 | write_handler = write_addr ? (write8_machine_func) (STATIC_BANK1 + (FPTR)(bank_base - 1 + 1)) : MWA8_UNMAP; | |
| 185 | 185 | |
| 186 | 186 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, start, start + size - 1, 0, 0, read_handler); |
| 187 | 187 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, start, start + size - 1, 0, 0, write_handler); |
| r1877 | r1878 | |
| 496 | 496 | case 0x0d1: |
| 497 | 497 | case 0x0d2: |
| 498 | 498 | case 0x0d3: |
| 499 | blink_srx_w(port & 0x03, data); | |
| 499 | blink_srx_w(machine, port & 0x03, data); | |
| 500 | 500 | return; |
| 501 | 501 | } |
| 502 | 502 |
| r1877 | r1878 | |
|---|---|---|
| 57 | 57 | /* basic machine hardware */ |
| 58 | 58 | MDRV_CPU_ADD(M68000, 8182000) /* 16.364 Mhz / 2 */ |
| 59 | 59 | MDRV_CPU_PROGRAM_MAP(concept_memmap, 0) |
| 60 | MDRV_CPU_VBLANK_INT(concept_interrupt | |
| 60 | MDRV_CPU_VBLANK_INT("main", concept_interrupt | |
| 61 | 61 | |
| 62 | 62 | MDRV_INTERLEAVE(1) |
| 63 | 63 | MDRV_MACHINE_START(concept) |
| r1877 | r1878 | |
|---|---|---|
| 175 | 175 | |
| 176 | 176 | static char *pcw16_mem_ptr[4]; |
| 177 | 177 | |
| 178 | static const write8_ | |
| 178 | static const write8_machin | |
| 179 | 179 | { |
| 180 | 180 | MWA8_BANK5, |
| 181 | 181 | MWA8_BANK6, |
| r1877 | r1878 | |
| 183 | 183 | MWA8_BANK8 |
| 184 | 184 | }; |
| 185 | 185 | |
| 186 | static const read8_ | |
| 186 | static const read8_machin | |
| 187 | 187 | { |
| 188 | 188 | MRA8_BANK1, |
| 189 | 189 | MRA8_BANK2, |
| r1877 | r1878 | |
| 260 | 260 | return pcw16_flash1_bank_handler_r(3, offset); |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | static const read8_ | |
| 263 | static const read8_machin | |
| 264 | 264 | { |
| 265 | 265 | pcw16_flash0_bank_handler0_r, |
| 266 | 266 | pcw16_flash0_bank_handler1_r, |
| r1877 | r1878 | |
| 268 | 268 | pcw16_flash0_bank_handler3_r, |
| 269 | 269 | }; |
| 270 | 270 | |
| 271 | static const read8_ | |
| 271 | static const read8_machin | |
| 272 | 272 | { |
| 273 | 273 | pcw16_flash1_bank_handler0_r, |
| 274 | 274 | pcw16_flash1_bank_handler1_r, |
| r1877 | r1878 | |
| 337 | 337 | pcw16_flash1_bank_handler_w(3, offset, data); |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | static const write8_ | |
| 340 | static const write8_machin | |
| 341 | 341 | { |
| 342 | 342 | pcw16_flash0_bank_handler0_w, |
| 343 | 343 | pcw16_flash0_bank_handler1_w, |
| r1877 | r1878 | |
| 345 | 345 | pcw16_flash0_bank_handler3_w, |
| 346 | 346 | }; |
| 347 | 347 | |
| 348 | static const write8_ | |
| 348 | static const write8_machin | |
| 349 | 349 | { |
| 350 | 350 | pcw16_flash1_bank_handler0_w, |
| 351 | 351 | pcw16_flash1_bank_handler1_w, |
| r1877 | r1878 | |
| 374 | 374 | |
| 375 | 375 | static void pcw16_set_bank_handlers(int bank, PCW16_RAM_TYPE type) |
| 376 | 376 | { |
| 377 | read8_handler read_handler; | |
| 378 | write8_handler write_handler; | |
| 377 | read8_machine_func read_handler; | |
| 378 | write8_machine_func write_handler; | |
| 379 | 379 | |
| 380 | 380 | switch (type) { |
| 381 | 381 | case PCW16_MEM_ROM: |
| r1877 | r1878 | |
| 1159 | 1159 | /* write to Super I/O chip. FDC Data Rate. */ |
| 1160 | 1160 | static WRITE8_HANDLER(pcw16_superio_fdc_datarate_w) |
| 1161 | 1161 | { |
| 1162 | pc_fdc_w(PC_FDC_DATA_RATE_REGISTER,data); | |
| 1162 | pc_fdc_w(machine, PC_FDC_DATA_RATE_REGISTER,data); | |
| 1163 | 1163 | } |
| 1164 | 1164 | |
| 1165 | 1165 | /* write to Super I/O chip. FDC Digital output register */ |
| 1166 | 1166 | static WRITE8_HANDLER(pcw16_superio_fdc_digital_output_register_w) |
| 1167 | 1167 | { |
| 1168 | pc_fdc_w(PC_FDC_DIGITAL_OUTPUT_REGISTER, data); | |
| 1168 | pc_fdc_w(machine, PC_FDC_DIGITAL_OUTPUT_REGISTER, data); | |
| 1169 | 1169 | } |
| 1170 | 1170 | |
| 1171 | 1171 | /* write to Super I/O chip. FDC Data Register */ |
| 1172 | 1172 | static WRITE8_HANDLER(pcw16_superio_fdc_data_w) |
| 1173 | 1173 | { |
| 1174 | pc_fdc_w(PC_FDC_DATA_REGISTER, data); | |
| 1174 | pc_fdc_w(machine, PC_FDC_DATA_REGISTER, data); | |
| 1175 | 1175 | } |
| 1176 | 1176 | |
| 1177 | 1177 | /* write to Super I/O chip. FDC Data Register */ |
| 1178 | 1178 | static READ8_HANDLER(pcw16_superio_fdc_data_r) |
| 1179 | 1179 | { |
| 1180 | return pc_fdc_r(PC_FDC_DATA_REGISTER); | |
| 1180 | return pc_fdc_r(machine, PC_FDC_DATA_REGISTER); | |
| 1181 | 1181 | } |
| 1182 | 1182 | |
| 1183 | 1183 | /* write to Super I/O chip. FDC Main Status Register */ |
| 1184 | 1184 | static READ8_HANDLER(pcw16_superio_fdc_main_status_register_r) |
| 1185 | 1185 | { |
| 1186 | return pc_fdc_r(PC_FDC_MAIN_STATUS_REGISTER); | |
| 1186 | return pc_fdc_r(machine, PC_FDC_MAIN_STATUS_REGISTER); | |
| 1187 | 1187 | } |
| 1188 | 1188 | |
| 1189 | 1189 | static READ8_HANDLER(pcw16_superio_fdc_digital_input_register_r) |
| 1190 | 1190 | { |
| 1191 | return pc_fdc_r(PC_FDC_DIGITIAL_INPUT_REGISTER); | |
| 1191 | return pc_fdc_r(machine, PC_FDC_DIGITIAL_INPUT_REGISTER); | |
| 1192 | 1192 | } |
| 1193 | 1193 | |
| 1194 | 1194 | static void pcw16_fdc_interrupt(int state) |
| r1877 | r1878 | |
|---|---|---|
| 162 | 162 | /* basic machine hardware */ |
| 163 | 163 | MDRV_CPU_ADD_TAG("main", M6502, 1000000) /* 1 MHz */ |
| 164 | 164 | MDRV_CPU_PROGRAM_MAP(kim1_map, 0) |
| 165 | MDRV_CPU_VBLANK_INT(kim1_interrupt | |
| 165 | MDRV_CPU_VBLANK_INT("main", kim1_interrupt | |
| 166 | 166 | MDRV_INTERLEAVE(1) |
| 167 | 167 | |
| 168 | 168 | MDRV_MACHINE_RESET( kim1 ) |
| r1877 | r1878 | |
|---|---|---|
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | #include "driver.h" |
| 9 | #include "deprecat.h" | |
| 9 | 10 | #include "machine/8255ppi.h" |
| 10 | 11 | #include "video/tms9928a.h" |
| 11 | 12 | #include "video/v9938.h" |
| r1877 | r1878 | |
| 726 | 727 | MDRV_CPU_ADD(Z80, 3579545) /* 3.579545 Mhz */ |
| 727 | 728 | MDRV_CPU_PROGRAM_MAP(readmem,writemem) |
| 728 | 729 | MDRV_CPU_IO_MAP(readport,writeport) |
| 729 | MDRV_CPU_VBLANK_INT(msx_interrupt | |
| 730 | MDRV_CPU_VBLANK_INT("main", msx_interrupt | |
| 730 | 731 | MDRV_INTERLEAVE(1) |
| 731 | 732 | |
| 732 | 733 | MDRV_MACHINE_START( msx ) |
| r1877 | r1878 | |
| 774 | 775 | MDRV_CPU_ADD(Z80, 3579545) /* 3.579545 Mhz */ |
| 775 | 776 | MDRV_CPU_PROGRAM_MAP(readmem, writemem) |
| 776 | 777 | MDRV_CPU_IO_MAP(readport2,writeport2) |
| 777 | MDRV_CPU_VBLANK_INT(msx2_interrupt,262) | |
| 778 | MDRV_CPU_VBLANK_INT_HACK(msx2_interrupt, 262) | |
| 778 | 779 | MDRV_INTERLEAVE(1) |
| 779 | 780 | |
| 780 | 781 | MDRV_MACHINE_RESET( msx2 ) |
| r1877 | r1878 | |
|---|---|---|
| 16 | 16 | ***************************************************************************/ |
| 17 | 17 | |
| 18 | 18 | #include "driver.h" |
| 19 | #include "deprecat.h" | |
| 19 | 20 | #include "includes/gamecom.h" |
| 20 | 21 | #include "cpu/sm8500/sm8500.h" |
| 21 | 22 | #include "devices/cartslot.h" |
| r1877 | r1878 | |
| 92 | 93 | MDRV_CPU_ADD_TAG( "main", SM8500, XTAL_11_0592MHz/2 ) /* actually it's an sm8521 microcontroller containing an sm8500 cpu */ |
| 93 | 94 | MDRV_CPU_PROGRAM_MAP( gamecom_mem_map, 0 ) |
| 94 | 95 | MDRV_CPU_CONFIG( gamecom_cpu_config ) |
| 95 | MDRV_CPU_VBLANK_INT( | |
| 96 | MDRV_CPU_VBLANK_INT_HACK( | |
| 96 | 97 | |
| 97 | 98 | MDRV_SCREEN_ADD("main", LCD) |
| 98 | 99 | MDRV_SCREEN_REFRESH_RATE( 59.732155 ) |
| r1877 | r1878 | |
|---|---|---|
| 114 | 114 | case 0x30: |
| 115 | 115 | // write cdp1869 command on the data bus |
| 116 | 116 | vismac_bkg_latch = data & 0x07; |
| 117 | cdp1869_out3_w(0, data); | |
| 117 | cdp1869_out3_w(machine, 0, data); | |
| 118 | 118 | break; |
| 119 | 119 | |
| 120 | 120 | case 0x40: |
| 121 | cdp1869_out4_w(0, data); | |
| 121 | cdp1869_out4_w(machine, 0, data); | |
| 122 | 122 | break; |
| 123 | 123 | |
| 124 | 124 | case 0x50: |
| 125 | cdp1869_out5_w(0, data); | |
| 125 | cdp1869_out5_w(machine, 0, data); | |
| 126 | 126 | break; |
| 127 | 127 | |
| 128 | 128 | case 0x60: |
| 129 | cdp1869_out6_w(0, data); | |
| 129 | cdp1869_out6_w(machine, 0, data); | |
| 130 | 130 | break; |
| 131 | 131 | |
| 132 | 132 | case 0x70: |
| 133 | cdp1869_out7_w(0, data); | |
| 133 | cdp1869_out7_w(machine, 0, data); | |
| 134 | 134 | break; |
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | static WRITE8_HANDLER( vismac_pageram_w ) |
| 139 | 139 | { |
| 140 | cdp1869_pageram_w( offset, data ); | |
| 140 | cdp1869_pageram_w( machine, offset, data ); | |
| 141 | 141 | vismac_colorram[offset] = vismac_color_latch; |
| 142 | 142 | } |
| 143 | 143 |
| r1877 | r1878 | |
|---|---|---|
| 597 | 597 | it. */ |
| 598 | 598 | |
| 599 | 599 | if (offset & 2) |
| 600 | reply = TMS9928A_register_r(0); | |
| 600 | reply = TMS9928A_register_r(machine, 0); | |
| 601 | 601 | else |
| 602 | reply = TMS9928A_vram_r(0); | |
| 602 | reply = TMS9928A_vram_r(machine, 0); | |
| 603 | 603 | |
| 604 | 604 | if (!(offset & 1)) |
| 605 | 605 | bogus_read_save = reply; |
| r1877 | r1878 | |
| 614 | 614 | if (offset & 1) |
| 615 | 615 | { |
| 616 | 616 | if (offset & 2) |
| 617 | TMS9928A_register_w(0, data); | |
| 617 | TMS9928A_register_w(machine, 0, data); | |
| 618 | 618 | else |
| 619 | TMS9928A_vram_w(0, data); | |
| 619 | TMS9928A_vram_w(machine, 0, data); | |
| 620 | 620 | } |
| 621 | 621 | } |
| 622 | 622 | |
| 623 | static | |
| 623 | static | |
| 624 | 624 | { |
| 625 | 625 | int reply = readinputport(9); |
| 626 | 626 |
| r1877 | r1878 | |
|---|---|---|
| 146 | 146 | MDRV_CPU_CONFIG(sh4cpu_config) |
| 147 | 147 | MDRV_CPU_PROGRAM_MAP(dc_map,0) |
| 148 | 148 | MDRV_CPU_IO_MAP(dc_port,0) |
| 149 | MDRV_CPU_VBLANK_INT(dc_dispatch_vblank | |
| 149 | MDRV_CPU_VBLANK_INT("main", dc_dispatch_vblank | |
| 150 | 150 | |
| 151 | 151 | MDRV_CPU_ADD_TAG("sound", ARM7, ((XTAL_33_8688MHz*2)/3)/8) // AICA bus clock is 2/3rds * 33.8688. ARM7 gets 1 bus cycle out of each 8. |
| 152 | 152 | MDRV_CPU_PROGRAM_MAP(dc_audio_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 37 | 37 | /* basic machine hardware */ |
| 38 | 38 | MDRV_CPU_ADD_TAG("main", M68000, 5093760) /* 20.37504 Mhz / 4 */ |
| 39 | 39 | MDRV_CPU_PROGRAM_MAP(lisa_map, 0) |
| 40 | MDRV_CPU_VBLANK_INT(lisa_interrupt | |
| 40 | MDRV_CPU_VBLANK_INT("main", lisa_interrupt | |
| 41 | 41 | |
| 42 | 42 | MDRV_CPU_ADD_TAG("fdc", M6502, 2000000) /* 16.000 Mhz / 8 in when DIS asserted, 16.000 Mhz / 9 otherwise (?) */ |
| 43 | 43 | MDRV_CPU_PROGRAM_MAP(lisa_fdc_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 215 | 215 | /* basic machine hardware */ |
| 216 | 216 | MDRV_CPU_ADD(M65SC02, 4000000) /* vti core, integrated in vlsi, stz, but not bbr bbs */ |
| 217 | 217 | MDRV_CPU_PROGRAM_MAP(lynx_mem, 0) |
| 218 | MDRV_CPU_VBLANK_INT(lynx_frame_int | |
| 218 | MDRV_CPU_VBLANK_INT("main", lynx_frame_int | |
| 219 | 219 | MDRV_INTERLEAVE(1) |
| 220 | 220 | |
| 221 | 221 | MDRV_MACHINE_START( lynx ) |
| r1877 | r1878 | |
|---|---|---|
| 215 | 215 | MDRV_CPU_ADD_TAG("main", Z80, 3500000) |
| 216 | 216 | MDRV_CPU_PROGRAM_MAP(aquarius_mem, 0) |
| 217 | 217 | MDRV_CPU_IO_MAP(aquarius_io, 0) |
| 218 | MDRV_CPU_VBLANK_INT( aquarius_interrupt | |
| 218 | MDRV_CPU_VBLANK_INT("main", aquarius_interrupt | |
| 219 | 219 | MDRV_INTERLEAVE(1) |
| 220 | 220 | |
| 221 | 221 | MDRV_MACHINE_RESET( aquarius ) |
| r1877 | r1878 | |
|---|---|---|
| 372 | 372 | MDRV_CPU_ADD_TAG("main", Z80, 2216800) /* 2,2168 Mhz */ |
| 373 | 373 | MDRV_CPU_PROGRAM_MAP(cgenie_mem, 0) |
| 374 | 374 | MDRV_CPU_IO_MAP(cgenie_io, 0) |
| 375 | MDRV_CPU_VBLANK_INT(cgenie_frame_interrupt | |
| 375 | MDRV_CPU_VBLANK_INT("main", cgenie_frame_interrupt | |
| 376 | 376 | MDRV_CPU_PERIODIC_INT(cgenie_timer_interrupt, 40) |
| 377 | 377 | MDRV_INTERLEAVE(4) |
| 378 | 378 |
| r1877 | r1878 | |
|---|---|---|
| 459 | 459 | MDRV_CPU_CONFIG(abc80_daisy_chain) |
| 460 | 460 | MDRV_CPU_PROGRAM_MAP(abc80_map, 0) |
| 461 | 461 | MDRV_CPU_IO_MAP(abc80_io_map, 0) |
| 462 | MDRV_CPU_VBLANK_INT(abc80_nmi_interrupt | |
| 462 | MDRV_CPU_VBLANK_INT("main", abc80_nmi_interrupt | |
| 463 | 463 | |
| 464 | 464 | MDRV_MACHINE_START(abc80) |
| 465 | 465 |
| r1877 | r1878 | |
|---|---|---|
| 802 | 802 | MDRV_CPU_PROGRAM_MAP(apexc_mem_map, 0) |
| 803 | 803 | MDRV_CPU_IO_MAP(apexc_io_map, 0) |
| 804 | 804 | /* dummy interrupt: handles the control panel */ |
| 805 | MDRV_CPU_VBLANK_INT(apexc_interrupt | |
| 805 | MDRV_CPU_VBLANK_INT("main", apexc_interrupt | |
| 806 | 806 | /*MDRV_CPU_PERIODIC_INT(func, rate)*/ |
| 807 | 807 | |
| 808 | 808 | MDRV_MACHINE_START( apexc ) |
| r1877 | r1878 | |
|---|---|---|
| 346 | 346 | // 4 channel DMA controller (Hitachi HD63450) |
| 347 | 347 | static WRITE16_HANDLER( x68k_dmac_w ) |
| 348 | 348 | { |
| 349 | hd63450_w(offset, data, mem_mask); | |
| 349 | hd63450_w(machine, offset, data, mem_mask); | |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | static READ16_HANDLER( x68k_dmac_r ) |
| 353 | 353 | { |
| 354 | return hd63450_r(offset, mem_mask); | |
| 354 | return hd63450_r(machine, offset, mem_mask); | |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | static void x68k_keyboard_ctrl_w(int data) |
| r1877 | r1878 | |
| 566 | 566 | switch(offset) |
| 567 | 567 | { |
| 568 | 568 | case 0: |
| 569 | return scc_r(0); | |
| 569 | return scc_r(machine, 0); | |
| 570 | 570 | case 1: |
| 571 | 571 | return x68k_read_mouse(); |
| 572 | 572 | case 2: |
| 573 | return scc_r(1); | |
| 573 | return scc_r(machine, 1); | |
| 574 | 574 | case 3: |
| 575 | return scc_r(3); | |
| 575 | return scc_r(machine, 3); | |
| 576 | 576 | default: |
| 577 | 577 | return 0xff; |
| 578 | 578 | } |
| r1877 | r1878 | |
| 586 | 586 | switch(offset) |
| 587 | 587 | { |
| 588 | 588 | case 0: |
| 589 | scc_w(0,(UINT8)data); | |
| 589 | scc_w(machine, 0,(UINT8)data); | |
| 590 | 590 | if((scc_get_reg_b(5) & 0x02) != prev) |
| 591 | 591 | { |
| 592 | 592 | if(scc_get_reg_b(5) & 0x02) // Request to Send |
| r1877 | r1878 | |
| 599 | 599 | } |
| 600 | 600 | break; |
| 601 | 601 | case 1: |
| 602 | scc_w(2,(UINT8)data); | |
| 602 | scc_w(machine, 2,(UINT8)data); | |
| 603 | 603 | break; |
| 604 | 604 | case 2: |
| 605 | scc_w(1,(UINT8)data); | |
| 605 | scc_w(machine, 1,(UINT8)data); | |
| 606 | 606 | break; |
| 607 | 607 | case 3: |
| 608 | scc_w(3,(UINT8)data); | |
| 608 | scc_w(machine, 3,(UINT8)data); | |
| 609 | 609 | break; |
| 610 | 610 | } |
| 611 | 611 | prev = scc_get_reg_b(5) & 0x02; |
| r1877 | r1878 | |
| 693 | 693 | { |
| 694 | 694 | case 0x00: |
| 695 | 695 | case 0x01: |
| 696 | nec765_data_w(0,data); | |
| 696 | nec765_data_w(machine, 0,data); | |
| 697 | 697 | break; |
| 698 | 698 | case 0x02: // drive option signal control |
| 699 | 699 | x = data & 0x0f; |
| r1877 | r1878 | |
| 736 | 736 | switch(offset) |
| 737 | 737 | { |
| 738 | 738 | case 0x00: |
| 739 | return nec765_status_r(0); | |
| 739 | return nec765_status_r(machine, 0); | |
| 740 | 740 | case 0x01: |
| 741 | return nec765_data_r(0); | |
| 741 | return nec765_data_r(machine, 0); | |
| 742 | 742 | case 0x02: |
| 743 | 743 | ret = 0x00; |
| 744 | 744 | for(x=0;x<4;x++) |
| r1877 | r1878 | |
| 782 | 782 | int data = -1; |
| 783 | 783 | |
| 784 | 784 | if(sys.fdc.drq_state != 0) |
| 785 | data = nec765_dack_r(0); | |
| 785 | data = nec765_dack_r(Machine, 0); | |
| 786 | 786 | // logerror("FDC: DACK reading\n"); |
| 787 | 787 | return data; |
| 788 | 788 | } |
| 789 | 789 | |
| 790 | 790 | static void x68k_fdc_write_byte(int addr, int data) |
| 791 | 791 | { |
| 792 | nec765_dack_w(0,data); | |
| 792 | nec765_dack_w(Machine, 0, data); | |
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 | static void fdc_drq(int state, int read_write) |
| r1877 | r1878 | |
| 820 | 820 | switch(offset) |
| 821 | 821 | { |
| 822 | 822 | case 0x00: |
| 823 | YM2151_register_port_0_w(0,data); | |
| 823 | YM2151_register_port_0_w(machine, 0, data); | |
| 824 | 824 | logerror("YM: Register select 0x%02x\n",data); |
| 825 | 825 | break; |
| 826 | 826 | case 0x01: |
| 827 | YM2151_data_port_0_w(0,data); | |
| 827 | YM2151_data_port_0_w(machine, 0, data); | |
| 828 | 828 | logerror("YM: Data write 0x%02x\n",data); |
| 829 | 829 | break; |
| 830 | 830 | } |
| r1877 | r1878 | |
| 833 | 833 | static READ16_HANDLER( x68k_fm_r ) |
| 834 | 834 | { |
| 835 | 835 | if(offset == 0x01) |
| 836 | return YM2151_status_port_0_r(0); | |
| 836 | return YM2151_status_port_0_r(machine, 0); | |
| 837 | 837 | |
| 838 | 838 | return 0xff; |
| 839 | 839 | } |
| r1877 | r1878 | |
| 1145 | 1145 | |
| 1146 | 1146 | static READ16_HANDLER( x68k_rtc_r ) |
| 1147 | 1147 | { |
| 1148 | return rp5c15_r(offset,mem_mask); | |
| 1148 | return rp5c15_r(machine, offset, mem_mask); | |
| 1149 | 1149 | } |
| 1150 | 1150 | |
| 1151 | 1151 | static WRITE16_HANDLER( x68k_rtc_w ) |
| 1152 | 1152 | { |
| 1153 | rp5c15_w(offset,data,mem_mask); | |
| 1153 | rp5c15_w(machine, offset, data, mem_mask); | |
| 1154 | 1154 | } |
| 1155 | 1155 | |
| 1156 | 1156 | static void x68k_rtc_alarm_irq(int state) |
| r1877 | r1878 | |
| 1928 | 1928 | { |
| 1929 | 1929 | /* Install RAM handlers */ |
| 1930 | 1930 | x68k_spriteram = (UINT16*)memory_region(REGION_USER1); |
| 1931 | memory_install_read16_handler(0,ADDRESS_SPACE_PROGRAM,0x000000,mess_ram_size-1,mess_ram_size-1,0,(read16_handler)1); | |
| 1932 | memory_install_write16_handler(0,ADDRESS_SPACE_PROGRAM,0x000000,mess_ram_size-1,mess_ram_size-1,0,(write16_handler)1); | |
| 1931 | memory_install_read16_handler(0,ADDRESS_SPACE_PROGRAM,0x000000,mess_ram_size-1,mess_ram_size-1,0,(read16_machine_func)1); | |
| 1932 | memory_install_write16_handler(0,ADDRESS_SPACE_PROGRAM,0x000000,mess_ram_size-1,mess_ram_size-1,0,(write16_machine_func)1); | |
| 1933 | 1933 | memory_set_bankptr(1,mess_ram); |
| 1934 | memory_install_read16_handler(0,ADDRESS_SPACE_PROGRAM,0xc00000,0xdfffff,0x1fffff,0,(read16_handler)x68k_gvram_r); | |
| 1935 | memory_install_write16_handler(0,ADDRESS_SPACE_PROGRAM,0xc00000,0xdfffff,0x1fffff,0,(write16_handler)x68k_gvram_w); | |
| 1934 | memory_install_read16_handler(0,ADDRESS_SPACE_PROGRAM,0xc00000,0xdfffff,0x1fffff,0,(read16_machine_func)x68k_gvram_r); | |
| 1935 | memory_install_write16_handler(0,ADDRESS_SPACE_PROGRAM,0xc00000,0xdfffff,0x1fffff,0,(write16_machine_func)x68k_gvram_w); | |
| 1936 | 1936 | memory_set_bankptr(2,gvram); // so that code in VRAM is executable - needed for Terra Cresta |
| 1937 | memory_install_read16_handler(0,ADDRESS_SPACE_PROGRAM,0xe00000,0xe7ffff,0x07ffff,0,(read16_handler)x68k_tvram_r); | |
| 1938 | memory_install_write16_handler(0,ADDRESS_SPACE_PROGRAM,0xe00000,0xe7ffff,0x07ffff,0,(write16_handler)x68k_tvram_w); | |
| 1937 | memory_install_read16_handler(0,ADDRESS_SPACE_PROGRAM,0xe00000,0xe7ffff,0x07ffff,0,(read16_machine_func)x68k_tvram_r); | |
| 1938 | memory_install_write16_handler(0,ADDRESS_SPACE_PROGRAM,0xe00000,0xe7ffff,0x07ffff,0,(write16_machine_func)x68k_tvram_w); | |
| 1939 | 1939 | memory_set_bankptr(3,tvram); // so that code in VRAM is executable - needed for Terra Cresta |
| 1940 | memory_install_read16_handler(0,ADDRESS_SPACE_PROGRAM,0xed0000,0xed3fff,0x003fff,0,(read16_handler)x68k_sram_r); | |
| 1941 | memory_install_write16_handler(0,ADDRESS_SPACE_PROGRAM,0xed0000,0xed3fff,0x003fff,0,(write16_handler)x68k_sram_w); | |
| 1940 | memory_install_read16_handler(0,ADDRESS_SPACE_PROGRAM,0xed0000,0xed3fff,0x003fff,0,(read16_machine_func)x68k_sram_r); | |
| 1941 | memory_install_write16_handler(0,ADDRESS_SPACE_PROGRAM,0xed0000,0xed3fff,0x003fff,0,(write16_machine_func)x68k_sram_w); | |
| 1942 | 1942 | memory_set_bankptr(4,generic_nvram16); // so that code in SRAM is executable, there is an option for booting from SRAM |
| 1943 | 1943 | |
| 1944 | 1944 | // start keyboard timer |
| r1877 | r1878 | |
| 2002 | 2002 | /* basic machine hardware */ |
| 2003 | 2003 | MDRV_CPU_ADD_TAG("main", M68000, 10000000) /* 10 MHz */ |
| 2004 | 2004 | MDRV_CPU_PROGRAM_MAP(x68k_map, 0) |
| 2005 | MDRV_CPU_VBLANK_INT(x68k_vsync_irq | |
| 2005 | MDRV_CPU_VBLANK_INT("main", x68k_vsync_irq | |
| 2006 | 2006 | MDRV_INTERLEAVE(1) |
| 2007 | 2007 | |
| 2008 | 2008 | MDRV_MACHINE_START( x68000 ) |
| r1877 | r1878 | |
|---|---|---|
| 319 | 319 | |
| 320 | 320 | static READ8_HANDLER ( spectrum_port_r ) |
| 321 | 321 | { |
| 322 | if ((offset & 1)==0) | |
| 323 | return spectrum_port_fe_r(offset); | |
| 322 | if ((offset & 1)==0) | |
| 323 | return spectrum_port_fe_r(machine, offset); | |
| 324 | 324 | |
| 325 | if ((offset & 0xff)==0x1f) | |
| 326 | return spectrum_port_1f_r(offset); | |
| 325 | if ((offset & 0xff)==0x1f) | |
| 326 | return spectrum_port_1f_r(machine, offset); | |
| 327 | 327 | |
| 328 | if ((offset & 0xff)==0x7f) | |
| 329 | return spectrum_port_7f_r(offset); | |
| 328 | if ((offset & 0xff)==0x7f) | |
| 329 | return spectrum_port_7f_r(machine, offset); | |
| 330 | 330 | |
| 331 | if ((offset & 0xff)==0xdf) | |
| 332 | return spectrum_port_df_r(offset); | |
| 331 | if ((offset & 0xff)==0xdf) | |
| 332 | return spectrum_port_df_r(machine, offset); | |
| 333 | 333 | |
| 334 | | |
| 334 | | |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | static WRITE8_HANDLER ( spectrum_port_w ) |
| 338 | 338 | { |
| 339 | 339 | if ((offset & 1)==0) |
| 340 | spectrum_port_fe_w(offset,data); | |
| 340 | spectrum_port_fe_w(machine, offset,data); | |
| 341 | 341 | else |
| 342 | 342 | { |
| 343 | 343 | logerror("Write %02x to Port: %04x\n", data, offset); |
| r1877 | r1878 | |
| 370 | 370 | |
| 371 | 371 | static WRITE8_HANDLER(spectrum_128_port_7ffd_w) |
| 372 | 372 | { |
| 373 | /* D0-D2: RAM page located at 0x0c000-0x0ffff */ | |
| 374 | /* D3 - Screen select (screen 0 in ram page 5, screen 1 in ram page 7 */ | |
| 375 | /* D4 - ROM select - which rom paged into 0x0000-0x03fff */ | |
| 376 | /* D5 - Disable paging */ | |
| 373 | /* D0-D2: RAM page located at 0x0c000-0x0ffff */ | |
| 374 | /* D3 - Screen select (screen 0 in ram page 5, screen 1 in ram page 7 */ | |
| 375 | /* D4 - ROM select - which rom paged into 0x0000-0x03fff */ | |
| 376 | /* D5 - Disable paging */ | |
| 377 | 377 | |
| 378 | /* disable paging? */ | |
| 379 | if (spectrum_128_port_7ffd_data & 0x20) | |
| 380 | return; | |
| 378 | /* disable paging? */ | |
| 379 | if (spectrum_128_port_7ffd_data & 0x20) | |
| 380 | return; | |
| 381 | 381 | |
| 382 | /* store new state */ | |
| 383 | spectrum_128_port_7ffd_data = data; | |
| 382 | /* store new state */ | |
| 383 | spectrum_128_port_7ffd_data = data; | |
| 384 | 384 | |
| 385 | /* update memory */ | |
| 386 | spectrum_128_update_memory(); | |
| 385 | /* update memory */ | |
| 386 | spectrum_128_update_memory(); | |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | extern void spectrum_128_update_memory(void) |
| 390 | 390 | { |
| 391 | unsigned char *ChosenROM; | |
| 392 | int ROMSelection; | |
| 391 | unsigned char *ChosenROM; | |
| 392 | int ROMSelection; | |
| 393 | 393 | |
| 394 | if (spectrum_128_port_7ffd_data & 8) | |
| 395 | { | |
| 396 | logerror("SCREEN 1: BLOCK 7\n"); | |
| 397 | spectrum_128_screen_location = spectrum_ram + (7<<14); | |
| 398 | } | |
| 399 | else | |
| 400 | { | |
| 401 | logerror("SCREEN 0: BLOCK 5\n"); | |
| 402 | spectrum_128_screen_location = spectrum_ram + (5<<14); | |
| 403 | } | |
| 394 | if (spectrum_128_port_7ffd_data & 8) | |
| 395 | { | |
| 396 | logerror("SCREEN 1: BLOCK 7\n"); | |
| 397 | spectrum_128_screen_location = spectrum_ram + (7<<14); | |
| 398 | } | |
| 399 | else | |
| 400 | { | |
| 401 | logerror("SCREEN 0: BLOCK 5\n"); | |
| 402 | spectrum_128_screen_location = spectrum_ram + (5<<14); | |
| 403 | } | |
| 404 | 404 | |
| 405 | /* select ram at 0x0c000-0x0ffff */ | |
| 406 | { | |
| 407 | int ram_page; | |
| 408 | unsigned char *ram_data; | |
| 405 | /* select ram at 0x0c000-0x0ffff */ | |
| 406 | { | |
| 407 | int ram_page; | |
| 408 | unsigned char *ram_data; | |
| 409 | 409 | |
| 410 | ram_page = spectrum_128_port_7ffd_data & 0x07; | |
| 411 | ram_data = spectrum_ram + (ram_page<<14); | |
| 410 | ram_page = spectrum_128_port_7ffd_data & 0x07; | |
| 411 | ram_data = spectrum_ram + (ram_page<<14); | |
| 412 | 412 | |
| 413 | memory_set_bankptr(4, ram_data); | |
| 414 | memory_set_bankptr(8, ram_data); | |
| 413 | memory_set_bankptr(4, ram_data); | |
| 414 | memory_set_bankptr(8, ram_data); | |
| 415 | 415 | |
| 416 | logerror("RAM at 0xc000: %02x\n",ram_page); | |
| 417 | } | |
| 416 | logerror("RAM at 0xc000: %02x\n",ram_page); | |
| 417 | } | |
| 418 | 418 | |
| 419 | /* ROM switching */ | |
| 420 | ROMSelection = ((spectrum_128_port_7ffd_data>>4) & 0x01); | |
| 419 | /* ROM switching */ | |
| 420 | ROMSelection = ((spectrum_128_port_7ffd_data>>4) & 0x01); | |
| 421 | 421 | |
| 422 | | |
| 422 | | |
| 423 | 423 | |
| 424 | | |
| 424 | | |
| 425 | 425 | |
| 426 | | |
| 426 | | |
| 427 | 427 | |
| 428 | | |
| 428 | | |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | |
| 432 | 432 | |
| 433 | 433 | static WRITE8_HANDLER(spectrum_128_port_bffd_w) |
| 434 | 434 | { |
| 435 | | |
| 435 | | |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | static WRITE8_HANDLER(spectrum_128_port_fffd_w) |
| 439 | 439 | { |
| 440 | | |
| 440 | | |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | static READ8_HANDLER(spectrum_128_port_fffd_r) |
| 444 | 444 | { |
| 445 | | |
| 445 | | |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | static READ8_HANDLER ( spectrum_128_port_r ) |
| 449 | 449 | { |
| 450 | 450 | if ((offset & 1)==0) |
| 451 | 451 | { |
| 452 | return spectrum_port_fe_r(offset); | |
| 452 | return spectrum_port_fe_r(machine, offset); | |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | if ((offset & 2)==0) |
| r1877 | r1878 | |
| 460 | 460 | break; |
| 461 | 461 | |
| 462 | 462 | case 3: |
| 463 | return spectrum_128_port_fffd_r(offset); | |
| 463 | return spectrum_128_port_fffd_r(machine, offset); | |
| 464 | 464 | } |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | /* don't think these are correct! */ |
| 468 | 468 | if ((offset & 0xff)==0x1f) |
| 469 | return spectrum_port_1f_r(offset); | |
| 469 | return spectrum_port_1f_r(machine, offset); | |
| 470 | 470 | |
| 471 | 471 | if ((offset & 0xff)==0x7f) |
| 472 | return spectrum_port_7f_r(offset); | |
| 472 | return spectrum_port_7f_r(machine, offset); | |
| 473 | 473 | |
| 474 | 474 | if ((offset & 0xff)==0xdf) |
| 475 | return spectrum_port_df_r(offset); | |
| 475 | return spectrum_port_df_r(machine, offset); | |
| 476 | 476 | |
| 477 | 477 | return video_screen_get_vpos(0)<193 ? spectrum_128_screen_location[0x1800|(video_screen_get_vpos(0)&0xf8)<<2]:0xff; |
| 478 | 478 | } |
| r1877 | r1878 | |
| 480 | 480 | static WRITE8_HANDLER ( spectrum_128_port_w ) |
| 481 | 481 | { |
| 482 | 482 | if ((offset & 1)==0) |
| 483 | spectrum_port_fe_w(offset,data); | |
| 483 | spectrum_port_fe_w(machine, offset,data); | |
| 484 | 484 | |
| 485 | 485 | /* Only decodes on A15, A14 & A1 */ |
| 486 | 486 | else if ((offset & 2)==0) |
| r1877 | r1878 | |
| 488 | 488 | switch ((offset>>8) & 0xc0) |
| 489 | 489 | { |
| 490 | 490 | case 0x40: |
| 491 | spectrum_128_port_7ffd_w(offset, data); | |
| 491 | spectrum_128_port_7ffd_w(machine, offset, data); | |
| 492 | 492 | break; |
| 493 | 493 | case 0x80: |
| 494 | spectrum_128_port_bffd_w(offset, data); | |
| 494 | spectrum_128_port_bffd_w(machine, offset, data); | |
| 495 | 495 | break; |
| 496 | 496 | case 0xc0: |
| 497 | spectrum_128_port_fffd_w(offset, data); | |
| 497 | spectrum_128_port_fffd_w(machine, offset, data); | |
| 498 | 498 | break; |
| 499 | 499 | default: |
| 500 | 500 | logerror("Write %02x to 128 port: %04x\n", data, offset); |
| r1877 | r1878 | |
| 566 | 566 | static WRITE8_HANDLER(spectrum_plus3_port_3ffd_w) |
| 567 | 567 | { |
| 568 | 568 | if (~readinputport(16) & 0x20) |
| 569 | nec765_data_w(0,data); | |
| 569 | nec765_data_w(machine, 0,data); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | static READ8_HANDLER(spectrum_plus3_port_3ffd_r) |
| r1877 | r1878 | |
| 574 | 574 | if (readinputport(16) & 0x20) |
| 575 | 575 | return 0xff; |
| 576 | 576 | else |
| 577 | return nec765_data_r(0); | |
| 577 | return nec765_data_r(machine, 0); | |
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | |
| r1877 | r1878 | |
| 583 | 583 | if (readinputport(16) & 0x20) |
| 584 | 584 | return 0xff; |
| 585 | 585 | else |
| 586 | return nec765_status_r(0); | |
| 586 | return nec765_status_r(machine, 0); | |
| 587 | 587 | } |
| 588 | 588 | |
| 589 | 589 | |
| r1877 | r1878 | |
| 722 | 722 | { |
| 723 | 723 | if ((offset & 1)==0) |
| 724 | 724 | { |
| 725 | return spectrum_port_fe_r(offset); | |
| 725 | return spectrum_port_fe_r(machine, offset); | |
| 726 | 726 | } |
| 727 | 727 | |
| 728 | 728 | if ((offset & 2)==0) |
| r1877 | r1878 | |
| 740 | 740 | |
| 741 | 741 | /* +3 fdc status */ |
| 742 | 742 | case 2: |
| 743 | return spectrum_plus3_port_2ffd_r(offset); | |
| 743 | return spectrum_plus3_port_2ffd_r(machine, offset); | |
| 744 | 744 | /* +3 fdc data */ |
| 745 | 745 | case 3: |
| 746 | return spectrum_plus3_port_3ffd_r(offset); | |
| 746 | return spectrum_plus3_port_3ffd_r(machine, offset); | |
| 747 | 747 | |
| 748 | 748 | default: |
| 749 | 749 | break; |
| r1877 | r1878 | |
| 753 | 753 | |
| 754 | 754 | /* 128k AY data */ |
| 755 | 755 | case 3: |
| 756 | return spectrum_128_port_fffd_r(offset); | |
| 756 | return spectrum_128_port_fffd_r(machine, offset); | |
| 757 | 757 | |
| 758 | 758 | default: |
| 759 | 759 | break; |
| r1877 | r1878 | |
| 766 | 766 | static WRITE8_HANDLER ( spectrum_plus3_port_w ) |
| 767 | 767 | { |
| 768 | 768 | if ((offset & 1)==0) |
| 769 | spectrum_port_fe_w(offset,data); | |
| 769 | spectrum_port_fe_w(machine, offset, data); | |
| 770 | 770 | |
| 771 | 771 | /* the following is not decoded exactly, need to check |
| 772 | 772 | what is correct! */ |
| r1877 | r1878 | |
| 790 | 790 | |
| 791 | 791 | /* +3 memory */ |
| 792 | 792 | case 1: |
| 793 | spectrum_plus3_port_1ffd_w(offset, data); | |
| 793 | spectrum_plus3_port_1ffd_w(machine, offset, data); | |
| 794 | 794 | break; |
| 795 | 795 | |
| 796 | 796 | /* +3 fdc data */ |
| 797 | 797 | case 3: |
| 798 | spectrum_plus3_port_3ffd_w(offset,data); | |
| 798 | spectrum_plus3_port_3ffd_w(machine, offset, data); | |
| 799 | 799 | break; |
| 800 | 800 | |
| 801 | 801 | default: |
| r1877 | r1878 | |
| 806 | 806 | |
| 807 | 807 | /* 128k memory */ |
| 808 | 808 | case 1: |
| 809 | spectrum_plus3_port_7ffd_w(offset, data); | |
| 809 | spectrum_plus3_port_7ffd_w(machine, offset, data); | |
| 810 | 810 | break; |
| 811 | 811 | |
| 812 | 812 | /* 128k AY data */ |
| 813 | 813 | case 2: |
| 814 | spectrum_128_port_bffd_w(offset, data); | |
| 814 | spectrum_128_port_bffd_w(machine, offset, data); | |
| 815 | 815 | break; |
| 816 | 816 | |
| 817 | 817 | /* 128K AY register */ |
| 818 | 818 | case 3: |
| 819 | spectrum_128_port_fffd_w(offset, data); | |
| 819 | spectrum_128_port_fffd_w(machine, offset, data); | |
| 820 | 820 | |
| 821 | 821 | default: |
| 822 | 822 | break; |
| r1877 | r1878 | |
| 870 | 870 | |
| 871 | 871 | static WRITE8_HANDLER(ts2068_port_f5_w) |
| 872 | 872 | { |
| 873 | AY8910_control_port_0_w(0, data); | |
| 873 | AY8910_control_port_0_w(machine, 0, data); | |
| 874 | 874 | } |
| 875 | 875 | |
| 876 | 876 | static READ8_HANDLER(ts2068_port_f6_r) |
| r1877 | r1878 | |
| 881 | 881 | if both bits are set then OR values |
| 882 | 882 | Bit 0 up, 1 down, 2 left, 3 right, 7 fire active low. Other bits 1 |
| 883 | 883 | */ |
| 884 | return AY8910_read_port_0_r(0); | |
| 884 | return AY8910_read_port_0_r(machine, 0); | |
| 885 | 885 | } |
| 886 | 886 | |
| 887 | 887 | static WRITE8_HANDLER(ts2068_port_f6_w) |
| 888 | 888 | { |
| 889 | AY8910_write_port_0_w(0, data); | |
| 889 | AY8910_write_port_0_w(machine, 0, data); | |
| 890 | 890 | } |
| 891 | 891 | |
| 892 | 892 | static READ8_HANDLER(ts2068_port_ff_r) |
| r1877 | r1878 | |
| 908 | 908 | } |
| 909 | 909 | |
| 910 | 910 | |
| 911 | static | |
| 911 | static | |
| 912 | 912 | { |
| 913 | switch (offset & 0xff) | |
| 914 | { | |
| 915 | /* Note: keys only decoded on port #fe not all even ports so | |
| 916 | ports #f4 & #f6 correctly read */ | |
| 917 | case 0xf4: return ts2068_port_f4_r(offset); | |
| 918 | case 0xf6: return ts2068_port_f6_r(offset); | |
| 919 | case 0xff: return ts2068_port_ff_r(offset); | |
| 913 | switch (offset & 0xff) | |
| 914 | { | |
| 915 | /* Note: keys only decoded on port #fe not all even ports so | |
| 916 | ports #f4 & #f6 correctly read */ | |
| 917 | case 0xf4: return ts2068_port_f4_r(machine, offset); | |
| 918 | case 0xf6: return ts2068_port_f6_r(machine, offset); | |
| 919 | case 0xff: return ts2068_port_ff_r(machine, offset); | |
| 920 | 920 | |
| 921 | case 0xfe: return spectrum_port_fe_r(offset); | |
| 922 | case 0x1f: return spectrum_port_1f_r(offset); | |
| 923 | case 0x7f: return spectrum_port_7f_r(offset); | |
| 924 | case 0xdf: return spectrum_port_df_r(offset); | |
| 925 | } | |
| 926 | logerror("Read from port: %04x\n", offset); | |
| 921 | case 0xfe: return spectrum_port_fe_r(machine, offset); | |
| 922 | case 0x1f: return spectrum_port_1f_r(machine, offset); | |
| 923 | case 0x7f: return spectrum_port_7f_r(machine, offset); | |
| 924 | case 0xdf: return spectrum_port_df_r(machine, offset); | |
| 925 | } | |
| 926 | logerror("Read from port: %04x\n", offset); | |
| 927 | 927 | |
| 928 | | |
| 928 | | |
| 929 | 929 | } |
| 930 | 930 | |
| 931 | 931 | static WRITE8_HANDLER ( ts2068_port_w ) |
| r1877 | r1878 | |
| 935 | 935 | Port #fb is the Thermal printer port and works exactly as the Sinclair |
| 936 | 936 | Printer - ie not yet emulated. |
| 937 | 937 | */ |
| 938 | switch (offset & 0xff) | |
| 939 | { | |
| 940 | case 0xfe: spectrum_port_fe_w(offset,data); break; | |
| 941 | case 0xf4: ts2068_port_f4_w(offset,data); break; | |
| 942 | case 0xf5: ts2068_port_f5_w(offset,data); break; | |
| 943 | case 0xf6: ts2068_port_f6_w(offset,data); break; | |
| 944 | case 0xff: ts2068_port_ff_w(offset,data); break; | |
| 945 | default: | |
| 946 | logerror("Write %02x to Port: %04x\n", data, offset); | |
| 947 | } | |
| 938 | switch (offset & 0xff) | |
| 939 | { | |
| 940 | case 0xfe: spectrum_port_fe_w(machine, offset,data); break; | |
| 941 | case 0xf4: ts2068_port_f4_w(machine, offset,data); break; | |
| 942 | case 0xf5: ts2068_port_f5_w(machine, offset,data); break; | |
| 943 | case 0xf6: ts2068_port_f6_w(machine, offset,data); break; | |
| 944 | case 0xff: ts2068_port_ff_w(machine, offset,data); break; | |
| 945 | default: | |
| 946 | logerror("Write %02x to Port: %04x\n", data, offset); | |
| 947 | } | |
| 948 | 948 | } |
| 949 | 949 | |
| 950 | 950 | |
| r1877 | r1878 | |
| 970 | 970 | void ts2068_update_memory(void) |
| 971 | 971 | { |
| 972 | 972 | unsigned char *ChosenROM, *ExROM, *DOCK; |
| 973 | read8_handler rh; | |
| 974 | write8_handler wh; | |
| 973 | read8_machine_func rh; | |
| 974 | write8_machine_func wh; | |
| 975 | 975 | |
| 976 | 976 | DOCK = timex_cart_data; |
| 977 | 977 | |
| r1877 | r1878 | |
| 1330 | 1330 | static READ8_HANDLER ( tc2048_port_r ) |
| 1331 | 1331 | { |
| 1332 | 1332 | if ((offset & 1)==0) |
| 1333 | return spectrum_port_fe_r(offset); | |
| 1333 | return spectrum_port_fe_r(machine, offset); | |
| 1334 | 1334 | switch (offset & 0xff) |
| 1335 | 1335 | { |
| 1336 | case 0xff: return ts2068_port_ff_r(offset); | |
| 1337 | case 0x1f: return spectrum_port_1f_r(offset); | |
| 1338 | case 0x7f: return spectrum_port_7f_r(offset); | |
| 1339 | case 0xdf: return spectrum_port_df_r(offset); | |
| 1336 | case 0xff: return ts2068_port_ff_r(machine, offset); | |
| 1337 | case 0x1f: return spectrum_port_1f_r(machine, offset); | |
| 1338 | case 0x7f: return spectrum_port_7f_r(machine, offset); | |
| 1339 | case 0xdf: return spectrum_port_df_r(machine, offset); | |
| 1340 | 1340 | } |
| 1341 | 1341 | |
| 1342 | 1342 | logerror("Read from port: %04x\n", offset); |
| r1877 | r1878 | |
| 1346 | 1346 | static WRITE8_HANDLER ( tc2048_port_w ) |
| 1347 | 1347 | { |
| 1348 | 1348 | if ((offset & 1)==0) |
| 1349 | spectrum_port_fe_w(offset,data); | |
| 1349 | spectrum_port_fe_w(machine, offset,data); | |
| 1350 | 1350 | else if ((offset & 0xff)==0xff) |
| 1351 | tc2048_port_ff_w(offset,data); | |
| 1351 | tc2048_port_ff_w(offset, data); | |
| 1352 | 1352 | else |
| 1353 | 1353 | { |
| 1354 | 1354 | logerror("Write %02x to Port: %04x\n", data, offset); |
| r1877 | r1878 | |
| 1521 | 1521 | { |
| 1522 | 1522 | unsigned char *ChosenROM; |
| 1523 | 1523 | int ROMSelection; |
| 1524 | read8_handler rh; | |
| 1525 | write8_handler wh; | |
| 1524 | read8_machine_func rh; | |
| 1525 | write8_machine_func wh; | |
| 1526 | 1526 | |
| 1527 | 1527 | if (spectrum_128_port_7ffd_data & 8) |
| 1528 | 1528 | { |
| r1877 | r1878 | |
| 1627 | 1627 | { |
| 1628 | 1628 | if ((offset & 1)==0) |
| 1629 | 1629 | { |
| 1630 | return spectrum_port_fe_r(offset); | |
| 1630 | return spectrum_port_fe_r(machine, offset); | |
| 1631 | 1631 | } |
| 1632 | 1632 | |
| 1633 | 1633 | /* KT: the following is not decoded exactly, need to check what |
| r1877 | r1878 | |
| 1636 | 1636 | { |
| 1637 | 1637 | switch ((offset>>8) & 0xff) |
| 1638 | 1638 | { |
| 1639 | case 0xff: return spectrum_128_port_fffd_r(offset); | |
| 1640 | case 0x1f: return spectrum_port_1f_r(offset); | |
| 1641 | case 0x7f: return spectrum_port_7f_r(offset); | |
| 1642 | case 0xdf: return spectrum_port_df_r(offset); | |
| 1639 | case 0xff: return spectrum_128_port_fffd_r(machine, offset); | |
| 1640 | case 0x1f: return spectrum_port_1f_r(machine, offset); | |
| 1641 | case 0x7f: return spectrum_port_7f_r(machine, offset); | |
| 1642 | case 0xdf: return spectrum_port_df_r(machine, offset); | |
| 1643 | 1643 | } |
| 1644 | 1644 | } |
| 1645 | 1645 | #if 0 |
| 1646 | 1646 | switch (offset & 0x0ff) |
| 1647 | 1647 | { |
| 1648 | 1648 | case 0x01f: |
| 1649 | return wd17xx_status_r(offset); | |
| 1649 | return wd17xx_status_r(machine, offset); | |
| 1650 | 1650 | case 0x03f: |
| 1651 | return wd17xx_track_r(offset); | |
| 1651 | return wd17xx_track_r(machine, offset); | |
| 1652 | 1652 | case 0x05f: |
| 1653 | return wd17xx_sector_r(offset); | |
| 1653 | return wd17xx_sector_r(machine, offset); | |
| 1654 | 1654 | case 0x07f: |
| 1655 | return wd17xx_data_r(offset); | |
| 1655 | return wd17xx_data_r(machine, offset); | |
| 1656 | 1656 | case 0x0ff: |
| 1657 | 1657 | return betadisk_status; |
| 1658 | 1658 | } |
| r1877 | r1878 | |
| 1668 | 1668 | static WRITE8_HANDLER(scorpion_port_w) |
| 1669 | 1669 | { |
| 1670 | 1670 | if ((offset & 1)==0) |
| 1671 | spectrum_port_fe_w(offset,data); | |
| 1671 | spectrum_port_fe_w(machine, offset, data); | |
| 1672 | 1672 | |
| 1673 | 1673 | else if ((offset & 2)==0) |
| 1674 | 1674 | { |
| 1675 | 1675 | switch ((offset>>8) & 0xf0) |
| 1676 | 1676 | { |
| 1677 | 1677 | case 0x70: |
| 1678 | scorpion_port_7ffd_w(offset, data); | |
| 1678 | scorpion_port_7ffd_w(machine, offset, data); | |
| 1679 | 1679 | break; |
| 1680 | 1680 | case 0xb0: |
| 1681 | spectrum_128_port_bffd_w(offset, data); | |
| 1681 | spectrum_128_port_bffd_w(machine, offset, data); | |
| 1682 | 1682 | break; |
| 1683 | 1683 | case 0xf0: |
| 1684 | spectrum_128_port_fffd_w(offset, data); | |
| 1684 | spectrum_128_port_fffd_w(machine, offset, data); | |
| 1685 | 1685 | break; |
| 1686 | 1686 | case 0x10: |
| 1687 | scorpion_port_1ffd_w(offset, data); | |
| 1687 | scorpion_port_1ffd_w(machine, offset, data); | |
| 1688 | 1688 | break; |
| 1689 | 1689 | default: |
| 1690 | 1690 | logerror("Write %02x to scorpion port: %04x\n", data, offset); |
| r1877 | r1878 | |
| 1977 | 1977 | MDRV_CPU_ADD_TAG("main", Z80, 3500000) /* 3.5 Mhz */ |
| 1978 | 1978 | MDRV_CPU_PROGRAM_MAP(spectrum_mem, 0) |
| 1979 | 1979 | MDRV_CPU_IO_MAP(spectrum_io, 0) |
| 1980 | MDRV_CPU_VBLANK_INT(spec_interrupt | |
| 1980 | MDRV_CPU_VBLANK_INT("main", spec_interrupt | |
| 1981 | 1981 | MDRV_INTERLEAVE(1) |
| 1982 | 1982 | |
| 1983 | 1983 | MDRV_MACHINE_RESET( spectrum ) |
| r1877 | r1878 | |
|---|---|---|
| 487 | 487 | data = ~kbdlatch; |
| 488 | 488 | |
| 489 | 489 | // watchdog reset |
| 490 | watchdog_reset | |
| 490 | watchdog_reset | |
| 491 | 491 | |
| 492 | 492 | // TONE led & speaker |
| 493 | 493 | led_tone = (~data & 0x80) >> 7; |
| r1877 | r1878 | |
| 541 | 541 | MDRV_CPU_ADD(Z80, 3579500/2) // 1.79 MHz |
| 542 | 542 | MDRV_CPU_PROGRAM_MAP(mpf1_map, 0) |
| 543 | 543 | MDRV_CPU_IO_MAP(mpf1_io_map, 0) |
| 544 | MDRV_CPU_VBLANK_INT(irq0_line_hold | |
| 544 | MDRV_CPU_VBLANK_INT("main", irq0_line_hold | |
| 545 | 545 | |
| 546 | 546 | MDRV_MACHINE_RESET( mpf1 ) |
| 547 | 547 |
| r1877 | r1878 | |
|---|---|---|
| 35 | 35 | ****************************************************************************/ |
| 36 | 36 | |
| 37 | 37 | #include "driver.h" |
| 38 | #include "deprecat.h" | |
| 38 | 39 | #include "sound/astrocde.h" |
| 39 | 40 | #include "includes/astrocde.h" |
| 40 | 41 | #include "devices/cartslot.h" |
| r1877 | r1878 | |
| 46 | 47 | |
| 47 | 48 | static WRITE8_HANDLER( astrocade_soundblock1_w ) |
| 48 | 49 | { |
| 49 | astrocade_sound1_w(offset + 0x18, data); | |
| 50 | astrocade_sound1_w(machine, offset + 0x18, data); | |
| 50 | 51 | } |
| 51 | 52 | |
| 52 | 53 | static ADDRESS_MAP_START( astrocade_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 79 | 80 | AM_RANGE(0x1d, 0x1d) AM_MIRROR(0xff00) AM_READ(input_port_9_r) |
| 80 | 81 | AM_RANGE(0x1e, 0x1e) AM_MIRROR(0xff00) AM_READ(input_port_10_r) |
| 81 | 82 | AM_RANGE(0x1f, 0x1f) AM_MIRROR(0xff00) AM_READ(input_port_11_r) |
| 82 | AM_SPACE(0x18, 0xff) AM_WRITE(astrocade_soundblock1_w) | |
| 83 | 83 | AM_RANGE(0x19, 0x19) AM_MIRROR(0xff00) AM_WRITE(astrocade_magic_expand_color_w) |
| 84 | AM_RANGE(0x18, 0xff) AM_MIRROR(0xff00) AM_WRITE(astrocade_soundblock1_w) | |
| 84 | 85 | ADDRESS_MAP_END |
| 85 | 86 | |
| 86 | 87 | static INPUT_PORTS_START( astrocde ) |
| r1877 | r1878 | |
| 173 | 174 | MDRV_CPU_ADD(Z80, 1789000) /* 1.789 Mhz */ |
| 174 | 175 | MDRV_CPU_PROGRAM_MAP(astrocade_mem, 0) |
| 175 | 176 | MDRV_CPU_IO_MAP(astrocade_io, 0) |
| 176 | MDRV_CPU_VBLANK_INT(astrocade_interrupt,256) | |
| 177 | MDRV_CPU_VBLANK_INT_HACK(astrocade_interrupt, 256) | |
| 177 | 178 | MDRV_INTERLEAVE(1) |
| 178 | 179 | |
| 179 | 180 | /* video hardware */ |
| r1877 | r1878 | |
|---|---|---|
| 235 | 235 | MDRV_CPU_ADD_TAG("main", Z80, 4000000) /* 4 Mhz */ |
| 236 | 236 | MDRV_CPU_PROGRAM_MAP(kaypro_mem, 0) |
| 237 | 237 | MDRV_CPU_IO_MAP(kaypro_io, 0) |
| 238 | MDRV_CPU_VBLANK_INT(kaypro_interrupt | |
| 238 | MDRV_CPU_VBLANK_INT("main", kaypro_interrupt | |
| 239 | 239 | MDRV_INTERLEAVE(4) |
| 240 | 240 | |
| 241 | 241 | MDRV_MACHINE_RESET( kaypro ) |
| r1877 | r1878 | |
|---|---|---|
| 84 | 84 | MDRV_CPU_ADD(R4600BE, 93750000) |
| 85 | 85 | MDRV_CPU_CONFIG(config) |
| 86 | 86 | MDRV_CPU_PROGRAM_MAP(n64_map, 0) |
| 87 | MDRV_CPU_VBLANK_INT( n64_vblank | |
| 87 | MDRV_CPU_VBLANK_INT("main", n64_vblank | |
| 88 | 88 | |
| 89 | 89 | MDRV_CPU_ADD(RSP, 62500000) |
| 90 | 90 | MDRV_CPU_CONFIG(n64_rsp_config) |
| r1877 | r1878 | |
|---|---|---|
| 89 | 89 | |
| 90 | 90 | static void atarist_fdc_dma_transfer(void) |
| 91 | 91 | { |
| 92 | running_machine *machine = Machine; | |
| 92 | 93 | UINT8 *RAM = memory_region(REGION_CPU1); |
| 93 | 94 | |
| 94 | 95 | if ((fdc.mode & ATARIST_FLOPPY_MODE_DMA_DISABLE) == 0) |
| r1877 | r1878 | |
| 97 | 98 | { |
| 98 | 99 | if (fdc.mode & ATARIST_FLOPPY_MODE_WRITE) |
| 99 | 100 | { |
| 100 | wd17xx_data_w(0, RAM[fdc.dmabase]); | |
| 101 | wd17xx_data_w(machine, 0, RAM[fdc.dmabase]); | |
| 101 | 102 | } |
| 102 | 103 | else |
| 103 | 104 | { |
| 104 | RAM[fdc.dmabase] = wd17xx_data_r(0); | |
| 105 | RAM[fdc.dmabase] = wd17xx_data_r(machine, 0); | |
| 105 | 106 | } |
| 106 | 107 | |
| 107 | 108 | fdc.dmabase++; |
| r1877 | r1878 | |
| 164 | 165 | } |
| 165 | 166 | else |
| 166 | 167 | { |
| 167 | return wd17xx_r((fdc.mode & ATARIST_FLOPPY_MODE_ADDRESS_MASK) >> 1); | |
| 168 | return wd17xx_r(machine, (fdc.mode & ATARIST_FLOPPY_MODE_ADDRESS_MASK) >> 1); | |
| 168 | 169 | } |
| 169 | 170 | } |
| 170 | 171 | } |
| r1877 | r1878 | |
| 193 | 194 | } |
| 194 | 195 | else |
| 195 | 196 | { |
| 196 | wd17xx_w((fdc.mode & ATARIST_FLOPPY_MODE_ADDRESS_MASK) >> 1, data); | |
| 197 | wd17xx_w(machine, (fdc.mode & ATARIST_FLOPPY_MODE_ADDRESS_MASK) >> 1, data); | |
| 197 | 198 | } |
| 198 | 199 | } |
| 199 | 200 | } |
| r1877 | r1878 | |
| 754 | 755 | { |
| 755 | 756 | if (ACCESSING_MSB16) |
| 756 | 757 | { |
| 757 | return scc_r(offset); | |
| 758 | return scc_r(machine, offset); | |
| 758 | 759 | } |
| 759 | 760 | else |
| 760 | 761 | { |
| r1877 | r1878 | |
| 766 | 767 | { |
| 767 | 768 | if (ACCESSING_MSB16) |
| 768 | 769 | { |
| 769 | scc_w(offset, data); | |
| 770 | scc_w(machine, offset, data); | |
| 770 | 771 | } |
| 771 | 772 | } |
| 772 | 773 |
| r1877 | r1878 | |
|---|---|---|
| 198 | 198 | */ |
| 199 | 199 | |
| 200 | 200 | #include "driver.h" |
| 201 | #include "deprecat.h" | |
| 201 | 202 | #include "video/v9938.h" |
| 202 | 203 | #include "includes/geneve.h" |
| 203 | 204 | #include "machine/ti99_4x.h" |
| r1877 | r1878 | |
| 450 | 451 | MDRV_CPU_ADD(TMS9995, 12000000) |
| 451 | 452 | MDRV_CPU_PROGRAM_MAP(memmap, 0) |
| 452 | 453 | MDRV_CPU_IO_MAP(readcru, writecru) |
| 453 | MDRV_CPU_VBLANK_INT(geneve_hblank_interrupt, 262) /* 262.5 in 60Hz, 312.5 in 50Hz */ | |
| 454 | MDRV_CPU_VBLANK_INT_HACK(geneve_hblank_interrupt, 262) /* 262.5 in 60Hz, 312.5 in 50Hz */ | |
| 454 | 455 | |
| 455 | 456 | MDRV_MACHINE_START( geneve ) |
| 456 | 457 | MDRV_MACHINE_RESET( geneve ) |
| r1877 | r1878 | |
|---|---|---|
| 557 | 557 | MDRV_CPU_ADD(Z80, XTAL_10_738635MHz/3) |
| 558 | 558 | MDRV_CPU_PROGRAM_MAP(sg1000_map, 0) |
| 559 | 559 | MDRV_CPU_IO_MAP(sg1000_io_map, 0) |
| 560 | MDRV_CPU_VBLANK_INT(sg1000_int | |
| 560 | MDRV_CPU_VBLANK_INT("main", sg1000_int | |
| 561 | 561 | |
| 562 | 562 | MDRV_MACHINE_START( sg1000 ) |
| 563 | 563 | |
| r1877 | r1878 | |
| 578 | 578 | MDRV_CPU_ADD(Z80, XTAL_10_738635MHz/3) |
| 579 | 579 | MDRV_CPU_PROGRAM_MAP(sc3000_map, 0) |
| 580 | 580 | MDRV_CPU_IO_MAP(sc3000_io_map, 0) |
| 581 | MDRV_CPU_VBLANK_INT(sg1000_int | |
| 581 | MDRV_CPU_VBLANK_INT("main", sg1000_int | |
| 582 | 582 | |
| 583 | 583 | MDRV_MACHINE_START( sc3000 ) |
| 584 | 584 | |
| r1877 | r1878 | |
| 599 | 599 | MDRV_CPU_ADD(Z80, XTAL_10_738635MHz/3) |
| 600 | 600 | MDRV_CPU_PROGRAM_MAP(sf7000_map, 0) |
| 601 | 601 | MDRV_CPU_IO_MAP(sf7000_io_map, 0) |
| 602 | MDRV_CPU_VBLANK_INT(sg1000_int | |
| 602 | MDRV_CPU_VBLANK_INT("main", sg1000_int | |
| 603 | 603 | |
| 604 | 604 | MDRV_MACHINE_START( sf7000 ) |
| 605 | 605 | MDRV_MACHINE_RESET( sf7000 ) |
| r1877 | r1878 | |
|---|---|---|
| 331 | 331 | MDRV_CPU_CONFIG(tx0_reset_param) |
| 332 | 332 | MDRV_CPU_PROGRAM_MAP(tx0_64kw_map, 0) |
| 333 | 333 | /* dummy interrupt: handles input */ |
| 334 | MDRV_CPU_VBLANK_INT(tx0_interrupt | |
| 334 | MDRV_CPU_VBLANK_INT("main", tx0_interrupt | |
| 335 | 335 | |
| 336 | 336 | MDRV_MACHINE_START( tx0 ) |
| 337 | 337 | MDRV_MACHINE_RESET( tx0 ) |
| r1877 | r1878 | |
|---|---|---|
| 149 | 149 | static UINT32 nIOC_ParReadCnt; |
| 150 | 150 | |
| 151 | 151 | // raise a local0 interrupt |
| 152 | static void int3_raise_local0_irq(UINT8 source_mask) | |
| 152 | static void int3_raise_local0_irq(running_machine *machine, UINT8 source_mask) | |
| 153 | 153 | { |
| 154 | 154 | // signal the interrupt is pending |
| 155 | 155 | int3_regs[0] |= source_mask; |
| r1877 | r1878 | |
| 157 | 157 | // if it's not masked, also assert it now at the CPU |
| 158 | 158 | if (int3_regs[1] & source_mask) |
| 159 | 159 | { |
| 160 | cpunum_set_input_line( | |
| 160 | cpunum_set_input_line(machine, 0, MIPS3_IRQ0, ASSERT_LINE); | |
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | |
| r1877 | r1878 | |
| 194 | 194 | switch( offset ) |
| 195 | 195 | { |
| 196 | 196 | case 0x004/4: |
| 197 | ret8 = pc_parallelport0_r(2) ^ 0x0d; | |
| 197 | ret8 = pc_parallelport0_r(machine, 2) ^ 0x0d; | |
| 198 | 198 | verboselog( 0, "Parallel Control Read: %02x\n", ret8 ); |
| 199 | 199 | return ret8; |
| 200 | 200 | break; |
| r1877 | r1878 | |
| 205 | 205 | // } |
| 206 | 206 | // else |
| 207 | 207 | // { |
| 208 | ret8 = pc_parallelport0_r(1) ^ 0x80; | |
| 208 | ret8 = pc_parallelport0_r(machine, 1) ^ 0x80; | |
| 209 | 209 | // nIOC_ParReadCnt++; |
| 210 | 210 | // } |
| 211 | 211 | verboselog( 0, "Parallel Status Read: %02x\n", ret8 ); |
| r1877 | r1878 | |
| 230 | 230 | return 0x00000004; |
| 231 | 231 | break; |
| 232 | 232 | case 0x40/4: |
| 233 | return kbdc8042_8_r(0); | |
| 233 | return kbdc8042_8_r(machine, 0); | |
| 234 | 234 | break; |
| 235 | 235 | case 0x44/4: |
| 236 | return kbdc8042_8_r(4); | |
| 236 | return kbdc8042_8_r(machine, 4); | |
| 237 | 237 | break; |
| 238 | 238 | case 0x58/4: |
| 239 | 239 | return 0x20; // chip rev 1, board rev 0, "Guinness" (Indy) => 0x01 for "Full House" (Indigo2) |
| r1877 | r1878 | |
| 254 | 254 | return int3_regs[offset-0x80/4]; |
| 255 | 255 | break; |
| 256 | 256 | case 0xb0/4: |
| 257 | ret8 = pit8253_0_r(0); | |
| 257 | ret8 = pit8253_0_r(machine, 0); | |
| 258 | 258 | verboselog( 0, "HPC PBUS6 IOC4 Timer Counter 0 Register Read: 0x%02x (%08x)\n", ret8, mem_mask ); |
| 259 | 259 | return ret8; |
| 260 | 260 | break; |
| 261 | 261 | case 0xb4/4: |
| 262 | ret8 = pit8253_0_r(1); | |
| 262 | ret8 = pit8253_0_r(machine, 1); | |
| 263 | 263 | verboselog( 0, "HPC PBUS6 IOC4 Timer Counter 1 Register Read: 0x%02x (%08x)\n", ret8, mem_mask ); |
| 264 | 264 | return ret8; |
| 265 | 265 | break; |
| 266 | 266 | case 0xb8/4: |
| 267 | ret8 = pit8253_0_r(2); | |
| 267 | ret8 = pit8253_0_r(machine, 2); | |
| 268 | 268 | verboselog( 0, "HPC PBUS6 IOC4 Timer Counter 2 Register Read: 0x%02x (%08x)\n", ret8, mem_mask ); |
| 269 | 269 | return ret8; |
| 270 | 270 | break; |
| 271 | 271 | case 0xbc/4: |
| 272 | ret8 = pit8253_0_r(3); | |
| 272 | ret8 = pit8253_0_r(machine, 3); | |
| 273 | 273 | verboselog( 0, "HPC PBUS6 IOC4 Timer Control Word Register Read: 0x%02x (%08x)\n", ret8, mem_mask ); |
| 274 | 274 | return ret8; |
| 275 | 275 | break; |
| r1877 | r1878 | |
| 288 | 288 | { |
| 289 | 289 | case 0x004/4: |
| 290 | 290 | verboselog( 0, "Parallel Control Write: %08x\n", data ); |
| 291 | pc_parallelport0_w(2, data ^ 0x0d); | |
| 291 | pc_parallelport0_w(machine, 2, data ^ 0x0d); | |
| 292 | 292 | // nIOC_ParCntl = data; |
| 293 | 293 | break; |
| 294 | 294 | case 0x030/4: |
| r1877 | r1878 | |
| 322 | 322 | } |
| 323 | 323 | break; |
| 324 | 324 | case 0x40/4: |
| 325 | kbdc8042_8_w(0, data); | |
| 325 | kbdc8042_8_w(machine, 0, data); | |
| 326 | 326 | break; |
| 327 | 327 | case 0x44/4: |
| 328 | kbdc8042_8_w(4, data); | |
| 328 | kbdc8042_8_w(machine, 4, data); | |
| 329 | 329 | break; |
| 330 | 330 | case 0x80/4: |
| 331 | 331 | case 0x84/4: |
| r1877 | r1878 | |
| 343 | 343 | // if no local0 interrupts now, clear the input to the CPU |
| 344 | 344 | if ((int3_regs[0] & int3_regs[1]) == 0) |
| 345 | 345 | { |
| 346 | cpunum_set_input_line( | |
| 346 | cpunum_set_input_line(machine, 0, MIPS3_IRQ0, CLEAR_LINE); | |
| 347 | 347 | } |
| 348 | 348 | else |
| 349 | 349 | { |
| 350 | cpunum_set_input_line( | |
| 350 | cpunum_set_input_line(machine, 0, MIPS3_IRQ0, ASSERT_LINE); | |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | // if no local1 interrupts now, clear the input to the CPU |
| 354 | 354 | if ((int3_regs[2] & int3_regs[3]) == 0) |
| 355 | 355 | { |
| 356 | cpunum_set_input_line( | |
| 356 | cpunum_set_input_line(machine, 0, MIPS3_IRQ1, CLEAR_LINE); | |
| 357 | 357 | } |
| 358 | 358 | else |
| 359 | 359 | { |
| 360 | cpunum_set_input_line( | |
| 360 | cpunum_set_input_line(machine, 0, MIPS3_IRQ1, ASSERT_LINE); | |
| 361 | 361 | } |
| 362 | 362 | break; |
| 363 | 363 | case 0xb0/4: |
| 364 | 364 | verboselog( 0, "HPC PBUS6 IOC4 Timer Counter 0 Register Write: 0x%08x (%08x)\n", data, mem_mask ); |
| 365 | pit8253_0_w(0, data & 0x000000ff); | |
| 365 | pit8253_0_w(machine, 0, data & 0x000000ff); | |
| 366 | 366 | return; |
| 367 | 367 | break; |
| 368 | 368 | case 0xb4/4: |
| 369 | 369 | verboselog( 0, "HPC PBUS6 IOC4 Timer Counter 1 Register Write: 0x%08x (%08x)\n", data, mem_mask ); |
| 370 | pit8253_0_w(1, data & 0x000000ff); | |
| 370 | pit8253_0_w(machine, 1, data & 0x000000ff); | |
| 371 | 371 | return; |
| 372 | 372 | break; |
| 373 | 373 | case 0xb8/4: |
| 374 | 374 | verboselog( 0, "HPC PBUS6 IOC4 Timer Counter 2 Register Write: 0x%08x (%08x)\n", data, mem_mask ); |
| 375 | pit8253_0_w(2, data & 0x000000ff); | |
| 375 | pit8253_0_w(machine, 2, data & 0x000000ff); | |
| 376 | 376 | return; |
| 377 | 377 | break; |
| 378 | 378 | case 0xbc/4: |
| 379 | 379 | verboselog( 0, "HPC PBUS6 IOC4 Timer Control Word Register Write: 0x%08x (%08x)\n", data, mem_mask ); |
| 380 | pit8253_0_w(3, data & 0x000000ff); | |
| 380 | pit8253_0_w(machine, 3, data & 0x000000ff); | |
| 381 | 381 | return; |
| 382 | 382 | break; |
| 383 | 383 | default: |
| r1877 | r1878 | |
| 455 | 455 | // verboselog( 2, "HPC3 HD0 Status Read: %08x (%08x): %08x\n", 0x1fb90000 + ( offset << 2), mem_mask, nHPC3_hd0_regs[0x17] ); |
| 456 | 456 | if (!(mem_mask & 0x000000ff)) |
| 457 | 457 | { |
| 458 | return wd33c93_r( 0 ); | |
| 458 | return wd33c93_r( machine, 0 ); | |
| 459 | 459 | } |
| 460 | 460 | else |
| 461 | 461 | { |
| r1877 | r1878 | |
| 467 | 467 | // verboselog( 2, "HPC3 HD0 Register Read: %08x (%08x): %08x\n", 0x1fb90000 + ( offset << 2), mem_mask, nHPC3_hd0_regs[nHPC3_hd0_register] ); |
| 468 | 468 | if (!(mem_mask & 0x000000ff)) |
| 469 | 469 | { |
| 470 | return wd33c93_r( 1 ); | |
| 470 | return wd33c93_r( machine, 1 ); | |
| 471 | 471 | } |
| 472 | 472 | else |
| 473 | 473 | { |
| r1877 | r1878 | |
| 491 | 491 | // verboselog( 2, "HPC3 HD0 Register Select Write: %08x\n", data ); |
| 492 | 492 | if (!(mem_mask & 0x000000ff)) |
| 493 | 493 | { |
| 494 | wd33c93_w( 0, data & 0x000000ff ); | |
| 494 | wd33c93_w( machine, 0, data & 0x000000ff ); | |
| 495 | 495 | } |
| 496 | 496 | break; |
| 497 | 497 | case 0x0004/4: |
| r1877 | r1878 | |
| 499 | 499 | // verboselog( 2, "HPC3 HD0 Register %d Write: %08x\n", nHPC3_hd0_register, data ); |
| 500 | 500 | if (!(mem_mask & 0x000000ff)) |
| 501 | 501 | { |
| 502 | wd33c93_w( 1, data & 0x000000ff ); | |
| 502 | wd33c93_w( machine, 1, data & 0x000000ff ); | |
| 503 | 503 | } |
| 504 | 504 | break; |
| 505 | 505 | default: |
| r1877 | r1878 | |
| 919 | 919 | static WRITE32_HANDLER( ip22_write_ram ) |
| 920 | 920 | { |
| 921 | 921 | // if banks 2 or 3 are enabled, do nothing, we don't support that much memory |
| 922 | if (mc_r(0xc8/4, 0xffffffff) & 0x10001000) | |
| 922 | if (mc_r(machine, 0xc8/4, 0xffffffff) & 0x10001000) | |
| 923 | 923 | { |
| 924 | 924 | // a random perturbation so the memory test fails |
| 925 | 925 | data ^= 0xffffffff; |
| 926 | 926 | } |
| 927 | 927 | |
| 928 | 928 | // if banks 0 or 1 have 2 subbanks, also kill it, we only want 128 MB |
| 929 | if (mc_r(0xc0/4, 0xffffffff) & 0x40004000) | |
| 929 | if (mc_r(machine, 0xc0/4, 0xffffffff) & 0x40004000) | |
| 930 | 930 | { |
| 931 | 931 | // a random perturbation so the memory test fails |
| 932 | 932 | data ^= 0xffffffff; |
| r1877 | r1878 | |
| 1277 | 1277 | |
| 1278 | 1278 | static void scsi_irq(int state) |
| 1279 | 1279 | { |
| 1280 | running_machine *machine = Machine; | |
| 1281 | ||
| 1280 | 1282 | if (state) |
| 1281 | 1283 | { |
| 1282 | 1284 | if (wd33c93_get_dma_count()) |
| r1877 | r1878 | |
| 1416 | 1418 | nHPC_SCSI0DMACtrl &= ~HPC3_DMACTRL_ENABLE; |
| 1417 | 1419 | |
| 1418 | 1420 | // set the interrupt |
| 1419 | int3_raise_local0_irq(INT3_LOCAL0_SCSI0); | |
| 1421 | int3_raise_local0_irq(machine, INT3_LOCAL0_SCSI0); | |
| 1420 | 1422 | } |
| 1421 | 1423 | else |
| 1422 | 1424 | { |
| r1877 | r1878 | |
| 1581 | 1583 | MDRV_CPU_ADD_TAG( "main", R5000BE, 50000000*3 ) |
| 1582 | 1584 | MDRV_CPU_CONFIG( config ) |
| 1583 | 1585 | MDRV_CPU_PROGRAM_MAP( ip225015_map, 0 ) |
| 1584 | MDRV_CPU_VBLANK_INT( ip22_vbl | |
| 1586 | MDRV_CPU_VBLANK_INT("main", ip22_vbl | |
| 1585 | 1587 | |
| 1586 | 1588 | MDRV_MACHINE_RESET( ip225015 ) |
| 1587 | 1589 | MDRV_NVRAM_HANDLER( ip22 ) |
| r1877 | r1878 | |
|---|---|---|
| 1170 | 1170 | MDRV_CPU_ADD_TAG("main", Z80, VIC6567_CLOCK) |
| 1171 | 1171 | MDRV_CPU_PROGRAM_MAP( c128_z80_mem, 0 ) |
| 1172 | 1172 | MDRV_CPU_IO_MAP( c128_z80_io, 0 ) |
| 1173 | MDRV_CPU_VBLANK_INT(c64_frame_interrupt | |
| 1173 | MDRV_CPU_VBLANK_INT("main", c64_frame_interrupt | |
| 1174 | 1174 | MDRV_CPU_PERIODIC_INT(vic2_raster_irq, VIC2_HRETRACERATE) |
| 1175 | 1175 | |
| 1176 | 1176 | MDRV_CPU_ADD_TAG("m8502", M8502, VIC6567_CLOCK) |
| 1177 | 1177 | MDRV_CPU_PROGRAM_MAP( c128_mem, 0 ) |
| 1178 | MDRV_CPU_VBLANK_INT(c64_frame_interrupt | |
| 1178 | MDRV_CPU_VBLANK_INT("main", c64_frame_interrupt | |
| 1179 | 1179 | MDRV_CPU_PERIODIC_INT(vic2_raster_irq, VIC2_HRETRACERATE) |
| 1180 | 1180 | |
| 1181 | 1181 | MDRV_INTERLEAVE(0) |
| r1877 | r1878 | |
|---|---|---|
| 274 | 274 | serial_connection_init(&cassette_serial_connection); |
| 275 | 275 | serial_connection_set_in_callback(&cassette_serial_connection, cassette_serial_in); |
| 276 | 276 | |
| 277 | exidy_fe_port_w(0,0); | |
| 277 | exidy_fe_port_w(machine, 0, 0); | |
| 278 | 278 | |
| 279 | 279 | timer_set(attotime_zero, NULL, 0, exidy_reset_timer_callback); |
| 280 | 280 | |
| r1877 | r1878 | |
| 303 | 303 | serial_connection_init(&cassette_serial_connection); |
| 304 | 304 | serial_connection_set_in_callback(&cassette_serial_connection, cassette_serial_in); |
| 305 | 305 | |
| 306 | exidy_fe_port_w(0,0); | |
| 306 | exidy_fe_port_w(machine, 0, 0); | |
| 307 | 307 | |
| 308 | 308 | timer_set(attotime_zero, NULL, 0, exidy_reset_timer_callback); |
| 309 | 309 | |
| r1877 | r1878 | |
| 315 | 315 | switch (offset & 0x03) |
| 316 | 316 | { |
| 317 | 317 | case 0: |
| 318 | return wd17xx_status_r(offset); | |
| 318 | return wd17xx_status_r(machine, offset); | |
| 319 | 319 | case 1: |
| 320 | return wd17xx_track_r(offset); | |
| 320 | return wd17xx_track_r(machine, offset); | |
| 321 | 321 | case 2: |
| 322 | return wd17xx_sector_r(offset); | |
| 322 | return wd17xx_sector_r(machine, offset); | |
| 323 | 323 | case 3: |
| 324 | return wd17xx_data_r(offset); | |
| 324 | return wd17xx_data_r(machine, offset); | |
| 325 | 325 | default: |
| 326 | 326 | break; |
| 327 | 327 | } |
| r1877 | r1878 | |
| 334 | 334 | switch (offset & 0x03) |
| 335 | 335 | { |
| 336 | 336 | case 0: |
| 337 | wd17xx_command_w(offset, data); | |
| 337 | wd17xx_command_w(machine, offset, data); | |
| 338 | 338 | return; |
| 339 | 339 | case 1: |
| 340 | wd17xx_track_w(offset, data); | |
| 340 | wd17xx_track_w(machine, offset, data); | |
| 341 | 341 | return; |
| 342 | 342 | case 2: |
| 343 | wd17xx_sector_w(offset, data); | |
| 343 | wd17xx_sector_w(machine, offset, data); | |
| 344 | 344 | return; |
| 345 | 345 | case 3: |
| 346 | wd17xx_data_w(offset, data); | |
| 346 | wd17xx_data_w(machine, offset, data); | |
| 347 | 347 | return; |
| 348 | 348 | default: |
| 349 | 349 | break; |
| r1877 | r1878 | |
| 377 | 377 | logerror("exidy fc w: %04x %02x\n",offset,data); |
| 378 | 378 | |
| 379 | 379 | hd6402_set_input(HD6402_INPUT_TBRL, HD6402_INPUT_TBRL); |
| 380 | hd6402_data_w(offset,data); | |
| 380 | hd6402_data_w(machine, offset, data); | |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | |
| r1877 | r1878 | |
| 552 | 552 | |
| 553 | 553 | } |
| 554 | 554 | |
| 555 | static | |
| 555 | static | |
| 556 | 556 | { |
| 557 | 557 | int data; |
| 558 | 558 | |
| 559 | 559 | hd6402_set_input(HD6402_INPUT_DRR, HD6402_INPUT_DRR); |
| 560 | data = hd6402_data_r(offset); | |
| 560 | data = hd6402_data_r(machine, offset); | |
| 561 | 561 | |
| 562 | 562 | logerror("exidy fc r: %04x %02x\n",offset,data); |
| 563 | 563 | |
| 564 | 564 | return data; |
| 565 | 565 | } |
| 566 | 566 | |
| 567 | static | |
| 567 | static | |
| 568 | 568 | { |
| 569 | 569 | int data; |
| 570 | 570 | /* set unused bits high */ |
| r1877 | r1878 | |
|---|---|---|
| 507 | 507 | MDRV_CPU_ADD_TAG("main", Z80, 4000000) /* 4 Mhz */ |
| 508 | 508 | MDRV_CPU_PROGRAM_MAP(pc8801_mem, 0) |
| 509 | 509 | MDRV_CPU_IO_MAP(pc88sr_io, 0) |
| 510 | MDRV_CPU_VBLANK_INT(pc8801_interrupt | |
| 510 | MDRV_CPU_VBLANK_INT("main", pc8801_interrupt | |
| 511 | 511 | |
| 512 | 512 | /* sub CPU(5 inch floppy drive) */ |
| 513 | 513 | MDRV_CPU_ADD_TAG("sub", Z80, 4000000) /* 4 Mhz */ |
| 514 | 514 | MDRV_CPU_PROGRAM_MAP(pc8801fd_mem, 0) |
| 515 | 515 | MDRV_CPU_IO_MAP(pc8801fd_io, 0) |
| 516 | MDRV_CPU_VBLANK_INT(pc8801fd_interrupt | |
| 516 | MDRV_CPU_VBLANK_INT("main", pc8801fd_interrupt | |
| 517 | 517 | |
| 518 | 518 | MDRV_INTERLEAVE(5000) |
| 519 | 519 |
| r1877 | r1878 | |
|---|---|---|
| 204 | 204 | MDRV_CPU_ADD(Z80, 2500000) |
| 205 | 205 | MDRV_CPU_PROGRAM_MAP(p2000t_mem, 0) |
| 206 | 206 | MDRV_CPU_IO_MAP(p2000t_io, 0) |
| 207 | MDRV_CPU_VBLANK_INT(p2000_interrupt | |
| 207 | MDRV_CPU_VBLANK_INT("main", p2000_interrupt | |
| 208 | 208 | |
| 209 | 209 | /* video hardware */ |
| 210 | 210 | MDRV_IMPORT_FROM( vh_saa5050 ) |
| r1877 | r1878 | |
| 222 | 222 | MDRV_CPU_ADD(Z80, 2500000) |
| 223 | 223 | MDRV_CPU_PROGRAM_MAP(p2000m_mem, 0) |
| 224 | 224 | MDRV_CPU_IO_MAP(p2000t_io, 0) |
| 225 | MDRV_CPU_VBLANK_INT(p2000_interrupt | |
| 225 | MDRV_CPU_VBLANK_INT("main", p2000_interrupt | |
| 226 | 226 | MDRV_INTERLEAVE(1) |
| 227 | 227 | |
| 228 | 228 | /* video hardware */ |
| r1877 | r1878 | |
|---|---|---|
| 143 | 143 | AM_RANGE(0xe810, 0xe813) AM_READWRITE(pia_0_r, pia_0_w) |
| 144 | 144 | AM_RANGE(0xe820, 0xe823) AM_READWRITE(pia_1_r, pia_1_w) |
| 145 | 145 | AM_RANGE(0xe840, 0xe84f) AM_READWRITE(via_0_r, via_0_w) |
| 146 | AM_RANGE(0xe880, 0xe880) AM_WRITE( pet_mc6845_address_w ) | |
| 147 | AM_RANGE(0xe881, 0xe881) AM_READWRITE(pet_mc6845_register_r, pet_mc6845_register_w) | |
| 146 | AM_RANGE(0xe880, 0xe880) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 147 | AM_RANGE(0xe881, 0xe881) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 148 | 148 | AM_RANGE(0xf000, 0xffff) AM_ROM |
| 149 | 149 | ADDRESS_MAP_END |
| 150 | 150 | |
| r1877 | r1878 | |
| 160 | 160 | AM_RANGE(0xe810, 0xe813) AM_READWRITE(pia_0_r, pia_0_w) |
| 161 | 161 | AM_RANGE(0xe820, 0xe823) AM_READWRITE(pia_1_r, pia_1_w) |
| 162 | 162 | AM_RANGE(0xe840, 0xe84f) AM_READWRITE(via_0_r, via_0_w) |
| 163 | AM_RANGE(0xe880, 0xe880) AM_WRITE( pet_mc6845_address_w ) | |
| 164 | AM_RANGE(0xe881, 0xe881) AM_READWRITE(pet_mc6845_register_r, pet_mc6845_register_w) | |
| 163 | AM_RANGE(0xe880, 0xe880) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 164 | AM_RANGE(0xe881, 0xe881) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 165 | 165 | #endif |
| 166 | 166 | AM_RANGE(0xf000, 0xffff) AM_READ(MRA8_BANK8) |
| 167 | 167 | AM_RANGE(0xf000, 0xffef) AM_WRITE(MWA8_BANK8) |
| r1877 | r1878 | |
| 191 | 191 | AM_RANGE(0xe810, 0xe813) AM_READWRITE(pia_0_r, pia_0_w) |
| 192 | 192 | AM_RANGE(0xe820, 0xe823) AM_READWRITE(pia_1_r, pia_1_w) |
| 193 | 193 | AM_RANGE(0xe840, 0xe84f) AM_READWRITE(via_0_r, via_0_w) |
| 194 | AM_RANGE(0xe880, 0xe880) AM_WRITE(pet_mc6845_address_w) | |
| 195 | AM_RANGE(0xe881, 0xe881) AM_READWRITE(pet_mc6845_register_r, pet_mc6845_register_w) | |
| 194 | AM_RANGE(0xe880, 0xe880) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 195 | AM_RANGE(0xe881, 0xe881) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 196 | 196 | /* 0xefe0, 0xefe3, mos 6702 */ |
| 197 | 197 | /* 0xeff0, 0xeff3, acia6551 */ |
| 198 | 198 | AM_RANGE(0xeff8, 0xefff) AM_READWRITE(superpet_r, superpet_w) |
| r1877 | r1878 | |
| 207 | 207 | AM_RANGE(0xe810, 0xe813) AM_READWRITE(pia_0_r, pia_0_w) |
| 208 | 208 | AM_RANGE(0xe820, 0xe823) AM_READWRITE(pia_1_r, pia_1_w) |
| 209 | 209 | AM_RANGE(0xe840, 0xe84f) AM_READWRITE(via_0_r, via_0_w) |
| 210 | AM_RANGE(0xe880, 0xe880) AM_WRITE(pet_mc6845_address_w) | |
| 211 | AM_RANGE(0xe881, 0xe881) AM_READWRITE(pet_mc6845_register_r, pet_mc6845_register_w) | |
| 210 | AM_RANGE(0xe880, 0xe880) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 211 | AM_RANGE(0xe881, 0xe881) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w) | |
| 212 | 212 | AM_RANGE(0xeff8, 0xefff) AM_READWRITE(superpet_r, superpet_w) |
| 213 | 213 | AM_RANGE(0xf000, 0xffff) AM_ROM |
| 214 | 214 | ADDRESS_MAP_END |
| r1877 | r1878 | |
| 563 | 563 | return 0; |
| 564 | 564 | } |
| 565 | 565 | |
| 566 | READ8_HANDLER( pet_mc6845_register_r ) { | |
| 567 | return mc6845_register_r( mc6845 ); | |
| 568 | } | |
| 569 | ||
| 570 | WRITE8_HANDLER( pet_mc6845_register_w ) { | |
| 571 | mc6845_register_w( mc6845, data ); | |
| 572 | } | |
| 573 | ||
| 574 | WRITE8_HANDLER( pet_mc6845_address_w ) { | |
| 575 | mc6845_address_w( mc6845, data ); | |
| 576 | } | |
| 577 | ||
| 578 | 566 | /* basic 1 */ |
| 579 | 567 | ROM_START (pet) |
| 580 | 568 | ROM_REGION (0x10000, REGION_CPU1, 0) |
| r1877 | r1878 | |
| 832 | 820 | /* basic machine hardware */ |
| 833 | 821 | MDRV_CPU_ADD_TAG("main", M6502, 7833600) /* 7.8336 Mhz */ |
| 834 | 822 | MDRV_CPU_PROGRAM_MAP(pet_mem, 0) |
| 835 | MDRV_CPU_VBLANK_INT(pet_frame_interrupt | |
| 823 | MDRV_CPU_VBLANK_INT("main", pet_frame_interrupt | |
| 836 | 824 | MDRV_INTERLEAVE(0) |
| 837 | 825 | |
| 838 | 826 | MDRV_MACHINE_RESET( pet ) |
| r1877 | r1878 | |
| 908 | 896 | /* m6809 cpu */ |
| 909 | 897 | MDRV_CPU_ADD_TAG("main", M6809, 1000000) |
| 910 | 898 | MDRV_CPU_PROGRAM_MAP(superpet_m6809_mem, 0) |
| 911 | MDRV_CPU_VBLANK_INT(pet_frame_interrupt | |
| 899 | MDRV_CPU_VBLANK_INT("main", pet_frame_interrupt | |
| 912 | 900 | |
| 913 | 901 | MDRV_SCREEN_MODIFY("main") |
| 914 | 902 | MDRV_SCREEN_REFRESH_RATE(50) |
| r1877 | r1878 | |
|---|---|---|
| 712 | 712 | static OPBASE_HANDLER( modeF6_opbase ) |
| 713 | 713 | { |
| 714 | 714 | if ( ( address & 0x1FFF ) >= 0x1FF6 && ( address & 0x1FFF ) <= 0x1FF9 ) { |
| 715 | modeF6_switch_w( ( address & 0x1FFF ) - 0x1FF6, 0 ); | |
| 715 | modeF6_switch_w( machine, ( address & 0x1FFF ) - 0x1FF6, 0 ); | |
| 716 | 716 | } |
| 717 | 717 | return address; |
| 718 | 718 | } |
| r1877 | r1878 | |
| 840 | 840 | /* Because the mame core caches opcode data and doesn't perform reads like normal */ |
| 841 | 841 | /* we have to put in this little hack here to get Suicide Mission to work. */ |
| 842 | 842 | if ( offset != 0xFF8 && ( activecpu_get_pc() & 0x1FFF ) == 0x1FF8 ) { |
| 843 | modeSS_r( 0xFF8 ); | |
| 843 | modeSS_r( machine, 0xFF8 ); | |
| 844 | 844 | } |
| 845 | 845 | return data; |
| 846 | 846 | } |
| r1877 | r1878 | |
| 1011 | 1011 | |
| 1012 | 1012 | */ |
| 1013 | 1013 | |
| 1014 | static opbase_handler FE_old_opbase_handler; | |
| 1014 | static opbase_handler_func FE_old_opbase_handler; | |
| 1015 | 1015 | static int FETimer; |
| 1016 | 1016 | |
| 1017 | 1017 | static OPBASE_HANDLER(modeFE_opbase_handler) |
| r1877 | r1878 | |
| 1159 | 1159 | |
| 1160 | 1160 | for (i = 0; i < count; i++) |
| 1161 | 1161 | { |
| 1162 | static const read8_ | |
| 1162 | static const read8_machin | |
| 1163 | 1163 | { |
| 1164 | 1164 | MRA8_BANK1, |
| 1165 | 1165 | MRA8_BANK2, |
| r1877 | r1878 | |
|---|---|---|
| 274 | 274 | /* restore bank handler across entire block */ |
| 275 | 275 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, |
| 276 | 276 | block * 0x04000 + 0x0000, block * 0x04000 + 0x3fff, 0, 0, |
| 277 | (read8_ | |
| 277 | (read8_machin | |
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | |
| r1877 | r1878 | |
| 646 | 646 | |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | static | |
| 649 | static | |
| 650 | 650 | { |
| 651 | 651 | /* from Jacob Nevins docs. FDC I/O is not fully decoded */ |
| 652 | 652 | if (offset & 1) |
| 653 | 653 | { |
| 654 | return nec765_data_r(0); | |
| 654 | return nec765_data_r(machine, 0); | |
| 655 | 655 | } |
| 656 | 656 | |
| 657 | return nec765_status_r(0); | |
| 657 | return nec765_status_r(machine, 0); | |
| 658 | 658 | } |
| 659 | 659 | |
| 660 | 660 | static WRITE8_HANDLER(pcw_fdc_w) |
| r1877 | r1878 | |
| 662 | 662 | /* from Jacob Nevins docs. FDC I/O is not fully decoded */ |
| 663 | 663 | if (offset & 1) |
| 664 | 664 | { |
| 665 | nec765_data_w(0,data); | |
| 665 | nec765_data_w(machine, 0,data); | |
| 666 | 666 | } |
| 667 | 667 | } |
| 668 | 668 |
| r1877 | r1878 | |
|---|---|---|
| 154 | 154 | static int mk2_read_a(int chip) |
| 155 | 155 | { |
| 156 | 156 | int data=0xff; |
| 157 | int help=input | |
| 157 | int help=readinput | |
| 158 | 158 | |
| 159 | switch (rriot_0_b_r(0)&0x7) { | |
| 159 | switch (rriot_0_b_r(Machine, 0)&0x7) { | |
| 160 | 160 | case 4: |
| 161 | 161 | if (help&0x20) data&=~0x1; //F |
| 162 | 162 | if (help&0x10) data&=~0x2; //E |
| r1877 | r1878 | |
| 165 | 165 | if (help&2) data&=~0x10; // B |
| 166 | 166 | if (help&1) data&=~0x20; // A |
| 167 | 167 | #if 0 |
| 168 | if (input | |
| 168 | if (readinput | |
| 169 | 169 | #endif |
| 170 | 170 | break; |
| 171 | 171 | case 5: |
| 172 | 172 | #if 0 |
| 173 | if (input_port_3_r(0)&2) data&=~0x1; //? | |
| 174 | if (input_port_3_r(0)&4) data&=~0x2; //? | |
| 175 | if (input_port_3_r(0)&8) data&=~0x4; //? | |
| 173 | if (readinputport(3)&2) data&=~0x1; //? | |
| 174 | if (readinputport(3)&4) data&=~0x2; //? | |
| 175 | if (readinputport(3)&8) data&=~0x4; //? | |
| 176 | 176 | #endif |
| 177 | if (input_port_0_r(0)&4) data&=~0x8; // Enter | |
| 178 | if (input_port_0_r(0)&2) data&=~0x10; // Clear | |
| 177 | if (readinputport(0)&4) data&=~0x8; // Enter | |
| 178 | if (readinputport(0)&2) data&=~0x10; // Clear | |
| 179 | 179 | if (help&0x80) data&=~0x20; // H |
| 180 | 180 | if (help&0x40) data&=~0x40; // G |
| 181 | 181 | break; |
| r1877 | r1878 | |
| 185 | 185 | |
| 186 | 186 | static void mk2_write_a(int chip, int value) |
| 187 | 187 | { |
| 188 | int temp=rriot_0_b_r(0); | |
| 188 | int temp=rriot_0_b_r(Machine, 0); | |
| 189 | 189 | |
| 190 | 190 | |
| 191 | 191 | switch(temp&0x3) { |
| r1877 | r1878 | |
|---|---|---|
| 688 | 688 | /* basic machine hardware */ |
| 689 | 689 | MDRV_CPU_ADD_TAG("main", M7501, 1400000) /* 7.8336 Mhz */ |
| 690 | 690 | MDRV_CPU_PROGRAM_MAP(c16_readmem, c16_writemem) |
| 691 | MDRV_CPU_VBLANK_INT(c16_frame_interrupt | |
| 691 | MDRV_CPU_VBLANK_INT("main", c16_frame_interrupt | |
| 692 | 692 | MDRV_CPU_PERIODIC_INT(ted7360_raster_interrupt, TED7360_HRETRACERATE) |
| 693 | 693 | MDRV_INTERLEAVE(1) |
| 694 | 694 | |
| r1877 | r1878 | |
| 783 | 783 | MDRV_CPU_PROGRAM_MAP(c364_readmem, c364_writemem) |
| 784 | 784 | MACHINE_DRIVER_END |
| 785 | 785 | |
| 786 | static DRIVER_INIT( c16 ) { c16_driver_init(); } | |
| 786 | static DRIVER_INIT( c16 ) { c16_driver_init(machine); } | |
| 787 | 787 | #ifdef UNUSED_FUNCTION |
| 788 | DRIVER_INIT( c16hun ) { c16_driver_init(); } | |
| 789 | DRIVER_INIT( c16c ) { c16_driver_init(); } | |
| 790 | DRIVER_INIT( c16v ) { c16_driver_init(); } | |
| 788 | DRIVER_INIT( c16hun ) { c16_driver_init(machine); } | |
| 789 | DRIVER_INIT( c16c ) { c16_driver_init(machine); } | |
| 790 | DRIVER_INIT( c16v ) { c16_driver_init(machine); } | |
| 791 | 791 | #endif |
| 792 | static DRIVER_INIT( plus4 ) { c16_driver_init(); } | |
| 792 | static DRIVER_INIT( plus4 ) { c16_driver_init(machine); } | |
| 793 | 793 | #ifdef UNUSED_FUNCTION |
| 794 | DRIVER_INIT( plus4c ) { c16_driver_init(); } | |
| 795 | DRIVER_INIT( plus4v ) { c16_driver_init(); } | |
| 796 | DRIVER_INIT( c364 ) { c16_driver_init(); } | |
| 794 | DRIVER_INIT( plus4c ) { c16_driver_init(machine); } | |
| 795 | DRIVER_INIT( plus4v ) { c16_driver_init(machine); } | |
| 796 | DRIVER_INIT( c364 ) { c16_driver_init(machine); } | |
| 797 | 797 | #endif |
| 798 | 798 | |
| 799 | 799 | static void c16cart_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| r1877 | r1878 | |
|---|---|---|
| 94 | 94 | static WRITE8_HANDLER ( sb2m600b_keyboard_w ) |
| 95 | 95 | { |
| 96 | 96 | key_row_latch = data; |
| 97 | discrete_sound_w(NODE_01, (data >> 2) & 0x0f); | |
| 97 | discrete_sound_w(machine, NODE_01, (data >> 2) & 0x0f); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | static WRITE8_HANDLER ( uk101_keyboard_w ) |
| r1877 | r1878 | |
|---|---|---|
| 120 | 120 | |
| 121 | 121 | static void enterprise_dave_reg_read(int RegIndex) |
| 122 | 122 | { |
| 123 | running_machine *machine = Machine; | |
| 124 | ||
| 123 | 125 | switch (RegIndex) |
| 124 | 126 | { |
| 125 | 127 | case 0x015: |
| 126 | 128 | { |
| 127 | 129 | /* read keyboard line */ |
| 128 | Dave_setreg(0x015, | |
| 130 | Dave_setreg(machine, 0x015, | |
| 129 | 131 | readinputport(Enterprise_KeyboardLine)); |
| 130 | 132 | } |
| 131 | 133 | break; |
| 132 | 134 | |
| 133 | 135 | case 0x016: |
| 134 | 136 | { |
| 135 | int ExternalJoystickInputs; | |
| 136 | int ExternalJoystickPortInput = readinputport(10); | |
| 137 | int ExternalJoystickInputs; | |
| 138 | int ExternalJoystickPortInput = readinputport(10); | |
| 137 | 139 | |
| 138 | if (Enterprise_KeyboardLine<=4) | |
| 139 | { | |
| 140 | ExternalJoystickInputs = ExternalJoystickPortInput>>(4-Enterprise_KeyboardLine); | |
| 141 | } | |
| 142 | else | |
| 143 | { | |
| 144 | ExternalJoystickInputs = 1; | |
| 145 | } | |
| 140 | if (Enterprise_KeyboardLine<=4) | |
| 141 | { | |
| 142 | ExternalJoystickInputs = ExternalJoystickPortInput>>(4-Enterprise_KeyboardLine); | |
| 143 | } | |
| 144 | else | |
| 145 | { | |
| 146 | ExternalJoystickInputs = 1; | |
| 147 | } | |
| 146 | 148 | |
| 147 | | |
| 149 | | |
| 148 | 150 | } |
| 149 | 151 | break; |
| 150 | 152 | |
| r1877 | r1878 | |
| 222 | 224 | |
| 223 | 225 | Dave_SetIFace(&enterprise_dave_interface); |
| 224 | 226 | |
| 225 | Dave_reg_w(0x010,0); | |
| 226 | Dave_reg_w(0x011,0); | |
| 227 | Dave_reg_w(0x012,0); | |
| 228 | Dave_reg_w(0x013,0); | |
| 227 | Dave_reg_w(machine, 0x010,0); | |
| 228 | Dave_reg_w(machine, 0x011,0); | |
| 229 | Dave_reg_w(machine, 0x012,0); | |
| 230 | Dave_reg_w(machine, 0x013,0); | |
| 229 | 231 | |
| 230 | 232 | cpunum_set_input_line_vector(0,0,0x0ff); |
| 231 | 233 | |
| r1877 | r1878 | |
| 243 | 245 | switch (offset & 0x03) |
| 244 | 246 | { |
| 245 | 247 | case 0: |
| 246 | return wd17xx_status_r(offset); | |
| 248 | return wd17xx_status_r(machine, offset); | |
| 247 | 249 | case 1: |
| 248 | return wd17xx_track_r(offset); | |
| 250 | return wd17xx_track_r(machine, offset); | |
| 249 | 251 | case 2: |
| 250 | return wd17xx_sector_r(offset); | |
| 252 | return wd17xx_sector_r(machine, offset); | |
| 251 | 253 | case 3: |
| 252 | return wd17xx_data_r(offset); | |
| 254 | return wd17xx_data_r(machine, offset); | |
| 253 | 255 | default: |
| 254 | 256 | break; |
| 255 | 257 | } |
| r1877 | r1878 | |
| 262 | 264 | switch (offset & 0x03) |
| 263 | 265 | { |
| 264 | 266 | case 0: |
| 265 | wd17xx_command_w(offset, data); | |
| 267 | wd17xx_command_w(machine, offset, data); | |
| 266 | 268 | return; |
| 267 | 269 | case 1: |
| 268 | wd17xx_track_w(offset, data); | |
| 270 | wd17xx_track_w(machine, offset, data); | |
| 269 | 271 | return; |
| 270 | 272 | case 2: |
| 271 | wd17xx_sector_w(offset, data); | |
| 273 | wd17xx_sector_w(machine, offset, data); | |
| 272 | 274 | return; |
| 273 | 275 | case 3: |
| 274 | wd17xx_data_w(offset, data); | |
| 276 | wd17xx_data_w(machine, offset, data); | |
| 275 | 277 | return; |
| 276 | 278 | default: |
| 277 | 279 | break; |
| r1877 | r1878 | |
|---|---|---|
| 104 | 104 | |
| 105 | 105 | static READ8_HANDLER(at_dma8237_1_r) |
| 106 | 106 | { |
| 107 | return dma8237_1_r(offset / 2); | |
| 107 | return dma8237_1_r(machine, offset / 2); | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | static WRITE8_HANDLER(at_dma8237_1_w) |
| 111 | 111 | { |
| 112 | dma8237_1_w(offset / 2, data); | |
| 112 | dma8237_1_w(machine, offset / 2, data); | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | static READ32_HANDLER(at32_dma8237_1_r) |
| 116 | 116 | { |
| 117 | return read32le_with_read8_handler(at_dma8237_1_r, offset, mem_mask); | |
| 117 | return read32le_with_read8_handler(at_dma8237_1_r, machine, offset, mem_mask); | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | static WRITE32_HANDLER(at32_dma8237_1_w) |
| 121 | 121 | { |
| 122 | write32le_with_write8_handler(at_dma8237_1_w, offset, data, mem_mask); | |
| 122 | write32le_with_write8_handler(at_dma8237_1_w, machine, offset, data, mem_mask); | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | |
| r1877 | r1878 | |
| 405 | 405 | |
| 406 | 406 | |
| 407 | 407 | |
| 408 | #define MDRV_CPU_ATPC(mem, port, type, clock | |
| 408 | #define MDRV_CPU_ATPC(mem, port, type, clock | |
| 409 | 409 | MDRV_CPU_ADD_TAG("main", type, clock) \ |
| 410 | 410 | MDRV_CPU_PROGRAM_MAP(mem##_map, 0) \ |
| 411 | 411 | MDRV_CPU_IO_MAP(port##_io, 0) \ |
| 412 | MDRV_CPU_VBLANK_INT(vblankfunc, 4) \ | |
| 413 | 412 | MDRV_CPU_CONFIG(i286_address_mask) |
| 414 | 413 | |
| 415 | 414 | static MACHINE_DRIVER_START( atcga ) |
| 416 | 415 | /* basic machine hardware */ |
| 417 | MDRV_CPU_ATPC(at, at, I80286, 12000000 | |
| 416 | MDRV_CPU_ATPC(at, at, I80286, 12000000 | |
| 418 | 417 | |
| 419 | 418 | MDRV_MACHINE_START( at ) |
| 420 | 419 | MDRV_MACHINE_RESET( at ) |
| r1877 | r1878 | |
| 448 | 447 | |
| 449 | 448 | static MACHINE_DRIVER_START( ps2m30286 ) |
| 450 | 449 | /* basic machine hardware */ |
| 451 | MDRV_CPU_ATPC(at, at, I80286, 12000000 | |
| 450 | MDRV_CPU_ATPC(at, at, I80286, 12000000 | |
| 452 | 451 | |
| 453 | 452 | MDRV_SCREEN_REFRESH_RATE(60) |
| 454 | 453 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| r1877 | r1878 | |
| 478 | 477 | |
| 479 | 478 | static MACHINE_DRIVER_START( atvga ) |
| 480 | 479 | /* basic machine hardware */ |
| 481 | MDRV_CPU_ATPC(at, at, I80286, 12000000 | |
| 480 | MDRV_CPU_ATPC(at, at, I80286, 12000000 | |
| 482 | 481 | |
| 483 | 482 | MDRV_IMPORT_FROM( pcvideo_vga ) |
| 484 | 483 | |
| r1877 | r1878 | |
| 515 | 514 | static MACHINE_DRIVER_START( at386 ) |
| 516 | 515 | /* basic machine hardware */ |
| 517 | 516 | /* original at 6 mhz, at03 8 megahertz */ |
| 518 | MDRV_CPU_ATPC(at386, at386, I386, 12000000 | |
| 517 | MDRV_CPU_ATPC(at386, at386, I386, 12000000 | |
| 519 | 518 | |
| 520 | 519 | MDRV_MACHINE_START( at ) |
| 521 | 520 | MDRV_MACHINE_RESET( at ) |
| r1877 | r1878 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | READ8_HANDLER(coleco_video_r) |
| 65 | 65 | { |
| 66 | return ((offset & 0x01) ? TMS9928A_register_r(1) : TMS9928A_vram_r(0)); | |
| 66 | return ((offset & 0x01) ? TMS9928A_register_r(machine, 1) : TMS9928A_vram_r(machine, 0)); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | WRITE8_HANDLER(coleco_video_w) |
| 70 | 70 | { |
| 71 | (offset & 0x01) ? TMS9928A_register_w(1, data) : TMS9928A_vram_w(0, data); | |
| 71 | (offset & 0x01) ? TMS9928A_register_w(machine, 1, data) : TMS9928A_vram_w(machine, 0, data); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | static ADDRESS_MAP_START( coleco_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1877 | r1878 | |
| 237 | 237 | MDRV_CPU_ADD(Z80, 7159090/2) // 3.579545 MHz |
| 238 | 238 | MDRV_CPU_PROGRAM_MAP(coleco_map, 0) |
| 239 | 239 | MDRV_CPU_IO_MAP(coleco_io_map, 0) |
| 240 | MDRV_CPU_VBLANK_INT(coleco_interrupt | |
| 240 | MDRV_CPU_VBLANK_INT("main", coleco_interrupt | |
| 241 | 241 | |
| 242 | 242 | MDRV_MACHINE_START(coleco) |
| 243 | 243 | MDRV_MACHINE_RESET(coleco) |
| r1877 | r1878 | |
|---|---|---|
| 165 | 165 | |
| 166 | 166 | |
| 167 | 167 | /* The ON LINE switch is directly connected to the INT1 input of the CPU */ |
| 168 | static | |
| 168 | static INPUT_CHANGED( online_switch | |
| 169 | 169 | { |
| 170 | 170 | static int state = ASSERT_LINE; |
| 171 | 171 | |
| 172 | if (newval | |
| 172 | if (newval | |
| 173 | 173 | { |
| 174 | 174 | cpunum_set_input_line(Machine, 0, UPD7810_INTF1, state); |
| 175 | 175 | state = (state == ASSERT_LINE) ? CLEAR_LINE : ASSERT_LINE; |
| r1877 | r1878 | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | |
| 180 | static void feed_switch(void *param, UINT32 oldvalue, UINT32 newvalue) | |
| 181 | { | |
| 182 | ||
| 183 | } | |
| 184 | ||
| 185 | ||
| 186 | static void selectype_switch(void *param, UINT32 oldvalue, UINT32 newvalue) | |
| 187 | { | |
| 188 | ||
| 189 | } | |
| 190 | ||
| 191 | ||
| 192 | static DRIVER_INIT(ex800) | |
| 193 | { | |
| 194 | input_port_set_changed_callback(port_tag_to_index("ONLISW"), 0xff, online_switch, NULL); | |
| 195 | input_port_set_changed_callback(port_tag_to_index("FEED"), 0xff, feed_switch, NULL); | |
| 196 | input_port_set_changed_callback(port_tag_to_index("SelecType"), 0xff, selectype_switch, NULL); | |
| 197 | } | |
| 198 | ||
| 199 | ||
| 200 | 180 | static MACHINE_START(ex800) |
| 201 | 181 | { |
| 202 | 182 | /* Setup beep */ |
| r1877 | r1878 | |
| 361 | 341 | static INPUT_PORTS_START( ex800 ) |
| 362 | 342 | PORT_START_TAG("ONLISW") |
| 363 | 343 | PORT_BIT(0xfe, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 364 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ON LINE") PORT_CODE(KEYCODE_F9) | |
| 344 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ON LINE") PORT_CODE(KEYCODE_F9) PORT_CHANGED(online_switch, NULL) | |
| 365 | 345 | |
| 366 | 346 | PORT_START_TAG("FEED") |
| 367 | 347 | PORT_BIT(0xfc, IP_ACTIVE_LOW, IPT_UNUSED) |
| r1877 | r1878 | |
| 496 | 476 | |
| 497 | 477 | |
| 498 | 478 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 499 | COMP( 1986, ex800, 0, 0, ex800, ex800, | |
| 479 | COMP( 1986, ex800, 0, 0, ex800, ex800, |
| r1877 | r1878 | |
|---|---|---|
| 366 | 366 | |
| 367 | 367 | static WRITE8_HANDLER(apf_wd179x_command_w) |
| 368 | 368 | { |
| 369 | wd17xx_command_w(offset,~data); | |
| 369 | wd17xx_command_w(machine, offset,~data); | |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | static WRITE8_HANDLER(apf_wd179x_track_w) |
| 373 | 373 | { |
| 374 | wd17xx_track_w(offset,~data); | |
| 374 | wd17xx_track_w(machine, offset,~data); | |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | static WRITE8_HANDLER(apf_wd179x_sector_w) |
| 378 | 378 | { |
| 379 | wd17xx_sector_w(offset,~data); | |
| 379 | wd17xx_sector_w(machine, offset,~data); | |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | static WRITE8_HANDLER(apf_wd179x_data_w) |
| 383 | 383 | { |
| 384 | wd17xx_data_w(offset,~data); | |
| 384 | wd17xx_data_w(machine, offset,~data); | |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | static READ8_HANDLER(apf_wd179x_status_r) |
| 388 | 388 | { |
| 389 | return ~wd17xx_status_r(offset); | |
| 389 | return ~wd17xx_status_r(machine, offset); | |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | static READ8_HANDLER(apf_wd179x_track_r) |
| 393 | 393 | { |
| 394 | return ~wd17xx_track_r(offset); | |
| 394 | return ~wd17xx_track_r(machine, offset); | |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | static READ8_HANDLER(apf_wd179x_sector_r) |
| 398 | 398 | { |
| 399 | return ~wd17xx_sector_r(offset); | |
| 399 | return ~wd17xx_sector_r(machine, offset); | |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | static READ8_HANDLER(apf_wd179x_data_r) |
| 403 | 403 | { |
| 404 | return wd17xx_data_r(offset); | |
| 404 | return wd17xx_data_r(machine, offset); | |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | static ADDRESS_MAP_START(apf_imagination_map, ADDRESS_SPACE_PROGRAM, 8) |
| r1877 | r1878 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | static READ8_HANDLER( spc_ram_100_r ) |
| 43 | 43 | { |
| 44 | return spc_ram_r(offset + 0x100); | |
| 44 | return spc_ram_r(machine, offset + 0x100); | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | static WRITE8_HANDLER( spc_ram_100_w ) |
| 48 | 48 | { |
| 49 | spc_ram_w(offset + 0x100, data); | |
| 49 | spc_ram_w(machine, offset + 0x100, data); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | static ADDRESS_MAP_START( spc_map, ADDRESS_SPACE_PROGRAM, 8) |
| r1877 | r1878 | |
| 237 | 237 | static int device_load_snes_cart(mess_image *image) |
| 238 | 238 | { |
| 239 | 239 | int i; |
| 240 | running_machine *machine = Machine; | |
| 240 | 241 | UINT16 totalblocks, readblocks; |
| 241 | 242 | UINT32 offset; |
| 242 | 243 | UINT8 header[512], sample[0xffff]; |
| r1877 | r1878 | |
| 384 | 385 | } |
| 385 | 386 | |
| 386 | 387 | /* Find the amount of sram */ |
| 387 | snes_cart.sram = snes_r_bank1(0x00ffd8); | |
| 388 | snes_cart.sram = snes_r_bank1(machine, 0x00ffd8); | |
| 388 | 389 | if( snes_cart.sram > 0 ) |
| 389 | 390 | { |
| 390 | 391 | snes_cart.sram = ((1 << (snes_cart.sram + 3)) / 8); |
| r1877 | r1878 | |
| 400 | 401 | logerror( "\tTotal blocks: %d (%dmb)\n", totalblocks, totalblocks / (snes_cart.mode == SNES_MODE_20 ? 32 : 16) ); |
| 401 | 402 | logerror( "\tROM bank size: %s (LoROM: %d , HiROM: %d)\n", (snes_cart.mode == SNES_MODE_20) ? "LoROM" : "HiROM", valid_mode20, valid_mode21 ); |
| 402 | 403 | for( i = 0; i < 2; i++ ) |
| 403 | companyid[i] = snes_r_bank1(0x00ffb0 + i); | |
| 404 | companyid[i] = snes_r_bank1(machine, 0x00ffb0 + i); | |
| 404 | 405 | logerror( "\tCompany ID: %s\n", companyid ); |
| 405 | 406 | for( i = 0; i < 4; i++ ) |
| 406 | romid[i] = snes_r_bank1(0x00ffb2 + i); | |
| 407 | romid[i] = snes_r_bank1(machine, 0x00ffb2 + i); | |
| 407 | 408 | logerror( "\tROM ID: %s\n", romid ); |
| 408 | 409 | logerror( "HEADER DETAILS\n" ); |
| 409 | 410 | for( i = 0; i < 21; i++ ) |
| 410 | title[i] = snes_r_bank1(0x00ffc0 + i); | |
| 411 | title[i] = snes_r_bank1(machine, 0x00ffc0 + i); | |
| 411 | 412 | logerror( "\tName: %s\n", title ); |
| 412 | logerror( "\tSpeed: %s [%d]\n", ((snes_r_bank1(0x00ffd5) & 0xf0)) ? "FastROM" : "SlowROM", (snes_r_bank1(0x00ffd5) & 0xf0) >> 4 ); | |
| 413 | logerror( "\tBank size: %s [%d]\n", (snes_r_bank1(0x00ffd5) & 0xf) ? "HiROM" : "LoROM", snes_r_bank1(0x00ffd5) & 0xf ); | |
| 413 | logerror( "\tSpeed: %s [%d]\n", ((snes_r_bank1(machine, 0x00ffd5) & 0xf0)) ? "FastROM" : "SlowROM", (snes_r_bank1(machine, 0x00ffd5) & 0xf0) >> 4 ); | |
| 414 | logerror( "\tBank size: %s [%d]\n", (snes_r_bank1(machine, 0x00ffd5) & 0xf) ? "HiROM" : "LoROM", snes_r_bank1(machine, 0x00ffd5) & 0xf ); | |
| 414 | 415 | for( i = 0; i < 12; i++ ) |
| 415 | 416 | { |
| 416 | if( CartTypes[i].Code == snes_r_bank1(0x00ffd6) ) | |
| 417 | if( CartTypes[i].Code == snes_r_bank1(machine, 0x00ffd6) ) | |
| 417 | 418 | break; |
| 418 | 419 | } |
| 419 | logerror( "\tType: %s [%d]\n", CartTypes[i].Name, snes_r_bank1(0x00ffd6) ); | |
| 420 | logerror( "\tSize: %d megabits [%d]\n", 1 << (snes_r_bank1(0x00ffd7) - 7), snes_r_bank1(0x00ffd7) ); | |
| 420 | logerror( "\tType: %s [%d]\n", CartTypes[i].Name, snes_r_bank1(machine, 0x00ffd6) ); | |
| 421 | logerror( "\tSize: %d megabits [%d]\n", 1 << (snes_r_bank1(machine, 0x00ffd7) - 7), snes_r_bank1(machine, 0x00ffd7) ); | |
| 421 | 422 | logerror( "\tSRAM: %d kilobits [%d]\n", snes_cart.sram * 8, snes_ram[0xffd8] ); |
| 422 | country = snes_r_bank1(0x00ffd9); | |
| 423 | country = snes_r_bank1(machine, 0x00ffd9); | |
| 423 | 424 | if( country > 14 ) |
| 424 | 425 | country = 14; |
| 425 | logerror( "\tCountry: %s [%d]\n", countries[country], snes_r_bank1(0x00ffd9) ); | |
| 426 | logerror( "\tLicense: %s [%X]\n", "", snes_r_bank1(0x00ffda) ); | |
| 427 | logerror( "\tVersion: 1.%d\n", snes_r_bank1(0x00ffdb) ); | |
| 428 | logerror( "\tInv Checksum: %X %X\n", snes_r_bank1(0x00ffdd), snes_r_bank1(0x00ffdc) ); | |
| 429 | logerror( "\tChecksum: %X %X\n", snes_r_bank1(0x00ffdf), snes_r_bank1(0x00ffde) ); | |
| 430 | logerror( "\tNMI Address: %2X%2Xh\n", snes_r_bank1(0x00fffb), snes_r_bank1(0x00fffa) ); | |
| 431 | logerror( "\tStart Address: %2X%2Xh\n", snes_r_bank1(0x00fffd), snes_r_bank1(0x00fffc) ); | |
| 426 | logerror( "\tCountry: %s [%d]\n", countries[country], snes_r_bank1(machine, 0x00ffd9) ); | |
| 427 | logerror( "\tLicense: %s [%X]\n", "", snes_r_bank1(machine, 0x00ffda) ); | |
| 428 | logerror( "\tVersion: 1.%d\n", snes_r_bank1(machine, 0x00ffdb) ); | |
| 429 | logerror( "\tInv Checksum: %X %X\n", snes_r_bank1(machine, 0x00ffdd), snes_r_bank1(machine, 0x00ffdc) ); | |
| 430 | logerror( "\tChecksum: %X %X\n", snes_r_bank1(machine, 0x00ffdf), snes_r_bank1(machine, 0x00ffde) ); | |
| 431 | logerror( "\tNMI Address: %2X%2Xh\n", snes_r_bank1(machine, 0x00fffb), snes_r_bank1(machine, 0x00fffa) ); | |
| 432 | logerror( "\tStart Address: %2X%2Xh\n", snes_r_bank1(machine, 0x00fffd), snes_r_bank1(machine, 0x00fffc) ); | |
| 432 | 433 | } |
| 433 | 434 | |
| 434 | 435 | /* Load SRAM */ |
| r1877 | r1878 | |
| 446 | 447 | |
| 447 | 448 | MDRV_CPU_ADD_TAG("sound", SPC700, 1024000) /* 1.024 Mhz */ |
| 448 | 449 | MDRV_CPU_PROGRAM_MAP(spc_map, 0) |
| 449 | MDRV_CPU_VBLANK_INT(NULL, 0) | |
| 450 | MDRV_CPU_VBLANK_INT_HACK(NULL, 0) | |
| 450 | 451 | |
| 451 | 452 | MDRV_INTERLEAVE(800) |
| 452 | 453 |
| r1877 | r1878 | |
|---|---|---|
| 704 | 704 | /* basic machine hardware */ |
| 705 | 705 | MDRV_CPU_ADD_TAG("main", M6502, VIC6560_CLOCK) /* 7.8336 Mhz */ |
| 706 | 706 | MDRV_CPU_PROGRAM_MAP(vc20_mem, 0) |
| 707 | MDRV_CPU_VBLANK_INT(vc20_frame_interrupt | |
| 707 | MDRV_CPU_VBLANK_INT("main", vc20_frame_interrupt | |
| 708 | 708 | MDRV_CPU_PERIODIC_INT(vic656x_raster_interrupt, VIC656X_HRETRACERATE) |
| 709 | 709 | MDRV_INTERLEAVE(0) |
| 710 | 710 |
| r1877 | r1878 | |
|---|---|---|
| 25 | 25 | #include "includes/electron.h" |
| 26 | 26 | #include "devices/cassette.h" |
| 27 | 27 | #include "formats/uef_cas.h" |
| 28 | #include "deprecat.h" | |
| 28 | 29 | |
| 29 | 30 | static const unsigned short electron_colour_table[8]= |
| 30 | 31 | { |
| r1877 | r1878 | |
| 187 | 188 | static MACHINE_DRIVER_START( electron ) |
| 188 | 189 | MDRV_CPU_ADD_TAG( "main", M6502, 2000000 ) |
| 189 | 190 | MDRV_CPU_PROGRAM_MAP( electron_mem, 0 ) |
| 190 | MDRV_CPU_VBLANK_INT( | |
| 191 | MDRV_CPU_VBLANK_INT_HACK( | |
| 191 | 192 | MDRV_SCREEN_ADD("main", RASTER) |
| 192 | 193 | MDRV_SCREEN_REFRESH_RATE( 50.08 ) |
| 193 | 194 |
| r1877 | r1878 | |
|---|---|---|
| 1848 | 1848 | static READ32_HANDLER( stv_scsp_regs_r32 ) |
| 1849 | 1849 | { |
| 1850 | 1850 | offset <<= 1; |
| 1851 | return (SCSP_0_r(offset+1, 0xffff) | (SCSP_0_r(offset, 0xffff)<<16)); | |
| 1851 | return (SCSP_0_r(machine, offset+1, 0xffff) | (SCSP_0_r(machine, offset, 0xffff)<<16)); | |
| 1852 | 1852 | } |
| 1853 | 1853 | |
| 1854 | 1854 | static WRITE32_HANDLER( stv_scsp_regs_w32 ) |
| 1855 | 1855 | { |
| 1856 | 1856 | offset <<= 1; |
| 1857 | SCSP_0_w(offset, data>>16, mem_mask >> 16); | |
| 1858 | SCSP_0_w(offset+1, data, mem_mask); | |
| 1857 | SCSP_0_w(machine, offset + 0, data >> 16, mem_mask >> 16); | |
| 1858 | SCSP_0_w(machine, offset + 1, data >> 0, mem_mask); | |
| 1859 | 1859 | } |
| 1860 | 1860 | |
| 1861 | 1861 | /* communication,SLAVE CPU acquires data from the MASTER CPU and triggers an irq. * |
| r1877 | r1878 | |
| 2282 | 2282 | /* basic machine hardware */ |
| 2283 | 2283 | MDRV_CPU_ADD(SH2, MASTER_CLOCK_352/2) // 28.6364 MHz |
| 2284 | 2284 | MDRV_CPU_PROGRAM_MAP(saturn_mem, 0) |
| 2285 | MDRV_CPU_VBLANK_INT(stv_interrupt,264)/*264 lines,224 display lines*/ | |
| 2285 | MDRV_CPU_VBLANK_INT_HACK(stv_interrupt, 264)/*264 lines,224 display lines*/ | |
| 2286 | 2286 | MDRV_CPU_CONFIG(sh2_conf_master) |
| 2287 | 2287 | |
| 2288 | 2288 | MDRV_CPU_ADD(SH2, MASTER_CLOCK_352/2) // 28.6364 MHz |
| r1877 | r1878 | |
|---|---|---|
| 909 | 909 | // basic machine hardware |
| 910 | 910 | MDRV_CPU_ADD(M68008, X1/2) |
| 911 | 911 | MDRV_CPU_PROGRAM_MAP(ql_map, 0) |
| 912 | MDRV_CPU_VBLANK_INT(zx8302_int | |
| 912 | MDRV_CPU_VBLANK_INT("main", zx8302_int | |
| 913 | 913 | |
| 914 | 914 | MDRV_CPU_ADD(I8749, X4) |
| 915 | 915 | MDRV_CPU_PROGRAM_MAP(ipc_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 36 | 36 | /*************************************************************************** |
| 37 | 37 | Battery Backed-Up Clock (MSM6264) |
| 38 | 38 | ***************************************************************************/ |
| 39 | static READ16_HANDLER( amiga_clock_r ) { return msm6242_r( offset / 2 ); } | |
| 40 | static WRITE16_HANDLER( amiga_clock_w ) { msm6242_w( offset / 2, data ); } | |
| 39 | static READ16_HANDLER( amiga_clock_r ) { return msm6242_r( machine, offset / 2 ); } | |
| 40 | static WRITE16_HANDLER( amiga_clock_w ) { msm6242_w( machine, offset / 2, data ); } | |
| 41 | 41 | |
| 42 | 42 | /*************************************************************************** |
| 43 | 43 | Address maps |
| r1877 | r1878 | |
| 192 | 192 | /* basic machine hardware */ |
| 193 | 193 | MDRV_CPU_ADD_TAG("main", M68000, AMIGA_68000_NTSC_CLOCK) |
| 194 | 194 | MDRV_CPU_PROGRAM_MAP(amiga_mem, 0) |
| 195 | MDRV_CPU_VBLANK_INT(amiga_scanline_callback, 262) | |
| 196 | 195 | |
| 197 | 196 | MDRV_SCREEN_ADD("main", RASTER) |
| 198 | 197 | MDRV_SCREEN_REFRESH_RATE(59.997) |
| r1877 | r1878 | |
| 245 | 244 | |
| 246 | 245 | /* adjust for PAL specs */ |
| 247 | 246 | MDRV_CPU_REPLACE("main", M68000, AMIGA_68000_PAL_CLOCK) |
| 248 | MDRV_CPU_VBLANK_INT(amiga_scanline_callback, 312) | |
| 249 | 247 | |
| 250 | 248 | MDRV_SCREEN_MODIFY("main") |
| 251 | 249 | MDRV_SCREEN_REFRESH_RATE(50) |
| r1877 | r1878 | |
|---|---|---|
| 94 | 94 | other address bits are ignored. Thus $D010-$D013 is mirrored |
| 95 | 95 | at all $Dxxx addresses with bit 4 high. */ |
| 96 | 96 | AM_RANGE(0xd010, 0xd013) AM_MIRROR(0x0fec) AM_READWRITE(pia_0_r, pia_0_w) |
| 97 | /* $Dxxx addresses with bit 4 low are NOPs. | |
| 98 | (Note this uses AM_SPACE, not AM_RANGE.) */ | |
| 99 | AM_SPACE(0xd000, 0xf010) AM_NOP | |
| 97 | /* $Dxxx addresses with bit 4 low are NOPs. */ | |
| 98 | AM_RANGE(0xd000, 0xd00f) AM_NOP AM_MIRROR(0xfe0) | |
| 100 | 99 | |
| 101 | 100 | /* We always include the remapped RAM for cassette BASIC, both for |
| 102 | 101 | simplicity and to allow the running of BASIC programs. */ |
| r1877 | r1878 | |
|---|---|---|
| 98 | 98 | |
| 99 | 99 | // CRTC |
| 100 | 100 | |
| 101 | static READ8_HANDLER( crtc_register_r ) | |
| 102 | { | |
| 103 | return mc6845_register_r(abc800_mc6845); | |
| 104 | } | |
| 105 | ||
| 106 | static WRITE8_HANDLER( crtc_register_w ) | |
| 107 | { | |
| 108 | mc6845_register_w(abc800_mc6845, data); | |
| 109 | } | |
| 110 | ||
| 111 | static WRITE8_HANDLER( crtc_address_w ) | |
| 112 | { | |
| 113 | mc6845_address_w(abc800_mc6845, data); | |
| 114 | } | |
| 115 | ||
| 116 | 101 | // HR |
| 117 | 102 | |
| 118 | 103 | static WRITE8_HANDLER( hrs_w ) |
| r1877 | r1878 | |
| 268 | 253 | |
| 269 | 254 | if (abc77_keylatch == 1) |
| 270 | 255 | { |
| 271 | watchdog_reset | |
| 256 | watchdog_reset | |
| 272 | 257 | } |
| 273 | 258 | |
| 274 | 259 | // abc77_beep = data & 0x10; |
| r1877 | r1878 | |
| 301 | 286 | AM_RANGE(0x07, 0x07) AM_READWRITE(abcbus_reset_r, hrc_w) |
| 302 | 287 | AM_RANGE(0x20, 0x23) AM_READWRITE(dart_r, dart_w) |
| 303 | 288 | AM_RANGE(0x30, 0x32) AM_WRITE(ram_ctrl_w) |
| 304 | AM_RANGE(0x31, 0x31) AM_READ(crtc_register_r) | |
| 305 | AM_RANGE(0x38, 0x38) AM_WRITE(crtc_address_w) | |
| 306 | AM_RANGE(0x39, 0x39) AM_WRITE(crtc_register_w) | |
| 289 | AM_RANGE(0x31, 0x31) AM_DEVREAD(MC6845, "crtc", mc6845_register_r) | |
| 290 | AM_RANGE(0x38, 0x38) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 291 | AM_RANGE(0x39, 0x39) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 307 | 292 | AM_RANGE(0x40, 0x43) AM_READWRITE(sio2_r, sio2_w) |
| 308 | 293 | AM_RANGE(0x50, 0x53) AM_READWRITE(z80ctc_0_r, z80ctc_0_w) |
| 309 | 294 | AM_RANGE(0x80, 0xff) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w) |
| r1877 | r1878 | |
| 340 | 325 | AM_RANGE(0x06, 0x06) AM_WRITE(hrs_w) |
| 341 | 326 | AM_RANGE(0x07, 0x07) AM_READWRITE(abcbus_reset_r, hrc_w) |
| 342 | 327 | AM_RANGE(0x20, 0x23) AM_READWRITE(dart_r, dart_w) |
| 343 | AM_RANGE(0x31, 0x31) AM_READ(crtc_register_r) | |
| 328 | AM_RANGE(0x31, 0x31) AM_DEVREAD(MC6845, "crtc", mc6845_register_r) | |
| 344 | 329 | AM_RANGE(0x32, 0x35) AM_READWRITE(sio2_r, sio2_w) |
| 345 | AM_RANGE(0x38, 0x38) AM_WRITE(crtc_address_w) | |
| 346 | AM_RANGE(0x39, 0x39) AM_WRITE(crtc_register_w) | |
| 330 | AM_RANGE(0x38, 0x38) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 331 | AM_RANGE(0x39, 0x39) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 347 | 332 | AM_RANGE(0x60, 0x63) AM_READWRITE(z80ctc_0_r, z80ctc_0_w) |
| 348 | 333 | AM_RANGE(0x80, 0xff) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w) |
| 349 | 334 | ADDRESS_MAP_END |
| r1877 | r1878 | |
| 365 | 350 | AM_RANGE(0x06, 0x06) AM_WRITE(hrs_w) |
| 366 | 351 | AM_RANGE(0x07, 0x07) AM_READWRITE(abcbus_reset_r, hrc_w) |
| 367 | 352 | AM_RANGE(0x20, 0x23) AM_READWRITE(dart_r, dart_w) |
| 368 | AM_RANGE(0x31, 0x31) AM_READ(crtc_register_r) | |
| 353 | AM_RANGE(0x31, 0x31) AM_DEVREAD(MC6845, "crtc", mc6845_register_r) | |
| 369 | 354 | AM_RANGE(0x34, 0x34) AM_READWRITE(bankswitch_r, bankswitch_w) |
| 370 | 355 | AM_RANGE(0x35, 0x35) AM_READWRITE(attribute_r, attribute_w) |
| 371 | 356 | AM_RANGE(0x37, 0x37) AM_READWRITE(sync_r, fgctlprom_w) |
| 372 | AM_RANGE(0x38, 0x38) AM_WRITE(crtc_address_w) | |
| 373 | AM_RANGE(0x39, 0x39) AM_WRITE(crtc_register_w) | |
| 357 | AM_RANGE(0x38, 0x38) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) | |
| 358 | AM_RANGE(0x39, 0x39) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) | |
| 374 | 359 | AM_RANGE(0x40, 0x41) AM_READWRITE(sio2_r, sio2_w) |
| 375 | 360 | AM_RANGE(0x60, 0x63) AM_READWRITE(z80ctc_0_r, z80ctc_0_w) |
| 376 | 361 | AM_RANGE(0x80, 0xff) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w) |
| r1877 | r1878 | |
| 720 | 705 | MDRV_CPU_CONFIG(abc800_daisy_chain) |
| 721 | 706 | MDRV_CPU_PROGRAM_MAP(abc802_map, 0) |
| 722 | 707 | MDRV_CPU_IO_MAP(abc802_io_map, 0) |
| 723 | MDRV_CPU_VBLANK_INT(abc802_vblank_interrupt | |
| 708 | MDRV_CPU_VBLANK_INT("main", abc802_vblank_interrupt | |
| 724 | 709 | |
| 725 | 710 | MDRV_CPU_ADD(I8035, 4608000) // 4.608 MHz, keyboard cpu |
| 726 | 711 | MDRV_CPU_PROGRAM_MAP(abc77_map, 0) |
| r1877 | r1878 | |
|---|---|---|
| 352 | 352 | PB7 SN76489 data output |
| 353 | 353 | */ |
| 354 | 354 | |
| 355 | SN76496_0_w(0, data); | |
| 355 | SN76496_0_w(machine, 0, data); | |
| 356 | 356 | |
| 357 | 357 | sn76489_ready = 0; |
| 358 | 358 | |
| r1877 | r1878 | |
| 410 | 410 | // basic machine hardware |
| 411 | 411 | MDRV_CPU_ADD(M6502, 2000000) |
| 412 | 412 | MDRV_CPU_PROGRAM_MAP(crvision_map, 0) |
| 413 | MDRV_CPU_VBLANK_INT(crvision_int | |
| 413 | MDRV_CPU_VBLANK_INT("main", crvision_int | |
| 414 | 414 | |
| 415 | 415 | MDRV_MACHINE_START( crvision ) |
| 416 | 416 | MDRV_MACHINE_RESET( crvision ) |
| r1877 | r1878 | |
|---|---|---|
| 108 | 108 | { |
| 109 | 109 | memory_set_bank(1, data & 0x01); |
| 110 | 110 | |
| 111 | cdp1864_tone_latch_w(0, data); | |
| 111 | cdp1864_tone_latch_w(machine, 0, data); | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /* Memory Maps */ |
| r1877 | r1878 | |
|---|---|---|
| 32 | 32 | #include "formats/pc_dsk.h" |
| 33 | 33 | |
| 34 | 34 | |
| 35 | static READ8_HANDLER(at_dma8237_1_r) { return dma8237_1_r(offset / 2); } | |
| 36 | static WRITE8_HANDLER(at_dma8237_1_w) { dma8237_1_w(offset / 2, data); } | |
| 35 | static READ8_HANDLER(at_dma8237_1_r) { return dma8237_1_r(machine, offset / 2); } | |
| 36 | static WRITE8_HANDLER(at_dma8237_1_w) { dma8237_1_w(machine, offset / 2, data); } | |
| 37 | 37 | |
| 38 | 38 | static READ64_HANDLER( bebox_dma8237_1_r ) |
| 39 | 39 | { |
| 40 | return read64be_with_read8_handler(at_dma8237_1_r, offset, mem_mask); | |
| 40 | return read64be_with_read8_handler(at_dma8237_1_r, machine, offset, mem_mask); | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | static WRITE64_HANDLER( bebox_dma8237_1_w ) |
| 44 | 44 | { |
| 45 | write64be_with_write8_handler(at_dma8237_1_w, offset, data, mem_mask); | |
| 45 | write64be_with_write8_handler(at_dma8237_1_w, machine, offset, data, mem_mask); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | static ADDRESS_MAP_START( bebox_mem, ADDRESS_SPACE_PROGRAM, 64 ) |
| r1877 | r1878 | |
|---|---|---|
| 13 | 13 | ***************************************************************************/ |
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | #include "deprecat.h" | |
| 16 | 17 | #include "cpu/m6502/m6502.h" |
| 17 | 18 | #include "sound/tiaintf.h" |
| 18 | 19 | #include "devices/cartslot.h" |
| r1877 | r1878 | |
| 264 | 265 | MDRV_CPU_ADD_TAG("main", M6502, CLK_NTSC) /* 1.79Mhz (note: The clock switches to 1.19Mhz |
| 265 | 266 | * when the TIA or RIOT are accessed) */ |
| 266 | 267 | MDRV_CPU_PROGRAM_MAP(a7800_mem, 0) |
| 267 | MDRV_CPU_VBLANK_INT(a7800_interrupt,262) | |
| 268 | MDRV_CPU_VBLANK_INT_HACK(a7800_interrupt, 262) | |
| 268 | 269 | |
| 269 | 270 | MDRV_INTERLEAVE(1) |
| 270 | 271 | |
| r1877 | r1878 | |
| 299 | 300 | /* basic machine hardware */ |
| 300 | 301 | MDRV_CPU_REPLACE("main", M6502, CLK_PAL) /* 1.79Mhz (note: The clock switches to 1.19Mhz |
| 301 | 302 | * when the TIA or RIOT are accessed) */ |
| 302 | MDRV_CPU_VBLANK_INT(a7800_interrupt,312) | |
| 303 | MDRV_CPU_VBLANK_INT_HACK(a7800_interrupt, 312) | |
| 303 | 304 | |
| 304 | 305 | MDRV_SCREEN_MODIFY( "main" ) |
| 305 | 306 | MDRV_SCREEN_REFRESH_RATE(50) |
| r1877 | r1878 | |
|---|---|---|
| 217 | 217 | MDRV_CPU_PROGRAM_MAP(gmaster_mem, 0) |
| 218 | 218 | MDRV_CPU_IO_MAP( gmaster_io, 0 ) |
| 219 | 219 | MDRV_CPU_CONFIG( config ) |
| 220 | MDRV_CPU_VBLANK_INT(gmaster_interrupt | |
| 220 | MDRV_CPU_VBLANK_INT("main", gmaster_interrupt | |
| 221 | 221 | |
| 222 | 222 | MDRV_SCREEN_ADD("main", LCD) |
| 223 | 223 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| r1877 | r1878 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | static WRITE8_HANDLER( ins8154_b1_port_a_w ) |
| 36 | 36 | { |
| 37 | ttl74145_0_w(0, data & 0x07); | |
| 37 | ttl74145_0_w(machine, 0, data & 0x07); | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | static WRITE8_HANDLER( acrnsys1_led_segment_w ) |
| r1877 | r1878 | |
|---|---|---|
| 236 | 236 | MDRV_CPU_ADD(Z80, MTX_SYSTEM_CLOCK) |
| 237 | 237 | MDRV_CPU_PROGRAM_MAP(mtx_mem, 0) |
| 238 | 238 | MDRV_CPU_IO_MAP(mtx_io, 0) |
| 239 | MDRV_CPU_VBLANK_INT(mtx_interrupt | |
| 239 | MDRV_CPU_VBLANK_INT("main", mtx_interrupt | |
| 240 | 240 | MDRV_CPU_CONFIG(mtx_daisy_chain) |
| 241 | 241 | |
| 242 | 242 | /* video hardware */ |
| r1877 | r1878 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | /* Components */ |
| 43 | 43 | #include "sound/ay8910.h" |
| 44 | #include "machine/6522via.h" | |
| 45 | #include "machine/6551.h" | |
| 44 | 46 | |
| 45 | 47 | /* Devices */ |
| 46 | 48 | #include "devices/cassette.h" |
| r1877 | r1878 | |
| 53 | 55 | AM_RANGE(0xbc01, 0xbc01) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w) |
| 54 | 56 | AM_RANGE(0xbc02, 0xbc02) AM_WRITE(AY8910_control_port_1_w) |
| 55 | 57 | AM_RANGE(0xbc03, 0xbc03) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w) |
| 56 | AM_RANGE(0xbfc0, 0xbfcf) AM_READWRITE(microtan_via_0_r, microtan_via_0_w) | |
| 57 | AM_RANGE(0xbfd0, 0xbfd3) AM_READWRITE(microtan_sio_r, microtan_sio_w) | |
| 58 | AM_RANGE(0xbfe0, 0xbfef) AM_READWRITE(microtan_via_1_r, microtan_via_1_w) | |
| 58 | AM_RANGE(0xbfc0, 0xbfcf) AM_READWRITE(via_0_r, via_0_w) | |
| 59 | AM_RANGE(0xbfd0, 0xbfd3) AM_READWRITE(acia_6551_r, acia_6551_w) | |
| 60 | AM_RANGE(0xbfe0, 0xbfef) AM_READWRITE(via_1_r, via_1_w) | |
| 59 | 61 | AM_RANGE(0xbff0, 0xbfff) AM_READWRITE(microtan_bffx_r, microtan_bffx_w) |
| 60 | 62 | AM_RANGE(0xc000, 0xe7ff) AM_ROM |
| 61 | 63 | AM_RANGE(0xf000, 0xffff) AM_ROM |
| r1877 | r1878 | |
| 211 | 213 | // basic machine hardware |
| 212 | 214 | MDRV_CPU_ADD_TAG("main", M6502, 750000) // 750 kHz |
| 213 | 215 | MDRV_CPU_PROGRAM_MAP(microtan_map, 0) |
| 214 | MDRV_CPU_VBLANK_INT(microtan_interrupt | |
| 216 | MDRV_CPU_VBLANK_INT("main", microtan_interrupt | |
| 215 | 217 | |
| 216 | 218 | MDRV_MACHINE_RESET(microtan) |
| 217 | 219 |
| r1877 | r1878 | |
|---|---|---|
| 291 | 291 | case 5: |
| 292 | 292 | case 6: |
| 293 | 293 | case 7: |
| 294 | return einstein_80col_ram_r(offset); | |
| 294 | return einstein_80col_ram_r(machine, offset); | |
| 295 | 295 | case 0x0c: |
| 296 | return einstein_80col_state_r(offset); | |
| 296 | return einstein_80col_state_r(machine, offset); | |
| 297 | 297 | default: |
| 298 | 298 | break; |
| 299 | 299 | } |
| r1877 | r1878 | |
| 313 | 313 | case 5: |
| 314 | 314 | case 6: |
| 315 | 315 | case 7: |
| 316 | einstein_80col_ram_w(offset,data); | |
| 316 | einstein_80col_ram_w(machine, offset,data); | |
| 317 | 317 | break; |
| 318 | 318 | case 8: |
| 319 | crtc6845_0_address_w(offset,data); | |
| 319 | crtc6845_0_address_w(machine, offset,data); | |
| 320 | 320 | break; |
| 321 | 321 | case 9: |
| 322 | crtc6845_0_register_w(offset,data); | |
| 322 | crtc6845_0_register_w(machine, offset,data); | |
| 323 | 323 | break; |
| 324 | 324 | default: |
| 325 | 325 | break; |
| r1877 | r1878 | |
| 331 | 331 | einstein_ctc_trigger^=1; |
| 332 | 332 | |
| 333 | 333 | /* channel 0 and 1 have a 2Mhz input clock for triggering */ |
| 334 | z80ctc_0_trg0_w(0,einstein_ctc_trigger); | |
| 335 | z80ctc_0_trg1_w(0,einstein_ctc_trigger); | |
| 334 | z80ctc_0_trg0_w(machine, 0, einstein_ctc_trigger); | |
| 335 | z80ctc_0_trg1_w(machine, 0, einstein_ctc_trigger); | |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | /* refresh keyboard data. It is refreshed when the keyboard line is written */ |
| r1877 | r1878 | |
| 541 | 541 | |
| 542 | 542 | if (offset & 0x01) |
| 543 | 543 | { |
| 544 | return TMS9928A_register_r(offset & 0x01); | |
| 544 | return TMS9928A_register_r(machine, offset & 0x01); | |
| 545 | 545 | } |
| 546 | 546 | |
| 547 | return TMS9928A_vram_r(offset & 0x01); | |
| 547 | return TMS9928A_vram_r(machine, offset & 0x01); | |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | static WRITE8_HANDLER(einstein_vdp_w) |
| r1877 | r1878 | |
| 553 | 553 | |
| 554 | 554 | if (offset & 0x01) |
| 555 | 555 | { |
| 556 | TMS9928A_register_w(offset & 0x01,data); | |
| 556 | TMS9928A_register_w(machine, offset & 0x01,data); | |
| 557 | 557 | return; |
| 558 | 558 | } |
| 559 | 559 | |
| 560 | TMS9928A_vram_w(offset & 0x01,data); | |
| 560 | TMS9928A_vram_w(machine, offset & 0x01,data); | |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | 563 | static WRITE8_HANDLER(einstein_fdc_w) |
| r1877 | r1878 | |
| 570 | 570 | { |
| 571 | 571 | case 0: |
| 572 | 572 | { |
| 573 | wd17xx_command_w(reg, data); | |
| 573 | wd17xx_command_w(machine, reg, data); | |
| 574 | 574 | } |
| 575 | 575 | break; |
| 576 | 576 | |
| 577 | 577 | case 1: |
| 578 | 578 | { |
| 579 | wd17xx_track_w(reg, data); | |
| 579 | wd17xx_track_w(machine, reg, data); | |
| 580 | 580 | } |
| 581 | 581 | break; |
| 582 | 582 | |
| 583 | 583 | case 2: |
| 584 | 584 | { |
| 585 | wd17xx_sector_w(reg, data); | |
| 585 | wd17xx_sector_w(machine, reg, data); | |
| 586 | 586 | } |
| 587 | 587 | break; |
| 588 | 588 | |
| 589 | 589 | case 3: |
| 590 | 590 | { |
| 591 | wd17xx_data_w(reg, data); | |
| 591 | wd17xx_data_w(machine, reg, data); | |
| 592 | 592 | } |
| 593 | 593 | break; |
| 594 | 594 | } |
| r1877 | r1878 | |
| 605 | 605 | { |
| 606 | 606 | case 0: |
| 607 | 607 | { |
| 608 | return wd17xx_status_r(reg); | |
| 608 | return wd17xx_status_r(machine, reg); | |
| 609 | 609 | } |
| 610 | 610 | break; |
| 611 | 611 | |
| 612 | 612 | case 1: |
| 613 | 613 | { |
| 614 | return wd17xx_track_r(reg); | |
| 614 | return wd17xx_track_r(machine, reg); | |
| 615 | 615 | } |
| 616 | 616 | break; |
| 617 | 617 | |
| 618 | 618 | case 2: |
| 619 | 619 | { |
| 620 | return wd17xx_sector_r(reg); | |
| 620 | return wd17xx_sector_r(machine, reg); | |
| 621 | 621 | } |
| 622 | 622 | break; |
| 623 | 623 | |
| 624 | 624 | case 3: |
| 625 | 625 | { |
| 626 | return wd17xx_data_r(reg); | |
| 626 | return wd17xx_data_r(machine, reg); | |
| 627 | 627 | } |
| 628 | 628 | break; |
| 629 | 629 | } |
| r1877 | r1878 | |
| 674 | 674 | { |
| 675 | 675 | logerror("ctc r: %04x\n",offset); |
| 676 | 676 | |
| 677 | return z80ctc_0_r(offset & 0x03); | |
| 677 | return z80ctc_0_r(machine, offset & 0x03); | |
| 678 | 678 | } |
| 679 | 679 | |
| 680 | 680 | static WRITE8_HANDLER(einstein_ctc_w) |
| 681 | 681 | { |
| 682 | 682 | logerror("ctc w: %04x %02x\n",offset,data); |
| 683 | 683 | |
| 684 | z80ctc_0_w(offset & 0x03,data); | |
| 684 | z80ctc_0_w(machine, offset & 0x03,data); | |
| 685 | 685 | } |
| 686 | 686 | |
| 687 | 687 | static WRITE8_HANDLER(einstein_serial_w) |
| r1877 | r1878 | |
| 692 | 692 | |
| 693 | 693 | if ((reg)==0) |
| 694 | 694 | { |
| 695 | msm8251_data_w(reg,data); | |
| 695 | msm8251_data_w(machine, reg,data); | |
| 696 | 696 | return; |
| 697 | 697 | } |
| 698 | 698 | |
| 699 | msm8251_control_w(reg,data); | |
| 699 | msm8251_control_w(machine, reg,data); | |
| 700 | 700 | } |
| 701 | 701 | |
| 702 | 702 | |
| r1877 | r1878 | |
| 708 | 708 | |
| 709 | 709 | if ((reg)==0) |
| 710 | 710 | { |
| 711 | return msm8251_data_r(reg); | |
| 711 | return msm8251_data_r(machine, reg); | |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | return msm8251_status_r(reg); | |
| 714 | return msm8251_status_r(machine, reg); | |
| 715 | 715 | } |
| 716 | 716 | |
| 717 | 717 | /* |
| r1877 | r1878 | |
| 750 | 750 | /* case 0 and 1 are not handled */ |
| 751 | 751 | case 2: |
| 752 | 752 | { |
| 753 | AY8910_control_port_0_w(0, data); | |
| 753 | AY8910_control_port_0_w(machine, 0, data); | |
| 754 | 754 | } |
| 755 | 755 | break; |
| 756 | 756 | |
| 757 | 757 | case 3: |
| 758 | 758 | { |
| 759 | AY8910_write_port_0_w(0, data); | |
| 759 | AY8910_write_port_0_w(machine, 0, data); | |
| 760 | 760 | } |
| 761 | 761 | break; |
| 762 | 762 | |
| r1877 | r1878 | |
| 773 | 773 | { |
| 774 | 774 | /* case 0 and 1 are not handled */ |
| 775 | 775 | case 2: |
| 776 | return AY8910_read_port_0_r(0); | |
| 776 | return AY8910_read_port_0_r(machine, 0); | |
| 777 | 777 | |
| 778 | 778 | default: |
| 779 | 779 | break; |
| r1877 | r1878 | |
| 964 | 964 | } |
| 965 | 965 | |
| 966 | 966 | |
| 967 | static | |
| 967 | static | |
| 968 | 968 | { |
| 969 | 969 | switch (offset & 0x0ff) |
| 970 | 970 | { |
| r1877 | r1878 | |
| 976 | 976 | case 0x05: |
| 977 | 977 | case 0x06: |
| 978 | 978 | case 0x07: |
| 979 | return einstein_psg_r(offset); | |
| 979 | return einstein_psg_r(machine, offset); | |
| 980 | 980 | case 0x08: |
| 981 | 981 | case 0x09: |
| 982 | 982 | case 0x0a: |
| r1877 | r1878 | |
| 985 | 985 | case 0x0d: |
| 986 | 986 | case 0x0e: |
| 987 | 987 | case 0x0f: |
| 988 | return einstein_vdp_r(offset); | |
| 988 | return einstein_vdp_r(machine, offset); | |
| 989 | 989 | case 0x10: |
| 990 | 990 | case 0x11: |
| 991 | 991 | case 0x12: |
| r1877 | r1878 | |
| 994 | 994 | case 0x15: |
| 995 | 995 | case 0x16: |
| 996 | 996 | case 0x17: |
| 997 | return einstein_serial_r(offset); | |
| 997 | return einstein_serial_r(machine, offset); | |
| 998 | 998 | case 0x18: |
| 999 | 999 | case 0x19: |
| 1000 | 1000 | case 0x1a: |
| r1877 | r1878 | |
| 1003 | 1003 | case 0x1d: |
| 1004 | 1004 | case 0x1e: |
| 1005 | 1005 | case 0x1f: |
| 1006 | return einstein_fdc_r(offset); | |
| 1006 | return einstein_fdc_r(machine, offset); | |
| 1007 | 1007 | case 0x20: |
| 1008 | return einstein_key_int_r(offset); | |
| 1008 | return einstein_key_int_r(machine, offset); | |
| 1009 | 1009 | case 0x28: |
| 1010 | 1010 | case 0x29: |
| 1011 | 1011 | case 0x2a: |
| r1877 | r1878 | |
| 1014 | 1014 | case 0x2d: |
| 1015 | 1015 | case 0x2e: |
| 1016 | 1016 | case 0x2f: |
| 1017 | return einstein_ctc_r(offset); | |
| 1017 | return einstein_ctc_r(machine, offset); | |
| 1018 | 1018 | case 0x30: |
| 1019 | 1019 | case 0x31: |
| 1020 | 1020 | case 0x32: |
| r1877 | r1878 | |
| 1023 | 1023 | case 0x35: |
| 1024 | 1024 | case 0x36: |
| 1025 | 1025 | case 0x37: |
| 1026 | return einstein_pio_r(offset); | |
| 1026 | return einstein_pio_r(machine, offset); | |
| 1027 | 1027 | case 0x40: |
| 1028 | 1028 | case 0x41: |
| 1029 | 1029 | case 0x42: |
| r1877 | r1878 | |
| 1040 | 1040 | case 0x4d: |
| 1041 | 1041 | case 0x4e: |
| 1042 | 1042 | case 0x4f: |
| 1043 | return einstein_80col_r(offset); | |
| 1043 | return einstein_80col_r(machine, offset); | |
| 1044 | 1044 | |
| 1045 | 1045 | default: |
| 1046 | 1046 | break; |
| r1877 | r1878 | |
| 1063 | 1063 | case 0x05: |
| 1064 | 1064 | case 0x06: |
| 1065 | 1065 | case 0x07: |
| 1066 | einstein_psg_w(offset,data); | |
| 1066 | einstein_psg_w(machine, offset,data); | |
| 1067 | 1067 | return; |
| 1068 | 1068 | case 0x08: |
| 1069 | 1069 | case 0x09: |
| r1877 | r1878 | |
| 1073 | 1073 | case 0x0d: |
| 1074 | 1074 | case 0x0e: |
| 1075 | 1075 | case 0x0f: |
| 1076 | einstein_vdp_w(offset,data); | |
| 1076 | einstein_vdp_w(machine, offset,data); | |
| 1077 | 1077 | return; |
| 1078 | 1078 | case 0x10: |
| 1079 | 1079 | case 0x11: |
| r1877 | r1878 | |
| 1083 | 1083 | case 0x15: |
| 1084 | 1084 | case 0x16: |
| 1085 | 1085 | case 0x17: |
| 1086 | einstein_serial_w(offset,data); | |
| 1086 | einstein_serial_w(machine, offset,data); | |
| 1087 | 1087 | return; |
| 1088 | 1088 | case 0x18: |
| 1089 | 1089 | case 0x19: |
| r1877 | r1878 | |
| 1093 | 1093 | case 0x1d: |
| 1094 | 1094 | case 0x1e: |
| 1095 | 1095 | case 0x1f: |
| 1096 | einstein_fdc_w(offset,data); | |
| 1096 | einstein_fdc_w(machine, offset,data); | |
| 1097 | 1097 | return; |
| 1098 | 1098 | case 0x20: |
| 1099 | einstein_key_int_w(offset,data); | |
| 1099 | einstein_key_int_w(machine, offset,data); | |
| 1100 | 1100 | return; |
| 1101 | 1101 | case 0x21: |
| 1102 | einstein_adc_int_w(offset,data); | |
| 1102 | einstein_adc_int_w(machine, offset,data); | |
| 1103 | 1103 | return; |
| 1104 | 1104 | case 0x23: |
| 1105 | einstein_drive_w(offset,data); | |
| 1105 | einstein_drive_w(machine, offset,data); | |
| 1106 | 1106 | return; |
| 1107 | 1107 | case 0x24: |
| 1108 | einstein_rom_w(offset,data); | |
| 1108 | einstein_rom_w(machine, offset,data); | |
| 1109 | 1109 | return; |
| 1110 | 1110 | case 0x25: |
| 1111 | einstein_fire_int_w(offset,data); | |
| 1111 | einstein_fire_int_w(machine, offset,data); | |
| 1112 | 1112 | return; |
| 1113 | 1113 | case 0x28: |
| 1114 | 1114 | case 0x29: |
| r1877 | r1878 | |
| 1118 | 1118 | case 0x2d: |
| 1119 | 1119 | case 0x2e: |
| 1120 | 1120 | case 0x2f: |
| 1121 | einstein_ctc_w(offset,data); | |
| 1121 | einstein_ctc_w(machine, offset,data); | |
| 1122 | 1122 | return; |
| 1123 | 1123 | case 0x30: |
| 1124 | 1124 | case 0x31: |
| r1877 | r1878 | |
| 1128 | 1128 | case 0x35: |
| 1129 | 1129 | case 0x36: |
| 1130 | 1130 | case 0x37: |
| 1131 | einstein_pio_w(offset,data); | |
| 1131 | einstein_pio_w(machine, offset,data); | |
| 1132 | 1132 | return; |
| 1133 | 1133 | case 0x40: |
| 1134 | 1134 | case 0x41: |
| r1877 | r1878 | |
| 1146 | 1146 | case 0x4d: |
| 1147 | 1147 | case 0x4e: |
| 1148 | 1148 | case 0x4f: |
| 1149 | einstein_80col_w(offset,data); | |
| 1149 | einstein_80col_w(machine, offset,data); | |
| 1150 | 1150 | return; |
| 1151 | 1151 | |
| 1152 | 1152 | default: |
| r1877 | r1878 | |
| 1169 | 1169 | case 0x05: |
| 1170 | 1170 | case 0x06: |
| 1171 | 1171 | case 0x07: |
| 1172 | return einstein_psg_r(offset); | |
| 1172 | return einstein_psg_r(machine, offset); | |
| 1173 | 1173 | case 0x08: |
| 1174 | 1174 | case 0x09: |
| 1175 | 1175 | case 0x0a: |
| r1877 | r1878 | |
| 1178 | 1178 | case 0x0d: |
| 1179 | 1179 | case 0x0e: |
| 1180 | 1180 | case 0x0f: |
| 1181 | return einstein_vdp_r(offset); | |
| 1181 | return einstein_vdp_r(machine, offset); | |
| 1182 | 1182 | case 0x10: |
| 1183 | 1183 | case 0x11: |
| 1184 | 1184 | case 0x12: |
| r1877 | r1878 | |
| 1187 | 1187 | case 0x15: |
| 1188 | 1188 | case 0x16: |
| 1189 | 1189 | case 0x17: |
| 1190 | return einstein_serial_r(offset); | |
| 1190 | return einstein_serial_r(machine, offset); | |
| 1191 | 1191 | case 0x18: |
| 1192 | 1192 | case 0x19: |
| 1193 | 1193 | case 0x1a: |
| r1877 | r1878 | |
| 1196 | 1196 | case 0x1d: |
| 1197 | 1197 | case 0x1e: |
| 1198 | 1198 | case 0x1f: |
| 1199 | return einstein_fdc_r(offset); | |
| 1199 | return einstein_fdc_r(machine, offset); | |
| 1200 | 1200 | case 0x20: |
| 1201 | return einstein_key_int_r(offset); | |
| 1201 | return einstein_key_int_r(machine, offset); | |
| 1202 | 1202 | case 0x28: |
| 1203 | 1203 | case 0x29: |
| 1204 | 1204 | case 0x2a: |
| r1877 | r1878 | |
| 1207 | 1207 | case 0x2d: |
| 1208 | 1208 | case 0x2e: |
| 1209 | 1209 | case 0x2f: |
| 1210 | return einstein_ctc_r(offset); | |
| 1210 | return einstein_ctc_r(machine, offset); | |
| 1211 | 1211 | case 0x30: |
| 1212 | 1212 | case 0x31: |
| 1213 | 1213 | case 0x32: |
| r1877 | r1878 | |
| 1216 | 1216 | case 0x35: |
| 1217 | 1217 | case 0x36: |
| 1218 | 1218 | case 0x37: |
| 1219 | return einstein_pio_r(offset); | |
| 1219 | return einstein_pio_r(machine, offset); | |
| 1220 | 1220 | |
| 1221 | 1221 | default: |
| 1222 | 1222 | break; |
| r1877 | r1878 | |
| 1239 | 1239 | case 0x05: |
| 1240 | 1240 | case 0x06: |
| 1241 | 1241 | case 0x07: |
| 1242 | einstein_psg_w(offset,data); | |
| 1242 | einstein_psg_w(machine, offset,data); | |
| 1243 | 1243 | return; |
| 1244 | 1244 | case 0x08: |
| 1245 | 1245 | case 0x09: |
| r1877 | r1878 | |
| 1249 | 1249 | case 0x0d: |
| 1250 | 1250 | case 0x0e: |
| 1251 | 1251 | case 0x0f: |
| 1252 | einstein_vdp_w(offset,data); | |
| 1252 | einstein_vdp_w(machine, offset,data); | |
| 1253 | 1253 | return; |
| 1254 | 1254 | case 0x10: |
| 1255 | 1255 | case 0x11: |
| r1877 | r1878 | |
| 1259 | 1259 | case 0x15: |
| 1260 | 1260 | case 0x16: |
| 1261 | 1261 | case 0x17: |
| 1262 | einstein_serial_w(offset,data); | |
| 1262 | einstein_serial_w(machine, offset,data); | |
| 1263 | 1263 | return; |
| 1264 | 1264 | case 0x18: |
| 1265 | 1265 | case 0x19: |
| r1877 | r1878 | |
| 1269 | 1269 | case 0x1d: |
| 1270 | 1270 | case 0x1e: |
| 1271 | 1271 | case 0x1f: |
| 1272 | einstein_fdc_w(offset,data); | |
| 1272 | einstein_fdc_w(machine, offset,data); | |
| 1273 | 1273 | return; |
| 1274 | 1274 | case 0x20: |
| 1275 | einstein_key_int_w(offset,data); | |
| 1275 | einstein_key_int_w(machine, offset,data); | |
| 1276 | 1276 | return; |
| 1277 | 1277 | case 0x21: |
| 1278 | einstein_adc_int_w(offset,data); | |
| 1278 | einstein_adc_int_w(machine, offset,data); | |
| 1279 | 1279 | return; |
| 1280 | 1280 | case 0x23: |
| 1281 | einstein_drive_w(offset,data); | |
| 1281 | einstein_drive_w(machine, offset,data); | |
| 1282 | 1282 | return; |
| 1283 | 1283 | case 0x24: |
| 1284 | einstein_rom_w(offset,data); | |
| 1284 | einstein_rom_w(machine, offset,data); | |
| 1285 | 1285 | return; |
| 1286 | 1286 | case 0x25: |
| 1287 | einstein_fire_int_w(offset,data); | |
| 1287 | einstein_fire_int_w(machine, offset,data); | |
| 1288 | 1288 | return; |
| 1289 | 1289 | case 0x28: |
| 1290 | 1290 | case 0x29: |
| r1877 | r1878 | |
| 1294 | 1294 | case 0x2d: |
| 1295 | 1295 | case 0x2e: |
| 1296 | 1296 | case 0x2f: |
| 1297 | einstein_ctc_w(offset,data); | |
| 1297 | einstein_ctc_w(machine, offset,data); | |
| 1298 | 1298 | return; |
| 1299 | 1299 | case 0x30: |
| 1300 | 1300 | case 0x31: |
| r1877 | r1878 | |
| 1304 | 1304 | case 0x35: |
| 1305 | 1305 | case 0x36: |
| 1306 | 1306 | case 0x37: |
| 1307 | einstein_pio_w(offset,data); | |
| 1307 | einstein_pio_w(machine, offset,data); | |
| 1308 | 1308 | return; |
| 1309 | 1309 | |
| 1310 | 1310 | default: |
| r1877 | r1878 | |
|---|---|---|
| 367 | 367 | MDRV_CPU_CONFIG(ti99_2_processor_config) |
| 368 | 368 | MDRV_CPU_PROGRAM_MAP(ti99_2_memmap, 0) |
| 369 | 369 | MDRV_CPU_IO_MAP(ti99_2_readcru, ti99_2_writecru) |
| 370 | MDRV_CPU_VBLANK_INT(ti99_2_vblank_interrupt | |
| 370 | MDRV_CPU_VBLANK_INT("main", ti99_2_vblank_interrupt | |
| 371 | 371 | |
| 372 | 372 | MDRV_MACHINE_RESET( ti99_2 ) |
| 373 | 373 |
| r1877 | r1878 | |
|---|---|---|
| 325 | 325 | /* basic machine hardware */ |
| 326 | 326 | MDRV_CPU_ADD_TAG("main", CP1610, XTAL_3_579545MHz/4) /* Colorburst/4 */ |
| 327 | 327 | MDRV_CPU_PROGRAM_MAP(intv_mem, 0) |
| 328 | MDRV_CPU_VBLANK_INT(intv_interrupt | |
| 328 | MDRV_CPU_VBLANK_INT("main", intv_interrupt | |
| 329 | 329 | MDRV_INTERLEAVE(1) |
| 330 | 330 | |
| 331 | 331 | MDRV_MACHINE_RESET( intv ) |
| r1877 | r1878 | |
| 359 | 359 | |
| 360 | 360 | MDRV_CPU_ADD(M6502, XTAL_3_579545MHz/2) /* Colorburst/2 */ |
| 361 | 361 | MDRV_CPU_PROGRAM_MAP(intv2_mem, 0) |
| 362 | MDRV_CPU_VBLANK_INT(intv_interrupt2 | |
| 362 | MDRV_CPU_VBLANK_INT("main", intv_interrupt2 | |
| 363 | 363 | |
| 364 | 364 | MDRV_INTERLEAVE(100) |
| 365 | 365 |
| r1877 | r1878 | |
|---|---|---|
| 169 | 169 | MDRV_CPU_ADD_TAG("main", Z80, 3250000) /* 3.25 Mhz */ |
| 170 | 170 | MDRV_CPU_PROGRAM_MAP(jupiter_mem, 0) |
| 171 | 171 | MDRV_CPU_IO_MAP(jupiter_io, 0) |
| 172 | MDRV_CPU_VBLANK_INT(jupiter_interrupt | |
| 172 | MDRV_CPU_VBLANK_INT("main", jupiter_interrupt | |
| 173 | 173 | MDRV_INTERLEAVE(1) |
| 174 | 174 | |
| 175 | 175 | MDRV_MACHINE_START( jupiter ) |
| r1877 | r1878 | |
|---|---|---|
| 546 | 546 | MDRV_CPU_ADD(TMS7000_EXL, 4910000) |
| 547 | 547 | MDRV_CPU_PROGRAM_MAP(exelv_memmap, 0) |
| 548 | 548 | MDRV_CPU_IO_MAP(exelv_portmap, 0) |
| 549 | MDRV_CPU_VBLANK_INT(exelv_hblank_interrupt, 363) | |
| 549 | MDRV_CPU_VBLANK_INT_HACK(exelv_hblank_interrupt, 363) | |
| 550 | 550 | |
| 551 | 551 | MDRV_MACHINE_RESET( exelv ) |
| 552 | 552 |
| r1877 | r1878 | |
|---|---|---|
| 43 | 43 | |
| 44 | 44 | static const struct via6522_interface config= |
| 45 | 45 | { |
| 46 | 0,//read8_handler in_a_func; | |
| 47 | 0,//read8_handler in_b_func; | |
| 48 | 0,//read8_handler in_ca1_func; | |
| 49 | 0,//read8_handler in_cb1_func; | |
| 50 | 0,//read8_handler in_ca2_func; | |
| 51 | 0,//read8_handler in_cb2_func; | |
| 52 | 0,//write8_handler out_a_func; | |
| 53 | 0,//write8_handler out_b_func; | |
| 54 | 0,//write8_handler out_ca2_func; | |
| 55 | 0,//write8_handler out_cb2_func; | |
| 46 | 0,//read8_machine_func in_a_func; | |
| 47 | 0,//read8_machine_func in_b_func; | |
| 48 | 0,//read8_machine_func in_ca1_func; | |
| 49 | 0,//read8_machine_func in_cb1_func; | |
| 50 | 0,//read8_machine_func in_ca2_func; | |
| 51 | 0,//read8_machine_func in_cb2_func; | |
| 52 | 0,//write8_machine_func out_a_func; | |
| 53 | 0,//write8_machine_func out_b_func; | |
| 54 | 0,//write8_machine_func out_ca2_func; | |
| 55 | 0,//write8_machine_func out_cb2_func; | |
| 56 | 56 | 0,//void (*irq_func)(int state); |
| 57 | 57 | }; |
| 58 | 58 |
| r1877 | r1878 | |
|---|---|---|
| 239 | 239 | |
| 240 | 240 | static void update_psg(void) |
| 241 | 241 | { |
| 242 | running_machine *machine = Machine; | |
| 243 | ||
| 242 | 244 | if(aleste_mode & 0x20) // RTC selected |
| 243 | 245 | { |
| 244 | 246 | switch(aleste_rtc_function) |
| 245 | 247 | { |
| 246 | 248 | case 0x02: // AS |
| 247 | mc146818_port_w(0,ppi_port_outputs[amstrad_ppi_PortA]); | |
| 249 | mc146818_port_w(machine, 0,ppi_port_outputs[amstrad_ppi_PortA]); | |
| 248 | 250 | break; |
| 249 | 251 | case 0x04: // DS write |
| 250 | mc146818_port_w(1,ppi_port_outputs[amstrad_ppi_PortA]); | |
| 252 | mc146818_port_w(machine, 1,ppi_port_outputs[amstrad_ppi_PortA]); | |
| 251 | 253 | break; |
| 252 | 254 | case 0x05: // DS read |
| 253 | ppi_port_inputs[amstrad_ppi_PortA] = mc146818_port_r(1); | |
| 255 | ppi_port_inputs[amstrad_ppi_PortA] = mc146818_port_r(machine, 1); | |
| 254 | 256 | break; |
| 255 | 257 | } |
| 256 | 258 | return; |
| r1877 | r1878 | |
| 262 | 264 | } break; |
| 263 | 265 | case 1: |
| 264 | 266 | {/* b6 = 1 ? : Read from selected PSG register and make the register data available to PPI Port A */ |
| 265 | ppi_port_inputs[amstrad_ppi_PortA] = AY8910_read_port_0_r(0); | |
| 267 | ppi_port_inputs[amstrad_ppi_PortA] = AY8910_read_port_0_r(machine, 0); | |
| 266 | 268 | } |
| 267 | 269 | break; |
| 268 | 270 | case 2: |
| 269 | 271 | {/* b7 = 1 ? : Write to selected PSG register and write data to PPI Port A */ |
| 270 | AY8910_write_port_0_w(0, ppi_port_outputs[amstrad_ppi_PortA]); | |
| 272 | AY8910_write_port_0_w(machine, 0, ppi_port_outputs[amstrad_ppi_PortA]); | |
| 271 | 273 | } |
| 272 | 274 | break; |
| 273 | 275 | case 3: |
| 274 | 276 | {/* b6 and b7 = 1 ? : The register will now be selected and the user can read from or write to it. The register will remain selected until another is chosen.*/ |
| 275 | AY8910_control_port_0_w(0, ppi_port_outputs[amstrad_ppi_PortA]); | |
| 277 | AY8910_control_port_0_w(machine, 0, ppi_port_outputs[amstrad_ppi_PortA]); | |
| 276 | 278 | prev_reg = ppi_port_outputs[amstrad_ppi_PortA]; |
| 277 | 279 | } |
| 278 | 280 | break; |
| r1877 | r1878 | |
| 1319 | 1321 | int b8b0 = ((offset & (1<<8)) >> (8 - 1)) | (offset & (0x01)); |
| 1320 | 1322 | switch (b8b0) { |
| 1321 | 1323 | case 0x02: { |
| 1322 | data = nec765_status_r(0); | |
| 1324 | data = nec765_status_r(machine, 0); | |
| 1323 | 1325 | } break; |
| 1324 | 1326 | case 0x03: { |
| 1325 | data = nec765_data_r(0); | |
| 1327 | data = nec765_data_r(machine, 0); | |
| 1326 | 1328 | } break; |
| 1327 | 1329 | default: { |
| 1328 | 1330 | } break; |
| r1877 | r1878 | |
| 1451 | 1453 | break; |
| 1452 | 1454 | |
| 1453 | 1455 | case 0x03: /* Write Data register of FDC */ |
| 1454 | nec765_data_w(0,data); | |
| 1456 | nec765_data_w(machine, 0,data); | |
| 1455 | 1457 | break; |
| 1456 | 1458 | default: |
| 1457 | 1459 | break; |
| r1877 | r1878 | |
| 1489 | 1491 | video_screen_configure(0,800,312,&rect,HZ_TO_ATTOSECONDS(AMSTRAD_FPS)); |
| 1490 | 1492 | } |
| 1491 | 1493 | } |
| 1492 | multiface_io_write(offset,data); | |
| 1494 | multiface_io_write(machine, offset,data); | |
| 1493 | 1495 | } |
| 1494 | 1496 | |
| 1495 | 1497 | // Handler for checking the ASIC unlocking sequence |
| r1877 | r1878 | |
|---|---|---|
| 408 | 408 | else if (offset >= 0xc4000 && offset <= 0xc4010) |
| 409 | 409 | { |
| 410 | 410 | logerror("17XX: R @ addr %x mask %08x\n", offset*4, mem_mask); |
| 411 | return wd17xx_data_r(offset&0xf); | |
| 411 | return wd17xx_data_r(machine, offset&0xf); | |
| 412 | 412 | } |
| 413 | 413 | else |
| 414 | 414 | { |
| r1877 | r1878 | |
| 505 | 505 | else if (offset >= 0xc4000 && offset <= 0xc4010) |
| 506 | 506 | { |
| 507 | 507 | logerror("17XX: %x to addr %x mask %08x\n", data, offset*4, mem_mask); |
| 508 | wd17xx_data_w(offset&0xf, data&0xff); | |
| 508 | wd17xx_data_w(machine, offset&0xf, data&0xff); | |
| 509 | 509 | } |
| 510 | 510 | else if (offset == 0xd40006) |
| 511 | 511 | { |
| r1877 | r1878 | |
|---|---|---|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | static void avigo_setbank(int bank, void *address, read8_ | |
| 97 | static void avigo_setbank(int bank, void *address, read8_machin | |
| 98 | 98 | { |
| 99 | 99 | if (address) |
| 100 | 100 | { |
| r1877 | r1878 | |
|---|---|---|
| 775 | 775 | /* basic machine hardware */ |
| 776 | 776 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) |
| 777 | 777 | MDRV_CPU_PROGRAM_MAP( psx_map, 0 ) |
| 778 | MDRV_CPU_VBLANK_INT( psx_vblank | |
| 778 | MDRV_CPU_VBLANK_INT("main", psx_vblank | |
| 779 | 779 | |
| 780 | 780 | MDRV_SCREEN_ADD("main", RASTER) |
| 781 | 781 | MDRV_SCREEN_REFRESH_RATE( 60 ) |
| r1877 | r1878 | |
| 805 | 805 | /* basic machine hardware */ |
| 806 | 806 | MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz ) |
| 807 | 807 | MDRV_CPU_PROGRAM_MAP( psx_map, 0 ) |
| 808 | MDRV_CPU_VBLANK_INT( psx_vblank | |
| 808 | MDRV_CPU_VBLANK_INT("main", psx_vblank | |
| 809 | 809 | |
| 810 | 810 | MDRV_SCREEN_ADD("main", RASTER) |
| 811 | 811 | MDRV_SCREEN_REFRESH_RATE( 50 ) |
| r1877 | r1878 | |
|---|---|---|
| 26 | 26 | ***************************************************************************/ |
| 27 | 27 | |
| 28 | 28 | #include "driver.h" |
| 29 | #include "deprecat.h" | |
| 29 | 30 | #include "cpu/z80/z80.h" |
| 30 | 31 | #include "includes/coupe.h" |
| 31 | 32 | #include "machine/wd17xx.h" |
| r1877 | r1878 | |
| 159 | 160 | case DSK1_PORT+0: /* This covers the total range of ports for 1 floppy controller */ |
| 160 | 161 | case DSK1_PORT+4: |
| 161 | 162 | wd17xx_set_side((offset >> 2) & 1); |
| 162 | return wd17xx_status_r(0); | |
| 163 | return wd17xx_status_r(machine, 0); | |
| 163 | 164 | case DSK1_PORT+1: |
| 164 | 165 | case DSK1_PORT+5: |
| 165 | 166 | wd17xx_set_side((offset >> 2) & 1); |
| 166 | return wd17xx_track_r(0); | |
| 167 | return wd17xx_track_r(machine, 0); | |
| 167 | 168 | case DSK1_PORT+2: |
| 168 | 169 | case DSK1_PORT+6: |
| 169 | 170 | wd17xx_set_side((offset >> 2) & 1); |
| 170 | return wd17xx_sector_r(0); | |
| 171 | return wd17xx_sector_r(machine, 0); | |
| 171 | 172 | case DSK1_PORT+3: |
| 172 | 173 | case DSK1_PORT+7: |
| 173 | 174 | wd17xx_set_side((offset >> 2) & 1); |
| 174 | return wd17xx_data_r(0); | |
| 175 | return wd17xx_data_r(machine, 0); | |
| 175 | 176 | case LPEN_PORT: |
| 176 | 177 | return LPEN; |
| 177 | 178 | case STAT_PORT: |
| r1877 | r1878 | |
| 200 | 201 | if (offset==SSND_ADDR) // Set sound address |
| 201 | 202 | { |
| 202 | 203 | SOUND_ADDR=data&0x1F; // 32 registers max |
| 203 | saa1099_control_port_0_w(0, SOUND_ADDR); | |
| 204 | saa1099_control_port_0_w(machine, 0, SOUND_ADDR); | |
| 204 | 205 | return; |
| 205 | 206 | } |
| 206 | 207 | |
| r1877 | r1878 | |
| 209 | 210 | case DSK1_PORT+0: // This covers the total range of ports for 1 floppy controller |
| 210 | 211 | case DSK1_PORT+4: |
| 211 | 212 | wd17xx_set_side((offset >> 2) & 1); |
| 212 | wd17xx_command_w(0, data); | |
| 213 | wd17xx_command_w(machine, 0, data); | |
| 213 | 214 | break; |
| 214 | 215 | case DSK1_PORT+1: |
| 215 | 216 | case DSK1_PORT+5: |
| 216 | 217 | /* Track byte requested on address line */ |
| 217 | 218 | wd17xx_set_side((offset >> 2) & 1); |
| 218 | wd17xx_track_w(0, data); | |
| 219 | wd17xx_track_w(machine, 0, data); | |
| 219 | 220 | break; |
| 220 | 221 | case DSK1_PORT+2: |
| 221 | 222 | case DSK1_PORT+6: |
| 222 | 223 | /* Sector byte requested on address line */ |
| 223 | 224 | wd17xx_set_side((offset >> 2) & 1); |
| 224 | wd17xx_sector_w(0, data); | |
| 225 | wd17xx_sector_w(machine, 0, data); | |
| 225 | 226 | break; |
| 226 | 227 | case DSK1_PORT+3: |
| 227 | 228 | case DSK1_PORT+7: |
| 228 | 229 | /* Data byte requested on address line */ |
| 229 | 230 | wd17xx_set_side((offset >> 2) & 1); |
| 230 | wd17xx_data_w(0, data); | |
| 231 | wd17xx_data_w(machine, 0, data); | |
| 231 | 232 | break; |
| 232 | 233 | case CLUT_PORT: |
| 233 | 234 | CLUT[(offset >> 8)&0x0F]=data&0x7F; // set CLUT data |
| r1877 | r1878 | |
| 252 | 253 | speaker_level_w(0,(data>>4) & 0x01); |
| 253 | 254 | break; |
| 254 | 255 | case SSND_DATA: |
| 255 | saa1099_write_port_0_w(0, data); | |
| 256 | saa1099_write_port_0_w(machine, 0, data); | |
| 256 | 257 | SOUND_REG[SOUND_ADDR] = data; |
| 257 | 258 | break; |
| 258 | 259 | default: |
| r1877 | r1878 | |
| 407 | 408 | MDRV_CPU_ADD(Z80, 6000000) /* 6 Mhz */ |
| 408 | 409 | MDRV_CPU_PROGRAM_MAP(coupe_mem, 0) |
| 409 | 410 | MDRV_CPU_IO_MAP(coupe_io, 0) |
| 410 | MDRV_CPU_VBLANK_INT(coupe_line_interrupt, 192 + 10) /* 192 scanlines + 10 lines of vblank (approx).. */ | |
| 411 | MDRV_CPU_VBLANK_INT_HACK(coupe_line_interrupt, 192 + 10) /* 192 scanlines + 10 lines of vblank (approx).. */ | |
| 411 | 412 | MDRV_SCREEN_ADD("main", RASTER) |
| 412 | 413 | MDRV_SCREEN_REFRESH_RATE(50) |
| 413 | 414 | MDRV_SCREEN_VBLANK_TIME(0) |
| r1877 | r1878 | |
|---|---|---|
| 568 | 568 | MDRV_CPU_CONFIG(tutor_processor_config) |
| 569 | 569 | MDRV_CPU_PROGRAM_MAP(tutor_memmap, 0) |
| 570 | 570 | MDRV_CPU_IO_MAP(tutor_readcru, /*tutor_writecru*/0) |
| 571 | MDRV_CPU_VBLANK_INT(tutor_vblank_interrupt | |
| 571 | MDRV_CPU_VBLANK_INT("main", tutor_vblank_interrupt | |
| 572 | 572 | |
| 573 | 573 | MDRV_MACHINE_START( tutor ) |
| 574 | 574 | MDRV_MACHINE_RESET( tutor ) |
| r1877 | r1878 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | /* Core includes */ |
| 80 | 80 | #include "driver.h" |
| 81 | #include "deprecat.h" | |
| 81 | 82 | #include "includes/trs80.h" |
| 82 | 83 | |
| 83 | 84 | /* Components */ |
| r1877 | r1878 | |
| 95 | 96 | { |
| 96 | 97 | if (readinputport(0) & 0x80) |
| 97 | 98 | { |
| 98 | return wd17xx_status_r(offset); | |
| 99 | return wd17xx_status_r(machine, offset); | |
| 99 | 100 | } |
| 100 | 101 | else |
| 101 | 102 | { |
| r1877 | r1878 | |
| 317 | 318 | MDRV_CPU_ADD_TAG("main", Z80, 1796000) /* 1.796 Mhz */ |
| 318 | 319 | MDRV_CPU_PROGRAM_MAP(mem_level1, 0) |
| 319 | 320 | MDRV_CPU_IO_MAP(io_level1, 0) |
| 320 | MDRV_CPU_VBLANK_INT(trs80_frame_interrupt | |
| 321 | MDRV_CPU_VBLANK_INT("main", trs80_frame_interrupt | |
| 321 | 322 | MDRV_CPU_PERIODIC_INT(trs80_timer_interrupt, 40) |
| 322 | 323 | MDRV_INTERLEAVE(1) |
| 323 | 324 | |
| r1877 | r1878 | |
| 358 | 359 | MDRV_CPU_MODIFY( "main" ) |
| 359 | 360 | MDRV_CPU_PROGRAM_MAP( mem_model3, 0 ) |
| 360 | 361 | MDRV_CPU_IO_MAP( io_model3, 0 ) |
| 361 | MDRV_CPU_VBLANK_INT(trs80_frame_interrupt, 2) | |
| 362 | MDRV_CPU_VBLANK_INT_HACK(trs80_frame_interrupt, 2) | |
| 362 | 363 | MACHINE_DRIVER_END |
| 363 | 364 | |
| 364 | 365 | /*************************************************************************** |
| r1877 | r1878 | |
|---|---|---|
| 183 | 183 | ***************************************************************************/ |
| 184 | 184 | |
| 185 | 185 | #include "driver.h" |
| 186 | #include "deprecat.h" | |
| 186 | 187 | #include "includes/apple2.h" |
| 187 | 188 | #include "machine/ay3600.h" |
| 188 | 189 | #include "devices/appldriv.h" |
| r1877 | r1878 | |
| 541 | 542 | /* basic machine hardware */ |
| 542 | 543 | MDRV_CPU_ADD_TAG("main", M6502, 1021800) /* close to actual CPU frequency of 1.020484 MHz */ |
| 543 | 544 | MDRV_CPU_PROGRAM_MAP(apple2_map, 0) |
| 544 | MDRV_CPU_VBLANK_INT(apple2_interrupt, 192/8) | |
| 545 | MDRV_CPU_VBLANK_INT_HACK(apple2_interrupt, 192/8) | |
| 545 | 546 | MDRV_INTERLEAVE(1) |
| 546 | 547 | |
| 547 | 548 | MDRV_MACHINE_START( apple2 ) |
| r1877 | r1878 | |
|---|---|---|
| 227 | 227 | MDRV_CPU_ADD_TAG( "main", Z80, 2500000 ) |
| 228 | 228 | MDRV_CPU_PROGRAM_MAP( primo32_mem, 0 ) |
| 229 | 229 | MDRV_CPU_IO_MAP( primoa_port, 0 ) |
| 230 | MDRV_CPU_VBLANK_INT( primo_vblank_interrupt | |
| 230 | MDRV_CPU_VBLANK_INT("main", primo_vblank_interrupt | |
| 231 | 231 | |
| 232 | 232 | MDRV_MACHINE_RESET( primoa ) |
| 233 | 233 |
| r1877 | r1878 | |
|---|---|---|
| 166 | 166 | svision_soundport_w(svision_channel + 1, offset & 3, data); |
| 167 | 167 | break; |
| 168 | 168 | case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: |
| 169 | svision_sounddma_w(offset - 0x18, data); | |
| 169 | svision_sounddma_w(machine, offset - 0x18, data); | |
| 170 | 170 | break; |
| 171 | 171 | case 0x28: case 0x29: case 0x2a: |
| 172 | svision_noise_w(offset - 0x28, data); | |
| 172 | svision_noise_w(machine, offset - 0x28, data); | |
| 173 | 173 | break; |
| 174 | 174 | default: |
| 175 | 175 | logerror("%.6f svision write %04x %02x\n", attotime_to_double(timer_get_time()), offset, data); |
| r1877 | r1878 | |
| 185 | 185 | if (offset >= 0x800 && offset < 0x840) |
| 186 | 186 | { |
| 187 | 187 | /* strange effects when modifying palette */ |
| 188 | return svision_r(offset); | |
| 188 | return svision_r(machine, offset); | |
| 189 | 189 | } |
| 190 | 190 | else |
| 191 | 191 | { |
| 192 | return svision_r(offset); | |
| 192 | return svision_r(machine, offset); | |
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | } |
| r1877 | r1878 | |
| 219 | 219 | } |
| 220 | 220 | break; |
| 221 | 221 | default: |
| 222 | svision_w(offset,data); | |
| 222 | svision_w(machine, offset,data); | |
| 223 | 223 | if (offset >= 0x800 && offset < 0x840) |
| 224 | 224 | { |
| 225 | 225 | UINT16 c; |
| r1877 | r1878 | |
| 480 | 480 | /* basic machine hardware */ |
| 481 | 481 | MDRV_CPU_ADD_TAG("main", M65C02, 4000000) /* ? stz used! speed? */ |
| 482 | 482 | MDRV_CPU_PROGRAM_MAP(svision_mem, 0) |
| 483 | MDRV_CPU_VBLANK_INT(svision_frame_int | |
| 483 | MDRV_CPU_VBLANK_INT("main", svision_frame_int | |
| 484 | 484 | |
| 485 | 485 | MDRV_MACHINE_RESET( svision ) |
| 486 | 486 |
| r1877 | r1878 | |
|---|---|---|
| 706 | 706 | /* basic machine hardware */ |
| 707 | 707 | MDRV_CPU_ADD_TAG("main", M6510, VIC6567_CLOCK) |
| 708 | 708 | MDRV_CPU_PROGRAM_MAP(c64_mem, 0) |
| 709 | MDRV_CPU_VBLANK_INT(c64_frame_interrupt | |
| 709 | MDRV_CPU_VBLANK_INT("main", c64_frame_interrupt | |
| 710 | 710 | MDRV_CPU_PERIODIC_INT(vic2_raster_irq, VIC2_HRETRACERATE) |
| 711 | 711 | MDRV_INTERLEAVE(1) |
| 712 | 712 |
| r1877 | r1878 | |
|---|---|---|
| 72 | 72 | AM_RANGE( 0x33, 0x33) AM_READWRITE( wd17xx_data_r, wd17xx_data_w ) |
| 73 | 73 | AM_RANGE( 0x34, 0x34) AM_READWRITE( svi318_fdc_irqdrq_r, svi318_fdc_drive_motor_w ) |
| 74 | 74 | AM_RANGE( 0x38, 0x38) AM_WRITE( svi318_fdc_density_side_w ) |
| 75 | AM_RANGE( 0x50, 0x51) AM_READWRITE( svi806_r, svi806_w ) | |
| 75 | AM_RANGE( 0x50, 0x50) AM_DEVREADWRITE( MC6845, "crtc", mc6845_register_r, mc6845_address_w ) | |
| 76 | AM_RANGE( 0x51, 0x51) AM_DEVREADWRITE( MC6845, "crtc", mc6845_register_r, mc6845_register_w ) | |
| 76 | 77 | AM_RANGE( 0x58, 0x58) AM_WRITE( svi806_ram_enable_w ) |
| 77 | 78 | AM_RANGE( 0x80, 0x80) AM_WRITE( TMS9928A_vram_w ) |
| 78 | 79 | AM_RANGE( 0x81, 0x81) AM_WRITE( TMS9928A_register_w ) |
| r1877 | r1878 | |
| 320 | 321 | MDRV_CPU_ADD_TAG( "main", Z80, 3579545 ) /* 3.579545 Mhz */ |
| 321 | 322 | MDRV_CPU_PROGRAM_MAP( svi318_mem, 0 ) |
| 322 | 323 | MDRV_CPU_IO_MAP( svi318_io, 0 ) |
| 323 | MDRV_CPU_VBLANK_INT( svi318_interrupt | |
| 324 | MDRV_CPU_VBLANK_INT("main", svi318_interrupt | |
| 324 | 325 | MDRV_INTERLEAVE(1) |
| 325 | 326 | |
| 326 | 327 | MDRV_MACHINE_START( svi318_pal ) |
| r1877 | r1878 | |
| 370 | 371 | MDRV_CPU_ADD_TAG( "main", Z80, 3579545 ) /* 3.579545 Mhz */ |
| 371 | 372 | MDRV_CPU_PROGRAM_MAP( svi328_806_mem, 0 ) |
| 372 | 373 | MDRV_CPU_IO_MAP( svi318_io2, 0 ) |
| 373 | MDRV_CPU_VBLANK_INT( svi318_interrupt | |
| 374 | MDRV_CPU_VBLANK_INT("main", svi318_interrupt | |
| 374 | 375 | MDRV_INTERLEAVE(1) |
| 375 | 376 | |
| 376 | 377 | MDRV_MACHINE_START( svi318_pal ) |
| r1877 | r1878 | |
|---|---|---|
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | 29 | #include "driver.h" |
| 30 | #include "deprecat.h" | |
| 30 | 31 | #include "video/v9938.h" |
| 31 | 32 | |
| 32 | 33 | #include "machine/ti99_4x.h" |
| r1877 | r1878 | |
| 244 | 245 | MDRV_CPU_ADD(TMS9900, 3000000) |
| 245 | 246 | MDRV_CPU_PROGRAM_MAP(memmap, 0) |
| 246 | 247 | MDRV_CPU_IO_MAP(readcru, writecru) |
| 247 | MDRV_CPU_VBLANK_INT(ti99_4ev_hblank_interrupt, 263) /* 262.5 in 60Hz, 312.5 in 50Hz */ | |
| 248 | MDRV_CPU_VBLANK_INT_HACK(ti99_4ev_hblank_interrupt, 263) /* 262.5 in 60Hz, 312.5 in 50Hz */ | |
| 248 | 249 | |
| 249 | 250 | MDRV_MACHINE_RESET( ti99 ) |
| 250 | 251 |
| r1877 | r1878 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | #include "driver.h" |
| 22 | #include "deprecat.h" | |
| 22 | 23 | #include "memconv.h" |
| 23 | 24 | |
| 24 | 25 | #include "machine/8255ppi.h" |
| r1877 | r1878 | |
| 90 | 91 | static READ8_HANDLER( pc_YM3812_0_r ) |
| 91 | 92 | { |
| 92 | 93 | if ((offset % 1) == 0) |
| 93 | return YM3812_status_port_0_r(0); | |
| 94 | return YM3812_status_port_0_r(machine, 0); | |
| 94 | 95 | else |
| 95 | 96 | return 0x00; |
| 96 | 97 | } |
| r1877 | r1878 | |
| 98 | 99 | static WRITE8_HANDLER( pc_YM3812_0_w ) |
| 99 | 100 | { |
| 100 | 101 | if ((offset % 1) == 0) |
| 101 | YM3812_control_port_0_w(0, data); | |
| 102 | YM3812_control_port_0_w(machine, 0, data); | |
| 102 | 103 | else |
| 103 | YM3812_write_port_0_w(0, data); | |
| 104 | YM3812_write_port_0_w(machine, 0, data); | |
| 104 | 105 | } |
| 105 | 106 | |
| 106 | static READ16_HANDLER( pc16le_YM3812_0_r ) { return read16le_with_read8_handler(pc_YM3812_0_r, offset, mem_mask); } | |
| 107 | static WRITE16_HANDLER( pc16le_YM3812_0_w ) { write16le_with_write8_handler(pc_YM3812_0_w, offset, data, mem_mask); } | |
| 107 | static READ16_HANDLER( pc16le_YM3812_0_r ) { return read16le_with_read8_handler(pc_YM3812_0_r, machine, offset, mem_mask); } | |
| 108 | static WRITE16_HANDLER( pc16le_YM3812_0_w ) { write16le_with_write8_handler(pc_YM3812_0_w, machine, offset, data, mem_mask); } | |
| 108 | 109 | |
| 109 | 110 | #ifdef UNUSED_FUNCTION |
| 110 | static WRITE16_HANDLER( pc16le_SN76496_0_w ) { write16le_with_write8_handler(SN76496_0_w, offset, data, mem_mask); } | |
| 111 | static WRITE16_HANDLER( pc16le_SN76496_0_w ) { write16le_with_write8_handler(SN76496_0_w, machine, offset, data, mem_mask); } | |
| 111 | 112 | #endif |
| 112 | 113 | |
| 113 | 114 | // IO Expansion, only a little bit for ibm bios self tests |
| r1877 | r1878 | |
| 1148 | 1149 | MDRV_CPU_ADD_TAG("main", type, clock) \ |
| 1149 | 1150 | MDRV_CPU_PROGRAM_MAP(mem##_map, 0) \ |
| 1150 | 1151 | MDRV_CPU_IO_MAP(port##_io, 0) \ |
| 1151 | MDRV_CPU_VBLANK_INT(vblankfunc, 4) \ | |
| 1152 | MDRV_CPU_VBLANK_INT_HACK(vblankfunc, 4) \ | |
| 1152 | 1153 | MDRV_CPU_CONFIG(i86_address_mask) |
| 1153 | 1154 | |
| 1154 | 1155 | |
| r1877 | r1878 | |
| 1157 | 1158 | MDRV_CPU_ADD_TAG("main", V20, 4772720) |
| 1158 | 1159 | MDRV_CPU_PROGRAM_MAP(pc8_map, 0) |
| 1159 | 1160 | MDRV_CPU_IO_MAP(pc8_io, 0) |
| 1160 | MDRV_CPU_VBLANK_INT(pc_mda_frame_interrupt, 4) | |
| 1161 | MDRV_CPU_VBLANK_INT_HACK(pc_mda_frame_interrupt, 4) | |
| 1161 | 1162 | |
| 1162 | 1163 | MDRV_MACHINE_RESET(pc_mda) |
| 1163 | 1164 |
| r1877 | r1878 | |
|---|---|---|
| 52 | 52 | **********************************************************************/ |
| 53 | 53 | |
| 54 | 54 | #include "driver.h" |
| 55 | #include "deprecat.h" | |
| 55 | 56 | #include "video/vdc.h" |
| 56 | 57 | #include "cpu/h6280/h6280.h" |
| 57 | 58 | #include "includes/pce.h" |
| r1877 | r1878 | |
| 143 | 144 | MDRV_CPU_ADD(H6280, MAIN_CLOCK/3) |
| 144 | 145 | MDRV_CPU_PROGRAM_MAP(pce_mem, 0) |
| 145 | 146 | MDRV_CPU_IO_MAP(pce_io, 0) |
| 146 | MDRV_CPU_VBLANK_INT(pce_interrupt, VDC_LPF) | |
| 147 | MDRV_CPU_VBLANK_INT_HACK(pce_interrupt, VDC_LPF) | |
| 147 | 148 | MDRV_INTERLEAVE(1) |
| 148 | 149 | |
| 149 | 150 | MDRV_MACHINE_RESET( pce ) |
| r1877 | r1878 | |
| 182 | 183 | MDRV_CPU_ADD(H6280, MAIN_CLOCK/3) |
| 183 | 184 | MDRV_CPU_PROGRAM_MAP(sgx_mem, 0) |
| 184 | 185 | MDRV_CPU_IO_MAP(sgx_io, 0) |
| 185 | MDRV_CPU_VBLANK_INT(sgx_interrupt, VDC_LPF) | |
| 186 | MDRV_CPU_VBLANK_INT_HACK(sgx_interrupt, VDC_LPF) | |
| 186 | 187 | MDRV_INTERLEAVE(1) |
| 187 | 188 | |
| 188 | 189 | MDRV_MACHINE_RESET( pce ) |
| r1877 | r1878 | |
|---|---|---|
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | #include "driver.h" |
| 22 | #include "deprecat.h" | |
| 22 | 23 | #include "video/v9938.h" |
| 23 | 24 | #include "machine/ti99_4x.h" |
| 24 | 25 | #include "machine/tms9901.h" |
| r1877 | r1878 | |
| 505 | 506 | MDRV_CPU_ADD(TMS9900, 3000000) |
| 506 | 507 | MDRV_CPU_PROGRAM_MAP(memmap, 0) |
| 507 | 508 | MDRV_CPU_IO_MAP(readcru, writecru) |
| 508 | MDRV_CPU_VBLANK_INT(ti99_vblank_interrupt | |
| 509 | MDRV_CPU_VBLANK_INT("main", ti99_vblank_interrupt | |
| 509 | 510 | |
| 510 | 511 | MDRV_MACHINE_START( ti99_4_60hz ) |
| 511 | 512 | MDRV_MACHINE_RESET( ti99 ) |
| r1877 | r1878 | |
| 535 | 536 | MDRV_CPU_ADD(TMS9900, 3000000) |
| 536 | 537 | MDRV_CPU_PROGRAM_MAP(memmap, 0) |
| 537 | 538 | MDRV_CPU_IO_MAP(readcru, writecru) |
| 538 | MDRV_CPU_VBLANK_INT(ti99_vblank_interrupt | |
| 539 | MDRV_CPU_VBLANK_INT("main", ti99_vblank_interrupt | |
| 539 | 540 | |
| 540 | 541 | MDRV_MACHINE_START( ti99_4_50hz ) |
| 541 | 542 | MDRV_MACHINE_RESET( ti99 ) |
| r1877 | r1878 | |
| 564 | 565 | MDRV_CPU_ADD(TMS9900, 3000000) |
| 565 | 566 | MDRV_CPU_PROGRAM_MAP(memmap, 0) |
| 566 | 567 | MDRV_CPU_IO_MAP(readcru, writecru) |
| 567 | MDRV_CPU_VBLANK_INT(ti99_vblank_interrupt | |
| 568 | MDRV_CPU_VBLANK_INT("main", ti99_vblank_interrupt | |
| 568 | 569 | |
| 569 | 570 | MDRV_MACHINE_START( ti99_4a_60hz ) |
| 570 | 571 | MDRV_MACHINE_RESET( ti99 ) |
| r1877 | r1878 | |
| 593 | 594 | MDRV_CPU_ADD(TMS9900, 3000000) |
| 594 | 595 | MDRV_CPU_PROGRAM_MAP(memmap, 0) |
| 595 | 596 | MDRV_CPU_IO_MAP(readcru, writecru) |
| 596 | MDRV_CPU_VBLANK_INT(ti99_vblank_interrupt | |
| 597 | MDRV_CPU_VBLANK_INT("main", ti99_vblank_interrupt | |
| 597 | 598 | |
| 598 | 599 | MDRV_MACHINE_START( ti99_4a_50hz ) |
| 599 | 600 | MDRV_MACHINE_RESET( ti99 ) |
| r1877 | r1878 | |
| 622 | 623 | MDRV_CPU_ADD(TMS9900, 3000000) |
| 623 | 624 | MDRV_CPU_PROGRAM_MAP(memmap_4ev, 0) |
| 624 | 625 | MDRV_CPU_IO_MAP(readcru, writecru) |
| 625 | MDRV_CPU_VBLANK_INT(ti99_4ev_hblank_interrupt, 263) /* 262.5 in 60Hz, 312.5 in 50Hz */ | |
| 626 | MDRV_CPU_VBLANK_INT_HACK(ti99_4ev_hblank_interrupt, 263) /* 262.5 in 60Hz, 312.5 in 50Hz */ | |
| 626 | 627 | |
| 627 | 628 | MDRV_MACHINE_START( ti99_4ev_60hz ) |
| 628 | 629 | MDRV_MACHINE_RESET( ti99 ) |
| r1877 | r1878 | |
|---|---|---|
| 17 | 17 | \*********************************************************************/ |
| 18 | 18 | |
| 19 | 19 | #include "driver.h" |
| 20 | #include "deprecat.h" | |
| 20 | 21 | #include "cpu/mips/mips3.h" |
| 21 | 22 | #include "machine/8530scc.h" |
| 22 | 23 | #include "machine/sgi.h" |
| r1877 | r1878 | |
| 132 | 133 | case 0x0120: |
| 133 | 134 | if (!(mem_mask & 0x0000ff00)) |
| 134 | 135 | { |
| 135 | return ( wd33c93_r( 0 ) << 8 ); | |
| 136 | return ( wd33c93_r( machine, 0 ) << 8 ); | |
| 136 | 137 | } |
| 137 | 138 | else |
| 138 | 139 | { |
| r1877 | r1878 | |
| 142 | 143 | case 0x0124: |
| 143 | 144 | if (!(mem_mask & 0x0000ff00)) |
| 144 | 145 | { |
| 145 | return ( wd33c93_r( 1 ) << 8 ); | |
| 146 | return ( wd33c93_r( machine, 1 ) << 8 ); | |
| 146 | 147 | } |
| 147 | 148 | else |
| 148 | 149 | { |
| r1877 | r1878 | |
| 176 | 177 | case 0x0d00: |
| 177 | 178 | verboselog( 2, "HPC DUART0 Channel B Control Read\n" ); |
| 178 | 179 | // return 0x00000004; |
| 179 | return 0x7c; //scc_r(0); | |
| 180 | return 0x7c; //scc_r(machine, 0); | |
| 180 | 181 | break; |
| 181 | 182 | case 0x0d04: |
| 182 | 183 | verboselog( 2, "HPC DUART0 Channel B Data Read\n" ); |
| 183 | 184 | // return 0; |
| 184 | return scc_r(2); | |
| 185 | return scc_r(machine, 2); | |
| 185 | 186 | break; |
| 186 | 187 | case 0x0d08: |
| 187 | 188 | verboselog( 2, "HPC DUART0 Channel A Control Read (%08x)\n", mem_mask ); |
| 188 | 189 | // return 0x40; |
| 189 | return 0x7c; //scc_r(1); | |
| 190 | return 0x7c; //scc_r(machine, 1); | |
| 190 | 191 | break; |
| 191 | 192 | case 0x0d0c: |
| 192 | 193 | verboselog( 2, "HPC DUART0 Channel A Data Read\n" ); |
| 193 | 194 | // return 0; |
| 194 | return scc_r(3); | |
| 195 | return scc_r(machine, 3); | |
| 195 | 196 | break; |
| 196 | 197 | case 0x0d10: |
| 197 | 198 | // verboselog( 2, "HPC DUART1 Channel B Control Read\n" ); |
| r1877 | r1878 | |
| 308 | 309 | if (!(mem_mask & 0x0000ff00)) |
| 309 | 310 | { |
| 310 | 311 | verboselog( 2, "HPC SCSI Controller Register Write: %08x\n", ( data >> 8 ) & 0x000000ff ); |
| 311 | wd33c93_w( 0, ( data >> 8 ) & 0x000000ff ); | |
| 312 | wd33c93_w( machine, 0, ( data >> 8 ) & 0x000000ff ); | |
| 312 | 313 | } |
| 313 | 314 | else |
| 314 | 315 | { |
| r1877 | r1878 | |
| 319 | 320 | if (!(mem_mask & 0x0000ff00)) |
| 320 | 321 | { |
| 321 | 322 | verboselog( 2, "HPC SCSI Controller Data Write: %08x\n", ( data >> 8 ) & 0x000000ff ); |
| 322 | wd33c93_w( 1, ( data >> 8 ) & 0x000000ff ); | |
| 323 | wd33c93_w( machine, 1, ( data >> 8 ) & 0x000000ff ); | |
| 323 | 324 | } |
| 324 | 325 | else |
| 325 | 326 | { |
| r1877 | r1878 | |
| 382 | 383 | break; |
| 383 | 384 | case 0x0d00: |
| 384 | 385 | verboselog( 2, "HPC DUART0 Channel B Control Write: %08x (%08x)\n", data, mem_mask ); |
| 385 | scc_w(0, data); | |
| 386 | scc_w(machine, 0, data); | |
| 386 | 387 | break; |
| 387 | 388 | case 0x0d04: |
| 388 | 389 | verboselog( 2, "HPC DUART0 Channel B Data Write: %08x (%08x)\n", data, mem_mask ); |
| 389 | scc_w(2, data); | |
| 390 | scc_w(machine, 2, data); | |
| 390 | 391 | break; |
| 391 | 392 | case 0x0d08: |
| 392 | 393 | verboselog( 2, "HPC DUART0 Channel A Control Write: %08x (%08x)\n", data, mem_mask ); |
| 393 | scc_w(1, data); | |
| 394 | scc_w(machine, 1, data); | |
| 394 | 395 | break; |
| 395 | 396 | case 0x0d0c: |
| 396 | 397 | verboselog( 2, "HPC DUART0 Channel A Data Write: %08x (%08x)\n", data, mem_mask ); |
| 397 | scc_w(3, data); | |
| 398 | scc_w(machine, 3, data); | |
| 398 | 399 | break; |
| 399 | 400 | case 0x0d10: |
| 400 | 401 | if( ( data & 0x000000ff ) >= 0x00000020 ) |
| r1877 | r1878 | |
| 613 | 614 | MDRV_CPU_ADD_TAG( "main", R4600BE, 50000000*3 ) |
| 614 | 615 | MDRV_CPU_CONFIG( config ) |
| 615 | 616 | MDRV_CPU_PROGRAM_MAP( ip204415_map, 0 ) |
| 616 | MDRV_CPU_VBLANK_INT( | |
| 617 | MDRV_CPU_VBLANK_INT_HACK( | |
| 617 | 618 | |
| 618 | ||
| 619 | 619 | MDRV_MACHINE_RESET( ip204415 ) |
| 620 | 620 | MDRV_NVRAM_HANDLER(93C56) |
| 621 | 621 |
| r1877 | r1878 | |
|---|---|---|
| 122 | 122 | MDRV_CPU_ADD(Z80, 3072000) |
| 123 | 123 | MDRV_CPU_PROGRAM_MAP(galaxy_mem, 0) |
| 124 | 124 | MDRV_CPU_IO_MAP(galaxy_readport, galaxy_writeport) |
| 125 | MDRV_CPU_VBLANK_INT(galaxy_interrupt | |
| 125 | MDRV_CPU_VBLANK_INT("main", galaxy_interrupt | |
| 126 | 126 | MDRV_SCREEN_ADD("main", RASTER) |
| 127 | 127 | MDRV_SCREEN_REFRESH_RATE(50) |
| 128 | 128 | MDRV_SCREEN_VBLANK_TIME(0) |
| r1877 | r1878 | |
|---|---|---|
| 700 | 700 | |
| 701 | 701 | static INTERRUPT_GEN( bbcb_vsync ) |
| 702 | 702 | { |
| 703 | via_0_ca1_w(0,1); | |
| 704 | via_0_ca1_w(0,0); | |
| 703 | via_0_ca1_w(machine, 0,1); | |
| 704 | via_0_ca1_w(machine, 0,0); | |
| 705 | 705 | bbc_frameclock(); |
| 706 | 706 | } |
| 707 | 707 | |
| r1877 | r1878 | |
| 718 | 718 | /* basic machine hardware */ |
| 719 | 719 | MDRV_CPU_ADD_TAG("main", M6502, 2000000) /* 2.00Mhz */ |
| 720 | 720 | MDRV_CPU_PROGRAM_MAP( bbca_mem, 0 ) |
| 721 | MDRV_CPU_VBLANK_INT(bbcb_vsync | |
| 721 | MDRV_CPU_VBLANK_INT("main", bbcb_vsync | |
| 722 | 722 | MDRV_CPU_PERIODIC_INT(bbcb_keyscan, 1000) /* scan keyboard */ |
| 723 | 723 | MDRV_SCREEN_ADD("main", RASTER) |
| 724 | 724 | MDRV_SCREEN_REFRESH_RATE(50) |
| r1877 | r1878 | |
| 781 | 781 | /* basic machine hardware */ |
| 782 | 782 | MDRV_CPU_ADD_TAG("main", M65SC02, 2000000) /* 2.00Mhz */ |
| 783 | 783 | MDRV_CPU_PROGRAM_MAP( bbcm_mem, 0 ) |
| 784 | MDRV_CPU_VBLANK_INT(bbcb_vsync | |
| 784 | MDRV_CPU_VBLANK_INT("main", bbcb_vsync | |
| 785 | 785 | MDRV_CPU_PERIODIC_INT(bbcm_keyscan, 1000) /* scan keyboard */ |
| 786 | 786 | MDRV_INTERLEAVE(1) |
| 787 | 787 |
| r1877 | r1878 | |
|---|---|---|
| 206 | 206 | MDRV_CPU_ADD_TAG("main", I80186, 8000000) /* 8 MHz */ |
| 207 | 207 | MDRV_CPU_PROGRAM_MAP(compis_mem, 0) |
| 208 | 208 | MDRV_CPU_IO_MAP(compis_io, 0) |
| 209 | MDRV_CPU_VBLANK_INT(compis_vblank_int | |
| 209 | MDRV_CPU_VBLANK_INT("main", compis_vblank_int | |
| 210 | 210 | MDRV_CPU_CONFIG(i86_address_mask) |
| 211 | 211 | |
| 212 | 212 | MDRV_INTERLEAVE(1) |
| r1877 | r1878 | |
|---|---|---|
| 75 | 75 | MDRV_MACHINE_START( bbcbc ) |
| 76 | 76 | MDRV_MACHINE_RESET( bbcbc ) |
| 77 | 77 | |
| 78 | MDRV_CPU_VBLANK_INT( bbcbc_interrupt | |
| 78 | MDRV_CPU_VBLANK_INT("main", bbcbc_interrupt | |
| 79 | 79 | MDRV_IMPORT_FROM( tms9928a ) |
| 80 | 80 | MDRV_SCREEN_MODIFY("main") |
| 81 | 81 | MDRV_SCREEN_REFRESH_RATE( 50 ) |
| r1877 | r1878 | |
|---|---|---|
| 447 | 447 | MDRV_CPU_ADD_TAG("main", Z80, 3694700) /* 3.694700 Mhz */ |
| 448 | 448 | MDRV_CPU_PROGRAM_MAP(vtech2_mem, 0) |
| 449 | 449 | MDRV_CPU_IO_MAP(vtech2_io, 0) |
| 450 | MDRV_CPU_VBLANK_INT(vtech2_interrupt | |
| 450 | MDRV_CPU_VBLANK_INT("main", vtech2_interrupt | |
| 451 | 451 | MDRV_SCREEN_ADD("main", RASTER) |
| 452 | 452 | MDRV_SCREEN_REFRESH_RATE(50) |
| 453 | 453 | MDRV_SCREEN_VBLANK_TIME(0) |
| r1877 | r1878 | |
|---|---|---|
| 46 | 46 | switch (port) |
| 47 | 47 | { |
| 48 | 48 | // case 0x080: |
| 49 | // return kc85_module_r(offset); | |
| 49 | // return kc85_module_r(machine, offset); | |
| 50 | 50 | |
| 51 | 51 | case 0x085: |
| 52 | 52 | case 0x084: |
| 53 | return kc85_4_84_r(offset); | |
| 53 | return kc85_4_84_r(machine, offset); | |
| 54 | 54 | |
| 55 | 55 | |
| 56 | 56 | case 0x086: |
| 57 | 57 | case 0x087: |
| 58 | return kc85_4_86_r(offset); | |
| 58 | return kc85_4_86_r(machine, offset); | |
| 59 | 59 | |
| 60 | 60 | case 0x088: |
| 61 | 61 | case 0x089: |
| 62 | return kc85_pio_data_r(port-0x088); | |
| 62 | return kc85_pio_data_r(machine, port-0x088); | |
| 63 | 63 | case 0x08a: |
| 64 | 64 | case 0x08b: |
| 65 | return kc85_pio_control_r(port-0x08a); | |
| 65 | return kc85_pio_control_r(machine, port-0x08a); | |
| 66 | 66 | case 0x08c: |
| 67 | 67 | case 0x08d: |
| 68 | 68 | case 0x08e: |
| 69 | 69 | case 0x08f: |
| 70 | return kc85_ctc_r(port-0x08c); | |
| 70 | return kc85_ctc_r(machine, port-0x08c); | |
| 71 | 71 | |
| 72 | 72 | } |
| 73 | 73 | |
| r1877 | r1878 | |
| 84 | 84 | switch (port) |
| 85 | 85 | { |
| 86 | 86 | // case 0x080: |
| 87 | // kc85_module_w(offset,data); | |
| 87 | // kc85_module_w(machine, offset,data); | |
| 88 | 88 | // return; |
| 89 | 89 | |
| 90 | 90 | case 0x085: |
| 91 | 91 | case 0x084: |
| 92 | kc85_4_84_w(offset,data); | |
| 92 | kc85_4_84_w(machine, offset,data); | |
| 93 | 93 | return; |
| 94 | 94 | |
| 95 | 95 | case 0x086: |
| 96 | 96 | case 0x087: |
| 97 | kc85_4_86_w(offset,data); | |
| 97 | kc85_4_86_w(machine, offset,data); | |
| 98 | 98 | return; |
| 99 | 99 | |
| 100 | 100 | case 0x088: |
| 101 | 101 | case 0x089: |
| 102 | kc85_4_pio_data_w(port-0x088, data); | |
| 102 | kc85_4_pio_data_w(machine, port-0x088, data); | |
| 103 | 103 | return; |
| 104 | 104 | |
| 105 | 105 | case 0x08a: |
| 106 | 106 | case 0x08b: |
| 107 | kc85_pio_control_w(port-0x08a, data); | |
| 107 | kc85_pio_control_w(machine, port-0x08a, data); | |
| 108 | 108 | return; |
| 109 | 109 | |
| 110 | 110 | case 0x08c: |
| 111 | 111 | case 0x08d: |
| 112 | 112 | case 0x08e: |
| 113 | 113 | case 0x08f: |
| 114 | kc85_ctc_w(port-0x08c, data); | |
| 114 | kc85_ctc_w(machine, port-0x08c, data); | |
| 115 | 115 | return; |
| 116 | 116 | } |
| 117 | 117 | |
| r1877 | r1878 | |
| 135 | 135 | switch (port) |
| 136 | 136 | { |
| 137 | 137 | case 0x080: |
| 138 | return kc85_module_r(offset); | |
| 138 | return kc85_module_r(machine, offset); | |
| 139 | 139 | |
| 140 | 140 | case 0x085: |
| 141 | 141 | case 0x084: |
| 142 | return kc85_4_84_r(offset); | |
| 142 | return kc85_4_84_r(machine, offset); | |
| 143 | 143 | |
| 144 | 144 | |
| 145 | 145 | case 0x086: |
| 146 | 146 | case 0x087: |
| 147 | return kc85_4_86_r(offset); | |
| 147 | return kc85_4_86_r(machine, offset); | |
| 148 | 148 | |
| 149 | 149 | case 0x088: |
| 150 | 150 | case 0x089: |
| 151 | return kc85_pio_data_r(port-0x088); | |
| 151 | return kc85_pio_data_r(machine, port-0x088); | |
| 152 | 152 | case 0x08a: |
| 153 | 153 | case 0x08b: |
| 154 | return kc85_pio_control_r(port-0x08a); | |
| 154 | return kc85_pio_control_r(machine, port-0x08a); | |
| 155 | 155 | case 0x08c: |
| 156 | 156 | case 0x08d: |
| 157 | 157 | case 0x08e: |
| 158 | 158 | case 0x08f: |
| 159 | return kc85_ctc_r(port-0x08c); | |
| 159 | return kc85_ctc_r(machine, port-0x08c); | |
| 160 | 160 | case 0x0f0: |
| 161 | 161 | case 0x0f1: |
| 162 | 162 | case 0x0f2: |
| 163 | 163 | case 0x0f3: |
| 164 | return kc85_disc_interface_ram_r(offset); | |
| 164 | return kc85_disc_interface_ram_r(machine, offset); | |
| 165 | 165 | |
| 166 | 166 | } |
| 167 | 167 | |
| r1877 | r1878 | |
| 255 | 255 | |
| 256 | 256 | case 0x088: |
| 257 | 257 | case 0x089: |
| 258 | return kc85_pio_data_r(port-0x088); | |
| 258 | return kc85_pio_data_r(machine, port-0x088); | |
| 259 | 259 | case 0x08a: |
| 260 | 260 | case 0x08b: |
| 261 | return kc85_pio_control_r(port-0x08a); | |
| 261 | return kc85_pio_control_r(machine, port-0x08a); | |
| 262 | 262 | case 0x08c: |
| 263 | 263 | case 0x08d: |
| 264 | 264 | case 0x08e: |
| 265 | 265 | case 0x08f: |
| 266 | return kc85_ctc_r(port-0x08c); | |
| 266 | return kc85_ctc_r(machine, port-0x08c); | |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | logerror("unhandled port r: %04x\n",offset); |
| r1877 | r1878 | |
| 284 | 284 | |
| 285 | 285 | case 0x088: |
| 286 | 286 | case 0x089: |
| 287 | kc85_3_pio_data_w(port-0x088, data); | |
| 287 | kc85_3_pio_data_w(machine, port-0x088, data); | |
| 288 | 288 | return; |
| 289 | 289 | |
| 290 | 290 | case 0x08a: |
| 291 | 291 | case 0x08b: |
| 292 | kc85_pio_control_w(port-0x08a, data); | |
| 292 | kc85_pio_control_w(machine, port-0x08a, data); | |
| 293 | 293 | return; |
| 294 | 294 | |
| 295 | 295 | case 0x08c: |
| 296 | 296 | case 0x08d: |
| 297 | 297 | case 0x08e: |
| 298 | 298 | case 0x08f: |
| 299 | kc85_ctc_w(port-0x08c, data); | |
| 299 | kc85_ctc_w(machine, port-0x08c, data); | |
| 300 | 300 | return; |
| 301 | 301 | } |
| 302 | 302 |
| r1877 | r1878 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | Source Changes: |
| 53 | 53 | ---------------- |
| 54 | - The core is based on MAME 0.123u | |
| 54 | - The core is based on MAME 0.123u4. This incorporates all features of the | |
| 55 | 55 | update to this core. [MAME team] |
| 56 | 56 | |
| 57 | 57 | - Updated the Motorola MC68901 Multi Function Peripheral to use the new |
| Previous | 15994 Revisions | Next |